esynr3z / corsair

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

Support for parametrized unpacked arrays #66

Open g-lesssard opened 2 weeks ago

g-lesssard commented 2 weeks ago

Hi! I really like the project and would see a ton of use for it in our FPGA/ASIC projects. However, one blocker I see is the lack of parameters on the HDL modules generated. I often have multiple instances of a module that I would like to share the same register bank. For this I often have modules that look like this in Verilog:

module registers #(
   parameter DATA_W = 32,
   parameter INSTANCE_COUNT = 8
) (
...
output [INSTANCE_COUNT-1:0] control_reg [DATA_W-1:],
...
);

I would this type of Register to be supported by corsair. This is a larger feature request that I would be happy to collaborate to. I would like your feedback on how best to include this. I was thinking of adding a class like UnpackedRegisters that would take in input a Register object and a name for its parameter.

Is this a feature that you would like to be supported and is my proposed approach in line to how you would approach the issue?