README.rst
1Description
2-----------
3
4This is a demo showcasing hybrid emulation where part of the platform is emulated in Renode and part is run on an actual hardware.
5
6Architecture
7------------
8
9The system architecture is as follows:
10
11[Renode] <-TCP-> [litex_server] <-USB-> [FOMU]
12
13(1) Renode runs the emulation of LiteX+VexRiscv with an additional "led" peripheral of EtherBoneBridge type.
14(2) There is litex_server running on the host machine (outside the emulation).
15(3) The actual LED peripheral is located on the FOMU board.
16
17Renode communicates over sockets with litex_server using the EtherBone protocol.
18litex_server talks over USB with FOMU programmed with a bitstream containing the ValentyUSB IPCore with a USB-wishbone bridge.
19
20How to run it?
21--------------
22
230. Clone LiteX and Migen (required to start litex_server)::
24
25 git clone https://github.com/enjoy-digital/litex.git
26 git clone https://github.com/m-labs/migen.git
27
28 export PYTHONPATH=`pwd`/litex:`pwd`/migen
29
301. Attach FOMU to a USB port and verify in dmesg that it's recognized::
31
32 [3265038.250957] usb 2-1: new full-speed USB device number 16 using xhci_hcd
33 [3265038.409283] usb 2-1: New USB device found, idVendor=1209, idProduct=5bf0, bcdDevice= 1.01
34 [3265038.409286] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
35 [3265038.409287] usb 2-1: Product: Fomu DFU Bootloader v1.7.2-3-g9013054
36 [3265038.409288] usb 2-1: Manufacturer: Foosn
37
382. Start litex_server.py (shipped together with LiteX available at https://github.com/enjoy-digital/litex.git)::
39
40 cd litex
41 (sudo) python3 litex/tools/litex_server.py --usb --usb-vid 0x1209 --usb-pid 0x5bf0
42
43 This will start EtherBone server on 127.0.0.1:1234 by default. If you want to change the port, use --bin-port switch.
44
45 Note: To allow non-root users to access USB Fomu device, install an udev rule in your system::
46
47 sudo cp 99-fomu.rules /etc/udev/rules.d
48 sudo udevadm control --reload
49
503. Start Renode and run 'renode_etherbone_fomu.resc' script.
51
524. Once started use 'led_toggle' or 'led_breathe' commands in Zephyr's shell to control HW led from inside of the emulation!
53
54