1. 从uvm_object扩展而来
1.1 uvm_object的method
get_name(), get_full_name(), get_type(),
UVM method的定制, 允许用户重新定义以上method的实现
do_print(), do_copy(), do_compare(), do_pack, do_unpack, do_record
1.2 uvm_sequence_item的method
get_item_context(), set_id_info()
get_transaction_id(), set_transaction_id(),
get_sequence_id(), set_sequence_id()
get_sequencer(), set_sequencer()
get_parent_sequence(), set_parent_sequence
1.3 举例
class transaction extends uvm_sequence_item;
rand bit [31:0] sa, da;
rand bit [7:0] payload[$];
transaction tr;
`uvm_object_utils_begin(transaction);
`uvm_field_int(sa, UVM_ALL_ON | UVM_NOCOPY)
`uvm_field_int(da, UVM_ALL_ON)
`uvm_field_queue_int(payload, UVM_ALL_ON)
`uvm_field_object(tr, UVM_ALL_ON)
`uvm_object_utils_end
endclass
1.4 `uvm_object_utils[_begin]实现了factory机制
1.5 uvm_field_*
`uvm_field_int, `uvm_field_real, `uvm_field_event, `uvm_field_object, `uvm_field_string, `uvm_field_enum
`uvm_field_sarray_* // fixed-sized array
`uvm_field_array_* // dynamic array
`uvm_field_queue_* // queue
`uvm_field_aa_* // associative array
1.6 flag
1.7 parameterized transaction class: 使用`uvm_object_param_utils_begin(class_name #(param))
class transaction #(width=48) extends uvm_sequence_item;
rand bit [width-1:0] data;
`uvm_object_param_utils_begin(transaction#(width))
`uvm_field_int(data, UVM_ALL_ON)
`uvm_object_utils_end
endclass
1.7.1 parameterized class创建举例
transaction tr = transaction#(16)::type_id::create("tr", this)
2. 使用uvm_sequence_item
2.1 定义一个base uvm_sequence_item
2.2 在testfile中,通过extend这个base uvm_sequence_item创建一个新的transaction
2.3 在testcase的build_phase中,通过调用set_inst_override_by_type或set_type_override_by_type用新的trasaction来覆盖base uvm_sequence_item
2.4 可以用aph_factory.print() 来显示整个架构,它也会显示那些被override的
2.5 这种方法可以增加property,method和constraint
2.6 使用时的general的方法