Parameter overriding which is declared inside package

Hi

Please see below snippet of code where i want to override the parameter declared inside the package.

I need help how can we do it?

////////////////////////////////////////////////////////////////////////////////////////////

package abc;
parameter int My_var=1;

function par_override(int local_val)
My_var=local_val;
// $display(“local_cal=%d”,local_val);
endfunction
endpackage

module basic1;

initial begin
abc::par_override(2);
//$display("My_var=%d ",abc::My_var);

end

endmodule:basic1

Thanks
Bharath

In reply to bharath123:
Hi Bharath,

There are only two ways to change the value of parameter,
1. during instantiation of module, interface, program block or class… or
2. using “defparam” statement.
As we can not instantiate package, the first option won’t work with package and the defparam statement works only with module, interface and program block. So, as per my understanding there is no way to override the value of parameter declared inside the package.

In reply to bdreku:

Thanks Hardik,

There could be way as they declared them inside package as local parameters.

The intention of keeping them parameterised expecting a scope of Generic way of coding.

Thanks
Bharath