Skip to content
Snippets Groups Projects
Commit fbbc1c2b authored by Daniel Newbrook's avatar Daniel Newbrook
Browse files

Add ASIC Flow for filelist compile

parent 039acb1d
No related branches found
No related tags found
No related merge requests found
......@@ -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")
......
......@@ -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) ; \
......
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