configuremodelsim - Configure ModelSim for use with EDA Simulator Link MQ

Syntax

configuremodelsim
configuremodelsim('PropertyName', 'PropertyValue'...)

Description

configuremodelsim configures ModelSim for use with the MATLAB and Simulink features of EDA Simulator Link MQ. There are two uses for this function:

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:

If you have specified Tcl commands to add to the Tcl startup DO file, those commands are now added to the ModelSimTclFunctionsForMATLAB.tcl script.

Usage Considerations

Property Name/Property Value Pairs

'action', 'install'

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.

'action', 'uninstall'

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.

'tclstart', 'tcl_commands'

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.

'vsimdir', 'pathname'

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.

Examples

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 Simulink

When 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 Simulink

If 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 Simulink

If 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 deconfigured

If you now inspect ModelSimTclFunctionsForMATLAB.tcl you will find that the contents of the file have been removed.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS