| EDA Simulator Link™ MQ | ![]() |
| On this page… |
|---|
Installing Related Application Software |
For details on how to install the EDA Simulator Link™ MQ software, see the MATLAB™ installation instructions.
Based on your configuration decisions and the software required for your EDA Simulator Link MQ application, identify software you need to install and where you need to install it. For example, if you need to run multiple instances of the link MATLAB server on different machines, you need to install MATLAB and any applicable toolbox software on multiple systems. Each instance of MATLAB can run only one instance of the server.
For details on how to install the HDL simulator, see the installation instructions for that product. For information on installing MathWorks™ products, see the MATLAB installation instructions.
EDA Simulator Link MQ software provides a guided set-up script (syscheckmq) for configuring your simulator. This script works whether you have installed the link software and MATLAB on the same machine as the HDL simulator or installed them on different machines.
The set-up script creates a configuration file containing the location of the appropriate EDA Simulator Link MQ MATLAB and Simulink libraries. You can then include this configuration with any other calls you make using ModelSim SE/PE vsim from the HDL simulator. You only need to run this script once.
Note The EDA Simulator Link MQ configuration and diagnostic script works only on UNIX and Linux. Windows users: please see instructions below. |
If you plan to use the MATLAB vsim.m function instead, no setup is required.
Refer to Using the EDA Simulator Link™ MQ Libraries for the correct link application library for your platform. Then see Starting ModelSim SE/PE from MATLAB.
After you have created your configuration files, see Starting the ModelSim Software from a Shell.
syscheckmq provides an easy way to configure your simulator setup to work with the EDA Simulator Link MQ software.
The following is an example of running syscheckmq on a Linux 64 machine with EDA Simulator Link MQ libraries in a different location than where they were first installed and specifying a TCP/IP connection.
Start syscheckmq:
% syscheckmq ******************************************************************************** Kernel name: Linux Kernel release: 2.6.11.4-20a-smp Machine: x86_64 ********************************************************************************
The script first returns the location of the HDL simulator installation (vsim.exe). If it does not find an installation, you receive an error message. Either provide the path to the installation or quit the script and install ModelSim SE/PE. You are then prompted to accept this installation or provide a path to another one, after which you receive a message confirming the HDL simulator installation:
Found /hub/share/apps/ModelSim/v60e/se/modeltech/bin/vsim on the path. Press Enter to use the path we found or enter another one: ******************************************************************************** /hub/share/apps/ModelSim/v60e/se/modeltech/bin/vsim -version Model Technology ModelSim SE-64 vsim 6.0e Simulator 2005.06 Jun 17 2005 ModelSim mode: 32 bits ********************************************************************************
Next, the script needs to know if the EDA Simulator Link MQ libraries are in the default directory (where they were first installed) or if you have moved them to another directory. If you have the HDL simulator and MATLAB on separate machines, move the link libraries to the ModelSim SE/PE machine.
Select method to search for EDA Simulator Link MQ libraries: 1. Use libraries installed with EDA Simulator Link MQ. 2. Prompt me to specify the direct path to the libraries. 2 Enter the path to liblfmhdlc_gcc41.so and liblfmhdls_gcc41.so: /tmp/lfmconfig/linux64 Found /tmp/lfmconfig/linux64/liblfmhdlc_gcc41.so and /tmp/lfmconfig/linux64/liblfmhdls_gcc41.so.
The script then runs a dependency checker to check for supporting libraries. If any of the libraries cannot be found, you probably need to append your environment path to find them.
********************************************************************************
Running dependency checker "ldd /tmp/lfmconfig/linux64/liblfmhdlc_gcc41.so".
Dependency checker passed.
Dependency status:
librt.so.1 => /lib64/tls/librt.so.1 (0x00002aaaaac0a000)
libpthread.so.0 => /lib64/tls/libpthread.so.0 (0x00002aaaaad12000)
libstdc++.so.6 => /devel/Ahdl/nightly/matlab/sys/os/glnxa64/libstdc++.so
.6 (0x00002aaaaae27000)
libm.so.6 => /lib64/tls/libm.so.6 (0x00002aaaab029000)
libgcc_s.so.1 => /devel/Ahdl/nightly/matlab/sys/os/glnxa64/libgcc_s.so.1
(0x00002aaaab180000)
libc.so.6 => /lib64/tls/libc.so.6 (0x00002aaaab28d000)
/lib64/ld-linux-x86-64.so.2 (0x0000555555555000)
********************************************************************************
This next step loads the EDA Simulator Link MQ libraries and compiles a test module to verify the libraries loaded correctly.
Press Enter to load EDA Simulator Link MQ or enter 'n' to skip this test:
Reading /mathworks/hub/share/apps/ModelSim/v60e/se/modeltech/linux_x86_64/../modelsim.ini
"worklfx24154" maps to directory worklfx24154. (Default mapping)
Model Technology ModelSim SE-64 vlog 6.0e Compiler 2005.06 Jun 17 2005
-- Compiling module d24154
Top level modules:
d24154
********************************************************************************
Reading /mathworks/hub/share/apps/ModelSim/v60e/se/modeltech/tcl/vsim/pref.tcl
# 6.0e
# vsim -do exit -foreign {matlabclient /tmp/lfmconfig/linux64/liblfmhdlc_gcc41.so}
-c worklfx24154.d24154
# // ModelSim SE-64 6.0e Jun 17 2005 Linux 2.6.11.4-20a-smp
# //
# // Copyright Mentor Graphics Corporation 2005
# // All Rights Reserved.
# //
# // THIS WORK CONTAINS TRADE SECRET AND
# // PROPRIETARY INFORMATION WHICH IS THE PROPERTY
# // OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS
# // AND IS SUBJECT TO LICENSE TERMS.
# //
# Loading worklfx24154.d24154
# Loading /tmp/lfmconfig/linux64/liblfmhdlc_gcc41.so
# exit
********************************************************************************
EDA Simulator Link MQ libraries loaded successfully.
********************************************************************************
Next, the script checks a TCP connection. If you choose to skip this step, the configuration file specifies use of shared memory. Both shared memory and socket configurations are in the configuration file; depending on your choice, one configuration or the other is commented out.
Press Enter to check for TCP connection or enter 'n' to skip this test: Enter an available port [5001] Enter remote host [localhost] Press Enter to continue ttcp_glnx -t -p5001 localhost Connection successful
Lastly, the script creates the configuration file, unless for some reason you choose not to do so at this time.
******************************************************************************** Press Enter to Create Configuration files or 'n' to skip this step: ******************************************************************************** Created template files simulink24255.arg and matlab24255.arg. Inspect and modify if necessary. ******************************************************************************** Diagnosis Completed
The template file names, in this example simulink24255.arg and matlab24255.arg, have different names each time you run this script.
After the script is complete, you can leave the configuration files where they are or move them to wherever it is convenient.
syscheckmq does not run on Windows. To use the configuration script on Windows, create two files according to the following instructions:
Create a MATLAB configuration file and name it. There are no file-naming restrictions. Enter the following text:
//Command file for MATLAB EDA Simulator Link MQ.
//Loading of foreign Library, usage example: vsim -f matlab14455.arg entity.
//You can manually change the following line to point to the correct library.
//The default location of the 32-bit Windows library is at
//MATLABROOT/toolbox/modelsim/windows32/liblfmhdlc_vs05.dll.
-foreign "matlabclient c:/path/liblfmhdlc_vs05.dll"where path is the path to the particular EDA Simulator Link MQ shared library you want to invoke (in this example. See Using the EDA Simulator Link™ MQ Libraries).
For more information on the -foreign option, refer to your ModelSim documentation.
The comments in the above text are optional.
Create a Simulink configuration file and name it. There are no file-naming restrictions. Enter the following text:
//Command file for Simulink EDA Simulator Link MQ. //Loading of foreign Library, usage example: vsim -f simulink14455.arg entity. //You can manually change the following line to point to the correct library. //For example the default location of the 32-bit Windows library is at //MATLABROOT/toolbox/modelsim/windows32/liblfmhdls_vs05.so. //For socket connection uncomment and modify the following line: -foreign "simlinkserver c:/path/liblfmhdls_vs05.so ; -socket 5001" //For shared connection uncomment and modify the following line: //-foreign "simlinkserver c:/path/liblfmhdls_vs05.so"
Where path is the path to the particular EDA Simulator Link MQ shared library you want to invoke. See Using the EDA Simulator Link™ MQ Libraries.
Note If you are going to use a TCP/IP socket connection, first confirm that you have an available port to put in this configuration file. Then, comment out whichever type of communication you will not be using. |
The comments in the above text are optional.
After you have finished creating the configuration files, you can leave the files where they are or move them to another location that is convenient.
In general, you want to use the same compiler for all libraries linked into the same executable. The link software provides many versions of the same library compilers that are available with the HDL simulators (usually some version of GCC). Using the same libraries ensures compatibility with other C++ libraries that may get linked into the HDL simulator, including SystemC libraries.
If you have any of these conditions, choose the version of the EDA Simulator Link MQ library that matches the compiler used for that code:
Link other third-party applications into your HDL simulator.
Compile and link in SystemC code as part of your design or testbench.
Write custom C/C++ applications and link them into your HDL simulator.
If you do not link any other code into your HDL simulator, you can use any version of the supplied libraries. A default library version is understood by the vsim MATLAB command.
Note EDA Simulator Link MQ software supports running in 32-bit mode on a 64-bit Solaris machine, but it does not support running on a 32-bit Solaris platform. |
The EDA Simulator Link MQ libraries are named according to the following format:
productdir/arch/lib{product_short_name}{client_server_tag}_{compiler_tag).{libext}
where
| productdir | modelsim |
| arch | linux32, linux64, solaris32, solaris64, or windows32 |
| product_short_name | lfm |
| client_server_tag | c or s (MATLAB or Simulink) |
| compiler_tag | gcc32, gcc33, gcc40, gcc41, spro11, or vs05 |
| libext | dll or so |
Not all combinations are supported. See Default Libraries for valid combinations.
EDA Simulator Link MQ scripts fully support the use of designated default libraries.
With the EDA Simulator Link MQ software, the default library for each platform is the version compiled using the same compiler that The MathWorks uses to compile MATLAB and Simulink. The following table lists all the libraries shipped with the link software. The default libraries for each platform are in bold text.
| Platform | MATLAB Library | Simulink Library |
|---|---|---|
| Linux32, Linux64 | liblfmhdlc_gcc41.so | liblfmhdls_gcc41.so |
| Solaris32, Solaris64 | liblfmhdlc_spro11.so | liblfmhdls_spro11.so |
| Windows32 | liblfmhdlc_vs05.dll | liblfmhdls_vs05.dll |
You can use a different HDL-side library by specifying it explicitly using the libfile parameter to the vsim MATLAB command. You should choose the version of the library that matches the compiler and system libraries you are using for any other C/C++ libraries linked into the HDL simulator. Depending on the version of your HDL simulator, you may need to explicitly set additional paths in the LD_LIBRARY_PATH environment variable.
Depending on the version of your HDL simulator, you may need to explicitly set additional paths in the LD_LIBRARY_PATH environment variable. For example, if you want to use a nondefault library:
Copy the system libraries from the MATLAB installation (found in matlabroot/sys/os/platform) to the machine with the HDL simulator (where matlabroot is your MATLAB installation and platform is one of the above architecture, e.g., linux32).
Modify the LD_LIBRARY_PATH environment variable to add the path to the system libraries that were copied in step 1.
Example: EDA Simulator Link™ MQ Alternative Library Using vsim. In this example, you run the 32-bit Solaris version of ModelSim 6 software on the same 64-bit Solaris machine which is running MATLAB. Because you want to incorporate some SystemC designs, you are using the EDA Simulator Link MQ version compiled with GCC 3.3. You can download the appropriate version of GCC with its associated system libraries from Mentor Graphics, instead of using the default library version compiled with SunPro 11.
In MATLAB:
>> currPath = getenv('PATH');
>> currLdPath = getenv('LD_LIBRARY_PATH');
>> setenv('PATH', ['/tools/modelsim-6.1e/bin:' currPath]);
>> setenv('LD_LIBRARY_PATH', ['/tools/mtigcc/gcc-3.3-sunos510/lib:' currLdPath]);
>> setenv('MTI_VCO_MODE', '32');
>> vsim('tclstart', { 'vlib work', 'vcom inverter.vhd', 'vsimulink inverter' }, ...
'libfile', 'liblfmhdls_gcc33');
You change the PATH to ensure that you get the correct version of the ModelSim software. You change the LD_LIBRARY_PATH because the HDL simulator does not automatically add the necessary path to the system libraries. The EDA Simulator Link MQ function vsim automatically detects the use of the 32-bit version of the HDL simulator and uses the solaris32 library directory in the link software installation; there is no need to specify the libdir parameter in this case.
The library resolution can be verified using ldd from within the ModelSim GUI:
vsim> exec ldd /path/to/liblfmhdls_gcc33.so # librt.so.1 => /lib/librt.so.1 # libpthread.so.1 => /lib/libpthread.so.1 # libstdc++.so.5 => /tools/mtigcc/gcc-3.3-sunos510/lib/libstdc++.so.5 # libm.so.2 => /lib/libm.so.2 # libgcc_s.so.1 => /tools/mtigcc/gcc-3.3-sunos510/lib/libgcc_s.so.1 # libaio.so.1 => /lib/libaio.so.1 # libmd5.so.1 => /lib/libmd5.so.1 # libc.so.1 => /lib/libc.so.1 # /platform/SUNW,Sun-Blade-1000/lib/libmd5_psr.so.1 # /platform/SUNW,Sun-Blade-1000/lib/libc_psr.so.1
Example: EDA Simulator Link™ MQ Alternate Library Using System Shell. This example shows how to load a ModelSim session by explicitly specifying the EDA Simulator Link MQ library (either the default or one of the alternatives). By explicitly using a system shell, you can execute this example on the same machine as MATLAB, on a different machine, and even on a machine with a different operating system.
In this example, you are running the 64-bit Linux version of QuestaSim 6.2c. It does not matter which machine is running MATLAB. Instead of using the EDA Simulator Link MQ default library version compiled with GCC 4.1.1, you are using the version compiled with GCC 4.0.2. You can download the appropriate version of GCC with its associated system libraries from Mentor Graphics.
In a csh-compatible system shell:
csh> setenv PATH /tools/modelsim-6.2c/bin:${PATH}
csh> setenv LD_LIBRARY_PATH /tools/mtigcc/gcc-4.0.2-linux_x86_64/lib64:${LD_LIBRARY_PATH}
csh> setenv MTI_VCO_MODE 64
csh> vlib work
csh> vcom +acc+inverter inverter.vhd
csh> vsim +acc+inverter -foreign
"matlabclient /tools/matlab-7b/toolbox/modelsim/linux64/liblfmhdlc_gcc40.so" inverter.vhd
You change the PATH to ensure that you get the correct version of the ModelSim software. You change the LD_LIBRARY_PATH because the HDL simulator does not automatically add the necessary path to the system libraries unless you are working with 6.2+ and have placed GCC at the root of the ModelSim installation.
You can check the proper library resolution using ldd as in the previous example.
![]() | Requirements | Starting the HDL Simulator | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |