diff --git a/bin/filelist_compile.py b/bin/filelist_compile.py index a32e800650690652e1ea75c66b6515cbb6f91769..eb32e5aab1bbfc81b32b3d677804221e669f2645 100755 --- a/bin/filelist_compile.py +++ b/bin/filelist_compile.py @@ -79,12 +79,24 @@ def read_list(filelist, first, incdirs, args): # Append to filelist if args.absolute == True: if args.tcl == True: - compiled_filelist.append("read_verilog " + str(env_var_substitute(line_list[1], tcl=True)).replace("$","$env")+"/"+str(file)) + if args.genus == True: + if file.endswith(".sv"): + compiled_filelist.append("read_hdl -language sv " + str(env_var_substitute(line_list[1], tcl=True)).replace("$","$env")+"/"+str(file)) + else: + compiled_filelist.append("read_hdl " + str(env_var_substitute(line_list[1], tcl=True)).replace("$","$env")+"/"+str(file)) + else: + compiled_filelist.append("read_verilog " + str(env_var_substitute(line_list[1], tcl=True)).replace("$","$env")+"/"+str(file)) else: compiled_filelist.append(env_var_substitute(line_list[1])+"/"+str(file)) else: if args.tcl == True: - compiled_filelist.append("read_verilog " + str(line_list[1])+"/"+str(file).replace("$","$env")) + if args.genus == True: + if file.endswith(".sv"): + compiled_filelist.append("read_hdl -language sv " + str(env_var_substitute(line_list[1], tcl=True)).replace("$","$env")+"/"+str(file)) + else: + compiled_filelist.append("read_hdl " + str(env_var_substitute(line_list[1], tcl=True)).replace("$","$env")+"/"+str(file)) + else: + compiled_filelist.append("read_verilog " + str(line_list[1])+"/"+str(file).replace("$","$env")) else: compiled_filelist.append(line_list[1]+"/"+str(file)) @@ -97,16 +109,28 @@ def read_list(filelist, first, incdirs, args): if args.tcl == True: if args.absolute == True: if first == True: - compiled_filelist.append("set search_path " + str(env_var_substitute(line_list[0].lstrip("+incdir+"), tcl=True)).replace("$","$env")) + if args.genus == True: + compiled_filelist.append("set_db init_hdl_search_path " + str(env_var_substitute(line_list[0].lstrip("+incdir+"), tcl=True)).replace("$","$env")) + else: + compiled_filelist.append("set search_path " + str(env_var_substitute(line_list[0].lstrip("+incdir+"), tcl=True)).replace("$","$env")) first = False else: - compiled_filelist.append("set search_path [ concat $search_path " + str(env_var_substitute(line_list[0].lstrip("+incdir+"), tcl=True)).replace("$","$env") + " ]") + if args.genus == True: + compiled_filelist.append("set_db init_hdl_search_path " + str(env_var_substitute(line_list[0].lstrip("+incdir+"), tcl=True)).replace("$","$env")) + else: + compiled_filelist.append("set search_path [ concat $search_path " + str(env_var_substitute(line_list[0].lstrip("+incdir+"), tcl=True)).replace("$","$env") + " ]") else: if first == True: - compiled_filelist.append("set search_path " + str(line_list[0].lstrip("+incdir+")).replace("$","$env")) + if args.genus == True: + compiled_filelist.append("set_db init_hdl_search_path " + str(env_var_substitute(line_list[0].lstrip("+incdir+"), tcl=True)).replace("$","$env")) + else: + compiled_filelist.append("set search_path " + str(line_list[0].lstrip("+incdir+")).replace("$","$env")) first = False else: - compiled_filelist.append("set search_path [ concat $search_path " + str(line_list[0].lstrip("+incdir+")).replace("$","$env") + " ]") + if args.genus == True: + compiled_filelist.append("set_db init_hdl_search_path " + str(env_var_substitute(line_list[0].lstrip("+incdir+"), tcl=True)).replace("$","$env")) + else: + compiled_filelist.append("set search_path [ concat $search_path " + str(line_list[0].lstrip("+incdir+")).replace("$","$env") + " ]") # elif args.makefile == True: # if args.absolute == True: # if first == True: @@ -149,22 +173,34 @@ def read_list(filelist, first, incdirs, args): compiled_filelist.append(line_list[0]) if len(hdl_files) > 0: # temp_str = 'add_files -norecurse -scan_for_includes "' - temp_str = f'add_files -norecurse -force -copy_to {args.rtldir} "' - for file in hdl_files: - temp_str += file + " " - temp_str += '"' - compiled_filelist.append(temp_str) + if args.genus == False: + temp_str = f'add_files -norecurse -force -copy_to {args.rtldir} "' + for file in hdl_files: + temp_str += file + " " + temp_str += '"' + compiled_filelist.append(temp_str) + else: + if hdl_files[0].endswith(".sv"): + temp_str = f'read_hdl -language sv ' + else: + temp_str = f'read_hdl ' + for file in hdl_files: + temp_str += file + " " + compiled_filelist.append(temp_str) return compiled_filelist, first, incdirs def incdir_compile(args, incdirs): temp_str = "" if args.tcl == True: - if len(incdirs) > 0: - temp_str = 'set_property include_dirs "' - for directory in incdirs: - temp_dir = str(directory).replace("$","$env") - temp_str += " " + temp_dir - temp_str += '" [current_fileset]' + if args.genus == False: + if len(incdirs) > 0: + temp_str = 'set_property include_dirs "' + for directory in incdirs: + temp_dir = str(directory).replace("$","$env") + temp_str += " " + temp_dir + temp_str += '" [current_fileset]' + + elif args.makefile == True: if len(incdirs) > 0: for directory in incdirs: @@ -190,8 +226,9 @@ def filelist_compile(args): # Create string of all paths to write out filelist_str = filelist_header if (args.tcl == False and args.makefile == False) else filelist_header.replace("//","#") if args.tcl == True: + if args.genus==False: # filelist_str += incdir_compile(args, incdirs) + "\n" - filelist_str += defines_compile(args) + filelist_str += defines_compile(args) for path in filelist: filelist_str += path filelist_str += incdir_compile(args, incdirs) + "\n" # filelist_str += defines_compile(args) @@ -207,6 +244,7 @@ if __name__ == "__main__": parser.add_argument("-o", "--output", type=str, help="Output Filelist location") parser.add_argument("-e", "--exclude", action='store_true', help="Exclude filists including these strings") parser.add_argument("-t", "--tcl", action='store_true', help="Generate a TCL Script") + parser.add_argument("-g", "--genus", action = 'store_true', help="Generate TCL script for genus") parser.add_argument("-m", "--makefile", action='store_true', help="Generate a Makefile RTL Sources File") parser.add_argument("-a", "--absolute", action='store_true', help="Substitute environment Variables with Absolute Path") parser.add_argument("-r", "--rtldir", type=str, help="Directory where RTL Source will be copied to in TCL mode") diff --git a/bin/htmlgen/makefile b/bin/htmlgen/makefile index 5203661656e6c49ab8d1f0a5fdd02257b448d320..03653d50b591104c457c3c39ea9ec31902c9e8ee 100644 --- a/bin/htmlgen/makefile +++ b/bin/htmlgen/makefile @@ -26,7 +26,7 @@ gen_html: @mkdir -p $(OUT_DIR)/build @echo Output Directory is $(OUT_DIR)/build @echo Filelist is $(FILELIST) - $(MAKE) -C $(SOCLABS_NANOSOC_TECH_DIR) defs_gen + $(MAKE) -C $(SOCLABS_NANOSOC_TECH_DIR) gen_defs @(cd $(OUT_DIR)/build; \ rm *.html; rm *.gif; \ $(SOCLABS_SOCTOOLS_FLOW_DIR)/bin/filelist_compile.py -ea -f $(FILELIST) -o $(OUTPUT_FILELIST) ; \