1 |
34 |
wfjm |
# $Id: INSTALL.txt 722 2015-12-30 19:45:46Z mueller $
|
2 |
5 |
wfjm |
|
3 |
11 |
wfjm |
Guide to install and build w11a systems, test benches and support software
|
4 |
5 |
wfjm |
|
5 |
|
|
Table of content:
|
6 |
|
|
|
7 |
11 |
wfjm |
1. Download
|
8 |
17 |
wfjm |
2. System requirements
|
9 |
29 |
wfjm |
3. Setup environment variables
|
10 |
17 |
wfjm |
4. Compile UNISIM/SIMPRIM libraries for ghdl
|
11 |
|
|
5. Compile and install the support software
|
12 |
11 |
wfjm |
a. Compile sharable libraries
|
13 |
|
|
b. Setup Tcl packages
|
14 |
17 |
wfjm |
6. The build system
|
15 |
|
|
7. Building test benches
|
16 |
|
|
8. Building systems
|
17 |
25 |
wfjm |
d. Available systems
|
18 |
|
|
e. Available bitkits with bit and log files
|
19 |
19 |
wfjm |
9. Generate Doxygen based source code view
|
20 |
5 |
wfjm |
|
21 |
|
|
1. Download ---------------------------------------------------------------
|
22 |
|
|
|
23 |
|
|
All instructions below assume that the project files reside in a
|
24 |
|
|
working directory with the name represented as
|
25 |
|
|
|
26 |
23 |
wfjm |
- to download latest snapshot of trunk
|
27 |
5 |
wfjm |
|
28 |
23 |
wfjm |
cd
|
29 |
|
|
svn co http://opencores.org/ocsvn/w11/w11/trunk
|
30 |
5 |
wfjm |
|
31 |
23 |
wfjm |
- to download tagged verions (from major releases)
|
32 |
|
|
list available svn tags
|
33 |
|
|
|
34 |
|
|
svn ls http://opencores.org/ocsvn/w11/w11/tags
|
35 |
5 |
wfjm |
|
36 |
23 |
wfjm |
and download one of them
|
37 |
5 |
wfjm |
|
38 |
23 |
wfjm |
cd
|
39 |
|
|
svn co http://opencores.org/ocsvn/w11/w11/tags/
|
40 |
|
|
|
41 |
|
|
- to download specific svn revision (from minor releases)
|
42 |
|
|
determine desired svn revsion from list given on
|
43 |
|
|
http://opencores.org/project,w11,overview
|
44 |
|
|
|
45 |
|
|
and download
|
46 |
|
|
|
47 |
|
|
cd
|
48 |
|
|
svn co -r http://opencores.org/ocsvn/w11/w11/trunk
|
49 |
|
|
|
50 |
17 |
wfjm |
2. System requirements ----------------------------------------------------
|
51 |
|
|
|
52 |
|
|
This project contains not only VHDL code but also support software. Therefore
|
53 |
|
|
quite a few software packages are expected to be installed. The following
|
54 |
|
|
list gives the Ubuntu/Debian package names, but mapping this to other
|
55 |
|
|
distributions should be straight forward.
|
56 |
5 |
wfjm |
|
57 |
29 |
wfjm |
- building the bit files requires a Xilinx ISE WebPACK installation
|
58 |
17 |
wfjm |
|
59 |
|
|
- building and using the RLink backend software requires:
|
60 |
|
|
- full C/C++ development chain (gcc,g++,cpp,make)
|
61 |
|
|
-> package: build-essential
|
62 |
|
|
- Boost C++ library (>= 1.40), with date-time, thread, and regex
|
63 |
|
|
-> package: libboost-dev libboost-date-time-dev libboost-thread-dev
|
64 |
|
|
libboost-regex-dev
|
65 |
|
|
- libusb 1.0 (>= 1.0.6)
|
66 |
|
|
-> package: libusb-1.0-0-dev
|
67 |
|
|
- Perl (>= 5.10) (usually included in base installations)
|
68 |
34 |
wfjm |
- Tcl (>= 8.6), with tclreadline support
|
69 |
17 |
wfjm |
-> package: tcl tcl-dev tcllib tclreadline
|
70 |
|
|
|
71 |
|
|
- for VHDL simulations one needs
|
72 |
|
|
- ghdl
|
73 |
|
|
-> see INSTALL_ghdl.txt for the unfortunately gory details
|
74 |
|
|
|
75 |
29 |
wfjm |
- additional requirements for using Cypress FX (on Nexys2/3) see
|
76 |
|
|
INSTALL_fx2_support.txt
|
77 |
|
|
|
78 |
19 |
wfjm |
- for doxygen documentation an up-to-date installation of doxygen is
|
79 |
|
|
required, version 1.8.3.1 or later
|
80 |
|
|
|
81 |
17 |
wfjm |
- optional but very useful is:
|
82 |
|
|
- gtkwave
|
83 |
|
|
-> package: gtkwave
|
84 |
|
|
|
85 |
29 |
wfjm |
3. Setup environment variables --------------------------------------------
|
86 |
17 |
wfjm |
|
87 |
11 |
wfjm |
The make flow for building test benches (ghdl and ISim based) and systems
|
88 |
29 |
wfjm |
(Xilinx ISE xst based) as well as the support software (mainly the rlink
|
89 |
|
|
backend server) requires
|
90 |
5 |
wfjm |
|
91 |
12 |
wfjm |
- the definition of the environment variables:
|
92 |
27 |
wfjm |
- RETROBASE: must refer to the installation root directory
|
93 |
|
|
- TCLINC: pathname for includes of Tcl runtime library
|
94 |
|
|
- TCLLIBNAME: name of Tcl runtime library
|
95 |
17 |
wfjm |
- RETRO_FX2_VID and RETRO_FX2_PID: default USB VID/PID, see below
|
96 |
11 |
wfjm |
- that the tools binary directory is in the path
|
97 |
|
|
- that the tools library directory is in the library path
|
98 |
19 |
wfjm |
- optional environment variables:
|
99 |
27 |
wfjm |
- TCLLIB: pathname for libraries of Tcl
|
100 |
|
|
- BOOSTINC: pathname for includes of boost library
|
101 |
|
|
- BOOSTLIB: pathname for libraries of boost library
|
102 |
19 |
wfjm |
{Note: Either both must be undefined, or both must be defined}
|
103 |
12 |
wfjm |
|
104 |
5 |
wfjm |
For bash and alike use
|
105 |
|
|
|
106 |
|
|
export RETROBASE=
|
107 |
|
|
export PATH=$PATH:$RETROBASE/tools/bin
|
108 |
11 |
wfjm |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RETROBASE/tools/lib
|
109 |
5 |
wfjm |
|
110 |
23 |
wfjm |
To access the man pages update also the MANPATH
|
111 |
|
|
|
112 |
|
|
export MANPATH=$MANPATH:$RETROBASE/doc/man
|
113 |
|
|
|
114 |
12 |
wfjm |
In most cases the boost library version coming with the distribution will
|
115 |
17 |
wfjm |
work, similar for Tcl, in those cases simply use
|
116 |
12 |
wfjm |
|
117 |
34 |
wfjm |
export TCLINC=/usr/include/tcl8.6
|
118 |
|
|
export TCLLIBNAME=tcl8.6
|
119 |
12 |
wfjm |
|
120 |
19 |
wfjm |
and don't setup BOOSTINC and BOOSTLIB.
|
121 |
|
|
|
122 |
5 |
wfjm |
After that building functional model based test benches will work. If you
|
123 |
|
|
want to also build post-xst or post-par test benches read next section.
|
124 |
|
|
|
125 |
29 |
wfjm |
For Cypress FX2 (on Nexys2/3) related setup see INSTALL_fx2_support.txt
|
126 |
5 |
wfjm |
|
127 |
17 |
wfjm |
4. Compile UNISIM/SIMPRIM libraries for ghdl ------------------------------
|
128 |
|
|
|
129 |
5 |
wfjm |
The build system for test benches also supports test benches run against
|
130 |
|
|
the gate level models derived after the xst, map or par step. In this
|
131 |
|
|
case ghdl has to link against a compiled UNISIM or SIMPRIM library.
|
132 |
|
|
|
133 |
29 |
wfjm |
To make handling of the parallel installion of several ISE WebPack versions
|
134 |
5 |
wfjm |
easy the compiled libraries are stored in sub-directories under $XILINX:
|
135 |
|
|
|
136 |
|
|
$XILINX/ghdl/unisim
|
137 |
|
|
$XILINX/ghdl/simprim
|
138 |
|
|
|
139 |
|
|
Two helper scripts will create these libraries:
|
140 |
|
|
|
141 |
25 |
wfjm |
|
142 |
5 |
wfjm |
|
143 |
|
|
cd $RETROBASE
|
144 |
29 |
wfjm |
xise_ghdl_unisim
|
145 |
|
|
xise_ghdl_simprim
|
146 |
5 |
wfjm |
|
147 |
|
|
If you have several WebPack versions installed, repeat for each version.
|
148 |
|
|
|
149 |
17 |
wfjm |
5. Compile and install the support software -------------------------------
|
150 |
5 |
wfjm |
|
151 |
17 |
wfjm |
5a. Compile sharable libraries ---------------------------------------
|
152 |
5 |
wfjm |
|
153 |
29 |
wfjm |
Note: some c++11 features are used in the code
|
154 |
|
|
- N2343: decltype (used by boost bind) -> since gcc 4.3
|
155 |
|
|
- N2431: nullptr -> since gcc 4.6
|
156 |
|
|
- N2930: range based for -> since gcc 4.6
|
157 |
|
|
- N1984: auto-types variables -> since gcc 4.4
|
158 |
|
|
|
159 |
12 |
wfjm |
Required tools and libraries:
|
160 |
29 |
wfjm |
g++ >= 4.6 (see c++11 usage above)
|
161 |
12 |
wfjm |
boost >= 1.35 (boost::thread api changed, new one is used)
|
162 |
17 |
wfjm |
linusb >= 1.0.5 (timerfd support)
|
163 |
12 |
wfjm |
|
164 |
|
|
Build was tested under:
|
165 |
29 |
wfjm |
ubuntu precise (14.04 LTS): gcc 4.8.2 boost 1.54 libusb 1.0.17
|
166 |
|
|
debian wheezy (7.0.8): gcc 4.7.2 boost 1.49 libusb 1.0.11
|
167 |
12 |
wfjm |
|
168 |
11 |
wfjm |
To build all sharable libraries
|
169 |
|
|
|
170 |
|
|
cd $RETROBASE/tools/src
|
171 |
|
|
make -j 4
|
172 |
|
|
|
173 |
25 |
wfjm |
Default is to compile with -O2 and without -g. These options can be
|
174 |
|
|
overwritten with the CXXOPTFLAGS enviromnent variable (or make opion).
|
175 |
|
|
To build with -O3 optimize use
|
176 |
|
|
make -j 4 CXXOPTFLAGS=-O3
|
177 |
|
|
To build a debug version with full symbol table use
|
178 |
|
|
make -j 4 CXXOPTFLAGS=-g
|
179 |
|
|
|
180 |
11 |
wfjm |
To cleanup, e.g. before a re-build
|
181 |
|
|
|
182 |
|
|
cd $RETROBASE/tools/src
|
183 |
|
|
rm_dep
|
184 |
|
|
make realclean
|
185 |
|
|
|
186 |
17 |
wfjm |
5b. Setup Tcl environment --------------------------------------------
|
187 |
11 |
wfjm |
|
188 |
|
|
The Tcl files are organized in several packages. To create the Tcl
|
189 |
|
|
package files (pkgIndex.tcl)
|
190 |
|
|
|
191 |
|
|
cd $RETROBASE/tools/tcl
|
192 |
|
|
setup_packages
|
193 |
|
|
|
194 |
|
|
To use these packages it is convenient to make them available via the
|
195 |
|
|
'auto_path' mechanism. To do that add in your .tclshrc or .wishrc
|
196 |
|
|
|
197 |
|
|
lappend auto_path [file join $env(RETROBASE) tools tcl]
|
198 |
|
|
lappend auto_path [file join $env(RETROBASE) tools lib]
|
199 |
|
|
|
200 |
|
|
The w11 distribution contains two ready to use .tclshrc or .wishrc
|
201 |
|
|
files which
|
202 |
|
|
- include the auto_path statements above
|
203 |
|
|
- activate tclreadline (and thus in tclshrc an event loop)
|
204 |
|
|
|
205 |
|
|
To use them simply copy them into your home directory (or soft link them)
|
206 |
|
|
|
207 |
|
|
cd $HOME
|
208 |
|
|
ln -s $RETROBASE/tools/tcl/.tclshrc .
|
209 |
|
|
ln -s $RETROBASE/tools/tcl/.wishrc .
|
210 |
|
|
|
211 |
17 |
wfjm |
6. The build system -------------------------------------------------------
|
212 |
|
|
|
213 |
29 |
wfjm |
The generation of
|
214 |
|
|
- FPGA firmware (e.g. .bit files)
|
215 |
|
|
- test benches (e.g. simulator images)
|
216 |
|
|
is based on make flows.
|
217 |
|
|
|
218 |
|
|
Two design tools are currently supported
|
219 |
|
|
- Xilinx Vivado
|
220 |
|
|
- Artix-7 based board (Basys3, Nexys4)
|
221 |
|
|
- see README_buildsystem_Vivado.txt
|
222 |
|
|
- Xilinx ISE
|
223 |
|
|
- Spartan-3 and Spartan-6 based boards (S3board, Nexys2, Nexys3)
|
224 |
|
|
- see README_buildsystem_ISE.txt
|
225 |
5 |
wfjm |
|
226 |
17 |
wfjm |
7. Building test benches --------------------------------------------------
|
227 |
5 |
wfjm |
|
228 |
29 |
wfjm |
General instructions are in
|
229 |
|
|
- README_buildsystem_Vivado.txt (for Basys3, Nexys4)
|
230 |
|
|
- README_buildsystem_ISE.txt (for S3board, Nexys2, Nexys3)
|
231 |
11 |
wfjm |
|
232 |
29 |
wfjm |
For available test benches see w11a_tb_guide.txt
|
233 |
5 |
wfjm |
|
234 |
29 |
wfjm |
8. Building systems and configuring FPGAs ---------------------------------
|
235 |
5 |
wfjm |
|
236 |
29 |
wfjm |
General instructions are in
|
237 |
|
|
- README_buildsystem_Vivado.txt (for Basys3, Nexys4)
|
238 |
|
|
- README_buildsystem_ISE.txt (for S3board, Nexys2, Nexys3)
|
239 |
5 |
wfjm |
|
240 |
29 |
wfjm |
8d. Available systems ------------------------------------------------
|
241 |
5 |
wfjm |
|
242 |
29 |
wfjm |
Ready to build designs are organized in the directories
|
243 |
5 |
wfjm |
|
244 |
29 |
wfjm |
$RETROBASE/rtl/sys_gen//
|
245 |
5 |
wfjm |
|
246 |
29 |
wfjm |
with
|
247 |
|
|
w11a w11a system
|
248 |
|
|
tst_rlink rlink over serial link tester
|
249 |
|
|
tst_rlink_cuff rlink over FX2 interface tester
|
250 |
5 |
wfjm |
|
251 |
29 |
wfjm |
and
|
252 |
|
|
basys3 b3: Digilent Basys3 board
|
253 |
|
|
nexys4 n4: Digilent Nexys4 board (cellular RAM version)
|
254 |
|
|
nexys3 n3: Digilent Nexys3 board
|
255 |
|
|
nexys2 n2: Digilent Nexys2 board (-1200 FPGA version)
|
256 |
|
|
s3board s3: Digilent S3board (-1000 FPGA version)
|
257 |
11 |
wfjm |
|
258 |
23 |
wfjm |
To build the designs locally use
|
259 |
|
|
|
260 |
29 |
wfjm |
cd $RETROBASE/rtl/sys_gen//
|
261 |
|
|
make sys__.bit
|
262 |
11 |
wfjm |
|
263 |
29 |
wfjm |
with in most cases = and = 2 letter abriviation for
|
264 |
|
|
the board, e.g. n4 for nexys4.
|
265 |
23 |
wfjm |
|
266 |
25 |
wfjm |
8e. Available bitkits with bit and log files -------------------------
|
267 |
|
|
|
268 |
|
|
Tarballs with ready to use bit files and all logfiles from the tool
|
269 |
|
|
chain can be downloaded from
|
270 |
|
|
http://www.retro11.de/data/oc_w11/bitkits/
|
271 |
|
|
This area is organized in folders for different releases. The tarball
|
272 |
|
|
file names contain information about release, Xlinix tool, and design:
|
273 |
|
|
__.tgz
|
274 |
|
|
|
275 |
29 |
wfjm |
- Vivado based designs:
|
276 |
|
|
These designs can be loaded with the Vivado hardware server into the FPGA.
|
277 |
25 |
wfjm |
|
278 |
29 |
wfjm |
- ISE based designs:
|
279 |
25 |
wfjm |
|
280 |
29 |
wfjm |
These designs can be loaded with config_wrapper into the FPGA. The
|
281 |
|
|
procedures for the supported boards are given below.
|
282 |
25 |
wfjm |
|
283 |
29 |
wfjm |
Notes:
|
284 |
|
|
1. XTWI_PATH and RETROBASE environment variables must be defined.
|
285 |
|
|
2. config_wrapper bit2svf is only needed once to create the svf files.
|
286 |
|
|
3. fx2load_wrapper is needed once after each board power on.
|
287 |
25 |
wfjm |
|
288 |
29 |
wfjm |
a. for Digilent Nexys3 board (using Cypress FX2 USB controller)
|
289 |
25 |
wfjm |
|
290 |
29 |
wfjm |
xtwi config_wrapper --board=nexys3 bit2svf .bit
|
291 |
|
|
fx2load_wrapper --board=nexys3
|
292 |
|
|
xtwi config_wrapper --board=nexys3 jconfig .svf
|
293 |
|
|
|
294 |
|
|
b. for Digilent Nexys2 board (using Cypress FX2 USB controller)
|
295 |
|
|
|
296 |
25 |
wfjm |
xtwi config_wrapper --board=nexys2 bit2svf .bit
|
297 |
27 |
wfjm |
fx2load_wrapper --board=nexys2
|
298 |
25 |
wfjm |
xtwi config_wrapper --board=nexys2 jconfig .svf
|
299 |
|
|
|
300 |
29 |
wfjm |
c. for Digilent S3board (using ISE Impact)
|
301 |
25 |
wfjm |
|
302 |
29 |
wfjm |
xtwi config_wrapper --board=s3board iconfig .bit
|
303 |
25 |
wfjm |
|
304 |
29 |
wfjm |
|
305 |
19 |
wfjm |
9. Generate Doxygen based source code view --------------------------------
|
306 |
|
|
|
307 |
|
|
Currently there is not much real documentation included in the source
|
308 |
|
|
files. The doxygen generated html output is nevertheless very useful
|
309 |
|
|
to browse the code. C++, Tcl and Vhdl source are covered by setup files
|
310 |
|
|
contained in the project files.
|
311 |
|
|
|
312 |
|
|
To generate the html files
|
313 |
|
|
|
314 |
|
|
cd $RETROBASE/tools/dox
|
315 |
|
|
export RETRODOXY
|
316 |
|
|
./make_doxy
|
317 |
|
|
|
318 |
|
|
If RETRODOXY is not defined '/tmp' is used. To view the docs use
|
319 |
|
|
|
320 |
|
|
firefox $RETRODOXY/w11/cpp/html/index.html &
|
321 |
|
|
firefox $RETRODOXY/w11/tcl/html/index.html &
|
322 |
|
|
firefox $RETRODOXY/w11/vhd/html/index.html &
|