fixed a bug in library IC 74198

This commit is contained in:
hneemann 2018-01-24 18:20:21 +01:00
parent b55f504540
commit 397707391b
8 changed files with 244 additions and 133 deletions

View File

@ -7,6 +7,7 @@ HEAD, planned as v0.17
- Added an "export to zip" function.
- Bug fixes
- Splitter, BarrelShifter and Comparator now are working with 64 bit.
- fixed a bug in library IC 74198
v0.16, released on 02. Jan 2018
- RAM components and EEPROM now allow an input invert configuration.

View File

@ -213,7 +213,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>10</int>
<string>10</string>
</entry>
</elementAttributes>
<pos x="-360" y="-100"/>
@ -231,7 +231,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>5</int>
<string>5</string>
</entry>
</elementAttributes>
<pos x="-320" y="-100"/>
@ -249,7 +249,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>4</int>
<string>4</string>
</entry>
</elementAttributes>
<pos x="-280" y="-100"/>
@ -267,7 +267,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>3</int>
<string>3</string>
</entry>
</elementAttributes>
<pos x="-240" y="-100"/>
@ -285,7 +285,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>2</int>
<string>2</string>
</entry>
</elementAttributes>
<pos x="-200" y="-100"/>
@ -303,7 +303,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>1</int>
<string>1</string>
</entry>
</elementAttributes>
<pos x="-160" y="-100"/>
@ -321,7 +321,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>13</int>
<string>13</string>
</entry>
</elementAttributes>
<pos x="-120" y="-100"/>
@ -339,7 +339,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>12</int>
<string>12</string>
</entry>
</elementAttributes>
<pos x="-80" y="-100"/>
@ -357,7 +357,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>11</int>
<string>11</string>
</entry>
</elementAttributes>
<pos x="-40" y="-100"/>
@ -371,7 +371,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>9</int>
<string>9</string>
</entry>
<entry>
<string>Inputs</string>
@ -389,7 +389,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>7</int>
<string>7</string>
</entry>
<entry>
<string>Inputs</string>
@ -407,7 +407,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>6</int>
<string>6</string>
</entry>
<entry>
<string>Inputs</string>
@ -425,7 +425,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>14</int>
<string>14</string>
</entry>
<entry>
<string>Inputs</string>
@ -448,7 +448,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>16</int>
<string>16</string>
</entry>
<entry>
<string>InDefault</string>
@ -466,11 +466,34 @@
</entry>
<entry>
<string>pinNumber</string>
<int>8</int>
<string>8</string>
</entry>
</elementAttributes>
<pos x="260" y="-60"/>
</visualElement>
<visualElement>
<elementName>Testcase</elementName>
<elementAttributes>
<entry>
<string>Testdata</string>
<testData>
<dataString>I1 I2 I3 I4 I5 I6 I7 I8 I9 D C B A
1 1 1 1 1 1 1 1 1 1 1 1 1
x x x x x x x x 0 0 1 1 0
x x x x x x x 0 1 0 1 1 1
x x x x x x 0 1 1 1 0 0 0
x x x x x 0 1 1 1 1 0 0 1
x x x x 0 1 1 1 1 1 0 1 0
x x x 0 1 1 1 1 1 1 0 1 1
x x 0 1 1 1 1 1 1 1 1 0 0
x 0 1 1 1 1 1 1 1 1 1 0 1
0 1 1 1 1 1 1 1 1 1 1 1 0
</dataString>
</testData>
</entry>
</elementAttributes>
<pos x="260" y="80"/>
</visualElement>
</visualElements>
<wires>
<wire>

View File

