Conditional conversion tricks?

Hi! I have some use cases where I do customization on instantiated objects by changing a default parameter and then I get parts of the code disabled inside “if” blocks. So far this has worked fine because converted “if False” (ie. testing the constant parameter) blocks supposedly get removed by synthesis optimizations.

Now I have a more complicated customization that switches the assignment of a certain signal between combinational and clock’ed process. The old “if constant-parameter” trick fails in this case with “myhdl.ConversionError: … Signal has multiple drivers”. I understand the parameter value is not being evaluated on conversion, so both processes are converted thus the multiple drivers problem.

Is it possible to achieve a working “conditional conversion” (disabling parts of code on instantiation) another way?

I’ve manage to fix conversion in my project by conditionally changing the usage of the signal, choosing between comb/clocked versions later, instead of multiple conditional assignments. But I still wonder if there is any kind of trick to achieve conditional conversion. :wink: