In my VPI call back function, I am getting real value for time, but units for this time value depends on timescale for the module where signal resides. How I can find what units for the provided time?
Here is my monitor VPI function:
my_monitor(p_cb_data cb_data_p)
{
unsigned int value, bit, i;
for(bit=1,value=0,i=strlen(cb_data_p->value->value.str) ; i ;i--){
// Convert string to hex value
value += cb_data_p->value->value.str[i-1]=='1' ? bit : 0; // TODO: Check for other values?
bit *= 2;
}
// Save to trace file
fprintf(pv_file_trace,"%15f(?s): %s = %s 0x%X\n",
cb_data_p->time->real,
cb_data_p->user_data,
cb_data_p->value->value.str, value);
}
Assuming the signal is declared in a module, you can do
I could not find I documented, but
ts
is in the scale of 10-ts in seconds