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?
Normally the only way to override a
localparamis by changing it to aparameter. But Modelsim has avoptswitch that global converts all localparam to parameters for the -G option. You can look it up in the ModelSim/Questa Reference Manual