Table of Contents Previous page Next page Index

ModelSim

Model Technology Inc.


Using the VHDL FLI

FLI routines are C programming language functions that provide procedural access to information within Model Technology's HDL simulator, vsim. A user-written application can use these functions to traverse the hierarchy of an HDL design, get information about and set the values of VHDL objects in the design, get information about a simulation, and control (to some extent) a simulation run. The header file mti.h externs all of the FLI functions and types that can be used by an FLI application.

Important concepts

A good understanding of the following concepts is necessary before creating an FLI application.

Elaboration

When the simulator starts, it first goes through an elaboration phase during which the entire design is loaded and connected and initial values are set. During this phase all foreign shared libraries are loaded and the initialization functions of all foreign architectures are executed.

Simulation

The simulation phase of the simulator begins when the first run command is executed and continues until a quit or restart command is executed. When a restart command is executed, the simulator goes through its elaboration phase again.

Foreign architecture

A foreign architecture is a design unit that is instantiated in a design but that does not (generally) contain any VHDL code. Instead it is a link to a C model that can communicate to the rest of the design through the ports of the foreign architecture. Normally, a C model creates processes and reads and drives signal values; in essence, behaving in the same manner as VHDL code but with the advantage of the power of C and the ease of reading and writing files and communicating with other system processes.

Foreign subprogram

A foreign subprogram is a VHDL function or procedure that is implemented in C as opposed to VHDL. A foreign subprogram reads its in and inout parameters, performs some operation(s) which may include accessing simulator information through FLI function calls, writes its inout and out parameters, and returns a value (in the case of a function).

Callback

A callback is a C function that is registered with the simulator for a specific reason. The registered function is called whenever the reason occurs. Callback functions generally perform special processing whenever certain simulation conditions occur.

Process

A process is a VHDL process that is created through the FLI. It can either be scheduled for a specific time or be made sensitive to one or more signals that trigger the process to run. The process is associated with a C function and the C function is executed whenever the process is run by the simulator.



Model Technology Inc.
Voice: (503) 641-1340
Fax: (503)526-5410
http://www.model.com
sales@model.com
TOC PREV NEXT INDEX

ModelSim