Running xelab - 2022.1 English

Vivado Design Suite Tutorial: Logic Simulation (UG937)

Document ID
Release Date
2022.1 English
In this step, you use the xelab command with the project file completed in Step 1 to elaborate, compile, and link all the design sources to create the simulation snapshot. To run the xelab command, open and configure a command window.
  1. On Windows, open a Command Prompt window. On Linux, simply skip to the next step.
  2. Change directory to the Xilinx installation area, and run settings64.bat as needed to setup the Xilinx tool paths for your computer:
    cd install_path\Vivado\2022.x\
    Note: The settings64.bat file configures the path on your computer to run the Vivado ML Editions.
    Tip: When running the xelab, xsc, xsim, xvhdl, or xvlog commands in batch files or scripts, it may also be necessary to define the XILINX_VIVADO environment variable to point to the installation hierarchy of the Vivado ML Editions. To set the XILINX_VIVADO variable, you can add one of the following to your script or batch file:

    On Windows -

    set XILINX_VIVADO=<Vivado_install_area>/Vivado/2022.x

    On Linux -

    setenv XILINX_VIVADO <Vivado_install_area>/Vivado/2022.x 


    export XILINX_VIVADO=<Vivado_install_area>/Vivado/2022.x
  3. Change directory to the <Extract_Dir>/scripts folder.

    The provided xelab batch file, xelab_batch.bat, is incomplete and you must modify it using the xelab syntax as previously described to produce the correct simulation snapshot.

  4. Edit the xelab_batch.bat file to add the following options:
    • Specify the project file: -prj simulate_xsim.prj
    • Specify the output simulation snapshot: -s run_sineGen
    • Specify the library and top-level design unit: xil_defaultlib.testbench

    For a complete list of available xelab command options, see the Vivado Design Suite User Guide: Logic Simulation (UG900).

  5. Save and close the batch file.
  6. In the command window, run the xelab_batch.bat file to compile and create the simulation snapshot.
  7. Examine the xelab output as it is transcribed to the Command Prompt window.
    Note: The xelab command also writes xelab.log file in the directory from which it was run. The log file contains all of the messages and results of the xelab command for you to review.
    Tip: You can also use the xelab command after the xvlog and xvhdl commands have parsed the HDL design sources to read the specified simulation libraries. The xelab command would be the same as described here, except that it would not require the -prj option since there would be no simulation project file.