How can I stop the ModelSim GUI from coming up during cosimulation when using Link for ModelSim?

18 views (last 30 days)
I do not want the ModelSim GUI to come up when I run a model that contains the HDL Cosimulation block. I want ModelSim to run in batch or background mode.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 May 2010
This enhancement has been incorporated in Release 2010a (R2010a). For previous product releases, read below for any possible workarounds:
The built-in Link for ModelSim VSIM function does not have an option to run ModelSim in batch mode.
There are two workarounds possible for this issue. Both the workarounds involve creating a do file that will execute ModelSim in the background. Here ModelSim will have to be invoked outside of MATLAB.
Both of these workarounds refer the the 'Manchester Reciever' demo model that is shipped with the EDA Simulator Link MQ. Please refer to this demo for more information on specific files.
WORKAROUND #1
Perform the following steps to start ModelSim in batch mode:
1. Create a do file. For this example, we will call this file batchmode.do. The do file is created for the VHDL file inverter.vhd Your do file should look like this:
vlib work
vmap work work
vcom inverter.vhd %Name of the VHDL code
vsim -foreign {simlinkserver MATLABROOT/toolbox/modelsim/glnx86/simulinklink.so} work.inverter
This starts ModelSim in the background.
2. You can now run the simulation from Simulink.
If you want to automatically create the do file rather than manually create it, read workaround 2.
WORKAROUND #2
If you do not want to create the complete do file manually, you can use this workaround. This example is for the Manchester Receiver demo.
1. From the MATLAB command prompt, execute the following:
vsim('tclstart', manchestercmds, 'startupfile', 'batchmode')
This creates a do file called ‘batchmode’. The ‘tclstart’ property name/value pair can have a cell array of startup Tcl commands to be executed in ModelSim.
2. At the shell prompt, type the following:
%vsim –c –do batchmode
For more information on the VSIM function, type the following at the MATLAB prompt:
doc vsim

More Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!