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# 69875

Vivado Simulator - How do I reference the pre-compiled XPM library when running from command line?


Vivado Design Suite User Guide: Logic Simulation (UG900) states the following:

"XPM is supported as a pre-compiled IP. Hence, you need not add the source file to the project."

However, if I run simulation from the command line and reference the library via the -L xpm switch, I see an error about not being able to find the XPM module.

For example:

xvlog -work work --sv xpm_test.v tb.v glbl.v
xelab -L work -L xpm -L unisims_ver -L unimacro_ver -L secureip tb glbl

ERROR: [VRFC 10-2063] Module <xpm_cdc_single> not found while processing module instance <xpm_cdc_single_inst>
ERROR: [XSIM 43-3322] Static elaboration of top level Verilog design unit(s) in library work failed.

I am able to simulate successfully only by manually compiling the .sv files from the Vivado install area for the appropriate XPM that I am trying to use.

xvlog -work work --sv xpm_test.v tb.v glbl.v C:\Xilinx\Vivado\2017.2\data\ip\xpm\xpm_cdc\hdl\xpm_cdc.sv
xelab -L work -L xpm -L unisims_ver -L unimacro_ver -L secureip tb glbl

How do I correctly reference the pre-compiled XPM library?


It is true that XPM sources are pre-compiled starting from Vivado 2016.3, including for Vivado Simulator. The problem is that you need to instruct the tool to find the pre-compiled XPM library.

The Vivado Simulator HDL compile programs, xvhdl, xvlog, and xelab, use the xsim.ini configuration file to find the definitions and physical locations of VHDL and Verilog logical libraries.

The compilers attempt to read xsim.ini from these locations in the following order:

  1. <Vivado_Install_Dir>/data/xsim
  2. User-file specified through the -initfile switch. If -initfile is not specified, the program searches for xsim.ini in the current working directory.

<Vivado_Install_Dir>/data/xsim/xsim.ini has standard as well as commonly used pre-compiled xsim libraries (UNISIMs, simprims, SecureIP, unifast, unimacro). 

All additional pre-compiled IP library mappings are specified in <Vivado_Install_Dir>/data/xsim/ip/xsim_ip.ini.

You should be able to find the following XPM entry in xsim_ip.ini:


If you launch the simulation in the Vivado IDE GUI, the tool will copy the xsim_ip.ini to the current simulation directory and rename it xsim.ini, so that the pre-compiled IP libraries can be referenced.

If you run from command line, you can either manually do the same copy operation as the GUI does, or point to xsim_ip.ini via the -initfile switch.

Take the above for example:

xvlog -work work --sv xpm_test.v tb.v glbl.v

xelab -initfile=C:/Xilinx/Vivado/2017.2/data/xsim/ip/xsim_ip.ini -L work -L xpm -L unisims_ver -L unimacro_ver -L secureip tb glbl
AR# 69875
Date 10/23/2017
Status Active
Type General Article
  • Vivado Design Suite - 2016.3
  • Vivado Design Suite - 2016.4
  • Vivado Design Suite - 2017.2
  • Vivado Design Suite - 2017.2.1
Page Bookmarked