« Prev | Next » Compiling Xilinx Vivado Simulation Libraries for Active-HDL Introduction This document describes how you can compile simulation libraries in Xilinx Vivado Design Suite to be used in Active-HDL. 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 Active-HDL, 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 and then attach the compiled libraries into Active-HDL. Requirements and Limitations This application note assumes that you have Xilinx Vivado Design Suite 2023.1 or later and Active-HDL 15.0 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 Open Vivado. Go to Tools | Compile Simulation Libraries. Figure 1: Accessing the Compile Simulation Libraries. The Compile Simulation Libraries will open. Select Active-HDL under Simulator. Select the desired language and libraries. Figure 2: Compile Simulation Libraries: Simulator, Language and Library selection. 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 avhdl.exe file in the Active-HDL installation directory. In the GCC executable path, add the path to the C/C++ compiler required for building SystemC IP cores. Figure 3: Compile Simulation Libraries: paths to compiled libraries, simulator executable, and GCC compiler. 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. When you have specified all of your settings, select Compile. Figure 5: Compile Simulation Libraries: Compile. 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 In Vivado Design Suite, execute the following command from the Tcl Console: compile_simlib -simulator activehdl -simulator_exec_path <Active-HDL 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. <Active-HDL installation folder> Specifies a path to the bin folder inside Active-HDL installation folder. NOTE: It might be required to put the path to the Active-HDL 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 activehdl -simulator_exec_path {C:/Aldec/Active-HDL/bin} -gcc_exec_path {C:/Aldec/Active-HDL/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. 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 Active-HDL After generating the compiled Xilinx libraries, they have to be attached into Active-HDL. You can either use the amap command or the Attach Library wizard to add required libraries. If you are using Active-HDL as the default simulator in Xilinx Vivado 2017.4 or later, you can attach the libraries within that environment. Using the Vivado Environment 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 Active-HDL option located in the Tool Settings | 3rd Party Simulators | Default Compiled Library Paths category of the Settings dialog box. 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 Active-HDL 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. Set up and launch Active-HDL as the default Xilinx Vivado simulator. For more information, refer to Starting Active-HDL as Default Simulator in Xilinx Vivado. Using the Attach Library Wizard Open Active-HDL. Click Cancel when it prompts to open a workspace. Go to Library | Attach Library... Figure 11: Accessing the Attach Library. Select the location of the compiled Xilinx libraries, then select the *.lib file of the selected library. If you are using Active-HDL as the default simulator in Xilinx Vivado, make sure that the Attach as Global Library check box is selected. Click Open. Figure 12: Attach Library: Library selection. Repeat the steps 2-3 for every library that needs to be attached. Verify that the libraries are attached properly under Library Manager. Figure 13: Library Manager: Verifying attached Xilinx libraries. Using the amap Command You can add multiple Xilinx Vivado libraries to an Active-HDL design with a single amap invocation: Open an Active-HDL design. In the Console window of Active-HDL, invoke the amap command with the following arguments: amap -link "<directory>" where: <directory> Directory containing the library.cfg file generated by Vivado. This will map the libraries locally to the library.cfg file from the current design directory. If you want to map all the Xilinx Vivado libraries compiled in previous steps, invoke the following command: amap -link C:\Aldec\Xilinx_Lib If you are setting up Active-HDL as the default simulator in Xilinx Vivado, you will need to map the libraries globally. You can use the amap -link command for that purpose: Close any already opened design or workspace. Remove the following line from the C:\Aldec\Xilinx_Lib\library.cfg file: $INCLUDE = "$VSIMSALIBRARYCFG" NOTE: The entry can be removed in any text editor or by issuing the following commands in the Console window: cd C:\Aldec\Xilinx_Lib !$aldec/bin/vmap -unlink $aldec/vlib Invoke the amap command in the Active-HDL Console window: amap -link C:\Aldec\Xilinx_Lib This will map all the Xilinx Vivado libraries globally in the library.cfg file from the $aldec\vlib directory. NOTE: The operations on the global library.cfg file require removing the read-only attribute from that file. To remove the attribute, open the library.cfg properties in the File Explorer \ Windows Explorer and clear the Read-only check box. If you want to map only selected Xilinx Vivado libraries: Invoke the amap command with the following arguments: amap [-global] <Logical Name> "<Lib File Path>" where: -global Is an optional argument denoting global mapping. If omitted, a local mapping is created. To create local mappings, a design must be opened in the Active-HDL environment. <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. For example, to map the UNISIM library as a global library invoke the following command: amap -global unisim "C:\Aldec\Xilinx_Lib\unisim\unisim.lib" Figure 14: Executing amap command from the Active-HDL Console. You can find information about the amap command by typing amap -help in the Console. Repeat step 1 for every library that needs to be attached. Verify that the libraries are attached correctly under Library Manager. NOTE: The paths to the *.lib files and directories containing the library.cfg files are included in quotes because the amap command does not accept spaces within a path. Conclusion In order to simulate Xilinx Vivado designs in Active-HDL, 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 Active-HDL in order to run the simulation. If you have difficulty compiling or using the libraries, please contact Aldec Support through the customer portal. Previous article Next article