Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 #include<stdio.h>
- 2 #include<stdlib.h>
- 3 #include"./include/vpi_user.h"
- 4 PLI_INT32 hello(PLI_BYTE8 *user_data){
- 5 vpi_printf("hello world!n");
- 6 return 0;
- 7 }
- 8
- 9 void hello_register()
- 10 {
- 11 s_vpi_systf_data tf_data;
- 12 tf_data.type=vpiSysTask;
- 13 tf_data.sysfunctype=0;
- 14 tf_data.tfname="$hello";
- 15 tf_data.calltf=hello;
- 16 tf_data.compiletf=NULL;
- 17 tf_data.sizetf=NULL;
- 18 tf_data.user_data=NULL;
- 19 vpi_register_systf(&tf_data);
- 20 }
- 23 #include <stdarg.h>
- 24 #include "./../include/vpi_user.h"
- 25 #include "./../include/vpi_user_cds.h"
- 26 #include "./../hello.c"
- 27 /*
- 28 extern void register_hello();
- 29
- 30 void (*vlog_startup_routines[])() =
- 31 {
- 32 register_hello,0
- 33 };
- 34 */
- 35 /* ----------------------------------------------------------------
- 36 The following is an example of what should be included in this
- file:
- 37
- 38 extern void setup_my_callbacks(); <-- Add a declaration for your routine.
- 39
- 40 void (*vlog_startup_routines[])() =
- 41 {
- 42 $*** add user entries here ***$
- 43
- 44 setup_my_callbacks, <-- Add your routine to the table.
- 45 hello_re
- 46 0 $*** final entry must be 0 ***$
- 47
- 48 };
- 49 ------------------------------------------------------------------ */
- 50
- 51 extern void register_hello();
- 52 void (*vlog_startup_routines[VPI_MAXARRAY])() =
- 53 {
- 54
- 55 register_hello,0
- 56 /*** final entry must be 0 ***/
- 57 };
- 1.gcc vpi_user.c -fPIC -shared -o hello_vpi.so
- 2.ncverilog hello_pli.v +access+rwc -loadvpi ./hello_vpi.so:register_hello
Add Comment
Please, Sign In to add comment