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

Create *_lib.qip and qsf with toplevel settings at the end.

parent cb28104f
No related branches found
No related tags found
No related merge requests found
......@@ -620,23 +620,47 @@ d) hdllib.cfg key descriptions
not exist then no QPF and QSF are created. The 'synth_top_level_entity' key specifies the top level entity in the HDL library that will be the
top level for synthesis. If the key value is '' then the 'hdl_lib_name' is taken as top level entity name.
* Created QPF:
- It only states that there is one revision that has the name of the 'synth_top_level_entity'. The Quartus scheme for revisions is not used.
Instead the RadioHDL scheme of defining design revisions as separate HDL libraries is used.
* Created QSF:
- Defines the top level entity name using 'synth_top_level_entity'
- It sources the files listed by the 'quartus_qsf_files' key, this is typically a board qsf that defines settings that are common to all
designs that target that board, eg. unb1_board.qsf.
- It sources all library QIP files <lib_name>_lib.qip that are needed by the design. The library QIP files are sourced in dependency order
so that the top level design <lib_name>_lib.qip is sourced last. In this way the top level design constraints are at the end.
* Created <lib_name>_lib.qip files
The <lib_name>_lib.qip files are created for each library using the following keys in this order:
- hdl_lib_uses_synth -- used for all HDL libraries
- quartus_vhdl_files -- used for IP libraries that have different HDL file for sim and for synth (typically not needed for most IP)
- quartus_qip_files -- used for IP libraries (constaints for the IP), top level design libraries (SOPC or QSYS MMM, e.g. sopc_unb1_minimal.qip)
- quartus_tcl_files -- used for top level design libraries (pinning definitions, e.g. unb1_minimal_pins.tcl)
- quartus_sdc_files -- used for top level design libraries (timing constraints, e.g. unb1_board.sdc)
- quartus_qsf_files =
See also 'synth_top_level_entity' description.
One or more .qsf files that need to be included in the HDL library qsf file for Quartus synthesis of a 'synth_top_level_entity' VHDL file.
- quartus_tcl_files =
One or more .tcl files that need to be included in the HDL library qip file for Quartus synthesis.
- quartus_vhdl_files =
See also 'synth_top_level_entity' description.
One or more .vhdl files that need to be included in the HDL library qip file for Quartus synthesis. These are VHDL files that must not be
simulated so the are not listed at the 'synth_files' key. This can typically occur for technology IP libraries where e.g. a .vhd file is used
for synthesis and a .vho file for simulation like in the tse_sqmii_lvds HDL library.
- quartus_sdc_files =
One or more .sdc files that need to be included in the HDL library qip file for Quartus synthesis.
- quartus_qip_files =
See also 'synth_top_level_entity' description.
One or more .qip files that need to be included in the HDL library qip file for Quartus synthesis.
- quartus_tcl_files =
See also 'synth_top_level_entity' description.
One or more .tcl files that need to be included in the HDL library qip file for Quartus synthesis.
- quartus_sdc_files =
See also 'synth_top_level_entity' description.
One or more .sdc files that need to be included in the HDL library qip file for Quartus synthesis.
4) Porting from $UNB to $RADIOHDL
......
......@@ -73,7 +73,7 @@ class QuartusConfig(hdl_config.HdlConfig):
- lib_names : one or more HDL libraries
"""
if lib_names==None: lib_names=self.lib_names
lib_dicts = self.libs.get_dicts('hdl_lib_name', lib_names)
lib_dicts = self.libs.get_dicts('hdl_lib_name', values=lib_names)
for lib_dict in cm.listify(lib_dicts):
# Open qip
lib_name = lib_dict['hdl_lib_name']
......@@ -118,6 +118,14 @@ class QuartusConfig(hdl_config.HdlConfig):
fp.write('set_global_assignment -name VHDL_FILE %s\n' % filePathName)
if 'quartus_qip_files' in lib_dict:
fp.write('\n')
fp.write('# quartus_qip_files\n')
quartus_qip_files = lib_dict['quartus_qip_files'].split()
for fn in quartus_qip_files:
filePathName = cm.expand_file_path_name(fn, lib_path)
fp.write('set_global_assignment -name QIP_FILE %s\n' % filePathName)
if 'quartus_tcl_files' in lib_dict:
fp.write('\n')
fp.write('# quartus_tcl_files\n')
......@@ -134,14 +142,6 @@ class QuartusConfig(hdl_config.HdlConfig):
filePathName = cm.expand_file_path_name(fn, lib_path)
fp.write('set_global_assignment -name SDC_FILE %s\n' % filePathName)
if 'quartus_qip_files' in lib_dict:
fp.write('\n')
fp.write('# quartus_qip_files\n')
quartus_qip_files = lib_dict['quartus_qip_files'].split()
for fn in quartus_qip_files:
filePathName = cm.expand_file_path_name(fn, lib_path)
fp.write('set_global_assignment -name QIP_FILE %s\n' % filePathName)
def create_quartus_project_file(self, lib_names=None):
"""Create the Quartus project file (QPF) for all HDL libraries that have a toplevel entity key synth_top_level_entity.
......@@ -208,9 +208,11 @@ class QuartusConfig(hdl_config.HdlConfig):
fp.write('set_global_assignment -name SOURCE_TCL_SCRIPT_FILE %s\n' % filePathName)
fp.write('\n')
fp.write('# all used HDL library qip files\n')
fp.write('# All used HDL library *_lib.qip files in order with top level last\n')
use_lib_names = self.derive_all_use_libs('synth', lib_name)
use_lib_dicts = self.libs.get_dicts('hdl_lib_name', use_lib_names)
use_lib_order = self.derive_lib_order('synth', use_lib_names)
#use_lib_dicts = self.libs.get_dicts('hdl_lib_name', values=use_lib_order) # uses original libs.dicts order, but
use_lib_dicts = self.get_lib_dicts_from_lib_names(lib_names=use_lib_order) # must preserve use_lib_order order to ensure that top level design qip with sdc file is include last in qsf
for lib_dict in cm.listify(use_lib_dicts):
qip_path = self.get_lib_build_dirs('synth', lib_dicts=lib_dict)
qip_name = lib_dict['hdl_lib_name'] + '_lib.qip'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment