Technical data

Using the VHDL FLI with foreign architectures
ModelSim EE/PLUS Reference Manual VHDL Foreign Language Interface and Verilog PLI
-
457
parameter
A string that is passed to the initialization function. This part is preceded by a semicolon
and is optional.
If the initialization function has a leading '+' or '-', both the VHDL architecture
body and the foreign module will be elaborated. If '+' is used (as in the example
below), the VHDL will be elaborated first, and if the '-' is used, the VHDL will be
elaborated after the foreign init function is called.
UNIX environment variables may also be used within the string as in this
example:
ATTRIBUTE foreign OF arch_name : ARCHITECTURE IS "+app_init $CAE/app.so";
Location of shared object files
VSIM searches for object files in the following order:
• $MGC_WD/<so> or ./<so> (If MGC_WD is not set, then it will use ".")
• <so>
search $LD_LIBRARY_PATH ($SHLIB_PATH on HP only)
• $MGC_HOME/lib/<so>
• $MODEL_TECH/<so>
• $MODEL_TECH/../<so>
In the search information above "<so>" refers to the path specified in the
FOREIGN attribute string. MGC_WD and MGC_HOME are user-definable
environment variables. MODEL_TECH is set by the application to the directory
where VSIM resides.
Note:
The
.so
extension will work on all platforms (it is not necessary to use the
.sl
extension on HPs).
The C initialization function
The initialization function typically:
• allocates memory to hold variables for this instance
registers a callback function to free the memory when VSIM is restarted
• saves the handles to the signals in the port list
• creates drivers on the ports that will be driven