Skip to main content

PeakRDL importer plugin for CMSIS-SVD register description files

Project description

peakrdl-svd

A PeakRDL importer plugin that reads CMSIS-SVD (System View Description) register description files and compiles them into the SystemRDL register model.

Installation

pip install peakrdl-svd

Once installed, the plugin registers itself automatically under the svd importer name, so PeakRDL picks it up with no extra configuration.

Usage

CLI

Import an SVD file and export to another format (e.g. IP-XACT):

peakrdl ipxact path/to/device.svd -o out/

Import only a single peripheral:

peakrdl ipxact path/to/device.svd --svd-peripheral UART0 -o out/

Python API

from systemrdl import RDLCompiler
from peakrdl_svd.importer import SVDImporter

rdlc = RDLCompiler()
imp = SVDImporter(rdlc, peripheral_filter="UART0")  # omit filter for full device
imp.import_file("path/to/device.svd")

root = rdlc.elaborate()
for periph in root.children():
    print(periph.inst_name)

Features

  • Full device or single-peripheral import via --svd-peripheral
  • derivedFrom — peripherals, registers, clusters, and <enumeratedValues>
  • Register and cluster arrays via <dim> / <dimIncrement>
  • Nested clusters mapped to nested regfile components
  • All three SVD bit-range notations: bitOffset+bitWidth, lsb+msb, [msb:lsb]
  • Default inheritancesize, access, resetValue, resetMask propagate from device → peripheral → cluster → register
  • <enumeratedValues> mapped to UserEnum encoding properties
  • modifiedWriteValues and readAction mapped to onwrite / onread

Development

git clone https://github.com/gkvas/peakrdl-svd
cd peakrdl-svd
pip install -e ".[dev]"
pytest

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peakrdl_svd-0.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

peakrdl_svd-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file peakrdl_svd-0.1.0.tar.gz.

File metadata

  • Download URL: peakrdl_svd-0.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for peakrdl_svd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e83212ec16983f007691c5a689ccc7ecdac8e31ad614479c93739d0de41c7ec6
MD5 d4e1a59165a342633a057804f4e0aadd
BLAKE2b-256 3da9e3476805a12b6d9551636113362fb101f93900d072f567a5856c86e2f53b

See more details on using hashes here.

Provenance

The following attestation bundles were made for peakrdl_svd-0.1.0.tar.gz:

Publisher: publish.yml on gkvas/peakrdl-svd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file peakrdl_svd-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: peakrdl_svd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for peakrdl_svd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0caaba469d0049f615e668b469cae722b578863a3d9740588d0b0f0806a5633a
MD5 66b5e30f04c54cd02839d55fb4a55b0d
BLAKE2b-256 b4bc923eb12c48bdf78323adcac228efc33a8caae199a950cdffa5d5c4ae87e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for peakrdl_svd-0.1.0-py3-none-any.whl:

Publisher: publish.yml on gkvas/peakrdl-svd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page