【发布时间】:2016-10-19 14:41:43
【问题描述】:
我想在uvm项目中使用如下宏
//---------------------------------------------------------
// 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
我通过以下方式从不同的类(序列、驱动程序等)调用此宏:
`my_fatal("FATAL ERROR", "FILE OPENED FAILED")
当我尝试编译它时,我得到了以下错误:
# ** 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.
【问题讨论】:
-
您没有在函数中使用 id 和 msg 参数
标签: macros verilog system-verilog uvm