regbits icon indicating copy to clipboard operation
regbits copied to clipboard

Questions

Open jeras opened this issue 4 years ago • 1 comments

Hi,

I was looking for something like regbits since yesterday :). Not really for a long time, so I am not sure yet if I found what I was looking for. Additionally C++ is not a language I write code in although I reed it sometimes. This is starting to look like an online recipe which starts with a history lesson. Still I would like to have more of a discussion than to report an issue.

I would like to use a SystemRDL register set definition to generate C/C++ headers. I was thinking of Rust too, then I checked, and there seem to be a few options already available.

The standard is good but not great (it can be confusing sometimes), but there is a great Python project implementing the standard SystemRDL Compiler. The compiler itself is of great quality, it covers all parts of the standard I could think of checking, and it has a few projects already using it on GitHub. I was able to use it to create a MarkDown and DOCX documentation generator in about 5 days, which is below my usual 'getting used to something' time, so I would say the compiler is very user friendly too.

SystemRDL provides a broad overview off all the functionality you might wish to implement in regbits, for example there is a list of supported field types in section 9.6 Software access properties.

There are other comparable register definition standards:

IP-EXACT is similar to SystemRDL, but broader is scope. There are few open source projects using it, maybe, because it is broad.

UVM is meant to be used in combination with the SystemVerilog HDL, so it is not generic enough to be used as the top definition. It would be more common to write the definition in SystemRDL and than use it to generate UVM code.

UVM-SystemC LRM (inside linked tarball) has a related section 15. Register abstraction classes.

jeras avatar Jun 23 '21 08:06 jeras

Thank you for the information about the various system description projects. If any of them are now or in the future become widely supported I might consider writing an xxx2regbits converter. That's assuming the existence of more, or better quality, microcontroller "xxx" descriptions than SVD ones. The completeness and accuracy of the descriptions is much more important than the format/language used to express them. As has been said many times: "The nice thing about standards is there's so many of them to choose from". ;)

Whether or not you use C++ is your choice, but note that many C++ coders would likely consider regbits to be C, not C++ (in its full object-oriented glory). Besides the obvious need to use a C++ compiler, the barrier for a C coder to use regbits is very low. Of course if you prefer to use Rust that's an entirely different issue, and as you point out there are existing solutions in that space.

thanks4opensource avatar Jun 23 '21 18:06 thanks4opensource