1

I know that it's possible to change the values of signals and variables via the Verilog Programming Interface (VPI). It's also possible to trigger a named event, by doing a vpi_put_value(...) on it.

Is it somehow possible to call a function or to start a task?

Laurel
  • 5,965
  • 14
  • 31
  • 57
Tudor Timi
  • 7,453
  • 1
  • 24
  • 53

1 Answers1

1

The VPI does not let you call tasks or functions from C, but the DPI does. Technically, the DPI only allows you to call SystemVerilog routines from C routines that have been called from SystemVerilog. The DPI has an import/export mechanism that needs to maintain the process identities of all threads created by your SystemVerilog code.

dave_59
  • 39,096
  • 3
  • 24
  • 63
  • That's not what I'm looking for. Going through the DPI means that I have to export the function. What I wanted to do is get a handle to a class object and use the VPI to call it's functions (i.e. reflection). – Tudor Timi May 22 '16 at 14:51
  • You can't pass class handles across the language boundary. What you need to do is create a wrapper function that you can export and that function can call the class method. – dave_59 May 23 '16 at 04:15