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

Subversion Repositories openrisc

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

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 468 julius
Copyright @copyright{} 2010,2011 OpenCores
12 397 julius
 
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 485 julius
* Generic Designs::
66 468 julius
* Software::
67 397 julius
* GNU Free Documentation License::  The license for this documentation
68
* Index::
69
@end menu
70
 
71 408 julius
@node Document Introduction
72 397 julius
@chapter Introduction
73
 
74
@cindex introduction to this @value{ORPSOC}
75
 
76 560 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. It also provides systems intended to be synthesized and programmed on physical hardware.
77 397 julius
 
78 560 julius
The reference system is the least complex implementation and consists of just enough to test the processor's functionality. The board-targeted builds typically include many additional peripherals.
79 397 julius
 
80 425 julius
The next section in this document outlines the organisation and structure of the project. The section ``@emph{Getting Started}'' goes through getting the project source and setting up any necessary tools. Each following section outlines a particular implementation of an OpenRISC-based system, beginning with the reference system. Each implementation section has an overview of the structure of the project (which probably won't vary much between the implementations), a section on setting up the required tools, running simulation, and if applicable, backend and debugging steps. There may be additional sections on modifying or customising each implementation system.
81 397 julius
 
82
@c ****************************************************************************
83
@c Project Organisation
84
@c ****************************************************************************
85
 
86
@node Project Organisation
87
@chapter Project Organisation
88
@cindex organisation of @value{ORPSOC} project
89
 
90
@menu
91
* Overview::
92
* Software::
93
* RTL::
94
* Testbenches::
95
* Reference And Board Designs::
96
@end menu
97
 
98 408 julius
@node Organisation Overview
99
@section Organisation Overview
100 397 julius
 
101 425 julius
The @value{ORPSOC} project is intended to serve dual purposes. One is to act as a development platform for OpenRISC processors, and as a development platform of OpenRISC-based SoCs targeted at specific hardware.
102 397 julius
 
103 530 julius
Organising a single project to satisfy these requirements can lead to some overlap and redundancy. This section is intended to make the organisation of the project clear.
104 397 julius
 
105 530 julius
The reference implementation based in the root (base directory) of the project contains enough components to create a simple OpenRISC-based SoC. Each board build is intended to implement as fully-featured a system as possible, depending on the targeted hardware.
106 425 julius
 
107
The project is organised in such a way that each board build can use both the reference implementation's RTL modules and software, as well as its own set of RTL and software. The reference implementation is limited to what is available in the RTL and software directories in the root of the project, and is not technology dependent.
108
 
109 397 julius
The following sections outline the organisation of the software, RTL, and board designs.
110
 
111 408 julius
@node Software Organisation
112 397 julius
@section Software
113
 
114 530 julius
The @code{sw} path contains primarily target software (code intended for cross-compilation and execution on an OpenRISC processor.) There is also a path, @code{sw/utils} containing custom tools, intended to be run on the host, for manipulation of binary software images.
115 397 julius
 
116 530 julius
Driver software, implementing access functions for hardware modules, are found under @code{sw/drivers}.
117 397 julius
 
118 425 julius
There is 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}.
119
 
120
All CPU-related functions are made available through the file @code{cpu-utils.h} which is located in @code{sw/lib/include} and depending on the CPU being used, can be used to switch between different CPU driver functions. All CPU drivers are under the @code{sw/drivers} path.
121
 
122 530 julius
@emph{Note:} It is expected in the future that the OpenRISC toolchain based on newlib will provide all of the necessary support software provided in this CPU-specific driver path. When the first release of the newlib-based toolchain occurs it is expected the software in ORPSoC will be changed to use this toolchain instead.
123
 
124 397 julius
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.
125
 
126 530 julius
Under each test directory are two directories, @code{board} and @code{sim}, containing appropriate test software. Code for simulation will produce less printfs and aim to execute within realistic timeframes for RTL simulation. Board targeted test software is obviously written with the opposite considerations in mind and be more verbose and perhaps run orders of magnitudes more tests.
127 397 julius
 
128 425 julius
@node Software Test Naming
129 397 julius
 
130 425 julius
The rules for naming software tests are important to adhere to, 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}.
131
 
132 468 julius
@xref{Software} for further details.
133
 
134 408 julius
@node RTL Organisation
135 397 julius
@section RTL
136
 
137
The HDL code layout conforms to those outlined in the OpenCores.org coding guidelines. http://cdn.opencores.org/downloads/opencores_coding_guidelines.pdf
138
 
139 425 julius
There are, however, some naming restrictions for this project.
140 397 julius
 
141 530 julius
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 (...);}.
142 425 julius
 
143
This will avoid confusion and help the scripts locate modules.
144
 
145
@subsection Verilog HDL
146
 
147
All RTL included in the project at this point is Verilog HDL, although it would be fine to add VHDL to a board build.
148
 
149 408 julius
@node Testbench Organisation
150
@section Testbench
151 397 julius
 
152 425 julius
For each design in @value{ORPSOC} there will be a testbench instantiating the top level, and any required peripherals.
153 397 julius
 
154 425 julius
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.
155 397 julius
 
156 530 julius
It is expected that by running the command @code{make rtl-test} in each board's simulation run path, a basic simulation of the system initialising should be run.
157
 
158 408 julius
@node Organisation of Reference And Board Designs
159 397 julius
@section Reference And Board Designs
160
 
161
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.
162
 
163 425 julius
@subsection Module Selection
164 397 julius
 
165 425 julius
Typically, a board-targeted design will wish to reuse common components (processor, debug interface, Wishbone arbiters, UART etc.)
166 397 julius
 
167 564 olof
The project has been configured so a board build will use modules in the ``common'' RTL path (@code{rtl/verilog/}) @emph{unless} there is a copy in the board's ``local'' RTL path ( @code{boards/vendor/boardname/rtl/verilog}) or the board includes an external module in @code{boards/vendor/boardname/modules}.
168 397 julius
 
169 425 julius
For example, in the event that modification to a module in the common RTL set is required for it to function correctly in a board build, it's advisable to copy that module to the board's @emph{local} RTL path and modify it there. Simulation and backend scripts should then use this board-specific version instead of the one in the common RTL path.
170
 
171
 
172
 
173 397 julius
@c ****************************************************************************
174
@c Getting started
175
@c ****************************************************************************
176
 
177
@node Getting Started
178
@chapter Getting Started
179
@cindex source files for @value{ORPSOC}, downloading
180
 
181
@menu
182
* Supported Platforms::
183
* Obtaining Project Source::
184
* Required Tools::
185
@end menu
186
 
187 408 julius
@node Getting Started Supported Platforms
188 425 julius
@section Supported Host Platforms
189
@cindex host platforms supported by the @value{ORPSOC} project
190 397 julius
 
191
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.
192
 
193 425 julius
Unless indicated otherwise, support for the project under Cygwin on Microsoft Windows platforms cannot be assumed.
194 397 julius
 
195 408 julius
@node Getting Started Obtaining Project Source
196 397 julius
@section Obtaining Project Source
197
@cindex getting a copy of the @value{ORPSOC} project
198
 
199
The source for @value{ORPSOC} can be obtained from the OpenCores subversion (SVN) server.
200
 
