mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-19 01:44:44 -04:00
adds processor tests for io instructions
This commit is contained in:
parent
a3f9592a91
commit
11494ca1f3
255
src/main/dig/processor/IO/TestOut.dig
Normal file
255
src/main/dig/processor/IO/TestOut.dig
Normal file
@ -0,0 +1,255 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<circuit>
|
||||
<version>1</version>
|
||||
<attributes>
|
||||
<entry>
|
||||
<string>isGeneric</string>
|
||||
<boolean>true</boolean>
|
||||
</entry>
|
||||
</attributes>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
<elementName>Register</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>valueIsProbe</string>
|
||||
<boolean>true</boolean>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>*</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="440" y="260"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Out</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="540" y="280"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>A</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="200" y="320"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>D</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="200" y="240"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Comparator</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="240" y="320"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Const</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>generic</string>
|
||||
<string>this.Value=args.addr;</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="220" y="340"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>w</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="200" y="380"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>And</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="340" y="340"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>r</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="200" y="140"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>GenericInitCode</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>generic</string>
|
||||
<string>addr:=2;</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="440" y="340"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Driver</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation rotation="2"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>flipSelPos</string>
|
||||
<boolean>true</boolean>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="460" y="180"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>And</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="340" y="140"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Clock</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>C</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="200" y="280"/>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="200" y="240"/>
|
||||
<p2 x="420" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="320"/>
|
||||
<p2 x="240" y="320"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="160"/>
|
||||
<p2 x="460" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="260"/>
|
||||
<p2 x="440" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="340"/>
|
||||
<p2 x="320" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="220" y="340"/>
|
||||
<p2 x="240" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="320" y="340"/>
|
||||
<p2 x="340" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="480" y="180"/>
|
||||
<p2 x="520" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="180"/>
|
||||
<p2 x="440" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="320" y="180"/>
|
||||
<p2 x="340" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="280"/>
|
||||
<p2 x="520" y="280"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="280"/>
|
||||
<p2 x="440" y="280"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="280"/>
|
||||
<p2 x="540" y="280"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="360"/>
|
||||
<p2 x="420" y="360"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="300"/>
|
||||
<p2 x="440" y="300"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="380"/>
|
||||
<p2 x="340" y="380"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="140"/>
|
||||
<p2 x="340" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="320" y="180"/>
|
||||
<p2 x="320" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="180"/>
|
||||
<p2 x="420" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="300"/>
|
||||
<p2 x="420" y="360"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="240"/>
|
||||
<p2 x="420" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="180"/>
|
||||
<p2 x="520" y="280"/>
|
||||
</wire>
|
||||
</wires>
|
||||
<measurementOrdering/>
|
||||
</circuit>
|
@ -11,6 +11,10 @@ It is a Harvard single-cycle CPU.
|
||||
angelehnt ist. Es handelt sich um eine Harvard
|
||||
Single-Cycle CPU.}}</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Width</string>
|
||||
<int>4</int>
|
||||
</entry>
|
||||
</attributes>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
@ -167,7 +171,7 @@ Single-Cycle CPU.}}</string>
|
||||
<int>2147483647</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1140" y="600"/>
|
||||
<pos x="1120" y="460"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Driver</elementName>
|
||||
@ -599,7 +603,7 @@ Single-Cycle CPU.}}</string>
|
||||
<string>C</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1160" y="600"/>
|
||||
<pos x="1140" y="460"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Tunnel</elementName>
|
||||
@ -802,6 +806,190 @@ c11,c21,8014,2020,38eb,c31,8014,2030,38e6,1991,ffff,3e09,146,165,154,4400,3ddb,a
|
||||
</elementAttributes>
|
||||
<pos x="840" y="380"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Description</string>
|
||||
<string>Address bus
|
||||
{{de Adressbus}}</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>A</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1320" y="460"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Description</string>
|
||||
<string>Data Bus
|
||||
{{de Datenbus}}</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>D</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1320" y="500"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Tunnel</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>NetName</string>
|
||||
<string>A</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1200" y="40"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Tunnel</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation rotation="2"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>NetName</string>
|
||||
<string>A</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1300" y="460"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Tunnel</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation rotation="2"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>NetName</string>
|
||||
<string>D</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1420" y="40"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Tunnel</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation rotation="2"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>NetName</string>
|
||||
<string>D</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1300" y="500"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Tunnel</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation rotation="2"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>NetName</string>
|
||||
<string>ioW</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1300" y="540"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Description</string>
|
||||
<string>io write enable
|
||||
{{de IO Schreibfreigabe}}</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>ioW</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1320" y="540"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Tunnel</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation rotation="2"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>NetName</string>
|
||||
<string>ioR</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1300" y="580"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Description</string>
|
||||
<string>io read enable
|
||||
{{de IO Lesefreigabe}}</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>ioR</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1320" y="580"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Rectangle</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>RectHeight</string>
|
||||
<int>10</int>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Outputs</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>RectWidth</string>
|
||||
<int>9</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1240" y="420"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Rectangle</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>RectHeight</string>
|
||||
<int>10</int>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Inputs</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>RectWidth</string>
|
||||
<int>9</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1000" y="420"/>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
@ -828,6 +1016,10 @@ c11,c21,8014,2020,38eb,c31,8014,2030,38e6,1991,ffff,3e09,146,165,154,4400,3ddb,a
|
||||
<p1 x="1340" y="260"/>
|
||||
<p2 x="1360" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1300" y="580"/>
|
||||
<p2 x="1320" y="580"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="760" y="520"/>
|
||||
<p2 x="820" y="520"/>
|
||||
@ -840,6 +1032,14 @@ c11,c21,8014,2020,38eb,c31,8014,2030,38e6,1991,ffff,3e09,146,165,154,4400,3ddb,a
|
||||
<p1 x="800" y="460"/>
|
||||
<p2 x="860" y="460"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1120" y="460"/>
|
||||
<p2 x="1140" y="460"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1300" y="460"/>
|
||||
<p2 x="1320" y="460"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="620" y="140"/>
|
||||
<p2 x="640" y="140"/>
|
||||
@ -912,10 +1112,6 @@ c11,c21,8014,2020,38eb,c31,8014,2030,38e6,1991,ffff,3e09,146,165,154,4400,3ddb,a
|
||||
<p1 x="360" y="20"/>
|
||||
<p2 x="1180" y="20"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1140" y="600"/>
|
||||
<p2 x="1160" y="600"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1000" y="280"/>
|
||||
<p2 x="1060" y="280"/>
|
||||
@ -929,13 +1125,17 @@ c11,c21,8014,2020,38eb,c31,8014,2030,38e6,1991,ffff,3e09,146,165,154,4400,3ddb,a
|
||||
<p2 x="1440" y="280"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="320" y="220"/>
|
||||
<p2 x="500" y="220"/>
|
||||
<p1 x="1300" y="540"/>
|
||||
<p2 x="1320" y="540"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="760" y="540"/>
|
||||
<p2 x="840" y="540"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="320" y="220"/>
|
||||
<p2 x="500" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="820" y="480"/>
|
||||
<p2 x="860" y="480"/>
|
||||
@ -1008,6 +1208,14 @@ c11,c21,8014,2020,38eb,c31,8014,2030,38e6,1991,ffff,3e09,146,165,154,4400,3ddb,a
|
||||
<p1 x="800" y="360"/>
|
||||
<p2 x="860" y="360"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1180" y="40"/>
|
||||
<p2 x="1200" y="40"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1420" y="40"/>
|
||||
<p2 x="1440" y="40"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="300"/>
|
||||
<p2 x="940" y="300"/>
|
||||
@ -1028,6 +1236,10 @@ c11,c21,8014,2020,38eb,c31,8014,2030,38e6,1991,ffff,3e09,146,165,154,4400,3ddb,a
|
||||
<p1 x="1280" y="240"/>
|
||||
<p2 x="1360" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1300" y="500"/>
|
||||
<p2 x="1320" y="500"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="760" y="500"/>
|
||||
<p2 x="800" y="500"/>
|
||||
@ -1200,18 +1412,22 @@ c11,c21,8014,2020,38eb,c31,8014,2030,38e6,1991,ffff,3e09,146,165,154,4400,3ddb,a
|
||||
<p1 x="540" y="120"/>
|
||||
<p2 x="540" y="420"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1180" y="0"/>
|
||||
<p2 x="1180" y="20"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1180" y="-60"/>
|
||||
<p2 x="1180" y="-40"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1180" y="20"/>
|
||||
<p1 x="1180" y="0"/>
|
||||
<p2 x="1180" y="20"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1180" y="40"/>
|
||||
<p2 x="1180" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1180" y="20"/>
|
||||
<p2 x="1180" y="40"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="860" y="100"/>
|
||||
<p2 x="860" y="120"/>
|
||||
@ -1242,6 +1458,10 @@ c11,c21,8014,2020,38eb,c31,8014,2030,38e6,1991,ffff,3e09,146,165,154,4400,3ddb,a
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1440" y="-60"/>
|
||||
<p2 x="1440" y="40"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1440" y="40"/>
|
||||
<p2 x="1440" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -39,8 +39,8 @@ public class TestExamples extends TestCase {
|
||||
*/
|
||||
public void testDistExamples() throws Exception {
|
||||
File examples = new File(Resources.getRoot().getParentFile().getParentFile(), "/main/dig");
|
||||
assertEquals(301, new FileScanner(this::check).scan(examples));
|
||||
assertEquals(325, testCasesInFiles);
|
||||
assertEquals(302, new FileScanner(this::check).scan(examples));
|
||||
assertEquals(331, testCasesInFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user