所有用户定义的sequence items都是从 uvm_sequence_item 类扩展的,因为它利用生成激励并具有sequence-sequencer机制的控制功能。
11.1 uvm_sequence_item class hierarchy
如上图所示,uvm_sequence_item派生自uvm_transaction类。
它支持UVM object章节中讨论的所有方法,如copy, compare, clone, print等。
11.2 uvm_sequence_item example
class seq_item extends uvm_seqeunce_item;
rand int value;
rand color_type colors;
rand byte data[4];
rand bit [7:0] addr;
`uvm_object_utils_begin(my_object)
`uvm_field_int(value, UVM_ALL_ON)
`uvm_field_string(names, UVM_ALL_ON)
`uvm_field_enum(color_type, colors, UVM_ALL_ON)
`uvm_field_sarray_int(data, UVM_ALL_ON)
`uvm_field_int(addr, UVM_ALL_ON)
`uvm_object_utils_end
function new(string name = "my_object");
super.new(name);
endfunction
endclass