Register map generated from generic values (N instance of a subcomponent)
Hello,
In our register map, we often have a generic/parameter setting the number of instance we want that generate such memory map :
Generic Number of N instance
@0x0000 | RO | IP identification
@0x0004 | RO | IP version register
@0x0008 | RO | IP capabilities register
@0x00101+0x00 | RW | Control register for instance 0
@0x00101+0x04 | RW | Status register for instance 0
@0x00102+0x00 | RW | Control register for instance 1
@0x00102+0x04 | RW | Status register for instance 1
@0x0010N+0x00 | RW | Control register for instance N-1
@0x0010N+0x04 | RW | Status register for instance N-1
That would be a great improvement to support such feature.
This could be addressed by defining a sub register map instantiated N times ?
Generic array lengths are now available as a preview feature, see https://airhdl.com/docs/beta
-
Guillaume commented
Adding generic defined array is key as most of the unused logic is not simplified.
My experience with an airhdl 256 array with only 8 connections :256 airhdl array with only 8 connections : 40KLUTs (as this is read+write register, this is more or less expected)
256 + generic restricted to 8 within the decoding : 37 KLUTs (more simplification where expected)
256 + manual modification of the <REGISTER>_ARRAY_LENGTH value to 8 : 1K LUTs
-> That would be awesome to be able to set the <REGISTER>_ARRAY_LENGTH from the generic list instead of the package.
These generics can be used to size the input/output ports associated with the arrays + the internal width of the arrays. -
Guillaume commented
As a workaround, I am using the array with a fixed value for each control/status register.
I a 256*4 address range between each register.-> I would be extremely helpfull to be able to set the exact number of instance from a generic assuming the generic value is <= allowed range (here 256).
thanks !