Flattened Devicetree to SVD conversion tool
Find a file
Weathered Steel e54acf9a28
All checks were successful
ci/woodpecker/push/woodpecker/1 Pipeline was successful
ci/woodpecker/push/woodpecker/2 Pipeline was successful
Merge pull request 'jh7110-tdm: add write constraints and enum values' (#87) from rmsyn/svd-generator:jh7110-tdm/add-write-constraint into main
Reviewed-on: #87
Reviewed-by: Weathered Steel <weathered-steel@noreply.codeberg.org>
2024-09-27 03:58:19 +00:00
dt dt: fix the order of L2PM interrupts 2024-05-27 23:06:00 +00:00
scripts test: add generate and build tests 2024-02-21 03:55:15 +00:00
src jh7110-tdm: add write constraint to tdm_fifo 2024-09-19 01:27:20 +00:00
templates/riscv test: add generate and build tests 2024-02-21 03:55:15 +00:00
.gitignore Initial commit 2024-01-22 00:25:38 +00:00
.woodpecker.yaml svd: use development version of svd-rs and svd-encoder 2024-07-23 01:33:02 +00:00
Cargo.lock svd: use development version of svd-rs and svd-encoder 2024-07-23 01:33:02 +00:00
Cargo.toml svd: use development version of svd-rs and svd-encoder 2024-07-23 01:33:02 +00:00
LICENSE Initial commit 2024-01-22 00:25:38 +00:00
README.md readme: add initial top-level README 2024-01-28 01:29:24 +00:00

svd-generator

Conversion tool for parsing device information from flattened device tree files, and generating a CMSIS-SVD description.

Building

Build using a standard Rust workflow:

$ cargo build [--release]

Running

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

Adding known peripherals

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:

  • peripheral module: src/svd/peripheral/<peripheral-model-name>.rs
  • peripheral sub-modules: src/svd/peripheral/<peripheral-model-name>/
  • peripheral registers submodule: src/svd/peripheral/<peripheral-model-name>/registers.rs
  • peripheral register definitions: src/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.

WIP

Currently, only binary-encoded flattened device tree (.dtb) is supported.

Work is ongoing to support source-encoded device tree (.dts).