Technical data

VSIM function descriptions
482
-
VHDL Foreign Language Interface and Verilog PLI ModelSim EE/PLUS Reference Manual
“long” before being passed as a non-array scalar object value across the C
interface. The mti_GetSignalValue function can be used to get the value of any
non-array scalar signal object except TIME and REAL which use
GetSignalValueIndirect. Use mti_GetVarValue and mti_GetVarValueIndirect for
variables.
Enumerations
Enumeration object values are equated to the position number of the
corresponding identifier or character literal in the VHDL type declaration. For
example:
-- C interface values
TYPE std_ulogic IS ('U',-- 0
'X',-- 1
'0',-- 2
'1',-- 3
'Z',-- 4
'W',-- 5
'L',-- 6
'H',-- 7
'-' -- 8
);
Reals and time
Eight bytes are required to store the values of variables and signals of type TIME
and REAL. In C, this corresponds to the time64 structure defined in
mti.h
and the
C “double” data type. GetSignalValueIndirect and GetVarValueIndirect calls are
used to retrieve these values.
Arrays
The C type “void *” is used for array type object values. The pointer points to the
first element of an array of C type “char” for enumerations with 256 or less values,
“double” for REAL, “time64” for TIME, and “long” in all other cases. The first
element of the array corresponds to the left bound of the array index range.
Likewise, for multidimensional arrays, the elements are stored sequentially from
left bound to right bound with the elements corresponding to the last subscript
coming first.
Note:
A STRING data type is represented as an array of enumerations. The array is not NULL terminated
as you would expect for a C string, so you must call mti_TickLength to get its length.