Hey there, hope you are all doing well. I’m starting UVM and practicing on it. I’m having a rather odd problem that when I use compare method to check for mismatches, it always gives only single mismatch. Although, when I print the 2 classes, there are several mismatches. Here is the code that I’m using for defining the macros:
`uvm_object_utils_begin( yapp_packet )
`uvm_field_array_int( payload, UVM_ALL_ON | UVM_BIN )
`uvm_field_int( parity, UVM_ALL_ON | UVM_BIN )
`uvm_field_int( addr, UVM_ALL_ON | UVM_BIN )
`uvm_field_int( length, UVM_ALL_ON | UVM_DEC )
`uvm_field_enum( parity_t, parity_type, UVM_ALL_ON | UVM_BIN)
`uvm_field_int( packet_delay, UVM_ALL_ON | UVM_DEC | UVM_NOCOMPARE)
`uvm_object_utils_end
and here is the output:
COPY
-----------------------------------------------
Name Type Size Value
-----------------------------------------------
copy_packet yapp_packet - @2585
payload da(integral) 3 -
[0] integral 8 'b10111
[1] integral 8 'b10001011
[2] integral 8 'b10001001
parity integral 8 'b11000
addr integral 2 'b1
length integral 8 'd3
parity_type parity_t 32 GOOD_PARITY
packet_delay integral 32 'd4
-----------------------------------------------
Randomized
-----------------------------------------------
Name Type Size Value
-----------------------------------------------
packet yapp_packet - @2618
payload da(integral) 3 -
[0] integral 8 'b1011000
[1] integral 8 'b11101111
[2] integral 8 'b1001
parity integral 8 'b10110000
addr integral 2 'b10
length integral 8 'd3
parity_type parity_t 32 GOOD_PARITY
packet_delay integral 32 'd17
-----------------------------------------------
UVM_INFO @ 0: reporter [MISCMP] Miscompare for copy_packet.payload:
UVM_INFO @ 0: reporter [MISCMP] 1 Miscompare(s) for object packet@2618 vs. copy_packet@2585
ncsim: *W,RNQUIE: Simulation is complete.
Following is the code that I’m using in tb_top.sv:
$display( "\nCOPY" );
copy_packet.copy( packet );
copy_packet.print();
$display( "\nRandomized" );
ok = packet.randomize();
packet.print();
ok = copy_packet.compare( packet );