Skip to content
Snippets Groups Projects
Commit a0b2141f authored by auphelia's avatar auphelia
Browse files

[Tranform] Enable rtlsim to utilize swg package

parent 175e7c60
No related branches found
No related tags found
No related merge requests found
......@@ -1064,6 +1064,9 @@ class ConvolutionInputGenerator_rtl(HLSCustomOp):
shutil.copy2(
os.environ["FINN_ROOT"] + "/finn-rtllib/swg/swg_common.sv", code_gen_dir
)
shutil.copy2(
os.environ["FINN_ROOT"] + "/finn-rtllib/swg/swg_pkg.sv", code_gen_dir
)
# set ipgen_path and ip_path so that HLS-Synth transformation
# and stich_ip transformation do not complain
......@@ -1082,6 +1085,7 @@ class ConvolutionInputGenerator_rtl(HLSCustomOp):
code_gen_dir = self.get_nodeattr("code_gen_dir_ipgen")
verilog_paths = [code_gen_dir]
verilog_files = [
"swg_pkg.sv",
self.get_nodeattr("gen_top_module") + "_wrapper.v",
self.get_nodeattr("gen_top_module") + "_impl.sv",
"swg_common.sv",
......@@ -1106,6 +1110,7 @@ class ConvolutionInputGenerator_rtl(HLSCustomOp):
code_gen_dir = self.get_nodeattr("code_gen_dir_ipgen")
sourcefiles = [
"swg_pkg.sv",
self.get_nodeattr("gen_top_module") + "_wrapper.v",
self.get_nodeattr("gen_top_module") + "_impl.sv",
"swg_common.sv",
......
......@@ -118,6 +118,8 @@ def prepare_stitched_ip_for_verilator(model):
if not remove_entry:
filtered_verilog_files.append(vfile)
remove_entry = True
elif "swg_pkg" in vfile:
continue
else:
filtered_verilog_files.append(vfile)
......@@ -315,8 +317,10 @@ def pyverilate_stitched_ip(
xpm_cdc = f"{vivado_path}/data/ip/xpm/xpm_cdc/hdl/xpm_cdc.sv"
xpm_fifo = f"{vivado_path}/data/ip/xpm/xpm_fifo/hdl/xpm_fifo.sv"
swg_pkg = os.environ["FINN_ROOT"] + "/finn-rtllib/swg/swg_pkg.sv"
sim = PyVerilator.build(
[top_module_file_name, xpm_fifo, xpm_memory, xpm_cdc],
[swg_pkg, top_module_file_name, xpm_fifo, xpm_memory, xpm_cdc],
verilog_path=[vivado_stitch_proj_dir, verilog_header_dir],
build_dir=build_dir,
trace_depth=get_rtlsim_trace_depth(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment