├── README.md └── img ├── DWR_constructor.png ├── GPIO_methods.png ├── GPIO_port_constructor.png ├── GPIO_private_properties.png ├── multiple_fields_definition.png ├── renode_gui.png ├── stm32h7_permem.png ├── stm32h7_permem1.png ├── stm32h7_permem2.png ├── stm32h7_permem3.png ├── stm32h7_permem4.png ├── stm_gpio_afrh0.png ├── stm_gpio_afrh1.png ├── stm_gpio_afrl0.png ├── stm_gpio_afrl1.png ├── stm_gpio_bisetreset0.png ├── stm_gpio_bisetreset1.png ├── stm_gpio_inputdatar.png ├── stm_gpio_lckr0.png ├── stm_gpio_lckr1.png ├── stm_gpio_moder.png ├── stm_gpio_ospeedr.png ├── stm_gpio_otyper0.png ├── stm_gpio_otyper1.png ├── stm_gpio_outputdatar.png ├── stm_gpio_pupdr0.png ├── stm_gpio_pupdr1.png ├── sw_arch.png └── wvf_params.png /README.md: -------------------------------------------------------------------------------- 1 | # Renode startup guide 2 | 3 | Renode is a tool for hardware(HW) simulation. HW can be described on .repl files, 4 | such as peripheral properties, mem space and pins linkage. 5 | 6 | ## Dependencies for Ubuntu 20.04 LTS 7 | 8 | ```sh 9 | sudo apt install mono-complete 10 | 11 | sudo apt-get install policykit-1 libgtk2.0-0 screen uml-utilities gtk-sharp2 libc6-dev gcc python3 python3-pip 12 | ``` 13 | 14 | ## Instalation 15 | 16 | The instalation of renode could be done by 17 | [git rep.](https://github.com/renode/renode/releases/tag/v1.12.0), compilation 18 | and instalation: 19 | 20 | ```sh 21 | git clone https://github.com/renode/renode 22 | ... 23 | cd renode 24 | git submodule update --init --recursive 25 | ... 26 | ./build.sh -v 27 | ``` 28 | 29 | ## Plataforms 30 | 31 | 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](https://renode.readthedocs.io/en/latest/advanced/platform_description_format.html) there is an explanation on the systax. 32 | 33 | Renode have some chips and boards implemented already, though it's possible to describe your own hardware, [here](https://renode.readthedocs.io/en/latest/advanced/writing-peripherals.html) there's a guide to describe custom peripherals. 34 | 35 | ## Usage 36 | 37 | When you run: 38 | ```sh 39 | cd renode 40 | ./renode 41 | ``` 42 | if renode is on PATH: 43 | ```sh 44 | renode 45 | ``` 46 | A terminal like GUI is open, and it seems like this: 47 | 48 | ![](./img/renode_gui.png) 49 | 50 | There machines could be created, runned and dellete. For more information please refere to [this](https://renode.readthedocs.io/en/latest/introduction/using.html). You also can run your first `demo`, what is decribed [here](https://renode.readthedocs.io/en/latest/introduction/demo.html). 51 | 52 | ## Creating a custom .repl file for STM32H750 53 | 54 | Using `path/to/renode/plataforms/cpus/stm32f746.repl` as example and ST `RM0433 Reference manual` for peripherals description: 55 | 56 | ![](./img/stm32h7_permem.png) 57 | ![](./img/stm32h7_permem1.png) 58 | ![](./img/stm32h7_permem2.png) 59 | ![](./img/stm32h7_permem3.png) 60 | ![](./img/stm32h7_permem4.png) 61 | 62 | ## Creating a custom peripheral C# 63 | 64 | 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. 65 | 66 | Using a GPIO as reference from `/renode/src/Infrastructure/src/Emulator/Peripherals/Peripherals/GPIOPort/`, beggining with it's properties: 67 | 68 | ![](./img/GPIO_private_properties.png) 69 | 70 | - DoubleWordRegister (`DWR`) is the base class for any 32 bits register, and DoubleWordRegisterCollection (`DWRC`) is a set of `DWR`. 71 | - PinMode type is basicaly the pin input and output modes possibilities on a enum type. 72 | - Registers type is a set of offsets from the peripheral offset for each register. 73 | 74 | GPIOport constructor is presented on the following image: 75 | 76 | ![](./img/GPIO_port_constructor.png) 77 | 78 | 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. 79 | 80 | ![](./img/multiple_fields_definition.png) 81 | 82 | For reference, the `WithValueField(...)` params order and explanation as following: 83 | 84 | ![](./img/wvf_params.png) 85 | 86 | ### Implementing STM32H750xB GPIO peripheral 87 | 88 | Following the especification of each GPIO register for STM32H750xB and renodes implementation: 89 | 90 | ![](./img/stm_gpio_moder.png) 91 | 92 | --- 93 | 94 | ![](./img/stm_gpio_otyper0.png) 95 | ![](./img/stm_gpio_otyper1.png) 96 | 97 | --- 98 | 99 | ![](./img/stm_gpio_ospeedr.png) 100 | 101 | --- 102 | 103 | ![](./img/stm_gpio_inputdatar.png) 104 | 105 | --- 106 | 107 | ![](./img/stm_gpio_outputdatar.png) 108 | 109 | --- 110 | 111 | ![](./img/stm_gpio_bisetreset0.png) 112 | ![](./img/stm_gpio_bisetreset1.png) 113 | 114 | --- 115 | 116 | ![](./img/stm_gpio_lckr0.png) 117 | ![](./img/stm_gpio_lckr1.png) 118 | 119 | --- 120 | 121 | ![](./img/stm_gpio_afrl0.png) 122 | ![](./img/stm_gpio_afrl1.png) 123 | 124 | --- 125 | 126 | ![](./img/stm_gpio_afrh0.png) 127 | ![](./img/stm_gpio_afrh1.png) 128 | -------------------------------------------------------------------------------- /img/DWR_constructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/DWR_constructor.png -------------------------------------------------------------------------------- /img/GPIO_methods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/GPIO_methods.png -------------------------------------------------------------------------------- /img/GPIO_port_constructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/GPIO_port_constructor.png -------------------------------------------------------------------------------- /img/GPIO_private_properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/GPIO_private_properties.png -------------------------------------------------------------------------------- /img/multiple_fields_definition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/multiple_fields_definition.png -------------------------------------------------------------------------------- /img/renode_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/renode_gui.png -------------------------------------------------------------------------------- /img/stm32h7_permem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm32h7_permem.png -------------------------------------------------------------------------------- /img/stm32h7_permem1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm32h7_permem1.png -------------------------------------------------------------------------------- /img/stm32h7_permem2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm32h7_permem2.png -------------------------------------------------------------------------------- /img/stm32h7_permem3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm32h7_permem3.png -------------------------------------------------------------------------------- /img/stm32h7_permem4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm32h7_permem4.png -------------------------------------------------------------------------------- /img/stm_gpio_afrh0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_afrh0.png -------------------------------------------------------------------------------- /img/stm_gpio_afrh1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_afrh1.png -------------------------------------------------------------------------------- /img/stm_gpio_afrl0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_afrl0.png -------------------------------------------------------------------------------- /img/stm_gpio_afrl1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_afrl1.png -------------------------------------------------------------------------------- /img/stm_gpio_bisetreset0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_bisetreset0.png -------------------------------------------------------------------------------- /img/stm_gpio_bisetreset1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_bisetreset1.png -------------------------------------------------------------------------------- /img/stm_gpio_inputdatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_inputdatar.png -------------------------------------------------------------------------------- /img/stm_gpio_lckr0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_lckr0.png -------------------------------------------------------------------------------- /img/stm_gpio_lckr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_lckr1.png -------------------------------------------------------------------------------- /img/stm_gpio_moder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_moder.png -------------------------------------------------------------------------------- /img/stm_gpio_ospeedr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_ospeedr.png -------------------------------------------------------------------------------- /img/stm_gpio_otyper0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_otyper0.png -------------------------------------------------------------------------------- /img/stm_gpio_otyper1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_otyper1.png -------------------------------------------------------------------------------- /img/stm_gpio_outputdatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_outputdatar.png -------------------------------------------------------------------------------- /img/stm_gpio_pupdr0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_pupdr0.png -------------------------------------------------------------------------------- /img/stm_gpio_pupdr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/stm_gpio_pupdr1.png -------------------------------------------------------------------------------- /img/sw_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/sw_arch.png -------------------------------------------------------------------------------- /img/wvf_params.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tarciszera/renode_guide/ea16746940184694559e9b912c56e826ddb84749/img/wvf_params.png --------------------------------------------------------------------------------