201
@example
202
@kbd{svn export http://opencores.org/ocsvn/openrisc/openrisc/trunk/orpsocv2}
203
@end example
204
 
205 408 julius
@node Getting Started Required Tools
206 397 julius
@section Required Tools
207
@cindex tools and utilities required for @value{ORPSOC}
208
 
209
 
210
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.
211
 
212 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.
213 397 julius
 
214
The required tools can be divided into four groups.
215
 
216
@itemize @bullet
217
@item
218
Host system tools - things like gcc, make, texinfo.
219
 
220
@item
221 530 julius
Target system toolchain and software - the OpenRISC GNU toolchain, with gcc cross-compiler, support libraries, the GNU debugger (gdb), OpenRISC port of various OSes and RTOS, etc.
222 397 julius
 
223
@item
224
Electronic design automation (EDA) tools - preprocessors, simulators, FPGA tool suites, etc.
225
 
226
@item
227
Debug tools - tools providing control over the system on target
228
@end itemize
229
 
230
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.
231
 
232
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.
233
 
234
Anyone implementing their own board port is encouraged to document, as best they can, any problematic tool installations and contribute them to this document.
235
 
236
 
237
 
238
@c ****************************************************************************
239
@c Reference Design chapter
240
@c ****************************************************************************
241
 
242
@node Reference Design
243
@chapter Reference Design
244
@cindex reference design
245
 
246
@menu
247
* Overview::
248
* Structure::
249
* Tools::
250
* Simulation::
251
* Synthesis::
252
@end menu
253
 
254 408 julius
@node Reference Design Overview
255 468 julius
@section Overview
256 397 julius
 
257 425 julius
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. Very little apart from the processor, memory, debug interface and interconnect modules are instantiated.
258 397 julius
 
259 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.
260 397 julius
 
261
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.
262
 
263
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.
264
 
265
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.
266
 
267 408 julius
@node Reference Design Structure
268 468 julius
@section Structure
269 397 julius
 
270
@menu
271
* Overview::
272
* RTL::
273
* Software::
274
* Simulation::
275
@end menu
276
 
277 408 julius
@node Reference Design Overview
278 468 julius
@subsection Overview
279 397 julius
 
280
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.
281
 
282
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}.
283
 
284 408 julius
@node Reference Design RTL
285 468 julius
@subsection RTL
286 397 julius
 
287
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.
288
 
289
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.
290
 
291 564 olof
External modules using the OpenCores structure can be put under each boards @code{modules} directory. The scripts will the look for verilog files under @code{modules/<module_name>/rtl/verilog}.
292
 
293 397 julius
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.
294
 
295 408 julius
@node Reference Design Software
296 468 julius
@subsection Software
297 397 julius
 
298
The software run on the reference design is found in the @value{ORPSOC} root directory, under the @code{sw} path.
299
 
300
The test software for the or1200 processor is found under @code{sw/tests/or1200/sim}.
301
 
302
A minimal set of drivers is built into @code{liborpsoc}, and they are found under @code{sw/tests/drivers}.
303
 
304
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.
305
 
306 408 julius
@node Reference Design Simulation
307 468 julius
@subsection Simulation
308 397 julius
 
309
The simulation of the reference design is run from the @code{sim/run} path.
310
 
311
The script controlling simulation is the file @code{sim/bin/Makefile}.
312
 
313
The generated output is kept in the @code{sim/out} path, and is cleared away when @kbd{make clean} is run.
314
 
315
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.
316
 
317 408 julius
@node Reference Design Tools
318 468 julius
@section Tools
319 397 julius
 
320
@menu
321
* Host Tools::
322
* Target System Tools::
323
* EDA Tools::
324
* Debug Tools::
325
@end menu
326
 
327 408 julius
@node Reference Design Host Tools
328 468 julius
@subsection Host Tools
329 397 julius
@cindex host tools required
330
 
331
Standard development suite of tools: gcc, make, etc.
332
 
333 408 julius
@node Reference Design Target System Tools
334 468 julius
@subsection Target System Tools
335 397 julius
@cindex target system tools required
336
 
337
OpenRISC GNU toolchain. For installation, see OpenRISC GNU toolchain page on OpenCores.org.
338
 
339 408 julius
@node Reference Design EDA Tools
340 468 julius
@subsection EDA Tools
341 397 julius
@cindex EDA tools required
342
 
