瀏覽代碼

Add more logging and save launch.json

Baglio Tabifata 4 年之前
父節點
當前提交
50e0368313
共有 2 個文件被更改,包括 28 次插入1 次删除
  1. 23 0
      .vscode/launch.json
  2. 5 1
      src/net/hkzlab/dupal/boardio/DuPALAnalyzer.java

+ 23 - 0
.vscode/launch.json

@@ -0,0 +1,23 @@
+{
+    // Use IntelliSense to learn about possible attributes.
+    // Hover to view descriptions of existing attributes.
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "type": "java",
+            "name": "Debug (Launch) - Current File",
+            "request": "launch",
+            "mainClass": "${file}",
+            //"args": ["/dev/ttyUSB0", "16R6", "/tmp", "C0"]
+            "args": ["/dev/ttyUSB0", "16R6", "/tmp"]
+        },
+        {
+            "type": "java",
+            "name": "Debug (Launch)-App<DuPAL_Analyzer_44ed364>",
+            "request": "launch",
+            "mainClass": "net.hkzlab.dupal.App",
+            "projectName": "DuPAL_Analyzer_44ed364"
+        }
+    ]
+}

+ 5 - 1
src/net/hkzlab/dupal/boardio/DuPALAnalyzer.java

@@ -25,7 +25,7 @@ import net.hkzlab.palanalisys.StateLink;
 import net.hkzlab.palanalisys.SubState;
 
 public class DuPALAnalyzer {
-    private final Logger logger = LoggerFactory.getLogger(DuPALAnalyzer.class);
+    private static final Logger logger = LoggerFactory.getLogger(DuPALAnalyzer.class);
 
     private static final String SERIALIZED_DUMP = "dupalstat.dmp";
     private static final String OUT_TABLE = "dupal_outputs.tbl";
@@ -552,6 +552,8 @@ public class DuPALAnalyzer {
     }
 
     static private void printLogicTableREGOUTPUTS(OutputStream out, PALSpecs specs, int additionalOUTs, int ioOUTMask, MacroState[] mStates) throws IOException {
+        logger.info("Printing logic table for registered outputs.");
+
         out.write(("# OUTPUT logic table\n").getBytes(StandardCharsets.US_ASCII));
         int totInputs = specs.getNumINPins() + (specs.getNumIOPins() - additionalOUTs);
         StringBuffer strBuf = new StringBuffer();
@@ -651,6 +653,8 @@ public class DuPALAnalyzer {
      * - OE status for each output
      */
     static private void printLogicTableOUTPUTS(OutputStream out, PALSpecs specs, int additionalOUTs, int ioOUTMask, MacroState[] mStates) throws IOException {
+        logger.info("Printing logic table for normal outputs.");
+        
         out.write(("# OUTPUT logic table\n").getBytes(StandardCharsets.US_ASCII));
         int totInputs = specs.getNumINPins() + (specs.getNumIOPins() - additionalOUTs);
         StringBuffer strBuf = new StringBuffer();