Line 62... |
Line 62... |
===============
|
===============
|
|
|
Unpack the software and create a _separate_ directory in which to build
|
Unpack the software and create a _separate_ directory in which to build
|
it:
|
it:
|
|
|
tar jxf or1ksim-0.5.0rc1.tar.bz2
|
tar jxf or1ksim-0.5.0rc2.tar.bz2
|
mkdir builddir_or1ksim
|
mkdir builddir_or1ksim
|
cd builddir_or1ksim
|
cd builddir_or1ksim
|
|
|
|
|
File: or1ksim.info, Node: Configuring the Build, Next: Build and Install, Prev: Preparation, Up: Installation
|
File: or1ksim.info, Node: Configuring the Build, Next: Build and Install, Prev: Preparation, Up: Installation
|
Line 79... |
Line 79... |
|
|
The most significant argument is `--target', which should specify the
|
The most significant argument is `--target', which should specify the
|
OpenRISC 1000 32-bit architecture. If this argument is omitted, it will
|
OpenRISC 1000 32-bit architecture. If this argument is omitted, it will
|
default to OpenRISC 1000 32-bit with a warning
|
default to OpenRISC 1000 32-bit with a warning
|
|
|
../or1ksim-0.5.0rc1/configure --target=or32-uclinux ...
|
../or1ksim-0.5.0rc2/configure --target=or32-uclinux ...
|
|
|
There are several other options available, many of which are standard
|
There are several other options available, many of which are standard
|
to GNU `configure' scripts. Use `configure --help' to see all the
|
to GNU `configure' scripts. Use `configure --help' to see all the
|
options. The most useful is `--prefix' to specify a directory for
|
options. The most useful is `--prefix' to specify a directory for
|
installation of the tools.
|
installation of the tools.
|
|
|
For testing (using `make check'), the `--target' parameter _must_ be
|
For testing (using `make check'), the `--target' parameter may be
|
specified, to allow the target tool chain to be selected. If the tools
|
specified, to allow the target tool chain to be selected. If not
|
have been installed using the standard OpenRISC script, then this
|
specified, it will default to `or32-elf', which is the same prefix used
|
should be set to `or32-elf'.
|
with the standard OpenRISC toolchain installation script.
|
|
|
A number of Or1ksim specific features in the simulator do require
|
A number of Or1ksim specific features in the simulator do require
|
enabling at configuration. These include
|
enabling at configuration. These include
|
|
|
`--enable-profiling'
|
`--enable-profiling'
|
Line 293... |
Line 293... |
2.1 Standalone Simulator
|
2.1 Standalone Simulator
|
========================
|
========================
|
|
|
The general form the standalone command is:
|
The general form the standalone command is:
|
|
|
or32-uclinux-sim [-vhiqV] [-f FILE] [--nosrv] [--srv=[N]]
|
or32-uclinux-sim [-vhiqVt] [-f FILE] [--nosrv] [--srv=[N]]
|
[-m ][-d STR]
|
[-m ][-d STR]
|
[--enable-profile] [--enable-mprofile] [FILE]
|
[--enable-profile] [--enable-mprofile] [FILE]
|
|
|
Many of the options have both a short and a long form. For example
|
Many of the options have both a short and a long form. For example
|
`-h' or `--help'.
|
`-h' or `--help'.
|
Line 322... |
Line 322... |
`--verbose'
|
`--verbose'
|
Generate extra output messages (equivalent of specifying the
|
Generate extra output messages (equivalent of specifying the
|
"verbose" option in the simulator configuration section (see *note
|
"verbose" option in the simulator configuration section (see *note
|
Simulator Behavior: Simulator Behavior.).
|
Simulator Behavior: Simulator Behavior.).
|
|
|
|
`-t'
|
|
`--trace'
|
|
Dump previous instruction, next instruction, GPRs and flag after
|
|
each instruction.
|
|
|
`-f FILE'
|
`-f FILE'
|
`--file FILE'
|
`--file=FILE'
|
Read configuration commands from the specified file, looking first
|
Read configuration commands from the specified file, looking first
|
in the current directory, and otherwise in the `$HOME/.or1k'
|
in the current directory, and otherwise in the `$HOME/.or1k'
|
directory. If this argument is not specified, the file `sim.cfg'
|
directory. If this argument is not specified, the file `sim.cfg'
|
in those two locations is used. Failure to find the file is a
|
in those two locations is used. Failure to find the file is a
|
fatal error. *Note Configuration: Configuration, for detailed
|
fatal error. *Note Configuration: Configuration, for detailed
|
Line 348... |
Line 353... |
server, otherwise a random value from the private port range
|
server, otherwise a random value from the private port range
|
(41920-65535) will be used. This option may not be specified with
|
(41920-65535) will be used. This option may not be specified with
|
`--nosrv'. If it is, a rude message is printed and the `--nosrv'
|
`--nosrv'. If it is, a rude message is printed and the `--nosrv'
|
option is ignored.
|
option is ignored.
|
|
|
`-m=SIZE'
|
`-m SIZE'
|
`--memory=SIZE'
|
`--memory=SIZE'
|
Configure a memory block of SIZE bytes, starting at address zero.
|
Configure a memory block of SIZE bytes, starting at address zero.
|
The size may be followed by `k', `K', `m', `M', `g', `G', to
|
The size may be followed by `k', `K', `m', `M', `g', `G', to
|
indicate kilobytes (2^10 bytes), megabytes (2^20 bytes) and
|
indicate kilobytes (2^10 bytes), megabytes (2^20 bytes) and
|
gigabytes (2^30 bytes).
|
gigabytes (2^30 bytes).
|
Line 364... |
Line 369... |
parameters taking their default value.
|
parameters taking their default value.
|
|
|
If a configuration file is also used, it should be sure not to
|
If a configuration file is also used, it should be sure not to
|
specify an overlapping memory block.
|
specify an overlapping memory block.
|
|
|
`-d=CONFIG_STRING'
|
`-d CONFIG_STRING'
|
`--debug-config=CONFIG_STRING'
|
`--debug-config=CONFIG_STRING'
|
Enable selected debug messages in Or1ksim. This parameter is for
|
Enable selected debug messages in Or1ksim. This parameter is for
|
use by developers only, and is not covered further here. See the
|
use by developers only, and is not covered further here. See the
|
source code for more details.
|
source code for more details.
|
|
|
Line 673... |
Line 678... |
|
|
Note: This function was added in Or1ksim 0.5.0.
|
Note: This function was added in Or1ksim 0.5.0.
|
|
|
|
|
-- `or1ksim.h': int or1ksim_write_mem (unsigned
|
-- `or1ksim.h': int or1ksim_write_mem (unsigned
|
long int ADDR, unsigned char *BUF, int LEN)
|
long int ADDR, const unsigned char *BUF, int LEN)
|
|
|
Write LEN bytes to ADDR, taking the data from BUF. Return LEN on
|
Write LEN bytes to ADDR, taking the data from BUF. Return LEN on
|
success and 0 on failure.
|
success and 0 on failure.
|
|
|
Note: This function was added in Or1ksim 0.5.0.
|
Note: This function was added in Or1ksim 0.5.0.
|
Line 1251... |
Line 1256... |
|
|
Memory configuration is described in `section memory'. This section
|
Memory configuration is described in `section memory'. This section
|
may appear multiple times, specifying multiple blocks of memory.
|
may appear multiple times, specifying multiple blocks of memory.
|
|
|
Caution: The user may choose whether or not to enable a memory
|
Caution: The user may choose whether or not to enable a memory
|
controller. If a memory controller is enabled, then the standard
|
controller. If a memory controller is enabled, then appropriate
|
OpenRISC C libraries will initialize it to expect 64MB memory
|
initalization code must be provided. The section describing
|
blocks, and any memory declarations _must_ reflect this. The
|
memory controller configuration describes the steps necessary for
|
section describing memory controller configuration describes the
|
using smaller or larger memory sections (*note Memory Controller
|
steps necessary for using smaller or larger memory sections (*note
|
Configuration: Memory Controller Configuration.).
|
Memory Controller Configuration: Memory Controller Configuration.).
|
|
|
The "uClibc" startup code initalizes a memory controller, assumed
|
If a memory controller is _not_ enabled, then the standard C
|
to be mapped at 0x93000000. If a memory controller is _not_
|
library code will generate memory access errors. The solution is
|
enabled, then the standard C library code will generate memory
|
to declare an additional writable memory block, mimicing the memory
|
access errors. The solution is to declare an additional writable
|
controller's register bank as follows.
|
memory block, mimicing the memory controller's register bank as
|
|
follows.
|
|
|
section memory
|
section memory
|
pattern = 0x00
|
pattern = 0x00
|
type = unknown
|
type = unknown
|
name = "MC shadow"
|
name = "MC shadow"
|
Line 1709... |
Line 1715... |
|
|
The memory controller configuration is described in `section mc'. This
|
The memory controller configuration is described in `section mc'. This
|
section may appear multiple times, specifying multiple memory
|
section may appear multiple times, specifying multiple memory
|
controllers.
|
controllers.
|
|
|
Caution: The standard OpenRISC C libraries will initialize the
|
Warning: There are known to be problems with the current memory
|
memory controller to expect 64MB memory blocks, and any memory
|
controller, which currently is not included in the regression test
|
declarations _must_ reflect this.
|
suite. Users are advised not to use the memory controller in the
|
|
current release.
|
|
|
|
Caution: There is no initialization code in the standard "newlib"
|
|
library.
|
|
|
|
The standard "uClibc" library assumes a memory controller mapped
|
|
at 0x93000000 and will initialize the memory controller to expect
|
|
64MB memory blocks, and any memory declarations _must_ reflect
|
|
this.
|
|
|
If smaller memory blocks are declared with a memory controller,
|
If smaller memory blocks are declared with a memory controller,
|
then sufficient memory will not be allocated by Or1ksim, but out of
|
then sufficient memory will not be allocated by Or1ksim, but out of
|
range memory accesses will not be trapped. For example declaring a
|
range memory accesses will not be trapped. For example declaring a
|
memory section from 0-4MB with a memory controller enabled would
|
memory section from 0-4MB with a memory controller enabled would
|
Line 2207... |
Line 2222... |
top level SVN directory, `ata'. It is described in the document
|
top level SVN directory, `ata'. It is described in the document
|
`ATA/ATAPI-5 Core Specification' by Richard Herveille, which can be
|
`ATA/ATAPI-5 Core Specification' by Richard Herveille, which can be
|
found in the `doc' subdirectory. It is a memory mapped component,
|
found in the `doc' subdirectory. It is a memory mapped component,
|
which resides on the main OpenRISC Wishbone data bus.
|
which resides on the main OpenRISC Wishbone data bus.
|
|
|
|
Warning: In the current release of Or1ksim, parsing of the ATA
|
|
section is broken. Users should not configure the disc interface
|
|
in this release.
|
|
|
ATA/ATAPI configuration is described in `section ata'. This section
|
ATA/ATAPI configuration is described in `section ata'. This section
|
may appear multiple times, specifying multiple disc controllers. The
|
may appear multiple times, specifying multiple disc controllers. The
|
following parameters may be specified.
|
following parameters may be specified.
|
|
|
`enabled = 0|1'
|
`enabled = 0|1'
|
Line 3476... |
Line 3495... |
|