‘dpi’ Dialect¶
SystemVerilog DPI-C boundary metadata (IEEE 1800-2023 35)
dpi describes the C ABI of imported and exported subroutines: one
#dpi.abi entry per logical value, exact C layouts for unpacked
aggregates and open arrays, and the identity metadata that elaboration
attaches to DPI calls, simulation functions and native thunks. It has no
operations; its attributes annotate operations of other dialects.
Attributes¶
ABIAttr¶
One logical value in a DPI-C signature
Syntax:
#dpi.abi<
::talos::dpi::ABIKind, # kind
::talos::dpi::ArgumentDirection, # direction
uint32_t, # width
bool, # fourState
bool # isSigned
>
Parameters:¶
Parameter |
C++ type |
Description |
|---|---|---|
kind |
|
an enum of type ABIKind |
direction |
|
an enum of type ArgumentDirection |
width |
|
|
fourState |
|
|
isSigned |
|
AggregateABIAttr¶
Exact C layout for one sized DPI unpacked aggregate
Syntax:
#dpi.aggregate_abi<
uint64_t, # cSize
uint32_t, # cAlignment
uint64_t, # stringCount
::mlir::DenseI64ArrayAttr # leaves
>
Parameters:¶
Parameter |
C++ type |
Description |
|---|---|---|
cSize |
|
|
cAlignment |
|
|
stringCount |
|
|
leaves |
|
OpenArrayABIAttr¶
Concrete actual shape bound to one DPI open-array formal
Syntax:
#dpi.open_array_abi<
uint32_t, # storage
::talos::dpi::ABIKind, # elementKind
uint32_t, # elementWidth
uint64_t, # transportWidth
bool, # transportFourState
bool, # fourState
uint64_t, # elementCSize
uint32_t, # elementCAlignment
uint64_t, # elementStringCount
::mlir::DenseI64ArrayAttr, # elementLeaves
int64_t, # packedLeft
int64_t, # packedRight
::mlir::DenseI64ArrayAttr, # ranges
::mlir::DenseI64ArrayAttr, # sourceRanges
::mlir::DenseI64ArrayAttr # shapePlan
>
Parameters:¶
Parameter |
C++ type |
Description |
|---|---|---|
storage |
|
|
elementKind |
|
an enum of type ABIKind |
elementWidth |
|
|
transportWidth |
|
|
transportFourState |
|
|
fourState |
|
|
elementCSize |
|
|
elementCAlignment |
|
|
elementStringCount |
|
|
elementLeaves |
|
|
packedLeft |
|
|
packedRight |
|
|
ranges |
|
|
sourceRanges |
|
|
shapePlan |
|
Enums¶
ABIKind¶
DPI-C value ABI category
Cases:¶
Symbol |
Value |
String |
|---|---|---|
Bit |
|
bit |
Logic |
|
logic |
Byte |
|
byte |
ShortInt |
|
shortint |
Int |
|
int |
LongInt |
|
longint |
BitVector |
|
bit_vector |
LogicVector |
|
logic_vector |
String |
|
string |
Chandle |
|
chandle |
ShortReal |
|
shortreal |
Real |
|
real |
OpenArray |
|
open_array |
UnpackedAggregate |
|
unpacked_aggregate |
ArgumentDirection¶
DPI-C ABI value role
Cases:¶
Symbol |
Value |
String |
|---|---|---|
Input |
|
input |
Output |
|
output |
InOut |
|
inout |
Result |
|
result |