Hi!
I have found the stuff!! There is a particular directory structure we used to follow, and there were altogether 3 makefiles placed in diffent hierarchry
![Undecided Undecided](https://designers-guide.org/forum/Templates/Forum/default/undecided.gif)
We used ncsim. I know it doesnt help much...
Anyway, coming back to VPI calls. We wrote a task called mytestprog, and used to call it from the top level VerilogAMS module.
Code:.....
initial
$mytestprog($time);
always @(negedge clk)
$mytestprog($time-1);
....
Pretty simple! Just like a system task! Now the next thing (rather the first thing) wud be to define this task somewhere and let ur simulator know there exists a task like that. This step is called registering your function. The directory that I was talking abt, there we found already such a function (c code) provided. This one was called vpiregn.c. (Im bit doubtful whether it was there already or we just edited it). But I think we just had to edit it!! Just here and there... It looks like this ..
Code:extern int vpitest();
static s_vpi_systf_data systfTestList[] = {
{vpiSysTask, 0, "$mytestprog", vpitest, 0,0,0},
{0}
};
void setup_test_callbacks()
{
s_cb_data cb_data_s;
p_vpi_systf_data systf_data_p = &(systfTestList[0]);
while (systf_data_p->type)
{
vpi_register_systf(systf_data_p++);
if (vpi_chk_error(NULL))
{
vpi_printf("Error occured while setting up user %s\n",
"defined system tasks and functions.");
return;
}
}
}
Now the next thing is to define the task which is the funtion vpitest(). So we wrote another C code to define vpitest(), where we used different VPI handles and functions.
In the manual you will get defintion of all these functions. Use them to write that all important C function of yours.
Hope this helps to give you a start...
Rajdeep