Open-CMSIS-Pack / svd-spec

CMSIS-SVD Specification
https://open-cmsis-pack.github.io/svd-spec/main/index.html
Apache License 2.0
5 stars 6 forks source link

[Question] Split bit ranges #11

Open rmsyn opened 6 months ago

rmsyn commented 6 months ago

In certain hardware descriptions, bit fields can be split across multiple ranges with significant bits in between.

An example I've recently come across: https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h#L275,

Is there a current part of the SVD specification for working with fields defined in this way? I would like to be able to use something like enumeratedValues combined with a bitmask for ignoring irrelevant bits on reads, and not clobbering those bits on writes.

As a work-around, it's obviously possible to just split the field into separate field definitions, and document their relation. However, I would like to be able to define this using the type system in the generated code.

If this capability is not currently in the specification, would it be desirable/possible to add it in a future version?

I would be happy to contribute time/effort in design and development work.