aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue98/vpi1.c
blob: 0adae07fe48700db9f4b2fc0c93ac6cabd002661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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
};