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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.61/] [doc/] [INSTALL.txt] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 25 wfjm
# $Id: INSTALL.txt 576 2014-08-02 12:24:28Z 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 25 wfjm
  6    a. Setting up Xilinx environment with xtwi
19 17 wfjm
  7.  Building test benches
20 11 wfjm
       a. General instructions
21
       b. Available test benches
22 17 wfjm
  8.  Building systems
23 11 wfjm
       a. General instructions
24 25 wfjm
       b. Configuring FPGAs (via make flow)
25
       c. Configuring FPGAs (directly via config_wrapper)
26
       d. Available systems
27
       e. Available bitkits with bit and log files
28 19 wfjm
  9.  Generate Doxygen based source code view
29 5 wfjm
 
30
1. Download ---------------------------------------------------------------
31
 
32
  All instructions below assume that the project files reside in a
33
  working directory with the name represented as 
34
 
35 23 wfjm
  - to download latest snapshot of trunk
36 5 wfjm
 
37 23 wfjm
      cd 
38
      svn co http://opencores.org/ocsvn/w11/w11/trunk
39 5 wfjm
 
40 23 wfjm
  - to download tagged verions (from major releases)
41
    list available svn tags
42
 
43
      svn ls http://opencores.org/ocsvn/w11/w11/tags
44 5 wfjm
 
45 23 wfjm
    and download one of them
46 5 wfjm
 
47 23 wfjm
      cd 
48
      svn co http://opencores.org/ocsvn/w11/w11/tags/
49
 
50
  - to download specific svn revision (from minor releases)
51
    determine desired svn revsion from list given on
52
      http://opencores.org/project,w11,overview
53
 
54
    and download
55
 
56
      cd 
57
      svn co -r  http://opencores.org/ocsvn/w11/w11/trunk
58
 
59
 
60 17 wfjm
2. System requirements ----------------------------------------------------
61
 
62
  This project contains not only VHDL code but also support software. Therefore
63
  quite a few software packages are expected to be installed. The following
64
  list gives the Ubuntu/Debian package names, but mapping this to other
65
  distributions should be straight forward.
66 5 wfjm
 
67 17 wfjm
  - building the bit files for the FPGAs requires a Xilinx WebPACK installation
68
 
69
  - building and using the RLink backend software requires:
70
    - full C/C++ development chain (gcc,g++,cpp,make)
71
      -> package: build-essential
72
    - Boost C++ library (>= 1.40), with date-time, thread, and regex
73
      -> package: libboost-dev libboost-date-time-dev libboost-thread-dev
74
                  libboost-regex-dev
75
    - libusb 1.0 (>= 1.0.6)
76
      -> package: libusb-1.0-0-dev
77
    - Perl (>= 5.10)  (usually included in base installations)
78
    - Tcl  (>= 8.4), with tclreadline support
79
      -> package: tcl tcl-dev tcllib tclreadline
80
 
81
  - the download contains pre-build firmware images for the Cypress FX2
82
    USB Interface. Re-building them requires
83
    - Small Device C Compiler
84
      -> package: sdcc sdcc-ucsim
85
 
86
  - for FX2 firmware download and jtag programming over USB one needs
87
    - fxload
88
      -> package: fxload
89
    - urjtag
90
      -> package: urjtag   for Ubuntu 12.04
91
      -> see INSTALL_urjtag.txt for other distributions !!
92
 
93
  - for VHDL simulations one needs
94
    - ghdl
95
      -> see INSTALL_ghdl.txt for the unfortunately gory details
96
 
97 19 wfjm
  - for doxygen documentation an up-to-date installation of doxygen is
98
    required, version 1.8.3.1 or later
99
 
100 17 wfjm
  - optional but very useful is:
101
    - gtkwave
102
      -> package: gtkwave
103
 
104
3. Setup system environment -----------------------------------------------
105
 
106
3a. Setup environment variables --------------------------------------
107
 
108 11 wfjm
  The make flow for building test benches (ghdl and ISim based) and systems
109
  (Xilinx xst based) as well as the support software (mainly the rlink backend
110
  server) requires
111 5 wfjm
 
112 12 wfjm
    - the definition of the environment variables:
113
      - RETROBASE: must refer to the installation root directory
114 17 wfjm
      - TCLINC:    pathname for includes of Tcl runtime library
115
      - RETRO_FX2_VID and RETRO_FX2_PID: default USB VID/PID, see below
116 11 wfjm
    - that the tools binary directory is in the path
117
    - that the tools library directory is in the library path
118 19 wfjm
    - optional environment variables:
119
      - BOOSTINC:  pathname for includes of boost library
120
      - BOOSTLIB:  pathname for libraries of boost library
121
        {Note: Either both must be undefined, or both must be defined}
122 12 wfjm
 
123 5 wfjm
  For bash and alike use
124
 
125
    export RETROBASE=
126
    export PATH=$PATH:$RETROBASE/tools/bin
127 11 wfjm
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RETROBASE/tools/lib
128 5 wfjm
 
129 23 wfjm
  To access the man pages update also the MANPATH
130
 
131
    export MANPATH=$MANPATH:$RETROBASE/doc/man
132
 
133 12 wfjm
  In most cases the boost library version coming with the distribution will
134 17 wfjm
  work, similar for Tcl, in those cases simply use
135 12 wfjm
 
136 17 wfjm
    export TCLINC=/usr/include/tcl8.5
137 12 wfjm
 
138 19 wfjm
  and don't setup BOOSTINC and BOOSTLIB.
139
 
140 5 wfjm
  After that building functional model based test benches will work. If you
141
  want to also build post-xst or post-par test benches read next section.
142
 
143 17 wfjm
  If the Cypress USB controller available on Digilent Nexys2, Nexys3 and
144
  Atlys boards is used the default USB VID and PID is defined by two
145
  environment variables. For internal lab use one can use
146 5 wfjm
 
147 17 wfjm
    export RETRO_FX2_VID=16c0
148
    export RETRO_FX2_PID=03ef
149
 
150
  !! Carefully read the disclaimer about usage of USB VID/PID numbers  !!
151
  !! in the file README_USB-VID-PID.txt. You'll be responsible for any !!
152
  !! misuse of the defaults provided with the project sources.         !!
153
  !! Usage of this VID/PID in any commercial product is forbidden.     !!
154
 
155
3b. Setup USB access -------------------------------------------------
156
 
157
  For using the Cypress FX2 USB interface on Digilent Nexys2, Nexys3 and
158
  Atlys boards 'udev' rules must be setup to allow user level access to
159
  these devices. A set of rules is provided under
160
 
161
    $RETROBASE/tools/fx2/sys
162
 
163
  Follow the 'README.txt' file in this directory.
164
 
165
  Notes:
166
  - the provided udev rules use the VID/PID for 'internal lab use' as
167
    described above. If other VID/PID used the file must be modified.
168
  - your user account must be in group 'plugdev' (should be the default).
169
 
170
4. Compile UNISIM/SIMPRIM libraries for ghdl ------------------------------
171
 
172 5 wfjm
  The build system for test benches also supports test benches run against
173
  the gate level models derived after the xst, map or par step. In this
174
  case ghdl has to link against a compiled UNISIM or SIMPRIM library.
175
 
176
  To make handling of the parallel installion of several WebPack versions
177
  easy the compiled libraries are stored in sub-directories under $XILINX:
178
 
179
     $XILINX/ghdl/unisim
180
     $XILINX/ghdl/simprim
181
 
182
  Two helper scripts will create these libraries:
183
 
184 25 wfjm
    
185 5 wfjm
 
186
    cd $RETROBASE
187 25 wfjm
    xtwi xilinx_ghdl_unisim
188
    xtwi xilinx_ghdl_simprim
189 5 wfjm
 
190
  If you have several WebPack versions installed, repeat for each version.
191
 
192 17 wfjm
5. Compile and install the support software -------------------------------
193 5 wfjm
 
194 17 wfjm
5a. Compile sharable libraries ---------------------------------------
195 5 wfjm
 
196 12 wfjm
  Required tools and libraries:
197
    g++    >= 4.3    (decltype support assumed in usage of boost::bind)
198
    boost  >= 1.35   (boost::thread api changed, new one is used)
199 17 wfjm
    linusb >= 1.0.5  (timerfd support)
200 12 wfjm
 
201
  Build was tested under:
202 17 wfjm
    ubuntu lucid (12.04 LTS):  gcc 4.6.3  boost 1.46.1  libusb 1.0.9
203
    debian squezze (6.0.6):    gcc 4.4.5  boost 1.46.1  libusb 1.0.8
204 12 wfjm
 
205 11 wfjm
  To build all sharable libraries
206
 
207
    cd $RETROBASE/tools/src
208
    make -j 4
209
 
210 25 wfjm
  Default is to compile with -O2 and without -g. These options can be
