uvm_config_db#(T) labels uniqness within same scope

uvm_config_db#(TYPE)::set(this, “*”, “label”, value)

Let’s say , we are using config db within same scope of different type with same label.

Case1 : uvm_config_db#(int)::set(uvm_root::get(),““,“counter”,cnt);
Case2 : uvm_config_db#(string)::set(uvm_root::get(),”
”,“counter”,str);

From this I understand that,static set methods are called from uvm_config_db#(int) & uvm_config_db#(string) which are considered different class as parameterized with different type.

Now when I use same label “counter” to share variables of type int and string among other components within same scope (here global).

Q1 : Is this valid ? If not, why ?
Q2 : Lookup table is in form of associative array ? If not, which way it is implemented ?
Q3 : What is the structure inside uvm_config_db class which keeps track of scope and while setting and getting ?

Reference doc : https://www.verilab.com/files/configdb_dvcon2014_1.pdf

In reply to jkpatel:

It is valid and it gets the int & string respectively when using the get.

`include "uvm_macros.svh"
import uvm_pkg::*;

class test extends uvm_test;
  `uvm_component_utils(test)
  
  function new(string name = "test", uvm_component parent);
    super.new(name, parent);
  endfunction
  
  int cnt;
  string str;
  
  function void build_phase(uvm_phase phase);
    super.build_phase(phase);
    void'(uvm_config_db#(int)::get(null,"*", "counter", cnt));
    void'(uvm_config_db#(string)::get(null, "*", "counter", str));
    $display(cnt,str);
  endfunction
  
endclass

  module aaa;

    int cnt;
    string str;
    test t1;
    
    initial begin
      	cnt = 10;
      	str = "AA";
		uvm_config_db#(int)::set(uvm_root::get(),"*","counter",cnt);
		uvm_config_db#(string)::set(uvm_root::get(),"*","counter",str);
      t1 = test::type_id::create("test",null);
      run_test();
    end
  endmodule

In reply to yourcheers:

Thanks a lot, any idea about Q2,Q3 ?