Welcome ! This website will help YOU (recent graduates/professionals) learn verification languages like SystemVerilog and UVM. Register for free and access more content !

A few examples on set and get methods were illustrated in the previous article. Now we'll see more combinations of expressions used to set and get settings from config_db and see the result of such operations on the same testbench structure with two agents in an environment.

set vs get results

To recap, a setting with field_name "Friend" is set with different cntxt and inst_name in the config_db. This is obtained by both agents and the environment using the get method with different cntxt and inst_name combinations. If the get call is successful, the cell is highlighted in pale green, else it is highlighted in pale red.

 
// Set the given field_name "Friend" in test
uvm_config_db #(string) :: set (cntxt, inst_name, "Friend", "Ross");
 
// Get "Friend" in env and agents
uvm_config_db #(string) :: get (cntxt, inst_name, "Friend", "Ross");
 
Hierarchy of each component:
  Environment : uvm_test_top.m_env
  Agent1      : uvm_test_top.m_env.m_agent1
  Agent2      : uvm_test_top.m_env.m_agent2
 

The first column in the table shown below is for the test class that sets the field Friend with the given cntxt and inst_name. All subsequent columns represent different components that try to get the setting from config_db which in our example is the environment and two agents.

Test :: set Env :: get Agent1 :: get Agent2 :: get
(null, "uvm_test_top") uvm_test_top.Friend (this, "") uvm_test_top.m_env.Friend (this, "") uvm_test_top.m_env.m_agent0.Friend (this, "") uvm_test_top.m_env.m_agent1.Friend
(this, "") uvm_test_top.Friend (this, "") uvm_test_top.m_env.Friend (this, "") uvm_test_top.m_env.m_agent0.Friend (this, "") uvm_test_top.m_env.m_agent1.Friend
(this, "*") uvm_test_top.*.Friend (this, "") uvm_test_top.m_env.Friend (this, "") uvm_test_top.m_env.m_agent0.Friend (this, "") uvm_test_top.m_env.m_agent1.Friend
(this, "m_env") uvm_test_top.m_env.Friend (this, "") uvm_test_top.m_env.Friend (this, "") uvm_test_top.m_env.m_agent0.Friend (this, "") uvm_test_top.m_env.m_agent1.Friend
(this, "m_env.*") uvm_test_top.m_env.*.Friend (this, "") uvm_test_top.m_env.Friend (this, "") uvm_test_top.m_env.m_agent0.Friend (this, "") uvm_test_top.m_env.m_agent1.Friend
(this, "m_env.m_agent*") uvm_test_top.m_env.m_agent*.Friend (this, "") uvm_test_top.m_env.Friend (this, "") uvm_test_top.m_env.m_agent0.Friend (this, "") uvm_test_top.m_env.m_agent1.Friend
(null, "uvm_test_top.m_env.m_agent1") uvm_test_top.m_env.m_agent1.Friend (this, "") uvm_test_top.m_env.Friend (this, "") uvm_test_top.m_env.m_agent0.Friend (this, "") uvm_test_top.m_env.m_agent1.Friend
(this, "*.m_agent1") uvm_test_top.*.m_agent1.Friend (this, "") uvm_test_top.m_env.Friend (this, "") uvm_test_top.m_env.m_agent0.Friend (this, "") uvm_test_top.m_env.m_agent1.Friend
(this, "m_env.m_ag*") uvm_test_top.m_env.m_ag*.Friend (this, "") uvm_test_top.m_env.Friend (this, "") uvm_test_top.m_env.m_agent0.Friend (this, "") uvm_test_top.m_env.m_agent1.Friend

Was this article helpful ?



You consent to our cookies if you continue to use our website. To know more about cookies, see our privacy policy. I accept cookies from this site.

Agree