down vote
favorite
I want to use the following macro in uvm project
//---------------------------------------------------------
// General macros which contain sequence repeate
// in many places.
//---------------------------------------------------------
`ifndef MY_MACROS_SV
`define MY_MACROS_SV
// MACRO: 'my_fatal_err
//
// calls uvm_fatal in case the assertion is not correct
`define my_fatal(id, msg )
assert (file_p != 0) else
`uvm_fatal("FATAL ERROR", "FILE OPENED FAILED")
`endif //MY_MACROS_SV
I to call this macro from different classes (sequenece, driver, etc…) by:
`my_fatal("FATAL ERROR", "FILE OPENED FAILED")
When I try to compile this I got the following error:
** Error: (vlog-13069) ** while parsing file included at ./sv/girobo2_pkg.sv(4
)
** at .\sv\my_macros.sv(13): near “assert”: syntax error, unexpected assert ,
expecting class.