Thursday, October 25, 2018

UVM_DRIVER and UVM_SEQUENCER communication



To understand UVM_DRIVER and UVM_SEQUENCER relationship we need to first understand how uvm_driver and uvm_sequencer are coded in uvm library . 

UVM_DRIVER :-
class uvm_driver #(type REQ=uvm_sequence_item,
type RSP=REQ) extends uvm_component;
uvm_seq_item_pull_port #(REQ, RSP) seq_item_port;
uvm_analysis_port #(RSP) rsp_port;
REQ req;RSP rsp;.......endclass


In the above code we can see uvm_driver has seq_item_port which is pull type port . this port is used
to connect to the sequencer 
some time interviewer asks what kind of transfer method driver and sequencer use .we can see in
the above code uvm_seq_item_pull_port #(REQ, RSP) seq_item_port; this tell it is a pull type method . 

UVM_SEQUENCER :-

class uvm_sequencer #(type REQ=uvm_sequence_item, RSP=REQ)
extends uvm_sequencer_param_base #(REQ, RSP);
uvm_seq_item_pull_imp #(REQ, RSP, this_type) seq_item_export;


Above uvm_sequencer code we can see that sequencer is using seq_item_export to get connect with the driver .because this is pull type transfer , port will make a request of data and than export will provide the data . Driver and sequecer get connect in agent .

example :- drv.seq_item_port.connect(seqr.seq_item_export)

How transaction start and reach to driver :-
1. Driver will request for data using get_next_item , in the same time sequencer will check  for the
sequence which is started from the test case.
2. Once sequnce is started , by using arbitration sequencer will give a grant .
3. Sequence job is to select the sequence and give a grant based on the priority
4. Once grant is done Start_item will be execute because it was waiting for grant .
5. From the Finish Item ,data will be flowing to driver and will hold the process till
item_done recived from the driver .
I have captured this information directly from the uvm_driver , sequencer , sequence_base
class if you want in more details can check or relate in the following links
http://www.studio-muzzi.com/project/docs/UVMdocs_smu/uvm-1.1d/uvm__sequence__base_8svh_source.html
http://www.studio-muzzi.com/project/docs/UVMdocs_smu/uvm-1.1d/uvm__sequencer_8svh_source.html
http://www.studio-muzzi.com/project/docs/UVMdocs_smu/uvm-1.1d/uvm__driver_8svh_source.html

No comments:

Post a Comment