Renode, Fomu and EtherBone bridge example¶
This tutorial shows how to run a hybrid simulation where part of the platform is run in Renode and part on FPGA hardware.
The system architecture consists of three main parts:
For the simulation part, you need to build Renode from sources according to the building instructions.
For the hardware part, you need to have the FOMU board.
Clone the repository and initialize the environment:
git clone https://github.com/enjoy-digital/litex cd litex ./litex_setup.py init # this will clone dependencies export PYTHONPATH=`pwd`:`pwd`/litex:`pwd`/migen
Loading the bitstream¶
Download and make iceprog - open source programming software for Lattice iCE40:
git clone https://github.com/cliffordwolf/icestorm cd icestorm/iceprog make
Download the prebuilt bitstream:
wget https://antmicro.com/projects/renode/foboot-bitstream.bin-s_104250-fc5f419372eb9a3a0baa5556483163bcfccb7d33 -O foboot-bitstream.bin
You can also build the bitstream yourself by following the instructions on the Foboot page.
Program the FPGA:
sudo iceprog foboot-bitstream.bin
Runnning the demo¶
Plug FOMU into a USB port and verify that it has been recognized by looking at
[65038.250957] usb 2-1: new full-speed USB device number 16 using xhci_hcd [65038.409283] usb 2-1: New USB device found, idVendor=1209, idProduct=5bf0, bcdDevice= 1.01 [65038.409286] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [65038.409287] usb 2-1: Product: Fomu DFU Bootloader v1.7.2-3-g9013054 [65038.409288] usb 2-1: Manufacturer: Foosn
Start the EtherBone bridge from the LiteX repository:
cd litex sudo python3 litex/tools/litex_server.py --usb --usb-vid 0x1209 --usb-pid 0x5bf0
Run the Zephyr OS image in simulation using the script shipped with Renode:
(monitor) start @scripts/complex/fomu/renode_etherbone_fomu.resc
Now you can control the HW LED form Zephyr’s shell using special commands:
uart:~$ led_toggle uart:~$ led_breathe
- toggles the green led
- makes the blue led blink with a fade-in/fade-out effect