Return to previous page Advance to next page

Compiling Xilinx® Simulation Libraries (COMPXLIB)

Note: Do NOT use with ModelSim XE (Xilinx Edition) or ISE Simulator.

Before starting the functional simulation of your design, you must compile the Xilinx® Simulation Libraries for the target simulator. For this purpose Xilinx® provides a tool called COMPXLIB.

COMPXLIB is a tool for compiling the Xilinx® HDL based simulation libraries using the tools provided by the simulator vendor.

Compiling Simulation Libraries

You can compile the libraries from Project Navigator or from the command line, as described in this section.

From Project Navigator

  1. Create or open an existing project for Project Navigator.
  2. In the Sources in Project window, highlight the target device.
  3. In the Processes for Source window, under the Design Entry Utilities toolbox,
    right-click Compile HDL Simulation Libraries and select Properties to open the Process Properties dialog box.
  4. Choose one or more of the available options from the Process Properties dialog box.

Note: Project Navigator will only show the options that apply to your specific design flow. For example, if you have created a Virtex-II™ project, it will only show you the list of libraries that are required for simulating a Virtex-II™ project.

    • Target Simulator
    • The Target Simulator property allows you to select the target simulator for which the libraries are to be compiled. Click anywhere in the Value field to display the list of supported simulators.

      Note: You must choose a Target Simulator before starting the process.

    • Language
    • By default, the Language property is selected according to the Project Properties.

    • Compiled Library Directory
    • The Compiled Library Directory property allows you to specify the directory where the compiled libraries will be saved.

      To change the directory path, type a new path in the Value field, or click anywhere in the Value field and double-click the small button that appears to the right of the current value. Use the Browse for File dialog box that appears to choose an output directory.

      The default directory path is $XILINX/language/simulator, where language is the selected language to compile and simulator is the name of the selected simulator.

    • Simulator Location
    • The Simulator Location property allows you to specify the simulator installation bin path where the simulator executables reside.

      To change the simulator path, click anywhere in the Value field and double-click the small button that appears to the right of the current value. Use the Browse for File dialog box that appears to choose a directory.

      By default, the path to the simulator will be searched for via the path environment variable. Please note that if you have multiple simulator installation versions on your system, or if you do not have the simulator executable path defined in your environment variable, you can use this option to specify the executable path to your appropriate simulator.

  • Existing Compiled Library
  • The Existing Compiled Library property allows you to overwrite the previously compiled library or to map to the previously compiled library. Select from the appropriate option in the drop-down list box.

    By default, the compiled libraries are overwritten.

  • Compile UNISIM (Functional) Simulation Library
  • This option allows you to choose to compile the UNISIM library.

    By default, the UNISIM libraries will be compiled.

  • Compile SIMPRIM (Timing) Simulation Library
  • This option allows you to choose to compile the SIMPRIM library.

    By default, the SIMPRIM libraries will be compiled.

  • Compile Xilinx®CoreLib (Coregen) Simulation Library
  • This option allows you to choose to compile the Xilinx®CoreLib library.

    By default, the Xilinx®CoreLib libraries will be compiled.

    Note: Note: XilinxCoreLib libraries depend on the unisim libraries and thus compxlib will automatically compile unisim prior to compiling the XilinxCoreLib libraries.

  • Compile SmartModels (PPC, MGT) Simulation Library
  • This option allows you to choose to compile the SmartModels library.

    By default, the SmartModels libraries will be compiled.

  • Update modelsim.ini File for Xilinx SmartModel Use
  • This option will instruct COMPXLIB to modify the modelsim.ini file to make the ammendments necessary to run SmartModel simulations.

  • Click OK. The Compile HDL Simulation Libraries properties are now set.
  • Double-click Compile HDL Simulation Libraries. Project Navigator will now compile the libraries using the properties specified in the properties you have set.

After the process is completed, double-click View Compilation Log to open the COMPXLIB.log file to view the compilation results.

From Command Line

To compile libraries, type the following on the command line:

compxlib [options]

See "COMPXLIB Syntax" for options and syntax details.

To view COMPXLIB help, type the following on the command line:

compxlib –help

Library Support

COMPXLIB supports the compilation of the following Xilinx® HDL Simulation Libraries:

  • UNISIM (Functional)
  • Uni9000 (Functional CPLDs only)
  • SIMPRIM (Timing)
  • Xilinx®CoreLib (Functional)
  • SmartModel Library™ (Functional & Timing)
  • CoolRunner™ (Functional)
  • Abel (Functional)

Device Family Support

COMPXLIB supports the compilation of libraries for all Xilinx® Device Families.

Simulator Support

Note: Do NOT use with ModelSim XE (Xilinx Edition) or ISE Simulator.

COMPXLIB supports the compilation of Xilinx® HDL Simulation Libraries for the following simulators:

  • ModelSim™ SE (all Xilinx® supported platforms)
  • ModelSim™ PE (all Xilinx® supported platforms)
  • NCSIM™ (all Xilinx® supported platforms)
  • VCS-MX™ (only on Solaris® and Linux based platforms)
  • VCS-MXi™ (only on Solaris® and Linux based platforms)

Note: The VHDL SIMPRIM library in this release is VITAL2000 compliant. Ensure that your simulator is also VITAL2000 compliant to successfully compile the SIMPRIM library.

COMPXLIB Syntax

The following command compiles all Xilinx® Verilog libraries for the Virtex™ device family on the ModelSim™ SE simulator. The compiled results are saved in the default location: $XILINX/verilog/mti_se.

compxlib –s mti_se –arch virtex –l verilog

COMPXLIB Options

This section describes COMPXLIB command line options.

  • –s (Target Simulator)
  • Specify the simulator for which the libraries will be compiled.

    If –s option is not specified, COMPXLIB will exit without compiling the libraries.

    Valid values for –s option are:

    -s mti_se

    -s mti_pe

    -s ncsim

    -s vcs_mx

    -s vcs_mxi

  • –l (Language)
  • Specify the language from which the libraries will be compiled.

    By default, COMPXLIB detects the language type from the –s (Target Simulator) option. If the simulator supports both Verilog and VHDL, COPMXLIB sets the –l option to all and compiles both Verilog and VHDL libraries, otherwise COMXPLIB detects the language type supported by the simulator and sets the –l option value accordingly.

    If the –l option is specified, COMXPLIB compiles the libraries for the language specified with –l option.

    Valid values for –l option are:

    -l verilog

    -l vhdl

    -l all

  • –arch (Device Family)
  • Specify the device family.

    If –arch option is not specified, COMPXLIB will exit with an error message without compiling the libraries.

    Valid values for –arch option are,

    –arch all (all device families)

    –arch virtex

    –arch virtexe

    –arch virtex2

    –arch virtex2p

    –arch virtex4

    –arch spartan2

    –arch spartan3

    –arch spartan2e

    –arch spartan3e

    –arch cpld

    -arch cr2s

    –arch xpla3

    –arch xbr

    –arch xc9500

    –arch xc9500xl

    –arch xc9500xv

    You can compile selected libraries by using the following –arch syntax.

    –arch device_family

  • –dir (Output Directory)
  • Specify the directory path where you want to compile the libraries. By default, COMXPLIB will compile the libraries in $XILINX/language/target_simulator - Unix/Linux

    %XILINX%\language\target_simulator - Windows directory.

  • –p (Simulator Path)
  • Specify the directory path where the simulator executables reside. By default, COMPXLIB will automatically search for the path from the $PATH or %PATH% environment variable. This option is required if the target simulator is not specified in the $PATH or %PATH% environment variable.

  • –w (Overwrite Compiled Library)
  • Specify this option if you want to overwrite the precompiled libraries. By default, COMXPLIB will not overwrite the precompiled libraries.

  • –cfg (Create Configuration File)
  • Specify this option to create a configuration file with default settings. By default, COMPXLIB will create the compxlib.cfg file if it is not present in the current directory.

    Use the configuration file to pass run time options to COMPXLIB while compiling the libraries. For more details on the configuration file see "Specifying Run Time Options".

  • info (Print Precompiled Library Info)
  • Specify this option to print the precompiled information of the libraries. You can specify a directory path with the –info option to print the information for that directory.

  • –lib (Specify name of library to compile)
  • Specify this option to print the precompiled information of the libraries. You can specify a directory path with the –info option to print the information for that directory.

    Valid values for –lib option are,

    unisim

    simprim

    uni9000

    xilinxcorelib

    smartmodel

    abel

    coolrunner

    Note: For multiple libraries please separate the "-lib" option with spaces.

    For example:

    .. -lib uisim -lib simprim ..

    If the -lib is not used all the libraries are compiled by default.

  • –help (Print COMXPLIB help)
  • Specify this option to print the COMPXLIB help to standard output.

COMPXLIB Command Line Examples

  • To print the COMPXLIB online help to your monitor screen, type the following at the command line:
  • compxlib -h

  • To compile all of the Verilog libraries for a Virtex™ device (UNISIM, SIMPRIM and Xilinx®CoreLib) on the ModelSim™ SE simulator and overwrite the results in $XILINX/verilog/mti_se, type the following at the command line:
  • compxlib -s mti_se -arch virtex -l verilog -w

  • To compile the Verilog UNISIM, Uni9000 and SIMPRIM libraries for the ModelSim™ PE simulator and save the results in the $MYAREA directory, type the following at the command line:
  • compxlib -s mti_pe -arch all -lib uni9000 -lib simprim-l verilog -o $MYAREA

  • To compile the VHDL and Verilog SmartModels for the Cadence™ NC-Sim™ simulator and save the results in /tmp directory, type the following at the command line:
  • compxlib -s ncsim -arch virtex2p -lib smartmodel -l all -o /tmp

  • To compile the Verilog Virtex-II™ Xilinx®CoreLib library for the Synopsys® VCS™ simulator and save the results in the default directory, $XILINX/verilog/vcs, type the following at the command line:
  • compxlib -s vcs mx -arch virtex2 -lib xilinxcorelib

  • To compile the Verilog CoolRunner™ library for the Synopsy®s VCSi™ simulator and save the results in the current directory, type the following at the command line:
  • compxlib -s vcs mxi -arch coolrunner -lib -o ./

  • To compile the Spartan-IIE™ and Spartan-3™ libraries (VHDL UNISIMs, SIMPRIMs and Xilinx®CoreLib) for the Synopsys® Scirocco™ simulator and save the results in the default directory ($XILINX/vhdl/scirocco), and use the simulator executables from the path specified with the –p option, type the following at the command line:
  • compxlib -s vcs mx -arch spartan2e -l vhdl -arch spartan3 -p /products/eproduct.ver2_0/2.0/
    comnon/sunos5/bin

  • To print the precompiled library information for the libraries compiled in %XILINX%\xilinxlibs, type the following at the command line:
  • compxlib –info %XILINX%\xilinxlibs

  • To print the precompiled library information for the unisim library compiled in $XILINX, type the following at the command line:
  • To create compxlib.cfg with default options, type the following at the command line:
  • compxlib -cfg

Specifying Run Time Options

You can specify run time options for COMPXLIB through the compxlib.cfg file. By default, COMPXLIB creates this file in the current directory. You can also automatically create this file with its default settings by using the –cfg option.

The following are run time options that can be specified in the configuration file.

  • EXECUTE: ON|OFF
  • By default, the value is ON which means that COMPXLIB compiles the libraries.

    If the value is OFF, COMPXLIB generates only the list of compilation commands in the compxlib.log file, without executing them.

  • EXTRACT_LIB_FROM_ARCH: ON|OFF
  • This option is there for support of Early Access devices. Please do not change this option.

  • LOCK_PRECOMPILED: ON |OFF
  • By default, the value is OFF which means that COMPXLIB will compile the dependent libraries automatically if not precompiled.

    If the value is ON, COMPXLIB will not compile the precompiled libraries.

    For example, if you want to compile the SmartModel Library™, COMPXLIB will look for this variable value to see if the dependent libraries, UNISIM and SIMPRIM, are to be compiled or not.

  • LOG_CMD_TEMPLATE: ON|OFF
  • By default, the value is OFF which means that COMPXLIB will not emit the compilation command line in compxlib.log file.

    If the value is ON, COMXPLIB will print the compilation commands in the compxlib.log file.

  • PRECOMPILED_INFO: ON|OFF
  • By default, the value is ON which means that COMPXLIB will print the precompiled library information including the date the library was compiled.

    If the value is OFF, COMXPLIB will not print the precompiled library information.

  • BACKUP_SETUP_FILES: ON|OFF

By default, the value is ON which means that COMPXLIB will create a backup of the all the simulator specific setup files (modelsim.ini/cds/lib/hdl.var/) that it wrote out in the previous run.

If the value is OFF, COMXPLIB will not create a backup of the setup files.

  • FAST_COMPILE: ON|OFF

By default, the value is ON which means that COMPXLIB will use advanced compilation techniques for faster library compilation for select libraries.

If the value is OFF, COMXPLIB will not use the advanced compilation methods and will revert to traditional methods for compilation.

  • ABORT_ON_ERROR: ON|OFF

By default, the value is OFF which means that COMPXLIB will not error out if the compilation errors are detected in the library

If the value is ON, COMXPLIB will error out when an error is run into during the compilation of libraries.

  • ADD_COMPILATION_RESULTS_TO_LOG: ON|OFF

By default, the value is ON which means that COMPXLIB will wirte to the log file with the name specified by the -log switch

If the value is OFF, COMXPLIB will ignore the -log switch

  • USE_OUTPUT_DIR_ENV: NONE|<NAME_OF_ENVIRONMENT_VARIABLE>

By default, the value is NONE which means that COMPXLIB will not look for an environment variable for the output directory. Instead it will use the directory specified by the -o switch.

If the value is <NAME_OF_ENV_VAR>, COMXPLIB will look on the system for an environment variable with the name listed in this option and will compile the libraries to that folder.

For example, in the cfg file:

USE_OUTPUT_DIR_ENV:MY_LIBS

In the system setting:

setenv MY_LIBS /my_compiled_libs

This will compile the libraries to the folder /my_compiled_libs

INSTALL_SMARTMODEL: ON|OFF

By default, the value is ON which means that COMPXLIB will install the smartmodels when -lib smartmodel is used

  • If the value is OFF, COMXPLIB will not install the SmartModels even if the -lib smartmodel is used.
INSTALL_SMARTMODEL_DIR:

By default, the value is left blank which means that COMPXLIB will wirte to the location that is pointed to by the LMC_HOME environment variable.

If the LMC_HOME environment variable is not set, then the smart models will be installed to the directory specified here. This option will only be used if the INSTALL_SMARTMODEL option is set to ON

  • OPTION
  • Simulator Language Command Line Options.

    Syntax:

    OPTION:Target_Simulator:Language:Command_Line_Options

    By default, COMXPLIB will pick the simulator compilation commands specified in the Command_Line_Options.

    You can add or remove the options from Command_Line_Options depending on the compilation requirements.

Sample Configuration File (Windows Version)

#*****************************************************************
# compxlib initialization file (compxlib.cfg) *
# *
# Copyright (c) 1995-2005 Xilinx, Inc. All rights reserved. *
# *
# Important :- *
# All options/variables must start from first column *
# *
#*****************************************************************
#
RELEASE_VERSION:H.37
#
# set current simulator name
SIMULATOR_NAME:mti_se
#
# set current language name
LANGUAGE_NAME:verilog
#
# set compilation execution mode
EXECUTE:on
#
# compile additional libraries in architecture specfic directories
EXTRACT_LIB_FROM_ARCH:on
#
MAP_PRE_COMPILED_LIBS:off
#
# donot re-compile dependent libraries
LOCK_PRECOMPILED:off
#
# print compilation command template in log file
LOG_CMD_TEMPLATE:off
#
# print Pre-Compiled library info
PRECOMPILED_INFO:on
#
# create backup copy of setup files
BACKUP_SETUP_FILES:on
#
# use enhanced compilation techniques for faster library compilation
# (applicable to selected libraries only)
FAST_COMPILE:on
#
# abort compilation process if errors are detected in the library
ABORT_ON_ERROR:off
#
# save compilation results to log file with the name specified with - log option
ADD_COMPILATION_RESULTS_TO_LOG:on
#
# compile library in the directory specified by the environment variable if the
# -dir option is not specified
USE_OUTPUT_DIR_ENV:NONE
#
# turn on/off smartmodel installation process
INSTALL_SMARTMODEL:on
#
# smartmodel installation directory
INSTALL_SMARTMODEL_DIR:
#
#///////////////////////////////////////////////////////////////////// //
# MTI-SE setup file name
SET:mti_se:MODELSIM=modelsim.ini
#
# MTI-SE options for VHDL Libraries
# Syntax:-
# OPTION:<simulator_name>:<language>:<library>:<options>
# <library> :- u (unisim) s (simprim) c (xilinxcorelib)
# m (smartmodel) a (abel) r (coolrunner)
#
OPTION:mti_se:vhdl:u:-source -93
OPTION:mti_se:vhdl:s:-source -93
OPTION:mti_se:vhdl:c:-source -93 -explicit
OPTION:mti_se:vhdl:m:-source -93
OPTION:mti_se:vhdl:a:-source -93
OPTION:mti_se:vhdl:r:-source -93
#
# MTI-SE options for VERILOG Libraries
# Syntax:-
# OPTION:<simulator_name>:<language>:<library>:<options>
# <library> :- u (unisim) s (simprim) c (xilinxcorelib)
# m (smartmodel) a (abel) r (coolrunner)
#
OPTION:mti_se:verilog:u:-source -93
OPTION:mti_se:verilog:s:-source -93
OPTION:mti_se:verilog:n:-source -93
OPTION:mti_se:verilog:c:-source -93
OPTION:mti_se:verilog:m:-source -93
OPTION:mti_se:verilog:a:-source -93
OPTION:mti_se:verilog:r:-source -93
#
#///////////////////////////////////////////////////////////////////// //
# MTI-PE setup file name
SET:mti_pe:MODELSIM=modelsim.ini
#
# MTI-PE options for VHDL Libraries
# Syntax:-
# OPTION:<simulator_name>:<language>:<library>:<options>
# <library> :- u (unisim) s (simprim) c (xilinxcorelib)
# m (smartmodel) a (abel) r (coolrunner)
#
OPTION:mti_pe:vhdl:u:-source -93
OPTION:mti_pe:vhdl:s:-source -93
OPTION:mti_pe:vhdl:c:-source -93 -explicit
OPTION:mti_pe:vhdl:m:-source -93
OPTION:mti_pe:vhdl:a:-source -93
OPTION:mti_pe:vhdl:r:-source -93
#
# MTI-PE options for VERILOG Libraries
# Syntax:-
# OPTION:<simulator_name>:<language>:<library>:<options>
# <library> :- u (unisim) s (simprim) c (xilinxcorelib)
# m (smartmodel) a (abel) r (coolrunner)
#
OPTION:mti_pe:verilog:u:-source -93
OPTION:mti_pe:verilog:s:-source -93
OPTION:mti_pe:verilog:n:-source -93
OPTION:mti_pe:verilog:c:-source -93
OPTION:mti_pe:verilog:m:-source -93
OPTION:mti_pe:verilog:a:-source -93
OPTION:mti_pe:verilog:r:-source -93
#
#///////////////////////////////////////////////////////////////////// //
# NCSIM setup file names
SET:ncsim:CDS=cds.lib
SET:ncsim:HDL=hdl.var
#
# NCSIM options for VHDL Libraries
# Syntax:-
# OPTION:<simulator_name>:<language>:<library>:<options>
# <library> :- u (unisim) s (simprim) c (xilinxcorelib)
# m (smartmodel) a (abel) r (coolrunner)
#
OPTION:ncsim:vhdl:u:-MESSAGES -v93 -RELAX -NOLOG -CDSLIB $CDS -HDLVAR $HDL
OPTION:ncsim:vhdl:s:-MESSAGES -v93 -RELAX -NOLOG -CDSLIB $CDS -HDLVAR $HDL
OPTION:ncsim:vhdl:c:-MESSAGES -v93 -RELAX -NOLOG -CDSLIB $CDS -HDLVAR $HDL
OPTION:ncsim:vhdl:m:-MESSAGES -v93 -RELAX -NOLOG -CDSLIB $CDS -HDLVAR $HDL
OPTION:ncsim:vhdl:a:-MESSAGES -v93 -RELAX -NOLOG -CDSLIB $CDS -HDLVAR $HDL
OPTION:ncsim:vhdl:r:-MESSAGES -v93 -RELAX -NOLOG -CDSLIB $CDS -HDLVAR $HDL
#
# NCSIM options for VERILOG Libraries
# Syntax:-
# OPTION:<simulator_name>:<language>:<library>:<options>
# <library> :- u (unisim) s (simprim) c (xilinxcorelib)
# m (smartmodel) a (abel) r (coolrunner)
#
OPTION:ncsim:verilog:u:-MESSAGES -NOLOG -CDSLIB $CDS -HDLVAR $HDL
OPTION:ncsim:verilog:s:-MESSAGES -NOLOG -CDSLIB $CDS -HDLVAR $HDL
OPTION:ncsim:verilog:n:-MESSAGES -NOLOG -CDSLIB $CDS -HDLVAR $HDL
OPTION:ncsim:verilog:c:-MESSAGES -NOLOG -CDSLIB $CDS -HDLVAR $HDL
OPTION:ncsim:verilog:m:-MESSAGES -NOLOG -CDSLIB $CDS -HDLVAR $HDL
OPTION:ncsim:verilog:a:-MESSAGES -NOLOG -CDSLIB $CDS -HDLVAR $HDL
OPTION:ncsim:verilog:r:-MESSAGES -NOLOG -CDSLIB $CDS -HDLVAR $HDL
#///////////////////////////////////////////////////////////////////// //
# End
Return to previous page Advance to next page

www.xilinx.com
1-800-255-7778