| EDA Simulator Link™ MQ | ![]() |
configuremodelsim
configuremodelsim('PropertyName', 'PropertyValue'...)
Note configuremodelsim has been replaced by the guided setup script (syscheckmq) for configuring your simulator setup. Although configuremodelsim supported for backward compatibility, you should consider using the setup script instead. See Setting Up the HDL Simulator for Use with the Link Software. |
configuremodelsim configures ModelSim for use with the MATLAB and Simulink features of EDA Simulator Link MQ. There are two uses for this function:
To configure ModelSim so that it may access EDA Simulator Link MQ when invoked from outside of MATLAB
To add Tcl commands to the Tcl startup script that runs every time you invoke ModelSim
When you use configuremodelsim without any arguments, the function prompts you to either allow it to find the installed ModelSim executable or have you provide the path to the ModelSim installation you want to use. If you had not configured the software previously (no Tcl DO file exists), configuremodelsim creates a new ModelSimTclFunctionsForMATLAB.tcl script in the tcl directory under the ModelSim installation. If a previous configuration exists, configuremodelsim prompts you to decide if you want to replace the existing configuration.
configuremodelsim('PropertyName', 'PropertyValue'...) starts an interactive or programmatic script (depending on which property name/value pairs you select) that allows you to customize the ModelSim configuration. See configuremodelsim Property Name/Property Value Pairs.
After you call this function, ModelSim is ready to use EDA Simulator Link MQ when you invoke ModelSim from outside of MATLAB. You can use HDL Simulator Command Extensions Reference from the ModelSim environment to perform the following actions:
Load instances of VHDL entities or Verilog modules for simulations that use MATLAB or Simulink for verification or cosimulation
Begin MATLAB test bench or component sessions for loaded instances
End MATLAB test bench or component sessions
If you have specified Tcl commands to add to the Tcl startup DO file, those commands are now added to the ModelSimTclFunctionsForMATLAB.tcl script.
configuremodelsim is intended to be used for setting up ModelSim and MATLAB when you plan to start ModelSim from outside of MATLAB.
If you intend to invoke vsim from the MATLAB prompt, then you do not need to use configuremodelsim. (MATLAB will find vsim if it already appears in the system path, and, if it does not, you can set the vsimdir property value of vsim in MATLAB to provide the path information.)
In addition, if you are starting ModelSim from outside of MATLAB, you should define your environment with the path to the ModelSim executable before running configuremodelsim.
Note The property name/property value options for vsim may have been set previously with a call to configuremodelsim. To check on current settings, search for and browse through the contents of the file \tcl\ModelSimTclFunctionsForMATLAB.tcl in your ModelSim installation path. The vsim function overrides any options previously defined by the configuremodelsim function. To start ModelSim from MATLAB with a default configuration previously defined by configuremodelsim, issue the command !vsim at the MATLAB command prompt. |
The vsimdir property value of configuremodelsim only instructs configuremodelsim where to put the Tcl DO file. It does not set up MATLAB workspace for MATLAB invocation of ModelSim (instead, you can perform this setup with the vsimdir property value of vsim).
If you are using configuremodelsim to add Tcl commands to the Tcl startup DO file, to change the location of the Tcl startup DO file, or to remove the Tcl startup DO file, you can run configuremodelsim as many times as you wish. You need to run configuremodelsim only once to set the location of the Tcl DO file.
Instructs configuremodelsim to create a new ModelSimTclFunctionsForMATLAB.tcl script.
This script is programmatic if you use 'vsimdir' to specify the ModelSim installation you want to use; otherwise, configuremodelsim prompts you for the desired directory.
If a previous configuration exists, configuremodelsim prompts you to decide if you want to replace the existing configuration. If you respond yes, the old Tcl DO file is overwritten with a new one.
Removes the EDA Simulator Link MQ configuration from the ModelSim startup DO file. The property replaces the contents of ModelSimTclFunctionsForMATLAB.tcl with this single line of text: "# MATLAB and Simulink option was deconfigured."
This script is programmatic if you use 'vsimdir' to specify the ModelSim installation you want to use; otherwise, configuremodelsim prompts you for the desired directory.
Adds one or more Tcl commands to the Tcl DO file that executes during ModelSim startup. Specify a command string or a cell array of command strings that configuremodelsim will append to ModelSimTclFunctionsForMATLAB.tcl.
This script is programmatic only; if you do not also use 'vsimdir' with this property, configuremodelsim uses the first vsim it encounters on the system path and modifies the Tcl DO file (ModelSimTclFunctionsForMATLAB.tcl) in the \tcl directory under this ModelSim installation.
Specifies where to put the Tcl script containing EDA Simulator Link MQ Tcl commands. This script is programmatic only; if you do not specify a directory with this property, configuremodelsim uses the first vsim it encounters on the system path and installs the Tcl DO file (ModelSimTclFunctionsForMATLAB.tcl) in the \tcl directory under this ModelSim installation.
The following function call starts the interactive installation script that installs EDA Simulator Link MQ commands for use with ModelSim:
configuremodelsim
Because the property name vsimdir was not supplied, configuremodelsim prompts you for the directory:
Identify the ModelSim installation to be configured for MATLAB and Simulink
Do you want configuremodelsim to locate installed ModelSim executables [y]/n? n
Please enter the path to your ModelSim executable file (modelsim.exe or vsim.exe):
D:\Applications\Modeltech_6.0e\win32
Modelsim successfully configured to be used with MATLAB and SimulinkWhen configuremodelsim is run on an existing configuration, the dialog looks similar to the following sample:
Identify the ModelSim installation to be configured for MATLAB and Simulink
Do you want configuremodelsim to locate installed ModelSim executables [y]/n? n
Please enter the path to your ModelSim executable file (modelsim.exe or vsim.exe):
D:\Applications\Modeltech_6.0e\win32
Previous MATLAB startup file found in this installation of ModelSim:
D:\Applications\Modeltech_6.0e\win32\..\tcl\ModelSimTclFunctionsForMATLAB.tcl
Do you want to replace this file [y]/n? y
Modelsim successfully configured to be used with MATLAB and SimulinkIf you answer no to the prompt for replacing the file, you receive this message instead:
Modelsim configuration not updated for MATLAB and Simulink
This next example shows adding a Tcl command to the ModelSim configuration, for a customized Tcl DO file:
configuremodelsim('tclstart','echo Starting ModelSim and EDA Simulator Link MQ')
vsimoptions =
echo Starting ModelSim and EDA Simulator Link MQ
Modelsim successfully configured to be used with MATLAB and SimulinkIf you now inspect ModelSimTclFunctionsForMATLAB.tcl you will find this last Tcl command appended to the file, as shown in the following graphic.

The following example shows removing the EDA Simulator Link MQ configuration from ModelSim:
configuremodelsim ('action', 'uninstall')
Identify the Modelsim installtion to be deconfigured for MATLAB and Simulink
Do you want configuremodelsim to locate installed Modelsim executables [y]/n? n
Please enter the path to your Modelsim executable file (modelsim.exe or vsim.exe):
D:\Applications\Modeltech_6.0e\win32
Previous MATLAB startup file found in this installation of Modelsim:
D:\Applications\Modeltech_6.0e\win32...\tcl\ModelsimTclFunctionsForMATLAB.tcl
Do you want to replace this file (required for deconfiguration) [y]/n? y
Modelsim successfully deconfiguredIf you now inspect ModelSimTclFunctionsForMATLAB.tcl you will find that the contents of the file have been removed.

![]() | MATLAB Function Reference | dec2mvl | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |