From 6f877db13e423a1b7f0cfd9108dba69bf02ca9bb Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Fri, 6 Jun 2014 13:04:38 +0000
Subject: [PATCH] Renamed and relocated modelsim_libraries_<technologyName>.txt
 into hdl_libraries_<technologyName>.txt

---
 tools/oneclick/base/hdl_config.py      | 17 +++++++++++++++++
 tools/oneclick/base/modelsim_config.py | 24 ++++--------------------
 2 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/tools/oneclick/base/hdl_config.py b/tools/oneclick/base/hdl_config.py
index cf279a0674..998d908369 100644
--- a/tools/oneclick/base/hdl_config.py
+++ b/tools/oneclick/base/hdl_config.py
@@ -162,6 +162,23 @@ class HdlConfig:
                 for lib in lib_order:
                     fp.write('%s ' % lib)
 
+    def read_hdl_libraries_technology_file(self, technologyName, filePath=None):
+        """Read the list of technology HDL libraries from a file.
+        
+           Arguments:
+           - technologyName : refers to the hdl_libraries_<technologyName>.txt file
+           - filePath       : path to hdl_libraries_<technologyName>.txt, when None then the file is
+                              read in the default toolRootDir
+        """
+        fileName = 'hdl_libraries_' + technologyName + '.txt'                  # use fixed file name format
+        if filePath==None:
+            toolSubDir = self.tool.get_key_values('synth_tool_name')
+            fileNamePath=os.path.join(self.toolRootDir, toolSubDir, fileName)  # default file path
+        else:
+            fileNamePath=os.path.join(filePath, fileName)                      # specified file path
+        tech_dict = self.tool.read_dict_file(fileNamePath)
+        return tech_dict
+    
 if __name__ == '__main__':
     # Read the dictionary info from all HDL tool and library configuration files in the current directory and the sub directories
     libRootDir = 'RADIOHDL'
diff --git a/tools/oneclick/base/modelsim_config.py b/tools/oneclick/base/modelsim_config.py
index 3031397e0c..5557dff0e1 100644
--- a/tools/oneclick/base/modelsim_config.py
+++ b/tools/oneclick/base/modelsim_config.py
@@ -44,9 +44,9 @@ class ModelsimConfig(hdl_config.HdlConfig):
            
            - hdllib.cfg : HDL library configuration dictionary file. One file for each HDL library.
            
-           - modelsim_libraries_<technologyName>.txt : Dictionary file with the technology libraries for the FPGA device that
+           - hdl_libraries_<technologyName>.txt : Dictionary file with the technology libraries for the FPGA device that
              come with the synthesis tool. The keys are the library names and the values are the paths. The file needs to be
-             created manually and can be read by read_modelsim_technology_libraries_file().
+             created manually and can be read by read_hdl_libraries_technology_file().
              
            - modelsim_project_files.txt
              The modelsim_project_files.txt file is a dictionary file with the list the Modelsim project files for all HDL
@@ -99,7 +99,7 @@ class ModelsimConfig(hdl_config.HdlConfig):
         """Create the Modelsim project file for all technology libraries and RTL HDL libraries.
         
            Arguments:
-           - technologyName : refers to the modelsim_libraries_<technologyName>.txt file.
+           - technologyName : refers to the hdl_libraries_<technologyName>.txt file.
            - lib_names      : one or more HDL libraries
         """
         if lib_names==None: lib_names=self.lib_names
@@ -115,7 +115,7 @@ class ModelsimConfig(hdl_config.HdlConfig):
                 # Write [Library] section for all used libraries
                 fp.write('[Library]\n')
                 # . vendor technology libs
-                tech_dict = self.read_modelsim_technology_libraries_file(technologyName)
+                tech_dict = self.read_hdl_libraries_technology_file(technologyName)
                 for lib_clause, lib_work in tech_dict.iteritems():
                     fp.write('%s = %s\n' % (lib_clause, lib_work))
                 # . all used libs for this lib_name
@@ -188,22 +188,6 @@ class ModelsimConfig(hdl_config.HdlConfig):
                 fp.write('IterationLimit = 100\n')
                 fp.write('DefaultRadix = decimal\n')
                 
-    def read_modelsim_technology_libraries_file(self, technologyName, filePath=None):
-        """Read the list of technology libraries from a file.
-        
-           Arguments:
-           - technologyName : refers to the modelsim_libraries_<technologyName>.txt file
-           - filePath       : path to modelsim_libraries_<technologyName>.txt, when None then the file is
-                              read in the default toolRootDir
-        """
-        fileName = 'modelsim_libraries_' + technologyName + '.txt'             # use fixed file name format
-        if filePath==None:
-            fileNamePath=os.path.join(self.toolRootDir, 'modelsim', fileName)  # default file path
-        else:
-            fileNamePath=os.path.join(filePath, fileName)                      # specified file path
-        tech_dict = self.tool.read_dict_file(fileNamePath)
-        return tech_dict
-    
     def create_modelsim_project_files_file(self, filePath=None, lib_names=None):
         """Create file with list of the Modelsim project files for all HDL libraries.
         
-- 
GitLab