Main Content

Start HDL Simulator for Cosimulation in Simulink

If you are using ModelSim® or Xcelium™ simulators, use this workflow to start the HDL simulator from the MATLAB® prompt.

If you are using the Vivado® simulator, the HDL Cosimulation block loads and executes the compiled design for cosimulation, and there is no need to separately start the HDL simulator.

Start HDL Simulator from MATLAB

Start the HDL simulator directly from MATLAB by calling the HDL Verifier™ function vsim or nclaunch.

>>vsim

Note that if both tools (MATLAB and the HDL simulator) are not running on the same system, you must start the HDL simulator manually and load the HDL Verifier libraries yourself. See Cosimulation Libraries.

You can call vsim or nclaunch with additional parameters; see the reference pages for details.

You must make sure the HDL simulator executables — also called vsim (ModelSim) and nclaunch (Cadence® Xcelium) — are on the system path. See your system documentation for instruction on setting environment variables.

Linux Users

Make sure the HDL simulator executable is still on the system path after the shell is launched from MATLAB. If it is not, make sure the shell startup file does not remove it from the path environment variable.

When using Vivado simulator for cosimulation, there is no need to start the HDL simulator separately, since the cosimulation executes as a single process with a shared DLL file.

Load Instance of HDL Module for Cosimulation

Xcelium users load an instance of the HDL module for cosimulation using the hdlsimulink function. ModelSim users do the same using the vsimulink function.

 Example of loading HDL Module instance — Xcelium users

 Example of loading HDL Module instance — ModelSim users

This command opens a simulation workspace for manchester and displays a series of messages in the HDL simulator command window as the simulator loads the packages and architectures for the HDL module.