How to add Xilinx/Altera library in Modelsim

Source: Internet
Author: User
Tags synopsys

Currently, many people install Xilinx and Modelsim separately. Therefore, when using simulation libraries of chip manufacturers such as Xilinx or Altera, libraries cannot be found; because Modelsim does not own the simulation libraries of FPGA manufacturers, you must manually compile these libraries. Below I will introduce three methods to increase the library problem of Xilinx or Altera:

1. find the installation directory of Modelsim and find $: \ modeltech_6.5 \ Modelsim under the installation directory. INI, modify ModelSim. INI attributes (remove "read-only"); Modelsim under the directory ModelSim. add the following content between [library] and [vcom] In the INI file:Code:

; Xilinx

; VHDL Section

Unisim = $ model_tech/../Xilinx/VHDL/unisim

Simprim = $ model_tech/../Xilinx/VHDL/simprim

Xilinxcorelib = $ model_tech/../Xilinx/VHDL/xilinxcorelib

Aim = $ model_tech/../Xilinx/VHDL/aim

Pls = $ model_tech/../Xilinx/VHDL/pls

CPLD = $ model_tech/../Xilinx/VHDL/CPLD

; OpenGL Section


Unisims_ver = c: \ Xilinx \ 10.1 \ ise \ Xilinx \ mti_se \ unisims_ver
Unim1__ver = c: \ Xilinx \ 10.1 \ ise \ Xilinx \ mti_se \ unim1__ver
Uni9000_ver = c: \ Xilinx \ 10.1 \ ise \ Xilinx \ mti_se \ uni9000_ver
Simprims_ver = c: \ Xilinx \ 10.1 \ ise \ Xilinx \ mti_se \ simprims_ver
Xilinxcorelib_ver = c: \ Xilinx \ 10.1 \ ise \ Xilinx \ mti_se \ xilinxcorelib_ver
Aim_ver = c: \ Xilinx \ 10.1 \ ise \ Xilinx \ mti_se \ abel_ver \ aim_ver
Cpld_ver = c: \ Xilinx \ 10.1 \ ise \ Xilinx \ mti_se \ cpld_ver
Secureip = c: \ Xilinx \ 10.1 \ ise \ Xilinx \ mti_se \ secureip


(The above installation path is the ise library path on my computer.) the method for adding the Altera library is shown above.




Simprim_ver: used for layout and wiring simulation.
Unisim_ver: compile this library if you want to perform integrated simulation.
Xilinxcorelib_ver: if the core generated by coregen is called in the design, compile the library.
We need to generate a standard library for ModelSim. The so-called standard library is the library automatically loaded after Modelsim runs. However, I am not very sure about this. Because I still need to specify the library path for the simulation during post-simulation, or Modelsim cannot be found.

Step 1:In The Modelsim environment, create a project. The project path is consistent with the path you want to store the library.(This step does not actually need to be used. Jump directly to the start of step 2 ...)

Step 2:Create a new database and use the database name as simprim_ver. The first thing we need to do is create this database.

Step 3:In The Modelsim command bar, run the following command:
Vlog-work simprim_verD:/Xilinx/OpenGL/src/simprims/*. v
D:/Xilinx is the installation path of Xilinx. You can change this to yours. Any of the following content that will change according to your system environment will be marked in green and underlined. After compilation, you will find a simprim folder under your project folder, which contains many folders. These are the databases we need.

Step 4:Compile the other two libraries according to the above method. The commands to be typed are as follows:
Vlog-work unisim_verD:/Xilinx/OpenGL/src/unisims/*. v
Vlog-work nodes inxcorelib_verD:/Xilinx/OpenGL/src/xilinxcorelib/*. v

If you want to compile the VHDL library, you need to create the libraries simprim, unisim and xilinxcorelib respectively. The Modelsim commands required by these three databases are as follows:
Vcom-work simprimD: Xilinx/VHDL/src/simprims/simprim_vcomponents.vhd
Vcom-work simprimD: Xilinx/VHDL/src/simprims/simprim_vpackage.vhd
Vcom-work simprimD: Xilinx/VHDL/src/simprims/simprim_vital.vhd

Vcom-work unisimD: Xilinx/VHDL/src/unisims/unisim_vcomp.vhd
Vcom-work unisimD: Xilinx/VHDL/src/unisims/unisim_vpkg.vhd
Vcom-work unisimD: Xilinx/VHDL/src/unisims/unisim_vital.vhd
Vcom-work unisimD: Xilinx/VHDL/src/unisims/unisim_v1_4k.vhd

Vcom-work using inxcorelibD: Xilinx/VHDL/src/xilinxcorelib/*. vhd

I have never put it into practice in the aspect of VHDL. If there is a mistake, it should not be a problem to change it.

Step 5:After the library is created, the next thing is to make it the standard library of ModelSim. You only need to modify the ModelSim. ini file in the Modelsim installation directory. The modified content is as follows:
STD = $ model_tech/../STD
IEEE = $ model_tech/../IEEE
OpenGL = $ model_tech /../
Vital2000 = $ model_tech/../vital2000
Std_1_skit = $ model_tech/../std_1_skit
Synopsys = $ model_tech/../Synopsys
Modelsim_lib = $ model_tech/../modelsim_lib
Simprim_ver = G:/eda/Xilinx/simprim_ver (library path, the same as below)
Unisim_ver = G:/eda/Xilinx/unisim_ver
Xilinxcorelib_ver = G:/eda/Xilinx/xilinxcorelib_ver

Note that this file is read-only. Remove this attribute before modification.

Step 6:Disable the project and restart ModelSim. Check whether the three libraries are in the library box.


Now, you can use ISE to directly call Modelsim for simulation.


3. The third method is the simplest. You can find c: \ Xilinx \ 10.1 \ ise \ bin \ nt \ compxlib.exeand open compxlib.exe. All the way to confirmation by default...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.