systemrdl-compiler
systemrdl-compiler copied to clipboard
Enum parsing
Hi,
I've been trying recently to import ipxact files that contain enums. I get the following error: "names are reserved for future Enum use" I've tried Python 3.6 & Python 3.9. Is it an issue related to the importer?
Interesting
I suspect your IP-XACT file contains enumeration names have an underscore prefix & suffix like: _something_
Internally, the RDL compiler will cast imported enumerations into a Python Enum
object. It looks like Python's implementation of enumerations imposes some restrictions on what enum member names can be used so that they do not collide with the built-in (and future) "sunder names": https://docs.python.org/3/library/enum.html#supported-sunder-names
I'll have to think about what the proper fix for this is. For now, I'd recommend editing the IP-XACT file and editing the names that have leading & trailing suffixes.
I will move this issue to the systemrdl-compiler
project since the fix will ultimately be there.
Found this bug two.
Hi, is there an update regarding this bug?
Was on vacation. Will look into it more now that I am back
Hi, any new? :)
I have a plan on how to fix this, but it is more intrusive than I had hoped.
The plan is to migrate away from the use of Python's Enum
objects to represent user-defined enumerations. This would address this issue, as well as other quirks that result from this (inability to pickle register models). Instead of Enum
classes, RDL enumerated types would be represented by more specialized class instances. A similar change would be done for RDL struct representations, but i expect they are less often used.
The biggest challenge is that I need to build a migration path that is not intrusive to the community and do my best to not break compatibility with current usages. I have a general plan for this, but still need to think through some details.
~~See planned rework details in #132.~~ (changed my mind. fixing a different way) I hope to get this fixed in the next few weeks.
Fixed in v1.24.0