How to print ovm messages from C code

Hello,

I have an OVM test which inturn calls Firmware code(in C). In the firmware c code can I print OVM messages(like ovm_info and ovm_error). And also can I terminate the test from the Firmware incase of any error? Example code below

int main( int argc, char **argv ){
for(i=0;i<=0x3C;i++){
 write(addr,val);
}
readVal = read(addr);
if(readVal != something)
{
  //Print ovm error msg and terminate the ovm test
}
}

Thanks.

In reply to sj1992:

If you mean you are calling your firmware C code by importing a DPI-C routine and calling it from your test, you can export the ovm_pkg::ovm_report_error routine to C and call it from there.

If that is not how you are calling the C code, you’ll need to explain better.