OpenCores
URL https://opencores.org/ocsvn/radiohdl/radiohdl/trunk

Subversion Repositories radiohdl

[/] [radiohdl/] [trunk/] [doc/] [radiohdl_hdl_tool_quartus.md] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 danv
# RadioHDL tool settings for Quartus
2
 
3
---
4
#### Document history:
5
|Revision|Date|Author|Affiliation|Modification|
6
|:---|:---|:---|:---|:---|
7
|1.0|27 jan 2020|E. Kooistra|ASTRON |Created.|
8
 
9
---
10
#### Contents:
11
1   Introduction
12
1.1 Preconditions
13
1.2 Overview
14
2   Appendix:configuration files
15
2.1 hdl_tool_quartus.cfg
16
2.2 hdllib.cfg keys for Quartus
17
3   Appendix: hdl_tool_quartus.cfg
18
 
19
---
20
#### Terminology:
21
- FPGA = Field Programmable Gate Array
22
- HDL = Hardware Description Language
23
- IP = Intellectual Property
24
- QIP = Quartus Intellectual Property (file)
25
- QPF = Quartus Project File
26
- QSF = Quartus Setting File
27
 
28
---
29
#### References:
30
 
31
[1] radiohdl_user_guide.md
32
[2] radiohdl_hdl_buildset_uniboard1.md
33
[3] radiohdl_hdl_library_key_descriptions.md
34
 
35
---
36
## 1 Introduction
37
 
38
The RadioHDL package consists of a set of scripts that interpret configuration files and that setup or run other tools for HDL code development. This document describes how to use the RadioHDL command line tools [1] with the vendor tools from Intel/Altera.
39
 
40
### 1.1 Preconditions
41
 
42
Install a version of Quartus in $ALTERA_DIR/ (version 11.1 is used for UniBoard1, but for newer boards newer Intel/.Altera tool versions have been used too).
43
 
44
Setup the RadioHDL environment as explained in [1]. The RadioHDL for Quartus is configured using a hdl_tool_.cfg configuration = hdl_tool_quartus.cfg file, where the tool_name = quartus is defined in a hdl_buildset_.cfg configuration file. The hdl_tool_quartus.cfg is described in appendix 2.
45
 
46
### 1.2 Overview
47
 
48
The following RadioHDL tools are about preparing intermediate targets like project files and compiled or pre-generated IP:
49
 
50
* **compile_altera_simlibs** to compile fixed, standard Altera component libraries for simulation with Modelsim. For example PLL, block RAM, FIFO components.
51
* **generate_ip_libs** to pre-generate customized, parameterizable IP components for simulation and synthesis, using Altera MegaWizard or Altera QSYS. For example a 10GbE MAC, a DDR4 PHY controller. The custom IP is generated for HDL libraries that have a [generate_ip_libs] section with one or more _ip_files keys. The supported IP tools are defined at the ip_tools key in the hdl_tool_quartus.cfg
52
* **quartus_config** to create Quartus project files (qpf, qsf, qip) for all HDL libraries with a hdllib.cfg. All HDL libraries withsource code that can be synthesized will get a Quartus qip file. The HDL libraries with top level design will also get a Quartus qfp and qsf file.
53
* **run_sopc** to generate a Altera SOPC memory mapped (MM) bus with NiosII, for an HDL library that has an sopc file
54
* **run_qsys** to generate a Altera QSYS memory mapped (MM) bus with NiosII, for an HDL library that has an qsys file
55
 
56
Internally **run_sopc** and **run_qsys** can also build the software that runs on the NiosII softcore processor. For this they use **run_app**, which calls **run_bsp** and **run_reg**. The **run_reg** calls **run_mif**.
57
 
58
The following tools are about synthesis and to build an image that can run on an FPGA:
59
 
60
* **run_quartus** to start Altera Quartus GUI for synthesis of an HDL library with a top level design
61
* **run_qcomp** to synthesize a top level design from the command line. Use option --seed to rerun the synthesis for different seeds, which can make a difference to achieve timing closure.
62
* **run_rbf** to create an Altera FPGA rbf file from an FPGA sof file, to boot the FPGA from flash
63
 
64
For an example of how to use these RadioHDL scripts please see how they are used for HDL firmware development for UniBoard1 [2].
65
 
66
For hdllib.cfg configuration file examples that are used by **generate_ip_libs** and **quartus_config** please see [3].
67
 
68
---
69
## 2 Appendix: configuration files
70
 
71
### 2.1 hdl_tool_quartus.cfg
72
 
73
This appendix describes the keys that are used in the hdl_tool_quartus configuration file that is located in $RADIOHDL_GEAR/config.
74
 
75
***quartus_rootdir***, ***quartus_rootdir_override*** and ***niosdir***
76
Quartus needs these three environment variables in order to operate properly. Note that you can refer to environment variables that you have defined in your buildset file.
77
 
78
***quartus_paths***
79
List of paths that are needed to run Quartus programs. Sometimes paths differ slightly between several versions of a tool. Just mention all paths here because paths that do not exist (for your  version) are not added to your PATH variable.
80
 
81
#### 2.1.1 []
82
For the tools you mentioned in the key 'block_design_names' of your hdl_buildset file you can define two keys that are automatically recognized by RadioHDL. These keys are:
83
 