343
RTL simulation: Icarus Verilog (also compatible with Mentor Graphics' Modelsim)
344
Cycle Accurate Simulation: Verilator, Verilog-Perl, System-Perl, SystemC
345
 
346 408 julius
@node Reference Design Debug Tools
347 468 julius
@subsection Debug Tools
348 397 julius
@cindex Debug tools required
349
 
350
None. The target is purely simulation, no extra utilities are required to debug.
351
 
352
 
353 408 julius
@node Reference Design Simulation
354 468 julius
@section Simulation
355 397 julius
 
356
@menu
357
* RTL::
358
* Cycle Accurate::
359
* Results::
360
@end menu
361
 
362 408 julius
@node Reference Design RTL
363 468 julius
@subsection RTL
364 397 julius
@cindex rtl simulation of reference design
365
 
366
All simulations of the reference design are run from the @code{sim/run} path.
367
 
368 468 julius
@subheading Running RTL Regression Test
369 397 julius
 
370
The simplest way of starting a run through the regression test, using the default RTL simulator, Icarus Verilog, can be done with:
371
 
372
@example
373
@kbd{make rtl-tests}
374
@end example
375
 
376 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.
377 397 julius
 
378 468 julius
@subheading Running An Individual Test
379 397 julius
 
380
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.
381
 
382
@example
383
@kbd{make rtl-test TEST=or1200-basic}
384
@end example
385
 
386 408 julius
@node Running A Set Of Specific Reference Design RTL Tests
387 468 julius
@subheading Running A Set Of Specific Tests
388 397 julius
 
389
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.
390
 
391
@example
392
@kbd{make rtl-tests TESTS="sdram-rows uart-simple or1200-mmu or1200-fp"}
393
@end example
394
 
395 468 julius
@node Providing A Precompiled ELF Executable
396
@subheading Providing A Precompiled ELF Executable
397
 
398
It's possible to specify the path to an OR32 ELF executable to be run in simulation instead of test software. Use the @code{USER_ELF} environment variable to specify the path to the ELF to run.
399
 
400
@example
401
@kbd{make rtl-test USER_ELF=/path/to/myapp.elf}
402
@end example
403
 
404
The ELF will be converted to binary format, and then converted to a VMEM to be
405
loaded into the model for execution at runtime.
406
 
407
@node Providing A Custom VMEM Image
408
@subheading Providing A Custom VMEM Image
409
 
410
It's possible to specify the path to a pre-existing VMEM image to be run in simulation instead of test software. Use the @code{USER_VMEM} environment variable to specify the path to the VMEM image to be run.
411
 
412
@example
413
@kbd{make rtl-test USER_VMEM=/path/to/myapp.vmem}
414
@end example
415
 
416
This VMEM file will be copied into the working directory, and renamed according to what the simulated memory expects.
417
 
418 408 julius
@node Options For Reference Design RTL Tests
419 468 julius
@subheading Options For RTL Tests
420 397 julius
 
421
There are some options, which can be specified through shell environment variables when running the test.
422
 
423
@table @code
424
 
425
@item VCD
426 408 julius
Set to '1' to enable @emph{value change dump} (VCD) creation in @code{sim/out/@emph{testname}.vcd}
427 397 julius
 
428
@item VCD_DELAY
429
Delay VCD creation start time by this number of timesteps (used as a Verilog @code{#delay} in the testbench.)
430
 
431
@item VCD_DELAY_INSNS
432
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.)
433
 
434
@item END_TIME
435
Force simulation end (@code{$finish}) at this time.
436
 
437
@item DISABLE_PROCESSOR_LOGS
438
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.
439
 
440
@item SIMULATOR
441
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.
442
 
443 485 julius
@item MGC_NO_VOPT
444
When using Modelsim (specifying @code{SIMULATOR=modelsim}), if the version does not include the individual @code{vopt} executable, specify @code{MGC_NO_VOPT=1} when compiling.
445
 
446 492 julius
@item VPI
447 530 julius
Pass @code{VPI=1} to have the an external JTAG debug module stall the processor just after bootup, and then provide a GDB stub (interacting with the Verilog sim via the VPI) to allow control of the system in a similar fashion to that of a physical target controlled over JTAG via a debug proxy application. The port for GDB is hard-coded to 50002. See the code in @code{bench/verilog/vpi/c} for more details.
448 492 julius
If running with Modelsim, ensure the path @code{MGC_PATH} is set and points to a directory containing a path named @code{modeltech}, which should be the Modelsim install.
449
 
450 397 julius
@end table
451
 
452
 
453
 
454 485 julius
 
455
 
456 408 julius
@node Reference Design Cycle Accurate
457 468 julius
@subsection Cycle Accurate
458 397 julius
@cindex cycle accurate simulation of reference design
459
 
460 468 julius
@subheading Running Cycle Accurate Regression Test
461 397 julius
 
462
The simplest way of starting a run through the regression test using the cycle accurate model can be done with:
463
 
464
@example
465
@kbd{make vlt-tests}
466
@end example
467
 
468
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.
469
 
470 468 julius
@subheading Running An Individual Test
471 397 julius
 
472
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.
473
 
474
@example
475
@kbd{make vlt-test TEST=or1200-basic}
476
@end example
477
 
478 468 julius
@subheading Generating Cycle Accurate Simulator Executable
479 397 julius
 
480
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.
481
 
482
@example
483
@kbd{make prepare-vlt}
484
@end example
485
 
486
The resulting executable will be @emph{Vorpsoc_top} in the @code{sim/vlt} path. Run it with the @emph{-h} option for usage instructions.
487
 
488 468 julius
@subheading Generating Automatically Profiled Cycle Accurate Simulator Executable
489 397 julius
 
490
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.
491
 
492
@example
493
@kbd{make prepare-vlt-profiled}
494
@end example
495
 
496 468 julius
@subheading Cycle Accurate Model Executable Usage
497 397 julius
 
498
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.
499
 
500
@example
501
@kbd{Vorpsoc_top --help}
502
@end example
503
 
504
A short list of options is given here.
505
 
506
@table @code
507
 
508
@item -f @var{file}
509
@itemx --program @var{file}
510
@cindex @code{-f}
511
@cindex @code{--program}
512
Load software from OR32 ELF image @var{file}
513
 
514
If unspecified, model attempts to load VMEM file @code{sram.vmem}
515
 
516
@item -v
517
@itemx --vcd
518
@cindex @code{-v}
519
@cindex @code{--vcd}
520
Dump VCD file
521
 
522
@item -e @var{value}
523
@itemx --endtime @var{value}
524
@cindex @code{-e}
525
@cindex @code{--endtime}
526
End simulation after @var{value} simulated ns
527
 
528
@item -l @var{file}
529
@itemx --log @var{file}
530
@cindex @code{-l}
531
@cindex @code{--log}
532
Log processor execution trace to @var{file}
533
 
534
@end table
535
 
536 408 julius
@node Reference Design Results
537 468 julius
@subsection Results
538 397 julius
@cindex output from simulation of reference design
539
 
540 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.
541 397 julius
 
542 468 julius
@subheading Processor Execution Trace
543 397 julius
 
544
A trace of the processor after each executed instruction is generated by both the event and cycle accurate models.
545
 
546
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}.
547
 
548 468 julius
@subheading Processor SPR Access Log
549 397 julius
 
550
A list of processor special purpose registers (SPR) accesses is created when processor logging is enabled.
551
 
552
These values are logged to a file in @code{sim/out} named @code{@emph{test-name}-sprs.log}.
553
 
554 468 julius
@subheading Processor Instruction Excecution Time Log
555 397 julius
 
556
A list of when each instruction was executed is generated when processor execution logging is enabled.
557
 
558
This is useful when debugging with VCD, and detecting at what time the problematic instructions were executed.
559
 
560
These values are logged to a file in @code{sim/out} named @code{@emph{test-name}-lookup.log}.
561
 
562 468 julius
@subheading Processor Report Mechanism Log
563 397 julius
 
564
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.
565
 
566
These values are logged to a file in @code{sim/out} named @code{@emph{test-name}-general.log}. This is not optional.
567
 
568 468 julius
@subheading Value Change Dump (VCD)
569 397 julius
 
570
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}.
571
 
572
 
573 408 julius
@node Reference Design Synthesis
574 468 julius
@section Synthesis
575 397 julius
 
576
The reference design is not intended to be synthesised, and thus no backend scripts are provided. See the sections on the board-specific builds.
577
 
578
 
579
@c ****************************************************************************
580 408 julius
@c ORDB1A3PE1500 board build chapter
581 397 julius
@c ****************************************************************************
582
 
583 408 julius
@node ORDB1A3PE1500
584
@chapter ORDB1A3PE1500
585
@cindex ORDB1A3PE1500 board build information
586 397 julius
 
587
@menu
588
* Overview::
589
* Structure::
590
* Tools::
591
* Simulating::
592 408 julius
* Synthesis and Backend::
593
* Programming File Generation::
594
* Customising::
595 397 julius
@end menu
596
 
597 408 julius
@node ORDB1A3PE1500 Overview
598 468 julius
@section Overview
599 397 julius
 
600 408 julius
The ORDB1 (ORSoC development board 1) with Actel A3PE1500 FPGA is supported by this build.
601 397 julius
 
602 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.
603
 
604
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.
605
 
606 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.
607 408 julius
 
608
This guide will overview how to simulation, synthesize and customise the system.
609
 
610
@node ORDB1A3PE1500 Structure
611 468 julius
@section Structure
612 397 julius
 
613 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}.
614 397 julius
 
615 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.
616
 
617
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.
618
 
619
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.
620
 
621
@node ORDB1A3PE1500 Tools
622 468 julius
@section Tools
623 397 julius
 
624
@menu
625
* Host Tools::
626
* Target System Tools::
627
* EDA Tools::
628
* Debug Tools::
629
@end menu
630
 
631 408 julius
@node ORDB1A3PE1500 Host Tools
632 468 julius
@subsection Host Tools
633 408 julius
@cindex host tools required ORDB1A3PE1500
634 397 julius
 
635
Standard development suite of tools: gcc, make, etc.
636
 
637 408 julius
@node ORDB1A3PE1500 Target System Tools
638 468 julius
@subsection Target System Tools
639 408 julius
@cindex target system tools required ORDB1A3PE1500
640 397 julius
 
641
OpenRISC GNU toolchain. For installation, see OpenRISC GNU toolchain page on OpenCores.org.
642
 
643 408 julius
@node ORDB1A3PE1500 EDA Tools
644 468 julius
@subsection EDA Tools
645 408 julius
@cindex EDA tools required ORDB1A3PE1500
646 397 julius
 
647
RTL, gatelevel simulation: Mentor Graphics' Modelsim
648
Synthesis: Synopsys Synplify (included in Actel Libero Suite)
649
Backend: Actel Designer (included in Actel Libero Suite)
650
Programming: Actel FlashPRO (included in Actel Libero Suite)
651
 
652 530 julius
This has been tested with with Libero versions 8.6, 9.0sp1 and 9.1 under Ubuntu Linux. It is recommended the very latest version available be used.
653 408 julius
 
654
@node ORDB1A3PE1500 Debug Tools
655 468 julius
@subsection Debug Tools
656 408 julius
@cindex Debug tools required ORDB1A3PE1500
657 397 julius
 
658
or_debug_proxy, ORPmon
659
 
660 408 julius
@node ORDB1A3PE1500 Simulating
661 468 julius
@section Simulating
662 408 julius
@cindex simulating ORDB1A3PE1500
663 397 julius
 
664 468 julius
@subheading Run RTL Regression Test
665 408 julius
 
666
To run the default set of regression tests for the build, run the following command in the board's @code{sw/run} path.
667
 
668
@example
669
@kbd{make rtl-tests}
670
@end example
671
 
672 425 julius
The same set of options for RTL tests available in the reference design should be available in this build. @xref{Running A Set Of Specific Reference Design RTL Tests}.
673 408 julius
 
674 409 julius
Options specific to the ORDB1A3PE1500 build.
675
 
676
@table @code
677
 
678
@item PRELOAD_RAM
679
Set to '1' to enable loading of the software image into RAM at the beginning of simulation.
680
 
681
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.
682
 
683
 
684
@end table
685
 
686
 
687
 
688 408 julius
@node ORDB1A3PE1500 Synthesis
689 468 julius
@section Synthesis
690 408 julius
 
691
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.
692
 
693
@example
694
@kbd{make all}
695
@end example
696
 
697
This will create a EDIF netlist in @code{syn/synplify/out}.
698
 
699
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.
700
 
701
@node ORDB1A3PE1500 Synthesis Options
702 468 julius
@subsection Options
703 408 julius
 
704
The following can be passed as environment variables when running @kbd{make all}.
705
 
706
@table @code
707
 
708
@item RTL_TOP
709
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.
710
 
711
@item FPGA_PART
712
Defaults to A3PE1500 but if targeting any other set it with this.
713
 
714
@item FPGA_FAMILY
715
Defaults to the A3PE1500's @emph{ProASIC3E} but if targeting any other set it with this.
716
 
717
@item FPGA_PACKAGE
718
Defaults to PQFP208 but if targeting any other set it with this.
719
 
720
@item FPGA_SPEED_GRADE
721
Defaults to Std but if targeting any other set it with this.
722
 
723
@item FREQ
724
Target frequency for synthesis.
725
 
726
@item MAXFAN
727
Maximum net fanout.
728
 
729
@item MAXFAN_HARD
730
Hard limit on maximum net fanout.
731
 
732
@item GLOBALTHRESH
733
Threshold of fanout before promoting signal to a global routing net.
734
 
735
@item RETIMING
736
Defaults to '1' (on) but set to '0' to disable.
737
 
738
@item RESOURCE_SHARING
739
Defaults to '1' (on) but set to '0' to disable.
740
 
741
@item DISABLE_IO_INSERTION
742
Defaults to '0' (off) but set to '1' to enable. Useful when synthesizing individual modules not intended as a top level.
743
 
744
@end table
745
 
746
@node ORDB1A3PE1500 Synthesis Warnings
747 468 julius
@subsection Checks
748 408 julius
 
749
The following is a list of some considerations before synthesis.
750
 
751
@itemize @bullet
752
@item bootrom.v
753
 
754 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.
755 408 julius
 
756 449 julius
Do a @kbd{make distclean} from the synthesis run directory to be sure that the previous bootROM file is cleared away and regenerated when synthesis is run.
757 408 julius
 
758
 
759
@item Clean away old leftovers
760
 
761
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.
762
 
763
 
764
@item Check Command Line Options
765
 
766
If using any command line settings, they can be checked by passing them to the following make target: @kbd{make print-config}
767
 
768
 
769
@end itemize
770
 
771
@node ORDB1A3PE1500 Place and Route
772 468 julius
@section Place and Route
773 408 julius
 
774
Place and route is run from the board's @code{backend/par/run} path with the following command.
775
 
776
@example
777
@kbd{make all}
778
@end example
779
 
780
This will create a @code{.adb} file in the same path.
781
 
782 439 julius
All steps, up to and including programming file generation are done here. FPGA device programming must be done using the programming FlashPro tool under Windows if using a free license.
783 408 julius
 
784
@node ORDB1A3PE1500 Place and route options
785 468 julius
@subsection Options
786 408 julius
 
787 439 julius
Most of the design's parameters are determined by processing the @code{orpsoc-defines.v} file and extracting, for example, the frequency of the clocks entering the design.
788 408 julius
 
789
The following can be passed as environment variables when running @kbd{make all}.
790
 
791
@table @code
792
 
793
@item FPGA_PART
794
Defaults to A3PE1500 but if targeting any other set it with this.
795
 
796
@item FPGA_FAMILY
797
Defaults to the A3PE1500's @emph{ProASIC3E} but if targeting any other set it with this.
798
 
799
@item FPGA_PACKAGE
800
Defaults to ``208 PQFP'' but if targeting any other set it with this.
801
 
802
 
803
@item FPGA_SPEED_GRADE
804
Defaults to Std but if targeting any other set it with this.
805
 
806
@item FPGA_VOLTAGE
807
Defaults to 1.5 but if targeting any other set it with this.
808
 
809
@item FPGA_TEMP_RANGE
810
Defaults to COM but if targeting any other set it with this.
811
 
812
@item FPGA_VOLT_RANGE
813
Defaults to COM but if targeting any other set it with this.
814
 
815
@item PLACE_INCREMENTAL
816
Defaults to off.
817
 
818
@item ROUTE_INCREMENTAL
819
Defaults to off.
820
 
821
@item PLACER_HIGH_EFFORT
822
Defaults to off.
823
 
824
@item BOARD_CONFIG
825
Defaults to @code{orsoccpuexpio.mkpinassigns}
826
 
827
@end table
828
 
829
@node ORDB1A3PE1500 Constraints
830 468 julius
@subsection Constraints
831 408 julius
 
832
 
833
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.
834
 
835
 
836
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}.
837
 
838
 
839
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.
840
 
841
@example
842
@kbd{make pdc-file sdc-file}
843
@end example
844
 
845
These can be generated and edited and then used when running place and route, they will not get replaced.
846
 
847
@node ORDB1A3PE1500 Programming File Generation
848 468 julius
@section Programming File Generation
849 408 julius
 
850
The @code{.adb} file resulting from place and route can be opened in the Actel @emph{Designer} tool and a programming file generated there.
851
 
852
Once this programming file is created, Actel's @emph{FlashPro} can used to program the ORDB1A3PE1500 board.
853
 
854
@node ORDB1A3PE1500 Customising
855 468 julius
@section Customising
856 408 julius
 
857
The versatile nature of the ORDB1A3PE1500 means the design that goes on it must be equally versatile, if not more so.
858
 
859
The following sections have information on how to configure the design.
860
 
861
@node ORDB1A3PE1500 Customising Enabling Existing Modules
862 468 julius
@subsection Enabling Existing RTL Modules
863 408 julius
 
864
The design relies on the Verilog HDL @emph{define} function to indicate which modules are included.
865
 
866 415 julius
There are only a few modules included by default.
867 408 julius
 
868
@itemize @bullet
869
@item Processor - @emph{or1200}
870
@item Clock and reset generation - @emph{clkgen}
871
@item Bus arbiters - @emph{arbiter_ibus}, @emph{arbiter_dbus}, @emph{arbiter_bytebus}
872
@end itemize
873
 
874
The rest are optional, depending on what is defined in the board's @code{rtl/verilog/include/orpsoc-defines.v} file.
875
 
876
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.
877
 
878 530 julius
These cores should be supported and ready to go by just defining them (uncomment in the @code{orpsoc-defines.v} file.)
879 408 julius
 
880
@node ORDB1A3PE1500 Customising Adding Modules
881 468 julius
@subsection Adding RTL Modules
882 408 julius
 
883
There are a number of steps to take when adding a new module to the design.
884
 
885
@itemize @bullet
886
@item RTL Files
887
 
888 564 olof
Create a directory under the board's @code{rtl/verilog} directory, and name it the same as the top level of the module.
889 408 julius
 
890 564 olof
 
891
 
892 408 julius
Ensure the module's top level file and actual name of the module when it will be instantiated are @emph{all the same}.
893
 
894
Place any include files into the board's @code{rtl/verilog/include} path.
895
 
896
@item Instantiate in ORPSoC Top Level File
897
 
898
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.
899
@itemize @bullet
900
@item Create appropriate @emph{`define} in @code{orpsoc-defines.v} and surround module instantiation with it.
901
@item Add required I/Os (surrounded by appropriate @emph{`ifdef })
902
@item Attach to appropriate bus arbiter, declaring any signals required. Be sure to tie them off if modules is not included.
903
@item Update appropriate bus arbiter (in board's @code{rtl/verilog/arbiters} path) adding (uncommenting) additional ports as needed.
904
@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.
905
@item Attach appropriate clocks and resets, modify the board's @code{rtl/verilog/clkgen/clkgen.v} file generating appropriate clocks if required.
906
@item Attach any interrupts to the processor's PIC vector in, assigned as the last thing in the file.
907
@end itemize
908
 
909
@item Update ORPSoC Testbench
910
 
911
Update the board's @code{bench/verilog/orpsoc_testbench.v} file with appropriate ports (surrounded by appropriate @emph{`ifdef}.)
912
 
913
Add any desired models to help test the module to the board's @code{bench/verilog} path and instantiate it correctly in the testbench.
914
 
915
@item Add Software Drivers and Tests
916
 
917
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.)
918
 
919
@item Update Backend Scripts
920
 
921 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.
922 408 julius
 
923
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.
924
 
925 530 julius
Continuing the format already there should be easy enough. Remember that the @code{orpsoc-defines.v} file is parsed and it's possible to tell if the module is included by testing if the variable is defined.
926 408 julius
 
927
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.
928
 
929
@example
930
@kbd{   $(Q)if [ ! -z $$FOO1 ]; then \
931
        echo "set_io foo1_srx_i " $(FOO_SRX_BUS_SETTINGS) " \
932 410 julius
        -pinname "$(FOO1_SRX_PIN) >> $@@; \
933 408 julius
        echo "set_io foo1_tx_o\\[0\\] " $(FOO_TX_BUS_SETTINGS) " \
934 410 julius
         -pinname "$(FOO1_TX0_PIN) >> $@@; \
935 408 julius
        echo "set_io foo1_tx_o\\[1\\] " $(FOO_TX_BUS_SETTINGS) "  \
936 410 julius
        -pinname "$(FOO1_TX1_PIN) >> $@@; \
937 408 julius
        echo "set_io foo1_tx_o\\[2\\] " $(FOO_TX_BUS_SETTINGS) "  \
938 410 julius
        -pinname "$(FOO1_TX2_PIN) >> $@@; \
939 408 julius
        echo "set_io foo1_tx_o\\[3\\] " $(FOO_TX_BUS_SETTINGS) "  \
940 410 julius
        -pinname "$(FOO1_TX3_PIN) >> $@@; \
941
fi
942 408 julius
       }
943
@end example
944
 
945
@emph{(ensure there is no whitespace after the trailing backslashes.)}
946
 
947
It's a little hard to follow, but it's essentially one @code{set_io} line for each I/O line.
948
 
949
First the line checks if the module's define was exported (which happens automatically if it's defined in @code{orpsoc-defines.v}.
950
 
951
Note that what is defined can be checked by running @kbd{make print-defines} in the board's @code{backend/par/run} path.
952
 
953
The values of the bus settings variables depend on the desired I/O standards and other examples in the Makefile can be referenced.
954
 
955 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.)
956 408 julius
 
957
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.
958
 
959
The physical constraints file can be generated manually with the @kbd{make pdc-file} command.
960
 
961
@end itemize
962
 
963 415 julius
@c ****************************************************************************
964
@c ML501 board build chapter
965
@c ****************************************************************************
966 408 julius
 
967 415 julius
@node ML501
968
@chapter ML501
969
@cindex ML501 board build information
970 408 julius
 
971 415 julius
@menu
972
* Overview::
973
* Structure::
974
* Tools::
975
* Simulating::
976
* Synthesis and Backend::
977
* Programming File Generation::
978
* Customising::
979
* Running And Debugging Software::
980
@end menu
981 408 julius
 
982 415 julius
@node ML501 Overview
983 468 julius
@section Overview
984 408 julius
 
985 415 julius
The Xilinx ML501 board contains a Virtex LX50 part, varied memories and peripherals. See Xilinx's site for specific details:
986
 
987
http://www.xilinx.com/products/devkits/HW-V5-ML501-UNI-G.htm
988
 
989 496 julius
The OR1200 core and Wishbone bus is set to run at 66MHz. The OR1200 core, as defined here, is almost fully featured, with every hardware arithmetic option enabled, and the largest possible cache configuration, of 1024 sets with 8 words per line which is 32 kilobytes of cache each for instruction and data buses.
990
 
991 415 julius
Not all peripherals are supported, and adding support for each is a goal.
992
 
993
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.
994
 
995 530 julius
The OpenCores 10/100 Ethernet MAC can be used for Ethernet, but only with the PHY in 10/100 mode using the MII interface to the Marvel Alaska Ethernet PHY IC. There still may be bugs in the FIFO buffer configuration in the ML501's @code{ethmac_defines.v} file should not be changed.
996 415 julius
 
997 560 julius
The ML501 build's scripts are capable of generating either a programming bitstream, @code{.bit}, file for direct programming of the FPGA via JTAG, or a flash image , @code{.mcs}, file which can be programmed into the on-board SPI flash which the FPGA can configure itself from on power-on. This flash image file may also contain a software image the processor can load at reset to, for example, present the user with the prompt for a boot monitor at power-on.
998 415 julius
 
999 560 julius
This guide is a work in progress, and provides the basics on simulating, building and modifying the design.
1000 415 julius
 
1001
@node ML501 Structure
1002 468 julius
@section Structure
1003 415 julius
 
1004
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}.
1005
 
1006
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.
1007
 
1008
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.
1009
 
1010
Backend files, mainly binary NGC files for mapping, are found in the board's @code{backend/bin} path.
1011
 
1012 425 julius
@node ML501 XILINX_PATH
1013 468 julius
@subsection ML501 XILINX_PATH
1014 425 julius
 
1015 560 julius
Be sure to set the environment variable @code{XILINX_PATH} to the path of the Xilinx tools' install path on the host machine. This path is usually the base install path for the Xilinx tool suite and contains subdirectories such as @code{ISE/}, @code{common/}, @code{PlanAhead/}, etc.
1016 415 julius
 
1017 560 julius
Most bash-like shells can use the following line to set this environment variable.
1018
 
1019
@example @kbd{export XILINX_PATH=/software/xilinx_12.3} @end example
1020
 
1021
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.
1022
 
1023 415 julius
If the @code{XILINX_PATH} variable is not set correctly, the makefiles will not run.
1024
 
