aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue98/vpi1.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/issue98/vpi1.c')
-rw-r--r--testsuite/gna/issue98/vpi1.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/gna/issue98/vpi1.c b/testsuite/gna/issue98/vpi1.c
new file mode 100644
index 000000000..0adae07fe
--- /dev/null
+++ b/testsuite/gna/issue98/vpi1.c
@@ -0,0 +1,36 @@
+#include <stdio.h>
+#include <vpi_user.h>
+
+void
+vpi_proc (void)
+{
+ vpiHandle net;
+ s_vpi_value val;
+
+ net = vpi_handle_by_name ("test_load.dat_o", NULL);
+ if (net == NULL)
+ {
+ printf ("cannot get net\n");
+ return;
+ }
+ val.format = vpiBinStrVal;
+ vpi_get_value (net, &val);
+ printf ("value: %s\n", val.value.str);
+}
+
+void my_handle_register()
+{
+ s_cb_data cb;
+
+ cb.reason = cbEndOfCompile;
+ cb.cb_rtn = &vpi_proc;
+ cb.user_data = NULL;
+ if (vpi_register_cb (&cb) == NULL)
+ vpi_printf ("cannot register EndOfCompile call back\n");
+}
+
+void (*vlog_startup_routines[]) () =
+{
+ my_handle_register,
+ 0
+};