@ -25,7 +25,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>6</int>
<string>6</string>
</entry>
<entry>
<string>Inputs</string>
@ -58,7 +58,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>7</int>
<string>7</string>
</entry>
<entry>
<string>Inputs</string>
@ -116,7 +116,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>9</int>
<string>9</string>
</entry>
<entry>
<string>Inputs</string>
@ -179,7 +179,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>14</int>
<string>14</string>
</entry>
<entry>
<string>Inputs</string>
@ -212,7 +212,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>15</int>
<string>15</string>
</entry>
<entry>
<string>Inputs</string>
@ -244,7 +244,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>5</int>
<string>5</string>
</entry>
</elementAttributes>
<pos x="-360" y="-100"/>
@ -262,7 +262,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>10</int>
<string>10</string>
</entry>
</elementAttributes>
<pos x="-320" y="-100"/>
@ -290,7 +290,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>11</int>
<string>11</string>
</entry>
</elementAttributes>
<pos x="-280" y="-100"/>
@ -318,7 +318,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>12</int>
<string>12</string>
</entry>
</elementAttributes>
<pos x="-240" y="-100"/>
@ -346,7 +346,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>13</int>
<string>13</string>
</entry>
</elementAttributes>
<pos x="-200" y="-100"/>
@ -374,7 +374,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>1</int>
<string>1</string>
</entry>
</elementAttributes>
<pos x="-160" y="-100"/>
@ -402,7 +402,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>2</int>
<string>2</string>
</entry>
</elementAttributes>
<pos x="-120" y="-100"/>
@ -430,7 +430,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>3</int>
<string>3</string>
</entry>
</elementAttributes>
<pos x="-80" y="-100"/>
@ -458,7 +458,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>4</int>
<string>4</string>
</entry>
</elementAttributes>
<pos x="-40" y="-100"/>
@ -487,7 +487,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>16</int>
<string>16</string>
</entry>
<entry>
<string>InDefault</string>
@ -505,11 +505,34 @@
</entry>
<entry>
<string>pinNumber</string>
<int>8</int>
<string>8</string>
</entry>
</elementAttributes>
<pos x="200" y="-80"/>
</visualElement>
<visualElement>
<elementName>Testcase</elementName>
<elementAttributes>
<entry>
<string>Testdata</string>
<testData>
<dataString>EI 0 1 2 3 4 5 6 7 A2 A1 A0 GS E0
1 x x x x x x x x 1 1 1 1 1
0 1 1 1 1 1 1 1 1 1 1 1 1 0
0 x x x x x x x 0 0 0 0 0 1
0 x x x x x x 0 1 0 0 1 0 1
0 x x x x x 0 1 1 0 1 0 0 1
0 x x x x 0 1 1 1 0 1 1 0 1
0 x x x 0 1 1 1 1 1 0 0 0 1
0 x x 0 1 1 1 1 1 1 0 1 0 1
0 x 0 1 1 1 1 1 1 1 1 0 0 1
0 0 1 1 1 1 1 1 1 1 1 1 0 1
</dataString>
</testData>
</entry>
</elementAttributes>
<pos x="240" y="180"/>
</visualElement>
</visualElements>
<wires>
<wire>

View File

