URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/or1ksim/doc
- from Rev 436 to Rev 440
- ↔ Reverse comparison
Rev 436 → Rev 440
/or1ksim.info
1,5 → 1,5
This is ../../or1ksim/doc/or1ksim.info, produced by makeinfo version |
4.13 from ../../or1ksim/doc/or1ksim.texi. |
This is ../../doc/or1ksim.info, produced by makeinfo version 4.13 from |
../../doc/or1ksim.texi. |
|
INFO-DIR-SECTION Embedded development |
START-INFO-DIR-ENTRY |
64,7 → 64,7
Unpack the software and create a _separate_ directory in which to build |
it: |
|
tar jxf or1ksim-2010-11-26.tar.bz2 |
tar jxf or1ksim-2010-12-08.tar.bz2 |
mkdir builddir_or1ksim |
cd builddir_or1ksim |
|
81,7 → 81,7
OpenRISC 1000 32-bit architecture. If this argument is omitted, it will |
default to OpenRISC 1000 32-bit with a warning |
|
../or1ksim-2010-11-26/configure --target=or32-uclinux ... |
../or1ksim-2010-12-08/configure --target=or32-uclinux ... |
|
There are several other options available, many of which are standard |
to GNU `configure' scripts. Use `configure --help' to see all the |
286,6 → 286,7
* Profiling Utility:: |
* Memory Profiling Utility:: |
* Simulator Library:: |
* Ethernet TUN/TAP Interface:: |
|
|
File: or1ksim.info, Node: Standalone Simulator, Next: Profiling Utility, Up: Usage |
509,7 → 510,7
|
|
|
File: or1ksim.info, Node: Simulator Library, Prev: Memory Profiling Utility, Up: Usage |
File: or1ksim.info, Node: Simulator Library, Next: Ethernet TUN/TAP Interface, Prev: Memory Profiling Utility, Up: Usage |
|
2.4 Simulator Library |
===================== |
757,6 → 758,189
|
|
|
File: or1ksim.info, Node: Ethernet TUN/TAP Interface, Prev: Simulator Library, Up: Usage |
|
2.5 Ethernet TUN/TAP Interface |
============================== |
|
When an Ethernet peripheral is configured (*note 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 Or1ksim model to connect to a physical network. |
This is particularly when Or1ksim is running the OpenRISC Linux kernel |
image. |
|
This section explains how to set up a bridge for use by 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:: |
|
|
File: or1ksim.info, Node: Setting Up a Persistent TAP device, Next: Establishing a Bridge, Up: Ethernet TUN/TAP Interface |
|
2.5.1 Setting Up a Persistent TAP device |
---------------------------------------- |
|
TUN/TAP devices can be created dynamically, but this requires superuser |
privileges (or at least `CAP_NET_ADMIN' capability). The solution is |
to create a persistent TAP device. This can be done using either |
`openvpn' or `tunctl'. In either case the package must be installed on |
the host system. Using `openvpn', the following would set up a TAP |
interface for a specified user and group. |
|
openvpn --mktun --dev tap_n_ --user _username_ --group _groupname_ |
|
|
File: or1ksim.info, Node: Establishing a Bridge, Next: Opening the Firewall, Prev: Setting Up a Persistent TAP device, Up: Ethernet TUN/TAP Interface |
|
2.5.2 Establishing a Bridge |
--------------------------- |
|
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 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 `bridge-utils' package, which |
must be installed on the host system. These commands are require |
superuser privileges or `CAP_NET_ADMIN' capability. To create a new |
interface `br_n_' the following commands are appropriate. |
|
brctl addbr br_n_ |
brctl addif br_n_ eth_x_ |
brctl addif br_n_ tap_y_ |
|
ifconfig eth_x_ 0.0.0.0 promisc up |
ifconfig tap_y_ 0.0.0.0 promisc up |
|
dhclient br_n_ |
|
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 `ifconfig' to set a |
static IP address, netmask and broadcast address. |
|
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 `omshell', but that is beyond the |
scope of this guide. |
|
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. |
|
|
File: or1ksim.info, Node: Opening the Firewall, Next: Disabling Ethernet Filtering, Prev: Establishing a Bridge, Up: Ethernet TUN/TAP Interface |
|
2.5.3 Opening the Firewall |
-------------------------- |
|
Firewall rules should be added to ensure traffic flows freely through |
the TAP and bridge interfaces. As superuser the following commands are |
appropriate. |
|
iptables -A INPUT -i tap_y_ -j ACCEPT |
iptables -A INPUT -i br_n_ -j ACCEPT |
iptables -A FORWARD -i br_n_ -j ACCEPT |
|
|
File: or1ksim.info, Node: Disabling Ethernet Filtering, Next: Networking from OpenRISC Linux and BusyBox, Prev: Opening the Firewall, Up: Ethernet TUN/TAP Interface |
|
2.5.4 Disabling Ethernet Filtering |
---------------------------------- |
|
Some systems may have ethernet filtering enabled (`ebtables', |
`bridge-nf', `arptables') which will stop traffic flowing through the |
bridge. |
|
The easiest way to disable this is by writing zero to all `bridge-nf-*' |
entries in `/proc/sys/net/bridge'. As superuser the following commands |
will achieve this. |
|
cd /proc/sys/net/bridge |
for f in bridge-nf-*; do echo 0 > $f; done |
|
|
File: or1ksim.info, Node: Networking from OpenRISC Linux and BusyBox, Next: Tearing Down a Bridge, Prev: Disabling Ethernet Filtering, Up: Ethernet TUN/TAP Interface |
|
2.5.5 Networking from OpenRISC Linux and BusyBox |
------------------------------------------------ |
|
The main use of this style of Ethernet interface to 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 `eth0') and bring it up with a DHCP assigned address. |
|
ifconfig eth0 |
ifup eth0 |
|
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, `udhcp' does not configure |
`/etc/resolv.conf' automatically. |
|
The solution is to duplicate the nameserver entry from the |
`/etc/resolv.conf' file of the host on the BusyBox system. A typical |
file might be as follows: |
|
`nameserver 192.168.0.1' |
|
It is convenient to make this permanent within the Linux initramfs. Add |
the file as `arch/openrisc/support/initramfs/etc/resolv.conf' within |
the Linux source tree and rebuild `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: |
|
mount -t nfs -o nolock 192.168.0.60:/home /mnt |
|
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 `xterm' console will not recognize ctrl-C. Instead the rogue |
process can be killed from a telnet connection. |
|
|
File: or1ksim.info, Node: Tearing Down a Bridge, Prev: Networking from OpenRISC Linux and BusyBox, Up: Ethernet TUN/TAP Interface |
|
2.5.6 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. |
|
ifconfig br_n_ down |
brctl delbr br_n_ |
|
dhclient eth_x_ |
|
As before this will leave a spare `dhclient' process in the background |
which should be killed. |
|
If desired the TAP interface can be deleted using |
|
openvpn --rmtun -dev tap_y_ |
|
Caution: The TAP interface should not be in use when running this |
command. For example any OpenRISC Linux/BusyBox sessions should be |
closed first. |
|
|
File: or1ksim.info, Node: Configuration, Next: Interactive Command Line, Prev: Usage, Up: Top |
|
3 Configuration |
1948,17 → 2132,18
3.4.4 Ethernet Configuration |
---------------------------- |
|
The Ethernet MAC used in Or1ksim is the component implemented at |
OpenCores, and found in the top level SVN directory, `ethmac'. It also |
forms part of the OpenRISC SoC, ORPSoC. It is described in the |
document `Ethernet IP Core Specification' by Igor Mohor, which can be |
found in the `doc' subdirectory. It is a memory mapped component, |
which resides on the main OpenRISC Wishbone data bus. |
|
Ethernet configuration is described in `section ethernet'. This |
section may appear multiple times, specifying multiple Ethernet |
interfaces. The following parameters may be specified. |
|
The Ethernet MAC used in Or1ksim corresponds to the Verilog |
implementation in project "ethmac". It's source code can be found in |
the top level SVN directory, `ethmac'. It also forms part of the |
OpenRISC reference SoC, ORPSoC. It is described in the document |
`Ethernet IP Core Specification' by Igor Mohor, which can be found in |
the `doc' subdirectory. It is a memory mapped component, which resides |
on the main OpenRISC Wishbone data bus. |
|
`enabled = 0|1' |
If 1 (true, the default), this Ethernet MAC is enabled. If 0, it |
is disabled. |
1987,19 → 2172,26
`irq = VALUE' |
Use VALUE as the IRQ number of this Ethernet MAC. Default value 0. |
|
`rtx_type = 0|1' |
If 1 (true) use a socket interface to the Ethernet (see parameter |
`sockif' below). If 0 (the default), use a file interface, |
reading and writing from and to the files specified in the |
`rxfile' and `txfile' parameters (see below). |
`rtx_type = "file"|"tap"' |
Specifies whether to use a TUN/TAP interface or file interface |
(the default) to model the external connection of the Ethernet. |
|
Note: By default the socket interface is not provided in |
Or1ksim. If it is required, this must be requested when |
configuring, by use of the `--enable-ethphy' option to |
`configure'. |
If a TUN/TAP interface is requested, Ethernet packets will be sent |
and received through the pesistent TAP interface specified in |
parameter `tap_dev' (see below). |
|
configure --target=or32-uclinux --enable-ethphy ... |
More details on configuring the TUN/TAP interface are given in the |
Usage section (*note Ethernet TUN/TAP Interface: Ethernet TUN/TAP |
Interface.). |
|
If a file interface (the default), is requested, the Ethernet will |
be modelled by reading and writing from and to the files specified |
in the `rxfile' and `txfile' parameters (see below). |
|
Caution: If a file interface is specified, Or1ksim will |
terminate once the receive file specified by `rxfile' is |
exhausted. |
|
`rx_channel = RXVALUE' |
`tx_channel = TXVALUE' |
RXVALUE specifies the DMA channel to use for receive and TXVALUE |
2024,11 → 2216,14
writable and will be created if necessary. If either of these |
conditions is not met, a warning will be given. |
|
`sockif = "SERVICE"' |
When `rtx_type' is 1 (see above), SERVICE specifies the service to |
use for communication. This may be TCP/IP or UDP/IP. The default |
value of this parameter is `"or1ksim_eth"'. |
Caution: Or1ksim will terminate once the RXFILE is exhausted. |
|
`tap_dev = "TAP"' |
When `rtx_type' is `"tap"' (see above), TAP_DEV specifies the TAP |
device to use for communication. This should be a persistent TAP |
device configured for the system (*note Ethernet TUN/TAP |
Interface: Ethernet TUN/TAP Interface.) |
|
`vapi_id = VALUE' |
VALUE specifies the value of the Verification API (VAPI) base |
address to be used with the Ethernet PHY. *Note Verification API: |
2036,8 → 2231,9
VAPI with the DMA controller. |
|
`phy_addr = VALUE' |
VALUE specifies address for emulated ethernet PHY. Defaults to 0 |
otherwise. |
VALUE specifies the address for emulated ethernet PHY (default 0). |
If there are multiple Ethernet peripherals, they should each have a |
different PHY value. |
|
|
|
3680,7 → 3876,7
(line 26) |
* baseaddr (DMA configuration): DMA Configuration. (line 24) |
* baseaddr (Ethernet configuration): Ethernet Configuration. |
(line 22) |
(line 23) |
* baseaddr (frame buffer configuration): Frame Buffer Configuration. |
(line 20) |
* baseaddr (generic peripheral configuration): Generic Peripheral Configuration. |
3708,8 → 3904,12
(line 57) |
* breaks (Interactive CLI): Interactive Command Line. |
(line 60) |
* bridge setup: Establishing a Bridge. |
(line 6) |
* btic (branch prediction configuration): Branch Prediction Configuration. |
(line 19) |
* BusyBox and Ethernet: Networking from OpenRISC Linux and BusyBox. |
(line 6) |
* byte_enabled (generic peripheral configuration): Generic Peripheral Configuration. |
(line 48) |
* cache configuration: Cache Configuration. (line 6) |
3781,6 → 3981,8
(line 6) |
* configuring the Ethernet interface: Ethernet Configuration. |
(line 6) |
* configuring the Ethernet TUN/TAP interface: Ethernet TUN/TAP Interface. |
(line 6) |
* configuring the frame buffer: Frame Buffer Configuration. |
(line 6) |
* configuring the GPIO: GPIO Configuration. (line 6) |
3850,7 → 4052,7
* dm (Interactive CLI): Interactive Command Line. |
(line 31) |
* dma (Ethernet configuration): Ethernet Configuration. |
(line 33) |
(line 34) |
* DMA configuration: DMA Configuration. (line 6) |
* DMA verification (VAPI): Verification API. (line 73) |
* dma_mode0_td (ATA/ATAPI configuration): Disc Interface Configuration. |
3885,7 → 4087,7
(line 11) |
* enabled (DMA configuration): DMA Configuration. (line 20) |
* enabled (Ethernet configuration): Ethernet Configuration. |
(line 18) |
(line 19) |
* enabled (frame buffer configuration): Frame Buffer Configuration. |
(line 16) |
* enabled (generic peripheral configuration): Generic Peripheral Configuration. |
3912,6 → 4114,8
(line 32) |
* ETH_VAPI_CTRL (Ethernet verification): Verification API. (line 86) |
* ETH_VAPI_DATA (Ethernet verification): Verification API. (line 84) |
* Ethernet bridge setup: Establishing a Bridge. |
(line 6) |
* Ethernet configuration: Ethernet Configuration. |
(line 6) |
* Ethernet verification (VAPI): Verification API. (line 78) |
3953,6 → 4157,8
(line 36) |
* filename (VGA configuration - deprecated): Display Interface Configuration. |
(line 47) |
* firewall with Ethernet bridge and TAP/TUN: Opening the Firewall. |
(line 6) |
* firmware (ATA/ATAPI device configuration): Disc Interface Configuration. |
(line 121) |
* flag setting by instructions: Configuring the Build. |
4026,6 → 4232,8
* library version of Or1ksim: Simulator Library. (line 6) |
* license for Or1ksim: GNU Free Documentation License. |
(line 6) |
* Linux (OpenRISC) and Ethernet: Networking from OpenRISC Linux and BusyBox. |
(line 6) |
* list breakpoints (Interactive CLI): Interactive Command Line. |
(line 60) |
* load_hitdelay (data cache configuration): Cache Configuration. |
4131,8 → 4339,10
(line 82) |
* pc (Interactive CLI): Interactive Command Line. |
(line 51) |
* persistent TAP device creation: Setting Up a Persistent TAP device. |
(line 6) |
* phy_addr: Ethernet Configuration. |
(line 94) |
(line 105) |
* PIC configuration: Interrupt Configuration. |
(line 6) |
* pio (ATA/ATAPI device configuration): Disc Interface Configuration. |
4237,7 → 4447,7
* rsp_port (debug interface configuration): Debug Interface Configuration. |
(line 32) |
* rtx_type (Ethernet configuration): Ethernet Configuration. |
(line 46) |
(line 47) |
* run (Interactive CLI): Interactive Command Line. |
(line 23) |
* running code (Interactive CLI): Interactive Command Line. |
4255,9 → 4465,9
* runtime.vapi: Global Data Structures. |
(line 62) |
* rx_channel (Ethernet configuration): Ethernet Configuration. |
(line 59) |
(line 67) |
* rxfile (Ethernet configuration): Ethernet Configuration. |
(line 68) |
(line 76) |
* sbp_bf_fwd (branch prediction configuration): Branch Prediction Configuration. |
(line 23) |
* sbp_bnf_fwd (branch prediction configuration): Branch Prediction Configuration. |
4336,8 → 4546,6
(line 12) |
* SME (power management register): Power Management Configuration. |
(line 16) |
* sockif (Ethernet configuration): Ethernet Configuration. |
(line 83) |
* sr (CPU configuration): CPU Configuration. (line 53) |
* stall (Interactive CLI): Interactive Command Line. |
(line 72) |
4362,6 → 4570,10
(line 24) |
* t (Interactive CLI): Interactive Command Line. |
(line 19) |
* TAP device creation: Setting Up a Persistent TAP device. |
(line 6) |
* tap_dev (Ethernet configuration): Ethernet Configuration. |
(line 93) |
* target test code: Regression Testing. (line 63) |
* TCP/IP port range: Verification API Configuration. |
(line 23) |
4384,9 → 4596,9
* toggle debug mode (Interactive CLI): Interactive Command Line. |
(line 151) |
* tx_channel (Ethernet configuration): Ethernet Configuration. |
(line 60) |
(line 68) |
* txfile (Ethernet configuration): Ethernet Configuration. |
(line 69) |
(line 77) |
* txfile (frame buffer configuration): Frame Buffer Configuration. |
(line 36) |
* txfile (VGA configuration): Display Interface Configuration. |
4433,7 → 4645,7
* vapi_id (debug interface configuration): Debug Interface Configuration. |
(line 43) |
* vapi_id (DMA configuration) <1>: Ethernet Configuration. |
(line 88) |
(line 99) |
* vapi_id (DMA configuration): DMA Configuration. (line 38) |
* vapi_id (GPIO configuration): GPIO Configuration. (line 32) |
* vapi_id (UART configuration): UART Configuration. (line 85) |
4455,56 → 4667,63
|
|
Tag Table: |
Node: Top830 |
Node: Installation1240 |
Node: Preparation1487 |
Node: Configuring the Build1782 |
Node: Build and Install7926 |
Node: Known Issues8704 |
Node: Usage9759 |
Node: Standalone Simulator9973 |
Node: Profiling Utility14537 |
Node: Memory Profiling Utility15447 |
Node: Simulator Library16812 |
Node: Configuration27217 |
Node: Configuration File Format27829 |
Node: Configuration File Preprocessing28214 |
Node: Configuration File Syntax28511 |
Node: Simulator Configuration31296 |
Node: Simulator Behavior31587 |
Node: Verification API Configuration36168 |
Node: CUC Configuration38108 |
Node: Core OpenRISC Configuration40100 |
Node: CPU Configuration40602 |
Node: Memory Configuration44721 |
Node: Memory Management Configuration51443 |
Node: Cache Configuration53820 |
Node: Interrupt Configuration56206 |
Node: Power Management Configuration58039 |
Node: Branch Prediction Configuration59316 |
Node: Debug Interface Configuration60676 |
Node: Peripheral Configuration63019 |
Node: Memory Controller Configuration63645 |
Node: UART Configuration67425 |
Node: DMA Configuration70944 |
Node: Ethernet Configuration72811 |
Node: GPIO Configuration76893 |
Node: Display Interface Configuration78526 |
Node: Frame Buffer Configuration80835 |
Node: Keyboard Configuration82699 |
Node: Disc Interface Configuration84937 |
Node: Generic Peripheral Configuration90041 |
Node: Interactive Command Line92336 |
Node: Verification API99310 |
Node: Code Internals103740 |
Node: Coding Conventions104323 |
Node: Global Data Structures108750 |
Node: Concepts111407 |
Ref: Output Redirection111552 |
Ref: Interrupts Internal112090 |
Node: Internal Debugging113243 |
Node: Regression Testing113767 |
Node: GNU Free Documentation License117556 |
Node: Index139963 |
Node: Top814 |
Node: Installation1224 |
Node: Preparation1471 |
Node: Configuring the Build1766 |
Node: Build and Install7910 |
Node: Known Issues8688 |
Node: Usage9743 |
Node: Standalone Simulator9988 |
Node: Profiling Utility14552 |
Node: Memory Profiling Utility15462 |
Node: Simulator Library16827 |
Node: Ethernet TUN/TAP Interface27267 |
Node: Setting Up a Persistent TAP device28350 |
Node: Establishing a Bridge29025 |
Node: Opening the Firewall30708 |
Node: Disabling Ethernet Filtering31199 |
Node: Networking from OpenRISC Linux and BusyBox31824 |
Node: Tearing Down a Bridge33486 |
Node: Configuration34229 |
Node: Configuration File Format34841 |
Node: Configuration File Preprocessing35226 |
Node: Configuration File Syntax35523 |
Node: Simulator Configuration38308 |
Node: Simulator Behavior38599 |
Node: Verification API Configuration43180 |
Node: CUC Configuration45120 |
Node: Core OpenRISC Configuration47112 |
Node: CPU Configuration47614 |
Node: Memory Configuration51733 |
Node: Memory Management Configuration58455 |
Node: Cache Configuration60832 |
Node: Interrupt Configuration63218 |
Node: Power Management Configuration65051 |
Node: Branch Prediction Configuration66328 |
Node: Debug Interface Configuration67688 |
Node: Peripheral Configuration70031 |
Node: Memory Controller Configuration70657 |
Node: UART Configuration74437 |
Node: DMA Configuration77956 |
Node: Ethernet Configuration79823 |
Node: GPIO Configuration84468 |
Node: Display Interface Configuration86101 |
Node: Frame Buffer Configuration88410 |
Node: Keyboard Configuration90274 |
Node: Disc Interface Configuration92512 |
Node: Generic Peripheral Configuration97616 |
Node: Interactive Command Line99911 |
Node: Verification API106885 |
Node: Code Internals111315 |
Node: Coding Conventions111898 |
Node: Global Data Structures116325 |
Node: Concepts118982 |
Ref: Output Redirection119127 |
Ref: Interrupts Internal119665 |
Node: Internal Debugging120818 |
Node: Regression Testing121342 |
Node: GNU Free Documentation License125131 |
Node: Index147538 |
|
End Tag Table |
/Makefile.in
1,4 → 1,4
# Makefile.in generated by automake 1.11 from Makefile.am. |
# Makefile.in generated by automake 1.11.1 from Makefile.am. |
# @configure_input@ |
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
/or1ksim.texi
86,9 → 86,9
build it: |
|
@example |
@kbd{tar jxf or1ksim-@value{VERSION}.tar.bz2} |
@kbd{mkdir builddir_or1ksim} |
@kbd{cd builddir_or1ksim} |
tar jxf or1ksim-@value{VERSION}.tar.bz2 |
mkdir builddir_or1ksim |
cd builddir_or1ksim |
@end example |
|
@node Configuring the Build |
102,7 → 102,7
default to OpenRISC 1000 32-bit with a warning |
|
@example |
@kbd{../or1ksim-@value{VERSION}/configure --target=or32-uclinux ...} |
../or1ksim-@value{VERSION}/configure --target=or32-uclinux ... |
@end example |
|
There are several other options available, many of which are standard |
183,7 → 183,7
@code{l.xori rD,rA,-1} |
@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). |
|
The default is to sign-extend, so that existing code will continue to |
234,7 → 234,7
@end table |
|
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 |
|
288,7 → 288,7
Build the tool with: |
|
@example |
@kbd{make all} |
make all |
@end example |
|
If you have the OpenRISC tool chain and DejaGNU installed, you can |
295,13 → 295,13
verify the tool as follows (otherwise omit this step): |
|
@example |
@kbd{make check} |
make check |
@end example |
|
Install the tool with: |
|
@example |
@kbd{make install} |
make install |
@end example |
|
This will install the three variations of the @value{OR1KSIM} tool, |
313,8 → 313,8
Postscript, DVI, HTML) with for example: |
|
@example |
@kbd{make pdf} |
@kbd{make install-pdf} |
make pdf |
make install-pdf |
@end example |
|
@node Known Issues |
327,7 → 327,7
@url{http://opencores.org/project,or1k,bugtracker}. |
|
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 |
@item |
353,6 → 353,7
* Profiling Utility:: |
* Memory Profiling Utility:: |
* Simulator Library:: |
* Ethernet TUN/TAP Interface:: |
@end menu |
|
@node Standalone Simulator |
453,7 → 454,7
bytes), megabytes (@math{2^{20}} bytes) and gigabytes (@math{2^{30}} |
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 |
up. This is the equivalent of specifying a configuration memory section |
with @code{baseaddr = 0} and @code{size = @var{size}} and all other |
476,7 → 477,7
specified, bus exceptions will be reported with a message to standard |
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. |
|
@item --strict-npc |
693,7 → 694,7
@end quotation |
|
@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 |
behavior of the WishBone bus. |
@end quotation |
836,7 → 837,7
Return @var{len} on success and 0 on failure. |
|
@quotation Note |
This function was added in Or1ksim 0.5.0. |
This function was added in @value{OR1KSIM} 0.5.0. |
@end quotation |
|
@end deftypefn |
849,7 → 850,7
Return @var{len} on success and 0 on failure. |
|
@quotation Note |
This function was added in Or1ksim 0.5.0. |
This function was added in @value{OR1KSIM} 0.5.0. |
@end quotation |
|
@end deftypefn |
861,7 → 862,7
@var{sprval_ptr}. Return non-zero on success and 0 on failure. |
|
@quotation Note |
This function was added in Or1ksim 0.5.0. |
This function was added in @value{OR1KSIM} 0.5.0. |
@end quotation |
|
@end deftypefn |
873,7 → 874,7
non-zero on success and 0 on failure. |
|
@quotation Note |
This function was added in Or1ksim 0.5.0. |
This function was added in @value{OR1KSIM} 0.5.0. |
@end quotation |
|
@end deftypefn |
886,7 → 887,7
failure. |
|
@quotation Note |
This function was added in Or1ksim 0.5.0. |
This function was added in @value{OR1KSIM} 0.5.0. |
@end quotation |
|
@end deftypefn |
898,7 → 899,7
@var{regnum}. Return non-zero on success and 0 on failure. |
|
@quotation Note |
This function was added in Or1ksim 0.5.0. |
This function was added in @value{OR1KSIM} 0.5.0. |
@end quotation |
|
@end deftypefn |
909,7 → 910,7
stalled). |
|
@quotation Note |
This function was added in Or1ksim 0.5.0. |
This function was added in @value{OR1KSIM} 0.5.0. |
@end quotation |
|
@end deftypefn |
957,6 → 958,198
|
@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 |
@chapter Configuration |
@cindex configuring @value{OR1KSIM} |
1908,7 → 2101,7
in the PICSR SPR. |
|
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. |
|
@item use_nmi = 0|1 |
2385,18 → 2578,18
@cindex configuring the Ethernet interface |
@cindex Ethernet configuration |
@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 |
section may appear multiple times, specifying multiple Ethernet |
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 |
|
@item enabled = 0|1 |
2435,21 → 2628,26
@cindex @code{dma} (Ethernet configuration) |
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) |
If 1 (true) use a socket interface to the Ethernet (see parameter |
@code{sockif} below). If 0 (the default), use a file interface, |
reading and writing from and to the files specified in the |
Specifies whether to use a TUN/TAP interface or file interface (the default) |
to model the external connection of the Ethernet. |
|
If a TUN/TAP interface is requested, Ethernet packets will be sent and |
received through the pesistent TAP interface specified in parameter |
@code{tap_dev} (see below). |
|
More details on configuring the TUN/TAP interface are given in the Usage |
section (@pxref{Ethernet TUN/TAP Interface, , Ethernet TUN/TAP |
Interface}). |
|
If a file interface (the default), is requested, the Ethernet will be |
modelled by reading and writing from and to the files specified in the |
@code{rxfile} and @code{txfile} parameters (see below). |
|
@quotation Note |
By default the socket interface is not provided in @value{OR1KSIM}. If |
it is required, this must be requested when configuring, by use of the |
@code{--enable-ethphy} option to @command{configure}. |
|
@example |
configure --target=or32-uclinux --enable-ethphy ... |
@end example |
@quotation Caution |
If a file interface is specified, @value{OR1KSIM} will terminate once the |
receive file specified by @code{rxfile} is exhausted. |
@end quotation |
|
@item rx_channel = @var{rxvalue} |
2482,12 → 2680,17
writable and will be created if necessary. If either of these |
conditions is not met, a warning will be given. |
|
@item sockif = "@var{service}" |
@cindex @code{sockif} (Ethernet configuration) |
When @code{rtx_type} is 1 (see above), @var{service} specifies the |
service to use for communication. This may be TCP/IP or UDP/IP. The |
default value of this parameter is @code{"or1ksim_eth"}. |
@quotation Caution |
@value{OR1KSIM} will terminate once the @var{rxfile} is exhausted. |
@end quotation |
|
@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} |
@cindex @code{vapi_id} (DMA configuration) |
@var{value} specifies the value of the Verification API (VAPI) base |
2497,7 → 2700,9
|
@item phy_addr = @var{value} |
@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 |
|
2748,7 → 2953,7
data bus. |
|
@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. |
@end quotation |
|
3782,10 → 3987,11
@item libsim.tests |
@itemx or1ksim.tests |
@cindex DejaGNU tests directories |
These are the directories of tests of the Or1ksim library. They also include |
@value{OR1KSIM} configuration files and each has a @file{Makefile.am} file. |
@file{Makefile.am} should be updated whenever files are added to this |
directory, to ensure they are included in the distribution. |
These are the directories of tests of the @value{OR1KSIM} library. They |
also include @value{OR1KSIM} configuration files and each has a |
@file{Makefile.am} file. @file{Makefile.am} should be updated whenever |
files are added to this directory, to ensure they are included in the |
distribution. |
|
@item test-code |
@cindex host test code |
/version.texi
1,4 → 1,4
@set UPDATED 25 November 2010 |
@set UPDATED-MONTH November 2010 |
@set EDITION 2010-11-26 |
@set VERSION 2010-11-26 |
@set UPDATED 8 December 2010 |
@set UPDATED-MONTH December 2010 |
@set EDITION 2010-12-08 |
@set VERSION 2010-12-08 |