In reply to bachan21:
You could write
function bit check(Packet obj);
if(obj.a ||
obj.b ||
obj.c }}
obj.d ||
obj.e )
return 0;
else
return 1;
endfunction
Or if you are using the UVM’s field automation macros, you could pack all of the registered fields into an array and check that the array was all 0. However, that would be very inefficient.