Compiling Xilinx Vivado Simulation Libraries for Riviera-PRO

Introduction

This document describes how you can compile simulation libraries in Xilinx Vivado Design Suite to be used in Riviera-PRO.

When you instantiate a component in your design, the simulator must reference a library that describes the functionality of the component to ensure proper simulation. Thus, before performing simulation of the design that contains Xilinx components in Riviera-PRO, you should attach the proper simulation libraries.

You can either use pre-compiled simulation libraries provided by Aldec (libraries can be downloaded from Aldec's website) or you can compile them yourself in the Xilinx Vivado Design Suite then attach the compiled libraries into Riviera-PRO.

Requirements and Limitations

This application note assumes that you have Xilinx Vivado Design Suite 2023.1 or later and Riviera-PRO 2023.04 or later properly installed and licensed.

Compiling simulation libraries

You can either use the compile_simlib command or the Compile Simulation Libraries wizard that simplifies compiling simulation libraries. With these tools, you can compile all IP core libraries included in the Vivado IP Catalog and the following basic Xilinx Vivado simulation libraries:

  • UNISIM

  • UNIMACRO

  • UNIFAST

  • SIMPRIM (Verilog Only)

  • SECUREIP (Verilog Only)

  • XILINX_VIP

  • XPM

You can find detailed description of these libraries in the following document: http://www.xilinx.com/support/documentation/sw_manuals/xilinx2019_2/ug900-vivado-logic-simulation.pdf

Using the Compile Simulation Libraries Wizard

  1. Open Vivado.

  2. Go to Tools | Compile Simulation Libraries.

    Figure 1: Accessing the Compile Simulation Libraries.

  3. The Compile Simulation Libraries will open.

  4. Select Riviera-PRO under Simulator. Select the desired language and libraries.

    Figure 2: Compile Simulation Libraries: Simulator, Language and Library selection.

  5. Under the Compiled Library Location, select the directory where you want the compiled libraries to be saved. Under the Simulator Executable Path, provide the path to the directory containing the riviera.exe file in the Riviera-PRO installation directory. In the GCC executable path, add the path to the C/C++ compiler required for building SystemC IP cores. The GCC compilers provided with Windows and Linux versions of Riviera-PRO, are stored under the <Riviera-PRO installation folder>\mingw\bin and <Riviera-PRO installation directory>/gcc_Linux64/bin paths, respectively.

    Figure 3: Compile Simulation Libraries: paths to compiled libraries, simulator executable, and GCC compiler.

  6. By default, all the IP modules available in the Vivado IP Catalog are selected for compilation. You can change that behavior by clearing the Compile Xilinx IP check box. When cleared, only the basic simulation libraries are compiled. You may also want to enable recompilation of libraries already present in the output directory. To do so, select the Overwrite the current pre-compiled libraries check box.

    Figure 4: Compile Simulation Libraries: Compile Xilinx IP and Overwrite the current pre-compiled libraries.

  7. When you have specified all of your settings, select Compile.

    Figure 5: Compile Simulation Libraries: Compile.

  8. Once the compilation is completed, you should see the compilation summary in the Tcl Console similar to the one in the picture below:

    Figure 6: Tcl Console: Compilation Summary.

Using the compile_simlib command

  1. In Vivado Design Suite, execute the following command from the Tcl Console:

    compile_simlib -simulator riviera -simulator_exec_path <Riviera-PRO installation folder> -gcc_exec_path <GCC installation folder> -family all -language all -library all -dir <output_folder>

    where:

    <output_folder>

    Specifies a path to the directory where you want compiled libraries to be saved.

    <Riviera-PRO installation folder>

    Specifies a path to the bin folder inside Riviera-PRO installation folder.

    NOTE: It might be required to put the path to the Riviera-PRO executable in quotes or curly brackets as the compile_simlib command does not accept spaces within a path.

    For example, the command may look as follows:

    compile_simlib -simulator riviera -simulator_exec_path {C:/Aldec/Riviera-PRO/bin} -gcc_exec_path {C:/Aldec/Riviera-PRO/mingw/bin} -family all -language all -library all -dir {C:/Aldec/Xilinx_Lib}

    Figure 7: Executing compile_simlib command from the Vivado Tcl Console.

    The above command will compile all simulation and IP libraries written in VHDL, Verilog, and SystemC for all devices available in Vivado. To disable compilation of IP Core libraries and compile only Xilinx simulation libraries, invoke the compile_simlib command with the -no_ip_compile argument. You may also want to disable recompilation of libraries already present in the output directory by issuing the -force argument. To obtain the complete list of available arguments, type compile_simlib -help in the Vivado Tcl Console.

  2. Once the compilation is completed, you should see the compilation summary in the Tcl Console similar to the one in the picture below:

    Figure 8: Library Compilation Summary.

    The output directory (specified with the -dir argument) will contain the library.cfg configuration file and the folders with pre-compiled libraries.

Attaching Compiled Xilinx Libraries into Riviera-PRO

After generating the compiled Xilinx libraries, they have to be attached into Riviera-PRO. You can either use the Library Manager window or the amap command to add required libraries. If you are using Riviera-PRO as the default simulator in the Xilinx Vivado environment 2017.4 or later, you can attach the libraries within that environment.

Using the Vivado Environment

  1. In Vivado, specify the path to the directory with the compiled libraries in the Compiled library location field which is available in the Project Settings | Simulation category of the Settings window when a project is loaded.

    Figure 9: Pointing the compiled library location in the Vivado project settings.

    NOTE: You can specify the default path to compiled libraries by using the Riviera-PRO option located in the Tool Settings | 3rd Party Simulators | Default Compiled Library Paths category of the Settings dialog box.

  2. Select the Use precompiled IP simulation libraries check box in the Project Settings | IP | Simulation category of the Settings dialog box. If this option is enabled, all the required libraries such as the precompiled IP simulation libraries and the xilinx_vip and xpm libraries are included as mappings in the generated macros so they are not recompiled when invoking the Riviera-PRO simulator.

    Figure 10: The Use precompiled IP simulation libraries option.

    NOTE: If the mappings are not successfully created, check whether the entries in the library.cfg file are specified correctly and the physical libraries exist in the specified locations.

  3. Set up and launch Riviera-PRO as the default Xilinx Vivado simulator. For more information, refer to Starting Riviera-PRO as Default Simulator in Xilinx Vivado 2017.4 or Later.

Using the Library Manager Window

  1. Open Riviera-PRO.

  2. Click the Attach Library icon in the Library Manager.

    Figure 11: Accessing the Attach Library.

  3. Under Library Name, enter the logical name of the library. Click Browse and select the location of the compiled Xilinx libraries, then select the *.lib file of the selected library. Click Ok.

    Figure 12: Attach Library: Library selection.

  4. The library will then show up as a local library. If you are using Riviera-PRO as the default simulator in Xilinx Vivado, the library must be attached as global. In order to add a local library to the global library, right click the library then select Make Library Global. Verify that it is added to the global library by expanding the library.cfg.

    Figure 13: Library Manager: Adding a local library to the global library.

    Figure 14: Library Manager: Verifying the global library under library.cfg.

  5. Repeat the steps 2-5 for every library that needs to be attached.

Mapping Multiple Libraries in Library Manager

You can add multiple libraries by attaching another library.cfg file to the library.cfg file from the current directory.

  1. Click the Link Libraries icon in the Library Manager.

    Figure 15: Accessing the Link Configuration window.

  2. Specify the library.cfg library configuration file created in the compilation output directory during compilation of the Xilinx Vivado libraries.

    Figure 16: Link Configuration: Attaching the library configuration file.

This will map the libraries locally to the library.cfg file from the current directory. The libraries can then be set as global with the Make Library Global context menu option.

Using the amap Command

  1. In the Riviera-PRO Console window map the libraries using the amap command. If you are setting up Riviera-PRO as the default simulator in Xilinx Vivado, map the libraries globally using the -global argument:

    amap -global <Logical Name> "<Lib File Path>"
    

    where:

    <Logical Name>

    Specifies the logical name of the library.

    <Lib File Path>

    Is the name of the library index file with the full path and the *.lib extension.

    NOTE: The path to the *.lib file is contained within quotes because the amap command does not accept spaces within a path.

    For example, the command may look as follows:

    amap -global unisim "C:\\Aldec\\Xilinx_Lib\\unisim\\unisim.lib"
    

    Figure 17: Executing amap command from the Riviera-PRO Console.

    You can find information about the amap command by typing amap -help in the Console.

  2. Repeat the step 2 for every library that needs to be attached. Verify that the libraries are attached correctly under Library Manager.

Mapping Multiple Libraries with the amap Command

You can add multiple libraries with a single amap invocation:

amap -link <directory>

where:

<directory>

Directory containing the libraries and library.cfg file generated by Vivado.

This will map the libraries locally to the library.cfg file from the current directory.

Conclusion

In order to simulate Xilinx Vivado designs in Riviera-PRO, Xilinx simulation libraries are required. You can either use pre-compiled libraries provided by Aldec or you can compile the libraries yourself in Vivado Design Suite. After compiling the libraries in Vivado, they have to be attached into Riviera-PRO in order to run the simulation.

If you have difficulty compiling or using the libraries, please contact Aldec Support through the customer portal.

Ask Us a Question
x
Ask Us a Question
x
Captcha ImageReload Captcha
Incorrect data entered.
Thank you! Your question has been submitted. Please allow 1-3 business days for someone to respond to your question.
Internal error occurred. Your question was not submitted. Please contact us using Feedback form.
We use cookies to ensure we give you the best user experience and to provide you with content we believe will be of relevance to you. If you continue to use our site, you consent to our use of cookies. A detailed overview on the use of cookies and other website information is located in our Privacy Policy.