Line 84... |
Line 84... |
|
|
Unpack the software and create a @emph{separate} directory in which to
|
Unpack the software and create a @emph{separate} directory in which to
|
build it:
|
build it:
|
|
|
@example
|
@example
|
@kbd{tar jxf or1ksim-@value{VERSION}.tar.bz2}
|
tar jxf or1ksim-@value{VERSION}.tar.bz2
|
@kbd{mkdir builddir_or1ksim}
|
mkdir builddir_or1ksim
|
@kbd{cd builddir_or1ksim}
|
cd builddir_or1ksim
|
@end example
|
@end example
|
|
|
@node Configuring the Build
|
@node Configuring the Build
|
@section Configuring the Build
|
@section Configuring the Build
|
|
|
Line 100... |
Line 100... |
The most significant argument is @code{--target}, which should specify
|
The most significant argument is @code{--target}, which should specify
|
the OpenRISC 1000 32-bit architecture. If this argument is omitted, it will
|
the 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
|
|
|
@example
|
@example
|
@kbd{../or1ksim-@value{VERSION}/configure --target=or32-uclinux ...}
|
../or1ksim-@value{VERSION}/configure --target=or32-uclinux ...
|
@end example
|
@end example
|
|
|
There are several other options available, many of which are standard
|
There are several other options available, many of which are standard
|
to GNU @command{configure} scripts. Use @kbd{configure --help} to see
|
to GNU @command{configure} scripts. Use @kbd{configure --help} to see
|
all the options. The most useful is @code{--prefix} to specify a
|
all the options. The most useful is @code{--prefix} to specify a
|
Line 181... |
Line 181... |
|
|
@example
|
@example
|
@code{l.xori rD,rA,-1}
|
@code{l.xori rD,rA,-1}
|
@end example
|
@end example
|
|
|
This flag causes Or1ksim to treat the immediate operand as unsigned (i.e
|
This flag causes @value{OR1KSIM} to treat the immediate operand as unsigned (i.e
|
to zero-extend rather than sign-extend).
|
to zero-extend rather than sign-extend).
|
|
|
The default is to sign-extend, so that existing code will continue to
|
The default is to sign-extend, so that existing code will continue to
|
work.
|
work.
|
|
|
Line 232... |
Line 232... |
get the missing test(s) working.
|
get the missing test(s) working.
|
|
|
@end table
|
@end table
|
|
|
A number of configuration flags have been removed since version 0.3.0,
|
A number of configuration flags have been removed since version 0.3.0,
|
because they led to invalid behavior of Or1ksim. Those removed are:
|
because they led to invalid behavior of @value{OR1KSIM}. Those removed are:
|
|
|
@table @code
|
@table @code
|
|
|
@item --enable-arith-flag
|
@item --enable-arith-flag
|
@cindex @code{--enable-arith-flag}
|
@cindex @code{--enable-arith-flag}
|
Line 286... |
Line 286... |
@node Build and Install
|
@node Build and Install
|
@section Building and Installing
|
@section Building and Installing
|
Build the tool with:
|
Build the tool with:
|
|
|
@example
|
@example
|
@kbd{make all}
|
make all
|
@end example
|
@end example
|
|
|
If you have the OpenRISC tool chain and DejaGNU installed, you can
|
If you have the OpenRISC tool chain and DejaGNU installed, you can
|
verify the tool as follows (otherwise omit this step):
|
verify the tool as follows (otherwise omit this step):
|
|
|
@example
|
@example
|
@kbd{make check}
|
make check
|
@end example
|
@end example
|
|
|
Install the tool with:
|
Install the tool with:
|
|
|
@example
|
@example
|
@kbd{make install}
|
make install
|
@end example
|
@end example
|
|
|
This will install the three variations of the @value{OR1KSIM} tool,
|
This will install the three variations of the @value{OR1KSIM} tool,
|
@command{or32-uclinux-sim}, @command{or32-uclinux-psim} and
|
@command{or32-uclinux-sim}, @command{or32-uclinux-psim} and
|
@command{or32-uclinux-mpsim}, the @value{OR1KSIM} library, @file{libsim}, the
|
@command{or32-uclinux-mpsim}, the @value{OR1KSIM} library, @file{libsim}, the
|
Line 311... |
Line 311... |
|
|
The documentation may be created and installed in alternative formats (PDF,
|
The documentation may be created and installed in alternative formats (PDF,
|
Postscript, DVI, HTML) with for example:
|
Postscript, DVI, HTML) with for example:
|
|
|
@example
|
@example
|
@kbd{make pdf}
|
make pdf
|
@kbd{make install-pdf}
|
make install-pdf
|
@end example
|
@end example
|
|
|
@node Known Issues
|
@node Known Issues
|
@section Known Problems and Issues
|
@section Known Problems and Issues
|
|
|
Line 325... |
Line 325... |
to see the current state of these issues and to raise new problems and
|
to see the current state of these issues and to raise new problems and
|
feature requests. It may be found at
|
feature requests. It may be found at
|
@url{http://opencores.org/project,or1k,bugtracker}.
|
@url{http://opencores.org/project,or1k,bugtracker}.
|
|
|
The following issues are long standing and unlikely to be fixed in
|
The following issues are long standing and unlikely to be fixed in
|
Or1ksim in the near future.
|
@value{OR1KSIM} in the near future.
|
|
|
@itemize @bullet
|
@itemize @bullet
|
@item
|
@item
|
The Supervision Register Little Endian Enable (LEE) bit is
|
The Supervision Register Little Endian Enable (LEE) bit is
|
ignored. @value{OR1KSIM} can be built for either little endian or big endian
|
ignored. @value{OR1KSIM} can be built for either little endian or big endian
|
Line 351... |
Line 351... |
@menu
|
@menu
|
* Standalone Simulator::
|
* Standalone Simulator::
|
* Profiling Utility::
|
* Profiling Utility::
|
* Memory Profiling Utility::
|
* Memory Profiling Utility::
|
* Simulator Library::
|
* Simulator Library::
|
|
* Ethernet TUN/TAP Interface::
|
@end menu
|
@end menu
|
|
|
@node Standalone Simulator
|
@node Standalone Simulator
|
@section Standalone Simulator
|
@section Standalone Simulator
|
@cindex command line for @value{OR1KSIM} standalone use
|
@cindex command line for @value{OR1KSIM} standalone use
|
Line 451... |
Line 452... |
zero. The size may be followed by @samp{k}, @samp{K}, @samp{m},
|
zero. The size may be followed by @samp{k}, @samp{K}, @samp{m},
|
@samp{M}, @samp{g}, @samp{G}, to indicate kilobytes (@math{2^{10}}
|
@samp{M}, @samp{g}, @samp{G}, to indicate kilobytes (@math{2^{10}}
|
bytes), megabytes (@math{2^{20}} bytes) and gigabytes (@math{2^{30}}
|
bytes), megabytes (@math{2^{20}} bytes) and gigabytes (@math{2^{30}}
|
bytes).
|
bytes).
|
|
|
This is mainly intended for use when Or1ksim is used without a
|
This is mainly intended for use when @value{OR1KSIM} is used without a
|
configuration file, to allow just the processor and memory to be set
|
configuration file, to allow just the processor and memory to be set
|
up. This is the equivalent of specifying a configuration memory section
|
up. This is the equivalent of specifying a configuration memory section
|
with @code{baseaddr = 0} and @code{size = @var{size}} and all other
|
with @code{baseaddr = 0} and @code{size = @var{size}} and all other
|
parameters taking their default value.
|
parameters taking their default value.
|
|
|
Line 474... |
Line 475... |
@cindex @code{--report-memory-errors}
|
@cindex @code{--report-memory-errors}
|
By default all exceptions are now handled silently. If this option is
|
By default all exceptions are now handled silently. If this option is
|
specified, bus exceptions will be reported with a message to standard
|
specified, bus exceptions will be reported with a message to standard
|
error indicating the address at which the exception occurred.
|
error indicating the address at which the exception occurred.
|
|
|
This was the default behaviour up to Or1ksim 0.4.0. This flag is
|
This was the default behaviour up to @value{OR1KSIM} 0.4.0. This flag is
|
provided for those who wish to keep that behavior.
|
provided for those who wish to keep that behavior.
|
|
|
@item --strict-npc
|
@item --strict-npc
|
@cindex @code{--strict-npc}
|
@cindex @code{--strict-npc}
|
In real hardware, setting the next program counter (NPC, SPR 16),
|
In real hardware, setting the next program counter (NPC, SPR 16),
|
Line 691... |
Line 692... |
the interface, and makes @value{OR1KSIM} more consistent with payload
|
the interface, and makes @value{OR1KSIM} more consistent with payload
|
representation in SystemC TLM 2.0.
|
representation in SystemC TLM 2.0.
|
@end quotation
|
@end quotation
|
|
|
@quotation Note
|
@quotation Note
|
The current implementation of Or1ksim always transfers single words (4
|
The current implementation of @value{OR1KSIM} always transfers single words (4
|
bytes), using masks if smaller values are required. In this it mimcs the
|
bytes), using masks if smaller values are required. In this it mimcs the
|
behavior of the WishBone bus.
|
behavior of the WishBone bus.
|
@end quotation
|
@end quotation
|
|
|
@end deftypefn
|
@end deftypefn
|
Line 834... |
Line 835... |
|
|
Read @var{len} bytes from @var{addr}, placing the result in @var{buf}.
|
Read @var{len} bytes from @var{addr}, placing the result in @var{buf}.
|
Return @var{len} on success and 0 on failure.
|
Return @var{len} on success and 0 on failure.
|
|
|
@quotation Note
|
@quotation Note
|
This function was added in Or1ksim 0.5.0.
|
This function was added in @value{OR1KSIM} 0.5.0.
|
@end quotation
|
@end quotation
|
|
|
@end deftypefn
|
@end deftypefn
|
|
|
@deftypefn {@file{or1ksim.h}} int or1ksim_write_mem @
|
@deftypefn {@file{or1ksim.h}} int or1ksim_write_mem @
|
Line 847... |
Line 848... |
|
|
Write @var{len} bytes to @var{addr}, taking the data from @var{buf}.
|
Write @var{len} bytes to @var{addr}, taking the data from @var{buf}.
|
Return @var{len} on success and 0 on failure.
|
Return @var{len} on success and 0 on failure.
|
|
|
@quotation Note
|
@quotation Note
|
This function was added in Or1ksim 0.5.0.
|
This function was added in @value{OR1KSIM} 0.5.0.
|
@end quotation
|
@end quotation
|
|
|
@end deftypefn
|
@end deftypefn
|
|
|
@deftypefn {@file{or1ksim.h}} int or1ksim_read_spr (int @var{sprnum}, @
|
@deftypefn {@file{or1ksim.h}} int or1ksim_read_spr (int @var{sprnum}, @
|
Line 859... |
Line 860... |
|
|
Read the SPR specified by @var{sprnum}, placing the result in
|
Read the SPR specified by @var{sprnum}, placing the result in
|
@var{sprval_ptr}. Return non-zero on success and 0 on failure.
|
@var{sprval_ptr}. Return non-zero on success and 0 on failure.
|
|
|
@quotation Note
|
@quotation Note
|
This function was added in Or1ksim 0.5.0.
|
This function was added in @value{OR1KSIM} 0.5.0.
|
@end quotation
|
@end quotation
|
|
|
@end deftypefn
|
@end deftypefn
|
|
|
@deftypefn {@file{or1ksim.h}} int or1ksim_write_spr (int @var{sprnum}, @
|
@deftypefn {@file{or1ksim.h}} int or1ksim_write_spr (int @var{sprnum}, @
|
Line 871... |
Line 872... |
|
|
Write @var{sprval} to the SPR specified by @var{sprnum}. Return
|
Write @var{sprval} to the SPR specified by @var{sprnum}. Return
|
non-zero on success and 0 on failure.
|
non-zero on success and 0 on failure.
|
|
|
@quotation Note
|
@quotation Note
|
This function was added in Or1ksim 0.5.0.
|
This function was added in @value{OR1KSIM} 0.5.0.
|
@end quotation
|
@end quotation
|
|
|
@end deftypefn
|
@end deftypefn
|
|
|
@deftypefn {@file{or1ksim.h}} int or1ksim_read_reg (int @var{regnum}, @
|
@deftypefn {@file{or1ksim.h}} int or1ksim_read_reg (int @var{regnum}, @
|
Line 884... |
Line 885... |
Read the general purpose register specified by @var{regnum}, placing the
|
Read the general purpose register specified by @var{regnum}, placing the
|
result in @var{regval_ptr}. Return non-zero on success and 0 on
|
result in @var{regval_ptr}. Return non-zero on success and 0 on
|
failure.
|
failure.
|
|
|
@quotation Note
|
@quotation Note
|
This function was added in Or1ksim 0.5.0.
|
This function was added in @value{OR1KSIM} 0.5.0.
|
@end quotation
|
@end quotation
|
|
|
@end deftypefn
|
@end deftypefn
|
|
|
@deftypefn {@file{or1ksim.h}} int or1ksim_write_reg (int @var{regnum}, @
|
@deftypefn {@file{or1ksim.h}} int or1ksim_write_reg (int @var{regnum}, @
|
Line 896... |
Line 897... |
|
|
Write @var{regval} to the general purpose register specified by
|
Write @var{regval} to the general purpose register specified by
|
@var{regnum}. Return non-zero on success and 0 on failure.
|
@var{regnum}. Return non-zero on success and 0 on failure.
|
|
|
@quotation Note
|
@quotation Note
|
This function was added in Or1ksim 0.5.0.
|
This function was added in @value{OR1KSIM} 0.5.0.
|
@end quotation
|
@end quotation
|
|
|
@end deftypefn
|
@end deftypefn
|
|
|
@deftypefn {@file{or1ksim.h}} void or1ksim_set_stall_state (int @var{state})
|
@deftypefn {@file{or1ksim.h}} void or1ksim_set_stall_state (int @var{state})
|
|
|
Set the processor's state according to @var{state} (1 = stalled, 0 = not
|
Set the processor's state according to @var{state} (1 = stalled, 0 = not
|
stalled).
|
stalled).
|
|
|
@quotation Note
|
@quotation Note
|
This function was added in Or1ksim 0.5.0.
|
This function was added in @value{OR1KSIM} 0.5.0.
|
@end quotation
|
@end quotation
|
|
|
@end deftypefn
|
@end deftypefn
|
|
|
The libraries will be installed in the @file{lib} sub-directory of the
|
The libraries will be installed in the @file{lib} sub-directory of the
|
Line 955... |
Line 956... |
@item
|
@item
|
Add the library directory to @file{/etc/ld.so.conf}
|
Add the library directory to @file{/etc/ld.so.conf}
|
|
|
@end itemize
|
@end itemize
|
|
|
|
@node Ethernet TUN/TAP Interface
|
|
@section Ethernet TUN/TAP Interface
|
|
@cindex configuring the Ethernet TUN/TAP interface
|
|
|
|
When an Ethernet peripheral is configured (@pxref{Ethernet
|
|
Configuration, , Ethernet Configuration}), one option is to tunnel
|
|
traffic through a TUN/TAP interface. The low level TAP interface is used
|
|
to tunnel raw Ethernet datagrams.
|
|
|
|
The TAP interface can then be connected to a physical Ethernet through a
|
|
bridge, allowing the @value{OR1KSIM} model to connect to a physical
|
|
network. This is particularly when @value{OR1KSIM} is running the
|
|
OpenRISC Linux kernel image.
|
|
|
|
This section explains how to set up a bridge for use by @value{OR1KSIM}. It does
|
|
require superuser access to the host machine (or at least the relevant
|
|
network capabilities). A system administrator can modify these
|
|
guidelines so they are executed on reboot if appropriate.
|
|
|
|
@menu
|
|
* Setting Up a Persistent TAP device::
|
|
* Establishing a Bridge::
|
|
* Opening the Firewall::
|
|
* Disabling Ethernet Filtering::
|
|
* Networking from OpenRISC Linux and BusyBox::
|
|
* Tearing Down a Bridge::
|
|
@end menu
|
|
|
|
@node Setting Up a Persistent TAP device
|
|
@subsection Setting Up a Persistent TAP device
|
|
@cindex persistent TAP device creation
|
|
@cindex TAP device creation
|
|
|
|
TUN/TAP devices can be created dynamically, but this requires superuser
|
|
privileges (or at least @code{CAP_NET_ADMIN} capability). The solution
|
|
is to create a persistent TAP device. This can be done using either
|
|
@command{openvpn} or @command{tunctl}. In either case the package must
|
|
be installed on the host system. Using @command{openvpn}, the following
|
|
would set up a TAP interface for a specified user and group.
|
|
|
|
@example
|
|
openvpn --mktun --dev tap@emph{n} --user @emph{username} --group @emph{groupname}
|
|
@end example
|
|
|
|
@node Establishing a Bridge
|
|
@subsection Establishing a Bridge
|
|
@cindex bridge setup
|
|
@cindex Ethernet bridge setup
|
|
|
|
A bridge is a ``virtual'' local area network interfaces, subsuming two or more
|
|
existing network interfaces. In this case we will bridge the physical
|
|
Ethernet interface of the host with the TAP interface that will be used
|
|
by @value{OR1KSIM}.
|
|
|
|
The Ethernet and TAP must lose their own individual IP addresses (by
|
|
setting them to 0.0.0.0) and are replaced by the IP address of the
|
|
bridge interface. To do this we use the @command{bridge-utils} package,
|
|
which must be installed on the host system. These commands are require
|
|
superuser privileges or @code{CAP_NET_ADMIN} capability. To create a new
|
|
interface @code{br@emph{n}} the following commands are appropriate.
|
|
|
|
@example
|
|
brctl addbr br@emph{n}
|
|
brctl addif br@emph{n} eth@emph{x}
|
|
brctl addif br@emph{n} tap@emph{y}
|
|
|
|
ifconfig eth@emph{x} 0.0.0.0 promisc up
|
|
ifconfig tap@emph{y} 0.0.0.0 promisc up
|
|
|
|
dhclient br@emph{n}
|
|
@end example
|
|
|
|
The last command instructs the bridge to obtain its IP address, netmask,
|
|
broadcast address, gateway and nameserver information using DHCP. In a
|
|
network without DHCP it should be replaced by @command{ifconfig} to set
|
|
a static IP address, netmask and broadcast address.
|
|
|
|
@quotation Note
|
|
This will leave a spare dhclient process running in the background,
|
|
which should be killed for tidiness. There is a technique to avoid this
|
|
using @command{omshell}, but that is beyond the scope of this guide.
|
|
@end quotation
|
|
|
|
@quotation Note
|
|
It is not clear to the author why the existing interfaces need to be
|
|
brought up in promiscuous mode, but it seems to cure various problems.
|
|
@end quotation
|
|
|
|
@node Opening the Firewall
|
|
@subsection Opening the Firewall
|
|
@cindex firewall with Ethernet bridge and TAP/TUN
|
|
|
|
Firewall rules should be added to ensure traffic flows freely through
|
|
the TAP and bridge interfaces. As superuser the following commands are
|
|
appropriate.
|
|
|
|
@example
|
|
iptables -A INPUT -i tap@emph{y} -j ACCEPT
|
|
iptables -A INPUT -i br@emph{n} -j ACCEPT
|
|
iptables -A FORWARD -i br@emph{n} -j ACCEPT
|
|
@end example
|
|
|
|
@node Disabling Ethernet Filtering
|
|
@subsection Disabling Ethernet Filtering
|
|
|
|
Some systems may have ethernet filtering enabled (@command{ebtables},
|
|
@command{bridge-nf}, @command{arptables}) which will stop traffic
|
|
flowing through the bridge.
|
|
|
|
The easiest way to disable this is by writing zero to all
|
|
@file{bridge-nf-*} entries in @file{/proc/sys/net/bridge}. As superuser
|
|
the following commands will achieve this.
|
|
|
|
@example
|
|
cd /proc/sys/net/bridge
|
|
for f in bridge-nf-*; do echo 0 > $f; done
|
|
@end example
|
|
|
|
@node Networking from OpenRISC Linux and BusyBox
|
|
@subsection Networking from OpenRISC Linux and BusyBox
|
|
@cindex BusyBox and Ethernet
|
|
@cindex Linux (OpenRISC) and Ethernet
|
|
|
|
The main use of this style of Ethernet interface to @value{OR1KSIM} is when
|
|
running the OpenRISC Linux kernel with BusyBox. The following commands
|
|
in the BusyBox console window will configure the Ethernet interface
|
|
(assumed to be @code{eth0}) and bring it up with a DHCP assigned
|
|
address.
|
|
|
|
@example
|
|
ifconfig eth0
|
|
ifup eth0
|
|
@end example
|
|
|
|
At this stage interface to IP addresses will work correctly.
|
|
|
|
For DNS to work the BusyBox system needs to know where to find a
|
|
nameserver. Under BusyBox, @command{udhcp} does not configure
|
|
@file{/etc/resolv.conf} automatically.
|
|
|
|
The solution is to duplicate the nameserver entry from the
|
|
@file{/etc/resolv.conf} file of the host on the BusyBox system. A
|
|
typical file might be as follows:
|
|
|
|
@example
|
|
@code{nameserver 192.168.0.1}
|
|
@end example
|
|
|
|
It is convenient to make this permanent within the Linux initramfs. Add
|
|
the file as @code{arch/openrisc/support/initramfs/etc/resolv.conf}
|
|
within the Linux source tree and rebuild @code{vmlinux}. It will then be
|
|
present automatically.
|
|
|
|
One of the most useful functions that is possible is to mount
|
|
the host file system through NFS. For example, from the BusyBox console:
|
|
|
|
@example
|
|
mount -t nfs -o nolock 192.168.0.60:/home /mnt
|
|
@end example
|
|
|
|
Another useful technique is to telnet into the BusyBox system from the
|
|
host. This is particularly valuable when a console process locks up,
|
|
since the @command{xterm} console will not recognize ctrl-C. Instead the
|
|
rogue process can be killed from a telnet connection.
|
|
|
|
@node Tearing Down a Bridge
|
|
@subsection Tearing Down a Bridge
|
|
|
|
There is little reason why a bridge should ever need to be torn down,
|
|
but if desired, the following commands will achieve the effect.
|
|
|
|
@example
|
|
ifconfig br@emph{n} down
|
|
brctl delbr br@emph{n}
|
|
|
|
dhclient eth@emph{x}
|
|
@end example
|
|
|
|
As before this will leave a spare @command{dhclient} process in the
|
|
background which should be killed.
|
|
|
|
If desired the TAP interface can be deleted using
|
|
|
|
@example
|
|
openvpn --rmtun -dev tap@emph{y}
|
|
@end example
|
|
|
|
@quotation Caution
|
|
The TAP interface should not be in use when running this command. For
|
|
example any OpenRISC Linux/BusyBox sessions should be closed first.
|
|
@end quotation
|
|
|
@node Configuration
|
@node Configuration
|
@chapter Configuration
|
@chapter Configuration
|
@cindex configuring @value{OR1KSIM}
|
@cindex configuring @value{OR1KSIM}
|
|
|
@value{OR1KSIM} is configured through a configuration file. This is specified
|
@value{OR1KSIM} is configured through a configuration file. This is specified
|
Line 1906... |
Line 2099... |
interrupt, and a function to clear level sensitive interrupts. Edge
|
interrupt, and a function to clear level sensitive interrupts. Edge
|
sensitive interrupts must be cleared by clearing the corresponding bit
|
sensitive interrupts must be cleared by clearing the corresponding bit
|
in the PICSR SPR.
|
in the PICSR SPR.
|
|
|
Internal functions to set and clear interrupts are also provided for
|
Internal functions to set and clear interrupts are also provided for
|
peripherals implemented within Or1ksim. @xref{Interrupts Internal, ,
|
peripherals implemented within @value{OR1KSIM}. @xref{Interrupts Internal, ,
|
Interrupts Internal} for more details.
|
Interrupts Internal} for more details.
|
|
|
@item use_nmi = 0|1
|
@item use_nmi = 0|1
|
@cindex @code{use_nmi} (interrupt controller)
|
@cindex @code{use_nmi} (interrupt controller)
|
If 1 (true, the default), interrupt lines 0 and 1 are non-maskable. In
|
If 1 (true, the default), interrupt lines 0 and 1 are non-maskable. In
|
Line 2383... |
Line 2576... |
@node Ethernet Configuration
|
@node Ethernet Configuration
|
@subsection Ethernet Configuration
|
@subsection Ethernet Configuration
|
@cindex configuring the Ethernet interface
|
@cindex configuring the Ethernet interface
|
@cindex Ethernet configuration
|
@cindex Ethernet configuration
|
@cindex @code{section ethernet}
|
@cindex @code{section ethernet}
|
The Ethernet MAC used in @value{OR1KSIM} is the component implemented
|
|
at OpenCores, and found in the top level SVN directory, @file{ethmac}.
|
|
It also forms part of the OpenRISC SoC, ORPSoC. It is described in
|
|
the document @cite{Ethernet IP Core Specification} by Igor Mohor,
|
|
which can be found in the @file{doc} subdirectory. It is a memory
|
|
mapped component, which resides on the main OpenRISC Wishbone data
|
|
bus.
|
|
|
|
Ethernet configuration is described in @code{section ethernet}. This
|
Ethernet configuration is described in @code{section ethernet}. This
|
section may appear multiple times, specifying multiple Ethernet
|
section may appear multiple times, specifying multiple Ethernet
|
interfaces. The following parameters may be specified.
|
interfaces. The following parameters may be specified.
|
|
|
|
The Ethernet MAC used in @value{OR1KSIM} corresponds to the Verilog
|
|
implementation in project @dfn{ethmac}. It's source code can be found in
|
|
the top level SVN directory, @file{ethmac}. It also forms part of the
|
|
OpenRISC reference SoC, ORPSoC. It is described in the document
|
|
@cite{Ethernet IP Core Specification} by Igor Mohor, which can be found
|
|
in the @file{doc} subdirectory. It is a memory mapped component, which
|
|
resides on the main OpenRISC Wishbone data bus.
|
|
|
@table @code
|
@table @code
|
|
|
@item enabled = 0|1
|
@item enabled = 0|1
|
@cindex @code{enabled} (Ethernet configuration)
|
@cindex @code{enabled} (Ethernet configuration)
|
If 1 (true, the default), this Ethernet MAC is enabled. If 0, it is
|
If 1 (true, the default), this Ethernet MAC is enabled. If 0, it is
|
Line 2433... |
Line 2626... |
|
|
@item irq = @var{value}
|
@item irq = @var{value}
|
@cindex @code{dma} (Ethernet configuration)
|
@cindex @code{dma} (Ethernet configuration)
|
Use @var{value} as the IRQ number of this Ethernet MAC. Default value 0.
|
Use @var{value} as the IRQ number of this Ethernet MAC. Default value 0.
|
|
|
@item rtx_type = 0|1
|
@item rtx_type = "file"|"tap"
|
@cindex @code{rtx_type} (Ethernet configuration)
|
@cindex @code{rtx_type} (Ethernet configuration)
|
If 1 (true) use a socket interface to the Ethernet (see parameter
|
Specifies whether to use a TUN/TAP interface or file interface (the default)
|
@code{sockif} below). If 0 (the default), use a file interface,
|
to model the external connection of the Ethernet.
|
reading and writing from and to the files specified in the
|
|
@code{rxfile} and @code{txfile} parameters (see below).
|
|
|
|
@quotation Note
|
If a TUN/TAP interface is requested, Ethernet packets will be sent and
|
By default the socket interface is not provided in @value{OR1KSIM}. If
|
received through the pesistent TAP interface specified in parameter
|
it is required, this must be requested when configuring, by use of the
|
@code{tap_dev} (see below).
|
@code{--enable-ethphy} option to @command{configure}.
|
|
|
More details on configuring the TUN/TAP interface are given in the Usage
|
|
section (@pxref{Ethernet TUN/TAP Interface, , Ethernet TUN/TAP
|
|
Interface}).
|
|
|
@example
|
If a file interface (the default), is requested, the Ethernet will be
|
configure --target=or32-uclinux --enable-ethphy ...
|
modelled by reading and writing from and to the files specified in the
|
@end example
|
@code{rxfile} and @code{txfile} parameters (see below).
|
|
|
|
@quotation Caution
|
|
If a file interface is specified, @value{OR1KSIM} will terminate once the
|
|
receive file specified by @code{rxfile} is exhausted.
|
@end quotation
|
@end quotation
|
|
|
@item rx_channel = @var{rxvalue}
|
@item rx_channel = @var{rxvalue}
|
@cindex @code{rx_channel} (Ethernet configuration)
|
@cindex @code{rx_channel} (Ethernet configuration)
|
@itemx tx_channel = @var{txvalue}
|
@itemx tx_channel = @var{txvalue}
|
Line 2480... |
Line 2678... |
|
|
The input file must exist and be readable. The output file must be
|
The input file must exist and be readable. The output file must be
|
writable and will be created if necessary. If either of these
|
writable and will be created if necessary. If either of these
|
conditions is not met, a warning will be given.
|
conditions is not met, a warning will be given.
|
|
|
@item sockif = "@var{service}"
|
@quotation Caution
|
@cindex @code{sockif} (Ethernet configuration)
|
@value{OR1KSIM} will terminate once the @var{rxfile} is exhausted.
|
When @code{rtx_type} is 1 (see above), @var{service} specifies the
|
@end quotation
|
service to use for communication. This may be TCP/IP or UDP/IP. The
|
|
default value of this parameter is @code{"or1ksim_eth"}.
|
@item tap_dev = "@var{tap}"
|
|
@cindex @code{tap_dev} (Ethernet configuration)
|
|
When @code{rtx_type} is @code{"tap"} (see above), @var{tap_dev}
|
|
specifies the TAP device to use for communication. This should be a
|
|
persistent TAP device configured for the system (@pxref{Ethernet TUN/TAP
|
|
Interface, , Ethernet TUN/TAP Interface})
|
|
|
@item vapi_id = @var{value}
|
@item vapi_id = @var{value}
|
@cindex @code{vapi_id} (DMA configuration)
|
@cindex @code{vapi_id} (DMA configuration)
|
@var{value} specifies the value of the Verification API (VAPI) base
|
@var{value} specifies the value of the Verification API (VAPI) base
|
address to be used with the Ethernet PHY. @xref{Verification API, ,
|
address to be used with the Ethernet PHY. @xref{Verification API, ,
|
Verification API}, for more details, which details the use of the VAPI
|
Verification API}, for more details, which details the use of the VAPI
|
with the DMA controller.
|
with the DMA controller.
|
|
|
@item phy_addr = @var{value}
|
@item phy_addr = @var{value}
|
@cindex @code{phy_addr}
|
@cindex @code{phy_addr}
|
@var{value} specifies address for emulated ethernet PHY. Defaults to 0 otherwise.
|
@var{value} specifies the address for emulated ethernet PHY (default
|
|
0). If there are multiple Ethernet peripherals, they should each have a
|
|
different PHY value.
|
|
|
@end table
|
@end table
|
|
|
@node GPIO Configuration
|
@node GPIO Configuration
|
@subsection GPIO Configuration
|
@subsection GPIO Configuration
|
Line 2746... |
Line 2951... |
Herveille, which can be found in the @file{doc} subdirectory. It is a
|
Herveille, which can be found in the @file{doc} subdirectory. It is a
|
memory mapped component, which resides on the main OpenRISC Wishbone
|
memory mapped component, which resides on the main OpenRISC Wishbone
|
data bus.
|
data bus.
|
|
|
@quotation Warning
|
@quotation Warning
|
In the current release of Or1ksim, parsing of the ATA section is
|
In the current release of @value{OR1KSIM}, parsing of the ATA section is
|
broken. Users should not configure the disc interface in this release.
|
broken. Users should not configure the disc interface in this release.
|
@end quotation
|
@end quotation
|
|
|
ATA/ATAPI configuration is described in @code{@w{section ata}}. This section
|
ATA/ATAPI configuration is described in @code{@w{section ata}}. This section
|
may appear multiple times, specifying multiple disc controllers. The
|
may appear multiple times, specifying multiple disc controllers. The
|
Line 3780... |
Line 3985... |
procedures for common use among the tests.
|
procedures for common use among the tests.
|
|
|
@item libsim.tests
|
@item libsim.tests
|
@itemx or1ksim.tests
|
@itemx or1ksim.tests
|
@cindex DejaGNU tests directories
|
@cindex DejaGNU tests directories
|
These are the directories of tests of the Or1ksim library. They also include
|
These are the directories of tests of the @value{OR1KSIM} library. They
|
@value{OR1KSIM} configuration files and each has a @file{Makefile.am} file.
|
also include @value{OR1KSIM} configuration files and each has a
|
@file{Makefile.am} should be updated whenever files are added to this
|
@file{Makefile.am} file. @file{Makefile.am} should be updated whenever
|
directory, to ensure they are included in the distribution.
|
files are added to this directory, to ensure they are included in the
|
|
distribution.
|
|
|
@item test-code
|
@item test-code
|
@cindex host test code
|
@cindex host test code
|
@cindex test code for host
|
@cindex test code for host
|
These are all the test programs to be compiled on the host (each in its
|
These are all the test programs to be compiled on the host (each in its
|