uvm_sequence_item——sequence机制(一)

让子弹飞一会

 

  UVM框架,将验证平台和激励分开,env以下属于平台部分,test和sequence属于激励,这样各司其职。我们可以将sequence_item 比喻成子弹,sequencer 类比成弹夹,UVM平台就是个枪。如图所示uvm_sequence 的类继承关系。

The sequence item is written by extending the uvm_sequence_item, uvm_sequence_item inherits from the uvm_object via the uvm_transaction class.

 

 

//------------------------------------------------------------------------------
//
// CLASS: uvm_sequence_item
//
// The base class for user-defined sequence items and also the base class for
// the uvm_sequence class. The uvm_sequence_item class provides the basic
// functionality for objects, both sequence items and sequences, to operate in
// the sequence mechanism.
//
//------------------------------------------------------------------------------

class uvm_sequence_item extends uvm_transaction;

  local      int                m_sequence_id = -1;
  protected  bit                m_use_sequence_info;
  protected  int                m_depth = -1;
  protected  uvm_sequencer_base m_sequencer;
  protected  uvm_sequence_base  m_parent_sequence;
  static     bit issued1,issued2;
  bit        print_sequence_info;


  // Function: new
  //
  // The constructor method for uvm_sequence_item. 
  
  function new (string name = "uvm_sequence_item");
    super.new(name);
  endfunction

  function string get_type_name();
    return "uvm_sequence_item";
  endfunction 

  // Macro for factory creation
  `uvm_object_registry(uvm_sequence_item, "uvm_sequence_item")

   ......
endclass

 

参考文献:
 

posted on 2017-11-30 20:04  dpc525  阅读(1923)  评论(0编辑  收藏  举报

导航