Skip to content

Generate Renode simulation

enjoy-digital edited this page Sep 27, 2023 · 5 revisions

LiteX provides a script for automatic generation of Renode scripts from the json file containing configuration of the LiteX SoC.

Renode

Renode was created by Antmicro as a virtual development tool for multinode embedded networks (both wired and wireless) and is intended to enable a scalable workflow for creating effective, tested and secure IoT systems.

With Renode, developing, testing, debugging and simulating unmodified software for IoT devices is fast, cost-effective and reliable.

For details, see the official webpage.

Usage

First, build your LiteX platform with --csr-json csr.json switch, e.g.:

python3 litex/boards/targets/arty.py --cpu-type vexriscv --with-ethernet --csr-json csr.json

Now, use the generated configuration file as an input for litex_json2renode.py:

litex_json2renode csr.json --resc litex.resc --repl litex.repl --bios-binary soc_ethernetsoc_arty/software/bios/bios.bin

This will generate two files:

  • litex.repl - platform definition file, containing information about all the peripherals and their configuration,
  • litex.resc - Renode script file, allowing to easily run the simulation of the generated platform.

Finally, you can run the simulation by executing the command:

renode litex.resc

Additional options

The script provides additional options. To discover them and get more informations execute:

./litex_json2renode.py --help

Supported LiteX components

The script can generate the following elements of the LiteX SoC:

  • uart,
  • timer0,
  • ethmac,
  • cas,
  • cpu,
  • spiflash,
  • spi,
  • ctrl,
  • i2c0,
  • sdphy,
  • spisdcard.
Clone this wiki locally