UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 52575

Vivado - How do I add HDL source files to a specific library in Vivado?

Description

When adding source files to a Vivado project, I want to assign them to a specific library other than the default library work. How do I do this?

Solution

Source files can be added to a Vivado project and assigned a library that references that file. The library can be assigned on an individual file basis, or by selecting several signals at once and assigning a common library to that group of signals. The following sections describe the actions for each method.

Single File Library Assignment:

To assign a library to a single file perform the following actions in the Vivado GUI:

  1. Open the "Add Sources" Dialog
  2. Select the HDL file you would like to add to the project
  3. Select the file you would like to change the library of
  4. Click the "Library" field of that file and modify the name as shown in the image below

    add_sources_single_library.jpg

     

Multiple File Library Assignment:

To assign a common library to multiple HDL source files, perform the following actions in the GUI: 

  1. Open the "Add Sources" Dialog
  2. Select the HDL files you would like to add to the project
  3. Select all of the HDL files you would like to assign to a new library
  4. Right click the selected signals and select "Change Source Properties" in the dialog box that appears as shown below

    add_sources_multi_library1.jpg
  5. Change the name of the library as shown in the dialog image below:

    add_sources_multi_library2.jpg

 

Files can also be added to a project in a specific library using the read_vhdl Tcl command.

For example:

       read_vhdl -library myLib /tmp/src/lib_src1.vhd

Note that the same source cannot be added to multiple libraries. For example, the second command below will fail.

      read_vhdl -library myLib /tmp/src/lib_src1.vhd
      read_vhdl -library work /tmp/src/lib_src1.vhd
AR# 52575
Date Created 10/24/2012
Last Updated 02/06/2014
Status Active
Type General Article
Tools
  • Vivado Design Suite