mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-26 22:41:59 -04:00
added a debounce test case
This commit is contained in:
parent
9a30558a94
commit
f7b4dc504e
@ -36,7 +36,7 @@ public class TestInSimulator extends TestCase {
|
|||||||
File examples = new File(Resources.getRoot(), "/dig/test/vhdl");
|
File examples = new File(Resources.getRoot(), "/dig/test/vhdl");
|
||||||
try {
|
try {
|
||||||
int tested = new FileScanner(this::check).scan(examples);
|
int tested = new FileScanner(this::check).scan(examples);
|
||||||
assertEquals(16, tested);
|
assertEquals(17, tested);
|
||||||
assertEquals(tested, testBenches);
|
assertEquals(tested, testBenches);
|
||||||
} catch (FileScanner.SkipAllException e) {
|
} catch (FileScanner.SkipAllException e) {
|
||||||
// if ghdl is not installed its also ok
|
// if ghdl is not installed its also ok
|
||||||
|
217
src/test/resources/dig/test/vhdl/debounce.dig
Normal file
217
src/test/resources/dig/test/vhdl/debounce.dig
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<circuit>
|
||||||
|
<version>1</version>
|
||||||
|
<attributes/>
|
||||||
|
<visualElements>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>D_FF</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="280" y="200"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>In</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>in</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="240" y="200"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Clock</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>Clk</string>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<string>Frequency</string>
|
||||||
|
<int>10</int>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<string>runRealTime</string>
|
||||||
|
<boolean>true</boolean>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="240" y="380"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>D_FF</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="400" y="200"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>XOr</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="500" y="300"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Counter</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Bits</string>
|
||||||
|
<int>4</int>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="600" y="280"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Register</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="720" y="200"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Out</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>out</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="800" y="220"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>VDD</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="580" y="260"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Testcase</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Testdata</string>
|
||||||
|
<testData>
|
||||||
|
<dataString> Clk in out
|
||||||
|
repeat(17) C 1 x
|
||||||
|
C 1 1
|
||||||
|
|
||||||
|
loop(n,32)
|
||||||
|
C 0 1
|
||||||
|
C 1 1
|
||||||
|
end loop
|
||||||
|
|
||||||
|
repeat(17) C 0 1
|
||||||
|
C 0 0
|
||||||
|
</dataString>
|
||||||
|
</testData>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="740" y="340"/>
|
||||||
|
</visualElement>
|
||||||
|
</visualElements>
|
||||||
|
<wires>
|
||||||
|
<wire>
|
||||||
|
<p1 x="680" y="240"/>
|
||||||
|
<p2 x="720" y="240"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="560" y="320"/>
|
||||||
|
<p2 x="600" y="320"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="380" y="340"/>
|
||||||
|
<p2 x="500" y="340"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="580" y="280"/>
|
||||||
|
<p2 x="600" y="280"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="240" y="200"/>
|
||||||
|
<p2 x="280" y="200"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="340" y="200"/>
|
||||||
|
<p2 x="380" y="200"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="460" y="200"/>
|
||||||
|
<p2 x="480" y="200"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="480" y="200"/>
|
||||||
|
<p2 x="720" y="200"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="380" y="200"/>
|
||||||
|
<p2 x="400" y="200"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="660" y="300"/>
|
||||||
|
<p2 x="680" y="300"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="580" y="300"/>
|
||||||
|
<p2 x="600" y="300"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="480" y="300"/>
|
||||||
|
<p2 x="500" y="300"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="240" y="380"/>
|
||||||
|
<p2 x="260" y="380"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="360" y="380"/>
|
||||||
|
<p2 x="580" y="380"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="260" y="380"/>
|
||||||
|
<p2 x="360" y="380"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="580" y="380"/>
|
||||||
|
<p2 x="700" y="380"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="700" y="220"/>
|
||||||
|
<p2 x="720" y="220"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="780" y="220"/>
|
||||||
|
<p2 x="800" y="220"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="260" y="220"/>
|
||||||
|
<p2 x="280" y="220"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="360" y="220"/>
|
||||||
|
<p2 x="400" y="220"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="480" y="200"/>
|
||||||
|
<p2 x="480" y="300"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="260" y="220"/>
|
||||||
|
<p2 x="260" y="380"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="580" y="300"/>
|
||||||
|
<p2 x="580" y="380"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="580" y="260"/>
|
||||||
|
<p2 x="580" y="280"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="360" y="220"/>
|
||||||
|
<p2 x="360" y="380"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="680" y="240"/>
|
||||||
|
<p2 x="680" y="300"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="700" y="220"/>
|
||||||
|
<p2 x="700" y="380"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="380" y="200"/>
|
||||||
|
<p2 x="380" y="340"/>
|
||||||
|
</wire>
|
||||||
|
</wires>
|
||||||
|
</circuit>
|
Loading…
x
Reference in New Issue
Block a user