Renode is a tool for hardware(HW) simulation. HW can be described on .repl files, such as peripheral properties, mem space and pins linkage.
sudo apt install mono-complete
sudo apt-get install policykit-1 libgtk2.0-0 screen uml-utilities gtk-sharp2 libc6-dev gcc python3 python3-pip
The instalation of renode could be done by git rep., compilation and instalation:
git clone https://github.com/renode/renode
...
cd renode
git submodule update --init --recursive
...
./build.sh -v
In renode environment there's those .repl files used to describe hardware architecture, such as special properties, memory allocation and linkage with other parts of hardware. Generaly it's described as peripherals, here there is an explanation on the systax.
Renode have some chips and boards implemented already, though it's possible to describe your own hardware, here there's a guide to describe custom peripherals.
When you run:
cd renode
./renode
if renode is on PATH:
renode
A terminal like GUI is open, and it seems like this:
There machines could be created, runned and dellete. For more information please refere to this. You also can run your first demo
, what is decribed here.
Using path/to/renode/plataforms/cpus/stm32f746.repl
as example and ST RM0433 Reference manual
for peripherals description:
This project have few implementations yet, so for general use, you must implement your hardware somehow. Here using a implementation as example, we try to exaplain how peripheral implementation works.
Using a GPIO as reference from /renode/src/Infrastructure/src/Emulator/Peripherals/Peripherals/GPIOPort/
, beggining with it's properties:
- DoubleWordRegister (
DWR
) is the base class for any 32 bits register, and DoubleWordRegisterCollection (DWRC
) is a set ofDWR
. - PinMode type is basicaly the pin input and output modes possibilities on a enum type.
- Registers type is a set of offsets from the peripheral offset for each register.
GPIOport constructor is presented on the following image:
On this example pins
and registers
are defined, highlighting the WithValueField(...)
method. The fields on registers and its actions are defined here by the callback functions. Like in the following image, multiple fields can be defined on each WithValueField(...)
call.
For reference, the WithValueField(...)
params order and explanation as following:
Following the especification of each GPIO register for STM32H750xB and renodes implementation: