• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Vwsim
      • Fgl
      • 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-ansi-portdecl
          • Vl-package
          • Vl-paramdecl
          • Vl-dpiexport
            • Vl-dpiexport-fix
            • Vl-dpiexport-equiv
            • Vl-dpiexport-p
            • Make-vl-dpiexport
            • Change-vl-dpiexport
            • Vl-dpiexport->spec
            • Vl-dpiexport->loc
            • Vl-dpiexport->fntask
            • Vl-dpiexport->c-name
            • Vl-dpiexport->atts
            • Vl-dpiexport->name
            • Vl-dpispec-p
            • Vl-dpifntask-p
          • Vl-plainarglist->exprs
          • Vl-class
          • Vl-taskdecllist->names
          • Vl-sort-blockitems-aux
          • Vl-fundecllist->names
          • Expressions-and-datatypes
          • 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-udpsymbol-p
          • Vl-final
          • Vl-maybe-clkskew
          • 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-modelement->loc
          • Vl-ctxelement
          • Vl-ctxelement->loc
          • Statements
          • Vl-interface->ifports
          • Vl-blockitem
          • Vl-vardecllist
          • Vl-module->ifports
          • Vl-lifetime-p
          • Vl-syntaxversion
          • Vl-nettypename-p
          • Vl-paramdecllist
          • Vl-modelementlist->genelements
          • Vl-importlist
          • Vl-gatetype-p
          • Vl-typedeflist
          • Vl-genelement->loc
          • Vl-cstrength-p
          • Vl-port->name
          • Vl-elabtask->loc
          • Vl-delayoreventcontrol
          • Vl-udpentry-p
          • Vl-portdecllist
          • Vl-port->loc
          • Property-expressions
          • Vl-taskdecllist
          • 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-blockstmt-p
          • Vl-bindlist
          • Vl-initiallist
          • Vl-genvarlist
          • Vl-gclkdecllist
          • Vl-finallist
          • Vl-elabtasklist
          • Vl-defaultdisablelist
          • Vl-clkdecllist
          • Vl-cassertionlist
          • 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-casekey-p
          • Vl-blockitemlist
          • Vl-ansi-portdecllist
          • Vl-regularportlist
          • Vl-paramdecllist-list
          • Vl-modelementlist
          • Vl-interfaceportlist
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Testing-utilities
    • Math
  • Syntax

Vl-dpiexport

Represents a single export of a SystemVerilog function/task for use in C programs 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 new C function to create which will correspond to this SystemVerilog function/task.
spec — vl-dpispec-p
Indicates whether this function uses the deprecated "DPI" or the replacement "DPI-C" interface.
fntask — vl-dpifntask-p
Are we exporting a function or a task?
atts — vl-atts
Any attributes associated with this DPI export.
loc — vl-location
Where this DPI export 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 export statement is for making SystemVerilog tasks and functions available to C programs. A DPI import goes the other way and we treat them separately; see vl-dpiimport.

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 export statements so that they don't lead to parse errors.

Aside from parsing, we largely don't care about DPI exports. Unlike DPI imports, we don't treat exports as scope items because if you look up a function foo, you want to find its definition, not the fact that it was exported.

Subtopics

Vl-dpiexport-fix
Fixing function for vl-dpiexport structures.
Vl-dpiexport-equiv
Basic equivalence relation for vl-dpiexport structures.
Vl-dpiexport-p
Recognizer for vl-dpiexport structures.
Make-vl-dpiexport
Basic constructor macro for vl-dpiexport structures.
Change-vl-dpiexport
Modifying constructor for vl-dpiexport structures.
Vl-dpiexport->spec
Get the spec field from a vl-dpiexport.
Vl-dpiexport->loc
Get the loc field from a vl-dpiexport.
Vl-dpiexport->fntask
Get the fntask field from a vl-dpiexport.
Vl-dpiexport->c-name
Get the c-name field from a vl-dpiexport.
Vl-dpiexport->atts
Get the atts field from a vl-dpiexport.
Vl-dpiexport->name
Get the name field from a vl-dpiexport.
Vl-dpispec-p
Representation of the "DPI" or "DPI-C" specification used in DPI import/exports.
Vl-dpifntask-p
Indicates whether we are exporting a function or task.