1 |
29 |
wfjm |
# $Id: README_buildsystem_Vivado.txt 651 2015-02-26 21:32:15Z mueller $
|
2 |
|
|
|
3 |
|
|
Guide to the Build System (Xilinx Vivado Version)
|
4 |
|
|
|
5 |
|
|
Table of content:
|
6 |
|
|
|
7 |
|
|
1. Concept
|
8 |
|
|
2. Setup system environment
|
9 |
|
|
a. Setup environment variables
|
10 |
|
|
b. Compile UNISIM/UNIMACRO libraries for ghdl
|
11 |
|
|
3. Building test benches
|
12 |
|
|
a. With ghdl
|
13 |
|
|
4. Building systems
|
14 |
|
|
5. Configuring FPGAs (via make flow)
|
15 |
|
|
6. Note on ISE
|
16 |
|
|
|
17 |
|
|
1. Concept ----------------------------------------------------------------
|
18 |
|
|
|
19 |
|
|
This projects uses GNU make to
|
20 |
|
|
- generate bit files (with Vivado synthesis)
|
21 |
|
|
- generate test benches (with ghdl or Vivado XSim)
|
22 |
|
|
- configure the FPGA (with Vivado hardware server)
|
23 |
|
|
|
24 |
|
|
The Makefile's in general contain only a few definitions. By far most of
|
25 |
|
|
the build flow logic in Vivado is in tcl scripts, only a thin interface
|
26 |
|
|
layer is needed at the make level, which is concentrated in a few master
|
27 |
|
|
makefiles which are included.
|
28 |
|
|
|
29 |
|
|
Simulation and synthesis tools usually need a list of the VHDL source
|
30 |
|
|
files, sometimes in proper compilation order (libraries before components).
|
31 |
|
|
The different tools have different formats of these 'project descriptions.
|
32 |
|
|
|
33 |
|
|
The build system employed in this project is based on manifest files called
|
34 |
|
|
'vbom' or "VHDL bill of material" files
|
35 |
|
|
which list for each vhdl source file the libraries and sources for the
|
36 |
|
|
instantiated components, the later via their vbom, and last but not least
|
37 |
|
|
the name of the vhdl source file.
|
38 |
|
|
All file name are relative to the current directory. A recursive traversal
|
39 |
|
|
through all vbom's gives for each vhld module all sources needed to compile
|
40 |
|
|
it. The vbomconv script in tools/bin does this, and generates depending on
|
41 |
|
|
options
|
42 |
|
|
- make dependency files
|
43 |
|
|
- Vivado synthesis setup files
|
44 |
|
|
- Vivado simulation setup files
|
45 |
|
|
- ghdl commands for analysis, inspection and make step
|
46 |
|
|
|
47 |
|
|
The master make files contain pattern rules like
|
48 |
|
|
%.bit : %.vbom -- create bit file
|
49 |
|
|
% : %.vbom -- build functional model test bench
|
50 |
|
|
which encapsulate all the vbomconv magic
|
51 |
|
|
|
52 |
|
|
A full w11a system is build from about 100 source files, test benches
|
53 |
|
|
from even more. Using the vbom's a large number of designs can be easily
|
54 |
|
|
maintained.
|
55 |
|
|
|
56 |
|
|
For more details on vbomconv consult the man page.
|
57 |
|
|
|
58 |
|
|
2. Setup system environment -----------------------------------------------
|
59 |
|
|
|
60 |
|
|
2a. Setup environment variables --------------------------------------
|
61 |
|
|
|
62 |
|
|
The build flows require the environment variables:
|
63 |
|
|
|
64 |
|
|
- RETROBASE: must refer to the installation root directory
|
65 |
|
|
- XTWV_PATH: install path of the Vivado version
|
66 |
|
|
|
67 |
|
|
For general instructions on environment see INSTALL.txt .
|
68 |
|
|
|
69 |
|
|
Notes:
|
70 |
|
|
- The build system uses a small wrapper script called xtwv to encapsulate
|
71 |
|
|
the Xilinx environment. It uses XTWV_PATH to setup the Vivado environment
|
72 |
|
|
on the fly. For details consult 'man xtwv'.
|
73 |
|
|
- don't run the Vivado setup scripts ..../settings(32|64).sh in your working
|
74 |
|
|
shell. Setup only XTWV_PATH !
|
75 |
|
|
|
76 |
|
|
2b. Compile UNISIM/UNIMACRO libraries for ghdl -----------------------
|
77 |
|
|
|
78 |
|
|
A few entities use UNISIM or UNIMACRO primitives, and post synthesis models
|
79 |
|
|
require also UNISIM primitives. In these cases ghdl has to link against a
|
80 |
|
|
compiled UNISIM or UNIMACRO libraries.
|
81 |
|
|
|
82 |
|
|
To make handling of the parallel installation of several Vivado versions
|
83 |
|
|
easy the compiled libraries are stored in sub-directories under $XTWV_PATH:
|
84 |
|
|
|
85 |
|
|
$XTWV_PATH/ghdl/unisim
|
86 |
|
|
$XTWV_PATH/ghdl/unimacro
|
87 |
|
|
|
88 |
|
|
A helper scripts will create these libraries:
|
89 |
|
|
|
90 |
|
|
cd $RETROBASE
|
91 |
|
|
xviv_ghdl_unisim # does UNISIM and UNIMACRO
|
92 |
|
|
|
93 |
|
|
Run these scripts for each Vivado version which is installed.
|
94 |
|
|
|
95 |
|
|
Notes:
|
96 |
|
|
- Vivado supports SIMPRIM libraries only in Verilog form, there is no vhdl
|
97 |
|
|
version anymore.
|
98 |
|
|
- ghdl can therefore not be used to do timing simulations with Vivado.
|
99 |
|
|
However: under ISE SIMPRIM was available in vhdl, but ghdl did never accept
|
100 |
|
|
the sdf files, making ghdl timing simulations impossible under ISE too.
|
101 |
|
|
|
102 |
|
|
3. Building test benches --------------------------------------------------
|
103 |
|
|
|
104 |
|
|
The build flows currently supports only ghdl.
|
105 |
|
|
Support for the Vivado simulator XSim will be added in a future release.
|
106 |
|
|
|
107 |
|
|
3a. With ghdl --------------------------------------------------------
|
108 |
|
|
|
109 |
|
|
To compile a ghdl based test bench named all is needed is
|
110 |
|
|
|
111 |
|
|
make
|
112 |
|
|
|
113 |
|
|
The make file will use .vbom, create all make dependency files,
|
114 |
|
|
and generate the needed ghdl commands.
|
115 |
|
|
|
116 |
|
|
In some cases the test benches can also be compiled against the gate
|
117 |
|
|
level models derived after the synthesis or optimize step. To compile them
|
118 |
|
|
|
119 |
|
|
make ghdl_tmp_clean
|
120 |
|
|
make _ssim # for post synthesis {see Notes}
|
121 |
|
|
make _osim # for post optimize {see Notes}
|
122 |
|
|
|
123 |
|
|
The 'make ghdl_tmp_clean' is needed to flush the ghdl work area from
|
124 |
|
|
the compilation remains of earlier functional model compiles.
|
125 |
|
|
|
126 |
|
|
Notes:
|
127 |
|
|
- post synthesis or optimize models currently very often fail to compile
|
128 |
|
|
in ghdl due to a bug in the ghdl code generator.
|
129 |
|
|
|
130 |
|
|
4. Building systems -------------------------------------------------------
|
131 |
|
|
|
132 |
|
|
To generate a bit file for a system named all is needed is
|
133 |
|
|
|
134 |
|
|
make .bit
|
135 |
|
|
|
136 |
|
|
The make file will use .vbom, create all make dependency files and
|
137 |
|
|
starts Vivado in batch mode with the proper scripts which will handle the
|
138 |
|
|
build steps. The log files and reports are conveniently renamed
|
139 |
|
|
|
140 |
|
|
_syn.log # synthesis log (from runme.log)
|
141 |
|
|
_imp.log # implementation log (from runme.log)
|
142 |
|
|
_bit.log # write_bitstream log (from runme.log)
|
143 |
|
|
|
144 |
|
|
_syn_util.rpt # (from _utilization_synth.rpt)
|
145 |
|
|
_opt_drc.rpt # (from _opt_drc.rpt)
|
146 |
|
|
_pla_io.rpt # (from _io_placed.rpt)
|
147 |
|
|
_pla_clk.rpt # (from _clock_utilization_placed.rpt)
|
148 |
|
|
_pla_util.rpt # (from _utilization_placed.rpt)
|
149 |
|
|
_pla_cset.rpt # (from _control_sets_placed.rpt)
|
150 |
|
|
_rou_sta.rpt # (from _route_status.rpt)
|
151 |
|
|
_rou_drc.rpt # (from _drc_routed.rpt)
|
152 |
|
|
_rou_tim.rpt # (from _timing_summary_routed.rpt)
|
153 |
|
|
_rou_pwr.rpt # (from _power_routed.rpt)
|
154 |
|
|
_rou_util.rpt # (extra report_utilization)
|
155 |
|
|
_rou_util_h.rpt # (extra report_utilization -hierarchical)
|
156 |
|
|
_ds.rpt # (extra report_datasheet)
|
157 |
|
|
|
158 |
|
|
The design check points are also kept
|
159 |
|
|
|
160 |
|
|
_syn.dcp # (from .dcp)
|
161 |
|
|
_opt.dcp # (from _opt.dcp)
|
162 |
|
|
_pla.dcp # (from _placed.dcp)
|
163 |
|
|
_rou.dcp # (from _routed.dcp)
|
164 |
|
|
|
165 |
|
|
If only the post synthesis, optimize or route design checkpoints are wanted
|
166 |
|
|
|
167 |
|
|
make _syn.dcp
|
168 |
|
|
make _opt.dcp
|
169 |
|
|
make _rou.dcp
|
170 |
|
|
|
171 |
|
|
5. Configuring FPGAs ------------------------------------------------------
|
172 |
|
|
|
173 |
|
|
The make flow supports also loading the bitstream into FPGAs via the
|
174 |
|
|
Vivado hardware server. Simply use
|
175 |
|
|
|
176 |
|
|
make .vconfig
|
177 |
|
|
|
178 |
|
|
Note: works with Basys3 and Nexys4, only one board must connected.
|
179 |
|
|
|
180 |
|
|
6. Note on ISE ------------------------------------------------------------
|
181 |
|
|
|
182 |
|
|
The development for Nexys4 started with ISE, but has now fully moved to
|
183 |
|
|
Vivado. The make files for the ISE build flows have been kept for comparison
|
184 |
|
|
are have the name Makefile.ise. So for some Nexys4 designs and associated
|
185 |
|
|
one can still start with a
|
186 |
|
|
|
187 |
|
|
make -f Makefile.ise
|
188 |
|
|
|
189 |
|
|
an ISE based build. To be used for tool comparisons, the ISE generated bit
|
190 |
|
|
files were never tested in an FPGA.
|