Uvm_config_db get doesn't get the expected value

I set the following calue in the build of the test:

class tx_test extends test_base;
   function void build_phase(uvm_phase phase);
      super.build_phase(phase);
      uvm_config_db #(int) :: set (this, "*", "mem_int_min", 5);
      uvm_config_db #(int) :: set (this, "*", "mem_int_max", 12);
      .....
   endfunction: build_phase
   .....
endclass: tx_test

In the base_transaction class I want to get above values by:

class base_transaction extends uvm_sequence_item();
 function int my_randomize_int(int seed, int mem, string mem_name);
      .....
      int  max, min;
      string mem_name_max = {mem_name, "_max"};
      string mem_name_min = {mem_name, "_min"};
      uvm_config_db #(int)::get(null, "", "mem_int_max", max);
      uvm_config_db #(int)::get(null, "", "mem_int_min", min);
      // temp = $urandom_range(1,11);
      mem = ($urandom_range(max,min));
      //data_xi = temp1 - 1;
      if(mem != 0)
	return mem;
      else
	return 0;
   endfunction: my_randomize_int  
  .....          
endclass: base_transaction

I don’t get the correct values (I got 0 instead).

In reply to saritr:

Use uvm_root :: get() instead of this in 1st argument of set function.

      uvm_config_db #(int) :: set (uvm_root :: get(), "*", "mem_int_min", 5);

In reply to kerulmodi:

Why it suppose to work this way?
And why can’t I use this (in the cntxt) of the get in the transaction?

Why is your get pointing to null? Shouldn’t it be pointing to “this” instead, like so:

uvm_config_db #(int)::get(this, "", "mem_int_max", max);
uvm_config_db #(int)::get(this, "", "mem_int_min", min);

Let me know if this works.

Also, you may want to consider putting all these configuration flags inside a configuration class, and then using the config db to point to the class.

In reply to arun.dsouza@arm.com:

Basically in sequence objects , get retrives the values .


1. get the scope of hierarchy 

string scope = "";

scope = get_full_name();

uvm_config_db#(int)::get(null, scope, "mem_int_max", max) .. same for min 

or 

uvm_config_db#(int)::get(null, get_full_name(), "mem_int_max", max) .. same for min 

In reply to kddholak:

EDIT:
You’re right, here’s the article referencing it:
Configuring Sequences