Commit 1e7fcbc4 authored by Peter's avatar Peter
Browse files

dev

parent 37e59206
Loading
Loading
Loading
Loading
Loading
+4 −4
Changes for src/main/java/hk/quantr/verilogcompiler/VerilogCompiler.java: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -130,10 +130,10 @@ public class VerilogCompiler {
			hk.quantr.verilogcompiler.structure.Module module = VerilogHelper.parseTopModule(temp.getParentFile(), temp.getName());
			System.out.println(CommonLib.objectToJson(module));
		} else if (cmd.hasOption("t")) {
			if (!cmd.hasOption("tvh")) {
				logger.log(Level.SEVERE, "-tvh, verilog heading statements option missing");
				System.exit(20);
			}
//			if (!cmd.hasOption("tvh")) {
//				logger.log(Level.SEVERE, "-tvh, verilog heading statements option missing");
//				System.exit(20);
//			}
//			if (!cmd.hasOption("tvs")) {
//				logger.log(Level.SEVERE, "-tvs, verilog statements option missing");
//				System.exit(20);
+2 −2
Changes for src/main/java/hk/quantr/verilogcompiler/VerilogHelper.java: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -263,8 +263,8 @@ 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("+".repeat(100));
		System.out.println(ps);
		System.out.println("+".repeat(100));
		VerilogLexer lexer = new VerilogLexer(CharStreams.fromString(sourceContent));
		CommonTokenStream tokenStream = new CommonTokenStream(lexer);
		VerilogParser parser = new VerilogParser(tokenStream);
+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
@@ -46,7 +46,7 @@ public class VerilogPreProcessorListener extends VerilogParserBaseListener {
//		verilogStatements += "$display(\"%x\", add(1,2));\n";
//		verilogStatements += "profile(\"" + ctx.variable_lvalue().getText() + "\");\n";
		verilogStatements += "/* verilator lint_off WIDTH */\n";
		verilogStatements += "profile(\"" + ctx.variable_lvalue().getText() + "\", " + ctx.variable_lvalue().getText() + ");\n";
		verilogStatements += "profile(>>" + (parentMacro.originalLineNo + 1) + ", \"" + ctx.variable_lvalue().getText() + "\", " + ctx.variable_lvalue().getText() + ");\n";
		verilogStatements += "/* verilator lint_on WIDTH */\n";
		parentMacro.children.add(new MacroListing(parentMacro, parentMacro.parseNo + 1, lineNo, parentMacro.originalLineNo, verilogStatements, MacroListing.Type.PROFILING));
	}