esynr3z / corsair

Control and Status Register map generator for HDL projects
https://corsair.readthedocs.io
MIT License
95 stars 33 forks source link

CMSIS SVD #12

Open raffi-g opened 2 years ago

raffi-g commented 2 years ago

Hi! First of all, thanks for the great work so far!

I would like to add a generator for CMSIS SVD files (a register description format for debugging, see here).

I've already done most of the work. The only thing is, that SVD wants to know, in which peripherals the registers are, e.g.

<peripherals>
    <peripheral>
        <!-- some other stuff -->
        <registers>
            <!-- list of registers for this peripheral -->
        </registers>
    </peripheral>
    <peripheral>
        <!-- second peripheral with list of registers -->
    </peripheral>
</peripherals>

At the moment this information is not provided in the register map. In order to minimize the impact on the current defintion and also be backwards compatible, I would suggest to just add an entry "peripheral" to each register, like so:

{
        "name": "CSR_NAME",
        "description": "",
        "address": "0x20",
        "peripheral": "my_peripheral",
        "bitfields": []
}

What's your opinion? Or is this not wished at all? Then I would just leave it on my fork.

esynr3z commented 2 years ago

Hello!

Of course I'm interested in SVD generator! CMSIS SVD was one of the sources of inspiration for me.

I see that you've done plenty of work already. And I'm planning to do a big refactoring, so I'm sure there will be much elegant way to integrate support of several peripherals. For example, to add several register maps to csrconfig. I think it is much convenient to place register map of each peripheral in a separate file.

raffi-g commented 2 years ago

Hi Goot to hear. If I can support you in any way, just let me know.