FEC

in my compare method if condition not excuting means my compersion sucessfull, functionality wise it is correct it reduce to code coverage due to not excution of if condition ,
please tell me how to overcome to this issue because it redude coverage.


function bit compare(sata_trans rcv, output string message);

compare='b0;
begin
if(  this.MB2IP_Addr_pin !=rcv.MB2IP_Addr_pin &&
     this.MB2IP_Data_pin !=rcv.MB2IP_Data_pin &&
     this.MB2IP_CS_pin   !=rcv.MB2IP_CS_pin   &&
     this.MB2IP_RNW_pin  !=rcv.MB2IP_RNW_pin  &&
     this.address_audio  !=rcv.address_audio  &&
     this.done           !=rcv.done           &&
     this.count1         !=rcv.count1         &&
     this.state          !=rcv.state

  )

      begin
                 // $display($time);
                // message="=============== DATA_MISMATCH=================";
       return(0);
      end

else
       begin
         $display($time);
         message="================== SUCESSFULLY_COMPARED=======";
         return(1);
      end
           
end
endfunction

In reply to uvm_verification:

If the DUT is behaving perfectly then it’s possible that code coverage for the test infrastructure cannot reach 100 %. This is where you would write tests for the test infrastructure. In your example, you would have a test that directly calls the compare method with rcv values that cause the comparison to fail.