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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [doc/] [INSTALL.txt] - Blame information for rev 24

Details | Compare with Previous | View Log

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