| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → EDA Simulator Link |
| Contents | Index |
| Learn more about EDA Link Simulator |
| On this page… |
|---|
For details on how to install the EDA Simulator Link software, see the MATLAB installation instructions.
You can start using the link software right away by issuing the link HDL simulator launch command, vsim, from MATLAB, and providing the EDA Simulator Link library information and other required parameters (see Using the EDA Simulator Link Libraries). No special setup is required.
If you would like some assistance in running through the setup, you can diagnose your setup (correct omissions and errors) and also customize your setup for future invocations of vsim by following the process in Diagnosing and Customizing Your Setup for Use with the HDL Simulator and EDA Simulator Link Software.
Based on your configuration decisions and the software required for your EDA Simulator Link 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 and activating MathWorks products, see the MATLAB installation and activation instructions.
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 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. The MATLAB vsim command chooses a default version of this library.
For examples on specifying EDA Simulator Link libraries when cosimulating across a network, see Performing Cross-Network Cosimulation.
The EDA Simulator Link HDL libraries use the following naming format:
edalink/extensions/version/arch/lib{version_short_name}{client_server_tag}_{compiler_tag)
.{libext}
where
| version | modelsim |
| arch | linux32, linux64, solaris32, solaris64, or windows32 |
| version_short_name | lfmhdl |
| client_server_tag | c or s (MATLAB or Simulink) |
| compiler_tag | gcc323, gcc33, gcc331, gcc402, gcc412, gcc421, tmwgcc, tmwspro, tmwvs |
| libext | dll or so |
Not all combinations are supported. See Default Libraries for valid combinations.
For more on MATLAB build compilers, see MATLAB Build Compilers — Release 2009a.
EDA Simulator Link scripts fully support the use of default libraries.
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 | liblfmhdlc_tmwgcc.so | liblfmhdls_tmwgcc.so |
| Linux 64 | liblfmhdlc_tmwgcc.so | liblfmhdls_tmwgcc.so |
| Solaris32 | liblfmhdlc_tmwspro.so | liblfmhdls_tmwspro.so |
| Solaris64 | liblfmhdlc_tmwspro.so | liblfmhdls_tmwspro.so |
| Windows32 | liblfmhdlc_tmwvs.dll | liblfmhdls_tmwvs.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.
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, for example, 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 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 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 function vsim automatically detects the use of the 32-bit version of the HDL simulator and uses the solaris32 library folder 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 Alternate Library Using System Shell. This example shows how to load a ModelSim session by explicitly specifying the EDA Simulator Link 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 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/edalink
/extensions/modelsim/linux64/liblfmhdlc_gcc402.so" work.inverterYou 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 | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |