Uvmmethods
Uvmmethods
svh"
import uvm_pkg::*;
`uvm_object_utils_begin(temp_class)
`uvm_field_int(tmp_addr, UVM_ALL_ON)
`uvm_field_int(tmp_data, UVM_ALL_ON)
`uvm_object_utils_end
endclass
`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_field_object(tmp, UVM_ALL_ON)
`uvm_object_utils_end
`uvm_component_utils(my_test)
my_object unpack_obj;
`uvm_info("Test","Initial", UVM_NONE);
assert(obj_A.randomize());
obj_A.print();
assert(obj_B.randomize());
obj_B.print();
`uvm_info("Test","Reset", UVM_NONE);
assert(obj_A.randomize());
obj_A.print();
assert(obj_B.randomize());
obj_B.print();
if(obj_B.compare(obj_A))
`uvm_info("Test","Compare A & B", UVM_NONE);
endfunction
endclass
module tb_top;
initial begin
run_test("my_test");
end
endmodule