olofk / fusesoc

Package manager and build abstraction tool for FPGA/ASIC development
BSD 2-Clause "Simplified" License
1.16k stars 242 forks source link

Determining parameters to use for generators. #139

Closed benreynwar closed 7 years ago

benreynwar commented 7 years ago

It's fairly common in designs to have low-level black boxes that need to be generated. My understanding is that the current way to do this in fusesoc is to create a provider.

However, I'm unsure how to work out the parameters that should be passed to the provider. For example, in my designs I have a tree of VHDL modules, most of which have generic parameters, and many of which contain compiled memories that must be generated. The parameters that I need to use for my compiled memories depend on all the preprocessing that is done to the generic parameters as they pass through the module tree.

To work out what parameters I need to use for the generator, I need to either 1) parse the VHDL files and do the preprocessing 2) somehow have the generic parameter transformations specified in the core file Neither of these options is very appealing!

I was wondering if anybody else has come up with a solution to this. I'm currently rolling my own build-system to get around this, but it would be much nicer to be able to use fusesoc.

benreynwar commented 7 years ago

I just got feedback from an issue on the ghdl repo, suggesting I use assert statements to get this information, which seems obvious now that someone else thought of it for me!