User guide

E-8
PLI Access Routines
memhand = acc_handle_tfarg(1);
if(!memhand) error_handle("NULL MEM HANDLE\n");
row = acc_fetch_tfarg_int(2);
start_bit = acc_fetch_tfarg_int(3);
len = acc_fetch_tfarg_int(4);
value = acc_getmem_int(memhand, row, start_bit, len);
printf("getmem: value of word %d is : %d\n",row,value);
fflush(stdout);
}
void clear_mem()
{
handle memhand = NULL;
memhand = acc_handle_tfarg(1);
if(!memhand) error_handle("NULL MEM HANDLE\n");
acc_clearmem_int(memhand);
}
The function with the set_mem identifier calls the IEEE standard
acc_fetch_tfarg_int routine to get the handles for arguments
to the user-defined system task that you associate with this function
in the PLI table file. It then assigns the handles to local variables and
calls acc_setmem_int to write to the specified memory in the
specified word, start bit, for the specified length.
Similarly, the function with the get_mem identifier calls the
acc_fetch_tfarg_int routine to get the handles for arguments
to a user-defined system task and assign them to local variables. It
then calls acc_gtetmem_int to read from the specified memory in
the specified word, starting with the specified start bit for the specified
length. It then displays the word index of the memory and its value.