User guide
21-101
OpenVera Native Testbench
result = a.pack(arr,index,left,right,0);
}
program MyTest
{
integer k = 0, j = 0;
repeat (20)
{
@(posedge CLOCK);
fork
{
for (j = 0; j < 200; j++)
{
k = k + 1;
MyPack(k);
}
}
{
for(j = 1; j < 100000; j++)
k ++;
DPI_call(1, 2);
}
join all
}
@(posedge CLOCK);
}
Example 21-11 dpi.c
#include <svdpi.h>
static int tmp;
static void do_activity(int j)
{
int i;
for( i = 0; i < 1000; i++ )
{
tmp ^= j + i;
}
}