{"id":18635508,"url":"https://github.com/jonlamb-gh/renode-run","last_synced_at":"2025-10-31T09:46:45.166Z","repository":{"id":142879391,"uuid":"614326788","full_name":"jonlamb-gh/renode-run","owner":"jonlamb-gh","description":"A custom Cargo runner that runs Rust firmware in the renode emulator","archived":false,"fork":false,"pushed_at":"2025-04-28T11:36:35.000Z","size":52,"stargazers_count":11,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-24T15:55:54.250Z","etag":null,"topics":["cargo-runner","embedded-rust","renode","simulation"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonlamb-gh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-15T11:13:22.000Z","updated_at":"2025-05-17T07:37:03.000Z","dependencies_parsed_at":"2024-11-07T05:29:28.483Z","dependency_job_id":"b43ed705-76d5-42fb-8345-741c1ab96872","html_url":"https://github.com/jonlamb-gh/renode-run","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonlamb-gh/renode-run","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonlamb-gh%2Frenode-run","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonlamb-gh%2Frenode-run/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonlamb-gh%2Frenode-run/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonlamb-gh%2Frenode-run/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonlamb-gh","download_url":"https://codeload.github.com/jonlamb-gh/renode-run/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonlamb-gh%2Frenode-run/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281969169,"owners_count":26591718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo-runner","embedded-rust","renode","simulation"],"created_at":"2024-11-07T05:25:18.533Z","updated_at":"2025-10-31T09:46:45.140Z","avatar_url":"https://github.com/jonlamb-gh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# renode-run \u0026emsp; ![ci] [![crates.io]](https://crates.io/crates/renode-run)\n\nA custom Cargo runner that runs Rust firmware in the [renode] emulator.\n\n## Features\n\n* Acts as a Cargo runner, integrating into `cargo run`.\n* Exposes all of [renode]'s scripting facilities and CLI as configuration in your `Cargo.toml`.\n* Provides configuration for the environment, allowing you to perform environment variable\n  substitution on nearly everything.\n\n## Installation\n\nTo install `renode-run`, use `cargo install renode-run`.\n\n## Setup\n\n**NOTE** Requires [renode] to be installed on the host system.\n\n### 1. Set the Cargo runner\n\nSet `renode-run` as your Cargo runner (`.cargo/config.toml`).\n\n``` toml\n[target.'cfg(all(target_arch = \"arm\", target_os = \"none\"))']\nrunner = \"renode-run\"\n```\n\n### 2. Run\n\nYou can now run your firmware using `cargo run`.\n\n## Configuration\n\n### `[package.metadata.renode]` options\n\n**NOTE** Many of these can be overridden by CLI options. Nearly every field supports environment variable substitution.\n\nFields pertaining the `resc` script generation:\n- **name**: The name field used in the generated `resc` script.\n  If not present, the name of the crate is used or a default name is provided.\n- **description**: The description field used in the generated `resc` script.\n  If not present, the description of the crate is used or a default description is provided.\n- **machine-name**: The machine's name.\n- **init-commands**: An array of commands ran after the machine is created and before variables are declared.\n- **variables**: An array of variable declarations.\n  `renode-run` will automatically insert `$bin = @target/\u003cprofile\u003e/\u003cbin\u003e` as provided by Cargo.\n- **platform-description**: A single platform description.\n  Can be one of:\n    * a renode-provided `repl` file (starts with `@`)\n    * a local `repl` file (doesn't start with `@`)\n    * a local `repl` file that is to be imported and generated into the output directory (starts with `\u003c`).\n      This is handy when you want to perform environment substitution on the contents of a `repl` file.\n    * a literal string\n- **platform-descriptions**: An array of platform descriptions.\n  Each entry can be one of:\n    * a renode-provided `repl` file (starts with `@`)\n    * a local `repl` file (doesn't start with `@`)\n    * a local `repl` file that is to be imported and generated into the output directory (starts with `\u003c`).\n      This is handy when you want to perform environment substitution on the contents of a `repl` file.\n    * a literal string\n- **reset**: The reset macro definition. The default is `sysbus LoadELF $bin`.\n- **start**: The start command definition. The default is `start`.\n- **pre-start-commands**: An array of commands ran immediately before the `start` command.\n- **post-start-commands**: An array of commands ran immediately after the `start` command.\n\nFields pertaining the behavior of `renode-run`:\n- **environment-variables**: An array of environment variables and values to set for both the `renode-run` and `renode` environment.\n- **renode**: The path to the `renode` binary to use. Defaults to using the system's `$PATH`.\n- **omit-start**: Don't generate a `start` command. Defaults to `false`.\n- **omit-out-dir-path**: Don't add the output directory to renode's path.\n- **resc-file-name**: The name of the generated `resc` script. Defaults to `emulate.resc`.\n- **use-relative-paths**: TBD\n- **disable-envsub**: TBD\n- **using-sysbus**: TBD\n\nFields pertaining the invocation of `renode` itself:\n- **plain**: Adds `--plain` to the list of arguments given to `renode`.\n- **port**: Adds `--port \u003cport\u003e` to the list of arguments given to `renode`.\n- **disable-xwt**: Adds `--disable-xwt` to the list of arguments given to `renode`.\n- **hide-monitor**: Adds `--hide-monitor` to the list of arguments given to `renode`.\n- **hide-log**: Adds `--hide-log` to the list of arguments given to `renode`.\n- **hide-analyzers**: Adds `--hide-analyzers` to the list of arguments given to `renode`.\n- **console**: Adds `--console` to the list of arguments given to `renode`.\n- **keep-temporary-files**: Adds `--keep-temporary-files` to the list of arguments given to `renode`.\n\n## Example\n\n```toml\n[package.metadata.renode]\nname = 'my-script'\ndescription = 'my renode script - ${FOOKEY} works'\nmachine-name = 'my-machine'\nusing-sysbus = true\nrenode = '${HOME}/repos/forks/renode/renode'\nenvironment-variables = [\n    ['FOOKEY', 'FOOVAL'],\n    [\"MYENV\", \"MYVAL\"],\n]\ninit-commands = [\n    'logLevel -1 i2c2',\n]\nvariables = [\n    '$tap?=\"renode-tap0\"',\n    # Set random board UNIQUE ID\n    '''\n    python \"import _random\"\n    python \"rand = _random.Random()\"\n\n    $id1 = `python \"print rand.getrandbits(32)\"`\n    $id2 = `python \"print rand.getrandbits(32)\"`\n    $id3 = `python \"print rand.getrandbits(32)\"`\n    ''',\n]\nplatform-descriptions = [\n    '@platforms/boards/stm32f4_discovery-kit.repl',\n    'path/to/dev_board.repl',\n    '\u003c ${SOMETHING}/other_dev_board.repl',\n    '''\n    phy3: Network.EthernetPhysicalLayer @ ethernet 3\n        Id1: 0x0000\n        Id2: 0x0000\n    ''',\n    '''\n    wss: Python.PythonPeripheral @ sysbus 0x50070000\n        size: 0x10\n        initable: true\n        filename: \"${ORIGIN}/sensor_models/wss.py\"\n    ''',\n]\npre-start-commands = [\n    '''\n    emulation CreateSwitch \"switch\"\n    connector Connect sysbus.ethernet switch\n    emulation CreateTap $tap \"tap\"\n    connector Connect host.tap switch\n    ''',\n    '''\n    logFile @/tmp/logfile.log true\n    logLevel 3 file\n    ''',\n    'emulation LogEthernetTraffic',\n    'machine StartGdbServer 3333',\n    '''\n    sysbus.usart3 AddLineHook \"PANIC\" \"Antmicro.Renode.Logging.Logger.Log(LogLevel.Error, line)\"\n    sysbus.usart3 AddLineHook \"test result: ok\" \"Antmicro.Renode.Emulator.Exit()\"\n    ''',\n]\nreset = '''\nsysbus LoadELF $bin\nsysbus WriteDoubleWord 0x1FFF7A10 $id1\nsysbus WriteDoubleWord 0x1FFF7A14 $id2\nsysbus WriteDoubleWord 0x1FFF7A18 $id3\n'''\n```\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\nlicensed as above, without any additional terms or conditions.\n\n[ci]: https://github.com/jonlamb-gh/renode-run/workflows/CI/badge.svg\n[crates.io]: https://img.shields.io/crates/v/renode-run.svg\n[renode]: https://renode.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonlamb-gh%2Frenode-run","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonlamb-gh%2Frenode-run","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonlamb-gh%2Frenode-run/lists"}