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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.74/] [doc/] [INSTALL.txt] - Blame information for rev 17

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 17 wfjm
# $Id: INSTALL.txt 467 2013-01-02 19:49:05Z 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
  3.  Setup system environment
10
       a. Setup environment variables
11
       b. Setup USB access
12
  4.  Compile UNISIM/SIMPRIM libraries for ghdl
13
  5.  Compile and install the support software
14 11 wfjm
       a. Compile sharable libraries
15
       b. Setup Tcl packages
16 17 wfjm
       c. Rebuild Cypress FX2 firmware
17
  6.  The build system
18
  7.  Building test benches
19 11 wfjm
       a. General instructions
20
       b. Available test benches
21 17 wfjm
  8.  Building systems
22 11 wfjm
       a. General instructions
23 17 wfjm
       b. Configuring FPGAs
24
       c. Available systems
25 5 wfjm
 
26
1. Download ---------------------------------------------------------------
27
 
28
  All instructions below assume that the project files reside in a
29
  working directory with the name represented as 
30
 
31
  To download latest tagged version (V0.5) of w11a
32
 
33
    cd 
34
    svn co http://opencores.org/ocsvn/w11/w11/tags/w11a_V0.5
35
 
36
  To download latest snapshot of trunk
37
 
38
    cd 
39
    svn co http://opencores.org/ocsvn/w11/w11/trunk
40
 
41 17 wfjm
2. System requirements ----------------------------------------------------
42
 
43
  This project contains not only VHDL code but also support software. Therefore
44
  quite a few software packages are expected to be installed. The following
45
  list gives the Ubuntu/Debian package names, but mapping this to other
46
  distributions should be straight forward.
47 5 wfjm
 
48 17 wfjm
  - building the bit files for the FPGAs requires a Xilinx WebPACK installation
49
 
50
  - building and using the RLink backend software requires:
51
    - full C/C++ development chain (gcc,g++,cpp,make)
52
      -> package: build-essential
53
    - Boost C++ library (>= 1.40), with date-time, thread, and regex
54
      -> package: libboost-dev libboost-date-time-dev libboost-thread-dev
55
                  libboost-regex-dev
56
    - libusb 1.0 (>= 1.0.6)
57
      -> package: libusb-1.0-0-dev
58
    - Perl (>= 5.10)  (usually included in base installations)
59
    - Tcl  (>= 8.4), with tclreadline support
60
      -> package: tcl tcl-dev tcllib tclreadline
61
 
62
  - the download contains pre-build firmware images for the Cypress FX2
63
    USB Interface. Re-building them requires
64
    - Small Device C Compiler
65
      -> package: sdcc sdcc-ucsim
66
 
67
  - for FX2 firmware download and jtag programming over USB one needs
68
    - fxload
69
      -> package: fxload
70
    - urjtag
71
      -> package: urjtag   for Ubuntu 12.04
72
      -> see INSTALL_urjtag.txt for other distributions !!
73
 
74
  - for VHDL simulations one needs
75
    - ghdl
76
      -> see INSTALL_ghdl.txt for the unfortunately gory details
77
 
78
  - optional but very useful is:
79
    - gtkwave
80
      -> package: gtkwave
81
 
82
3. Setup system environment -----------------------------------------------
83
 
84
3a. Setup environment variables --------------------------------------
85
 
86 11 wfjm
  The make flow for building test benches (ghdl and ISim based) and systems
87
  (Xilinx xst based) as well as the support software (mainly the rlink backend
88
  server) requires
89 5 wfjm
 
90 12 wfjm
    - the definition of the environment variables:
91
      - RETROBASE: must refer to the installation root directory
92
      - BOOSTINC:  pathname for includes of boost library
93 17 wfjm
      - TCLINC:    pathname for includes of Tcl runtime library
94
      - RETRO_FX2_VID and RETRO_FX2_PID: default USB VID/PID, see below
95 11 wfjm
    - that the tools binary directory is in the path
96
    - that the tools library directory is in the library path
97 12 wfjm
 
98 11 wfjm
 
99 5 wfjm
  For bash and alike use
100
 
101
    export RETROBASE=
102
    export PATH=$PATH:$RETROBASE/tools/bin
103 11 wfjm
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RETROBASE/tools/lib
104 5 wfjm
 
105 12 wfjm
  In most cases the boost library version coming with the distribution will
106 17 wfjm
  work, similar for Tcl, in those cases simply use
107 12 wfjm
 
108
    export BOOSTINC=/usr/include
109 17 wfjm
    export TCLINC=/usr/include/tcl8.5
110 12 wfjm
 
111 5 wfjm
  After that building functional model based test benches will work. If you
112
  want to also build post-xst or post-par test benches read next section.
113
 
114 17 wfjm
  If the Cypress USB controller available on Digilent Nexys2, Nexys3 and
115
  Atlys boards is used the default USB VID and PID is defined by two
116
  environment variables. For internal lab use one can use
117 5 wfjm
 
118 17 wfjm
    export RETRO_FX2_VID=16c0
119
    export RETRO_FX2_PID=03ef
120
 
121
  !! Carefully read the disclaimer about usage of USB VID/PID numbers  !!
122
  !! in the file README_USB-VID-PID.txt. You'll be responsible for any !!
123
  !! misuse of the defaults provided with the project sources.         !!
124
  !! Usage of this VID/PID in any commercial product is forbidden.     !!
125
 
126
3b. Setup USB access -------------------------------------------------
127
 
128
  For using the Cypress FX2 USB interface on Digilent Nexys2, Nexys3 and
129
  Atlys boards 'udev' rules must be setup to allow user level access to
130
  these devices. A set of rules is provided under
131
 
132
    $RETROBASE/tools/fx2/sys
133
 
134
  Follow the 'README.txt' file in this directory.
135
 
136
  Notes:
137
  - the provided udev rules use the VID/PID for 'internal lab use' as
138
    described above. If other VID/PID used the file must be modified.
139
  - your user account must be in group 'plugdev' (should be the default).
140
 
141
4. Compile UNISIM/SIMPRIM libraries for ghdl ------------------------------
142
 
143 5 wfjm
  The build system for test benches also supports test benches run against
144
  the gate level models derived after the xst, map or par step. In this
145
  case ghdl has to link against a compiled UNISIM or SIMPRIM library.
146
 
147
  To make handling of the parallel installion of several WebPack versions
148
  easy the compiled libraries are stored in sub-directories under $XILINX:
149
 
150
     $XILINX/ghdl/unisim
151
     $XILINX/ghdl/simprim
152
 
153
  Two helper scripts will create these libraries:
154
 
155
    
156
 
157
    cd $RETROBASE
158
    xilinx_ghdl_unisim
159
    xilinx_ghdl_simprim
160
 
161
  If you have several WebPack versions installed, repeat for each version.
162
 
163 17 wfjm
5. Compile and install the support software -------------------------------
164 5 wfjm
 
165 17 wfjm
5a. Compile sharable libraries ---------------------------------------
166 5 wfjm
 
167 12 wfjm
  Required tools and libraries:
168
    g++    >= 4.3    (decltype support assumed in usage of boost::bind)
169
    boost  >= 1.35   (boost::thread api changed, new one is used)
170 17 wfjm
    linusb >= 1.0.5  (timerfd support)
171 12 wfjm
 
172
  Build was tested under:
173 17 wfjm
    ubuntu lucid (12.04 LTS):  gcc 4.6.3  boost 1.46.1  libusb 1.0.9
174
    debian squezze (6.0.6):    gcc 4.4.5  boost 1.46.1  libusb 1.0.8
175 12 wfjm
 
176 11 wfjm
  To build all sharable libraries
177
 
178
    cd $RETROBASE/tools/src
179
    make -j 4
180
 
181
  To cleanup, e.g. before a re-build
182
 
183
    cd $RETROBASE/tools/src
184
    rm_dep
185
    make realclean
186
 
187 17 wfjm
5b. Setup Tcl environment --------------------------------------------
188 11 wfjm
 
189
  The Tcl files are organized in several packages. To create the Tcl
190
  package files (pkgIndex.tcl)
191
 
192
    cd $RETROBASE/tools/tcl
193
    setup_packages
194
 
195
  To use these packages it is convenient to make them available via the
196
  'auto_path' mechanism. To do that add in your .tclshrc or .wishrc
197
 
198
    lappend auto_path [file join $env(RETROBASE) tools tcl]
199
    lappend auto_path [file join $env(RETROBASE) tools lib]
200
 
201
  The w11 distribution contains two ready to use .tclshrc or .wishrc
202
  files which
203
    - include the auto_path statements above
204
    - activate tclreadline (and thus in tclshrc an event loop)
205
 
206
  To use them simply copy them into your home directory (or soft link them)
207
 
208
    cd $HOME
209
    ln -s $RETROBASE/tools/tcl/.tclshrc .
210
    ln -s $RETROBASE/tools/tcl/.wishrc  .
211
 
212 17 wfjm
5c. Rebuild Cypress FX2 firmware -------------------------------------
213 11 wfjm
 
214 17 wfjm
  The download includes pre-build firmware images for the Cypress FX2
215
  USB interface used on the Digilent Nexys2, Nexys3 and Atlys Boards.
216
  These firmware images are under
217 11 wfjm
 
218 17 wfjm
    $RETROBASE/tools/fx2/bin
219
 
220
  To re-build them, e.g. because a different USB VID/PID is to be used
221
 
222
    cd $RETROBASE/tools/fx2/src
223
    make clean
224
    make
225
    make install
226
 
227
  Please read README_USB_VID-PID.txt carefully to understand the usage
228
  of USB VID and PID.
229
 
230
6. The build system -------------------------------------------------------
231
 
232 5 wfjm
  Simulation and synthesis tools usually need a list of the VHDL source
233
  files, often in proper compilation order (libraries before components).
234
  The different tools have different formats of these 'project files'.
235
 
236
  The build system employed in this project is based on
237
     "VHDL bill of material" or 'vbom' files
238
  which list for each vhdl source file the libraries and sources for
239
  the instantiated components, the later via their vbom, and last but
240
  not least the name of the vhdl source file. All file name are relative
241
  to the current directory. A recursive traversal through all vbom's gives
242
  for each vhld module all sources needed to compile it. The vbomconv script
243
  in tools/bin does this, and generates depending on options
244
   - make dependency files
245
   - ISE xst project files
246
   - ISE ISim project files
247
   - ghdl commands for analysis, inspection and make step
248
 
249
  The master make files contain pattern rules like
250
    %.ngc  : %.vbom           -- synthesize with xst
251
    %      : %.vbom           -- build functional model test bench
252
  which encapsulate all the vbomconf magic
253
 
254
  A full w11a is build from more than 80 source files, test benches from
255
  even more. Using the vbom's a large number of designs can be easily
256
  maintained.
257
 
258 17 wfjm
7. Building test benches --------------------------------------------------
259 5 wfjm
 
260 17 wfjm
7a. General instructions ---------------------------------------------
261 11 wfjm
 
262 5 wfjm
  To compile a test bench named  all is needed is
263
 
264
    make 
265
 
266
  The make file will use .vbom, create all make dependency files,
267
  and generate the needed ghdl commands.
268
 
269
  In many cases the test benches can also be compiled against the gate
270
  level models derived after the xst, map or par step. To compile them
271
 
272
    make ghdl_tmp_clean
273
    make _ssim                  # for post-xst
274
    make _fsim                  # for post-map
275
    make _tsim                  # for post-par
276
 
277
  The 'make ghdl_tmp_clean' is needed to flush the ghdl work area from
278
  the compilation remains of earlier functional model compiles.
279
 
280 17 wfjm
7b. Available test benches -------------------------------------------
281 5 wfjm
 
282 11 wfjm
  See file w11a_tb_guide.txt
283
 
284 17 wfjm
8. Building systems -------------------------------------------------------
285 11 wfjm
 
