How to use do_not_randomize in my local UVM envt

Hi,
There is a variable do_not_randomize in uvm_sequence_base which is declared as :

// Variable: do_not_randomize
//
// If set, prevents the sequence from being randomized before being executed
// by the uvm_do*() and uvm_rand_send*() macros,
// or as a default sequence.
//
bit do_not_randomize;

As mentioned in its comment, how do I set it in my environment? I have a `uvm_send(item) called inside one of my sequences extended from uvm_sequence. And this sequence is declared as default_sequence. I dont want the ‘item’ to get randomized, hence the experiment. Have anybody tried this?

thanks
Shyam

Hi myashu,

Add this inside your environment:


uvm_config_db #(int)::set(this, "path_to_your_running_sequencer.*", "do_not_randomize", 1);

And this in your default_sequence (your base sequence):


uvm_config_db #(int)::get(null, get_full_name(), "do_not_randomize", do_not_randomize);

It should solve your problem.

An,

In reply to An Pham:

Hi An,
I tried your solution, but somehow it doesn’t work in my case. Will it override the do_not_sequence in the uvm_sequence_base?
I had set the do_not_randomize as you suggested in the build_phase of my test, above the line in which I set my default_sequence.
And in the body() of my sequence which was set as default _sequence I get() it. I displayed the value of do_not_randomize and it displayed 1. But the randomization is still happening as per my constraints. Any suggestions???

thanks
myashu

In reply to myashu:

Hi myashu,

If you look at the UVM library code, you will see that do_not_randomize is only used by some UVM macros such as the uvm_do*() and uvm_rand_send*() macros.
If you are using `uvm_send(item) macro. It simply expands to this:


begin
  uvm_sequence_base __seq;
  if (!$cast(__seq,item)) begin
     start_item(item, -1);
     finish_item(item, -1);
  end
  else __seq.start(__seq.get_sequencer(), this, -1, 0);
end

You can see that it does not affected by do_not_randomize. So if your item is randomized, please check your code. It must be randomized somewhere in your code.

An,