1025 530 julius
This build has been tested with ISE versions 11.1 and 12.3.
1026
 
1027 415 julius
@node ML501 Tools
1028 468 julius
@section Tools
1029 415 julius
 
1030
@menu
1031
* Host Tools::
1032
* Target System Tools::
1033
* EDA Tools::
1034
* Debug Tools::
1035
@end menu
1036
 
1037
@node ML501 Host Tools
1038 468 julius
@subsection Host Tools
1039 415 julius
@cindex host tools required ML501
1040
 
1041
Standard development suite of tools: gcc, make, etc.
1042
 
1043
@node ML501 Target System Tools
1044 468 julius
@subsection Target System Tools
1045 415 julius
@cindex target system tools required ML501
1046
 
1047
OpenRISC GNU toolchain. For installation, see OpenRISC GNU toolchain page on OpenCores.org.
1048
 
1049
@node ML501 EDA Tools
1050 468 julius
@subsection EDA Tools
1051 415 julius
@cindex EDA tools required ML501
1052
 
1053
RTL, gatelevel simulation: Mentor Graphics' Modelsim
1054
Synthesis: XST (from Xilinx ISE)
1055
Backend: ngdbuild/map/par/bitgen/promgen, etc. (from Xilinx ISE)
1056
Programming: iMPACT (from Xilinx ISE)
1057
 
1058 439 julius
This has been tested with Xilinx ISE 11.1 under Ubuntu Linux.
1059 415 julius
 
1060
 
1061
@node ML501 Debug Tools
1062 468 julius
@subsection Debug Tools
1063 415 julius
@cindex Debug tools required ML501
1064
 
1065
or_debug_proxy, ORPmon
1066
 
1067
@node ML501 Simulating
1068 468 julius
@section Simulating
1069 415 julius
@cindex simulating ML501
1070
 
1071 530 julius
Ensure the @code{XILINX_PATH} environment variable is set correctly. @xref{ML501 XILINX_PATH} for information.
1072 415 julius
 
1073 425 julius
Note that if this path is not set, simulations will not compile.
1074 415 julius
 
1075 468 julius
@subheading Run RTL Regression Test
1076 415 julius
 
1077
To run the default set of regression tests for the build, run the following command in the board's @code{sw/run} path.
1078
 
1079
@example
1080
@kbd{make rtl-tests}
1081
@end example
1082
 
1083 425 julius
The same set of options for RTL tests available in the reference design should be available in this build. @xref{Running A Set Of Specific Reference Design RTL Tests}.
1084 415 julius
 
1085
Options specific to the ML501 build.
1086
 
1087
@table @code
1088
 
1089
@item PRELOAD_RAM
1090
Set to '1' to enable loading of the software image into RAM at the beginning of simulation.
1091
 
1092
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.
1093
 
1094
 
1095
@end table
1096
 
1097
 
1098
 
1099
@node ML501 Synthesis
1100 468 julius
@section Synthesis
1101 415 julius
 
1102
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.
1103
 
1104
@example
1105
@kbd{make all}
1106
@end example
1107
 
1108
This will create an NGC file in @code{syn/xst/run} named @code{orpsoc.ngc}.
1109
 
1110
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.
1111
 
1112
@node ML501 Synthesis Options
1113 468 julius
@subsection Options
1114 415 julius
 
1115
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}.
1116
 
1117
@example
1118
@kbd{make print-config}
1119
@end example
1120
 
1121
 
1122
@node ML501 Synthesis Warnings
1123 468 julius
@subsection Checks
1124 415 julius
 
1125
The following is a list of some considerations before synthesis.
1126
 
1127
@itemize @bullet
1128
@item bootrom.v
1129
 
1130
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.
1131
 
1132 449 julius
Do a @kbd{make distclean} from the synthesis run directory to be sure that the previous bootROM file is cleared away and regenerated when synthesis is run.
1133 415 julius
 
1134
 
1135
@item Clean away old leftovers
1136
 
1137
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.
1138
 
1139
 
1140
 
1141
@end itemize
1142
 
1143
@node ML501 Synthesised Netlist
1144 468 julius
@subsection Netlist generation
1145 415 julius
 
1146
To create a Verilog HDL netlist of the post-synthesis design, run the following in the board's @code{syn/xst/run} path.
1147
 
1148
@example
1149
@kbd{make orpsoc.v}
1150
@end example
1151
 
1152
@node ML501 Place and Route
1153 468 julius
@section Place and Route
1154 415 julius
 
1155
Place and route of the design can be run from the board's @code{backend/par/run} path with the following command.
1156
 
1157
@example
1158
@kbd{make orpsoc.ncd}
1159
@end example
1160
 
1161
@node ML501 Timing Report
1162 468 julius
@section Post-PAR STA Report
1163 415 julius
 
1164
The @code{trce} tool can be used to generate a timing report of the post-place and route design.
1165
 
1166
@example
1167
@kbd{make timingreport}
1168
@end example
1169
 
1170
@node ML501 Back-annotated Netlist
1171 468 julius
@section Back-annotated Netlist
1172 415 julius
 
1173
A post-PAR back-annotated netlist can be generated with the following command.
1174
 
1175
@example
1176
@kbd{make netlist}
1177
@end example
1178
 
1179
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.
1180
 
1181
 
1182
@node ML501 Place and route options
1183 468 julius
@subsection Options
1184 415 julius
 
1185
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.
1186
 
1187
@example
1188
@kbd{make print-config}
1189
@end example
1190
 
1191
@node ML501 Constraints
1192 468 julius
@subsection Constraints
1193 415 julius
 
1194
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.
1195
 
1196
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.
1197
 
1198
@node ML501 Programming File Generation
1199 468 julius
@section Programming File Generation
1200 415 julius
 
1201
Programming file generation is run from the board's @code{backend/par/run} path with the following command.
1202
 
1203
@example
1204
@kbd{make orpsoc.bit}
1205
@end example
1206
 
1207
This file can then be loaded into the Xilinx iMPACT program and programmed onto the Virtex 5 part on the ML501.
1208
 
1209
@node ML501 SPI programming file
1210 468 julius
@subsection SPI programming file generation
1211 415 julius
 
1212
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.
1213
 
1214
@example
1215
@kbd{make orpsoc.mcs}
1216
@end example
1217
 
1218
@node ML501 SPI programming file with software
1219 468 julius
@subsection SPI programming file generation with software
1220 415 julius
 
1221
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.
1222
 
1223
@example
1224
@kbd{make orpsoc.mcs BOOTLOADER_BIN=/path/to/bootloader-binary-file.bin}
1225
@end example
1226
 
1227
The image is allowed to be up to 256KBytes in size.
1228
 
1229
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.
1230
 
1231
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.
1232
 
1233
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.
1234
 
1235
The file pointed to by @code{BOOTLOADER_BIN} should be a binary image with the  size of the image embedded in the first word.
1236
 
1237
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:
1238
 
1239
@example
1240
@kbd{bin2binsizeword /path/to/orpmon/orpmon.or32.bin orpmon-sizeword.bin}
1241
@end example
1242
 
1243
This @code{orpmon-sizeword.bin} file should then be passed via the BOOTLOADER_BIN option when creating the @code{.mcs} file to embed it.
1244
 
1245
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.
1246
 
1247
@node ML501 SPI flash programming
1248 468 julius
@subsection SPI flash programming
1249 415 julius
 
1250 542 julius
There are two ways to program the M25P16 2MByte SPI flash from the Xilinx iMPACT tool - @emph{direct} and @emph{indirect}. Direct programming means the Xilinx programmer has a direct connection from its pins to the SPI bus. It then performs SPI accesses on the bus to erase and program the part. Indirect programming involves the FPGA and sets up connections to the SPI via it. Indirect programming may be slower, but it is the only supported method as of ISE 12 onwards.
1251
 
1252
There may be a way of programming directly using the open source @emph{xc3sprog} tool, http://sourceforge.net/projects/xc3sprog/ , but the author is yet to figure out how, and would greatly appreciate anyone who can provide a quick rundown on how this could be achieved.
1253
 
1254
Once programmed, booting from the SPI flash to ORPmon prompt is about 3 to 4 seconds.
1255
 
1256
@node ML501 Direct SPI flash programming
1257
@subsubsection Direct SPI flash programming
1258
 
1259
@emph{Note}: As of ISE 12, direct SPI flash programming is no longer supported. ISE 11 must be used if this method is to be used. Indirect SPI flash programming is the recommended method by Xilinx now. How annoying.
1260
 
1261 415 julius
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.
1262
 
1263 542 julius
A more general explanation of direct SPI flash programming can be found in XAPP951- http://www.xilinx.com/support/documentation/application\_notes/xapp951.pdf
1264
 
1265 415 julius
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.
1266
 
1267 542 julius
@emph{Note}: Direct SPI flash programming 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 .
1268 415 julius
 
1269 479 julius
@emph{Note}: If leaving the SPI programming fly leads in place and attempting to boot the image, be sure to remove the @code{Vref} (@code{VCC3V3} on JP2) connection before attempting to boot. Be sure the configuration DIP SW15 is set back to the @code{00000101} position!
1270 415 julius
 
1271 479 julius
@emph{Note:} The other cable from the programmer (going to the JP1 header) @emph{must} be unplugged from the board before attempting to program the SPI flash.
1272
 
1273 542 julius
@node ML501 Inirect SPI flash programming
1274
@subsubsection Indirect SPI flash programming
1275 479 julius
 
1276 542 julius
The indirect method of programming the SPI flash has the memory show up as an extrnal module off the FPGA when performing an automatic JTAG boundary scan.
1277 415 julius
 
1278 542 julius
The following page has more information about the steps required. http://www.xilinx.com/support/documentation/sw\_manuals/xilinx11/pim\_p\_configure\_spi\_bpi\_through\_fpga.htm The @code{.mcs} file required is the one generated in previous steps in this guide.
1279 415 julius
 
1280 542 julius
@emph{Note:} As we generate the @code{.mcs} file with bit/byte swapping disabled (with the use of the @code{-spi} option when running the promgen tool) we must disable iMPACT's automatic bit/byte swapping when programming the SPI flash. In ISE 12 this option is found by going to the @emph{Edit menu -> Preferences}, and  in the @emph{Configuration Preferences} category, set the @emph{SPI Byte Swap} option to @emph{Ignore Setting}.
1281
 
1282
@emph{Note:} iMPACT from ISE 12 introduced errors in the software image when being programmed. It is advisable that versions of iMPACT from ISEs other than 12 are used until this bug is fixed.
1283
 
1284
 
1285 415 julius
@node ML501 Customising
1286 468 julius
@section Customising
1287 415 julius
 
1288
The large amount of peripherals on the ML501 means that things will want to be added or removed to suit the design.
1289
 
1290
The following sections have information on how to configure the design.
1291
 
1292
@node ML501 Customising Enabling Existing Modules
1293 468 julius
@subsection Enabling Existing RTL Modules
1294 415 julius
 
1295
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.
1296
 
1297
These @code{`defines} will correspond to defines in the board's top level RTL file @code{boardpath/rtl/verilog/orpsoc_top/orpsoc_top.v}.
1298
 
1299
There are only a few modules included by default.
1300
 
1301
@itemize @bullet
1302
@item Processor - @emph{or1200}
1303
@item Clock and reset generation - @emph{clkgen}
1304
@item Bus arbiters - @emph{arbiter_ibus}, @emph{arbiter_dbus}, @emph{arbiter_bytebus}
1305
@end itemize
1306
 
1307
The rest are optional, depending on what is defined in the board's @code{rtl/verilog/include/orpsoc-defines.v} file.
1308
 
1309
@node ML501 Customising Adding Modules
1310 468 julius
@subsection Adding RTL Modules
1311 415 julius
 
1312
There are a number of steps to take when adding a new module to the design.
1313
 
1314
@itemize @bullet
1315
@item RTL Files
1316
 
1317 564 olof
@itemize @bullet
1318
@item Create a directory under the board's @code{rtl/verilog} directory, and name it the same as the top level of the module.
1319 415 julius
 
1320 564 olof
@emph{or}
1321 415 julius
 
1322 564 olof
Create a directory under the board's @code{modules} directory, containing a @code{rtl/verilog} directory, and name it the same as the top level of the module
1323 415 julius
 
1324 564 olof
@item Ensure the module's top level file and actual name of the module when it will be instantiated are @emph{all the same}.
1325
 
1326
@item Place any include files into the board's @code{rtl/verilog/include} path.
1327
@end itemize
1328 415 julius
@item Instantiate in ORPSoC Top Level File
1329
 
1330
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.
1331
@itemize @bullet
1332
@item Create appropriate @emph{`define} in @code{orpsoc-defines.v} and surround module instantiation with it.
1333
@item Add required I/Os (surrounded by appropriate @emph{`ifdef })
1334
@item Attach to appropriate bus arbiter, declaring any signals required. Be sure to tie them off if modules is not included.
1335
@item Update appropriate bus arbiter (in board's @code{rtl/verilog/arbiters} path) adding (uncommenting) additional ports as needed.
1336
@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.
1337
@item Attach appropriate clocks and resets, modify the board's @code{rtl/verilog/clkgen/clkgen.v} file generating appropriate clocks if required.
1338
@item Attach any interrupts to the processor's PIC vector in, assigned as the last thing in the file.
1339
@end itemize
1340
 
1341
@item Update ORPSoC Testbench
1342
 
1343
Update the board's @code{bench/verilog/orpsoc_testbench.v} file with appropriate ports (surrounded by appropriate @emph{`ifdef}.)
1344
 
1345
Add any desired models to help test the module to the board's @code{bench/verilog} path and instantiate it correctly in the testbench.
1346
 
1347
@item Add Software Drivers and Tests
1348
 
1349
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.)
1350
 
1351
@item Update Backend Scripts
1352
 
1353
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}.
1354
 
1355
@end itemize
1356
 
1357
@node ML501 Running And Debugging Software
1358 468 julius
@section Running And Debugging Software
1359 415 julius
 
1360
@node ML501 Debug Interface
1361 468 julius
@subsection Debug Interface
1362 415 julius
 
1363
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.
1364
 
1365
From the USB debugger, a fly lead must take the following signals to the following pins on header J4 on the ML501.
1366
 
1367
@itemize @bullet
1368
@item
1369
tdo - HDR2_6
1370
@item
1371
tdi - HDR2_8
1372
@item
1373
tms - HDR2_10
1374
@item
1375
tck - HDR2_12
1376
@end itemize
1377
 
1378
This corresponds to right-most column of pins on the J4 header, starting on the third row going down.
1379
 
1380
Supply and ground pins must also be hooked up for the USB debugger.
1381
 
1382
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.
1383
 
1384
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.
1385
 
1386
@node ML501 UART
1387 468 julius
@subsection UART
1388 415 julius
 
1389
There are 2 ways of connecting to the UART in the design.
1390
 
1391
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.
1392
 
1393
There is also a connection available via the USB debugger mentioned in the previous subsection.
1394
 
