nclaunch - Start and configure Incisive simulators for use with EDA Simulator Link™ IN software

Syntax

nclaunch('PropertyName', 'PropertyValue'...)

Description

nclaunch('PropertyName', 'PropertyValue'...) starts the Incisive simulator for use with the MATLAB and Simulink features of the EDA Simulator Link IN software. The first directory in the Incisive simulator matches your MATLAB current directory if no explicit rundir parameter is specified.

After you call this function, you can use EDA Simulator Link IN command extensions to do interactive debug setup.

The property name/property value pair settings allow you to customize the Tcl commands used to start the Incisive simulator, the ncsim executable to be used, the path and name of the Tcl script that stores the start commands, and for Simulink applications, details about the mode of communication to be used by the applications. You must use a property name/property value pair with nclaunch.

Property Name/
Property Value Pairs

'hdlsimdir', 'pathname'

Specifies the path name to the Incisive simulator executable to be started. By default, the function uses the first version of the simulator that it finds on the system path (defined by the path variable) . Use this option to start different versions of the Incisive simulator or if the version of the simulator you want to run does not reside on the system path.

'hdlsimexe', 'simexename'

Specifies the name of an Incisive simulator executable. By default, this function uses 'ncsim'. You can specify a custom-built simulator executable with 'simexename.'

'libdir', 'directory'

Specifies the directory containing MATLAB shared libraries. This property creates an entry in the startup Tcl file that points to the directory with the shared libraries needed for the Incisive simulator to communicate with MATLAB when the Incisive simulator is running on a machine that does not have MATLAB.

'rundir', 'dirname'

Specifies where to run the HDL simulator. By default, the function uses the current working directory.

The following conditions apply to this name/value pair:

'startupfile', 'pathname'

Specifies a Tcl script that defines the behavior of the Incisive simulator commands hdlsimmatlab and hdlsimulink. The Tcl script consists of some general-purpose Tcl commands for launching the Incisive simulator and any commands you specify with the 'tclstart' property. If you omit this property, the function creates a temporary file each time the Incisive simulator starts. If you specify a name for the Tcl script, later you can use the file to start the Incisive simulator from a system shell as shown in the following syntax:

tclsh tcl_scriptname

'socketsimulink', 'tcp_spec'

Specifies TCP/IP socket communication for links between the Incisive simulator and Simulink. See Specifying TCP/IP Values for valid TCP/IP examples. For more information on choosing TCP/IP socket ports, see Choosing TCP/IP Socket Ports.

If the Incisive simulator and Simulink 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 -socketsimulink tcp_spec from the function call.

'starthdlsim', ['yes' | 'no']

Determines whether the Incisive simulator is launched. The default is yes, which launches the Incisive simulator and creates a startup Tcl file. If starthdlsim is set to no, the Incisive simulator is not launched, but a startup Tcl file is still created.

This startup Tcl file contains pointers to MATLAB and Simulink shared libraries. To run the Incisive simulator manually, see Starting the HDL Simulator.

'tclstart', 'tcl_commands'

Specifies one or more Tcl commands to execute before the Incisive simulator launches. Specify a command string or a cell array of command strings. You must specify at least one command; otherwise, no action occurs.

Examples

The following function call sequence compiles the design and starts Simulink with a GUI from the "proj" directory with the model loaded. Simulink is instructed to communicate with the EDA Simulator Link IN interface on socket port 4449. All of these commands are specified in a single string as the property value to tclstart.

nclaunch(...
'tclstart',...
{'exec ncverilog -c +access+rw +linedebug top.v',...
'hdlsimulink -gui work.top'},...
'socketsimulink','4449',...
'rundir', '/proj');

In this next example, tclcmd is used to build the sequence of Tcl commands that are executed in a Tcl shell after calling nclaunch from MATLAB, as follows:

The arguments being passed with -input (matlabtb and run) are executed in the ncsim Tcl shell. In this example, matlabcp associates the m-function vlogmatlabc to the module instance u_matlab_component. It assumes that the hdldaemon in MATLAB is listening on port 32864. run will run 50 resolution units (ticks).

tclcmd{1} = 'exec ncvlog vlogtestbench_top.v'
tclcmd{2} = 'exec ncelab -access +wc vlogtestbench_top'
tclcmd{3} = ['hdlsimmatlab -gui vlogtestbench_top ' ...
           '-input "{@matlabcp vlogtestbench_top.u_matlab_component...
                      -mfunc vlogmatlabc -socket 32864}" '...
           '-input "{@run 50}"']
nclaunch('hdlsimdir', 'local.IUS.glnx.tools.bin', 'tclstart',tclcmd);

The following example shows using the property startupfile to designate a Tcl script that is then used to start the HDL simulator from the Tcl shell.

In MATLAB:

nclaunch (‘tclstart', ‘xxx', ‘startupfile', ‘mytclscript',...
          ‘starthdlsim', ‘no')  

In Tcl shell:

shell> tclsh mytclscript
  


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