• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
          • Vl-module
          • Vl-vardecl
          • Vl-fundecl
          • Vl-interface
          • Vl-design
          • Vl-assign
          • Vl-modinst
          • Vl-gateinst
          • Vl-taskdecl
          • Vl-portdecl
          • Vl-commentmap
          • Vl-dpiimport
            • Vl-dpiimport-fix
            • Vl-dpiimport-p
            • Make-vl-dpiimport
            • Vl-dpiimport-equiv
            • Vl-dpiprop-p
            • Change-vl-dpiimport
            • Vl-dpiimport->rettype
            • Vl-dpiimport->portdecls
            • Vl-dpiimport->spec
            • Vl-dpiimport->prop
            • Vl-dpiimport->name
            • Vl-dpiimport->c-name
            • Vl-dpiimport->loc
            • Vl-dpiimport->atts
            • Vl-dpispec-p
          • Vl-ansi-portdecl
          • Vl-package
          • Vl-paramdecl
          • Vl-dpiexport
          • Vl-class
          • Vl-sort-blockitems-aux
          • Vl-plainarglist->exprs
          • Vl-taskdecllist->names
          • Expressions-and-datatypes
          • Vl-fundecllist->names
          • Vl-udp
          • Vl-port
          • Vl-genelement
          • Vl-clkdecl
          • Vl-parse-temps
          • Vl-bind
          • Vl-namedarg
          • Vl-exprdist
          • Vl-clkassign
          • Vl-range
          • Vl-propport
          • Vl-typedef
          • Vl-gatedelay
          • Vl-dimension
          • Vl-sequence
          • Vl-clkskew
          • Vl-program
          • Vl-gatestrength
          • Vl-property
          • Vl-config
          • Vl-always
          • Vl-import
          • Vl-repeateventcontrol
          • Vl-timeliteral
          • Vl-initial
          • Vl-eventcontrol
          • Vl-final
          • Vl-udpsymbol-p
          • Vl-maybe-clkskew
          • Vl-function-specialization
          • Vl-alias
          • Vl-maybe-nettypename
          • Vl-maybe-gatedelay
          • Vl-letdecl
          • Vl-direction-p
          • Vl-modelement
          • Vl-maybe-timeprecisiondecl
          • Vl-maybe-scopeid
          • Vl-maybe-gatestrength
          • Vl-maybe-direction
          • Vl-maybe-delayoreventcontrol
          • Vl-gclkdecl
          • Vl-fwdtypedef
          • Vl-maybe-udpsymbol-p
          • Vl-maybe-timeunitdecl
          • Vl-maybe-timeliteral
          • Vl-maybe-parse-temps
          • Vl-maybe-cstrength
          • Vl-arguments
          • Vl-maybe-module
          • Vl-maybe-design
          • Vl-covergroup
          • Vl-udpline
          • Vl-timeunitdecl
          • Vl-genvar
          • Vl-defaultdisable
          • Vl-context1
          • Vl-timeprecisiondecl
          • Vl-sort-blockitems
          • Vl-elabtask
          • Vl-udpedge
          • Vl-delaycontrol
          • Vl-context
          • Vl-ctxelement
          • Vl-ctxelement->loc
          • Vl-modelement->loc
          • Statements
          • Vl-blockitem
          • Vl-vardecllist
          • Vl-interface->ifports
          • Vl-syntaxversion
          • Vl-nettypename-p
          • Vl-module->ifports
          • Vl-lifetime-p
          • Vl-paramdecllist
          • Vl-modelementlist->genelements
          • Vl-importlist
          • Vl-typedeflist
          • Vl-gatetype-p
          • Vl-cstrength-p
          • Vl-port->name
          • Vl-genelement->loc
          • Vl-delayoreventcontrol
          • Vl-udpentry-p
          • Vl-portdecllist
          • Vl-elabtask->loc
          • Property-expressions
          • Vl-taskdecllist
          • Vl-port->loc
          • Vl-fundecllist
          • Vl-sequencelist
          • Vl-propertylist
          • Vl-portlist
          • Vl-dpiimportlist
          • Vl-dpiexportlist
          • Vl-classlist
          • Vl-arguments->args
          • Vl-alwaystype-p
          • Vl-modinstlist
          • Vl-importpart-p
          • Vl-importpart-fix
          • Vl-bindlist
          • Vl-initiallist
          • Vl-genvarlist
          • Vl-gclkdecllist
          • Vl-function-specialization-map
          • Vl-finallist
          • Vl-elabtasklist
          • Vl-defaultdisablelist
          • Vl-clkdecllist
          • Vl-cassertionlist
          • Vl-blockstmt-p
          • Vl-assignlist
          • Vl-assertionlist
          • Vl-alwayslist
          • Vl-aliaslist
          • Vl-udptable
          • Vl-udplist
          • Vl-udpentrylist
          • Vl-propportlist
          • Vl-programlist
          • Vl-packagelist
          • Vl-namedarglist
          • Vl-modulelist
          • Vl-modportlist
          • Vl-modport-portlist
          • Vl-letdecllist
          • Vl-interfacelist
          • Vl-gateinstlist
          • Vl-fwdtypedeflist
          • Vl-covergrouplist
          • Vl-configlist
          • Vl-clkassignlist
          • Vl-blockitemlist
          • Vl-ansi-portdecllist
          • Vl-regularportlist
          • Vl-paramdecllist-list
          • Vl-modelementlist
          • Vl-interfaceportlist
          • Vl-casekey-p
          • Sv::maybe-4veclist
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Syntax

