espressif / svd

SVD files for Espressif devices
Apache License 2.0
55 stars 2 forks source link

ESP32-C6 SVD seems to have some malformed names #31

Closed Irvise closed 10 months ago

Irvise commented 10 months ago

Hi all,

in the ESP32-C6 SVD, some data registers seem to be incorrectly named. One such example is the entry

   2545         <register>
   2546           <dim>3</dim>
   2547           <dimIncrement>0x10</dimIncrement>
   2548           <name>IN_INT_RAW_CH%s</name>
   2549           <description>Raw status interrupt of channel 0</description>
   2550           <addressOffset>0x0</addressOffset>
   2551           <size>0x20</size>
   2552           <fields>
   2553             <field>
   2554               <name>IN_DONE</name>
   2555               <description>The raw interrupt bit turns to high level when the last data pointed by one inlink descriptor has been rec   2555 eived for Rx channel 0.</description>
   2556               <bitOffset>0</bitOffset>
   2557               <bitWidth>1</bitWidth>
   2558               <access>read-write</access>
   2559             </field>
   2560             <field>
   2561               <name>IN_SUC_EOF</name>
   2562               <description>The raw interrupt bit turns to high level when the last data pointed by one inlink descriptor has been rec   2562 eived for Rx channel 0. For UHCI0 the raw interrupt bit turns to high level when the last data pointed by one inlink descriptor has b   2562 een received and no data error is detected for Rx channel 0.</description>
   2563               <bitOffset>1</bitOffset>
   2564               <bitWidth>1</bitWidth>
   2565               <access>read-write</access>

The name of the registry is IN_INT_RAW_CH%s. I believe the svd generator should have created the IN_INT_RAW_CH0 name, as per the documentation manual https://www.espressif.com/sites/default/files/documentation/esp32-c6_technical_reference_manual_en.pdf There are a few other registers with the same issue.

I saw this issue after trying to automagically generate a HAL (Hardware Abstraction Layer) for Ada using svd2ada (which worked as intended). But the compiler, obviously, did not like that a spurious % was present in several name identifiers.

Could it be fixed? I suppose other SVD->HAL generators will have the same issue.

Best regards, Fer

Irvise commented 10 months ago

After taking a closer look at the issue I noticed that Rust had already a HAL for the C6 which was being automatically generated correctly. I looked at the CMSIS-SVD specification and the %s specifier is allowed in order to denote several sequenced names. I will close the issue and open it with svd2ada.

Sorry for the noise!