diff --git a/common.mk b/common.mk index 59156a00..fa882068 100644 --- a/common.mk +++ b/common.mk @@ -138,7 +138,7 @@ firrtl: $(FIRRTL_FILE) $(FINAL_ANNO_FILE) ######################################################################################### # create verilog files rules and variables ######################################################################################### -CIRCT_TARGETS = $(FIRTOOL_SMEMS_CONF) $(FIRTOOL_MOD_HIER_JSON) $(FIRTOOL_TB_MOD_HIER_JSON) $(FIRTOOL_SMEMS_JSON) $(FIRTOOL_TB_SMEMS_JSON) +CIRCT_TARGETS = $(FIRTOOL_SMEMS_CONF) $(FIRTOOL_MOD_HIER_JSON) $(FIRTOOL_TB_MOD_HIER_JSON) $(FIRTOOL_SMEMS_JSON) $(FIRTOOL_TB_SMEMS_JSON) $(FIRTOOL_FILELIST) # DOC include start: FirrtlCompiler $(TOP_TARGETS) $(HARNESS_TARGETS) &: $(FIRRTL_FILE) $(ANNO_FILE) $(VLOG_SOURCES) @@ -208,7 +208,7 @@ $(TOP_MODS_FILELIST) $(TB_MODS_FILELIST) $(ALL_MODS_FILELIST) &: $(FIRTOOL_TB_MO --out-tb-filelist $(TB_MODS_FILELIST) \ --in-all-filelist $(FIRTOOL_FILELIST) \ --build-dir $(build_dir) - sed -e 's;^;$(build_dir)/;' $(FIRTOOL_FILELIST) > $(ALL_MODS_FILELIST) + cat $(TOP_MODS_FILELIST) $(TB_MODS_FILELIST) > $(ALL_MODS_FILELIST) $(TOP_SMEMS_CONF) $(HARNESS_SMEMS_CONF) &: $(FIRTOOL_SMEMS_JSON) $(FIRTOOL_TB_SMEMS_JSON) $(FIRTOOL_SMEMS_CONF) $(base_dir)/scripts/split-mems-conf.py \ diff --git a/scripts/split-module-files.py b/scripts/split-module-files.py index d68de231..079ea23e 100755 --- a/scripts/split-module-files.py +++ b/scripts/split-module-files.py @@ -73,34 +73,40 @@ if __name__ == "__main__": dut_mods = set(get_modules(dut_top)) tb_mods = set(get_modules(j)) - dut_mods both_mods = dut_mods.intersection(tb_mods) + assert len(both_mods) == 0 with open(args.out_dut_filelist, 'w') as df: with open(args.in_all_filelist) as fl: # add paths that correspond to modules to output file for path in fl: - writeOut = True + writeOut = False for dm in dut_mods: if dm in path: - # don't write - writeOut = False + writeOut = True break # prepend the build directory to get filelist with absolute paths if writeOut: - df.write(f"{args.build_dir}/{path}") + if not args.build_dir in path: + df.write(f"{args.build_dir}/{path}") + else: + df.write(f"{path}") + with open(args.out_tb_filelist, 'w') as df: with open(args.in_all_filelist) as fl: # add paths that correspond to modules to output file for path in fl: - writeOut = True + writeOut = False for dm in tb_mods: if dm in path: - # don't write - writeOut = False + writeOut = True break # prepend the build directory to get filelist with absolute paths if writeOut: - df.write(f"{args.build_dir}/{path}") + if not args.build_dir in path: + df.write(f"{args.build_dir}/{path}") + else: + df.write(f"{path}")