vsim
Start and configure ModelSim for use with HDL Verifier
Syntax
Description
vsim
starts and configures the ModelSim™ simulator for use with the MATLAB® or Simulink® cosimulation.
vsim
creates a startup (or .do
) file that adds
these Tcl
commands to ModelSim:
vsimmatlab
: link to MATLAB from ModelSimvsimulink
: link to Simulink from ModelSimvsimmatlabsysobj
: link to MATLAB System object™ from ModelSim
You can use these ModelSim
Tcl
commands instead of the ModelSim
vsim
command. These commands load instances of VHDL® entities or Verilog® modules for simulations that use MATLAB or Simulink for verification.
Tip
When attempting to automate the cosimulation, use pingHdlSim
to add a pause between the call to vsim
and
the call to run the simulation.
vsim(
configures the ModelSim simulator using options specified by one or more name-value pair
arguments.Name,Value
)
Examples
Start and Configure ModelSim
Change the folder location to the ModelSim project folder, and then call the vsim
function using the
default executable. The function creates a temporary .do
file in a
temporary folder.
Specify the Tcl command vsimmatlab
by using the
'tclstart'
name-value pair argument. Specify to load an instance of
the VHDL entity parse
in the library work
for
MATLAB verification.
Begin the testbench session for an instance of the entity parse
by
using the matlabtb
command. Specify TCP/IP socket
communication on port 4449
and a testbench timing value of 10
ns
.
cd VHDLproj % Change folder to ModelSim project folder vsim('tclstart','vsimmatlab work.parse; matlabtb parse 10 ns -socket 4449')
Change the folder location to the ModelSim project folder, and then call the vsim
function. Specify
the use of TCP/IP socket communication on the same computer for links between Simulink and ModelSim by using the 'socketsimulink'
name-value pair argument.
Specify using socket port 4449
.
cd VHDLproj % Change folder to ModelSim project folder vsim('tclstart','vsimulink work.parse','socketsimulink','4449')
Input Arguments
Version History
Introduced in R2008a