How to set a parameter in configuration data base?

How to set a parameter using uvm_config_db(…) API inside a call that is extended by uvm_object?

myClass extends uvm_object;

uvm_config_db#(int)::set(uvm_root::get(), “uvm_test_top.*”,“MY_PARAMETER”,my_paramter);

endclass

I am able to read a parameter inside myClass extended but not able to set a parameter?

In reply to superUVM:

From the 1800-2017 SV LRM. Section 6.20 Constants
Constants are named data objects that never change. SystemVerilog provides three elaboration-time constants: parameter, localparam, and specparam. SystemVerilog also provides a run-time constant, const (see 6.20.6).

The key part is that parameters are resolved at elaboration time, so you cannot set them using procedural code at run time.

There are tool specific ways of setting values for parameters at command line, for that you’ll need to check your tool’s manual.

HTH,

-R