From da967737b42010df7ca031817fa8dcfadfda2fc6 Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Mon, 20 Apr 2015 12:59:25 +0000
Subject: [PATCH] Move technolgyNames from command line to hdltool.cfg.
 Introduced toolset level in build dir.

---
 tools/oneclick/base/quartus_config.py | 41 ++++++++++++++-------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/tools/oneclick/base/quartus_config.py b/tools/oneclick/base/quartus_config.py
index 62e1264d9e..c105a00ed8 100755
--- a/tools/oneclick/base/quartus_config.py
+++ b/tools/oneclick/base/quartus_config.py
@@ -32,20 +32,22 @@ import argparse
 
 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.
         
            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
            - 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.
            
+           The technologyNames parameter is defined in the hdltool_<toolset>.cfg file. All generic HDL libraries and these
+           technology specific libraries are kept.
+           
            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.
            
@@ -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
                               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):
         """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):
 
 if __name__ == '__main__':
     # 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])
-    argparser = argparse.ArgumentParser(description='Create Quartus project file (QPF) for all hdllib.cfg')
-    argparser.add_argument('-t','--technology', help=arghelp_str, default=technologySelect[0], required=False)
+    arghelp_str = 'choose toolset %s (default: %s)' % (toolsetSelect,toolsetSelect[0])
+    argparser = argparse.ArgumentParser(description='Create Modelsim mpf files for all hdllib.cfg')
+    argparser.add_argument('-t','--toolset', help=arghelp_str, default=toolsetSelect[0], required=False)
     args = vars(argparser.parse_args())
 
-    if args['technology'] not in technologySelect:
-        print 'Technology %s is not supported' % args['technology']
+    if args['toolset'] not in toolsetSelect:
+        print 'Toolset %s is not supported' % args['toolset']
         print 'Hint: give argument -h for possible options'
         sys.exit(1)
 
-
-    #technologyNames = 'ip_stratixiv'
-    technologyNames = args['technology']
-
-    qsyn = QuartusConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName='hdltool.cfg', technologyNames=technologyNames)
+    toolset = args['toolset']
+    toolFileName = 'hdltool_' + toolset + '.cfg'
+ 
+    qsyn = QuartusConfig(toolRootDir=os.path.expandvars('$RADIOHDL/tools'), libFileName='hdllib.cfg', toolFileName=toolFileName)
         
     print '#'
     print '# QuartusConfig:'
@@ -259,14 +260,14 @@ if __name__ == '__main__':
     qsyn.create_quartus_ip_lib_file()
     
     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')
     
     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()
 
     
     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()
-- 
GitLab