@ -35,7 +35,7 @@
<elementAttributes>
<entry>
<string>Value</string>
<int>0</int>
<long>0</long>
</entry>
</elementAttributes>
<pos x="300" y="220"/>
@ -63,10 +63,10 @@
</entry>
<entry>
<string>Output Splitting</string>
<string>1,7</string>
<string>1-7</string>
</entry>
</elementAttributes>
<pos x="-40" y="200"/>
<pos x="-40" y="280"/>
</visualElement>
<visualElement>
<elementName>Splitter</elementName>
@ -76,7 +76,7 @@
<string>7,1</string>
</entry>
</elementAttributes>
<pos x="60" y="220"/>
<pos x="60" y="280"/>
</visualElement>
<visualElement>
<elementName>In</elementName>
@ -87,10 +87,10 @@
</entry>
<entry>
<string>pinNumber</string>
<int>22</int>
<string>22</string>
</entry>
</elementAttributes>
<pos x="-100" y="240"/>
<pos x="-100" y="300"/>
</visualElement>
<visualElement>
<elementName>Splitter</elementName>
@ -100,7 +100,7 @@
<string>1,7</string>
</entry>
</elementAttributes>
<pos x="60" y="280"/>
<pos x="60" y="220"/>
</visualElement>
<visualElement>
<elementName>In</elementName>
@ -111,10 +111,10 @@
</entry>
<entry>
<string>pinNumber</string>
<int>2</int>
<string>2</string>
</entry>
</elementAttributes>
<pos x="-100" y="280"/>
<pos x="-100" y="220"/>
</visualElement>
<visualElement>
<elementName>Splitter</elementName>
@ -125,10 +125,10 @@
</entry>
<entry>
<string>Output Splitting</string>
<string>7,1</string>
<string>7</string>
</entry>
</elementAttributes>
<pos x="-40" y="300"/>
<pos x="-40" y="240"/>
</visualElement>
<visualElement>
<elementName>Splitter</elementName>
@ -167,7 +167,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>13</int>
<string>13</string>
</entry>
<entry>
<string>Default</string>
@ -189,7 +189,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>11</int>
<string>11</string>
</entry>
</elementAttributes>
<pos x="260" y="480"/>
@ -225,7 +225,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>1</int>
<string>1</string>
</entry>
</elementAttributes>
<pos x="180" y="480"/>
@ -243,7 +243,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>23</int>
<string>23</string>
</entry>
</elementAttributes>
<pos x="220" y="480"/>
@ -267,7 +267,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>3</int>
<string>3</string>
</entry>
</elementAttributes>
<pos x="60" y="360"/>
@ -281,7 +281,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>5</int>
<string>5</string>
</entry>
</elementAttributes>
<pos x="-100" y="380"/>
@ -295,7 +295,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>7</int>
<string>7</string>
</entry>
</elementAttributes>
<pos x="60" y="400"/>
@ -309,7 +309,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>9</int>
<string>9</string>
</entry>
</elementAttributes>
<pos x="-100" y="420"/>
@ -323,7 +323,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>15</int>
<string>15</string>
</entry>
</elementAttributes>
<pos x="60" y="440"/>
@ -337,7 +337,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>17</int>
<string>17</string>
</entry>
</elementAttributes>
<pos x="-100" y="460"/>
@ -351,7 +351,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>19</int>
<string>19</string>
</entry>
</elementAttributes>
<pos x="60" y="480"/>
@ -365,7 +365,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>21</int>
<string>21</string>
</entry>
</elementAttributes>
<pos x="-100" y="500"/>
@ -379,7 +379,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>4</int>
<string>4</string>
</entry>
</elementAttributes>
<pos x="500" y="220"/>
@ -393,7 +393,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>6</int>
<string>6</string>
</entry>
</elementAttributes>
<pos x="640" y="240"/>
@ -407,7 +407,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>8</int>
<string>8</string>
</entry>
</elementAttributes>
<pos x="500" y="260"/>
@ -421,7 +421,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>10</int>
<string>10</string>
</entry>
</elementAttributes>
<pos x="640" y="280"/>
@ -435,7 +435,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>14</int>
<string>14</string>
</entry>
</elementAttributes>
<pos x="500" y="300"/>
@ -449,7 +449,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>16</int>
<string>16</string>
</entry>
</elementAttributes>
<pos x="640" y="320"/>
@ -463,7 +463,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>18</int>
<string>18</string>
</entry>
</elementAttributes>
<pos x="500" y="340"/>
@ -477,7 +477,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>20</int>
<string>20</string>
</entry>
</elementAttributes>
<pos x="640" y="360"/>
@ -496,7 +496,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>24</int>
<string>24</string>
</entry>
<entry>
<string>InDefault</string>
@ -514,11 +514,50 @@
</entry>
<entry>
<string>pinNumber</string>
<int>12</int>
<string>12</string>
</entry>
</elementAttributes>
<pos x="560" y="500"/>
</visualElement>
<visualElement>
<elementName>Testcase</elementName>
<elementAttributes>
<entry>
<string>Testdata</string>
<testData>
<dataString>~MR S1 S0 CP DSL DSR P0 P1 P2 P3 P4 P5 P6 P7 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
0 x x x x x x x x x x x x x 0 0 0 0 0 0 0 0
1 x x 0 x x x x x x x x x x 0 0 0 0 0 0 0 0
repeat(256) 1 1 1 C 0 0 bits(8,n) bits(8,n)
1 1 1 C 0 0 bits(8,0) bits(8,0)
1 x x 0 x x x x x x x x x x 0 0 0 0 0 0 0 0
loop (n,256)
1 1 1 C 0 0 bits(8,n) bits(8,n)
1 0 1 C 0 1 bits(8,0) 1 bits(7,n&gt;&gt;1)
1 1 1 C 0 0 bits(8,n) bits(8,n)
1 0 1 C 0 0 bits(8,0) 0 bits(7,n&gt;&gt;1)
end loop
loop (n,256)
1 1 1 C 0 0 bits(8,n) bits(8,n)
1 1 0 C 1 0 bits(8,0) bits(7,n) 1
1 1 1 C 0 0 bits(8,n) bits(8,n)
1 1 0 C 0 0 bits(8,0) bits(7,n) 0
end loop
loop (n,256)
1 1 1 C 0 0 bits(8,n) bits(8,n)
1 0 0 C x x x x x x x x x x bits(8,n)
end loop
</dataString>
</testData>
</entry>
</elementAttributes>
<pos x="520" y="540"/>
</visualElement>
</visualElements>
<wires>
<wire>
@ -569,25 +608,17 @@
<p1 x="480" y="360"/>
<p2 x="640" y="360"/>
</wire>
<wire>
<p1 x="-80" y="200"/>
<p2 x="-40" y="200"/>
</wire>
<wire>
<p1 x="140" y="200"/>
<p2 x="160" y="200"/>
</wire>
<wire>
<p1 x="480" y="300"/>
<p2 x="500" y="300"/>
</wire>
<wire>
<p1 x="-20" y="300"/>
<p1 x="-100" y="300"/>
<p2 x="60" y="300"/>
</wire>
<wire>
<p1 x="-80" y="300"/>
<p2 x="-40" y="300"/>
<p1 x="480" y="300"/>
<p2 x="500" y="300"/>
</wire>
<wire>
<p1 x="-100" y="460"/>
@ -601,22 +632,26 @@
<p1 x="560" y="460"/>
<p2 x="600" y="460"/>
</wire>
<wire>
<p1 x="-20" y="240"/>
<p2 x="60" y="240"/>
</wire>
<wire>
<p1 x="-80" y="240"/>
<p2 x="-40" y="240"/>
</wire>
<wire>
<p1 x="480" y="240"/>
<p2 x="640" y="240"/>
</wire>
<wire>
<p1 x="-100" y="240"/>
<p2 x="60" y="240"/>
<p1 x="200" y="240"/>
<p2 x="320" y="240"/>
</wire>
<wire>
<p1 x="120" y="240"/>
<p2 x="160" y="240"/>
</wire>
<wire>
<p1 x="200" y="240"/>
<p2 x="320" y="240"/>
</wire>
<wire>
<p1 x="60" y="400"/>
<p2 x="80" y="400"/>
@ -634,16 +669,20 @@
<p2 x="580" y="500"/>
</wire>
<wire>
<p1 x="480" y="280"/>
<p2 x="640" y="280"/>
<p1 x="80" y="280"/>
<p2 x="120" y="280"/>
</wire>
<wire>
<p1 x="-100" y="280"/>
<p1 x="-20" y="280"/>
<p2 x="60" y="280"/>
</wire>
<wire>
<p1 x="80" y="280"/>
<p2 x="120" y="280"/>
<p1 x="-80" y="280"/>
<p2 x="-40" y="280"/>
</wire>
<wire>
<p1 x="480" y="280"/>
<p2 x="640" y="280"/>
</wire>
<wire>
<p1 x="300" y="280"/>
@ -653,6 +692,14 @@
<p1 x="60" y="440"/>
<p2 x="80" y="440"/>
</wire>
<wire>
<p1 x="80" y="220"/>
<p2 x="160" y="220"/>
</wire>
<wire>
<p1 x="-100" y="220"/>
<p2 x="60" y="220"/>
</wire>
<wire>
<p1 x="480" y="220"/>
<p2 x="500" y="220"/>
@ -665,14 +712,6 @@
<p1 x="380" y="220"/>
<p2 x="400" y="220"/>
</wire>
<wire>
<p1 x="80" y="220"/>
<p2 x="160" y="220"/>
</wire>
<wire>
<p1 x="-20" y="220"/>
<p2 x="60" y="220"/>
</wire>
<wire>
<p1 x="400" y="220"/>
<p2 x="460" y="220"/>
@ -701,14 +740,14 @@
<p1 x="580" y="480"/>
<p2 x="580" y="500"/>
</wire>
<wire>
<p1 x="120" y="240"/>
<p2 x="120" y="280"/>
</wire>
<wire>
<p1 x="200" y="440"/>
<p2 x="200" y="460"/>
</wire>
<wire>
<p1 x="120" y="240"/>
<p2 x="120" y="280"/>
</wire>
<wire>
<p1 x="300" y="280"/>
<p2 x="300" y="300"/>
@ -731,11 +770,11 @@
</wire>
<wire>
<p1 x="-80" y="160"/>
<p2 x="-80" y="200"/>
<p2 x="-80" y="240"/>
</wire>
<wire>
<p1 x="-80" y="200"/>
<p2 x="-80" y="300"/>
<p1 x="-80" y="240"/>
<p2 x="-80" y="280"/>
</wire>
</wires>
</circuit>

View File

@ -45,7 +45,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>3</int>
<string>3</string>
</entry>
</elementAttributes>
<pos x="140" y="200"/>
@ -59,7 +59,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>5</int>
<string>5</string>
</entry>
</elementAttributes>
<pos x="300" y="220"/>
@ -73,7 +73,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>7</int>
<string>7</string>
</entry>
</elementAttributes>
<pos x="140" y="240"/>
@ -87,7 +87,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>9</int>
<string>9</string>
</entry>
</elementAttributes>
<pos x="300" y="260"/>
@ -101,7 +101,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>12</int>
<string>12</string>
</entry>
</elementAttributes>
<pos x="140" y="280"/>
@ -115,7 +115,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>14</int>
<string>14</string>
</entry>
</elementAttributes>
<pos x="300" y="300"/>
@ -129,7 +129,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>16</int>
<string>16</string>
</entry>
</elementAttributes>
<pos x="140" y="320"/>
@ -143,7 +143,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>18</int>
<string>18</string>
</entry>
</elementAttributes>
<pos x="300" y="340"/>
@ -167,7 +167,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>2</int>
<string>2</string>
</entry>
</elementAttributes>
<pos x="140" y="0"/>
@ -181,7 +181,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>4</int>
<string>4</string>
</entry>
</elementAttributes>
<pos x="300" y="20"/>
@ -195,7 +195,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>6</int>
<string>6</string>
</entry>
</elementAttributes>
<pos x="140" y="40"/>
@ -209,7 +209,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>8</int>
<string>8</string>
</entry>
</elementAttributes>
<pos x="300" y="60"/>
@ -223,7 +223,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>11</int>
<string>11</string>
</entry>
</elementAttributes>
<pos x="140" y="80"/>
@ -237,7 +237,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>13</int>
<string>13</string>
</entry>
</elementAttributes>
<pos x="300" y="100"/>
@ -251,7 +251,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>15</int>
<string>15</string>
</entry>
</elementAttributes>
<pos x="140" y="120"/>
@ -265,7 +265,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>17</int>
<string>17</string>
</entry>
</elementAttributes>
<pos x="300" y="140"/>
@ -289,7 +289,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>19</int>
<string>19</string>
</entry>
</elementAttributes>
<pos x="540" y="220"/>
@ -303,7 +303,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>1</int>
<string>1</string>
</entry>
</elementAttributes>
<pos x="540" y="180"/>
@ -322,7 +322,7 @@
</entry>
<entry>
<string>pinNumber</string>
<int>20</int>
<string>20</string>
</entry>
<entry>
<string>InDefault</string>
@ -340,11 +340,28 @@
</entry>
<entry>
<string>pinNumber</string>
<int>10</int>
<string>10</string>
</entry>
</elementAttributes>
<pos x="140" y="440"/>
</visualElement>
<visualElement>
<elementName>Testcase</elementName>
<elementAttributes>
<entry>
<string>Testdata</string>
<testData>
<dataString>P7 P6 P5 P4 P3 P2 P1 P0 Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 ~P=Q ~P&gt;Q
loop(P,256)
loop(Q,256)
bits(8,P) bits(8,Q) (~(P=Q)) (~(P&gt;Q))
end loop
end loop</dataString>
</testData>
</entry>
</elementAttributes>
<pos x="420" y="40"/>
</visualElement>
</visualElements>
<wires>
<wire>

View File

@ -4,7 +4,6 @@ import de.neemann.digital.analyse.expression.ContextFiller;
import de.neemann.digital.analyse.expression.Expression;
import de.neemann.digital.analyse.expression.Variable;
import de.neemann.digital.analyse.expression.format.FormatToExpression;
import de.neemann.digital.analyse.expression.format.FormatterException;
import de.neemann.digital.analyse.quinemc.primeselector.PrimeSelectorDefault;
import junit.framework.TestCase;
@ -18,14 +17,14 @@ import static de.neemann.digital.analyse.expression.Operation.or;
*/
public class QuineMcCluskeyRegressionTest extends TestCase {
public void testRegression() throws Exception, FormatterException {
public void testRegression() throws Exception {
testRegression(8, 128);
testRegression(8, 16);
testRegression(4, 8);
testRegression(4, 4);
}
public void testRegression2() throws Exception, FormatterException {
public void testRegression2() throws Exception {
for (int i = 0; i < 100; i++) {
testRegression(5, 16);
testRegression(5, 8);
@ -33,7 +32,7 @@ public class QuineMcCluskeyRegressionTest extends TestCase {
}
}
public void testRegression3() throws Exception, FormatterException {
public void testRegression3() throws Exception {
Variable a = new Variable("A");
Variable b = new Variable("B");
Variable c = new Variable("C");
@ -48,18 +47,18 @@ public class QuineMcCluskeyRegressionTest extends TestCase {
Expression ex = or(a, c);
t.fillTableWith(new BoolTableExpression(ex, new ContextFiller(vars)));
System.out.println("--");
// System.out.println("--");
while (!t.isFinished()) {
System.out.println(FormatToExpression.FORMATTER_JAVA.format(t.getExpression()));
// System.out.println(FormatToExpression.FORMATTER_JAVA.format(t.getExpression()));
t.simplifyStep();
}
t.simplifyPrimes(new PrimeSelectorDefault());
assertEquals("A || C", FormatToExpression.FORMATTER_JAVA.format(t.getExpression()));
System.out.println("--");
// System.out.println("--");
}
public static void testRegression(int n, int j) throws Exception {
private static void testRegression(int n, int j) throws Exception {
int size = 1 << n;
boolean[] table = new boolean[size];
@ -82,6 +81,5 @@ public class QuineMcCluskeyRegressionTest extends TestCase {
for (int i = 0; i < table.length; i++)
assertEquals(table[i], expression.calculate(cf.setContextTo(i)));
}
}

View File

@ -11,6 +11,7 @@ public class FileScanner {
private Interface test;
private ArrayList<Error> errors;
private int pos;
public FileScanner(Interface test) {
this.test = test;
@ -25,7 +26,9 @@ public class FileScanner {
System.err.println("all tests are skipped: " + e.getMessage());
throw e;
}
System.out.println("tested " + count + " examples");
if (pos > 0)
System.out.println();
System.out.println("-- tested " + count + " examples");
if (errors.isEmpty())
return count;
@ -47,8 +50,15 @@ public class FileScanner {
count += scanIntern(f);
}
} else {
if (f.getName().endsWith(".dig")) {
String name = f.getName();
if (name.endsWith(".dig")) {
try {
if (pos + name.length() >= 78) {
System.out.println();
pos = 0;
}
System.out.print(name + ", ");
pos += 2 + name.length();
test.check(f);
} catch (SkipAllException e) {
throw e;

View File

@ -30,7 +30,7 @@ public class TestExamples extends TestCase {
public void testDistExamples() throws Exception {
File examples = new File(Resources.getRoot().getParentFile().getParentFile(), "/main/dig");
assertEquals(208, new FileScanner(this::check).scan(examples));
assertEquals(112, testCasesInFiles);
assertEquals(116, testCasesInFiles);
}
/**