User guide
xiv
Support for the vpi_register_systf Routine. . . . . . . . . . . . . . . 17-31
PLI Table File for VPI Routines . . . . . . . . . . . . . . . . . . . . . . . 17-32
Integrating a VPI Application With VCS. . . . . . . . . . . . . . . . . 17-32
Writing Your Own main() Routine . . . . . . . . . . . . . . . . . . . . . . . . 17-34
18. DirectC Interface
Using Direct C/C++ Function Calls . . . . . . . . . . . . . . . . . . . . . . . 18-3
How C/C++ Functions Work in a Verilog Environment . . . . . 18-5
Declaring the C/C++ Function . . . . . . . . . . . . . . . . . . . . . . . . 18-6
Calling the C/C++ Function . . . . . . . . . . . . . . . . . . . . . . . . . . 18-12
Storing Vector Values in Machine Memory . . . . . . . . . . . . . . 18-14
Converting Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-17
Avoiding a Naming Problem . . . . . . . . . . . . . . . . . . . . . . . . . 18-19
Using Direct Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-20
Using the vc_hdrs.h File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-27
Access Routines for Multi-Dimensional Arrays . . . . . . . . . . . 18-28
UB *vc_arrayElemRef(UB*, U, ...) . . . . . . . . . . . . . . . . . . 18-28
U vc_getSize(UB*,U) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-29
Using Abstract Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-29
Using vc_handle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-30
Using Access Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-31
int vc_isScalar(vc_handle) . . . . . . . . . . . . . . . . . . . . . . . . 18-32
int vc_isVector(vc_handle) . . . . . . . . . . . . . . . . . . . . . . . . 18-33
int vc_isMemory(vc_handle). . . . . . . . . . . . . . . . . . . . . . . 18-34
int vc_is4state(vc_handle) . . . . . . . . . . . . . . . . . . . . . . . . 18-35
int vc_is2state(vc_handle) . . . . . . . . . . . . . . . . . . . . . . . . 18-36