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

Move technolgyNames from command line to hdltool.cfg. Introduced toolset level in build dir.

parent 40a89b13
Branches
No related tags found
No related merge requests found
...@@ -32,20 +32,22 @@ import argparse ...@@ -32,20 +32,22 @@ import argparse
class QuartusConfig(hdl_config.HdlConfig): class QuartusConfig(hdl_config.HdlConfig):
def __init__(self, toolRootDir, libFileName='hdllib.cfg', toolFileName='hdltool.cfg', technologyNames=[]): def __init__(self, toolRootDir, libFileName='hdllib.cfg', toolFileName='hdltool_<toolset>.cfg'):
"""Get Quartus tool info from toolRootDir and all HDL library info from libRootDir. """Get Quartus tool info from toolRootDir and all HDL library info from libRootDir.
Arguments: Arguments:
- toolRootDir : Root directory from where the hdltool.cfg file is searched for. - toolRootDir : Root directory from where the hdltool_<toolset>.cfg file is searched for.
- libFileName : Default HDL library configuration file name - libFileName : Default HDL library configuration file name
- toolFileName : Default HDL tools configuration file name - toolFileName : Default HDL tools configuration file name
- technologyNames : Include all generic HDL libraries and these technology specific libraries
The libRootDir is defined in the hdltool.cfg file and is the root directory from where the hdllib.cfg The libRootDir is defined in the hdltool_<toolset>.cfg file and is the root directory from where the hdllib.cfg
files are searched for. files are searched for.
The technologyNames parameter is defined in the hdltool_<toolset>.cfg file. All generic HDL libraries and these
technology specific libraries are kept.
Files: Files:
- hdltool.cfg : HDL tool configuration dictionary file. One central file. - hdltool_<toolset>.cfg : HDL tool configuration dictionary file. One central file per toolset.
- hdllib.cfg : HDL library configuration dictionary file. One file for each HDL library. - hdllib.cfg : HDL library configuration dictionary file. One file for each HDL library.
...@@ -55,7 +57,7 @@ class QuartusConfig(hdl_config.HdlConfig): ...@@ -55,7 +57,7 @@ class QuartusConfig(hdl_config.HdlConfig):
- <lib_name>.qsf : Quartus settings file (QSF) for a certain HDL library based on the hdllib.cfg. The file is created by - <lib_name>.qsf : Quartus settings file (QSF) for a certain HDL library based on the hdllib.cfg. The file is created by
create_quartus_settings_file(). There is one QSF per Quartus synthesis project. create_quartus_settings_file(). There is one QSF per Quartus synthesis project.
""" """
hdl_config.HdlConfig.__init__(self, toolRootDir, libFileName, toolFileName, technologyNames) hdl_config.HdlConfig.__init__(self, toolRootDir, libFileName, toolFileName)
def create_quartus_ip_lib_file(self, lib_names=None): def create_quartus_ip_lib_file(self, lib_names=None):
"""Create the Quartus IP file <hdl_lib_name>_lib.qip for all HDL libraries. The <hdl_lib_name>.qip file contains the list of files that are given """Create the Quartus IP file <hdl_lib_name>_lib.qip for all HDL libraries. The <hdl_lib_name>.qip file contains the list of files that are given
...@@ -218,23 +220,22 @@ class QuartusConfig(hdl_config.HdlConfig): ...@@ -218,23 +220,22 @@ class QuartusConfig(hdl_config.HdlConfig):
if __name__ == '__main__': if __name__ == '__main__':
# Read the dictionary info from all HDL tool and library configuration files in the current directory and the sub directories # Read the dictionary info from all HDL tool and library configuration files in the current directory and the sub directories
technologySelect = ['ip_stratixiv', 'ip_arria10'] toolsetSelect = ['unb1', 'unb2']
arghelp_str = 'choose technology %s (default: %s)' % (technologySelect,technologySelect[0]) arghelp_str = 'choose toolset %s (default: %s)' % (toolsetSelect,toolsetSelect[0])
argparser = argparse.ArgumentParser(description='Create Quartus project file (QPF) for all hdllib.cfg') argparser = argparse.ArgumentParser(description='Create Modelsim mpf files for all hdllib.cfg')
argparser.add_argument('-t','--technology', help=arghelp_str, default=technologySelect[0], required=False) argparser.add_argument('-t','--toolset', help=arghelp_str, default=toolsetSelect[0], required=False)
args = vars(argparser.parse_args()) args = vars(argparser.parse_args())
if args['technology'] not in technologySelect: if args['toolset'] not in toolsetSelect:
print 'Technology %s is not supported' % args['technology'] print 'Toolset %s is not supported' % args['toolset']
print 'Hint: give argument -h for possible options' print 'Hint: give argument -h for possible options'
sys.exit(1) sys.exit(1)
toolset = args['toolset']
#technologyNames = 'ip_stratixiv' toolFileName = 'hdltool_' + toolset + '.cfg'
technologyNames = args['technology']
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='hdltool.cfg', technologyNames=technologyNames)
print '#' print '#'
print '# QuartusConfig:' print '# QuartusConfig:'
...@@ -259,14 +260,14 @@ if __name__ == '__main__': ...@@ -259,14 +260,14 @@ if __name__ == '__main__':
qsyn.create_quartus_ip_lib_file() qsyn.create_quartus_ip_lib_file()
print '' print ''
print 'Copy Quartus directories and files from HDL library source tree to build_dir_synth for all HDL libraries that are found in $%s.' % qsyn.libRootDir print 'Copy Quartus directories and files from HDL library source tree to build_dir for all HDL libraries that are found in $%s.' % qsyn.libRootDir
qsyn.copy_files('synth') qsyn.copy_files('synth')
print '' print ''
print 'Create Quartus project files (QPF) for technology %s and all HDL libraries with a top level entity for synthesis that are found in $%s.' % (technologyNames, qsyn.libRootDir) print 'Create Quartus project files (QPF) for technology %s and all HDL libraries with a top level entity for synthesis that are found in $%s.' % (qsyn.technologyNames, qsyn.libRootDir)
qsyn.create_quartus_project_file() qsyn.create_quartus_project_file()
print '' print ''
print 'Create Quartus settings files (QSF) for technology %s and all HDL libraries with a top level entity for synthesis that are found in $%s.' % (technologyNames, qsyn.libRootDir) print 'Create Quartus settings files (QSF) for technology %s and all HDL libraries with a top level entity for synthesis that are found in $%s.' % (qsyn.technologyNames, qsyn.libRootDir)
qsyn.create_quartus_settings_file() qsyn.create_quartus_settings_file()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment