本文旨在通过一个小设计展示SystemVerilog Direct Programming Interface (DPI)的使用。这个小设计模拟了一...
The "check&save" for this more complex SV file shows the following errors: 22 package cmath; 23 import "DPI-C" function real sin(input real x); 24 endpackage // cmath 26 import cmath::*; <-- ERROR-1: Package cmath cannot be bound ! 28 // import tbObjPkg::*; <-- E...
The SystemVerilog DPI supports two types of functions: Pure Functions A nonvoid (must return a value) function which depends on only the input arguments and contains no side effects. They cannot: perform any file IO read or write anything (ie. no env variables, OS objects, shared memory, ...
Both DPI imported and exported functions can be declared in any place where normal SystemVerilog functions can be (e.g. package, module, program, interface, constructs). Also all functions used in DPI complete their execution instantly (zero simulation time), just as normal SystemVerilog functions...