From 62d71043982eb866c524753e865c3a15c49ff7ad Mon Sep 17 00:00:00 2001 From: Kevin Kim Date: Sun, 27 Aug 2023 14:13:29 -0700 Subject: [PATCH] wrapper generation works --- synthDC/scripts/wrapperGen.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/synthDC/scripts/wrapperGen.py b/synthDC/scripts/wrapperGen.py index 76ae24a33..84c04f1fd 100644 --- a/synthDC/scripts/wrapperGen.py +++ b/synthDC/scripts/wrapperGen.py @@ -30,7 +30,7 @@ lineModuleEnd = 0 moduleName = "" # string that will keep track of the running module header -buf = "`include \"config.vh\"\n`include \"parameter-defs.vh\"\nimport cvw::*;\n" +buf = "import cvw::*;\n`include \"config.vh\"\n`include \"parameter-defs.vh\"\n" # are we writing into the buffer writeBuf=False @@ -56,5 +56,19 @@ for l in lines: buf += f"\t{moduleName} #(P) dut(.*);\nendmodule" +# path to wrapper +wrapperPath = f"{os.getenv('WALLY')}/src/wrappers/{moduleName}wrapper.sv" + +# clear wrappers directory +os.system(f"rm {os.getenv('WALLY')}/src/wrappers/*") + +fout = open(wrapperPath, "w") + +fout.write(buf) + +fin.close() +fout.close() + + print(buf) \ No newline at end of file