- I want to declare a int variable in config db.
//configuration class
class config extends uvm_object;
`uvm_object_utils(config)
int value;
function new(string name = "config");
super.new(name);
endfunction
endclass
2.i want set this value= 3(some value) in higher components like env or test
//environment class
config cfg;
function void build_phase(uvm_phase phase);
super.build_phase(phase);
uvm_config_db#(int)::set(this,"*","config",cfg.value==5);
endfunction
- I want to get the value in lower ever components like monitor or driver.
config mfg;
function void build_phase(uvm_phase phase);
super.build_phase(phase);
if(!uvm_config_db)#(int)::get(this,"","config",mfg))
`uvm_fatal("monitor","your are not getting have you set properly in environment")
endclass
task run_phase(uvm_phase phase);
forever
collect();
endtask
task collect();
$display("value =%d",mfg.value);
endtask
endclass
but I am getting value = 0.
Help me in correcting the issue.