211
  overwritten with the CXXOPTFLAGS enviromnent variable (or make opion).
212
  To build with -O3 optimize use
213
    make -j 4 CXXOPTFLAGS=-O3
214
  To build a debug version with full symbol table use
215
    make -j 4 CXXOPTFLAGS=-g
216
 
217 11 wfjm
  To cleanup, e.g. before a re-build
218
 
219
    cd $RETROBASE/tools/src
220
    rm_dep
221
    make realclean
222
 
223 17 wfjm
5b. Setup Tcl environment --------------------------------------------
224 11 wfjm
 
225
  The Tcl files are organized in several packages. To create the Tcl
226
  package files (pkgIndex.tcl)
227
 
228
    cd $RETROBASE/tools/tcl
229
    setup_packages
230
 
231
  To use these packages it is convenient to make them available via the
232
  'auto_path' mechanism. To do that add in your .tclshrc or .wishrc
233
 
234
    lappend auto_path [file join $env(RETROBASE) tools tcl]
235
    lappend auto_path [file join $env(RETROBASE) tools lib]
236
 
237
  The w11 distribution contains two ready to use .tclshrc or .wishrc
238
  files which
239
    - include the auto_path statements above
240
    - activate tclreadline (and thus in tclshrc an event loop)
241
 
242
  To use them simply copy them into your home directory (or soft link them)
243
 
244
    cd $HOME
245
    ln -s $RETROBASE/tools/tcl/.tclshrc .
246
    ln -s $RETROBASE/tools/tcl/.wishrc  .
247
 
248 17 wfjm
5c. Rebuild Cypress FX2 firmware -------------------------------------
249 11 wfjm
 
250 17 wfjm
  The download includes pre-build firmware images for the Cypress FX2
251
  USB interface used on the Digilent Nexys2, Nexys3 and Atlys Boards.
252
  These firmware images are under
253 11 wfjm
 
254 17 wfjm
    $RETROBASE/tools/fx2/bin
255
 
256
  To re-build them, e.g. because a different USB VID/PID is to be used
257
 
258
    cd $RETROBASE/tools/fx2/src
259
    make clean
260
    make
261
    make install
262
 
263
  Please read README_USB_VID-PID.txt carefully to understand the usage
264
  of USB VID and PID.
265
 
266
6. The build system -------------------------------------------------------
267
 
268 5 wfjm
  Simulation and synthesis tools usually need a list of the VHDL source
269
  files, often in proper compilation order (libraries before components).
270
  The different tools have different formats of these 'project files'.
271
 
272 25 wfjm
  The build system employed in this project is based on manifest files called
273
     'vbom' or "VHDL bill of material" files
274
  which list for each vhdl source file the libraries and sources for the
275
  instantiated components, the later via their vbom, and last but not least
276
  the name of the vhdl source file.
277
  All file name are relative to the current directory. A recursive traversal
278
  through all vbom's gives for each vhld module all sources needed to compile
279
  it. The vbomconv script in tools/bin does this, and generates depending on
280
  options
281
    - make dependency files
282
    - ISE xst project files
283
    - ISE ISim project files
284
    - ghdl commands for analysis, inspection and make step
285 5 wfjm
 
286
  The master make files contain pattern rules like
287
    %.ngc  : %.vbom           -- synthesize with xst
288
    %      : %.vbom           -- build functional model test bench
289
  which encapsulate all the vbomconf magic
290
 
291 25 wfjm
  A full w11a is build from about 100 source files, test benches from
292 5 wfjm
  even more. Using the vbom's a large number of designs can be easily
293
  maintained.
294
 
295 25 wfjm
6a. Setting up Xilinx environment with xtwi --------------------------
296
 
297
  The Xilinx ISE setup script redefines PATH and LD_LIBRARY_PATH. The ISE
298
  tools run fine in this environment, but other installed programs on the
299
  system  can (and actually do) fail.
300
 
301
  The build system uses a small wrapper script called xtwi to encapsulate
302
  the Xilinx environment. It expects that the environment variable XTWI_PATH
303
  is setup to the install path of the  ISE version to be used. Without the
304
  /ISE_DS/ which is added by the ISE installation procedure !
305
 
306
  Note: don't run the ISE setup scripts ..../settings(32|64).sh in your
307
    working shell. Setup only XTWI_PATH !
308
 
309 17 wfjm
7. Building test benches --------------------------------------------------
310 5 wfjm
 
311 17 wfjm
7a. General instructions ---------------------------------------------
312 11 wfjm
 