286 17 wfjm
8a. General instructions ---------------------------------------------
287 11 wfjm
 
288 5 wfjm
  To generate a bit file for a system named  all is needed is
289
 
290
    make .bit
291
 
292
  The make file will use .vbom, create all make dependency files, build
293
  the ucf file with cpp, and run the synthesis flow (xst, ngdbuild, par, trce).
294
  The log files will be named
295
 
296
      _xst.log        # xst log file
297
      _tra.log        # translate (ngdbuild) log file (renamed %.bld)
298
      _map.log        # map log file                  (renamed %_map.mrp)
299
      _par.log        # par log file                  (renamed %.par)
300
      _pad.log        # pad file                      (renamed %_pad.txt)
301
      _twr.log        # trce log file                 (renamed %.twr)
302
 
303
  To load the bitfile with WebPack impact into the target board use
304
 
305 12 wfjm
    make .iconfig
306 5 wfjm
 
307
  If only the xst or par output is wanted just use
308
 
309
    make .ngc
310
    make .ncd
311 11 wfjm
 
312 17 wfjm
  A simple 'message filter' system is also integrated into the make build flow.
313
  For many (though not all) systems a .mfset file has been provided which
314
  defines the xst,par and bitgen messages which are considered ok. To see
315
  only the remaining message extracted from the vaious .log files simply
316
  use the make target
317 11 wfjm
 
318 17 wfjm
    make .mfsum
319
 
320
  after a re-build.
321
 
322
8b. Configuring FPGAs ------------------------------------------------
323
 
324
  The make flow supports also loading the bitstream into FPGAs, either
325
  via Xilinx Impact, or via the Cypress FX2 USB controller is available.
326
 
327
  For Xilinx Impact a Xilinx USB Cable II has to be properly setup, than
328
  simply use
329
 
330
    make .iconfig
331
 
332
  For using the Cypress FX2 USB controlle on Digilent Nexys2, Nexys3 and
333
  Atlys boards just connect the USB cable and
334
 
335
    make .jconfig
336
 
337
  This will automatically check and optionaly re-load the FX2 firmware
338
  to a version matching the FPGA design, generate a .svf file from the
339
  .bit file, and configure the FPGA. In case the bit file is out-of-date
340
  the whole design will be re-implemented before.
341
 
342
8c. Available systems ------------------------------------------------
343
 
344 11 wfjm
  Note: Currently ready to build versions exist for
345
          Digilent S3BOARD (-1000 FPGA version)
346
          Digilent Nexys2 board (-1200 FPGA version)
347 15 wfjm
          Digilent Nexys3 board
348 11 wfjm
 
349
  1. rlink tester
350
     a. for Digilent Nexys2 board
351
 
352
        cd $RETROBASE/rtl/sys_gen/tst_rlink/nexys2
353
        make sys_tst_rlink_n2.bit
354
 
355 15 wfjm
     b. for Digilent Nexys3 board
356
 
357
        cd $RETROBASE/rtl/sys_gen/tst_rlink/nexys3
358
        make sys_tst_rlink_n3.bit
359
 
360 17 wfjm
  2. rlink over USB tester
361
     a. for Digilent Nexys2 board
362
 
363
        cd $RETROBASE/rtl/sys_gen/tst_rlink_cuff/nexys2/ic
364
        make sys_tst_rlink_cuff_ic_n2.bit
365
 
366
  3. w11a systems
367 11 wfjm
     a. for Digilent S3BOARD
368
 
369
        cd $RETROBASE/rtl/sys_gen/w11a/s3board
370
        make sys_w11a_s3.bit
371
 
372
     b. for Digilent Nexys2 board
373
 
374
        cd $RETROBASE/rtl/sys_gen/w11a/nexys2
375
        make sys_w11a_n2.bit
376 15 wfjm
 
377
     c. for Digilent Nexys3 board
378
 
379
        cd $RETROBASE/rtl/sys_gen/w11a/nexys3
380
        make sys_w11a_n3.bit

powered by: WebSVN 2.1.0

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