mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-18 09:24:42 -04:00
ensure examples a buildable
This commit is contained in:
parent
bbe382990e
commit
25e6d6d420
@ -1,248 +1,324 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<circuit>
|
||||
<version>1</version>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
<elementName>Multiply.dig</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="340" y="120"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Seven-Seg-Hex</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="280" y="-80"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Seven-Seg-Hex</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="120" y="-80"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Seven-Seg-Hex</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="540" y="-80"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Seven-Seg-Hex</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="460" y="-80"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>P</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>4</int>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Default</string>
|
||||
<int>4</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="120" y="120"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>4</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>1*4</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="280" y="120"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>4</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>1*4</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="280" y="200"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Q</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>4</int>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Default</string>
|
||||
<int>9</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="120" y="200"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>1*4</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>4</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="460" y="120"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>1*4</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>4</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="460" y="200"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="300" y="160"/>
|
||||
<p2 x="340" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="160"/>
|
||||
<p2 x="460" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="240"/>
|
||||
<p2 x="340" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="240"/>
|
||||
<p2 x="460" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="220" y="80"/>
|
||||
<p2 x="340" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="180"/>
|
||||
<p2 x="340" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="180"/>
|
||||
<p2 x="460" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="260"/>
|
||||
<p2 x="340" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="260"/>
|
||||
<p2 x="460" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="120"/>
|
||||
<p2 x="340" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="120" y="120"/>
|
||||
<p2 x="220" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="480" y="120"/>
|
||||
<p2 x="600" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="120"/>
|
||||
<p2 x="460" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="220" y="120"/>
|
||||
<p2 x="280" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="200"/>
|
||||
<p2 x="340" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="120" y="200"/>
|
||||
<p2 x="180" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="200"/>
|
||||
<p2 x="460" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="480" y="200"/>
|
||||
<p2 x="520" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="180" y="200"/>
|
||||
<p2 x="280" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="140"/>
|
||||
<p2 x="340" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="140"/>
|
||||
<p2 x="460" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="220"/>
|
||||
<p2 x="340" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="220"/>
|
||||
<p2 x="460" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="340" y="60"/>
|
||||
<p2 x="340" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="180" y="60"/>
|
||||
<p2 x="180" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="600" y="60"/>
|
||||
<p2 x="600" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="60"/>
|
||||
<p2 x="520" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="220" y="80"/>
|
||||
<p2 x="220" y="120"/>
|
||||
</wire>
|
||||
</wires>
|
||||
<version>1</version>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
<elementName>Multiply.dig</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="340" y="120"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Seven-Seg-Hex</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="300" y="-80"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Seven-Seg-Hex</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="140" y="-80"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Seven-Seg-Hex</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="560" y="-80"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Seven-Seg-Hex</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="480" y="-80"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>P</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>4</int>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Default</string>
|
||||
<int>4</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="120" y="120"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>4</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>1*4</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="280" y="120"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>4</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>1*4</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="280" y="200"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Q</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>4</int>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Default</string>
|
||||
<int>9</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="120" y="200"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>1*4</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>4</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="460" y="120"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>1*4</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>4</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="460" y="200"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Const</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation rotation="1"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Value</string>
|
||||
<int>0</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="200" y="80"/>
|
||||
<rotate>1</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Const</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation reference="../../../../visualElement[12]/elementAttributes/entry/rotation"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Value</string>
|
||||
<int>0</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="360" y="80"/>
|
||||
<rotate>1</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Const</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation reference="../../../../visualElement[12]/elementAttributes/entry/rotation"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Value</string>
|
||||
<int>0</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="540" y="80"/>
|
||||
<rotate>1</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Const</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation reference="../../../../visualElement[12]/elementAttributes/entry/rotation"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Value</string>
|
||||
<int>0</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="620" y="80"/>
|
||||
<rotate>1</rotate>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="300" y="160"/>
|
||||
<p2 x="340" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="160"/>
|
||||
<p2 x="460" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="240"/>
|
||||
<p2 x="340" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="240"/>
|
||||
<p2 x="460" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="220" y="80"/>
|
||||
<p2 x="340" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="180"/>
|
||||
<p2 x="340" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="180"/>
|
||||
<p2 x="460" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="260"/>
|
||||
<p2 x="340" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="260"/>
|
||||
<p2 x="460" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="120"/>
|
||||
<p2 x="340" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="120" y="120"/>
|
||||
<p2 x="220" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="480" y="120"/>
|
||||
<p2 x="600" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="120"/>
|
||||
<p2 x="460" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="220" y="120"/>
|
||||
<p2 x="280" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="200"/>
|
||||
<p2 x="340" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="120" y="200"/>
|
||||
<p2 x="180" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="200"/>
|
||||
<p2 x="460" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="480" y="200"/>
|
||||
<p2 x="520" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="180" y="200"/>
|
||||
<p2 x="280" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="140"/>
|
||||
<p2 x="340" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="140"/>
|
||||
<p2 x="460" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="300" y="220"/>
|
||||
<p2 x="340" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="220"/>
|
||||
<p2 x="460" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="340" y="60"/>
|
||||
<p2 x="340" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="180" y="60"/>
|
||||
<p2 x="180" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="600" y="60"/>
|
||||
<p2 x="600" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="60"/>
|
||||
<p2 x="520" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="60"/>
|
||||
<p2 x="200" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="60"/>
|
||||
<p2 x="360" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="220" y="80"/>
|
||||
<p2 x="220" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="60"/>
|
||||
<p2 x="540" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="620" y="60"/>
|
||||
<p2 x="620" y="80"/>
|
||||
</wire>
|
||||
</wires>
|
||||
</circuit>
|
@ -1,91 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<circuit>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Di</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Default</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="160" y="100"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>16</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>8,8</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="190" y="100"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>8,8</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>16</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="260" y="110"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Do</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="310" y="110"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="160" y="100"/>
|
||||
<p2 x="190" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="100"/>
|
||||
<p2 x="230" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="230" y="120"/>
|
||||
<p2 x="260" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="270" y="110"/>
|
||||
<p2 x="310" y="110"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="110"/>
|
||||
<p2 x="260" y="110"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="230" y="100"/>
|
||||
<p2 x="230" y="120"/>
|
||||
</wire>
|
||||
</wires>
|
||||
<version>1</version>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Di</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Default</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="320" y="200"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>16</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>8,8</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="380" y="200"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>8,8</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>16</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="520" y="220"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Do</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="620" y="220"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="460" y="240"/>
|
||||
<p2 x="520" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="320" y="200"/>
|
||||
<p2 x="380" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="200"/>
|
||||
<p2 x="460" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="220"/>
|
||||
<p2 x="620" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="220"/>
|
||||
<p2 x="520" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="460" y="200"/>
|
||||
<p2 x="460" y="240"/>
|
||||
</wire>
|
||||
</wires>
|
||||
</circuit>
|
@ -1,107 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<circuit>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Di</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Default</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="160" y="100"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>16</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>4,4,4,4</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="190" y="100"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>4,4,4,4</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>16</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="270" y="110"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Do</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="310" y="110"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="200" y="130"/>
|
||||
<p2 x="270" y="130"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="160" y="100"/>
|
||||
<p2 x="190" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="100"/>
|
||||
<p2 x="240" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="240" y="120"/>
|
||||
<p2 x="270" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="120"/>
|
||||
<p2 x="230" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="230" y="140"/>
|
||||
<p2 x="270" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="280" y="110"/>
|
||||
<p2 x="310" y="110"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="110"/>
|
||||
<p2 x="270" y="110"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="240" y="100"/>
|
||||
<p2 x="240" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="230" y="120"/>
|
||||
<p2 x="230" y="140"/>
|
||||
</wire>
|
||||
</wires>
|
||||
<version>1</version>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Di</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Default</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="320" y="200"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>16</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>4,4,4,4</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="380" y="200"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Splitter</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Input Splitting</string>
|
||||
<string>4,4,4,4</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Output Splitting</string>
|
||||
<string>16</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="540" y="220"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Do</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="620" y="220"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="480" y="240"/>
|
||||
<p2 x="540" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="240"/>
|
||||
<p2 x="460" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="260"/>
|
||||
<p2 x="540" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="320" y="200"/>
|
||||
<p2 x="380" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="200"/>
|
||||
<p2 x="480" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="460" y="280"/>
|
||||
<p2 x="540" y="280"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="560" y="220"/>
|
||||
<p2 x="620" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="220"/>
|
||||
<p2 x="540" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="480" y="200"/>
|
||||
<p2 x="480" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="460" y="240"/>
|
||||
<p2 x="460" y="280"/>
|
||||
</wire>
|
||||
</wires>
|
||||
</circuit>
|
@ -0,0 +1,63 @@
|
||||
package de.neemann.digital.integration;
|
||||
|
||||
import de.neemann.digital.core.NodeException;
|
||||
import de.neemann.digital.draw.elements.PinException;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Reads all examples and tries to create the model.
|
||||
* Makes sure that all examples are creatable (one can build the model)
|
||||
* Does not ensure that they work correctly!
|
||||
*
|
||||
* @author hneemann
|
||||
*/
|
||||
public class TestExamples extends TestCase {
|
||||
|
||||
public void testExamples() throws Exception {
|
||||
File res = Resources.getRoot();
|
||||
File src = res.getParentFile().getParentFile();
|
||||
File examples = new File(src, "/main/dig");
|
||||
assertEquals(17, scan(new File(examples, "combinatorial")));
|
||||
assertEquals(18, scan(new File(examples, "sequential")));
|
||||
assertEquals(16, scan(new File(examples, "processor")));
|
||||
assertEquals(4, scan(new File(examples, "hazard")));
|
||||
}
|
||||
|
||||
private int scan(File path) {
|
||||
int count = 0;
|
||||
File[] files = path.listFiles();
|
||||
if (files != null) {
|
||||
for (File f : files) {
|
||||
if (f.isDirectory()) {
|
||||
if (f.getName().charAt(0) != '.') {
|
||||
count += scan(f);
|
||||
}
|
||||
} else {
|
||||
if (f.getName().endsWith(".dig")) {
|
||||
check(f);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the model and initializes it
|
||||
*
|
||||
* @param dig the model file
|
||||
*/
|
||||
private void check(File dig) {
|
||||
try {
|
||||
new ToBreakRunner(dig);
|
||||
assertTrue(true);
|
||||
} catch (PinException | NodeException | IOException e) {
|
||||
assertTrue(dig.getPath() + ": " + e.getMessage(), false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -36,7 +36,18 @@ public class ToBreakRunner {
|
||||
* @throws NodeException
|
||||
*/
|
||||
public ToBreakRunner(String file) throws IOException, PinException, NodeException {
|
||||
File filename = new File(Resources.getRoot(), file);
|
||||
this(new File(Resources.getRoot(), file));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new instance
|
||||
*
|
||||
* @param filename the file to load
|
||||
* @throws IOException
|
||||
* @throws PinException
|
||||
* @throws NodeException
|
||||
*/
|
||||
public ToBreakRunner(File filename) throws IOException, PinException, NodeException {
|
||||
ElementLibrary library = new ElementLibrary();
|
||||
ShapeFactory shapeFactory = new ShapeFactory(library);
|
||||
circuit = Circuit.loadCircuit(filename, shapeFactory);
|
||||
@ -46,8 +57,6 @@ public class ToBreakRunner {
|
||||
ModelDescription md = new ModelDescription(circuit, library);
|
||||
model = md.createModel();
|
||||
model.init(true);
|
||||
|
||||
assertTrue(model.isFastRunModel());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -58,6 +67,7 @@ public class ToBreakRunner {
|
||||
* @throws NodeException
|
||||
*/
|
||||
public ToBreakRunner runToBreak(int steps) throws NodeException {
|
||||
assertTrue(model.isFastRunModel());
|
||||
assertEquals(steps, model.runToBreak());
|
||||
return this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user