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

Renamed and relocated modelsim_libraries_<technologyName>.txt into...

Renamed and relocated modelsim_libraries_<technologyName>.txt into hdl_libraries_<technologyName>.txt
parent 7542ca72
No related branches found
No related tags found
No related merge requests found
...@@ -162,6 +162,23 @@ class HdlConfig: ...@@ -162,6 +162,23 @@ class HdlConfig:
for lib in lib_order: for lib in lib_order:
fp.write('%s ' % lib) 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__': 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
libRootDir = 'RADIOHDL' libRootDir = 'RADIOHDL'
......
...@@ -44,9 +44,9 @@ class ModelsimConfig(hdl_config.HdlConfig): ...@@ -44,9 +44,9 @@ class ModelsimConfig(hdl_config.HdlConfig):
- 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.
- 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 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 - modelsim_project_files.txt
The modelsim_project_files.txt file is a dictionary file with the list the Modelsim project files for all HDL 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): ...@@ -99,7 +99,7 @@ class ModelsimConfig(hdl_config.HdlConfig):
"""Create the Modelsim project file for all technology libraries and RTL HDL libraries. """Create the Modelsim project file for all technology libraries and RTL HDL libraries.
Arguments: 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 - lib_names : one or more HDL libraries
""" """
if lib_names==None: lib_names=self.lib_names if lib_names==None: lib_names=self.lib_names
...@@ -115,7 +115,7 @@ class ModelsimConfig(hdl_config.HdlConfig): ...@@ -115,7 +115,7 @@ class ModelsimConfig(hdl_config.HdlConfig):
# Write [Library] section for all used libraries # Write [Library] section for all used libraries
fp.write('[Library]\n') fp.write('[Library]\n')
# . vendor technology libs # . 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(): for lib_clause, lib_work in tech_dict.iteritems():
fp.write('%s = %s\n' % (lib_clause, lib_work)) fp.write('%s = %s\n' % (lib_clause, lib_work))
# . all used libs for this lib_name # . all used libs for this lib_name
...@@ -188,22 +188,6 @@ class ModelsimConfig(hdl_config.HdlConfig): ...@@ -188,22 +188,6 @@ class ModelsimConfig(hdl_config.HdlConfig):
fp.write('IterationLimit = 100\n') fp.write('IterationLimit = 100\n')
fp.write('DefaultRadix = decimal\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): 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. """Create file with list of the Modelsim project files for all HDL libraries.
......
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