Originally posted in cdnusers.org by ashvarma
Currently xsim does not support PLI function acc_fetch_paramval_str(). The work around is to write your own C code. Since we know it functions in a manner similar to acc_fetch_paramval() except that it returns a char*, we can use acc_fetch_paramval() and cast it to char *, something like this:
char *acc_fetch_paramval_str(handle h)
return((char *) (unsigned long) acc_fetch_paramval(h));
Compile this code from a C file such as:
gcc -c -I$AXIS_HOME/include mypli.c
Once you have compiled this file, link the .o object using "-pl mypli.o" option in xsim.
acc_fetch_paramval() cannot be used on 64-bit platforms to fetch a string value of a parameter, while acc_fetch_paramval_str() can be used on all platforms.