| EDA Simulator Link™ DS | ![]() |
pv = launchDiscovery('PropertyName',
'PropertyValue'...)
pv = launchDiscovery(PropertyValueStruct)
pv = launchDiscovery('PropertyName', 'PropertyValue'...) generates HDL compile scripts and HDL simulator launch scripts and executes them. These scripts set up an appropriate GCC environment and load the correct EDA Simulator Link DS library into the Synopsys VCS MX simulator. The function returns a structure of properties and their values.
For custom scripting requirements, you can use launchDiscovery to generate template "sh" scripts that you can modify and invoke from MATLAB using a "system" command.
You must use a property name/property value pair with launchDiscovery('PropertyName', 'PropertyValue'...).
pv = launchDiscovery(PropertyValueStruct) both passes and returns a structure of properties and their values.
In batch run modes, the function returns only after the HDL simulator starts and the HDL simulation begins. In interactive run modes, the function returns without waiting for the user to start the HDL simulation.
Required Properties
Specifies either Simulink or MATLAB. A Simulink link session includes using the HDL Cosimulation block in a Simulink model for cosimulation with the HDL simulator. A MATLAB link session includes using matlabtb, matlabcp, and matlabtbeval to employ MATLAB functions as callbacks for HDL simulator events.
Specifies the full or relative (to "RunDir") path to Verilog files. Specify as single string in double quotes or as cell array of filenames.
Specifies the full or relative (to "RunDir") path to VHDL files. Specify as single string in double quotes or as cell array of filenames.
Specifies the name of the top-level HDL module.
Specifies the name of the signal access file that gives cosimulated signals read/write/force access to the EDA Simulator Link DS application. See the Synopsys VCS MX documentation (search for "PLI table") on how to create this file.
Common Optional Properties
Specifies the directory from which to execute the compilation and launch scripts. This property defaults to an automatically created temporary directory.
Specifies how to start the HDL simulator. This property accepts the following valid values:
'Batch': Start the HDL simulator in the background with no window.
'Batch with Xterm': Start the HDL simulator in the background but show session in an Xterm.
'CLI': Start the HDL simulator in an interactive shell.
'GUI': Start the HDL simulator in the Synopsys DVE GUI.
This value defaults to 'GUI'.
Specifies 'vlogan' flags.
Specifies 'vhdlan' flags.
Sets UUM-compatible compilation flags to 'vcs' .
Sets UUM-compatible runtime flags to 'simv' .
Specifies Tcl commands to execute before starting the HDL simulation. Use this property for simple waveform generation statements for signals such as clocks, resets, and enables.
For Simulink link sessions only. Specifies the number of seconds to wait for the HDL simulator to launch before reporting back an error. To avoid waiting for the simulator to start, use the value of 0. This property defaults to 10 for 'Batch' and 'Batch with Xterm' run modes, and 0 for 'CLI' and 'GUI' run modes.
Advanced Optional Properties
For Simulink links only. Specifies a cell array of HDL Cosimulation block instances that are bound to the HDL simulator about to be built and launched. This value defaults to all cosimulation blocks in the current model. Correct syntax is:
'CosimBlockList', { 'block1', block2', ... }For Simulink link sessions only. Specifies the communications mechanism between Simulink and a local HDL simulator. This property accepts the following valid values:
'AutoGenSocketPort': Find an available TCP port on the current host and program the CosimBlockList with that port. HostCommdefaults to this value.
'SharedPipe': Program the CosimBlockList to use a shared pipe connection.
'GetFromCosimBlock': Use whichever communication parameters appear in any existing cosimulation block masks.
'<portnumber>': Program the CosimBlockList with a numeric socket port value, '<portnumber>', specified as a string.
'<servicename>': Program the CosimBlockList with an OS TCP/IP service name, '<servicename>', specified as a string.
Note launchDiscovery currently does not directly support remote host execution; see Examples section for help in setting up remote connections. |
Specifies a remote host name for cross-machine simulations.
Specifies a cell array of VAR=value environment variables for use by the compilation and launch scripts. Correct syntax is:
'UserEnv', { 'VAR1=val1', 'VAR2=val2', ... }When true, instructs HDL simulator not to write the compilation and launch scripts. This value defaults to false.
When true, instructs the HDL simulator not to execute the compilation script. This value defaults to false.
When true, instructs the HDL simulator not to execute the launch script. This value defaults to false.
The default GCC compiler used is the default VG_GNU_PACKAGE from a standard installation in the VCS tree. If you want to compile using a different version of GCC, you must specify the following properties.
VG_GNU_PACKAGE Properties
Specifies using the default VG_GNU_PACKAGE in the VCS installation tree. See Synopsys documentation for the installation instructions. When you set the UseDefaultVgGnuPackage property to True, the function ignoresVgGnuPackage and VgGnuGccVersion. To guarantee inter-operability of the link application with the Synopsys VCS MX software, keep this property set to True. This value defaults to True.
Specifies the full directory path to a nondefault installation (an installation outside of the VCS tree) of VG_GNU_PACKAGE. This value defaults to ''. If you do not specify a value for dirpath (if you leave it an empty string), the default value is $VCS_HOME/gnu/{arch} (giving dirpath a dynamic default value, in effect).
Specifies the version of GCC to use. For the 2008.03 VG_GNU_PACKAGE downloads, versions include:
gcc-3.3.6
gcc-4.1.2
Typical use cases for these properties include:
Use default GCC version in the default VG_GNU_PACKAGE installation location. You specify nothing. Synopsys and the VG_GNU_PACKAGE distribution determine these defaults.
Use default GCC version in a nondefault VG_GNU_PACKAGE installation location. For this property, you must specify:
'UseDefaultVgGnuPackage', false
'VgGnuPackage', '/path/to/vg/gnu/installation'
Use nondefault GCC version in the default VG_GNU_PACKAGE installation location. For this property, you must specify:
'UseDefaultVgGnuPackage', false
'VgGnuGccVersion', 'gcc-4.1.2' (for example)
Use nondefault GCC version in a nondefault VG_GNU_PACKAGE installation location. For this property, you must specify:
'UseDefaultVgGnuPackage', false
'VgGnuPackage', '/path/to/vg/gnu/installation'
'VgGnuGccVersion', 'gcc-3.3.6' (for example)
This example compiles and launches a single-file HDL design for cosimulation with Simulink. The code allows the use of Verilog-2000 syntax in the HDL source. This code launches the Synopsys DVE software.
>> launchDiscovery( ...
'LinkType', 'Simulink', ...
'VerilogFiles', 'myinverter.v', ...
'VlogAnFlags', '+v2k', ...
'TopLevel', 'myinverter', ...
'AccFile', 'myinverter.acc' ...
);This next example compiles and launches an HDL design in batch mode. In batch mode, the HDL simulator exits after the simulation completes, thus the example relaunches the simulation by calling launchDiscovery again with the previously returned property/value structure.
To run cosimulation after HDL simulator has exited:
>> pv = launchDiscovery( ...
'LinkType', 'Simulink', ...
'VhdlFiles', '"mymultiplier.vhd mymultiplier_tb.vhd"', ...
'TopLevel', 'mymultiplier_tb', ...
'AccFile', 'mymultiplier.acc', ...
'RunMode', 'Batch', ...
);To rerun cosimulation:
>> pv.SkipScriptGeneration = true; >> pv.SkipCompilation = true; >> pv = launchDiscovery(pv); % relaunch the simulator
This next example generates scripts for customizing the environment of a specific project (USER_ENV includes some custom environment). Some common reasons to customize the resultant script include:
You want to run the scripts on a different platform.
You want to run the scripts on the same platform but on a remote machine.
The build and run for the HDL simulator is part of a larger environment involving Perl scripts, makefiles, or LSF.
You want to run in 32-bit mode on a 64-bit machine
You want to use some other GCC besides the default VG_GNU_PACKAGE.
>> srcDir = '/path/to/src';
>> launchDiscovery( ...
'LinkType', 'MATLAB', ...
'VhdlFiles', {[srcDir '/top.vhd'], [srcDir '/dut.vhd']}, ...
'TopLevel', 'top', ...
'AccFile', 'top.acc', ...
'RunDir', '/testruns/myrun', ...
'UserEnv', {'LM_LICENSE_FILE=/path/to/license.dat'}, ...
'SkipCompilation', true, ...
'SkipLaunch', true ...
);On remote machine, for example, you might use:
sh> cd /testruns/myrun sh> (edit scripts as needed) sh> . tmwESLDS.compile.sh sh> . tmwESLDS.launch.sh
After you finalize the scripts, you can execute them from MATLAB:
>> system('rsh linux100 cd /testruns/myrun ; sh tmwESLDS.compile.sh ; sh tmwESLDS.launch.sh');This example shows the generated compilation script:
# AUTO-GENERATED SH SCRIPT FOR Simulink COSIMULATION
#--- EDA Link Environment ---
LAUNCHER_NAME=tmwESLDS
NUM_BITS=64
LINK_LIB_DIR=/matlab/toolbox/discovery/linux64
LINK_SL_FILE=liblfdhdls_vlog_gcc336.so
LINK_ML_FILE=liblfdhdlc_vlog_gcc336.so
BITS_FLAG=-full64
export VG_GNU_PACKAGE=${VCS_HOME}/gnu/linux
COMPILE_SETUP_CMDS=". ${VG_GNU_PACKAGE}/source_me_${NUM_BITS}.sh"
export LD_LIBRARY_PATH=${VG_GNU_PACKAGE}/gcc-${NUM_BITS}/slib64:${LINK_LIB_DIR}:
${LD_LIBRARY_PATH}
LOAD_SL_LIB="-load ${LINK_SL_FILE}:simlinkserver"
LOAD_ML_LIB="-load ${LINK_ML_FILE}:matlabclient"
VHPI_SL_LIB="-vhpi ${LINK_SL_FILE}:simlinkserver"
VHPI_ML_LIB="-vhpi ${LINK_ML_FILE}:matlabclient"
export SL_LIB_SOCKET=37592
VLOG_FILES=/matlab/toolbox/discovery/discoverydemos/Filter/lowpass_filter.v
VHDL_FILES=
TOP_LEVEL=lowpass_filter
ACC_FILE=/matlab/toolbox/discovery/discoverydemos/Filter/lowpass_filter.pli_acc.tab
VHDLAN_FLAGS=
VLOGAN_FLAGS="+v2k"
UUMCOMP_FLAGS=
UUMRUN_FLAGS=
COMP_DEBUG_FLAGS=-debug_all
LAUNCH_DEBUG_FLAGS="-gui -i tmwESLDS.presim.tcl"
#--- User Environment ---
eval ${COMPILE_SETUP_CMDS}
vlogan ${BITS_FLAG} ${VLOGAN_FLAGS} ${VLOG_FILES}
vcs ${COMP_DEBUG_FLAGS} ${UUMCOMP_FLAGS} +vpi +applylearn+${ACC_FILE} ${BITS_FLAG}
${TOP_LEVEL} ${LOAD_ML_LIB}This example shows the generated launch script:
# AUTO-GENERATED SH SCRIPT FOR Simulink COSIMULATION
#--- EDA Link Environment ---
LAUNCHER_NAME=tmwESLDS
NUM_BITS=64
LINK_LIB_DIR=/matlab/toolbox/discovery/linux64
LINK_SL_FILE=liblfdhdls_vlog_gcc336.so
LINK_ML_FILE=liblfdhdlc_vlog_gcc336.so
BITS_FLAG=-full64
export VG_GNU_PACKAGE=${VCS_HOME}/gnu/linux
COMPILE_SETUP_CMDS=". ${VG_GNU_PACKAGE}/source_me_${NUM_BITS}.sh"
LAUNCH_SETUP_CMDS=". ${VG_GNU_PACKAGE}/source_me_${NUM_BITS}.sh"
export LD_LIBRARY_PATH=${VG_GNU_PACKAGE}/gcc-${NUM_BITS}/slib64:${LINK_LIB_DIR}:
${LD_LIBRARY_PATH}
LOAD_SL_LIB="-load ${LINK_SL_FILE}:simlinkserver"
LOAD_ML_LIB="-load ${LINK_ML_FILE}:matlabclient"
VHPI_SL_LIB="-vhpi ${LINK_SL_FILE}:simlinkserver"
VHPI_ML_LIB="-vhpi ${LINK_ML_FILE}:matlabclient"
export SL_LIB_SOCKET=37592
VLOG_FILES=/matlab/toolbox/discovery/discoverydemos/Filter/lowpass_filter.v
VHDL_FILES=
TOP_LEVEL=lowpass_filter
ACC_FILE=/matlab/toolbox/discovery/discoverydemos/Filter/lowpass_filter.pli_acc.tab
VHDLAN_FLAGS=
VLOGAN_FLAGS="+v2k"
UUMCOMP_FLAGS=
UUMRUN_FLAGS=
COMP_DEBUG_FLAGS=-debug_all
LAUNCH_DEBUG_FLAGS="-gui -i tmwESLDS.presim.tcl"
#--- User Environment ---
eval ${LAUNCH_SETUP_CMDS}
simv ${LAUNCH_DEBUG_FLAGS} ${UUMRUN_FLAGS}This example uses the GCC 4.1.2 VG_GNU_PACKAGE.
>> launchDiscovery( ...
'LinkType', 'MATLAB', ...
'VerilogFiles', 'mydesign.v', ...
'TopLevel', 'mydesign', ...
'AccFile', 'mydesign.acc', ...
'UseDefaultVgGnuPackage', false, ...
'VgGnuGccVersion', 'gcc-4.1.2' ...
);
![]() | hdldaemon | mvl2dec | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |