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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [doc/] [orpsoc.texi] - Blame information for rev 415

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

Line No. Rev Author Line
1 397 julius
\input texinfo   @c -*-texinfo-*-
2
@c %**start of header
3
@setfilename orpsoc.info
4
@settitle ORPSoC manual 0.1
5
@include config.texi
6
@c %**end of header
7
 
8
@copying
9
This file documents the OpenRISC Reference Platform SoC, @value{ORPSOC}.
10
 
11
Copyright @copyright{} 2010 OpenCores
12
 
13
@quotation
14
Permission is granted to copy, distribute and/or modify this document
15
under the terms of the GNU Free Documentation License, Version 1.2 or
16
any later version published by the Free Software Foundation; with no
17
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
18
Texts.  A copy of the license is included in the section entitled ``GNU
19
Free Documentation License''.
20
@end quotation
21
@end copying
22
 
23
@setchapternewpage on
24
@settitle @value{ORPSOC} User Guide
25
 
26
@syncodeindex fn cp
27
@syncodeindex vr cp
28
 
29
@titlepage
30
@title @value{ORPSOC} User Guide
31
@c @subtitle subtitle-if-any
32
@c @subtitle second-subtitle
33
@author Julius Baxter
34
@author OpenCores
35
@author Issue 1 for @value{ORPSOC}
36
 
37
@c  The following two commands
38
@c  start the copyright page.
39
@page
40
@vskip 0pt plus 1filll
41
@insertcopying
42
 
43
Published by OpenCores
44
@end titlepage
45
 
46
@c So the toc is printed at the start.
47
@contents
48
 
49
@ifnottex
50
@node Top
51
@top Scope of this Document
52
 
53
This document is the user guide for @value{ORPSOC}, the OpenRISC Reference Platform System on Chip project.
54
 
55
@end ifnottex
56
 
57
@menu
58
* Introduction::
59
* Project Organisation::
60
* Getting Started::
61
* Reference Design::
62
* Board Designs::
63 408 julius
* ORDB1A3PE1500::
64 415 julius
* ML501::
65 397 julius
* GNU Free Documentation License::  The license for this documentation
66
* Index::
67
@end menu
68
 
69 408 julius
@node Document Introduction
70 397 julius
@chapter Introduction
71
 
72
@cindex introduction to this @value{ORPSOC}
73
 
74 415 julius
@value{ORPSOC} is intended to be a reference implementation of processors in the OpenRISC family. It provides a smallest-possible reference system, primarily for testing of the processors, and systems intended to be synthesized and run on physical hardware (boards.) The simple reference system contains just enough to test the processor's functionality, whereas the board targeted builds will include many additional peripherals.
75 397 julius
 
76
The reference design will contain a minimal set of resources to create an OpenRISC-based SoC. It is expected the board builds will contain their own set of peripheral modules and software, and still draw upon the resources available in the reference implementation. It is hoped that, with this structure, the project can serve dual roles; to be a development platform for OpenRISC family processors, and to provide a platform for development of complex OpenRISC-based systems on chip.
77
 
78
This document, the user guide, focuses on getting the various designs in @value{ORPSOC} up and running. For matters relating to development of a board port, see the development guide included with this documentation.
79
 
80
@c ****************************************************************************
81
@c Project Organisation
82
@c ****************************************************************************
83
 
84
@node Project Organisation
85
@chapter Project Organisation
86
@cindex organisation of @value{ORPSOC} project
87
 
88
@menu
89
* Overview::
90
* Software::
91
* RTL::
92
* Testbenches::
93
* Reference And Board Designs::
94
@end menu
95
 
96 408 julius
@node Organisation Overview
97
@section Organisation Overview
98 397 julius
 
99
The @value{ORPSOC} project is intended for dual uses. One is to act as a development platform for OpenRISC processors, as well as development of complex OpenRISC-based SoCs. Organising a single project to satisfy these requirements can lead to some confusion. This section is intended to make the organisation of the project clear.
100
 
101 415 julius
In essence, the reference implementation based in the root of the project contains enough to get a simple OpenRISC-based SoC together, the board builds are intended to implement fully-featured systems. The project is organised in such a way that the board builds can use both the reference implementation's RTL and software, as well as its own set of RTL and software. The reference implementation, however, cannot use any board's modules, software or scripts.
102 397 julius
 
103
The following sections outline the organisation of the software, RTL, and board designs.
104
 
105 408 julius
@node Software Organisation
106 397 julius
@section Software
107
 
108
The @code{sw} path contains primarily target software (code intended for cross-compilation and execution on an OpenRISC processor) and a few custom tools for manipulation of binary software images.
109
 
110
Driver software, implementing access functions for hardware modules, are found under @code{sw/drivers}. There is the concept of a CPU library, providing CPU-specific functions, which can be changed to support different versions of OpenRISC processors. There is also a minimal support library under the @code{sw/lib} path. Both drivers and support library are compiled together to create a library called @code{liborpsoc} which is placed in @code{sw/lib}.
111
 
112
Test software is found under @code{sw/tests}. Typically, each is for a specific module, or for a particular capability (eg. tests for the UART capability are under @code{sw/tests/uart}, rather than @code{sw/tests/uart16550} which.) There are no specific rules here.
113
 
114
Under each test directory are two directories, @code{board} and @code{sim}, containing the test software targeted at each. Code for simulation will produce less printfs and perhaps not run as long as tests intended to run at full speed on target.
115
 
116
There are for naming software tests, so the automation scripts can locate them. The test directory name must be a single word (potentially with underscores), and then the tests must be in files of the format @emph{testdirname}-@emph{testname}.extension, eg. @code{uart-simple.c} or @code{or1200-fp.S}.
117
 
118 408 julius
@node RTL Organisation
119 397 julius
@section RTL
120
 
121
The HDL code layout conforms to those outlined in the OpenCores.org coding guidelines. http://cdn.opencores.org/downloads/opencores_coding_guidelines.pdf
122
 
123
Beyond that, there are some rules for the naming in modules. The directory name (presumably the name of the module, something like @code{uart16550}) should also be the name of the top level file, eg. @code{uart16550.v}, and the top level module should also be simply this name, eg. @code{module uart16550 (...}.
124
 
125 408 julius
@node Testbench Organisation
126
@section Testbench
127 397 julius
 
128
For each design in @value{ORPSOC} there will be a testbench instantiating the top level, and any peripherals (at least, as many as there are models for.)
129
 
130
Despite this being far from a thorough verification platform, it is considered useful to be able to perform enough simulation to ensure that the fundamental system is correctly assembled and can communicate with the peripherals. However, this is not intended as a platform for peripheral development (although, it very well could be) the board designs are not expected to have thorough peripheral tests. They are expected to have just enough to prove that basic functionality.
131
 
132 408 julius
@node Organisation of Reference And Board Designs
133 397 julius
@section Reference And Board Designs
134
 
135
The goal of the reference design is to provide an environment to develop and test OpenRISC processors (also, potentially, basic components.) The goal of the various board-targeted designs is to provide ready-to-go implementations for hardware.
136
 
137
Typically, a board-targeted design will wish to reuse common components (processor, debug interface, Wishbone arbiters, UART etc.) The project has been configured to allow a board build to use either modules available in the ``common'' RTL path (@code{rtl/verilog/}) as well as those in their ``local'' RTL path (something like @code{boards/vendor/boardname/rtl/verilog}). In the event that some particular modification to a module in the common RTL set is desired for a particular board build, that module can simply be copied into the board's ``local'' RTL path and the scripts will that version instead of the common one.
138
 
139
 
140
 
141
@c ****************************************************************************
142
@c Getting started
143
@c ****************************************************************************
144
 
145
@node Getting Started
146
@chapter Getting Started
147
@cindex source files for @value{ORPSOC}, downloading
148
 
149
@menu
150
* Supported Platforms::
151
* Obtaining Project Source::
152
* Required Tools::
153
@end menu
154
 
155 408 julius
@node Getting Started Supported Platforms
156 397 julius
@section Supported Platforms
157
@cindex platforms supported by the @value{ORPSOC} project
158
 
159
At present the majority of  @value{ORPSOC}'s development occurs with tools that run under the GNU/Linux operating system. All of the tools required to run the basic implementation are free, open source, and easily installable in any modern GNU/Linux distribution.
160
 
161
Unless indicated otherwise, support for the project under Cygwin on Microsoft Windows platforms is not a given.
162
 
163
 
164 408 julius
@node Getting Started Obtaining Project Source
165 397 julius
@section Obtaining Project Source
166
@cindex getting a copy of the @value{ORPSOC} project
167
 
168
The source for @value{ORPSOC} can be obtained from the OpenCores subversion (SVN) server.
169
 
170
@example
171
@kbd{svn export http://opencores.org/ocsvn/openrisc/openrisc/trunk/orpsocv2}
172
@end example
173
 
174 408 julius
@node Getting Started Required Tools
175 397 julius
@section Required Tools
176
@cindex tools and utilities required for @value{ORPSOC}
177
 
178
 
179
Performing the installation of tools required to design, simulate, verify, compile and debug a SoC is not for the faint hearted. The various sets of tools must be first installed, and the user's environment configured to allow them to run correctly.
180
 
181 415 julius
First the host system must be capable of building and running development tools, next the various compilers, simulators and utilities must be installed, and finally, if required, additional tools to interact with the built design are installed. Once complete, the set up rarely needs to be touched, and results in greatly improved productivity.
182 397 julius
 
183
The required tools can be divided into four groups.
184
 
185
@itemize @bullet
186
@item
187
Host system tools - things like gcc, make, texinfo.
188
 
189
@item
190
Target system toolchain and software - the OpenRISC GNU toolchain, with gcc crosscompiler, support libraries, the GNU debugger (gdb), OpenRISC port of various OSes and RTOS, etc.
191
 
192
@item
193
Electronic design automation (EDA) tools - preprocessors, simulators, FPGA tool suites, etc.
194
 
195
@item
196
Debug tools - tools providing control over the system on target
197
@end itemize
198
 
199
The first two items are likely to be the same for most of the designs included in @value{ORPSOC}, however the final two can vary greatly depending on the FPGA vendor, part and configuration, and the application of the SoC design.
200
 
201
There will be a section on the tools for each design in @value{ORPSOC}. This section is intended to provide a list of tools required for each particular build. Any lengthy instructions on installing a particular tool will be attached as an appendix, which can be references by several build prerequisite lists in order to save repetition of information.
202
 
203
Anyone implementing their own board port is encouraged to document, as best they can, any problematic tool installations and contribute them to this document.
204
 
205
 
206
 
207
@c ****************************************************************************
208
@c Reference Design chapter
209
@c ****************************************************************************
210
 
211
@node Reference Design
212
@chapter Reference Design
213
@cindex reference design
214
 
215
@menu
216
* Overview::
217
* Structure::
218
* Tools::
219
* Simulation::
220
* Synthesis::
221
@end menu
222
 
223 408 julius
@node Reference Design Overview
224 397 julius
@subsection Overview
225
 
226
The reference design included in @value{ORPSOC} is intended to be the minimal implementation (or thereabouts) of a SoC required to exercise an OpenRISC processor. In this regard, very little apart from the processor, memory, debug interface and interconnect modules are instantiated.
227
 
228 415 julius
The primary role for this design is to implement a system that an OpenRISC processor can be instantiated in for for development purposes. The automated testing mechanism, capable of compiling, executing and checking software on the design, is used as a method of regression testing for the processor as it is developed. After features are added or modified in the processor, new software tests can be added to the existing suite, checking for the expected functionality and ensuring legacy behavior is also unchanged.
229 397 julius
 
230
The design can be simulated two ways. The first uses the standard event-driven simulators such as Icarus Verilog and Mentor Graphics' Modelsim. The second method involves creating a cycle accurate (C or SystemC) model from the Verilog HDL description using the Verilator tool.
231
 
232
The simulations begin with the desired software image preloaded in memory. For debugging the design, the models provide an interface to the system allowing the GNU debugger to control the target processor in a manner similar to that of physical hardware.
233
 
234
The design is not intended for implementation on an FPGA or ASIC, rather purely for development and testing in simulation environments. The board targeted builds in the @value{ORPSOC} project, however, are intended for implementation on hardware.
235
 
236 408 julius
@node Reference Design Structure
237 397 julius
@subsection Structure
238
 
239
@menu
240
* Overview::
241
* RTL::
242
* Software::
243
* Simulation::
244
@end menu
245
 
246 408 julius
@node Reference Design Overview
247 397 julius
@subsubsection Overview
248
 
249
The reference design's paths are all based in the root directory of @value{ORPSOC}. This is different from the board-targeted builds, which are based in their specific board paths.
250
 
251
As synthesis and physical implementation is not intended for the reference design there are no @code{syn} or @code{backend} paths in the root directory of @value{ORPSOC}.
252
 
253 408 julius
@node Reference Design RTL
254 397 julius
@subsubsection RTL
255
 
256
At present only Verilog HDL is included in the reference implementation of @value{ORPSOC}, as the open source tools intended to simulate the design do not support VHDL.
257
 
258
The directory structure consists of an @code{rtl} directory in the root, and a @code{verilog} path under that. Within the @code{rtl/verilog} path, each module has its own directory.
259
 
260
A common Verilog include path, @code{rtl/verilog/include} directory is used. The Verilog HDL include files for each module should be moved here. This allows each @value{ORPSOC} implementation (board design) to maintain their own include path, and thus configure the modules for their specific implementation.
261
 
262 408 julius
@node Reference Design Software
263 397 julius
@subsubsection Software
264
 
265
The software run on the reference design is found in the @value{ORPSOC} root directory, under the @code{sw} path.
266
 
267
The test software for the or1200 processor is found under @code{sw/tests/or1200/sim}.
268
 
269
A minimal set of drivers is built into @code{liborpsoc}, and they are found under @code{sw/tests/drivers}.
270
 
271
In addition to these drivers, a set of support C functions is build into @code{liborpsoc}, which are found in the @code{sw/lib} path.
272
 
273 408 julius
@node Reference Design Simulation
274 397 julius
@subsubsection Simulation
275
 
276
The simulation of the reference design is run from the @code{sim/run} path.
277
 
278
The script controlling simulation is the file @code{sim/bin/Makefile}.
279
 
280
The generated output is kept in the @code{sim/out} path, and is cleared away when @kbd{make clean} is run.
281
 
282
When the Verilator-processed cycle accurate model is built, it is done in the @code{sim/vlt} path, which is also cleaned away when @kbd{make clean} is run.
283
 
284 408 julius
@node Reference Design Tools
285 397 julius
@subsection Tools
286
 
287
@menu
288
* Host Tools::
289
* Target System Tools::
290
* EDA Tools::
291
* Debug Tools::
292
@end menu
293
 
294 408 julius
@node Reference Design Host Tools
295 397 julius
@subsubsection Host Tools
296
@cindex host tools required
297
 
298
Standard development suite of tools: gcc, make, etc.
299
 
300 408 julius
@node Reference Design Target System Tools
301 397 julius
@subsubsection Target System Tools
302
@cindex target system tools required
303
 
304
OpenRISC GNU toolchain. For installation, see OpenRISC GNU toolchain page on OpenCores.org.
305
 
306 408 julius
@node Reference Design EDA Tools
307 397 julius
@subsubsection EDA Tools
308
@cindex EDA tools required
309
 
310
RTL simulation: Icarus Verilog (also compatible with Mentor Graphics' Modelsim)
311
Cycle Accurate Simulation: Verilator, Verilog-Perl, System-Perl, SystemC
312
 
313 408 julius
@node Reference Design Debug Tools
314 397 julius
@subsubsection Debug Tools
315
@cindex Debug tools required
316
 
317
None. The target is purely simulation, no extra utilities are required to debug.
318
 
319
 
320 408 julius
@node Reference Design Simulation
321 397 julius
@subsection Simulation
322
 
323
@menu
324
* RTL::
325
* Cycle Accurate::
326
* Results::
327
@end menu
328
 
329 408 julius
@node Reference Design RTL
330 397 julius
@subsubsection RTL
331
@cindex rtl simulation of reference design
332
 
333
All simulations of the reference design are run from the @code{sim/run} path.
334
 
335
@subsubheading Running RTL Regression Test
336
 
337
The simplest way of starting a run through the regression test, using the default RTL simulator, Icarus Verilog, can be done with:
338
 
339
@example
340
@kbd{make rtl-tests}
341
@end example
342
 
343 408 julius
This will compile the software and RTL, and run a new simulation for each software test. Defining which tests are run is the variable @code{TESTS}, set by default in the @code{sw/bin/Makefile} script. Other default options are that a processor execution log is generated (in @code{sim/out/@emph{testname}-executed.log}), but VCDs are not.
344 397 julius
 
345
@subsubheading Running An Individual Test
346
 
347
An individual test can be run, by specifying the test name through the @code{TEST} environment variable (which must correspond to a file in @code{sw/tests/@emph{module}/sim/} where @code{@emph{module}} is the name of the module to be tested. In the following example the test @emph{or1200-basic} is run.
348
 
349
@example
350
@kbd{make rtl-test TEST=or1200-basic}
351
@end example
352
 
353 408 julius
@node Running A Set Of Specific Reference Design RTL Tests
354 397 julius
@subsubheading Running A Set Of Specific Tests
355
 
356
A specific set of tests can be run in the same fashion as the regression tests but with the actual tests to run set in the @code{TESTS} environment variable.
357
 
358
@example
359
@kbd{make rtl-tests TESTS="sdram-rows uart-simple or1200-mmu or1200-fp"}
360
@end example
361
 
362 408 julius
@node Options For Reference Design RTL Tests
363 397 julius
@subsubheading Options For RTL Tests
364
 
365
There are some options, which can be specified through shell environment variables when running the test.
366
 
367
@table @code
368
 
369
@item VCD
370 408 julius
Set to '1' to enable @emph{value change dump} (VCD) creation in @code{sim/out/@emph{testname}.vcd}
371 397 julius
 
372
@item VCD_DELAY
373
Delay VCD creation start time by this number of timesteps (used as a Verilog @code{#delay} in the testbench.)
374
 
375
@item VCD_DELAY_INSNS
376
Delay VCD creation start time until this number of instructions has been executed by the processor. Useful for creating a dump just before a bug exhibited and correlated to an instruction number (from execution trace file.)
377
 
378
@item END_TIME
379
Force simulation end (@code{$finish}) at this time.
380
 
381
@item DISABLE_PROCESSOR_LOGS
382
Turn off processor monitor's execution trace generation. This helps speed up the simulation (less time writing to files) and avoids creating very large execution logs (in the GBs) for very long simulations.
383
 
384
@item SIMULATOR
385
Specify simulator to use. Default is Icarus Verilog, can be set to @code{modelsim} to use Mentor Graphics' Modelsim. No others are supported right now.
386
 
387
@end table
388
 
389
 
390
 
391 408 julius
@node Reference Design Cycle Accurate
392 397 julius
@subsubsection Cycle Accurate
393
@cindex cycle accurate simulation of reference design
394
 
395
@subsubheading Running Cycle Accurate Regression Test
396
 
397
The simplest way of starting a run through the regression test using the cycle accurate model can be done with:
398
 
399
@example
400
@kbd{make vlt-tests}
401
@end example
402
 
403
This will build the cycle accurate model and run a new simulation for each software test. Defining which tests are run is the variable @code{TESTS}, set by default in the @code{sw/bin/Makefile} script.
404
 
405
@subsubheading Running An Individual Test
406
 
407
An individual test can be run, by specifying the test name through the @code{TEST} environment variable (which must correspond to a file in @code{sw/tests/@emph{module}/sim/} where @code{@emph{module}} is the name of the module to be tested. In the following example the test @emph{or1200-basic} is run.
408
 
409
@example
410
@kbd{make vlt-test TEST=or1200-basic}
411
@end example
412
 
413
@subsubheading Generating Cycle Accurate Simulator Executable
414
 
415
The cycle accurate model is somewhat similar to the OpenRISC architectural simulator, in that it can be run as a standalone application, although it is not as configurable at runtime. The standalone application can be built with the following command from the @code{sim/run} path.
416
 
417
@example
418
@kbd{make prepare-vlt}
419
@end example
420
 
421
The resulting executable will be @emph{Vorpsoc_top} in the @code{sim/vlt} path. Run it with the @emph{-h} option for usage instructions.
422
 
423
@subsubheading Generating Automatically Profiled Cycle Accurate Simulator Executable
424
 
425
An automatic profiling and compilation set of commands in the script can be used to create a higher performance cycle accurate model. The following make target will first compile the cycle accurate design to generate profiling outputs, run some software, and recompile using the profiling information.
426
 
427
@example
428
@kbd{make prepare-vlt-profiled}
429
@end example
430
 
431
@subsubheading Cycle Accurate Model Executable Usage
432
 
433
The executable generated by running any of the above commands is in the @code{sim/vlt} path. The usage options can be listed by running it with the @code{--help} switch.
434
 
435
@example
436
@kbd{Vorpsoc_top --help}
437
@end example
438
 
439
A short list of options is given here.
440
 
441
@table @code
442
 
443
@item -f @var{file}
444
@itemx --program @var{file}
445
@cindex @code{-f}
446
@cindex @code{--program}
447
Load software from OR32 ELF image @var{file}
448
 
449
If unspecified, model attempts to load VMEM file @code{sram.vmem}
450
 
451
@item -v
452
@itemx --vcd
453
@cindex @code{-v}
454
@cindex @code{--vcd}
455
Dump VCD file
456
 
457
@item -e @var{value}
458
@itemx --endtime @var{value}
459
@cindex @code{-e}
460
@cindex @code{--endtime}
461
End simulation after @var{value} simulated ns
462
 
463
@item -l @var{file}
464
@itemx --log @var{file}
465
@cindex @code{-l}
466
@cindex @code{--log}
467
Log processor execution trace to @var{file}
468
 
469
@end table
470
 
471 408 julius
@node Reference Design Results
472 397 julius
@subsubsection Results
473
@cindex output from simulation of reference design
474
 
475 415 julius
The following files are generated from the event driven simulation. For output options of the cycle accurate model, see the section on Cycle Accurate Model Executable Usage.
476 397 julius
 
477
@subsubheading Processor Execution Trace
478
 
479
A trace of the processor after each executed instruction is generated by both the event and cycle accurate models.
480
 
481
In the event driven simulations, the log is created by default, and is stored in @code{sim/out} and will be named @code{@emph{test-name}-executed.log}.
482
 
483
@subsubheading Processor SPR Access Log
484
 
485
A list of processor special purpose registers (SPR) accesses is created when processor logging is enabled.
486
 
487
These values are logged to a file in @code{sim/out} named @code{@emph{test-name}-sprs.log}.
488
 
489
@subsubheading Processor Instruction Excecution Time Log
490
 
491
A list of when each instruction was executed is generated when processor execution logging is enabled.
492
 
493
This is useful when debugging with VCD, and detecting at what time the problematic instructions were executed.
494
 
495
These values are logged to a file in @code{sim/out} named @code{@emph{test-name}-lookup.log}.
496
 
497
@subsubheading Processor Report Mechanism Log
498
 
499
The use of the processor's report mechanism is commonplace in the test software, as it allows for the checking of intermediate values after simulation.
500
 
501
These values are logged to a file in @code{sim/out} named @code{@emph{test-name}-general.log}. This is not optional.
502
 
503
@subsubheading Value Change Dump (VCD)
504
 
505
When VCD files are generated they are placed in the @code{sim/out} path, and are named @code{@emph{test-name}.vcd}. They should be viewable with programs like @emph{GTKWave}.
506
 
507
 
508 408 julius
@node Reference Design Synthesis
509 397 julius
@subsection Synthesis
510
 
511
The reference design is not intended to be synthesised, and thus no backend scripts are provided. See the sections on the board-specific builds.
512
 
513
 
514
@c ****************************************************************************
515 408 julius
@c ORDB1A3PE1500 board build chapter
516 397 julius
@c ****************************************************************************
517
 
518 408 julius
@node ORDB1A3PE1500
519
@chapter ORDB1A3PE1500
520
@cindex ORDB1A3PE1500 board build information
521 397 julius
 
522
@menu
523
* Overview::
524
* Structure::
525
* Tools::
526
* Simulating::
527 408 julius
* Synthesis and Backend::
528
* Programming File Generation::
529
* Customising::
530 397 julius
@end menu
531
 
532 408 julius
@node ORDB1A3PE1500 Overview
533 397 julius
@subsection Overview
534
 
535 408 julius
The ORDB1 (ORSoC development board 1) with Actel A3PE1500 FPGA is supported by this build.
536 397 julius
 
537 408 julius
As the ORDB1 is intended to be a daughter board for a variety of I/O boards its options for configuration are extensive.
538
 
539
This board port of ORPSoC implements an example of a configurable system, with many cores that can be enabled or disabled as required by the expansion board's capabilities.
540
 
541 415 julius
The port was mainly developed with the ORSoC Ethernet expansion board (OREEB1), and was used with the OpenRISC port of the Linux kernel and BusyBox suite running network applications.
542 408 julius
 
543
This guide will overview how to simulation, synthesize and customise the system.
544
 
545
@node ORDB1A3PE1500 Structure
546 397 julius
@subsection Structure
547
 
548 408 julius
Note that in this chapter the term @emph{board path} refers to the path in the project for this board port; @code{boards/actel/ordb1a3pe1500}.
549 397 julius
 
550 408 julius
The board port's structure is similar to that of a standalone project which accords with the OpenCores coding guidelines. However, all software and RTL that is available in the reference design is also available to the board port, with any local (ie. in the board's @code{rtl} or @code{sw} paths) versions taking precedence over the versions available in the reference design.
551
 
552
The Verilog RTL specific to this board is under @code{rtl/verilog} in the board path. The @code{include} path in there is the place where all required definitions files, configuring the RTL, are found.
553
 
554
Backend files, things such as PLLs and buffers generated by Actel's @emph{smartgen} tool, are found in the board's @code{backend/rtl/verilog} path.
555
 
556
@node ORDB1A3PE1500 Tools
557 397 julius
@subsection Tools
558
 
559
@menu
560
* Host Tools::
561
* Target System Tools::
562
* EDA Tools::
563
* Debug Tools::
564
@end menu
565
 
566 408 julius
@node ORDB1A3PE1500 Host Tools
567 397 julius
@subsubsection Host Tools
568 408 julius
@cindex host tools required ORDB1A3PE1500
569 397 julius
 
570
Standard development suite of tools: gcc, make, etc.
571
 
572 408 julius
@node ORDB1A3PE1500 Target System Tools
573 397 julius
@subsubsection Target System Tools
574 408 julius
@cindex target system tools required ORDB1A3PE1500
575 397 julius
 
576
OpenRISC GNU toolchain. For installation, see OpenRISC GNU toolchain page on OpenCores.org.
577
 
578 408 julius
@node ORDB1A3PE1500 EDA Tools
579 397 julius
@subsubsection EDA Tools
580 408 julius
@cindex EDA tools required ORDB1A3PE1500
581 397 julius
 
582
RTL, gatelevel simulation: Mentor Graphics' Modelsim
583
Synthesis: Synopsys Synplify (included in Actel Libero Suite)
584
Backend: Actel Designer (included in Actel Libero Suite)
585
Programming: Actel FlashPRO (included in Actel Libero Suite)
586
 
587 408 julius
This has been developed with Libero v8.6 for Linux.
588
 
589
@node ORDB1A3PE1500 Debug Tools
590 397 julius
@subsubsection Debug Tools
591 408 julius
@cindex Debug tools required ORDB1A3PE1500
592 397 julius
 
593
or_debug_proxy, ORPmon
594
 
595 408 julius
@node ORDB1A3PE1500 Simulating
596
@subsection Simulating
597
@cindex simulating ORDB1A3PE1500
598 397 julius
 
599 408 julius
@subsubheading Run RTL Regression Test
600
 
601
To run the default set of regression tests for the build, run the following command in the board's @code{sw/run} path.
602
 
603
@example
604
@kbd{make rtl-tests}
605
@end example
606
 
607
The same set of options for RTL tests available in the reference design should available in this build. @xref{Running A Set Of Specific Reference Design RTL Tests}.
608
 
609 409 julius
Options specific to the ORDB1A3PE1500 build.
610
 
611
@table @code
612
 
613
@item PRELOAD_RAM
614
Set to '1' to enable loading of the software image into RAM at the beginning of simulation.
615
 
616
If the chosen bootROM program (set via a define in software header file in the board's @code{sw/board/include} path) will jump straight to RAM to begin execution, then the software image will need to be in RAM for the simulation to work. This define @emph{must} be used in that case for the simulation to do anything.
617
 
618
 
619
@end table
620
 
621
 
622
 
623 408 julius
@node ORDB1A3PE1500 Synthesis
624
@subsection Synthesis
625
 
626
Synthesis of the board port for the Actel technology with the Synplify tool can be run in the board's @code{syn/synplify/run} path with the following command.
627
 
628
@example
629
@kbd{make all}
630
@end example
631
 
632
This will create a EDIF netlist in @code{syn/synplify/out}.
633
 
634
Hopefully it's all automated enough so that, as long as the design is simulating as desired, the correct set of RTL will be picked up and synthesized without any need for customising scripts for the tool.
635
 
636
@node ORDB1A3PE1500 Synthesis Options
637
@subsubsection Options
638
 
639
The following can be passed as environment variables when running @kbd{make all}.
640
 
641
@table @code
642
 
643
@item RTL_TOP
644
Default's to the designs top level module, @emph{orpsoc_top}, but if wishing to synthesize a particular module, its name (not instantiated name) should be set here.
645
 
646
@item FPGA_PART
647
Defaults to A3PE1500 but if targeting any other set it with this.
648
 
649
@item FPGA_FAMILY
650
Defaults to the A3PE1500's @emph{ProASIC3E} but if targeting any other set it with this.
651
 
652
@item FPGA_PACKAGE
653
Defaults to PQFP208 but if targeting any other set it with this.
654
 
655
@item FPGA_SPEED_GRADE
656
Defaults to Std but if targeting any other set it with this.
657
 
658
@item FREQ
659
Target frequency for synthesis.
660
 
661
@item MAXFAN
662
Maximum net fanout.
663
 
664
@item MAXFAN_HARD
665
Hard limit on maximum net fanout.
666
 
667
@item GLOBALTHRESH
668
Threshold of fanout before promoting signal to a global routing net.
669
 
670
@item RETIMING
671
Defaults to '1' (on) but set to '0' to disable.
672
 
673
@item RESOURCE_SHARING
674
Defaults to '1' (on) but set to '0' to disable.
675
 
676
@item DISABLE_IO_INSERTION
677
Defaults to '0' (off) but set to '1' to enable. Useful when synthesizing individual modules not intended as a top level.
678
 
679
@end table
680
 
681
@node ORDB1A3PE1500 Synthesis Warnings
682
@subsubsection Checks
683
 
684
The following is a list of some considerations before synthesis.
685
 
686
@itemize @bullet
687
@item bootrom.v
688
 
689 415 julius
If the bootROM module is being used to provide the processor with a program at startup, check that board software include file, in the board's @code{sw/board/include} path, is selecting the correct bootROM program.
690 408 julius
 
691
Do a @kbd{make clean-all} from the synthesis run directory to be sure that the previous bootROM file is cleared away and regenerated when synthesis is run.
692
 
693
 
694
@item Clean away old leftovers
695
 
696
If the unwanted files from an old synthesis run are still there before the next run, it's best to clean them away with @kbd{make clean} from the synthesis run directory.
697
 
698
 
699
@item Check Command Line Options
700
 
701
If using any command line settings, they can be checked by passing them to the following make target: @kbd{make print-config}
702
 
703
 
704
@end itemize
705
 
706
@node ORDB1A3PE1500 Place and Route
707
@subsection Place and Route
708
 
709
Place and route is run from the board's @code{backend/par/run} path with the following command.
710
 
711
@example
712
@kbd{make all}
713
@end example
714
 
715
This will create a @code{.adb} file in the same path.
716
 
717 415 julius
All steps, up to programming file generation are done here. This is mainly a licensing thing (free licenses for Libero under Linux @emph{do not} allow programming file generation - they do, however, under Windows.)
718 408 julius
 
719
@node ORDB1A3PE1500 Place and route options
720
@subsubsection Options
721
 
722 415 julius
Most of the design's parameters are determined by processing the @code{orpsoc-defines.v} file and determining, for example, the frequency of the clocks entering the design.
723 408 julius
 
724
The following can be passed as environment variables when running @kbd{make all}.
725
 
726
@table @code
727
 
728
@item FPGA_PART
729
Defaults to A3PE1500 but if targeting any other set it with this.
730
 
731
@item FPGA_FAMILY
732
Defaults to the A3PE1500's @emph{ProASIC3E} but if targeting any other set it with this.
733
 
734
@item FPGA_PACKAGE
735
Defaults to ``208 PQFP'' but if targeting any other set it with this.
736
 
737
 
738
@item FPGA_SPEED_GRADE
739
Defaults to Std but if targeting any other set it with this.
740
 
741
@item FPGA_VOLTAGE
742
Defaults to 1.5 but if targeting any other set it with this.
743
 
744
@item FPGA_TEMP_RANGE
745
Defaults to COM but if targeting any other set it with this.
746
 
747
@item FPGA_VOLT_RANGE
748
Defaults to COM but if targeting any other set it with this.
749
 
750
@item PLACE_INCREMENTAL
751
Defaults to off.
752
 
753
@item ROUTE_INCREMENTAL
754
Defaults to off.
755
 
756
@item PLACER_HIGH_EFFORT
757
Defaults to off.
758
 
759
@item BOARD_CONFIG
760
Defaults to @code{orsoccpuexpio.mkpinassigns}
761
 
762
@end table
763
 
764
@node ORDB1A3PE1500 Constraints
765
@subsubsection Constraints
766
 
767
 
768
A @emph{synposys design constraints} (SDC) file, and @emph{physical design constraints} (PDC) file are generated automatically by the scripts. The main Verilog defines file is parsed to detect which modules are included in the design, and generates the appropriate constraints which are embedded in the Makefile.
769
 
770
 
771
The PDC relies on the @code{BOARD_CONFIG} environment variable to indicate which pin assignment file to pull into the Makefile (they live in @code{backend/par/bin}). The PDC also depends on the actual contents of the main place and route Makefile, @code{backend/par/bin/Makefile}.
772
 
773
 
774
By default these should have support for the peripherals included with ORPSoC. Double check, however, that the correct constraints are set, by running the following command before starting place and route.
775
 
776
@example
777
@kbd{make pdc-file sdc-file}
778
@end example
779
 
780
These can be generated and edited and then used when running place and route, they will not get replaced.
781
 
782
@node ORDB1A3PE1500 Programming File Generation
783
@subsection Programming File Generation
784
 
785
The @code{.adb} file resulting from place and route can be opened in the Actel @emph{Designer} tool and a programming file generated there.
786
 
787
Once this programming file is created, Actel's @emph{FlashPro} can used to program the ORDB1A3PE1500 board.
788
 
789
@node ORDB1A3PE1500 Customising
790
@subsection Customising
791
 
792
The versatile nature of the ORDB1A3PE1500 means the design that goes on it must be equally versatile, if not more so.
793
 
794
The following sections have information on how to configure the design.
795
 
796
@node ORDB1A3PE1500 Customising Enabling Existing Modules
797
@subsubsection Enabling Existing RTL Modules
798
 
799
The design relies on the Verilog HDL @emph{define} function to indicate which modules are included.
800
 
801 415 julius
There are only a few modules included by default.
802 408 julius
 
803
@itemize @bullet
804
@item Processor - @emph{or1200}
805
@item Clock and reset generation - @emph{clkgen}
806
@item Bus arbiters - @emph{arbiter_ibus}, @emph{arbiter_dbus}, @emph{arbiter_bytebus}
807
@end itemize
808
 
809
The rest are optional, depending on what is defined in the board's @code{rtl/verilog/include/orpsoc-defines.v} file.
810
 
811
Inspect that file to see which modules are able to be included. At present the list includes USB 1.1 host controller and/or slave interface, I2C master/slave core, and SPI master cores.
812
 
813 415 julius
These cores should be supported and ready to go by just defining them (uncomment in the @code{orspco-defines.v} file.)
814 408 julius
 
815
@node ORDB1A3PE1500 Customising Adding Modules
816
@subsubsection Adding RTL Modules
817
 
818
There are a number of steps to take when adding a new module to the design.
819
 
820
@itemize @bullet
821
@item RTL Files
822
 
823
Create a directory under the board's @code{rtl/verilog} directory, and name it the same as the top level of the module.
824
 
825
Ensure the module's top level file and actual name of the module when it will be instantiated are @emph{all the same}.
826
 
827
Place any include files into the board's @code{rtl/verilog/include} path.
828
 
829
@item Instantiate in ORPSoC Top Level File
830
 
831
Instantiate the module in the ORPSoC top level file, @code{rtl/verilog/orpsoc_top/orpsoc_top.v}, and be sure to take care of the following.
832
@itemize @bullet
833
@item Create appropriate @emph{`define} in @code{orpsoc-defines.v} and surround module instantiation with it.
834
@item Add required I/Os (surrounded by appropriate @emph{`ifdef })
835
@item Attach to appropriate bus arbiter, declaring any signals required. Be sure to tie them off if modules is not included.
836
@item Update appropriate bus arbiter (in board's @code{rtl/verilog/arbiters} path) adding (uncommenting) additional ports as needed.
837
@item Update board's @code{rtl/verilog/include/orpsoc-params.v} file with appropriate set of parameters for new module, as well as arbiter memory mapping assignment.
838
@item Attach appropriate clocks and resets, modify the board's @code{rtl/verilog/clkgen/clkgen.v} file generating appropriate clocks if required.
839
@item Attach any interrupts to the processor's PIC vector in, assigned as the last thing in the file.
840
@end itemize
841
 
842
@item Update ORPSoC Testbench
843
 
844
Update the board's @code{bench/verilog/orpsoc_testbench.v} file with appropriate ports (surrounded by appropriate @emph{`ifdef}.)
845
 
846
Add any desired models to help test the module to the board's @code{bench/verilog} path and instantiate it correctly in the testbench.
847
 
848
@item Add Software Drivers and Tests
849
 
850
In a similar fashion to what is already in the board's @code{sw/drivers} and @code{sw/tests} path, create desired driver and test software to be used during simulation (and potentially on target.)
851
 
852
@item Update Backend Scripts
853
 
854 415 julius
If any I/O is added, or special timing specified, the board's backend main Makefile, @code{backend/par/bin/Makefile} and pinout files (in @code{backend/par/bin} will need to be updated.
855 408 julius
 
856
The section in @code{backend/par/bin/Makefile} mapping signals to Makefile variables will need to have these new signals added to them. The section in the file begins with @code{$(PDC_FILE):} and is actually a set of long bash lines.
857
 
858 415 julius
Continuing the format already there should be easy enough. Remember that the @code{orspoc-defines.v} file is parsed and it's possible to tell if the module is included by testing if the variable is defined.
859 408 julius
 
860
For example, to add I/Os for a module called @code{foo}, and in @code{orpsoc-defines.v} a value @code{FOO1} is defined, we can add I/Os @code{foo1_srx_i} and @code{foo1_tx_o[3:0]} with the following.
861
 
862
@example
863
@kbd{   $(Q)if [ ! -z $$FOO1 ]; then \
864
        echo "set_io foo1_srx_i " $(FOO_SRX_BUS_SETTINGS) " \
865 410 julius
        -pinname "$(FOO1_SRX_PIN) >> $@@; \
866 408 julius
        echo "set_io foo1_tx_o\\[0\\] " $(FOO_TX_BUS_SETTINGS) " \
867 410 julius
         -pinname "$(FOO1_TX0_PIN) >> $@@; \
868 408 julius
        echo "set_io foo1_tx_o\\[1\\] " $(FOO_TX_BUS_SETTINGS) "  \
869 410 julius
        -pinname "$(FOO1_TX1_PIN) >> $@@; \
870 408 julius
        echo "set_io foo1_tx_o\\[2\\] " $(FOO_TX_BUS_SETTINGS) "  \
871 410 julius
        -pinname "$(FOO1_TX2_PIN) >> $@@; \
872 408 julius
        echo "set_io foo1_tx_o\\[3\\] " $(FOO_TX_BUS_SETTINGS) "  \
873 410 julius
        -pinname "$(FOO1_TX3_PIN) >> $@@; \
874
fi
875 408 julius
       }
876
@end example
877
 
878
@emph{(ensure there is no whitespace after the trailing backslashes.)}
879
 
880
It's a little hard to follow, but it's essentially one @code{set_io} line for each I/O line.
881
 
882
First the line checks if the module's define was exported (which happens automatically if it's defined in @code{orpsoc-defines.v}.
883
 
884
Note that what is defined can be checked by running @kbd{make print-defines} in the board's @code{backend/par/run} path.
885
 
886
The values of the bus settings variables depend on the desired I/O standards and other examples in the Makefile can be referenced.
887
 
888 415 julius
The pin numbers need to be set in the @code{.mkpinassigns} which is included into the Makefile (according to the @code{BOARD_CONFIG} variable set when running the @code{make} command.)
889 408 julius
 
890
These files are simple assignments of values to variables (and potentially then to other variables) which correspond to the variables finally used in the main Makefile.
891
 
892
The physical constraints file can be generated manually with the @kbd{make pdc-file} command.
893
 
894
@end itemize
895
 
896 415 julius
@c ****************************************************************************
897
@c ML501 board build chapter
898
@c ****************************************************************************
899 408 julius
 
900 415 julius
@node ML501
901
@chapter ML501
902
@cindex ML501 board build information
903 408 julius
 
904 415 julius
@menu
905
* Overview::
906
* Structure::
907
* Tools::
908
* Simulating::
909
* Synthesis and Backend::
910
* Programming File Generation::
911
* Customising::
912
* Running And Debugging Software::
913
@end menu
914 408 julius
 
915 415 julius
@node ML501 Overview
916
@subsection Overview
917 408 julius
 
918 415 julius
The Xilinx ML501 board contains a Virtex LX50 part, varied memories and peripherals. See Xilinx's site for specific details:
919
 
920
http://www.xilinx.com/products/devkits/HW-V5-ML501-UNI-G.htm
921
 
922
Not all peripherals are supported, and adding support for each is a goal.
923
 
924
At present the build contains a memory controller for the DDR2 SDRAM (based around a Xilinx MIG derived controller) and SSRAM. None of the other peripherals (VGA/AC97/PS2/USB/LCD) have controllers in the design yet.
925
 
926
The OpenCores 10/100 Ethernet MAC can be used for Ethernet, but still has some bugs to do with memory access, although it appears to be using the RGMII interface to the 10/10/1000 PHY on the ML501 OK.
927
 
928
The project is configured to generate either a @code{.bit} file for direct programming via JTAG, or a @code{.mcs} file with inbuilt bootloader software for the processor, meaning the board can be powered up and an application like ORPmon loaded without having to reprogram it from iMPACT between power cycles.
929
 
930
This guide is far from complete, but provides the basics on running simulations, and building the design.
931
 
932
@node ML501 Structure
933
@subsection Structure
934
 
935
Note that in this chapter the term @emph{board path} refers to the path in the project for this board port; @code{boards/xilinx/ml501}.
936
 
937
The board port's structure is similar to that of a standalone project which accords with the OpenCores coding guidelines. However, all software and RTL that is available in the reference design is also available to the board port, with any local (ie. in the board's @code{rtl} or @code{sw} paths) versions taking precedence over the versions available in the reference design.
938
 
939
The Verilog RTL specific to this board is under @code{rtl/verilog} in the board path. The @code{include} path in there is the place where all required definitions files, configuring the RTL, are found.
940
 
941
Backend files, mainly binary NGC files for mapping, are found in the board's @code{backend/bin} path.
942
 
943
Be sure to set the environment variable @code{XILINX_PATH} to the path of the ISE path on the host machine. This can be done with something like @kbd{export XILINX_PATH=/software/xilinx_11.1/ISE} and additionally a symbolic link to the Verilog simulation library sources will be required - see the simulation section on this. Note that it helps to add the @code{XILINX_PATH} variable to the user's @code{.bashrc} script or similar to save setting it each time a new shell is opened.
944
 
945
If the @code{XILINX_PATH} variable is not set correctly, the makefiles will not run.
946
 
947
@node ML501 Tools
948
@subsection Tools
949
 
950
@menu
951
* Host Tools::
952
* Target System Tools::
953
* EDA Tools::
954
* Debug Tools::
955
@end menu
956
 
957
@node ML501 Host Tools
958
@subsubsection Host Tools
959
@cindex host tools required ML501
960
 
961
Standard development suite of tools: gcc, make, etc.
962
 
963
@node ML501 Target System Tools
964
@subsubsection Target System Tools
965
@cindex target system tools required ML501
966
 
967
OpenRISC GNU toolchain. For installation, see OpenRISC GNU toolchain page on OpenCores.org.
968
 
969
@node ML501 EDA Tools
970
@subsubsection EDA Tools
971
@cindex EDA tools required ML501
972
 
973
RTL, gatelevel simulation: Mentor Graphics' Modelsim
974
Synthesis: XST (from Xilinx ISE)
975
Backend: ngdbuild/map/par/bitgen/promgen, etc. (from Xilinx ISE)
976
Programming: iMPACT (from Xilinx ISE)
977
 
978
This has been developed with Xilinx ISE 11.1 under Linux.
979
 
980
 
981
@node ML501 Debug Tools
982
@subsubsection Debug Tools
983
@cindex Debug tools required ML501
984
 
985
or_debug_proxy, ORPmon
986
 
987
@node ML501 Simulating
988
@subsection Simulating
989
@cindex simulating ML501
990
 
991
@node ML501 Xilinx Source Directory
992
@subsubsection Setup Link To Xilinx Simulation Library Directory
993
 
994
The Xilinx simulation library is too big to include in this project, and is installed with ISE, which is required to run this project. The simplest way to get access to it is to create a @emph{symbolic link} to it.
995
 
996
A link must be made in the board's @code{backend/rtl} path to ISE's @code{verilog} path.
997
 
998
If the @code{XILINX_PATH} environment variable is set, this is very easy to do in the board's @code{backend/rtl} path:
999
 
1000
@example
1001
@kbd{ln -s $XILINX_PATH/verilog verilog}
1002
@end example
1003
 
1004
Note that if this path is not set, simulations will be unable to compile.
1005
 
1006
@subsubheading Run RTL Regression Test
1007
 
1008
To run the default set of regression tests for the build, run the following command in the board's @code{sw/run} path.
1009
 
1010
@example
1011
@kbd{make rtl-tests}
1012
@end example
1013
 
1014
The same set of options for RTL tests available in the reference design should available in this build. @xref{Running A Set Of Specific Reference Design RTL Tests}.
1015
 
1016
Options specific to the ML501 build.
1017
 
1018
@table @code
1019
 
1020
@item PRELOAD_RAM
1021
Set to '1' to enable loading of the software image into RAM at the beginning of simulation.
1022
 
1023
If the chosen bootROM program (set via a define in software header file in the board's @code{sw/board/include} path) will jump straight to RAM to begin execution, then the software image will need to be in RAM for the simulation to work. This define @emph{must} be used in that case for the simulation to do anything.
1024
 
1025
 
1026
@end table
1027
 
1028
 
1029
 
1030
@node ML501 Synthesis
1031
@subsection Synthesis
1032
 
1033
Synthesis of the board port for the Actel technology with the Synplify tool can be run in the board's @code{syn/xst/run} path with the following command.
1034
 
1035
@example
1036
@kbd{make all}
1037
@end example
1038
 
1039
This will create an NGC file in @code{syn/xst/run} named @code{orpsoc.ngc}.
1040
 
1041
Hopefully it's all automated enough so that, as long as the design is simulating as desired, the correct set of RTL will be picked up and synthesized without any need for customising scripts for the tool.
1042
 
1043
@node ML501 Synthesis Options
1044
@subsubsection Options
1045
 
1046
Use the following command int the @code{syn/xst/run} path to get a list of the variables used during synthesis. Any can be set on the command line when running @code{make all}.
1047
 
1048
@example
1049
@kbd{make print-config}
1050
@end example
1051
 
1052
 
1053
@node ML501 Synthesis Warnings
1054
@subsubsection Checks
1055
 
1056
The following is a list of some considerations before synthesis.
1057
 
1058
@itemize @bullet
1059
@item bootrom.v
1060
 
1061
If the bootROM module is being used to provide the processor with a program at startup (reset address in processor's define file is set to @code{0xf0000100} or similar), check that board software include file, in the board's @code{sw/board/include} path, is selecting the correct bootROM program.
1062
 
1063
Do a @kbd{make clean-all} from the synthesis run directory to be sure that the previous bootROM file is cleared away and regenerated when synthesis is run.
1064
 
1065
 
1066
@item Clean away old leftovers
1067
 
1068
If the unwanted files from an old synthesis run are still there before the next run, it's best to clean them away with @kbd{make clean} from the synthesis run directory.
1069
 
1070
 
1071
 
1072
@end itemize
1073
 
1074
@node ML501 Synthesised Netlist
1075
@subsubsection Netlist generation
1076
 
1077
To create a Verilog HDL netlist of the post-synthesis design, run the following in the board's @code{syn/xst/run} path.
1078
 
1079
@example
1080
@kbd{make orpsoc.v}
1081
@end example
1082
 
1083
@node ML501 Place and Route
1084
@subsection Place and Route
1085
 
1086
Place and route of the design can be run from the board's @code{backend/par/run} path with the following command.
1087
 
1088
@example
1089
@kbd{make orpsoc.ncd}
1090
@end example
1091
 
1092
@node ML501 Timing Report
1093
@subsection Post-PAR STA Report
1094
 
1095
The @code{trce} tool can be used to generate a timing report of the post-place and route design.
1096
 
1097
@example
1098
@kbd{make timingreport}
1099
@end example
1100
 
1101
@node ML501 Back-annotated Netlist
1102
@subsection Back-annotated Netlist
1103
 
1104
A post-PAR back-annotated netlist can be generated with the following command.
1105
 
1106
@example
1107
@kbd{make netlist}
1108
@end example
1109
 
1110
This will make a new directory under the board's @code{backend/par/run} path named @code{netlist} and will contain a Verilog netlist and SDF file with timing information.
1111
 
1112
 
1113
@node ML501 Place and route options
1114
@subsubsection Options
1115
 
1116
To get a list of options that can be set when running the backend flow, run the following in the board's @code{backend/par/run} path.
1117
 
1118
@example
1119
@kbd{make print-config}
1120
@end example
1121
 
1122
@node ML501 Constraints
1123
@subsubsection Constraints
1124
 
1125
A Xilinx User Constraints File (UCF) file is in the board's @code{backend/par/bin} path. It is named @code{ml501.ucf}. It should be edited if any extra I/O or constraints are required.
1126
 
1127
Eventually it would be good to dynamically generated this, based on what is included in the design, but for now this must be hand modified if modules are added ore removed from the design.
1128
 
1129
@node ML501 Programming File Generation
1130
@subsection Programming File Generation
1131
 
1132
Programming file generation is run from the board's @code{backend/par/run} path with the following command.
1133
 
1134
@example
1135
@kbd{make orpsoc.bit}
1136
@end example
1137
 
1138
This file can then be loaded into the Xilinx iMPACT program and programmed onto the Virtex 5 part on the ML501.
1139
 
1140
@node ML501 SPI programming file
1141
@subsubsection SPI programming file generation
1142
 
1143
To generate a file, which can be programmed into the SPI flash on the board (and thus allowing the FPGA to be configured without using iMPACT each time) run the following command in the board's @code{backend/par/run} path.
1144
 
1145
@example
1146
@kbd{make orpsoc.mcs}
1147
@end example
1148
 
1149
@node ML501 SPI programming file with software
1150
@subsubsection SPI programming file generation with software
1151
 
1152
To generate a file, which can be programmed into the SPI flash on the board (and thus allowing the FPGA to be configured without using iMPACT each time) and also has a bootloader the processor can run (such as ORPmon) run the following command in the board's @code{backend/par/run} path.
1153
 
1154
@example
1155
@kbd{make orpsoc.mcs BOOTLOADER_BIN=/path/to/bootloader-binary-file.bin}
1156
@end example
1157
 
1158
The image is allowed to be up to 256KBytes in size.
1159
 
1160
As the SPI flash on the ML501 is only 2MBytes in size, and the FPGA configuration image takes up almost 1.5MBytes, the final 256KBytes are reserved for a software image to be loaded at reset by the processor.
1161
 
1162
This mark (the last 256KBytes of memory) is at hex address @code{0x1c0000}. This value is passed to the @code{promgen} tool when creating the @code{.mcs} file, and is set in the board's @code{board.h} file so the embedded bootloader in the design knows which address to load from.
1163
 
1164
If changing the address of the bootloader, to accommodate a larger image for example, be sure to update the address in the @code{board.h} file and set the environment variable @code{SPI_BOOTLOADER_SW_OFFSET_HEX} to the hex address to embed the binary image at (hexadecimal value without the leading ``@code{0x}''.) Note that changing the address to load from in @code{board.h} will require the entire design is re synthesized.
1165
 
1166
The file pointed to by @code{BOOTLOADER_BIN} should be a binary image with the  size of the image embedded in the first word.
1167
 
1168
The tool @code{bin2binsizeword} in ORPSoC's @code{sw/utils} path can add the sizeword to a binary image. A binary image is something created with the processor toolchains @code{objcopy -O binary} option. A tool like ORPmon is a good candidate for being embedded in the SPI flash as bootloader software - a binary image is automatically created when it's compiled, usually named @code{orpmon.or32.bin}. To embed that, it would simply need to be passed to the @code{bin2binsizeword} like the following:
1169
 
1170
@example
1171
@kbd{bin2binsizeword /path/to/orpmon/orpmon.or32.bin orpmon-sizeword.bin}
1172
@end example
1173
 
1174
This @code{orpmon-sizeword.bin} file should then be passed via the BOOTLOADER_BIN option when creating the @code{.mcs} file to embed it.
1175
 
1176
If once the FPGA configuration image, and a bootloader image is embedded in the SPI flash, the FPGA can be configured with ORPSoC and then the processor can load the bootloader (like ORPmon) with a single press of the board's @code{PROG} button. This makes developing on the board very easy.
1177
 
1178
@node ML501 SPI flash programming
1179
@subsubsection SPI flash programming
1180
 
1181
For a guide on how to actually set up the ML501 board to program the SPI flash, see the section under ``@emph{My Own SPI Flash Image Demonstration}'' on page 26 of the Xilinx UG228 document, http://www.xilinx.com/support/documentation/boards_and_kits/ug228.pdf . Follow steps 1 to 4, and then 9 to 16, and supply the @code{.mcs} file generated here.
1182
 
1183
Be sure to set the @emph{CONFIG} switches to @code{00010101} (left-to-right when Xilinx logo in North-West of board) before attempting to program the SPI flash. The be sure to switch them back to @code{00000101} before attempting to boot the image.
1184
 
1185
Note that this will require fly-leads from the Xilinx programming cable to the the board. See page 6 of XAPP1053 for a picture of this for a @emph{different} board, but to get the idea: http://www.xilinx.com/support/documentation/application_notes/xapp1053.pdf .
1186
 
1187
Note that the other cable from the progammer (going to the JP1 header) @emph{must} be unplugged from the board before attempting to program the SPI flash.
1188
 
1189
Booting from the SPI flash to ORPmon prompt is about 3 to 4 seconds.
1190
 
1191
 
1192
@node ML501 Customising
1193
@subsection Customising
1194
 
1195
The large amount of peripherals on the ML501 means that things will want to be added or removed to suit the design.
1196
 
1197
The following sections have information on how to configure the design.
1198
 
1199
@node ML501 Customising Enabling Existing Modules
1200
@subsubsection Enabling Existing RTL Modules
1201
 
1202
The design relies on the Verilog HDL @emph{define} function to indicate which modules are included. See the board's @code{rtl/verilog/include/orpsoc-defines.v} file to determine which options are enabled by uncommented @code{`define} values.
1203
 
1204
These @code{`defines} will correspond to defines in the board's top level RTL file @code{boardpath/rtl/verilog/orpsoc_top/orpsoc_top.v}.
1205
 
1206
There are only a few modules included by default.
1207
 
1208
@itemize @bullet
1209
@item Processor - @emph{or1200}
1210
@item Clock and reset generation - @emph{clkgen}
1211
@item Bus arbiters - @emph{arbiter_ibus}, @emph{arbiter_dbus}, @emph{arbiter_bytebus}
1212
@end itemize
1213
 
1214
The rest are optional, depending on what is defined in the board's @code{rtl/verilog/include/orpsoc-defines.v} file.
1215
 
1216
@node ML501 Customising Adding Modules
1217
@subsubsection Adding RTL Modules
1218
 
1219
There are a number of steps to take when adding a new module to the design.
1220
 
1221
@itemize @bullet
1222
@item RTL Files
1223
 
1224
Create a directory under the board's @code{rtl/verilog} directory, and name it the same as the top level of the module.
1225
 
1226
Ensure the module's top level file and actual name of the module when it will be instantiated are @emph{all the same}.
1227
 
1228
Place any include files into the board's @code{rtl/verilog/include} path.
1229
 
1230
@item Instantiate in ORPSoC Top Level File
1231
 
1232
Instantiate the module in the ORPSoC top level file, @code{rtl/verilog/orpsoc_top/orpsoc_top.v}, and be sure to take care of the following.
1233
@itemize @bullet
1234
@item Create appropriate @emph{`define} in @code{orpsoc-defines.v} and surround module instantiation with it.
1235
@item Add required I/Os (surrounded by appropriate @emph{`ifdef })
1236
@item Attach to appropriate bus arbiter, declaring any signals required. Be sure to tie them off if modules is not included.
1237
@item Update appropriate bus arbiter (in board's @code{rtl/verilog/arbiters} path) adding (uncommenting) additional ports as needed.
1238
@item Update board's @code{rtl/verilog/include/orpsoc-params.v} file with appropriate set of parameters for new module, as well as arbiter memory mapping assignment.
1239
@item Attach appropriate clocks and resets, modify the board's @code{rtl/verilog/clkgen/clkgen.v} file generating appropriate clocks if required.
1240
@item Attach any interrupts to the processor's PIC vector in, assigned as the last thing in the file.
1241
@end itemize
1242
 
1243
@item Update ORPSoC Testbench
1244
 
1245
Update the board's @code{bench/verilog/orpsoc_testbench.v} file with appropriate ports (surrounded by appropriate @emph{`ifdef}.)
1246
 
1247
Add any desired models to help test the module to the board's @code{bench/verilog} path and instantiate it correctly in the testbench.
1248
 
1249
@item Add Software Drivers and Tests
1250
 
1251
In a similar fashion to what is already in the board's @code{sw/drivers} and @code{sw/tests} path, create desired driver and test software to be used during simulation (and potentially on target.)
1252
 
1253
@item Update Backend Scripts
1254
 
1255
If any I/O is added, or special timing specified, the board's UCF file will need updating - see @code{boardpath/backend/par/bin/ml501.ucf}.
1256
 
1257
@end itemize
1258
 
1259
@node ML501 Running And Debugging Software
1260
@subsection Running And Debugging Software
1261
 
1262
@node ML501 Debug Interface
1263
@subsubsection Debug Interface
1264
 
1265
The debug interface uses a separate JTAG tap and some fly-leads must be connected from an @emph{ORSoC USB debugger} (http://opencores.com/shop,item,3) to the ML501.
1266
 
1267
From the USB debugger, a fly lead must take the following signals to the following pins on header J4 on the ML501.
1268
 
1269
@itemize @bullet
1270
@item
1271
tdo - HDR2_6
1272
@item
1273
tdi - HDR2_8
1274
@item
1275
tms - HDR2_10
1276
@item
1277
tck - HDR2_12
1278
@end itemize
1279
 
1280
This corresponds to right-most column of pins on the J4 header, starting on the third row going down.
1281
 
1282
Supply and ground pins must also be hooked up for the USB debugger.
1283
 
1284
The left column of pins on J4 are all tied to ground. All pins on J7 (expansion header located adjacent to J4) are all tied to VCC2V5, 2.5V DC, and this is OK for supplying the buffers on the USB debug cable, and can be used. So essentially put the supply leads anywhere on J7 and ground leads anywhere on the left column of J4.
1285
 
1286
Once the debug interface is connected, the @code{or_debug_proxy} application can be used to provide a stub for GDB to connect to. See http://opencores.org/openrisc,debugging_physical for more information.
1287
 
1288
@node ML501 UART
1289
@subsubsection UART
1290
 
1291
There are 2 ways of connecting to the UART in the design.
1292
 
1293
One is via the usual serial port connector, P3, on the ML501. This will obviously require a PC with a serial input and appropriate terminal application.
1294
 
1295
There is also a connection available via the USB debugger mentioned in the previous subsection.
1296
 
1297
The following pins are used for RX/TX to/from the design on header J4.
1298
 
1299
@itemize @bullet
1300
@item
1301
UART RX - HDR2_2
1302
@item
1303
UART TX - HDR2_4
1304
@end itemize
1305
 
1306
Again, supply and ground leads for the UART drivers on the USB debugger can be sourced from J7/left-column J4 as per the debug interface subsection.
1307
 
1308
If both UART and debug interface are connected via the ORSoC USB debugger, this ultimately ends up witht he first 2 pins on the right column of J4 as RX/TX for the UART then the JTAG TDO, TDI, TMS and TCK in succession down the right column of J4.
1309
 
1310
See the ML501 schematic (http://www.xilinx.com/support/documentation/boards_and_kits/ml501_20061010_bw.pdf) for more details on these headers, and refer to the pinouts in the ML501 UCF, in the board's @code{backend/par/bin/ml501.ucf} file.
1311
 
1312
 
1313 397 julius
@c ****************************************************************************
1314
@c End bits
1315
@c ****************************************************************************
1316
 
1317
@node  GNU Free Documentation License
1318
@chapter GNU Free Documentation License
1319
@cindex license for @value{ORPSOC}
1320
 
1321
@include fdl-1.2.texi
1322
 
1323
@node Index
1324
 
1325
@unnumbered Index
1326
 
1327
@printindex cp
1328
 
1329
@bye
1330
 

powered by: WebSVN 2.1.0

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