1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <vpi_user.h> 4 5 static void show_value(const char * name)6show_value (const char *name) 7 { 8 vpiHandle net; 9 s_vpi_value val; 10 11 net = vpi_handle_by_name ((char *)name, NULL); 12 if (net == NULL) 13 { 14 printf ("cannot get net: %s\n", name); 15 exit(1); 16 return; 17 } 18 val.format = vpiBinStrVal; 19 vpi_get_value (net, &val); 20 printf ("%s= %s\n", name, val.value.str); 21 } 22 23 static PLI_INT32 vpi_proc(struct t_cb_data * cb)24vpi_proc (struct t_cb_data *cb) 25 { 26 show_value ("test_load.w"); 27 show_value ("test_load.\\extend.id\\"); 28 return 0; 29 } 30 my_handle_register(void)31static void my_handle_register(void) 32 { 33 s_cb_data cb; 34 35 cb.reason = cbEndOfCompile; 36 cb.cb_rtn = &vpi_proc; 37 cb.user_data = NULL; 38 if (vpi_register_cb (&cb) == NULL) 39 vpi_printf ("cannot register EndOfCompile call back\n"); 40 } 41 42 void (*vlog_startup_routines[]) () = 43 { 44 my_handle_register, 45 0 46 }; 47