fail
.description This has duplicate state names;
.inputs a b c;
.outputs x y z;
.states a a b;
000 01  10 101 ;
110 000 10 001 ;

fail
.description Duplicate state encoding exists ;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "000" "000" "111";
000 01  10 101 ;
110 000 10 001 ;

fail
.description Duplicate state encoding exists ;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "000" "001" "001";
000 01  10 101 ;
110 000 10 001 ;

fail
.description Duplicate state encoding exists ;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "000" "001" "000";
000 01  10 101 ;
110 000 10 001 ;

fail
.description Duplicate state encoding exists ;
.inputs a b c;
.outputs x y z;
.states a b c d;
.encodings "000" "001" "001" "111";
000 01  10 101 ;
110 000 10 001 ;

fail
.description Some rows have symbolic state names, some don't. ;
.inputs a b c;
.outputs x y z;
.states a b c ;
.encodings "000" "001" "111";
000 a b 101 ;
000 111;
fail
.description Shouldn't parse;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "000" "001" "111";
110  001 ;
000 a b 101 ;

fail
.description Duplicate input name ;
.inputs a a c;
.outputs x y z;
.encodings "000" "001" "111";
110  001 ;

fail
.description Duplicate input name ;
.inputs a c a;
.outputs x y z;
.encodings "000" "001" "111";
110  001 ;

fail
.description Duplicate input name ;
.inputs a c c;
.outputs x y z;
.encodings "000" "001" "111";
110  001 ;

fail
.description Duplicate output name ;
.inputs a b c;
.outputs x x z;
.encodings "000" "001" "111";
110  001 ;

fail
.description Duplicate output name ;
.inputs a b c;
.outputs x z x;
.encodings "000" "001" "111";
110  001 ;

fail
.description Duplicate output name ;
.inputs a b c;
.outputs x z z;
.encodings "000" "001" "111";
110  001 ;

fail
.description Case A: wrong # inputs ;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "000" "001" "111";
00 a b 101 ;

fail
.description Case A: wrong # outputs ;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "000" "001" "111";
000 a b 11 ;

fail
.description Case A: bogus state names ;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "000" "001" "111";
000 w b 110 ;

pass
.description Case A: don't care state names - should work OK ;
.inputs a b c;
.outputs x y z;
.states a b;
.encodings "000" "111";
1-- - a 101 ;
0-- a b 000;
0-- b a 000;

pass
.description Case A: don't care state names - should work OK;
.inputs a b c;
.outputs x y z;
.states a b ;
.encodings "000" "111";
1-- - a 101 ;
0-- a b 000;
0-- b a 000;
--- b - 101;

fail
.description Case B: combinational design - wrong number of inputs in truth table row ;
.inputs a b c;
.outputs x y z;
00  001 ;

fail
.description Case B: combinational design - wrong number of outputs in truth table row ;
.inputs a b c;
.outputs x y z;
000  01 ;

fail
.description This has duplicate state names;
.inputs a b c;
.outputs x y z;
.states a a b;
000 01  10 101 ;
110 000 10 001 ;

fail
.description Test of user-supplied encodings.  Should fail due to - in some of the encodings. ;
.inputs a b c;
.outputs x y z;
.states a b c ;
.encodings "01-0" "1110" "1010"
000 b a 101 ;
101 - b 001;
101 b - 001;
000 c a 100;

fail
.description Cannot supply encodings in type B file. ;
.inputs a b;
.outputs x y;
.states a b c ;
.encodings "010" "110" "100" ;
00101 00001;

fail
.description Cannot supply encodings in type B file;
.inputs a b;
.outputs x y;
.states a b c ;
.encodings "010" "110" "100" ;
0001 00001;

fail
.description Wrong output block size. ;
.inputs a b;
.outputs x y;
.statebits 2;
0010 000 ;


fail
.description State a is not collectively exhaustive. ;
.inputs a b;
.outputs x ;
.states a b  ;
.encodings default;
1- - a 0 ;
01 a b 1 ;
00 b b 0 ;
01 b a 1 ;


fail
.description State b is not collectively exhaustive. ;
.inputs a b;
.outputs x ;
.states a b  ;
.encodings default;
1- - a 0 ;
00 a a 1 ;
01 a b 1 ;
00 b b 0 ;


fail
.description Neither a nor b are collectively exhaustive ;
.inputs a b;
.outputs x ;
.states a b  ;
.encodings default;
00 a a 1 ;
01 a b 1 ;
00 b b 0 ;
01 b a 0 ;


fail
.description A is not mutually exclusive ;
.inputs a b;
.outputs x ;
.states a b  ;
.encodings default;
1- - a 0 ;
0- a a 1 ;
01 a b 1 ;
00 b b 0 ;
01 b a 0 ;


fail
.description A is not mutually exclusive ;
.inputs a b;
.outputs x ;
.states a b  ;
.encodings default;
1- - a 0 ;
10 a a 1 ;
01 a b 1 ;
00 b b 0 ;
01 b a 0 ;


fail
.description A is not mutually exclusive ;
.inputs a b;
.outputs x ;
.states a b  ;
.encodings default;
1- - a 0 ;
-0 a a 1 ;
01 a b 1 ;
00 b b 0 ;
01 b a 0 ;


fail
.description This has duplicate state names;
.inputs a b c;
.outputs x y z;
.states a b a;
000 01  10 101 ;
110 000 10 001 ;

fail
.description Wrong preamble - has states but is type B. ;
.inputs a b;
.outputs x ;
.states a b  ;
.encodings default;
1-  0 ;
-0  1 ;
01  1 ;
00  0 ;
01  0 ;


fail
.description Wrong preamble - has  state bits but doesn't include enough bits. ;
.inputs a b;
.outputs x ;
.statebits 2;
1-  0 ;
-0  1 ;
01  1 ;
00  0 ;
01  0 ;


fail
.description Wrong preamble - has  state bits and symbolic state names. ;
.inputs a b;
.outputs x ;
.statebits 2;
1- a b 0 ;
-0 a b  1 ;
01 b c 1 ;
00 d e 0 ;


fail
.description This has duplicate state names;
.inputs a b c;
.outputs x y z;
.states a b b;
000 01  10 101 ;
110 000 10 001 ;

fail
.description Fewer state encodings than state names. ;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "000" "010" ;
000 01  10 101 ;
110 000 10 001 ;

fail
.description Fewer state names than state encodings. ;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "000" "010" "111" "101";
000 01  10 101 ;
110 000 10 001 ;

fail
.description Not all encodings are same length ;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "00" "111" "101";
000 01  10 101 ;
110 000 10 001 ;

fail
.description Not all encodings are same length ;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "000" "11" "101";
000 01  10 101 ;
110 000 10 001 ;

fail
.description Not all encodings are same length ;
.inputs a b c;
.outputs x y z;
.states a b c;
.encodings "000" "111" "10";
000 01  10 101 ;
110 000 10 001 ;

pass
.description Purely combinational - no states.  Should be OK ;
.inputs a b c;
.outputs x y z;
000  101 ;
001  100  ;
110  001 ;

pass
.description Test of one hot encodings.  Should work OK. ;	
.inputs a b c;
.outputs x y z;
.states a b c ;
.encodings onehot;
1-- - a 000;
0-- a b 111;
0-- b c 010;
0-- c a 010;

pass
.description Test of default encodings.  Should work OK. ;	
.inputs a b c;
.outputs x y z;
.states a b c ;
.encodings default;
1-- - a 000;
0-- a b 111;
0-- b c 010;
0-- c a 010;


pass
.description Test of user-supplied encodings.  Should work OK. ;	
.inputs a b c;
.outputs x y z;
.states a b c ;
.encodings "0100" "1110" "1010" ;
1-- - a 000;
0-- a b 111;
0-- b c 010;
0-- c a 010;


pass
.description Test of splitting out CS and NS in case B files ;
.inputs a b c;
.outputs x y z;
.statebits 2;
00001 10101 ;
10110 01001;
10101 01001;
00011 10100;

pass
.description Consistency checking = should be OK ;
.inputs a b;
.outputs x ;
.states a b  ;
.encodings default;
1- - a 0 ;
00 a a 0 ;
01 a b 1 ;
00 b b 0 ;
01 b a 1 ;


pass
.description Another test of splitting out state bits.  Should be OK. ;
.inputs reset inputac inputbd ;
.outputs s1 s0 o1 o2 ;
.statebits  2;
1---- 000000 ;
00-00 000000 ;
01-00 010000 ;
0-001 010110 ;
0-101 100110 ;
00-10 101000 ;
01-10 111000 ;
0-011 111100 ;
0-111 001101 ;
