User guide
17-34
Using the PLI
• -load /usr/lib/mylib.so:my_register
The registration routine my_register() is in lib1.so, which is in /usr/
lib/mylib.so, and not in the LD_LIBRARY_PATH environment
variable.
Writing Your Own main() Routine
You write your own main() routine if you wrote your PLI application
in C++ code or if your standard C code application does some
processing before starting the simv executable.
When you write your own main() routine you must include the -e
compile-time option on the vcs command line. The syntax is as
follows:
-e new_name_for_main
For example:
vcs -P my_main.tab my_main.cc -e SimvMain source.v
The contents of my_main.cc is as follows:
#if defined(__cplusplus)
extern "C" {
#endif
extern int SimvMain(int argc, char *argv[]);
extern void vcs_atexit (void(*pfun)(int code));
#if defined(__cplusplus)
}
#endif