| Link for ModelSim |  |
Setting up Expected Parameters
The Link for ModelSim interface expects a MATLAB test bench function
to be defined with the following function definition line:
function [iport, tnext] = MyFunctionName(oport, tnow, portinfo)
The data that gets passed into the function through the output parameters
is defined by the structure of the corresponding VHDL entity. The following
table explains the purpose of each parameter:
| Parameter | Purpose |
| iport | Structure that forces (by deposit) values onto signals connected to
ports of the associated VHDL entity. |
| tnext | Specifies an optional time at which the MATLAB function is to be called
back. If you leave this parameter unassigned or if you assign it an empty
value ([]), no new entries are added to the simulation schedule. By default,
time is represented in seconds. The interface accepts 64bit integers,
which are interpreted as multiples of the ModelSim resolution limit. |
| oport | Structure that receives VHDL signal values from the output ports defined
for the associated VHDL entity at the time specified by tnow. |
| tnow | Receives the simulation time at which the MATLAB function is called.
By default, time is represented in seconds. The interface also supports full
64bit time resolution. For more information see Starting the MATLAB Server. |
| portinfo | For the first invocation of the function (at the start of the simulation)
only, receives an array of information that describes the ports defined for
the associated VHDL entity. For each port, the array identifies information
such as the port's type, direction, and size. The information passed to this
parameter is useful for validating the entity under test. You might also consider
using the port information to create a generic MATLAB function that operates
differently depending on the port information supplied at startup. |
Note
You can substitute your own names for the preceding parameters. For
example, the following function definition is valid: function [a, b] = foo(c, d, e) |
For more information on using tnext and tnow for
simulation scheduling, see Deciding on Test Bench Scheduling Options and Controlling Callback Timing from a MATLAB Test Bench Function.
For an example of how to use these parameters, see Sample MATLAB Test Bench Function. For more information
on port data, see Gaining Access to and Applying Port Information.
| Naming a MATLAB Test Bench Function | | Gaining Access to and Applying Port Information |  |
Learn more about the latest releases of MathWorks products:
|