### Start Emulation Source: https://github.com/renode/renode-docs/blob/master/source/basic/control.md Use the 'start' command to begin emulation. Emulation starts in a paused state. ```none (machine-0) start Starting emulation... ``` -------------------------------- ### Start USB/IP Server and Attach ArduinoLoader Source: https://github.com/renode/renode-docs/blob/master/source/host-integration/arduino.md Starts the USB/IP server in Renode and attaches the ArduinoLoader pseudo-device to it. ```none (machine-0) emulation CreateUSBIPServer (machine-0) host.usb CreateArduinoLoader sysbus.cpu 0x10000 0 "arduinoLoader" ``` -------------------------------- ### Start Renode Script Immediately Source: https://github.com/renode/renode-docs/blob/master/source/introduction/using.md Use the `start` command (or `s`) instead of `include` to load and immediately begin emulation with a Renode script. ```default start @scripts/single-node/quark_c1000.resc ``` -------------------------------- ### Install libfuse for directory sharing Source: https://github.com/renode/renode-docs/blob/master/source/host-integration/sharing-files.md Clone the libfuse repository, navigate to the directory sharing example, and build the passthrough filesystem daemon using Meson and Ninja. This daemon is required for directory sharing. ```bash $ git clone https://github.com/antmicro/libfuse --branch passthrough-hp-uds $ cd renode-filesystem-sharing-libfuse $ mkdir build; cd build $ meson setup .. $ ninja ``` -------------------------------- ### Start TFTP Server in Renode Source: https://github.com/renode/renode-docs/blob/master/source/host-integration/sharing-files.md Configure and start the TFTP server in Renode. This involves creating a network server, connecting it to a switch, and starting the TFTP service on a specified port. ```none emulation CreateNetworkServer "server" "192.168.100.100" connector Connect server switch server StartTFTP 69 ``` -------------------------------- ### Set up Virtual Environment and Install Dependencies Source: https://github.com/renode/renode-docs/blob/master/source/execution-tracing/coverage-report.md Initialize a virtual environment and install the necessary Python dependencies for the execution tracer script when invoking it directly from the Renode directory. ```sh python3 -m venv .venv source .venv/bin/activate python3 -m pip install -r ${RENODE_PATH}/tools/execution_tracer/requirements.txt ``` -------------------------------- ### Start Emulation in Renode Source: https://github.com/renode/renode-docs/blob/master/source/introduction/using.md Initiate the emulation process within Renode by using the 'start' command in the Monitor CLI. This command begins the execution of the configured emulated environment. ```none start ``` -------------------------------- ### UART Output Example Source: https://github.com/renode/renode-docs/blob/master/source/host-integration/arduino.md This is an example of the output you should expect to see on the UART after starting the simulation. ```default 123 123 128 128 128 128 135 135 135 135 136 136 136 136 141 141 141 141 142 142 142 142 148 148 148 148 153 153 153 153 155 165 165 165 168 168 168 172 172 172 172 173 173 173 173 178 178 178 178 178 178 178 178 178 178 178 178 181 181 181 181 184 184 ``` -------------------------------- ### Start Emulation Manually Source: https://github.com/renode/renode-docs/blob/master/source/debugging/gdb.md Starts emulation from Renode's monitor after GDB has connected. This is followed by a 'continue' command in GDB. ```none (machine-0) start ``` ```default (gdb) continue ``` -------------------------------- ### Start Emulation via GDB Monitor Command Source: https://github.com/renode/renode-docs/blob/master/source/debugging/gdb.md Passes the 'start' command to Renode's monitor directly from GDB, followed by 'continue'. ```default (gdb) monitor start (gdb) continue ``` -------------------------------- ### Start GDB Server with Autostart Emulation Source: https://github.com/renode/renode-docs/blob/master/source/debugging/gdb.md Starts a GDB server that automatically begins emulation as soon as GDB connects. Useful for simple scenarios. ```none (machine-0) machine StartGdbServer 3333 true ``` -------------------------------- ### Renode Simulation Script Example Source: https://github.com/renode/renode-docs/blob/master/source/debugging/vscode.md This script specifies the ELF file to load and starts a GDB server on port 3333. Adjust the 'bin' variable to point to your executable. ```renode $bin ?= $CWD/build/zephyr/zephyr.elf include @scripts/single-node/nrf52840.resc machine StartGdbServer 3333 ``` -------------------------------- ### Compiling the 'Hello World' Example Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/co-simulating-custom-hdl.md This shell command compiles the 'Hello World' example with UART output enabled. Ensure the `PULPRT_HOME` environment variable is set and the SDK is configured. ```sh make all io=uart ``` -------------------------------- ### Starting Renode and Loading Script Source: https://github.com/renode/renode-docs/blob/master/source/advanced/loading-assembly-to-memory.md Commands to start Renode and load a Renode script file. ```bash $ renode asm.resc (monitor) i $CWD/test.resc (machine-0) ``` -------------------------------- ### Install Custom Instruction Handler from File Source: https://github.com/renode/renode-docs/blob/master/source/basic/using-python.md Install a custom instruction handler by providing the instruction's opcode and the path to a Python file containing the handler logic. ```none (machine) sysbus.cpu InstallCustomInstructionHandlerFromFile "10110011100011110000111110000010" "path/to/file.py" ``` -------------------------------- ### Start Renode Simulation and Show UART Source: https://github.com/renode/renode-docs/blob/master/source/host-integration/arduino.md Commands to start the simulation and attach a analyzer to the UART for observing output. ```none (machine-0) showAnalyzer sysbus.uart0 (machine-0) start ``` -------------------------------- ### Install peakrdl-renode Tool Source: https://github.com/renode/renode-docs/blob/master/source/advanced/writing-peripherals.md These commands set up a Python virtual environment and install the necessary tools for using peakrdl-renode. ```sh python3 -m venv .venv source .venv/bin/activate pip install peakrdl pip install git+https://github.com/renode/renode/#subdirectory=tools/PeakRDL-renode ``` -------------------------------- ### Install Metrics Visualizer Prerequisites Source: https://github.com/renode/renode-docs/blob/master/source/basic/metrics.md Installs the necessary Python packages for the metrics visualization layer. Run this command from the root Renode directory. ```sh python3 -m pip install --user -r tools/metrics_analyzer/metrics_visualizer/requirements.txt ``` -------------------------------- ### List of Integers Example Source: https://github.com/renode/renode-docs/blob/master/source/advanced/platform_description_format.md Demonstrates the syntax for defining a list of integers. ```none [1, 2, 3] ``` -------------------------------- ### Install Prerequisites for Android Emulator Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/ble-hci-integration.md Installs the Java Runtime Environment and other necessary tools on Debian-based systems for setting up the Android Emulator. ```sh sh sudo apt install default-jre unzip wget ``` -------------------------------- ### Install Custom Instruction Handler from String Source: https://github.com/renode/renode-docs/blob/master/source/basic/using-python.md Use this command to install a custom instruction handler directly from a string defining the instruction's opcode and the Python code to execute. ```none (machine) sysbus.cpu InstallCustomInstructionHandlerFromString "10110011100011110000111110000010" "cpu.DebugLog('custom instruction executed!')" ``` -------------------------------- ### Start GDB Server with a Single CPU Source: https://github.com/renode/renode-docs/blob/master/source/debugging/gdb.md Creates a GDB server on port 3333 with autostart enabled, specifically attaching 'sysbus.cpu1'. ```none (machine-0) machine StartGdbServer 3333 true sysbus.cpu1 ``` -------------------------------- ### Start vmnet-helper Process Source: https://github.com/renode/renode-docs/blob/master/source/networking/host-network.md Starts the vmnet-helper background process on macOS with specified network parameters. This configures the VMNET interface for Renode simulations. ```sh vmnet_helper \ --socket=${SOCKET_PATH:-vmnet_helper.sock} \ --operation-mode=${mode:-shared} \ --start-address=${start_ipv4:-172.16.0.0} \ --end-address=${end_ipv4:-172.16.0.10} \ --subnet-mask=${mask:-255.240.0.0} ``` -------------------------------- ### Start Paused TAP and VMNET Interfaces Source: https://github.com/renode/renode-docs/blob/master/source/networking/host-network.md Commands to manually start paused TAP and VMNET interfaces, enabling communication between the host and the guest system. ```none (monitor) start ``` ```none (monitor) host.tap Start ``` ```none (monitor) host.vmnet Start ``` -------------------------------- ### Install Core Dependencies on Ubuntu Source: https://github.com/renode/renode-docs/blob/master/source/advanced/building_from_sources.md Installs essential build tools and libraries required for compiling Renode on Debian-based systems. ```bash sudo apt update sudo apt install git automake cmake autoconf libtool g++ coreutils policykit-1 libgtk-3-dev uml-utilities gtk-sharp3 python3 python3-pip ``` -------------------------------- ### Configure UART Peripheral Parameters Source: https://github.com/renode/renode-docs/blob/master/source/basic/describing_platforms.md This example demonstrates setting constructor parameters and properties for a peripheral, such as the clock frequency for a UART. ```none uart0: UART.MiV_CoreUART @ sysbus 0x80000000 clockFrequency: 66000000 ``` -------------------------------- ### Get Detailed Help for a Renode Monitor Command Source: https://github.com/renode/renode-docs/blob/master/source/introduction/using.md To get more information about a specific command, use the 'help' command followed by the command name. This provides usage details and arguments. ```none (monitor) help analyzers Usage: ------ analyzers [peripheral] lists ids of available analyzer for [peripheral] analyzers default [peripheral] writes id of default analyzer for [peripheral] ``` -------------------------------- ### Install Execution Tracer Script with pipx Source: https://github.com/renode/renode-docs/blob/master/source/execution-tracing/coverage-report.md Install the execution tracer script as a CLI utility using pipx for easy access to its commands. ```sh pipx install tools/execution_tracer/ ``` -------------------------------- ### Include Platform File with Absolute Path Source: https://github.com/renode/renode-docs/blob/master/source/basic/describing_platforms.md This example shows how to include a platform file using an absolute path. ```default using "/tmp/platform.repl" ``` -------------------------------- ### Indentation Equivalence Example Source: https://github.com/renode/renode-docs/blob/master/source/advanced/platform_description_format.md Illustrates the equivalence between meaningful indentation and curly brace syntax in Renode's platform description format. ```none line1 line2 line3 line4 line5 line6 ``` ```none line1 line2 { line3; line4 { line5 }; line 6 } ``` -------------------------------- ### Get Help for a Command Source: https://github.com/renode/renode-docs/blob/master/source/basic/monitor-syntax.md Use the `help` command followed by a specific command name to get detailed information about its usage and parameters. ```default help start ``` -------------------------------- ### Get Help in Renode Monitor Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/miv-example.md Type 'help' to get a list of built-in Monitor commands. Use 'help builtin_command_name' for specific command documentation. ```none help ``` ```none help builtin_command_name ``` -------------------------------- ### Start Simulation with Port Numbers Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/co-simulating-custom-hdl.md In the main function, call the simulate function with two port numbers. These numbers are passed as command-line arguments when starting the Verilated peripheral. ```cpp Init(); uart->simulate(atoi(argv[1]), atoi(argv[2])); ``` -------------------------------- ### Start filesystem daemon Source: https://github.com/renode/renode-docs/blob/master/source/host-integration/sharing-files.md Launch the passthrough filesystem daemon from the libfuse build. This command starts the daemon and specifies the host directory to be shared. A Unix domain socket will be created for communication. ```bash $ passthrough_hp_uds path_to_share ``` -------------------------------- ### Start Fomu Emulation in Renode Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/usbip.md Begins the emulation of the configured Fomu platform and Foboot software within Renode. ```none (machine-0) start ``` -------------------------------- ### Install Opcode Counter Patterns Source: https://github.com/renode/renode-docs/blob/master/source/execution-tracing/metrics-and-profiling.md Installs specific opcode counter patterns. The first argument is the counter name (e.g., 'bl', 'b'), and the second is a bitmask pattern to match the opcode. ```none cpu InstallOpcodeCounterPattern "bl" "****1011************************" ``` ```none cpu InstallOpcodeCounterPattern "b" "****1010************************" ``` -------------------------------- ### Get All Opcode Counters Source: https://github.com/renode/renode-docs/blob/master/source/execution-tracing/metrics-and-profiling.md Prints the current counts for all installed opcode counters to the Monitor window. Displays the opcode name and its corresponding execution count. ```none cpu GetAllOpcodesCounters ``` -------------------------------- ### Run STM32F4 Discovery Demo Source: https://github.com/renode/renode-docs/blob/master/source/introduction/demo.md Use the `start` command with the script path to run the single-node STM32F4 Discovery demo. Tab autocompletion can help discover available demos. ```none s @scripts/single-node/stm32f4_discovery.resc ``` -------------------------------- ### Get Samples within a Time Range Source: https://github.com/renode/renode-docs/blob/master/source/basic/resd.md Retrieves samples from a specific block within a RESD file between a given start time and end time. Useful for extracting specific data points for analysis. ```none (monitor) resd get-samples-range r1 2 "2.2" "2.3" 00:00:02.203125: [0, 0, 0.1] g 00:00:02.218750: [0, 0, 0.2] g 00:00:02.234375: [0, 0, 0.3] g 00:00:02.250000: [0, 0, 0.2] g 00:00:02.265625: [0, 0, 0.2] g 00:00:02.281250: [0, 0, 0.1] g 00:00:02.296875: [0, 0, 0.0] g ``` -------------------------------- ### Start a switch Source: https://github.com/renode/renode-docs/blob/master/source/networking/wired.md Starts the 'switch1' object to enable communication. This can be done either by starting the entire emulation or by starting the switch individually. ```default (monitor) start ``` ```none (machine-0) switch1 Start ``` -------------------------------- ### Create a New Machine Source: https://github.com/renode/renode-docs/blob/master/source/basic/machines.md Use 'mach create' to add a new emulated machine. If no name is provided, it will be indexed sequentially starting from 0. ```default (monitor) mach create (machine-0) ``` -------------------------------- ### Build HTML Documentation Source: https://github.com/renode/renode-docs/blob/master/README.rst Run this command to build the documentation as HTML. ```bash make html ``` -------------------------------- ### Set up Android SDK and Emulator Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/ble-hci-integration.md This script downloads and installs the latest Android SDK command-line tools and the Android Emulator. It configures necessary environment variables and creates an Android Virtual Device (AVD). ```sh export BASE_PATH=$HOME export ANDROID_HOME=$BASE_PATH/android-sdk export CMDLINE_TOOLS_DIR=$ANDROID_HOME/cmdline-tools export SDK_LATEST=$CMDLINE_TOOLS_DIR/latest export EMULATOR_DIR=$ANDROID_HOME/emulator export PLATFORM_TOOLS_DIR=$ANDROID_HOME/platform-tools export PATH=$PATH:$EMULATOR_DIR:$PLATFORM_TOOLS_DIR:$SDK_LATEST/bin/ export ANDROID_AVD_HOME=$ANDROID_HOME/system-images export TEMP_CMDLINE_ZIP=$CMDLINE_TOOLS_DIR/commandlinetools.zip export TEMP_EMULATOR_ZIP=$ANDROID_HOME/emulator.zip mkdir -p $CMDLINE_TOOLS_DIR # https://developer.android.com/studio#command-tools CMD_DOWNLOAD_URL=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip wget -O $TEMP_CMDLINE_ZIP $CMD_DOWNLOAD_URL unzip $TEMP_CMDLINE_ZIP -d $CMDLINE_TOOLS_DIR mv $CMDLINE_TOOLS_DIR/cmdline-tools $SDK_LATEST rm $TEMP_CMDLINE_ZIP yes | sdkmanager --licenses sdkmanager --install "platform-tools" sdkmanager --install "platforms;android-34" # https://developer.android.com/studio/emulator_archive EMULATOR_VERSION=33.1.14 EMULATOR_DOWNLOAD_URL=https://redirector.gvt1.com/edgedl/android/repository/emulator-linux_x64-9997245.zip wget -O $TEMP_EMULATOR_ZIP $EMULATOR_DOWNLOAD_URL unzip $TEMP_EMULATOR_ZIP -d $ANDROID_HOME rm $TEMP_EMULATOR_ZIP sdkmanager --install "system-images;android-34;google_apis;x86_64" export AVD_NAME_0=Android0 echo "no" | avdmanager --verbose create avd -n $AVD_NAME_0 -k "system-images;android-34;google_apis;x86_64" ``` -------------------------------- ### Start UART Hub Source: https://github.com/renode/renode-docs/blob/master/source/networking/machine-to-machine-connections.md Starts a UART hub to enable data transfer between connected UART devices. This can be done automatically when starting the simulation or manually for a running simulation. ```none (monitor) start (monitor) uartHub Start ``` -------------------------------- ### Install vmnet-helper on older macOS Source: https://github.com/renode/renode-docs/blob/master/source/networking/host-network.md Installs the vmnet-helper program on older macOS versions by downloading and executing an installation script. This is a prerequisite for using VMNET interfaces in Renode on macOS. ```sh curl -fsSL https://github.com/nirs/vmnet-helper/releases/latest/download/install.sh | bash ``` -------------------------------- ### Create Fomu Platform Instance in Renode Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/usbip.md Initializes a new virtual machine instance and loads the Fomu platform description in Renode. ```none (monitor) mach create (machine-0) machine LoadPlatformDescription @platforms/cpus/fomu.repl ``` -------------------------------- ### Install Core Dependencies on macOS Source: https://github.com/renode/renode-docs/blob/master/source/advanced/building_from_sources.md Installs necessary build tools using Homebrew for macOS systems. ```bash brew install binutils gnu-sed coreutils dialog cmake xcode-select --install ``` -------------------------------- ### Build PDF Documentation Source: https://github.com/renode/renode-docs/blob/master/README.rst Run this command to build the documentation as a PDF file. ```bash make latexpdf ``` -------------------------------- ### Include peripheral model from C# source Source: https://github.com/renode/renode-docs/blob/master/source/advanced/platform_description_format.md This example shows how a `preinit` block can include a C# source file, likely to compile a peripheral model before its instantiation. ```none peripheral: MyPeripheral @ sysbus 0x0 preinit: include @MyPeripheral.cs ``` -------------------------------- ### Install Robot Framework Test Dependencies Source: https://github.com/renode/renode-docs/blob/master/source/advanced/building_from_sources.md Installs Python packages required for running Robot Framework tests. ```bash python3 -m pip install -r tests/requirements.txt ``` -------------------------------- ### Install pyusb for EtherBone Bridge Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/fomu-example.md Install the pyusb package, which is a dependency for the litex_server.py script to function correctly with USB devices. ```bash pip3 install pyusb ``` -------------------------------- ### Platform definition with multiple usings Source: https://github.com/renode/renode-docs/blob/master/source/advanced/platform_description_format.md Example demonstrating how multiple `using` entries are processed before local definitions. Later `using` files and entries override earlier ones. ```none // myplatform.repl using "a.repl" using "b.repl" variable: SomeType ``` -------------------------------- ### GDB Assembly and Register View Example Source: https://github.com/renode/renode-docs/blob/master/source/advanced/loading-assembly-to-memory.md An example of the GDB TUI showing assembly instructions and register values during execution. ```gdb ┌─Register group: general────────────────────────────────────────────────────────────────────────────────────┐ │zero 0x0 0 ra 0x0 0x0 │ │sp 0x0 0x0 gp 0x0 0x0 │ tp 0x0 0x0 tp 0x0 0x0 │ fp 0x0 0x0 s1 0x0 0 │ a0 0x0 0 a1 0x0 0 │ a2 0x0 0 a3 0x0 0 │└────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ │ >0x100b0 <_start> lui a0,0x64 │ 0x100b4 <_start+4> li a2,5 │ 0x100b6 <_start+6> sw zero,0(a0) │ 0x100ba <_start+10> lw a4,0(a0) │ 0x100bc <_start+12> sw a2,0(a0) │ 0x100be <_start+14> lw a4,0(a0) │ 0x100c0 j 0x100c0 │ 0x100c2 unimp │└────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ remote Thread 1 (asm) In: _start L?? PC: 0x100b0 (gdb) ``` -------------------------------- ### Create and Select Machine Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/miv-example.md Use 'mach create' to create a new machine and switch the Monitor's context to it. Use 'mach set' to switch to an existing machine by its number or name. ```none mach create ``` ```none mach set 1 ``` ```none mach set "MI-V" ``` -------------------------------- ### Install vmnet-helper on macOS Source: https://github.com/renode/renode-docs/blob/master/source/networking/host-network.md Installs the vmnet-helper program on macOS using Homebrew. This is a prerequisite for using VMNET interfaces in Renode on macOS. ```sh brew install nirs/vmnet-helper/vmnet-helper ``` -------------------------------- ### Load Platform Description Source: https://github.com/renode/renode-docs/blob/master/source/basic/machines.md Use 'machine LoadPlatformDescription' followed by the path to the platform file to configure a machine with its peripherals. ```none (machine-0) machine LoadPlatformDescription @platforms/cpus/miv.repl (machine-0) ``` -------------------------------- ### Basic Renode Monitor Script Example Source: https://github.com/renode/renode-docs/blob/master/source/basic/monitor-syntax.md This script sets up a Renode environment for the nRF52840, loads a platform description, a Zephyr shell binary, and configures an UART analyzer. ```renode :name: nRF52840 :description: This script runs Zephyr Shell demo on NRF52840. using sysbus mach create machine LoadPlatformDescription @platforms/cpus/nrf52840.repl $bin?=@https://dl.antmicro.com/projects/renode/renode-nrf52840-zephyr_shell_module.elf-gf8d05cf-s_1310072-c00fbffd6b65c6238877c4fe52e8228c2a38bf1f showAnalyzer uart0 macro reset """ sysbus LoadELF $bin """ runMacro $reset ``` -------------------------------- ### Using Commands with Parameters Source: https://github.com/renode/renode-docs/blob/master/source/basic/monitor-syntax.md Many commands require you to specify a parameter after the command name. This example shows the `using sysbus` command, which is often a prerequisite for other commands. ```none using sysbus ``` -------------------------------- ### Install Packaging Prerequisites on Linux Source: https://github.com/renode/renode-docs/blob/master/source/advanced/building_from_sources.md Installs necessary Ruby and RPM tools required for creating native packages on Debian/Ubuntu-based Linux distributions. ```bash sudo apt-get install ruby ruby-dev rpm 'bsdtar|libarchive-tools' sudo gem install fpm ``` -------------------------------- ### Create USB/IP Server in Renode Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/usbip.md Use this command in the Renode monitor to create a USB/IP server instance. This will create a `host.usb` device and start the server. ```text (monitor) emulation CreateUSBIPServer ``` -------------------------------- ### Implement Peripheral Initialization and Callbacks Source: https://github.com/renode/renode-docs/blob/master/source/advanced/writing-peripherals.md This C# code demonstrates implementing the Init, Reset, and AttachCallbacks methods for a custom peripheral in Renode. It shows how to attach callbacks to register fields to implement custom logic and logging. ```csharp using Antmicro.Renode.Core.Structure.Registers; using Antmicro.Renode.Peripherals.Bus; using Antmicro.Renode.Logging; public partial class MyPeripheral { partial void Init() { // Add you logic here // This is an example of custom logic, achieved by attaching callbacks to registers AttachCallbacks(); this.Reset(); } partial void Reset() { // Add your logic here secondVal = 0; } private void AttachCallbacks() { // Example of callbacks attached to a register, implementing behavioral logic this.Registers_BitFields.FIRST.ValueProviderCallback += (val) => { this.Log(LogLevel.Debug, "Previous FIRST value: {0}", val); // Test low bit of "secondVal" return (secondVal & 1) == 1; }; this.Registers_BitFields.SECOND.WriteCallback += (old_val, new_val) => { secondVal = new_val + 1; this.Log(LogLevel.Debug, "second_val: {0} -> {1}", old_val, secondVal); }; } private ulong secondVal; } ``` -------------------------------- ### Legacy Coverage Report Output Example Source: https://github.com/renode/renode-docs/blob/master/source/execution-tracing/coverage-report.md Example output format for the legacy text-based coverage report, showing line numbers and execution counts. ```c 0: const int buf_size = 100; 0: 28: void funB(int *buf, int b) { 2828: for (int i = 0; i < buf_size; i++) { 2800: buf[i] -= b; 0: } 28: } 0: 0: void funA(int *buf, int b); 0: void funC(); 0: 2: void buf_increment_all(int *buf) { 202: for (int i = 0; i < buf_size; i++) { 200: buf[i] += 1; 0: } 2: } ... ``` -------------------------------- ### Start EtherBone Bridge Server Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/fomu-example.md Launch the EtherBone bridge server using litex_server.py, specifying the USB VID and PID for the Fomu device. This establishes the communication link between Renode and the hardware. ```bash cd litex sudo python3 litex/tools/litex_server.py --usb --usb-vid 0x1209 --usb-pid 0x5bf0 ``` -------------------------------- ### Start GDB Server for a Specific CPU Cluster Source: https://github.com/renode/renode-docs/blob/master/source/debugging/gdb.md Starts a GDB server on port 3333 with autostart enabled, targeting CPUs within the 'cortex-r5f' cluster. ```none (machine-0) machine StartGdbServer 3333 true cpuCluster="cortex-r5f" ``` -------------------------------- ### Start a New GDB Server with a Different CPU Source: https://github.com/renode/renode-docs/blob/master/source/debugging/gdb.md Initiates a new GDB server on port 3334, attaching 'sysbus.cpu3' with autostart enabled. This creates a separate debugging session. ```none (machine-0) machine StartGdbServer 3334 true sysbus.cpu3 ``` -------------------------------- ### Start Renode in Telnet Mode Source: https://github.com/renode/renode-docs/blob/master/source/basic/running.md Use the `-P` switch to start Renode with the Monitor interface available over a network socket. This allows remote control of the simulation. ```default $ renode -P 1234 17:01:20.6362 [INFO] Loaded monitor commands from: /home/antmicro/renode/scripts/monitor.py 17:01:20.6800 [INFO] Monitor available in telnet mode on port 1234 17:02:17.2373 [INFO] Script: hello ``` -------------------------------- ### Enable Guest Profiler (Perfetto) Source: https://github.com/renode/renode-docs/blob/master/source/execution-tracing/metrics-and-profiling.md A shortcut command to enable the profiler with the Perfetto output format. ```none cpu EnableProfilerPerfetto ``` -------------------------------- ### Using btproxy with TCP Server Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/ble-hci-integration.md This command starts btproxy as a TCP server, allowing Renode to connect to it. Ensure the ports match your Renode configuration. ```none sudo ./tools/btproxy -l127.0.0.1 -p1000 -i 0 socat TCP-CONNECT:127.0.0.1:3456 TCP-CONNECT:127.0.0.1:1000 ``` -------------------------------- ### Enabling UART Analyzer and Starting Simulation Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/co-simulating-custom-hdl.md These Renode monitor commands enable the analyzer window for the `verilated_uart` peripheral and start the simulation. The `s` command executes one step of the simulation. ```none (machine-0) showAnalyzer verilated_uart (machine-0) s ``` -------------------------------- ### Install bumble for Bluetooth socket support Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/ble-hci-integration.md Install the bumble module using pipx to ensure proper Bluetooth socket support, avoiding potential AttributeError with conda environments. ```sh pipx install git+https://github.com/google/bumble.git@8eeb58e467 ``` ```sh python -m pip install git+https://github.com/google/bumble.git@8eeb58e467 ``` -------------------------------- ### Basic Entry Structure Example Source: https://github.com/renode/renode-docs/blob/master/source/advanced/platform_description_format.md Shows the fundamental structure of an entry in Renode's platform description format, including variable name, type, registration info, and attributes. ```none variableName: TypeName registrationInfo attribute1 attribute2 ... attributeN ``` -------------------------------- ### Create ArduinoLoader with Default Settings Source: https://github.com/renode/renode-docs/blob/master/source/host-integration/arduino.md Creates the ArduinoLoader pseudo-device with default settings, simplifying the configuration. ```none (machine-0) host.usb CreateArduinoLoader sysbus.cpu ``` -------------------------------- ### Create USB/IP Server and Export Fomu Device Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/usbip.md Sets up a USB/IP server within Renode and registers the Fomu's Valenty USB peripheral to be exported. This makes the simulated device available to the host. ```none (machine-0) emulation CreateUSBIPServer (machine-0) host.usb Register sysbus.valenty ``` -------------------------------- ### Start Virtual HCI Interfaces and Renode Simulations Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/ble-hci-integration.md This command starts three virtual HCI interfaces and launches three Renode instances, each configured for a BLE Mesh Zephyr application. ```sh $ sudo btvirt -d -l3 $ renode -e "$port=3456; $bin=@/home/user/zephyrproject/zephyr/hci_mesh/zephyr/zephyr.elf; i @scripts/complex/hci_uart/hci_uart.resc" $ renode -e "$port=3457; $bin=@/home/user/zephyrproject/zephyr/hci_mesh/zephyr/zephyr.elf; i @scripts/complex/hci_uart/hci_uart.resc" $ renode -e "$port=3458; $bin=@/home/user/zephyrproject/zephyr/hci_mesh/zephyr/zephyr.elf; i @scripts/complex/hci_uart/hci_uart.resc" ``` -------------------------------- ### Clone LiteX and Initialize Environment Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/fomu-example.md Clone the LiteX repository and set up the necessary Python environment for the EtherBone bridge. This is required for connecting Renode to the Fomu board. ```bash git clone https://github.com/enjoy-digital/litex cd litex ./litex_setup.py init # this will clone the dependencies export PYTHONPATH=`pwd`:`pwd`/litex:`pwd`/migen ``` -------------------------------- ### Install Dependencies and Build BlueZ Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/ble-hci-integration.md Installs necessary packages and builds the BlueZ Bluetooth stack from source on Debian-based systems. This is required to use the btvirt tool for creating virtual BLE controllers. ```bash sudo apt update sudo apt install -y wget xz-utils git bc libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev autoconf bison flex libssl-dev libncurses-dev libdbus-1-dev python3-docutils cmake udev systemd wget https://github.com/json-c/json-c/archive/refs/tags/json-c-0.16-20220414.tar.gz tar xvf json-c-0.16-20220414.tar.gz cd json-c-json-c-0.16-20220414 mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIBS=OFF .. make sudo make install wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.68.tar.xz tar -xvf bluez-5.68.tar.xz cd bluez-5.68 ./configure --enable-mesh --enable-testing --enable-tools --enable-deprecated --enable-experimental --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var make -j$(nproc) ``` -------------------------------- ### Accessing Global Variables Source: https://github.com/renode/renode-docs/blob/master/source/basic/monitor-syntax.md Illustrates how to create and access global variables using the 'global' prefix. ```none (monitor) $global.CWD ``` -------------------------------- ### Start GDB Server in Renode Source: https://github.com/renode/renode-docs/blob/master/source/tutorials/miv-example.md Start a GDB server in Renode on a specified port to allow debugging with GDB or GDB-based IDEs. The 'true' parameter forces Renode to autostart when the GDB client connects. ```renode (monitor) include @scripts/single-node/miv.resc (MI-V) machine StartGdbServer 3333 true ```