ARM-software / CMSIS_5

CMSIS Version 5 Development Repository
http://arm-software.github.io/CMSIS_5/index.html
Apache License 2.0
1.33k stars 1.08k forks source link

Feature request: enumeratedValueDataType pattern should allow binary literals #172

Closed eperie closed 7 years ago

eperie commented 7 years ago

A lot of ARM silicon vendors datasheets do contain enumerated values for register fields specified in binary. Forcing users of CMSIS-SVD to convert such binary literals prior to fill enumerated values in a .svd files is going against the very purpose of schemes such as CMSID-SVD or IP-XACT I guess:

<xs:simpleType name="enumeratedValueDataType"> <xs:restriction base="xs:string"> <xs:pattern value="[+]?(0x|0X|#)?[0-9a-fxA-FX]+"\> </xs:restriction> </xs:simpleType\>

Suggestions:

This could likely be achieved at a very low cost in a very near future, and would be extremely useful.

jkrech commented 7 years ago

Are you aware that binary notation is already possible, however it uses a leading # instead of 0b?

eperie commented 7 years ago

I was obviously not, thank you. Did I miss something in CMSIS-SVD.xsd, or in the .svd examples, or in some other documentation ?

jkrech commented 7 years ago

http://arm-software.github.io/CMSIS_5/SVD/html/svd_xml_conventions_gr.html

Constants

Number constants shall be entered in hexadecimal, decimal, or binary format.

The Hexadecimal format is indicated by a leading 0x.
The Binary format is indicated by a leading #.
All other formats are interpreted as decimal numbers.
The element <enumeratedValue>.<value> can be used to define constants.
eperie commented 7 years ago

I see, my mistake then - I was expecting to see such an information in the schema file and did not look for it in the HTML documentation. Thank you.