I'm following http://cluelogic.com/2013/01/uvm-tutorial-for-candy-lovers-do-hooks/ and https://verificationacademy.com/cookbook/transaction/methods to implement compare the only difference is instead of big logical AND (&&) I'm using
virtual function bit do_compare ....
do_compare &= <statement A>;
do_compare &= <statement B>;
$display (do_compare); ///< this displays 1
return do_compare;
endfunction
However returned value always comes out to be 0 for e.g. consider sequences
temp = m.compare(n);
$display (temp); ///< displays 0
I've been trying to debug why temp is always 0 but couldn't figure out. Can anyone point me in right direction