I have two modules, one has a latency of x clock cycles, the other one has a latency of y clock cycles. I'd like to tie the latency to each of these modules, so that when I instantiate the module in e.g. a test bench or another module, I can extract the right latency without manually changing x with y each time. This would be the 'inverse' of passing a parameter from the higher module down.
What would be the most Chisel-appropriate way to do this?
I read the latest Chisel book but could not find a solution.
You can simply read a value declared under the module and use it in your code generation.
Here an example on scatie.
latencyis a value declared in Modules that is read byprintlnfunction in the upwards Module.