How do I pass TCL commands directly to ModelSim from MATLAB using Link for ModelSim 1.4 (R14SP3)?

1 view (last 30 days)
I would like to be able to pass TCL commands to an open session of ModelSim directly from the MATLAB Prompt, using Link for ModelSim. Using the 'tclstart' property of the VSIM command, I am able to open a new session of ModelSim and issue a set of TCL commands. However, I would like to be able to send further commands to this session of ModelSim, instead of opening a new session.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This functionality is available but undocumented in Link for ModelSim 1.4 (R14SP3).
To work around the issue, read the description below on how to use an undocumented option for the HDLDAEMON command. The 'TCLCMD' option will send a TCL command from MATLAB to be executed in ModelSim. This interface has some limitations; using it to send TCL commands that changes the state of the simulator is not recommended and can cause hang-ups. This is a limitation of ModelSim and is documented in their interface.
To send a TCL command from MATLAB to an open ModelSim session, you must first connect to ModelSim using the HLDDAEMON command. You will then be able to use the undocumented 'TCLCMD' option for the HLDDAEMON command, which will pass commands to ModelSim. For example, typing the following command at the MATLAB prompt:
hdldaemon('TCLCMD','echo "Hello"');
This code will display the word "Hello" in the ModelSim prompt. To quit any connected ModelSim sessions, you can use the following command:
hdldaemon('TCLCMD','quit -f')

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Products


Release

R14SP1

Community Treasure Hunt

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

Start Hunting!