Trying simple tutorial for EDA Link between Simulink and Modelsim for MATLAB R2010a

6 views (last 30 days)
When I get to the part of tutorial, "Loading Instances of the VHDL Entity for Cosimulation with Simulink" BUT the command
"vsimulink work.inverter" does not work. Modelsim says 'vsimulink' is an invalid command.
I can't really get passed that and its very frustrating.
  4 Comments
Edward
Edward on 20 Oct 2011
Whenever I try typing the vsim commands in the MATLAB windows per the tutorial's directions I also get errors:
>> vsim('tclstart','vsimulink work.parse','socketsimulink','4449')
??? SWITCH expression must be a scalar or string constant.
Error in ==> hdlsim>l_GetModelSimLibInfo at 549
switch (lfmVer)
Error in ==> hdlsim at 113
case 'ModelSim', libInfo = l_GetModelSimLibInfo;
Error in ==> vsim at 101
hdlsim(pvpairs{:});
>> vsim('tclstart', 'vsimulink work.parse')
??? SWITCH expression must be a scalar or string constant.
Error in ==> hdlsim>l_GetModelSimLibInfo at 549
switch (lfmVer)
Error in ==> hdlsim at 113
case 'ModelSim', libInfo = l_GetModelSimLibInfo;
Error in ==> vsim at 101
hdlsim(pvpairs{:});

Sign in to comment.

Answers (2)

Kaustubha Govind
Kaustubha Govind on 20 Oct 2011
I think the issue may be that Modelsim is not on the system path, and MATLAB can't find it. For example, try the following from MATLAB:
>> !vsim -version
If this doesn't work, make sure that vsim.exe on the system path and restart MATLAB.
  3 Comments
Edward
Edward on 7 Nov 2011
What is the distinction between typing "vsim" in MATLAB vs. typing "!vsim" ?
What does the ! do? From my messages, it looks like it is working with ! but not without....why would that be?
Here is the two responses I get from MATLAB:
>> !vsim -version
Model Technology ModelSim PE vsim 10.0 Simulator 2010.12 Dec 4 2010
>> vsim
??? SWITCH expression must be a scalar or string constant.
Error in ==> hdlsim>l_GetModelSimLibInfo at 549
switch (lfmVer)
Error in ==> hdlsim at 113
case 'ModelSim', libInfo = l_GetModelSimLibInfo;
Error in ==> vsim at 101
hdlsim(pvpairs{:});
Kaustubha Govind
Kaustubha Govind on 8 Nov 2011
"vsim" executes the vsim.m file that is part of the EDA Simulator Link product (type "which vsim" to see the full path to the file), whereas "!vsim" redirects the command to the system shell. So it is equivalent to opening a system command window and running "vsim".
It looks like vsim.exe is on your system path, but MATLAB has trouble parsing the command. It could be that ModelSim 10.0 is not supported with the version of MATLAB you have installed. Open your help window (type "doc") and navigate to EDA Simulator Link->Getting Started->Product Requirements->Supported EDA Tools to see the list of supported tools for your version.
Also, please consider contacting Tech Support if this doesn't help.

Sign in to comment.


Walter Roberson
Walter Roberson on 7 Nov 2011
Put a breakpoint in at hdlsim>l_GetModelSimLibInfo at 549 and examine lfmVer and see whether it is indeed a scalar or a string constant. If we knew the value that lfmVer had at that point, we might be able to get further.
Also, please look at the lines immediately after that and tell us what data type the switch() code is expecting to receive.
  1 Comment
Edward
Edward on 8 Nov 2011
Wow... This helped me a great deal. When I trace the generation of this message I find the following code:
switch (lfmVer)
% when using the tmwgcc libs, we do NOT want to let MTI prepend to
% LD_LIBRARY_PATH.
case {'6.3', '6.4', '6.5'}
libInfo.letMtiPrependLdPath = false;
This seems to be telling me that MATLAB is expecting a version of Modelsim of 6.3, 6.4, or 6.5. But for whatever reason, Modelsim jumped up to 10.0 in its later releases and that is what I'm using.
I will try using an older version of Modelsim and see what happens.
Thanks.

Sign in to comment.

Categories

Find more on RF Blockset Models for Transceivers in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!