Quellcode durchsuchen

Fix formatting of header with RO

Baglio Tabifata vor 5 Jahren
Ursprung
Commit
50f5b017a5

+ 5 - 1
src/main/java/info/hkzlab/dupal/analyzer/palanalisys/formatter/EspressoFormatter.java

@@ -37,7 +37,7 @@ public class EspressoFormatter {
         strBuf.append("\n");
        
         strBuf.append(".phase ");
-        for(int idx = 0; idx < outCount; idx++) strBuf.append(pSpecs.isActiveLow() ? '0' : '1');
+        for(int idx = 0; idx < outCount+pSpecs.getPinCount_RO(); idx++) strBuf.append(pSpecs.isActiveLow() ? '0' : '1');
         for(int idx = 0; idx < outCount; idx++) strBuf.append('1');
         strBuf.append("\n\n");
         
@@ -102,6 +102,10 @@ public class EspressoFormatter {
             for(RegLink rl : regLinks) {
                 strBuf.delete(0, strBuf.length());
 
+                // TODO
+
+                strBuf.append('\n');
+                tableRows.add(strBuf.toString());
             }
         }
 

+ 15 - 1
src/test/java/info/hkzlab/dupal/analyzer/FormattersTest.java

@@ -52,6 +52,20 @@ public class FormattersTest {
         System.out.print(EspressoFormatter.formatEspressoTableHeader(pSpecs, ioAsOutMask));
         for(String row : rows) System.out.print(row);
 
-        assertArrayEquals("EspressoFormatter should build the correct truth table for specified states", new String[3], rows);
+        String[] expected = new String[] {
+            "0000000000000111 --11111000\n",
+            "0000000000011111 0110-00001\n",
+            "0010000000000111 0000000000\n",
+            
+            "000000000000010- --11111000\n",
+            "111000000000010- 0110-00001\n",
+            "001000000000010- 0000000000\n",
+            
+            "1001000000000000 0000000000\n",
+            "0000000000010000 0110-00001\n",
+            "0010000000000000 0110-00001\n",
+        };
+
+        assertArrayEquals("EspressoFormatter should build the correct truth table for specified states", expected, rows);
     }
 }