2011年6月13日 星期一

UVM Virtual Sequences(一)

一個virtual sequence

A virtual sequence use `uvm_do_on or `uvm_do_on_with to execute sequences on any of the
subsequencers connected to the current virtual sequencer.

A virtual sequence uses `uvm_do or `uvm_do_with to execute other virtual sequences of this
sequencer. A virtual sequence cannot use `uvm_do or `uvm_do_with to execute items. Virtual sequencers do not have items associated with them, only sequences.


examle

class simple_virt_seq extends uvm_sequence;
... // Constructor and UVM automation macros
// Required to be able to use p_sequencer
`uvm_declare_p_sequencer(simple_virtual_sequencer)
// A sequence from the cpu sequencer library
cpu_config_seq conf_seq;
// A sequence from the ethernet subsequencer library
eth_large_payload_seq frame_seq;
// A virtual sequence from this sequencer's library
random_traffic_virt_seq rand_virt_seq;
virtual task body();
// Invoke a sequence in the cpu subsequencer.
`uvm_do_on(conf_seq, p_sequencer.cpu_seqr)
// Invoke a sequence in the ethernet subsequencer.
`uvm_do_on(frame_seq, p_sequencer.eth_seqr) //執行其它普通的sequence
// Invoke another virtual sequence in this sequencer.
`uvm_do(rand_virt_seq) //執行另一個virtual sequence
endtask : body
endclass : simple_virt_seq

沒有留言: