# Config\_db::set from Same Level of Hierarchy

**URL:** <https://verificationacademy.com/forums/t/config-db-set-from-same-level-of-hierarchy/37740>\
**Category:** UVM\
**Tags:** UVM, config\_dbset-from-Same-Level-of-Hierarchy\
**Created:** [June 20, 2020, 8:48pm UTC](https://verificationacademy.com/forums/t/config-db-set-from-same-level-of-hierarchy/37740 "2020-06-20T20:48:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MICRO\_91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/5f9b8f/32.png) [@MICRO\_91](https://verificationacademy.com/forums/u/MICRO_91)\
**Post date:** [June 20, 2020, 8:48pm UTC](https://verificationacademy.com/forums/t/config-db-set-from-same-level-of-hierarchy/37740/1 "2020-06-20T20:48:48Z")

</div>

Hi all ,  
I am trying so set “is\_active” variable ( of class uvm\_agent ) from 2 Components at Same level of Hierarchy

```verilog

`include "uvm_pkg.sv"
`include "uvm_macros.svh" 

import uvm_pkg::*;

`define COMP_NEW function new ( string name , uvm_component parent ) ; \
                  super.new(name,parent);\
                 endfunction

 class agent extends uvm_agent ;

 `uvm_component_utils( agent ) 
 `COMP_NEW

function void build_phase ( uvm_phase phase ) ;
 int active;
  
  `uvm_info(get_name(),"In build_phase",UVM_NONE)
   
  if( get_config_int("is_active", active) ) 
   begin	 
	 
    `uvm_info(get_name()," get_config_int is Successful !! ",UVM_NONE)
     is_active = uvm_active_passive_enum'(active);
     
   end

endfunction

 endclass

 class test extends uvm_component ;

 `uvm_component_utils( test ) 
 `COMP_NEW

  agent ag ;

  function void build_phase ( uvm_phase phase ) ;
    `uvm_info(get_name(),"In build_phase",UVM_NONE)
    uvm_config_db#(int)::set(this,"*","is_active",101) ; // Value of 101 set from Test i.e Active ( Since LSB is 1 ) !! 
	 ag = new("ag",this) ; 
  endfunction

  function void end_of_elaboration_phase ( uvm_phase phase ) ;
     uvm_top.print_topology();
  endfunction
 
 
 endclass

 class my_class extends uvm_component ;

 `uvm_component_utils( my_class ) 
 `COMP_NEW

 function void build_phase ( uvm_phase phase ) ;
    `uvm_info(get_name(),"In build_phase",UVM_NONE)
	uvm_config_db#(int)::set(uvm_top,"*","is_active",100) ; // Value of 100 set i.e Passive ( Since LSB is 0 ) !! !! 
  endfunction

 endclass
 

my_class class_h ;

 initial begin
   
   class_h = new("class_h",null);
   run_test("test") ;

 end

```

Since “class\_h” and uvm\_test\_top i.e test are AT SAME LEVEL OF HIERARCHY , I expected get\_config\_int to be successful with is\_active set to UVM\_ACTIVE.

**But I notice that in Output get() isn’t successful**  
**Any thoughts ?**

Thanks in advance

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [June 20, 2020, 11:07pm UTC](https://verificationacademy.com/forums/t/config-db-set-from-same-level-of-hierarchy/37740/2 "2020-06-20T23:07:48Z")

</div>

_In reply to [MICRO\_91](https://verificationacademy.com/forums/t/config-db-set-from-same-level-of-hierarchy/37740):_

See [Usage of set\_config\_\* methods on global scope | Verification Academy](https://verificationacademy.com/forums/uvm/usage-setconfig-methods-global-scope#reply-40256)

---

<div class="post-metadata">

**Author:** ![MICRO\_91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/5f9b8f/32.png) [@MICRO\_91](https://verificationacademy.com/forums/u/MICRO_91)\
**Post date:** [June 21, 2020, 4:08pm UTC](https://verificationacademy.com/forums/t/config-db-set-from-same-level-of-hierarchy/37740/3 "2020-06-21T16:08:25Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/config-db-set-from-same-level-of-hierarchy/37740/2):_

Since the **type-parameter is different** the get() doesn’t succeed .

Thanks , Dave
