Unable to link PLI with system verilog based code

Hi,
I am trying to link a pli to my system verilog(vmm) based code in questasim 10.0c simulator.
I am able to compile “c” code and generate the “.o” file but at simulation,simulator giving warning “System task or function ‘$sup_drv’ is not defined.”.
I am unable to understand why simulator unable to recognize “$sup_drv”.So please give your input and correct me if have done something incorrect.

Providing command line used for compilation and simulation.
compile:
vlib mylib;
vmap work mylib;
vlog -mfcu -sv +incdir+$(VMM_HOME)/sv +incdir+ +incdir+…/qsim …/qsim/device_tb.sv;
gcc -c -g -I/tool/questa_sim/questasim/include …/pli/sup_drv.c;
ld -shared -E -o sup_drv.sl sup_drv.o

sim:
vsim -c -do $(DO_LIST) -pli ./sup_drv.sl

My c code snippet –
#include “veriuser.h”
#include “acc_user.h”
#include “vpi_user.h”
#include “svdpi.h”

int sup_drv_checktf (),sup_drv_calltf ();
s_tfcell veriusertfs = {
{usertask, 0, sup_drv_checktf, 0, sup_drve_calltf, 0, “$sup_drv”},
{0}
};

int sup_drv_checktf()
{
//some checks
}

int sup_drv_calltf()
{

char *sim_time;
char *mod_name;
int result;

acc_initialize();
//some operation
tf_putrealp(0,result);

return (0);
}

Thanks
Kiran

Look at your vsim log file and make sure you see

Loading ./sup_drv.sl…

Check to make sure your simulation and sl file are both 64 or 32 bit binaries. Unless you need the memory capacity of 64-bit, we recommend keeping everything in 32-bit mode for better performance.

In reply to dave_59:

Thanks Dave for your feedback.
I have looked for “Loading ./sup_drv.sl” as you suggested ,but it is not there.Any clue why?
BTW my simulator is 64 bit and “sl” file is 32 bit binaries.

Thanks
Kiran

In reply to kiru2006:

I have found some issues in do file itself.After fixing that I am able to load the “sup_drv.sl”.But after that simulator is showing “Error :Expected system function , not system task ‘$sup_drv’” .
Any clue why this error ?
code snippet of how I am using $sup_drv :

wire [3:0] io_sup_drv;
assign io_sup_drv = $sup_drv(io1,io2);

Thanks
Kiran

In reply to kiru2006:

Change

{user**task**, 0, sup_drv_checktf, 0, sup_drve_calltf, 0, "$sup_drv"},

to

{user**function**, 0, sup_drv_checktf, sup_drv_sizetf, sup_drve_calltf, 0, "$sup_drv"},

You will need to add sup_drv_sizetf which returns the size of the return value.

In reply to dave_59:

Thanks Dave for your input.Now I am able to load the PLI.

Thanks
Kiran