How to override localparam? -GPARAM=VAL not working

1.3k views Asked by At

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?

1

There are 1 answers

0
dave_59 On BEST ANSWER

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