matlabtb

Schedule MATLAB test bench session for instantiated HDL module

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 an HDL module that is to be associated with a MATLAB test bench function. By default, matlabtb associates the instance with 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. Multiple time values are separated by a space, for example: matlabtb vlogtestbench_top 1e6 fs 3 2e3 ps -repeat 3 ns -cancel 7ns
-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 first 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 first called. If you do not specify a cancel time, the command calls the MATLAB function.

All time specifications for the matlabtb functions are represented by a number and optionally a time unit:

-socket <tcp_spec>

Specifies TCP/IP socket communication for the link between the HDL simulator and MATLAB. For TCP/IP socket communication on a single computer, the <tcp_spec> can consist of just a TCP/IP port number or service name (alias). If you are setting up communication between computers, you must also specify the name or Internet address of the remote host that is running the MATLAB server (hdldaemon). See Specifying TCP/IP Values for some valid tcp_spec examples.

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

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

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

Indicates that the specified MATLAB function is called on the rising edge (transition from '0' to '1') of any of the specified signals. Specify -rising with the path names of one or more signals defined as a logic type.

-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 path names of one or more signals defined as a logic type.

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

Indicates that the specified MATLAB function is called when any of the specified signals changes state. Specify -sensitivity with the path names of one or more signals. Signals in the sensitivity list can be any type and can be at any level of the HDL design.

-mfunc <name>

The name of the associated MATLAB function. If you omit this argument, matlabtb associates the HDL module instance to a MATLAB function that has the same name as the HDL instance. For example, if the HDL module instance is myfirfilter, matlabtb associates the HDL module instance 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 has the following characteristics:

MATLAB test bench functions mimic stimuli passed to entities in the HDL model. You force stimulus from MATLAB or HDL scheduled with matlabtb.

Examples

The following command starts the Incisive simulator client component of the EDA Simulator Link IN software, associates an instance of the module myfirfilter with the MATLAB function myfirfilter, and begins 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:

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

The following command starts the Incisive simulator client component of the EDA Simulator Link IN software, and begins a remote TCP/IP socket-based session using remote MATLAB host compa 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.

ncsim> matlabtb myfirfilter 10 ns -rising top.fclk
-sensitivity top.din -socket 4449@compa

The following command starts the Incisive simulator client component of the EDA Simulator Link IN software. The '-mfunc' option specifies the m-function to connect to and '-socket' option specifies the port number for socket connection mode. '-sensitivity' indicates that the test bench session is sensitized to the signal sine_out.

ncsim>matlabtb osc_top -sensitivity osc_top.sine_out
      -socket 4448 -mfunc hosctb
  


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