uvm中item函数模版 do_copy/do_compare/convert2string
来自糖果爱好者32
//------------------------------------------------------------------------------
// Class: jelly_bean_transaction
//------------------------------------------------------------------------------
class jelly_bean_transaction extends uvm_sequence_item;
`uvm_object_utils( jelly_bean_transaction )
randc flavor_e flavor;
rand color_e color;
rand bit sugar_free;
rand bit sour;
taste_e taste;
constraint flavor_color_con {
flavor != NO_FLAVOR;
flavor == APPLE -> color != BLUE;
flavor == BLUEBERRY -> color == BLUE;
}
//----------------------------------------------------------------------------
// Function: new
//----------------------------------------------------------------------------
function new( string name = "jelly_bean_transaction" );
super.new( name );
endfunction: new
//----------------------------------------------------------------------------
// Function: do_copy
//----------------------------------------------------------------------------
virtual function void do_copy