diff options
author | Jiri Gaisler <jiri@gaisler.se> | 2020-10-25 11:27:31 -0400 |
---|---|---|
committer | Jiri Gaisler <jiri@gaisler.se> | 2020-10-28 13:38:31 -0400 |
commit | 66efed88eff45dca65661ab65327ee47f2732cfa (patch) | |
tree | 17d58ad35d7fa967347bd99bd4005721de2e8716 /sis.info | |
parent | 511bfc5dd1b679e5a99850290ba29313995b0fb1 (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.info')
-rw-r--r-- | sis.info | 194 |
1 files changed, 172 insertions, 22 deletions
@@ -1,8 +1,8 @@ This is sis.info, produced by makeinfo version 6.5 from sis.texi. -This manual is for SIS (version 2.22, 31 May 2019). +This manual is for SIS (version 2.23, 25 October 2020). - Copyright (C) 2019 Free Software Foundation, Inc. + Copyright (C) 2020 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -21,7 +21,7 @@ File: sis.info, Node: Top, Next: Introduction, Up: (dir) SIS *** -This manual is for SIS (version 2.22, 31 May 2019). +This manual is for SIS (version 2.23, 25 October 2020). * Menu: @@ -30,6 +30,7 @@ This manual is for SIS (version 2.22, 31 May 2019). * Commands :: * Emulated Systems :: * Multi-processing :: +* Networking :: * Interfacing to GDB :: * Code coverage :: * Building SIS :: @@ -75,6 +76,11 @@ The simulator is started as follows: The following options are recognized: +'-bridge BRIDGE' + Connect the tap device used for networking to the host BRIDGE. + Typical values are br0 or lxcbr0. Requires running SIS with + sudo/root. + '-c FILE' Read sis commands from FILE at startup. @@ -118,6 +124,11 @@ The simulator is started as follows: Start execution immediately without an interactive shell. This is useful for automated testing. +'-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. + '-riscv' Emulate a RISC-V RV32IMACFD processor @@ -568,8 +579,8 @@ power-down mode. 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 +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. @@ -585,6 +596,7 @@ APBMAST 0x80000000 - APBUART 0x80000100 3 IRQMP 0x80000200 - GPTIMER 0x80000300 8, 9 +GRETH 0x80000B00 6 4.3.2 Memory interface ---------------------- @@ -637,7 +649,7 @@ time and timeh CSR. The timer does not generare any interrupt and the timecmp register is not implemented. -File: sis.info, Node: Multi-processing, Next: Interfacing to GDB, Prev: Emulated Systems, Up: Top +File: sis.info, Node: Multi-processing, Next: Networking, Prev: Emulated Systems, Up: Top 5 Multi-processing ****************** @@ -651,9 +663,145 @@ time-slices can be selected using -d <clocks>. simulator where n can be 2 - 4. -File: sis.info, Node: Interfacing to GDB, Next: Code coverage, Prev: Multi-processing, Up: Top +File: sis.info, Node: Networking, Next: Interfacing to GDB, Prev: Multi-processing, Up: Top + +6 Networking +************ + +6.1 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. + +6.2 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. + +6.3 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: + + $ 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> + + +File: sis.info, Node: Interfacing to GDB, Next: Code coverage, Prev: Networking, Up: Top -6 Interfacing to GDB +7 Interfacing to GDB ******************** SIS can be connected to gdb through a network socket using the gdb @@ -664,7 +812,7 @@ localhost:1234'. The port can be changed using the -port option. File: sis.info, Node: Code coverage, Next: Building SIS, Prev: Interfacing to GDB, Up: Top -7 Code coverage +8 Code coverage *************** Code coverage data will be produce if sis is started with the -cov @@ -689,7 +837,7 @@ i.e. the C-extension can not be used when code coverage is measured. File: sis.info, Node: Building SIS, Next: GNU Free Documentation License, Prev: Code coverage, Up: Top -8 Building SIS +9 Building SIS ************** SIS uses the GNU autoconf system, and can simply be build using @@ -698,7 +846,7 @@ do 'make sis.pdf'. The following custom configure options are recognized: -'-enable-l1cache' +'--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 @@ -1203,21 +1351,23 @@ Index * Introduction: Introduction. (line 6) * invoking sis: Invoking sis. (line 6) * Multi-processing: Multi-processing. (line 6) +* Networking: Networking. (line 5) * sis: Invoking sis. (line 6) Tag Table: -Node: Top696 -Node: Introduction1029 -Node: Invoking sis1653 -Node: Commands3706 -Node: Emulated Systems7810 -Node: Multi-processing20477 -Node: Interfacing to GDB20973 -Node: Code coverage21383 -Node: Building SIS22388 -Node: GNU Free Documentation License23037 -Node: Index48181 +Node: Top700 +Node: Introduction1053 +Node: Invoking sis1677 +Node: Commands4109 +Node: Emulated Systems8213 +Node: Multi-processing20925 +Node: Networking21413 +Node: Interfacing to GDB27723 +Node: Code coverage28127 +Node: Building SIS29132 +Node: GNU Free Documentation License29782 +Node: Index54926 End Tag Table |