Skip to content
Snippets Groups Projects
Commit 742a0824 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Moved arg parser before mode selection. Rename arg_toolFileName.

parent d8124222
No related branches found
No related tags found
No related merge requests found
......@@ -337,7 +337,6 @@ if __name__ == '__main__':
# 5 = Remove a new key = value pair from all hdllib.cfg dict files
mode = 0
if mode==0:
# Parse command line arguments
toolsetSelect = ['unb1', 'unb2', 'unb2a']
......@@ -351,12 +350,13 @@ if __name__ == '__main__':
print 'Toolset %s is not supported' % arg_toolset
print 'Hint: give argument -h for possible options'
sys.exit(1)
toolFileName = 'hdltool_' + arg_toolset + '.cfg'
arg_toolFileName = 'hdltool_' + arg_toolset + '.cfg'
arg_verbosity = args['verbosity']
if mode==0:
# Read the dictionary info from all HDL tool and library configuration files in the current directory and the sub directories
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=toolFileName)
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=arg_toolFileName)
print '#'
print '# HdlConfig:'
print '#'
......@@ -423,7 +423,7 @@ if __name__ == '__main__':
key = 'build_dir'
new_value = '$HDL_BUILD_DIR'
# Read the dictionary info from all HDL tool and library configuration files in the current directory and the sub directories
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName='hdltool_unb1.cfg')
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=arg_toolFileName)
for p in hdl.libs.filePathNames:
hdl.libs.change_key_value_in_dict_file(p, key, new_value)
......@@ -432,16 +432,16 @@ if __name__ == '__main__':
insert_value = ''
insertLineNr = 4
# Read the dictionary info from all HDL tool and library configuration files in the current directory and the sub directories
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName='hdltool_unb1.cfg')
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=arg_toolFileName)
for p in hdl.libs.filePathNames:
hdl.libs.insert_key_in_dict_file_at_line_number(p, insert_key, insert_value, insertLineNr)
if mode==3:
insert_key = 'hdl_lib_uses_sim'
insert_key = '[quartus_project_file]'
insert_value = '\n'
insert_beforeKey = 'hdl_lib_technology'
insert_beforeKey = 'synth_files'
# Read the dictionary info from all HDL tool and library configuration files in the current directory and the sub directories
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName='hdltool_unb1.cfg')
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=arg_toolFileName)
for p in hdl.libs.filePathNames:
hdl.libs.insert_key_in_dict_file_before_another_key(p, insert_key, insert_value, insert_beforeKey)
......@@ -449,13 +449,13 @@ if __name__ == '__main__':
old_key = 'hdl_lib_uses'
new_key = 'hdl_lib_uses_synth'
# Read the dictionary info from all HDL tool and library configuration files in the current directory and the sub directories
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName='hdltool_unb1.cfg')
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=arg_toolFileName)
for p in hdl.libs.filePathNames:
hdl.libs.rename_key_in_dict_file(p, old_key, new_key)
if mode==5:
remove_key = 'modelsim_search_libraries'
# Read the dictionary info from all HDL tool and library configuration files in the current directory and the sub directories
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName='hdltool_unb1.cfg')
hdl = HdlConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=arg_toolFileName)
for p in hdl.libs.filePathNames:
hdl.libs.remove_key_from_dict_file(p, remove_key)
......@@ -210,7 +210,7 @@ class ModelsimConfig(hdl_config.HdlConfig):
elif file_ext=='v':
project_file_p_defaults_file_specific = project_file_p_defaults_verilog
else:
print '\nERROR - Undefined file extension in synth_files:', synth_files[i]
print '\nERROR - Undefined file extension in synth_files:', lib_name, synth_files[i]
sys.exit()
fp.write('Project_File_P_%d = folder %s compile_order %d %s\n' % (offset+i, project_folders[-1], offset+i, project_file_p_defaults_hdl+' '+project_file_p_defaults_file_specific))
......@@ -228,7 +228,7 @@ class ModelsimConfig(hdl_config.HdlConfig):
elif file_ext=='v':
project_file_p_defaults_file_specific = project_file_p_defaults_verilog
else:
print '\nERROR - Undefined file extension in test_bench_files:', test_bench_files[i]
print '\nERROR - Undefined file extension in test_bench_files:', lib_name, test_bench_files[i]
sys.exit()
fp.write('Project_File_P_%d = folder %s compile_order %d %s\n' % (offset+i, project_folders[-1], offset+i, project_file_p_defaults_hdl+' '+project_file_p_defaults_file_specific))
......@@ -308,9 +308,6 @@ if __name__ == '__main__':
# hdllib.cfg. The hdllib.cfg still does need some manual editing to set the proper key and paths.
mode = 0
if mode==0:
# Read the dictionary info from all HDL tool and library configuration files in the current directory and the sub directories
# Parse command line arguments
toolsetSelect = ['unb1', 'unb2', 'unb2a']
......@@ -324,12 +321,15 @@ if __name__ == '__main__':
print 'Toolset %s is not supported' % arg_toolset
print 'Hint: give argument -h for possible options'
sys.exit(1)
toolFileName = 'hdltool_' + arg_toolset + '.cfg'
arg_toolFileName = 'hdltool_' + arg_toolset + '.cfg'
arg_verbosity = args['verbosity']
if mode==0:
# Read the dictionary info from all HDL tool and library configuration files in the current directory and the sub directories
# Create and use msim object
msim = ModelsimConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=toolFileName)
msim = ModelsimConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=arg_toolFileName)
if arg_verbosity>=2:
print '#'
......
......@@ -243,12 +243,12 @@ if __name__ == '__main__':
print 'Toolset %s is not supported' % arg_toolset
print 'Hint: give argument -h for possible options'
sys.exit(1)
toolFileName = 'hdltool_' + arg_toolset + '.cfg'
arg_toolFileName = 'hdltool_' + arg_toolset + '.cfg'
arg_verbosity = args['verbosity']
# Create and use qsyn object
qsyn = QuartusConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=toolFileName)
qsyn = QuartusConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=arg_toolFileName)
if arg_verbosity>=2:
print '#'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment