CVER PLI HOW TO

1. Compile CVER
$cd cver/src
$make -f makefile.freebsd all (For FreeBSD machine)
or
$make -f makefile.lnx all (for Linux machine)
$cd cver/ tests_and_examples/examples.vpi/
$sh inst_pli.sh lnx (test vpi examples on the machine)

Why is the OS dynamic loader unable to find my .so PLI program libraries?


When Cver is unable to find dynamic libraries that needed to be loaded because they are coded as the +loadvpi=[library]:[boostrap routine] or +loadpli1=[library][boostrap routine] library field, error message 1803 is emitted. The error messages contains the reason for dynamic library load failure. The most common reason is "No such file or directory". The most common cause of this error is that you forgot to set the OS LD_LIBRARY_PATH environment variable. Even if you keep your dynamic libraries in the same directory in which you run your simulation, you must set the LD_LIBRARY_PATH environment variable to '.' (current directory). You do not need to include the .so suffix on your library name since Cver first tries name as it appears and then try again with .so suffix appended.

Include file vpi_user.h, #include "cver/pli_incs/vpi_user.h" #include "cver/pli_incs/cv_vpi_user.h"

CVER with PLI

Assume you have this register routine

void hello_world_register(){

  s_vpi_systf_data tf_data;

  tf_data.type    = vpiSysTask;
  tf_data.sysfunctype = 0;
  tf_data.tfname = "$hello_world";
  tf_data.calltf = hello_world_calltf;
  tf_data.compiletf = hello_world_compiletf;
  tf_data.sizetf    = NULL;
  tf_data.user_data = NULL;
  vpi_register_systf(&tf_data);
}

To insert following lines into PLI .c file to make CVER take PLI call

void (*vlog_startup_routines[])() = {
  /*** add user entries here ***/
  hello_world_register,
  0 /*** final entry must be 0 ***/
};


/* dummy +loadvpi= boostrap routine - mimics old style exec all routines */
/* in standard PLI vlog_startup_routines */
void vpi_compat_bootstrap(void){
    int i;
    for (i = 0;; i++){
        if (vlog_startup_routines[i] == NULL) break;
        vlog_startup_routines[i]();
    }
}


Qing XU
Last modified: Wed Jul 26 17:11:22 EDT 2006