dpi_import_export ::= //
from Annex A.2.6
import
"DPI" [ dpi_function_import_property ] [ c_identifier
= ] dpi_function_proto
;
| import "DPI" [ dpi_task_import_property ] [ c_identifier = ] dpi_task_proto ;
| export "DPI" [ c_identifier = ] function function_identifier ;
| export "DPI" [ c_identifier = ] task task task_identifier ;
named_function_proto::= [ signing ] function_data_type function_identifier ( [list_of_tf_proto_formals tf_port_list] )
named_task_proto ::= task_identifier
( [list_of_tf_proto_formals tf_port_list ] )
list_of_tf_proto_formals ::=
{ attribute_instance } tf_proto_formal
{ , { attribute_instance } tf_proto_formal
}
task_proto_formal tf_proto_formal ::=
tf_input_declaration
| tf_output_declaration
| tf_inout_declaration
| tf_ref_declaration
Function result types are restricted
to small values. The following SystemVerilog data types are allowed for
imported function results:
— void, byte, shortint, int, longint, real, shortreal, chandle, and string.
— packed bit arrays up to
32 bits and all types that are eventually equivalent to packed bit arrays up to
32 bits.
— scalar values of type bit and logic
So, if a formal argument is
declared as bit bit
[15:8] b [], then it is the import declaration
which specifies the formal argument is an unpacked array of packed bit array
with bounds 15 to 8, while the actual argument used at a particular call site
defines the bounds for the unpacked part for that call.