Start and configure Cadence Incisive simulators for use with HDL Verifier software


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


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

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

The property name/property value pair settings allow you to customize the Tcl commands used to start the Cadence 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.

Name-Value Pair Arguments


Specifies the path name to the Cadence Incisive simulator executable to be started.

  • pathname

    Start a different version of the Cadence Incisive simulator or if the version of the simulator you want to run does not reside on the system path.

Default: The first version of the simulator that the function finds on the system path.


Specifies the name of a Cadence Incisive simulator executable.

  • simexename

    Custom-built simulator executable.

Default: ncsim


This property creates an entry in the startup Tcl file that points to the folder with the shared libraries for the Cadence Incisive simulator to communicate with MATLAB when the Cadence Incisive simulator runs on a machine that does not have MATLAB.

  • folder

    Folder containing MATLAB shared libraries.


Specifies the library file to use for HDL simulation. 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. See HDL Verifier Libraries for versions of the library built using other compilers.

  • library_file_name

    The particular library file to use for HDL simulation.

Default: The version of the library file that was built using the same compiler that MATLAB itself uses.


Specifies the folder containing the HDL simulator executable.

  • dirname

    Where to run the HDL simulator.

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 folder does not exist, you will get an error.

Default: The current working folder


Specifies how to start the HDL simulator.

  • mode

    This property accepts the following valid values:

    • 'Batch': Start the HDL simulator in the background with no window.

    • 'Batch with Xterm': Run HDL simulator in an non-interactive Xterm window.

    • 'CLI': Start the HDL simulator in an interactive terminal window.

    • 'GUI': Start the HDL simulator with the SimVision graphical user interface.

Default: 'GUI'


Specifies TCP/IP socket communication between the Cadence Incisive simulator and Simulink. For shared memory, omit -socket <tcp-spec> on the command line.

  • tcp_spec

    TCP/IP port number or service name (alias)

Default: Shared memory


Determines whether the Cadence Incisive simulator is launched.

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

  • yes

    Launches the Cadence Incisive simulator and creates a startup Tcl file.

  • no

    Does not launch the Cadence Incisive simulator , but still creates a startup Tcl file.

Default: yes


Specify the name and location of the Tcl script generated by nclaunch. The generated Tcl script, when executed, compiles and launches the HDL simulator. You can edit and use the generated file in a regular shell outside of MATLAB. For example:

sh> tclsh compile_and_launch.tcl
  • pathname

    Filename and path for generated Tcl script. If the file name already exists on the specified path, that file's contents are overwritten.

Default: Generates a filename of compile_and_launch.tcl in the folder specified by rundir.


Specifies one or more Tcl commands to execute before the Cadence Incisive simulator launches. You must specify at least one command; otherwise, no action occurs.

  • tcl_commands

    A command string or a cell array of command strings.

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

      exec -ncverilog -c +access+rw +linedebug top.v
      hdlsimulink -gui


collapse all

Start Cosimulation Session with Simulink

Compile design and start Simulink.

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

In this example, nclaunch performs the following:

  • Compiles the design top.v: exec ncverilog -c +access+rw +linedebug top.v.

  • Starts Simulink with the GUI from the proj folder with the model loaded: hdlsimulink -gui 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 string as the property value to tclstart.

Create Tcl Script to Start HDL Simulator

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.

Execute Multiple Tcl Commands When Launching Cosimulation Connection

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 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}"']
tclcmd = 

    'exec ncvlog vlogtestbench_top.v'    'exec ncelab -access +wc vlogtestbench_top'

tclcmd = 

    'exec ncvlog vlogtestbench_top.v'    'exec ncelab -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', '', '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 ncsim 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).

Was this topic helpful?