313 5 wfjm
  To compile a test bench named  all is needed is
314
 
315
    make 
316
 
317
  The make file will use .vbom, create all make dependency files,
318
  and generate the needed ghdl commands.
319
 
320
  In many cases the test benches can also be compiled against the gate
321
  level models derived after the xst, map or par step. To compile them
322
 
323
    make ghdl_tmp_clean
324
    make _ssim                  # for post-xst
325
    make _fsim                  # for post-map
326
    make _tsim                  # for post-par
327
 
328
  The 'make ghdl_tmp_clean' is needed to flush the ghdl work area from
329
  the compilation remains of earlier functional model compiles.
330
 
331 17 wfjm
7b. Available test benches -------------------------------------------
332 5 wfjm
 
333 11 wfjm
  See file w11a_tb_guide.txt
334
 
335 17 wfjm
8. Building systems -------------------------------------------------------
336 11 wfjm
 
337 17 wfjm
8a. General instructions ---------------------------------------------
338 11 wfjm
 
339 25 wfjm
  First ensure that XTWI_PATH is setup, see section 6a.
340
 
341 5 wfjm
  To generate a bit file for a system named  all is needed is
342
 
343
    make .bit
344
 
345
  The make file will use .vbom, create all make dependency files, build
346
  the ucf file with cpp, and run the synthesis flow (xst, ngdbuild, par, trce).
347
  The log files will be named
348
 
349
      _xst.log        # xst log file
350
      _tra.log        # translate (ngdbuild) log file (renamed %.bld)
351
      _map.log        # map log file                  (renamed %_map.mrp)
352
      _par.log        # par log file                  (renamed %.par)
353
      _pad.log        # pad file                      (renamed %_pad.txt)
354
      _twr.log        # trce log file                 (renamed %.twr)
355
 
356
  To load the bitfile with WebPack impact into the target board use
357
 
358 12 wfjm
    make .iconfig
359 5 wfjm
 
360 20 wfjm
  For boards with a Cypress FX2 USB controller load the bitfile directly with
361
 
362
    make .jconfig
363
 
364 25 wfjm
  If a svf file is required for configuring the FPGA a svf can be created
365
  from a bit file with
366
 
367
    make .svf
368
 
369 5 wfjm
  If only the xst or par output is wanted just use
370
 
371
    make .ngc
372
    make .ncd
373 11 wfjm
 
374 17 wfjm
  A simple 'message filter' system is also integrated into the make build flow.
375
  For many (though not all) systems a .mfset file has been provided which
376
  defines the xst,par and bitgen messages which are considered ok. To see
377
  only the remaining message extracted from the vaious .log files simply
378
  use the make target
379 11 wfjm
 
380 17 wfjm
    make .mfsum
381
 
382
  after a re-build.
383
 
384 25 wfjm
8b. Configuring FPGAs (via make flow) --------------------------------
385 17 wfjm
 
386
  The make flow supports also loading the bitstream into FPGAs, either
387
  via Xilinx Impact, or via the Cypress FX2 USB controller is available.
388
 
389
  For Xilinx Impact a Xilinx USB Cable II has to be properly setup, than
390
  simply use
391
 
392
    make .iconfig
393
 
394 20 wfjm
  For using the Cypress FX2 USB controller on Digilent Nexys2, Nexys3 and
395 17 wfjm
  Atlys boards just connect the USB cable and
396
 
397
    make .jconfig
398
 
399
  This will automatically check and optionaly re-load the FX2 firmware
400
  to a version matching the FPGA design, generate a .svf file from the
401
  .bit file, and configure the FPGA. In case the bit file is out-of-date
402
  the whole design will be re-implemented before.
403
 
404 25 wfjm
8c. Configuring FPGAs (directly via config_wrapper) ------------------
405 17 wfjm
 
406 25 wfjm
  The make flow described above uses two scripts
407
    config_wrapper              # must be used with xtwi !
408
    fx2load_wrapper
409
  which can be used directly for loading available bit or svf files into
410
  the FPGA. For detailed documentation see the respective man pages.
411
 
412
  Examples for the supported boards are given in section 8e.
413
 
414
8d. Available systems ------------------------------------------------
415
 
416 23 wfjm
  Currently ready to build versions exist for
417
    - Digilent S3BOARD (-1000 FPGA version)
418
    - Digilent Nexys2 board (-1200 FPGA version)
419
    - Digilent Nexys3 board
420 11 wfjm
 
421 23 wfjm
  To build the designs locally use
422
 
423 11 wfjm
  1. rlink tester
424 23 wfjm
     a. for Digilent S3BOARD
425 11 wfjm
 
426 23 wfjm
        cd $RETROBASE/rtl/sys_gen/tst_rlink/s3board
427
        make sys_tst_rlink_s3.bit
428
 
429
     b. for Digilent Nexys2 board
430
 
431 11 wfjm
        cd $RETROBASE/rtl/sys_gen/tst_rlink/nexys2
432
        make sys_tst_rlink_n2.bit
433
 
434 23 wfjm
     c. for Digilent Nexys3 board
435 15 wfjm
 
436
        cd $RETROBASE/rtl/sys_gen/tst_rlink/nexys3
437
        make sys_tst_rlink_n3.bit
438
 
439 17 wfjm
  2. rlink over USB tester
440
     a. for Digilent Nexys2 board
441
 
442
        cd $RETROBASE/rtl/sys_gen/tst_rlink_cuff/nexys2/ic
443
        make sys_tst_rlink_cuff_ic_n2.bit
444
 
445 21 wfjm
     b. for Digilent Nexys3 board
446
 
447
        cd $RETROBASE/rtl/sys_gen/tst_rlink_cuff/nexys3/ic
448
        make sys_tst_rlink_cuff_ic_n3.bit
449
 
450 17 wfjm
  3. w11a systems
451 11 wfjm
     a. for Digilent S3BOARD
452
 
453
        cd $RETROBASE/rtl/sys_gen/w11a/s3board
454
        make sys_w11a_s3.bit
455
 
456
     b. for Digilent Nexys2 board
457
 
458
        cd $RETROBASE/rtl/sys_gen/w11a/nexys2
459
        make sys_w11a_n2.bit
460 15 wfjm
 
461
     c. for Digilent Nexys3 board
462
 
463
        cd $RETROBASE/rtl/sys_gen/w11a/nexys3
464
        make sys_w11a_n3.bit
465 19 wfjm
 
466 25 wfjm
8e. Available bitkits with bit and log files -------------------------
467
 
468
  Tarballs with ready to use bit files and all logfiles from the tool
469
  chain can be downloaded from
470
    http://www.retro11.de/data/oc_w11/bitkits/
471
  This area is organized in folders for different releases. The tarball
472
  file names contain information about release, Xlinix tool, and design:
473
    __.tgz
474
 
475
  These designs can be loaded with config_wrapper into the FPGA. The
476
  procedures for the supported boards are given below.
477
 
478
  Notes:
479
    1. XTWI_PATH and RETROBASE environment variables must be defined.
480
    2. config_wrapper bit2svf is only needed once to create the svf files.
481
    3. fx2load_wrapper is needed once after each board power on.
482
 
483
  a. for Digilent S3BOARD (using ISE Impact)
484
 
485
       xtwi config_wrapper --board=s3board iconfig .bit
486
 
487
  b. for Digilent Nexys2 board (using Cypress FX2 USB controller)
488
 
489
       xtwi config_wrapper --board=nexys2 bit2svf .bit
490
       fx2load_wrapper     --board=nexys2 --file=nexys2_jtag_2fifo_ic.ihx
491
       xtwi config_wrapper --board=nexys2 jconfig .svf
492
 
493
  c. for Digilent Nexys3 board (using Cypress FX2 USB controller)
494
 
495
       xtwi config_wrapper --board=nexys3 bit2svf .bit
496
       fx2load_wrapper     --board=nexys3 --file=nexys3_jtag_2fifo_ic.ihx
497
       xtwi config_wrapper --board=nexys3 jconfig .svf
498
 
499 19 wfjm
9. Generate Doxygen based source code view --------------------------------
500
 
501
   Currently there is not much real documentation included in the source
502
   files. The doxygen generated html output is nevertheless very useful
503
   to browse the code. C++, Tcl and Vhdl source are covered by setup files
504
   contained in the project files.
505
 
506
   To generate the html files
507
 
508
     cd $RETROBASE/tools/dox
509
     export RETRODOXY 
510
     ./make_doxy
511
 
512
   If RETRODOXY is not defined '/tmp' is used. To view the docs use
513
 
514
     firefox $RETRODOXY/w11/cpp/html/index.html &
515
     firefox $RETRODOXY/w11/tcl/html/index.html &
516
     firefox $RETRODOXY/w11/vhd/html/index.html &

powered by: WebSVN 2.1.0

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