1395
The following pins are used for RX/TX to/from the design on header J4.
1396
 
1397
@itemize @bullet
1398
@item
1399
UART RX - HDR2_2
1400
@item
1401
UART TX - HDR2_4
1402
@end itemize
1403
 
1404
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.
1405
 
1406 530 julius
If both UART and debug interface are connected via the ORSoC USB debugger, this ultimately ends up with the 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.
1407 415 julius
 
1408
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.
1409
 
1410 485 julius
 
1411 468 julius
@c ****************************************************************************
1412 485 julius
@c Generic Design build chapter
1413
@c ****************************************************************************
1414
 
1415 492 julius
@node Generic Designs
1416
@chapter Generic Designs
1417 485 julius
@cindex Generic design information
1418
 
1419
@menu
1420
* Overview::
1421
@end menu
1422
 
1423
 
1424
@node Generic Build Overview
1425
@section Overview
1426
 
1427
The paths under @code{boards/generic} contain designs similar to the reference design, in that they are not technology specific, and used for development of certain features of the processor, or peripherals.
1428
 
1429 492 julius
These builds are a TODO, but should provide technology-independent builds, with any specialist modules required to debug, or assist in development or demonstration of a module.
1430 485 julius
 
1431
 
1432
@c ****************************************************************************
1433 468 julius
@c Software section
1434
@c ****************************************************************************
1435 415 julius
 
1436 468 julius
 
1437
@node Software
1438
@chapter Software
1439
 
1440
@cindex software use of @value{ORPSOC}
1441
 
1442
This section details the structure of the software library included in @value{ORPSOC}.
1443
 
1444
@node Software Overview
1445
@section Overview
1446
 
1447
The software provided with ORPSoC is intended to be of sufficient functionality to develop and test the designs, with some additional utility programs for board bring up.
1448
 
1449
The bulk of the software library consists of drivers and tests for the included RTL modules, focusing on the processor. A basic C library, implementing basic support functions such as printf, is included. This alleviates the prerequisite of a compiler with supporting C library installed.
1450
 
1451
Each board port may contain additional software drivers and tests in its own software directory, the structure of which mimics that of the main software directory.
1452
 
1453 530 julius
@node Software Components
1454 468 julius
@section Components
1455
 
1456
This section outlines the different components of the software library in the @code{sw/} path in the root of @value{ORPSOC}.
1457
 
1458
 
1459
@node Software Components Applications
1460
@subsection Applications
1461
 
1462
There are some included applications, which are neither drivers or tests.
1463
 
1464
Typically these will contain a @code{README} file in their directories which contain information on the software and its use.
1465
 
1466
In general, these are to be run on hardware, and thus will need to be compiled for a specific board. Be sure to pass the @code{BOARD} environment variable when compiling to pick up the appropriate board configuration. @xref{Software For Board Ports} for an example.
1467
 
1468
@node Software Components Drivers
1469
@subsection Drivers
1470
 
1471
Each RTL component may have a driver, which will be compiled into the liborpsoc library and be made available to applications and tests that use the library.
1472
 
1473
Each driver path should contain its source and an include path for driver headers.
1474
 
1475
@node Software Components CPU Drivers
1476
@subsection CPU Drivers
1477
 
1478
An attempt has been made to make the interface to basic CPU functions as generic as possible. This can allow different CPUs to be implemented in @value{ORPSOC}.
1479
 
1480
The header file @code{cpu-utils.h} should be included to gain access to the CPU driver functions, such as timers, special purpose registers, memory access macros, etc. This header will, in turn, include the appropriate CPU driver header.
1481
 
1482
@emph{Note:} What is included in the CPU driver, and how it should be interfaced is not documented yet, but in future every effort should be made to ensure a generic interface to CPU functions is used.
1483
 
1484
At present only the OR1200 has a driver, but it is intended that alternate OpenRISC processors can be implemented into ORPSoC and a driver for it to be easily used in the library.
1485
 
1486
The environment variable @code{CPU_DRIVER} is used to specify which driver is the CPU driver to be used at liborpsoc compile time.
1487
 
1488
@node Software Components Tests
1489
@subsection Tests
1490
 
1491
Each test subdirectory contains directories for each target. Usually there's just @code{sim} and @code{board}, the difference between the two being longer run-time and use of UART for board-targeted tests.
1492
 
1493
@emph{Note:} Test directory names should not contain hyphens or underscores. Test software files should be named with the single test directory name first, followed by a single word, eg. @code{or1200-simple.c}.
1494
 
1495
Test names are referenced using this @code{module}-@code{testname} pair. The automated testing mechanism implemented by the Makefile scripts will always search the @code{sim} paths for tests, rather than the @code{board} paths.
1496
 
1497 530 julius
@emph{Note:} There is no automated testing mechanism for the board-targeted software yet. It is anticipated that a testing harness for these will be developed, and we encourage users to help solve this problem.
1498 468 julius
 
1499
@node Software Components Library
1500
@subsection Library
1501
 
1502
The @code{lib} path in the root software directory is where the code for the minimal C library is located, and is the location of the @code{liborpsoc} archive file after its compilation.
1503
 
1504
@node Software Components Board
1505
@subsection Board
1506
 
1507
The @code{board} path in the software directory may, in future, contain other board-specific code, but at present its @code{include} path houses just an important header, @code{board.h} used for configuring the software when compiling programs targeted at a specific board port.
1508
 
1509
This file contains mainly defines of things such as the CPU frequency and timer rate, peripheral base addresses, IRQ numbers, and other board-specific defines. Each board port should contain its own, and is one of the reasons for passing the @code{BOARD} environment variable when compiling software targeted at a specific board port - so its board-specific defines will be used instead of the reference design's.
1510
 
1511
@node Software Components Utilities
1512
@subsection Utilities
1513
 
1514
The @code{utils} path contains tools used to help manipulate binary software images for a variety of purposes. All tools are designed to be run on the host machine, and not on ORPSoC.
1515
 
1516
 
1517
@node Software For Board Ports
1518
@section Software For Board Ports
1519
 
1520
Each board port will have its own software directory, if only to keep its @code{board.h} header file, specifying system parameters specific to the board.
1521
 
1522
It may also contain drivers and tests specific to peripherals for that board.
1523
 
1524
@emph{Note:} For any tests or drivers named the same found in both a board's software path and the root software path, the @emph{board's} software will be used instead.
1525
 
1526 530 julius
@emph{Note:} When compiling any software in the @emph{root} software path (such as in the applications folder) intended to run on a particular board, make use of the @code{BOARD} variable to indicate which board's configuration (@code{board.h} file, and any board-specific drivers) to use. For example:
1527 468 julius
 
1528
@example
1529
@kbd{orpsoc/sw/apps/app1$ make app1.elf BOARD=xilinx/ml501}
1530
@end example
1531
 
1532
It's also advisable to do a @code{make distclean} prior to clear out any preexisting libraries that may not contain software appropriate for the targeted board port (it may have been built with the reference design's @code{board.h}, for example.)
1533
 
1534
 
1535
 
1536 397 julius
@c ****************************************************************************
1537
@c End bits
1538
@c ****************************************************************************
1539
 
1540
@node  GNU Free Documentation License
1541
@chapter GNU Free Documentation License
1542
@cindex license for @value{ORPSOC}
1543
 
1544
@include fdl-1.2.texi
1545
 
1546
@node Index
1547
 
1548
@unnumbered Index
1549
 
1550
@printindex cp
1551
 
1552
@bye
1553
 

powered by: WebSVN 2.1.0

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