I have been working on some code conversion from OVM to UVM. I came across a potential OVM issue where the associative array was registered with OVM_NOPRINT that got pass through the OVM_COMPARE also.
I have a class in OVM that is registered with flag OVM_NOPRINT as shown below. I am setting some of the fields in one object and not setting them in another object. I would expect the compare method to fail over here. But it passes in OVM, while it fails in UVM:
class A extends ovm_object;
bit [7:0] syndrome[int] = '{ default: 0 };
`ovm_object_utils_begin(A)
`ovm_field_aa_int_int(syndrome, OVM_NOPRINT) // Only NOPRINT flag given
//`ovm_field_aa_int_int(syndrome, OVM_DEFAULT) // This will shout for an error
`ovm_object_utils_end
function new(string name = "A");
super.new(name);
endfunction
endclass
// Somewhere in top module
A a,b;
initial begin
a = A::type_id::create("a");
b = A::type_id::create("b");
a.syndrome[1] = 5; // Add single element in object a. Not element in object b.
if(a.compare(b)) begin
$display("COMPARE PASS");
end else begin
$display("COMPARE FAIL");
end
end
// output OVM:
COMPARE PASS
// output UVM:
UVM_INFO /apps/vcsmx/etc/uvm-1.2/src/base/uvm_comparer.svh(351) @ 0: reporter [MISCMP] Miscompare for a: lhs size = 1 : rhs size = 0
UVM_INFO /apps/vcsmx/etc/uvm-1.2/src/base/uvm_comparer.svh(382) @ 0: reporter [MISCMP] 2 Miscompare(s) (1 shown) for object b@336 vs. a@335
COMPARE FAIL
The above code shows compare pass for OVM (unexpected). While it shows compare fail in UVM (expectedly). Here is the sample code at EDAPlayground here. Can anyone please explain me why the NOPRINT also supresses the COMPARE in OVM?