是否可以配置Aldec Riviera PRO模拟器来破坏$error
或$warning
SystemVerilog调用上的模拟?如果是,那又是怎么回事?
发布于 2015-09-14 01:06:35
我不认为将$error
或$warning
提升到Riviera的断点上有一个特定的配置选项,尽管值得与他们的支持进行检查。你确实有几个选择:
$error
替换为$fatal
第二种选择如下所示:
#include "vpi_user.h"
// System function overload on $warning and $error to stop sim
static int system_function_overload(char *userdata)
{
vpiHandle systfref, args_iter, argh;
struct t_vpi_value argval;
const char *msg = "*** NO MESSAGE PROVIDED ***";
// Obtain a handle to the argument list
systfref = vpi_handle(vpiSysTfCall, NULL);
args_iter = vpi_iterate(vpiArgument, systfref);
// Pull out the string passed in as the first argument
if (args_iter) {
argh = vpi_scan(args_iter);
argval.format = vpiStringVal;
vpi_get_value(argh, &argval);
vpi_free_object(args_iter);
msg = argval.value.str;
}
vpi_printf("BREAK sim from %s:%d with msg %s\n",
vpi_get_str(vpiFile, systfref),
vpi_get(vpiLineNo, systfref),
msg);
vpi_control(vpiStop);
return 0;
}
static void register_system_functions(void)
{
s_vpi_systf_data tfData = { vpiSysTask, vpiSysTask };
tfData.sizetf = NULL;
tfData.compiletf = system_function_compiletf;
tfData.calltf = system_function_overload;
tfData.user_data = NULL;
tfData.tfname = "$warning";
vpi_register_systf( &tfData );
tfData.tfname = "$error";
vpi_register_systf( &tfData );
}
void (*vlog_startup_routines[])(void) = {
register_system_functions,
0
};
https://stackoverflow.com/questions/32551892
复制