SystemRDL / PeakRDL-cheader

GNU General Public License v3.0
9 stars 11 forks source link

C Register HAL #4

Closed roowatt closed 1 year ago

roowatt commented 1 year ago

I am looking for a C based register HAL, I understand that there are plans to add an exporter fo the PeakRDL tool to do this.

Do you have any advice as to how to approach this? Do you have any design notes or examples of the style of headers and macros you expect? Any gotchas or deal breakers?

I am asking because it makes sense that if we take this on that it is able to be contributed to the project.

amykyta3 commented 1 year ago

I'm actually working on the initial architecture for it as we speak, and hope to implement it quite soon.

One thing that will be the biggest help is to get ideas for what specific features people are looking for. Generally, I plan to have the tool generate both a struct overlay for register addressing, as well as #define for field definitions. One good existing example is ARM's CMSIS headers: https://github.com/ARM-software/CMSIS_4/blob/master/CMSIS/Include/core_cm4.h

If there is anything specific you have seen in your experience that you'd like to see in the tool, let me know!

roowatt commented 1 year ago

Seems like fortuitous timing. :) I am approaching this from a standing start (nearly).

Deeply embedded processor sub-systems I have designed and implemented have mostly been a very manual process. This approach is not sustainable, particularly for the projct I am currently working on.

I have talked to one of our SW devs, he agrees the example file you linked to would be good.

Some initial thoughts I have been pondering are below, this is by no means exhaustive but maybe a start;

I am keen to help testing if you need/want.

amykyta3 commented 1 year ago

Yep that's generally the idea.

roowatt commented 1 year ago

Sounds great!

Versioning will be difficult to do generically, however if I also export defines for field reset values, that could be used as a common source of truth to bind header+Verilog versioning, assuming you have a version register or similar.

That would work, binding the header+verilog would be enough I guess. I could always use some kind of command line parameter to pass a GIT hash to a description string.

URL prefix is a really interesting idea! So provide a mechanism to create links back to PeakRDL-html output. I like it.

I haven't set it up yet, but I am planning on using a CI/CD flow for internal releases of FPGA builds prior to ASIC tapeout. There will be multiple build variants and iterations so a link back to html doco will be fantastic.

amykyta3 commented 1 year ago

Refactored version released! See v1.0.0