summaryrefslogtreecommitdiff
path: root/sis.texi
diff options
context:
space:
mode:
authorJiri Gaisler <jiri@gaisler.se>2020-10-25 11:27:31 -0400
committerJiri Gaisler <jiri@gaisler.se>2020-10-28 13:38:31 -0400
commit66efed88eff45dca65661ab65327ee47f2732cfa (patch)
tree17d58ad35d7fa967347bd99bd4005721de2e8716 /sis.texi
parent511bfc5dd1b679e5a99850290ba29313995b0fb1 (diff)
Add networking support using host tap device2.23
* Emulation of GRETH 10/100 Mbit MAC and PHY * Supported only on linux
Diffstat (limited to 'sis.texi')
-rw-r--r--sis.texi121
1 files changed, 118 insertions, 3 deletions
diff --git a/sis.texi b/sis.texi
index abc7e68..51d20c8 100644
--- a/sis.texi
+++ b/sis.texi
@@ -50,6 +50,7 @@ This manual is for SIS (version @value{VERSION}, @value{UPDATED}).
* Commands ::
* Emulated Systems ::
* Multi-processing ::
+* Networking ::
* Interfacing to GDB ::
* Code coverage ::
* Building SIS ::
@@ -100,6 +101,9 @@ sis [options] [file]
The following options are recognized:
@table @code
+@item -bridge @var{bridge}
+Connect the tap device used for networking to the host @var{bridge}. Typical values are br0 or lxcbr0. Requires running SIS with sudo/root.
+
@item -c @var{file}
Read sis commands from @var{file} at startup.
@@ -142,6 +146,9 @@ Use @var{port} for the gdb server. Default is port 1234.
Start execution immediately without an interactive shell. This is useful
for automated testing.
+@item -rt
+Real-time mode. When enabled, the simulator tries to synchronize the simulator time to the wall (host) time. Useful for interactive programs. Enabled by default when networking is used.
+
@item -riscv
Emulate a RISC-V RV32IMACFD processor
@@ -576,8 +583,8 @@ A Ctrl-C in the simulator window will exit the power-down mode.
@section LEON3 emulation
In LEON3 mode, SIS emulates a LEON3 system as defined in the GRLIP IP manual.
-The emulated system includes the standard peripherals such as APBUART, GPTIMER, IRQMP and SRCTRL. The emulated system includes 16 Mbyte ROM
-and 16 Mbyte RAM. The SPARC emulation supports an FPU but not the LEON3 MMU.
+The emulated system includes the standard peripherals such as APBUART, GPTIMER, IRQMP and SRCTRL. The emulated system includes 32 Mbyte ROM
+and 32 Mbyte RAM. The SPARC emulation supports an FPU but not the LEON3 MMU.
To start sis in LEON3 mode, use the -leon3 switch.
@@ -591,6 +598,7 @@ The following IP cores from GRLIB are emulated in LEON3 mode:
@item APBUART @tab 0x80000100 @tab 3
@item IRQMP @tab 0x80000200 @tab -
@item GPTIMER @tab 0x80000300 @tab 8, 9
+@item GRETH @tab 0x80000B00 @tab 6
@end multitable
@subsection Memory interface
@@ -650,6 +658,113 @@ using -d <clocks>.
To start SIS with SMP, use the switch -m <n> when starting the simulator
where n can be 2 - 4.
+@node Networking
+@chapter Networking
+@cindex Networking
+@section Introduction
+SIS supports the emulation of the GRLIB/GRETH 10/100 Mbit network interface, for leon3 and RISC-V targets. The network interface creates a tun/tap interface on the host, through which ethernet packets can be sent and received.
+
+The tap device is automatically created when the application enables the GRETH core. The tap can optionally be connected to a host bridge using -bridge br0 or similar at invocation. Networking requires SIS to be run as root or with sudo.
+
+Networking is currently only supported on 64-bit linux hosts. On other hosts, the networking emaultion is disabled during compilation.
+
+@section Emulation of GRETH
+The 10/100 Mbit GRETH interface is emulated accurately and allows execution of unmodified target applications using the network interface. An ethernet PHY connected to the GRETH MDIO interface is also emulated and indicates 100 Mbit connection when accessed.
+
+The ethernet address of the host tap is equal to what the application programs into the GRETH MAC registers. Care has to be taken so that a valid ethernet address is choosen or the host can reject the address and a mismatch error will occur. The ethernet address cannot be changed once it has been set.
+
+DMA operation and interrupt generation operates as defind in the GRETH specification. There is no support for multi-cast or the EDCL debug support link.
+
+@section Usage
+To simplify operation, a bridge should be created on the linux host using brctl or similar. This will create an isolated environment for network applications. Installing the lxc package on the host will in most cases automatically create a bridge called lxcbr0 with subnet 10.0.3.1. The network applications should then be configured to use an IP on the bridge subnet. Below is an example of SIS runnig the ttcp performance application under RTEMS:
+
+@example
+$ sudo ./sis -riscv ./ttcp.exe -bridge lxcbr0
+
+ SIS - SPARC/RISCV instruction simulator 2.23
+ RISCV emulation enabled, 1 cpus online, delta 50 clocks
+ Loaded ttcp.exe, entry 0x40000000
+
+sis> run
+
+net: using tap0, ether 829991919191, bridge lxcbr0
+greth: driver attached
+**** PHY ****
+Vendor: 885 Device: 11 Revision: 2
+Current Operating Mode: 100 Mbit Full Duplex
+Autonegotiation Time: 0ms
+>>> ttcp -rs
+ttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5001 tcp
+ttcp-r: socket
+ttcp-r: accept from 10.0.3.1
+ttcp-r: 3012285 bytes in 0.53 real seconds = 5580.46 KB/sec +++
+ttcp-r: 453 I/O calls, msec/call = 1.19, calls/sec = 859.35
+ttcp-r: 0.0user 0.0sys 0:00real 100% 0i+0d 0maxrss 0+0pf 0+0csw
+-----------------------------------------------------------------------
+ CPU USAGE BY THREAD
+------------+--------------------------------+---------------+---------
+ ID | NAME | SECONDS | PERCENT
+------------+--------------------------------+---------------+---------
+ 0x09010001 | IDLE | 5.643012 | 91.406
+ 0x0a010001 | UI1 | 0.000000 | 0.000
+ 0x0a010002 | ntwk | 0.118958 | 1.926
+ 0x0a010003 | DCrx | 0.337919 | 5.472
+ 0x0a010004 | TTCP | 0.074758 | 1.210
+------------+--------------------------------+---------------+---------
+ TIME SINCE LAST CPU USAGE RESET IN SECONDS: 6.174651
+-----------------------------------------------------------------------
+************ MBUF STATISTICS ************
+mbufs:2048 clusters: 128 free: 96
+drops: 0 waits: 0 drains: 0
+ free:2015 data:33 header:0 socket:0
+ pcb:0 rtable:0 htable:0 atable:0
+ soname:0 soopts:0 ftable:0 rights:0
+ ifaddr:0 control:0 oobdata:0
+************ INTERFACE STATISTICS ************
+***** lo0 *****
+Address:127.0.0.1 Net mask:255.0.0.0
+Flags: Up Loopback Running Multicast
+Send queue limit:50 length:0 Dropped:0
+***** gr_eth1 *****
+Ethernet Address: 82:99:91:91:91:91
+Address:10.0.3.2 Broadcast Address:10.0.3.255 Net mask:255.255.255.0
+Flags: Up Broadcast Running Simplex
+Send queue limit:50 length:0 Dropped:0
+Rx Interrupts:186 Rx Packets:2234 Length:0 Non-octet:0
+Bad CRC:0 Overrun:0 Tx Interrupts:0 Maximal Frags:1 GBIT MAC:0
+************ IP Statistics ************
+ total packets received 2233
+ datagrams delivered to upper level 2233
+ total ip packets generated here 369
+************ TCP Statistics ************
+ connections accepted 1
+ connections established 1
+ conn. closed (includes drops) 1
+ segs where we tried to get rtt 2
+ times we succeeded 2
+ delayed acks sent 3
+ total packets sent 369
+ ack-only packets sent 5
+ window update-only packets sent 363
+ control (SYN|FIN|RST) packets sent 1
+ total packets received 2233
+ packets received in sequence 2230
+ bytes received in sequence 3012285
+ rcvd ack packets 2
+ bytes acked by rcvd acks 2
+ times hdr predict ok for data pkts 2228
+*** FATAL ***
+fatal source: 5 (RTEMS_FATAL_SOURCE_EXIT)
+fatal code: 0 (0x00000000)
+RTEMS version: 6.0.0.c1164b650a2754335b15910e6408a9b144aa5162
+RTEMS tools: 10.2.1 20200918 (RTEMS 6, RSB ed5030bc24dbfdfac52074ed78cf4231bf1f353d, Newlib 749cbcc)
+executing thread ID: 0x08a010004
+executing thread name: TTCP
+cpu 0 in error mode (tt = 0x101)
+ 445299412 4004af30: 00000073 ecall
+sis>
+@end example
+
@node Interfacing to GDB
@chapter Interfacing to GDB
@cindex Interfacing to GDB
@@ -691,7 +806,7 @@ manual, do @code{make sis.pdf}.
The following custom configure options are recognized:
@table @code
-@item -enable-l1cache
+@item --enable-l1cache
Enable the emulation of a L1 cache in multi-processor systems. Each core in an
MP LEON3/RISC-V system will have a 4Kbyte instruction cache and a 4 Kbyte data
cache. The cache only affects instruction timing, and has no effect on instruction