E
EdA
Guest
Hi,
Q1:
I have a callback as follows:
cbData.reason = cbEndOfSimulation;
cbData.user_data = (char *) ptr;
cbData.time = &time_callback;
cbData.value = NULL;
cbData.obj = NULL;
cbData.cb_rtn = myFinishSim;
vpi_register_cb(&cbData);
In the function "myFinishSim()" I have a "return(0)" at the end.
My feeling is I should let the simulator call "exit()" but users
of my library are complaining that the simulator is hanging. I
know my routine is being called.
Is there a better way? (Simulators are NC & VCS, VCS hangs)
Q2:
I register a task as follows:
static int something = 0;
static int something_else = 1;
systf.type = vpiSysTask;
systf.sysfunctype = 0;
systf.tfname = "$myModel";
systf.calltf = myModelCall;
systf.compiletf = myModelCompile;
systf.sizetf = NULL;
systf.user_data = (char *) &something;
I decided to get clever and register it again passing in
"something_else".
This works great in NC. I also am using VCS. And a TAB file with the
same call but different data so I've had to do the following:
#ifdef VPI_COMPLIANT
static int myModelCall(char *data)
#else
int myModelCall(int data, int reason)
#endif
Is there a better way?
Thanks,
/Ed
Q1:
I have a callback as follows:
cbData.reason = cbEndOfSimulation;
cbData.user_data = (char *) ptr;
cbData.time = &time_callback;
cbData.value = NULL;
cbData.obj = NULL;
cbData.cb_rtn = myFinishSim;
vpi_register_cb(&cbData);
In the function "myFinishSim()" I have a "return(0)" at the end.
My feeling is I should let the simulator call "exit()" but users
of my library are complaining that the simulator is hanging. I
know my routine is being called.
Is there a better way? (Simulators are NC & VCS, VCS hangs)
Q2:
I register a task as follows:
static int something = 0;
static int something_else = 1;
systf.type = vpiSysTask;
systf.sysfunctype = 0;
systf.tfname = "$myModel";
systf.calltf = myModelCall;
systf.compiletf = myModelCompile;
systf.sizetf = NULL;
systf.user_data = (char *) &something;
I decided to get clever and register it again passing in
"something_else".
This works great in NC. I also am using VCS. And a TAB file with the
same call but different data so I've had to do the following:
#ifdef VPI_COMPLIANT
static int myModelCall(char *data)
#else
int myModelCall(int data, int reason)
#endif
Is there a better way?
Thanks,
/Ed