| EDA Simulator Link™ MQ | ![]() |
vsim('PropertyName', 'PropertyValue'...)
vsim('PropertyName', 'PropertyValue'...) starts and configures the ModelSim simulator (vsim) for use with the MATLAB and Simulink features of EDA Simulator Link MQ. The first directory in ModelSim matches your MATLAB current directory.
After you call this function, you can use EDA Simulator Link MQ command extensions to perform the following actions:
Load instances of VHDL entities or Verilog modules for simulations that use MATLAB for verification
Load instances of VHDL entities or Verilog modules for simulations that use Simulink for cosimulation
The property name/property value pair settings allow you to customize the Tcl commands used to start ModelSim, the vsim executable to be used, the path and name of the DO file that stores the start commands, and for Simulink applications, details about the mode of communication to be used by the applications.
Tip Use pingHdlSim to add a pause between the call to vsim and the call to actually run the simulation when you are attempting to automate the cosimulation. |
Specifies one or more Tcl commands to execute after ModelSim launches. Specify a command string or a cell array of command strings.
Specifies the path name to the ModelSim simulator executable (vsim.exe) to be started. By default, the function uses the first version of vsim.exe that it finds on the system path (defined by the path variable) . Use this option to start different versions of the ModelSim simulator or if the version of the simulator you want to run does not reside on the system path.
Specifies a DO macro file that defines the behavior of the ModelSim commands vsimmatlab and vsimulink. The DO file consists of some general-purpose Tcl commands for launching ModelSim and any commands you specify with the 'tclstart' property. If you omit this property, the function creates a temporary file that is overwritten each time ModelSim starts. If you specify a name for the DO file, later you can use the file to start ModelSim from the command line as shown in the following syntax:
vsim -gui -do do_file
Specifies where to run ModelSim. By default, the function uses the current working directory.
The following conditions apply to this name/value pair:
If dirname is specified and the directory exists, ModelSim is run in the specified directory.
If no rundir property/value pair is specified or if dirname is empty, ModelSim is run in the current working directory.
If the value of dirname is "TEMPDIR", the function creates a temporary directory in which it runs ModelSim.
If dirname is specified and the directory does not exist, you will get an error.
Specifies TCP/IP socket communication for links between ModelSim and Simulink. For TCP/IP socket communication on a single computing system, the tcp_spec can consist of just a TCP/IP port number or service name. If you are setting up communication between computing systems, you must also specify the name or Internet address of the remote host. See Specifying TCP/IP Values for some valid tcp_spec examples.
For more information on choosing TCP/IP socket ports, see Choosing TCP/IP Socket Ports
If ModelSim and Simulink are running on the same computing system, you have the option of using shared memory for communication. Shared memory is the default mode of communication and takes effect if you omit -socketsimulink tcp_spec from the function call.
Note The function applies the communication mode specified by this property to all invocations of Simulink from ModelSim. |
Determines whether ModelSim is launched from vsim. The default is yes, which launches ModelSim and creates a startup Tcl file. If startms is set to no, ModelSim is not launched, but a startup Tcl file is still created.
This startup Tcl file contains pointers to MATLAB libraries. To run ModelSim on a machine without MATLAB, copy the startup Tcl file and MATLAB library files to the remote machine and start ModelSim manually. See Using the EDA Simulator Link™ MQ Libraries.
Specifies the directory containing MATLAB library files. This property creates an entry in the startup Tcl file that points to the directory with the libraries needed for ModelSim to communicate with MATLAB when ModelSim is running on a machine that does not have MATLAB.
The following function call sequence changes the directory location to VHDLproj and then calls the function vsim. Because the call to vsim omits the 'vsimdir' and 'startupfile' properties, vsim uses the default vsim executable and creates a temporary DO file in a temporary directory. The 'tclstart' property specifies a Tcl command that loads an instance of a VHDL entity for MATLAB verification:
The vsimmatlab command loads an instance of the VHDL entity parse in the library work for MATLAB verification.
The matlabtb command begins the test bench session for an instance of entity parse, using TCP/IP socket communication on port 4449 and a test bench timing value of 10 ns.
cd VHDLproj % Change directory to ModelSim project directory
vsim('tclstart','vsimmatlab work.parse; matlabtb parse 10 ns -socket 4449')
The following function call sequence changes the directory location to VHDLproj and then calls the function vsim. Because the call to vsim omits the 'vsimdir' and 'startupfile' properties, vsim uses the default vsim executable and creates a DO file in a temporary directory. The 'tclstart' property specifies a Tcl command that loads the VHDL entity parse in the library work for cosimulation between vsim and Simulink. The 'socketsimulink' property specifies that TCP/IP socket communication on the same computer is to be used for links between Simulink and ModelSim, using socket port 4449:
cd VHDLproj % Change directory to ModelSim project directory
vsim('tclstart','vsimulink work.parse','socketsimulink','4449')
![]() | tclHdlSim | EDA Simulator Link™ MQ Command Extensions for the HDL Simulator Reference | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |