diff --git a/src/test/java/de/neemann/digital/integration/TestExamples.java b/src/test/java/de/neemann/digital/integration/TestExamples.java index d24431414..2ba6b0e51 100644 --- a/src/test/java/de/neemann/digital/integration/TestExamples.java +++ b/src/test/java/de/neemann/digital/integration/TestExamples.java @@ -45,8 +45,8 @@ public class TestExamples extends TestCase { public void testTestExamples() throws Exception { File examples = new File(Resources.getRoot(), "/dig/test"); testCasesInFiles = 0; - assertEquals(137, new FileScanner(TestExamples::check).scan(examples)); - assertEquals(129, testCasesInFiles); + assertEquals(139, new FileScanner(TestExamples::check).scan(examples)); + assertEquals(131, testCasesInFiles); } /** diff --git a/src/test/resources/dig/test/shapes/4BitAdder.dig b/src/test/resources/dig/test/shapes/4BitAdder.dig new file mode 100644 index 000000000..ef9856ffd --- /dev/null +++ b/src/test/resources/dig/test/shapes/4BitAdder.dig @@ -0,0 +1,256 @@ + + + 1 + + + shapeType + LAYOUT + + + + + Splitter + + + splitterSpreading + 4 + + + Input Splitting + 1*5 + + + Output Splitting + 5 + + + + + + Splitter + + + splitterSpreading + 4 + + + Input Splitting + 4 + + + Output Splitting + 1*4 + + + + + + Splitter + + + splitterSpreading + 4 + + + Input Splitting + 4 + + + Output Splitting + 1*4 + + + + + + In + + + Label + A + + + Bits + 4 + + + + + + In + + + Label + B + + + Bits + 4 + + + + + + Out + + + Label + S + + + Bits + 5 + + + + + + In + + + Label + c_i + + + + + + Adder.dig + + + + + Adder.dig + + + + + Adder.dig + + + + + Adder.dig + + + + + Testcase + + + Testdata + + A B c_i S +loop (a,16) +loop (b,16) +loop (c,2) +(a) (b) (c) (a+b+c) +end loop +end loop +end loop + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/dig/test/shapes/Adder.dig b/src/test/resources/dig/test/shapes/Adder.dig new file mode 100644 index 000000000..4241007f6 --- /dev/null +++ b/src/test/resources/dig/test/shapes/Adder.dig @@ -0,0 +1,250 @@ + + + 1 + + + shapeType + LAYOUT + + + Width + 5 + + + + + XOr + + + + + And + + + + + In + + + Label + A + + + + + + In + + + Label + B + + + + + + XOr + + + + + And + + + + + In + + + Description + carry in + + + rotation + + + + Label + c_i + + + + + + Out + + + Description + sum + + + Label + S + + + + + + Or + + + rotation + + + + + + + Out + + + Description + carry out + + + rotation + + + + Label + c_o + + + + + + Testcase + + + Testdata + + A B c_i c_o S +loop (a,2) +loop (b,2) +loop (c,2) +(a) (b) (c) bits(2,a+b+c) +end loop +end loop +end loop + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file