Hi,
I have two agents in one environment.
Considering agt1(active) and agt2(passive),
I have two agent config files and using uvm_config_db both the config is set in the testbase class and I’m retrieving back using get method in agt1 and agt2.
Can you please provide me the proper way to configure it.
Thanks
//Config file for agt1
class agent1_config extends uvm_object;
`uvm_object_utils(agent1_config)
uvm_active_passive_enum is_active = UVM_ACTIVE;
function new(string name="");
super.new(name);
endfunction
endclass
//Config file for agt2
class agent2_config extends uvm_object;
`uvm_object_utils(agent2_config)
uvm_active_passive_enum is_active = UVM_PASSIVE;
function new(string name="");
super.new(name);
endfunction
endclass
Hi nirajsp47, in agent1_config and agent2_config you have declared and assigned with UVM_ACTIVE and UVM_PASSIVE respectively(uvm_active_passive_enum is_active = UVM_ACTIVE / UVM_PASSIVE).
In base_test I am able to see equating the UVM_ACTIVE / UVM_PASSIVE again,
agt1_cfg.is_active = UVM_ACTIVE;
agt2_cfg.is_active = UVM_PASSIVE;
So may I know what is the reason of assigning two times?
The config classes are setting a default value. The test is explicitly assigning the value. This is a common style as the test writer may not know the default value, or just wants to be very clear.
I believe and summarized my understanding that the default value which was set in the config class will work without any hindrance even though we don’t explicitly assigning the value from the test base.