Loading nbactions.xml +3 −3 Changes for nbactions.xml: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ <properties> <exec.vmArgs></exec.vmArgs> <exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args> <exec.appArgs>-t ../quantr-i/src/id.v -o ../quantr-i/src-output</exec.appArgs> <exec.appArgs>-t ../quantr-i/src -o ../quantr-i/src-output</exec.appArgs> <exec.mainClass>hk.quantr.verilogcompiler.VerilogCompiler</exec.mainClass> <exec.executable>java</exec.executable> </properties> Loading @@ -29,7 +29,7 @@ <properties> <exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs> <exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args> <exec.appArgs>-t ../quantr-i/src/id.v -o ../quantr-i/src-output</exec.appArgs> <exec.appArgs>-t ../quantr-i/src -o ../quantr-i/src-output</exec.appArgs> <exec.mainClass>hk.quantr.verilogcompiler.VerilogCompiler</exec.mainClass> <exec.executable>java</exec.executable> <jpda.listen>true</jpda.listen> Loading @@ -49,7 +49,7 @@ <exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args> <exec.mainClass>${packageClassName}</exec.mainClass> <exec.executable>java</exec.executable> <exec.appArgs>-t ../quantr-i/src/id.v -o ../quantr-i/src-output</exec.appArgs> <exec.appArgs>-t ../quantr-i/src -o ../quantr-i/src-output</exec.appArgs> </properties> </action> <action> Loading src/main/java/hk/quantr/verilogcompiler/VerilogCompiler.java +1 −1 Changes for src/main/java/hk/quantr/verilogcompiler/VerilogCompiler.java: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ public class VerilogCompiler { } File output = new File(dir.getAbsolutePath() + File.separator + tempFile.getName()); FileUtils.write(output, newContent, "utf-8"); logger.info("preprocess " + tempFile.getName() + " to " + output.getAbsolutePath()); logger.info("preprocessed " + tempFile.getName() + " to " + output.getAbsolutePath()); } else { logger.info(newContent); } Loading src/main/java/hk/quantr/verilogcompiler/VerilogHelper.java +4 −4 Changes for src/main/java/hk/quantr/verilogcompiler/VerilogHelper.java: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -258,7 +258,7 @@ public class VerilogHelper { String sourceContent = VerilogHelper.getContentReplacedWithMacro(1, content, VerilogHelper.scanMacroDefinitions(file, file.getParentFile()), ps); // FileUtils.writeStringToFile(new File("aaaa.v"), sourceContent, "utf-8"); // CommonLib.printWithLineNumber(sourceContent); // System.out.println(ps); System.out.println(ps); // System.out.println("+".repeat(100)); VerilogLexer lexer = new VerilogLexer(CharStreams.fromString(sourceContent)); CommonTokenStream tokenStream = new CommonTokenStream(lexer); Loading @@ -273,12 +273,12 @@ public class VerilogHelper { System.out.println(ps); List<MacroListing> list = ps.fatternMacroListing().stream().filter(c -> c.type == Type.PROFILING).sorted((MacroListing o1, MacroListing o2) -> Integer.valueOf(o2.lineNo).compareTo(o1.lineNo)).collect(Collectors.toList()); List<String> lines = Arrays.asList(sourceContent.split(System.lineSeparator())); List<String> lines = new ArrayList(Arrays.asList(content.split("\r?\n"))); for (MacroListing temp : list) { System.out.println(temp + " = " + temp.getTopParent()); lines.add(temp.getTopParent().originalLineNo, temp.line); lines.add(temp.getTopParent().originalLineNo + 1, temp.line); } return String.join(System.lineSeparator(), lines); return "/* verilator lint_off UNOPTFLAT */\n" + String.join(System.lineSeparator(), lines) + "\n"; } } src/main/java/hk/quantr/verilogcompiler/listener/preprocess/VerilogPreProcessorListener.java +1 −1 Changes for src/main/java/hk/quantr/verilogcompiler/listener/preprocess/VerilogPreProcessorListener.java: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ public class VerilogPreProcessorListener extends VerilogParserBaseListener { System.out.println("parentMacro is null, " + lineNo); System.exit(929); } parentMacro.children.add(new MacroListing(parentMacro, parentMacro.parseNo + 1, lineNo, parentMacro.originalLineNo, lineNo + " >> $display(" + ctx.variable_lvalue().getText() + ");", MacroListing.Type.PROFILING)); parentMacro.children.add(new MacroListing(parentMacro, parentMacro.parseNo + 1, lineNo, parentMacro.originalLineNo, "$display(" + ctx.variable_lvalue().getText() + ");", MacroListing.Type.PROFILING)); } @Override Loading src/main/java/hk/quantr/verilogcompiler/macro/ParseStructure.java +29 −8 Changes for src/main/java/hk/quantr/verilogcompiler/macro/ParseStructure.java: 29 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -122,21 +122,42 @@ public class ParseStructure { } if (bingoX == -1) { System.err.println("bingoX is -1"); System.exit(1699); } int delta = lineNo - temp.get(bingoX).lineNo - 1; int tempDelta = bingoX; MacroListing deltaMacroListing = temp.get(tempDelta); int lastLineNo = deltaMacroListing.lineNo; while (delta > 0) { int delta; if (temp.get(bingoX).isEmptyIgnoreProfiling()) { delta = lineNo - temp.get(bingoX).lineNo; } else { delta = lineNo - temp.get(bingoX).lineNo - 1; } if (delta == 0) { return temp.get(bingoX); } else { int tempDelta = bingoX + 1; int lastLineNo = -99999; MacroListing deltaMacroListing; do { deltaMacroListing = temp.get(tempDelta); if (deltaMacroListing.children.stream().filter(c -> c.type != Type.PROFILING).count() == 0 && lastLineNo != deltaMacroListing.lineNo) { delta--; } tempDelta++; lastLineNo = deltaMacroListing.lineNo; deltaMacroListing = temp.get(tempDelta); } tempDelta++; } while (delta != 0); // MacroListing deltaMacroListing = temp.get(tempDelta); // int lastLineNo = deltaMacroListing.lineNo; // while (delta > 0) { // if (deltaMacroListing.children.stream().filter(c -> c.type != Type.PROFILING).count() == 0 && lastLineNo != deltaMacroListing.lineNo) { // delta--; // } // tempDelta++; // lastLineNo = deltaMacroListing.lineNo; // deltaMacroListing = temp.get(tempDelta); // } // return temp.get(bingoX + delta); return deltaMacroListing; } } } Loading
nbactions.xml +3 −3 Changes for nbactions.xml: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ <properties> <exec.vmArgs></exec.vmArgs> <exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args> <exec.appArgs>-t ../quantr-i/src/id.v -o ../quantr-i/src-output</exec.appArgs> <exec.appArgs>-t ../quantr-i/src -o ../quantr-i/src-output</exec.appArgs> <exec.mainClass>hk.quantr.verilogcompiler.VerilogCompiler</exec.mainClass> <exec.executable>java</exec.executable> </properties> Loading @@ -29,7 +29,7 @@ <properties> <exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs> <exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args> <exec.appArgs>-t ../quantr-i/src/id.v -o ../quantr-i/src-output</exec.appArgs> <exec.appArgs>-t ../quantr-i/src -o ../quantr-i/src-output</exec.appArgs> <exec.mainClass>hk.quantr.verilogcompiler.VerilogCompiler</exec.mainClass> <exec.executable>java</exec.executable> <jpda.listen>true</jpda.listen> Loading @@ -49,7 +49,7 @@ <exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args> <exec.mainClass>${packageClassName}</exec.mainClass> <exec.executable>java</exec.executable> <exec.appArgs>-t ../quantr-i/src/id.v -o ../quantr-i/src-output</exec.appArgs> <exec.appArgs>-t ../quantr-i/src -o ../quantr-i/src-output</exec.appArgs> </properties> </action> <action> Loading
src/main/java/hk/quantr/verilogcompiler/VerilogCompiler.java +1 −1 Changes for src/main/java/hk/quantr/verilogcompiler/VerilogCompiler.java: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ public class VerilogCompiler { } File output = new File(dir.getAbsolutePath() + File.separator + tempFile.getName()); FileUtils.write(output, newContent, "utf-8"); logger.info("preprocess " + tempFile.getName() + " to " + output.getAbsolutePath()); logger.info("preprocessed " + tempFile.getName() + " to " + output.getAbsolutePath()); } else { logger.info(newContent); } Loading
src/main/java/hk/quantr/verilogcompiler/VerilogHelper.java +4 −4 Changes for src/main/java/hk/quantr/verilogcompiler/VerilogHelper.java: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -258,7 +258,7 @@ public class VerilogHelper { String sourceContent = VerilogHelper.getContentReplacedWithMacro(1, content, VerilogHelper.scanMacroDefinitions(file, file.getParentFile()), ps); // FileUtils.writeStringToFile(new File("aaaa.v"), sourceContent, "utf-8"); // CommonLib.printWithLineNumber(sourceContent); // System.out.println(ps); System.out.println(ps); // System.out.println("+".repeat(100)); VerilogLexer lexer = new VerilogLexer(CharStreams.fromString(sourceContent)); CommonTokenStream tokenStream = new CommonTokenStream(lexer); Loading @@ -273,12 +273,12 @@ public class VerilogHelper { System.out.println(ps); List<MacroListing> list = ps.fatternMacroListing().stream().filter(c -> c.type == Type.PROFILING).sorted((MacroListing o1, MacroListing o2) -> Integer.valueOf(o2.lineNo).compareTo(o1.lineNo)).collect(Collectors.toList()); List<String> lines = Arrays.asList(sourceContent.split(System.lineSeparator())); List<String> lines = new ArrayList(Arrays.asList(content.split("\r?\n"))); for (MacroListing temp : list) { System.out.println(temp + " = " + temp.getTopParent()); lines.add(temp.getTopParent().originalLineNo, temp.line); lines.add(temp.getTopParent().originalLineNo + 1, temp.line); } return String.join(System.lineSeparator(), lines); return "/* verilator lint_off UNOPTFLAT */\n" + String.join(System.lineSeparator(), lines) + "\n"; } }
src/main/java/hk/quantr/verilogcompiler/listener/preprocess/VerilogPreProcessorListener.java +1 −1 Changes for src/main/java/hk/quantr/verilogcompiler/listener/preprocess/VerilogPreProcessorListener.java: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ public class VerilogPreProcessorListener extends VerilogParserBaseListener { System.out.println("parentMacro is null, " + lineNo); System.exit(929); } parentMacro.children.add(new MacroListing(parentMacro, parentMacro.parseNo + 1, lineNo, parentMacro.originalLineNo, lineNo + " >> $display(" + ctx.variable_lvalue().getText() + ");", MacroListing.Type.PROFILING)); parentMacro.children.add(new MacroListing(parentMacro, parentMacro.parseNo + 1, lineNo, parentMacro.originalLineNo, "$display(" + ctx.variable_lvalue().getText() + ");", MacroListing.Type.PROFILING)); } @Override Loading
src/main/java/hk/quantr/verilogcompiler/macro/ParseStructure.java +29 −8 Changes for src/main/java/hk/quantr/verilogcompiler/macro/ParseStructure.java: 29 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -122,21 +122,42 @@ public class ParseStructure { } if (bingoX == -1) { System.err.println("bingoX is -1"); System.exit(1699); } int delta = lineNo - temp.get(bingoX).lineNo - 1; int tempDelta = bingoX; MacroListing deltaMacroListing = temp.get(tempDelta); int lastLineNo = deltaMacroListing.lineNo; while (delta > 0) { int delta; if (temp.get(bingoX).isEmptyIgnoreProfiling()) { delta = lineNo - temp.get(bingoX).lineNo; } else { delta = lineNo - temp.get(bingoX).lineNo - 1; } if (delta == 0) { return temp.get(bingoX); } else { int tempDelta = bingoX + 1; int lastLineNo = -99999; MacroListing deltaMacroListing; do { deltaMacroListing = temp.get(tempDelta); if (deltaMacroListing.children.stream().filter(c -> c.type != Type.PROFILING).count() == 0 && lastLineNo != deltaMacroListing.lineNo) { delta--; } tempDelta++; lastLineNo = deltaMacroListing.lineNo; deltaMacroListing = temp.get(tempDelta); } tempDelta++; } while (delta != 0); // MacroListing deltaMacroListing = temp.get(tempDelta); // int lastLineNo = deltaMacroListing.lineNo; // while (delta > 0) { // if (deltaMacroListing.children.stream().filter(c -> c.type != Type.PROFILING).count() == 0 && lastLineNo != deltaMacroListing.lineNo) { // delta--; // } // tempDelta++; // lastLineNo = deltaMacroListing.lineNo; // deltaMacroListing = temp.get(tempDelta); // } // return temp.get(bingoX + delta); return deltaMacroListing; } } }