84
- _paths: the paths to add to your PATH variable.
85
- _environment_variables: the environment variables this tool need. Note that the name of environment variable and de value of the environment variable are separated by a space.
86
 
87
#### 2.1.2 [ip generation]
88
This section defines the tools and their options that will be used for the generation of the IP libraries. Currently the generate_ip_libs executable from RadioHDL supports three generation tools: qmegawiz, qsys-generate and quartus_sh. For each of these tools you can define a key _default_options that contains the default options to add to the commandline when running this tool. Options that are lib-specific are defined in the hdllib.cfg file. In those files the key _extra_options can be used to add other flags/arguments to the IP compilation.
89
 
90
#### 2.1.3 [user settings]
91
Finally you can define paths and environment variables that are specific for you own need. The keys user_paths and user_environment_variables are recognized by RadioHDL.
92
 
93
 
94
### 2.2 hdllib.cfg keys for Quartus
95
 
96
This appendix describes the keys that are used in the [quartus_project_files] section of the hdllib.cfg configuration file. Please see [2] and [3] for hdllib.cfg configuration file examples that use these Quartus specific keys.
97
 
98
***quartus_copy_files***
99
Copy listed all directories and files for synthesis with Quartus, used when tool_name_synth = quartus in hdl_buildset_.cfg. Can be used to e.g. copy SOPC or QSYS file from the hdllib.cfg location directory to the build directory where the Quartus project file is and that is where the run_* bash commands expect them to be.
100
 
101
***synth_top_level_entity***
102
When this key exists then a Quartus project file (QPF) and Quartus settings file (QSF) will be created for this HDL library. If this key does 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 empty '' then the 'hdl_lib_name' is taken as top level entity name. The 'synth_top_level_entity' key in a library indicates that the library is a design library that can be synthesized to yield an FPGA image. A design library should not depend on another design library with a 'synth_top_level_entity' key, because then there may occur conflicting or double design constraints for Quartus.
103
 
104
* Created QPF:
105
  - 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 [1].
106
* Created QSF:
107
  - Defines the top level entity name using 'synth_top_level_entity'
108
  - 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.
109
  - It sources all library QIP files _lib.qip that are needed by the design. The library QIP files are sourced in dependency order so that the top level design _lib.qip is sourced last. In this way the top level design constraints are at the end.
110
* Created _lib.qip files:
111
The _lib.qip files are created for each library using the following keys in this order:
112
  - hdl_lib_uses_synth   -- used for all HDL libraries
113
  - quartus_vhdl_files   -- used for IP libraries that have different HDL file for sim and for synth (typically not needed for most IP)
114
  - quartus_qip_files    -- used for IP libraries (constraints for the IP), top level design libraries (SOPC or QSYS MMM-bus, e.g. sopc_unb1_minimal.qip)
115
  - quartus_tcl_files    -- used for top level design libraries (pinning definitions, e.g. unb1_minimal_pins.tcl)
116
  - quartus_sdc_files    -- used for top level design libraries (timing constraints, e.g. unb1_board.sdc)
117
 
118
***quartus_qsf_files*** (see also 'synth_top_level_entity' description)
119
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.
120
 
121
***quartus_vhdl_files*** (see also 'synth_top_level_entity' description)
122
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 they 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.
123
 
124
***quartus_qip_files***  (see also 'synth_top_level_entity' description)
125
One or more .qip files that need to be included in the HDL library qip file for Quartus synthesis.
126
 
127
***quartus_tcl_files***  (see also 'synth_top_level_entity' description)
128
One or more .tcl files that need to be included in the HDL library qip file for Quartus synthesis.
129
 
130
***quartus_sdc_files***  (see also 'synth_top_level_entity' description)
131
One or more .sdc files that need to be included in the HDL library qip file for Quartus synthesis.
132
 
133
---
134
## 3 Appendix: hdl_tool_quartus.cfg
135
 
136
Tool configuration file for Intel/Altera Quartus from $RADIOHDL_GEAR/config.
137
```
138
# configuration file for defining the quartus installation on this system
139
quartus_rootdir          = ${QUARTUS_DIR}/quartus
140
quartus_rootdir_override = ${QUARTUS_DIR}/quartus
141
niosdir                  = ${QUARTUS_DIR}/nios2eds
142
 
143
# extension to the PATH variable
144
quartus_paths =
145
    /bin
146
    /bin
147
    /bin/gnu/H-i686-pc-linux-gnu/bin
148
    /bin/gnu/H-x86_64-pc-linux-gnu/bin
149
    /sdk2/bin
150
 
151
[sopc]
152
sopc_paths =
153
    /sopc_builder/bin
154
sopc_environment_variables =
155
    sopc_kit_nios2      
156
 
157
[qsys]
158
qsys_paths =
159
    /../qsys/bin
160
 
161
[ip generation]
162
ip_tools                      = qmegawiz qsys-generate quartus_sh
163
qmegawiz_default_options      = -silent
164
qsys-generate_default_options = --synthesis=VHDL --simulation=VHDL --allow-mixed-language-simulation --block-symbol-file
165
quartus_sh_default_options    =
166
 
167
[user settings]
168
user_paths =
169
user_environment_variables =
170
    altera_hw_tcl_keep_temp_files 1
171
 
172
#unb_compile_stamps 1
173
```
174
 
175
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.