Jump to content
karandeep963

FORK JOIN_NONE in UVM_SEQUENCE

Recommended Posts

class my_virtual_sequence extends uvm_sequence;
`uvm_sequence_utils(my_virtual sequence,my_v_sequencer)
exec_sequence eseq_inst[100];

...
virtual task body();

 for(int i = 0 ; i <100 ; i++)begin
 
     fork
       automatic int var = i; // this is not allowed , getting compilation error 
       `uvm_do_on(eseq_inst[var], p_sequencer.master_sequencer[var])
     join_none
 end
.....
some other piece of code                   
.....
endtask: body
endclass: my_virtual_sequence

Hi ,

As per the above code, I wanted to parallely fire 100 transactions on 100 different masters_sequncers.

Question 1: But it is not allowing to declare automatic variable before fork. what is alternative to this ?

Also Question 2: when we execute `uvm_do_on(eseq_inst[var],...) , so it creates an object and registers with factory.

Does for every iteration it registers with factory the same name eseq_inst[var] instead of value eseq_inst[0]/eseq_inst[1]/eseq_inst[3].

Since I checked UVM library and found 

 

 

`uvm_do_on_with implicity calls `uvm_create which further calls create_item()

as :

{ \
uvm_object_wrapper w_; \
w_ = SEQ_OR_ITEM.get_type(); \
$cast(SEQ_OR_ITEM , create_item(w_, SEQR, #SEQ_OR_ITEM));\
}
Definition at line 146 of file uvm_sequence_defines.svh.

while create_item has been defined as:
protected function uvm_sequence_item create_item(
uvm_object_wrapper type_var,
uvm_sequencer_base l_sequencer,
string name
)
 

So what is the work around to this if one wants to execute it with `uvm_do_* .

May be using seq.start(sequncer) can be solution , but wandering if I can do it `uvm_do.

 

Thanks

Share this post


Link to post
Share on other sites

Great many thanks Tudor , I  overlooked it .  

Also can you please also provide your expertise feedback on :

 

Question 2: when we execute `uvm_do_on(eseq_inst[va],...) , so it creates an object and registers with factory.

Does for every iteration it registers with factory the same name eseq_inst[va] instead of value eseq_inst[0]/eseq_inst[1]/eseq_inst[3].

as per UVM library :

 

`uvm_do_on_with implicity calls `uvm_create which further calls create_item()

as :

{ \
uvm_object_wrapper w_; \
w_ = SEQ_OR_ITEM.get_type(); \
$cast(SEQ_OR_ITEM , create_item(w_, SEQR, #SEQ_OR_ITEM));\
}
Definition at line 146 of file uvm_sequence_defines.svh.

while create_item has been defined as:
protected function uvm_sequence_item create_item(
uvm_object_wrapper type_var,
uvm_sequencer_base l_sequencer,
string name
)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×