Vl-dpiimport

Represents a single import of a C function into SystemVerilog via the Direct Programming Interface.

This is a product type introduced by defprod.

Fields
name — stringp
The SystemVerilog version of the name (may differ from the C function's name.)
c-name — stringp
The name of the C function being imported.
spec — vl-dpispec-p
Indicates whether this function uses the deprecated "DPI" or the replacement "DPI-C" interface.
prop — vl-dpiprop-p
Indicates whether the pure or context keywords were provided.
rettype — vl-maybe-datatype
For an imported function, this is the return type. For a task, it is nil, which lets you distinguish whether this import is for a function or a task.
portdecls — vl-portdecllist
The arguments from the function/task prototype.
atts — vl-atts
Any attributes associated with this DPI import.
loc — vl-location
Where this DPI import was found in the source code.

SystemVerilog's Direct Programming Interface (DPI) allows for SystemVerilog code to invoke functions that are written in C, and for C programs to invoke SystemVerilog functions/tasks. (In theory the DPI can also be used to connect to other languages besides C, but we'll just say C here.)

A DPI import statement is for making C functions available to the SystemVerilog design. A DPI export goes the other way and we treat them separately; see vl-dpiexport.

We cannot imagine any way for VL to really comprehend or make any real use of imported C code. However, we do try to at least parse and represent the actual DPI import statements so that they don't lead to parse errors. We also regard import statements as real, legitimate scope items that can be looked up in a scopestack, which allows applications like vl-lint to recognize that calls of these functions/tasks are not undefined.

Subtopics

Vl-dpiimport-fix
Fixing function for vl-dpiimport structures.
Vl-dpiimport-p
Recognizer for vl-dpiimport structures.
Make-vl-dpiimport
Basic constructor macro for vl-dpiimport structures.
Vl-dpiimport-equiv
Basic equivalence relation for vl-dpiimport structures.
Vl-dpiprop-p
Representation of pure or context properties.
Change-vl-dpiimport
Modifying constructor for vl-dpiimport structures.
Vl-dpiimport->rettype
Get the rettype field from a vl-dpiimport.
Vl-dpiimport->portdecls
Get the portdecls field from a vl-dpiimport.
Vl-dpiimport->spec
Get the spec field from a vl-dpiimport.
Vl-dpiimport->prop
Get the prop field from a vl-dpiimport.
Vl-dpiimport->name
Get the name field from a vl-dpiimport.
Vl-dpiimport->c-name
Get the c-name field from a vl-dpiimport.
Vl-dpiimport->loc
Get the loc field from a vl-dpiimport.
Vl-dpiimport->atts
Get the atts field from a vl-dpiimport.
Vl-dpispec-p
Representation of the "DPI" or "DPI-C" specification used in DPI import/exports.