Search code examples
system-verilogmodelsimquestasim

How to override localparam? -GPARAM=VAL not working


I know we can override a generic/parameter in Verilog/SystemVerilog using vsim's option -GMYPARAM=VALUE.

This doesn't work for a localparam and the use of localparam in the module to prevent the change of the value isn't allowed.

mymod #(
  localparam A = 0  // not allowed
)(
...
);

Is there a way to override a localparam of a module or an instance from the tcl?


Solution

  • Normally the only way to override a localparam is by changing it to a parameter. But Modelsim has a vopt switch that global converts all localparam to parameters for the -G option. You can look it up in the ModelSim/Questa Reference Manual