Main Content

nclaunch

Start and configure Cadence Xcelium simulator for use with HDL Verifier software

Description

nclaunch starts the Cadence® Xcelium™ simulator for use with the MATLAB® and Simulink® features of the HDL Verifier™ software. The first folder in the Xcelium simulator matches your MATLAB current folder if you do not specify an explicit rundir parameter.

nclaunch(Name,Value) specifies name-value pair arguments that allows you to customize the Tcl commands used to start the Xcelium simulator, the xmsim 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.

After you call this function, you can use HDL Verifier functions for the HDL simulator (for example, hdlsimmatlab, hdlsimulink) to do interactive debug setup.

example

Examples

collapse all

Compile design and start Simulink.

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

In this example, nclaunch performs the following:

  • Compiles the design top.v: exec xmvlog -64bit -c +access+rw +linedebug top.v.

  • Starts Simulink with the GUI from the proj folder with the model loaded: hdlsimulink -gui work.top and 'rundir', '/proj'.

  • Instructs Simulink to communicate with the HDL Verifier interface on socket port 4449: 'socketsimulink','4449'.

All of these commands are specified in a single character vector as the property value to tclstart.

Create a Tcl script to start the HDL simulator from a Tcl shell using nclaunch.

Specify the name of the Tcl script and the command(s) it includes as parameters to nclaunch:

nclaunch('tclstart','xxx','startupfile','myTclscript','starthdlsim','yes') 

In this example, a Tcl script is created and the command to start the HDL simulator is included. The startup Tcl file is named "myTclscript".

Execute the script in a Tcl shell:

shell> Tclsh myTclscript

This starts the HDL simulator.

Build a sequence of Tcl commands that are then executed in a Tcl shell, after calling nclaunch from MATLAB.

Assign Tcl command values to the Tclcmd parameter of nclaunch:

Tclcmd{1} = 'exec xmvlog -64bit vlogtestbench_top.v'
Tclcmd{2} = 'exec xmelab -64bit -access +wc vlogtestbench_top'
Tclcmd{3} = ['hdlsimmatlab -gui vlogtestbench_top ' '-input "{@matlabcp... 
     vlogtestbench_top.u_matlab_component -mfunc vlogmatlabc...
     -socket 32864}" ' '-input "{@run 50}"']
Tclcmd = 

    'exec xmvlog -64bit vlogtestbench_top.v'  'exec xmelab -64bit -access +wc vlogtestbench_top'

Tclcmd = 

    'exec xmvlog -64bit vlogtestbench_top.v'  'exec xmelab -64bit -access +wc vlogtestbench_top'

Tclcmd = 

    [1x31 char]    [1x41 char]    [1x145 char]
  • tclcmd{1} compiles vlogtestbench_top.

  • tclcmd{2} elaborates the model.

  • tclcmd{3} calls hdlsimmatlab in gui mode and loads the elaborated vlogtestbench_top in the simulator.

Issue the nclaunch command, passing the tclcmd variable just set:

nclaunch('hdlsimdir','local.IUS.glnx.tools.bin','tclstart',tclcmd);

In this example, the nclaunch launches the following tasks through the Tcl commands assigned in tclcmd:

  • Executes the arguments being passed with -input (matlabtb and run) in the xmsim Tcl shell.

  • Issues a call to matlabcp, which associates the function vlogmatlabc to the module instance u_matlab_component.

  • Assumes that the hdldaemon in MATLAB is listening on port 32864

  • Instructs the run function to run 50 resolution units (ticks).

Input Arguments

collapse all

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: nclaunch('runmode','GUI') starts the HDL simulator with graphical user interface.

Path to Xcelium simulator executable, specified as the comma-separated pair consisting of 'hdlsimdir' and a path name. By default, function executes first version of the simulator that the function finds on system path.

Data Types: char

Name of Xcelium simulator executable, specified as the comma-separated pair consisting of 'hdlsimexe' and a simulator name. By default, function uses 'xmsim' simulator.

Data Types: char

Entry in startup Tcl file, specified as the comma-separated pair consisting of 'libdir' and a folder name. It points to the folder with the shared libraries for Xcelium simulator to communicate with MATLAB when Xcelium simulator runs on a machine that does not have MATLAB.

Data Types: char

Library file for HDL simulation, specified as the comma-separated pair consisting of 'libfile' and the library file name. If the HDL simulator links other libraries, including SystemC libraries, that were built using a compiler supplied with the HDL simulator, you can specify an alternate library file with this property. By default, function uses that version of the library file which was built using the same compiler that MATLAB itself uses.

Data Types: char

Location to run HDL simulator, specified as the comma-separated pair consisting of 'rundir' and a folder name.

The following conditions apply to this name-value pair:

  • If the value of dirname is "TEMPDIR", the function creates a temporary folder in which it runs the HDL simulator.

  • If you specify dirname and the directory does not exist, you will get an error.

Data Types: char

Run mode for HDL simulator, specified as the comma-separated pair consisting of 'runmode' and one of the following values:

  • 'Batch' – Starts HDL simulator in background with no window

  • 'Batch with Xterm' – Starts HDL simulator in background with no window

  • 'CLI' – Starts HDL simulator in an interactive terminal window

  • 'GUI' – Starts HDL simulator with graphical user interface

TCP/IP socket communication between Xcelium simulator and Simulink, specified as the comma-separated pair consisting of 'socketsimulink' and a port number or service name. By default, function uses shared memory communication.

Data Types: char

Option to start Xcelium, specified as the comma-separated pair consisting of 'starthdlsim' and one of the following values:

  • 'yes' – To create a startup Tcl file after launching Xcelium simulator.

  • 'no' – To create a startup Tcl file without launching Xcelium simulator.

Name and location of the generated Tcl file, specified as the comma-separated pair consisting of 'startupfile' and a path name. The generated Tcl script, when executed, compiles and launches the Xcelium simulator.

Data Types: char

Execute TCL commands before Xcelium simulator launches, specified as the comma-separated pair consisting of 'tclstart' and a Tcl command.

Note

You must type exec in front of non -Tcl system shell commands. For example:

exec -xmvlog -64bit -c +access+rw +linedebug top.v
hdlsimulink -gui work.top

You must specify at least one command; otherwise, no action occurs.

Data Types: char

Version History

Introduced in R2008a