matlabtb

Initiate a MATLAB test bench session for an instance of a VHDL entity based on specified test bench stimuli

Syntax

matlabtb <instance> [<time-specs>] [-socket
<tcp-spec>] 
[-rising <port>[,<port>...]] [-falling <port>[,<port>,...]]
[-sensitivity <port>[,<port>,...]] [-mfunc <name>]

Arguments

<instance>

Specifies the instance of a VHDL entity that attaches to a MATLAB function. By default, matlabtb attaches the instance to a MATLAB function that has the same name as the instance. For example, if the instance is myfirfilter, matlabtb associates the instance with the MATLAB function myfirfilter. Alternatively, you can specify a different MATLAB function with -mfunc.

<time-specs>

Specifies a combination of time specifications consisting of any or all of the following:

<timen>,...Specifies one or more discrete time values at which the specified MATLAB function is called. Each time value is relative to the current simulation time. Even if you do not specify a time, the command calls the MATLAB function once at the start of the simulation.
-repeat <time>Specifies that the MATLAB function be called repeatedly based on the specified <timen>,... pattern. The time values are relative to the value of tnow at the time the MATLAB function is initially called.
-cancel <time>Specifies a time at which the specified MATLAB function stops executing. The time value is relative to the value of tnow at the time the MATLAB function is initially called. If you do not specify a cancel time, the command calls the MATLAB function.

-socket <tcp_spec>

Specifies TCP/IP socket communication for the link between ModelSim and MATLAB. For TCP/IP socket communication on a single computing system, the <tcp_spec> can consist of just a TCP/IP port number or service name (alias). If you are setting up communication between computing systems, you must also specify the name or Internet address of the remote host that is running the MATLAB server (hdldaemon). The following table lists different ways of specifying <tcp_spec>.

FormatExample
<port-num>4449
<port-alias>matlabservice
<port-num>@<host>4449@compa
<host>:<port-num>compa:4449
<port-alias>@<host-ia>matlabservice@123.34.55.23

For more information on choosing TCP/IP socket ports, see Choosing TCP/IP Socket Ports.

If ModelSim and MATLAB are running on the same computing system, you have the option of using shared memory for communication. Shared memory is the default mode of communication and takes effect if you omit -ocket <tcp_spec> from the command line.

-rising <signal>[, <signal>...]

Indicates that the specified MATLAB function is called when any of the specified signals experiences a rising edge — changes from '0' to '1'. Specify -rising with the pathnames of one or more signals defined as a logic type — std_logic, bit, x01, and so on.

-falling <signal>[, <signal>...]

Indicates that the specified MATLAB function is called when any of the specified signals experiences a falling edge — changes from '1' to '0'. Specify -falling with the pathnames of one or more signals defined as a logic type — std_logic, bit, x01, and so on.

-sensitivity <signal>[, <signal>...]

Indicates that the specified MATLAB function is called when any of the specified signals changes state. Specify –sensitivity with the pathnames of one or more signals. Signals in the sensitivity list can be any type and can be at any level of the VHDL hierarchy.

-mfunc <name>

The name of the MATLAB function that is attached to the entity you specify for instance. If you omit this argument, matlabtb attaches the entity to a MATLAB function that has the same name as the entity. For example, if the entity is myfirfilter, matlabtb associates the entity with the MATLAB function myfirfilter. If you omit this argument and matlabtb does not find a MATLAB function with the same name, the command generates an error message.

Description

The matlabtb command,

  1. Starts the ModelSim client component of the Link for ModelSim.

  2. Associates a specified instance of a VHDL entity created in ModelSim with a MATLAB MATLAB function.

  3. Creates a process that schedules invocations of the specified MATLAB function.

Examples

The following command starts the ModelSim client component of the Link for ModelSim, associates an instance of the entity myfirfilter with the MATLAB function myfirfilter, and initiates a local TCP/IP socket-based test bench session using TCP/IP port 4449. Based on the specified test bench stimuli, myfirfilter.m executes 5 nanoseconds from the current time, and then repeatedly every 10 nanoseconds (when t equals 0, 5, 15, 25, and so on).

vsim> matlabtb myfirfilter 5 ns -repeat 10 ns -socket 4449

The following command starts the ModelSim client component of the Link for ModelSim, and initiates a remote TCP/IP socket-based session using remote MATLAB host compb and TCP/IP port 4449. Based on the specified test bench stimuli, myfirfilter.m executes 10 nanoseconds from the current time, each time signal \work\fclk experiences a rising edge, and each time signal \work\din changes state.

vsim> matlabtb myfirfilter 10 ns -rising \work\fclk
-sensitivity \work\din -socket 4449@compa


Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS