| Crates.io | svd-generator |
| lib.rs | svd-generator |
| version | 0.7.0 |
| created_at | 2024-01-28 00:19:17.335941+00 |
| updated_at | 2024-10-17 00:52:41.411289+00 |
| description | Converts device information from flattened device tree into an SVD description |
| homepage | |
| repository | https://codeberg.org/weathered-steel/svd-generator |
| max_upload_size | |
| id | 1117112 |
| size | 1,458,487 |
Conversion tool for parsing device information from flattened device tree files, and generating a CMSIS-SVD description.
Build using a standard Rust workflow:
$ cargo build [--release]
svd-generator produces a CLI binary, you can run with:
# Using `cargo-run`
$ cargo run -- -f <flatted-device-tree.dtb> [-o <output.svd>]
# Running directly using the binary file
$ svd-generator -f <flattened-device-tree.dtb> [-o <output.svd>]
The default output file is out.svd.
For help information:
$ svd-generator -h
Only known peripherals will have SVD entries added.
This is because register definitions are not included in device tree files.
Register definitions are typically parsed from vendor provided manuals, firmware/kernel source code, and/or hardware definitions (VHDL, Verilog, etc.).
Currenty, there are a limited number of supported peripherals. They can be used as examples for adding new peripherals.
Peripheral definitions go in the svd/peripheral directory as a module.
For example, the Synsopsys DesignWare APB I2C peripheral definition: dw_apb_i2c.
New peripherals should follow to convential Rust module naming pattern:
src/svd/peripheral/<peripheral-model-name>.rssrc/svd/peripheral/<peripheral-model-name>/src/svd/peripheral/<peripheral-model-name>/registers.rssrc/svd/peripheral/<peripheral-model-name>/registers/{<reg0-name>.rs, <reg1-name>.rs}Defining peripherals in this way should allow for a large degree of reusability among different SoCs/boards.
New entries should also be added to the Compatible enum: tree/compatible.
Currently, only binary-encoded flattened device tree (.dtb) is supported.
Work is ongoing to support source-encoded device tree (.dts).