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(
specifies name-value pair
arguments that allows you to customize the Tcl commands used to start the Xcelium simulator, the Name,Value
)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.
Examples
Start Cosimulation Session with Simulink
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 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 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}
compilesvlogtestbench_top
.tclcmd{2}
elaborates the model.tclcmd{3}
callshdlsimmatlab
ingui
mode and loads the elaboratedvlogtestbench_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
andrun
) in thexmsim
Tcl shell.Issues a call to
matlabcp
, which associates the functionvlogmatlabc
to the module instanceu_matlab_component
.Assumes that the
hdldaemon
in MATLAB is listening on port 32864Instructs the
run
function to run 50 resolution units (ticks).
Input Arguments
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.
hdlsimdir
— Path to Cadence Xcelium simulator executable
path name
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
hdlsimexe
— Name of Xcelium simulator executable
'xmsim'
(default) | character vector
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
libdir
— Entry in startup Tcl file
folder name
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
libfile
— Library file for HDL simulation
library file name
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
rundir
— Location to run HDL simulator
folder name
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
runmode
— Run mode for HDL simulator
'GUI'
(default) | 'Batch'
| 'Batch with Xterm'
| 'CLI'
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
socketsimulink
— TCP/IP socket communication between the Xcelium simulator and Simulink
tcp_spec
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
starthdlsim
— Option to start the Xcelium simulator
'yes'
(default) | 'no'
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.
startupfile
— Name and location of generated Tcl file
path name
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
tclstart
— Execute Tcl commands
tcl commands
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
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)