This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > FPGA Technical Tutorials > Designing with Xilinx FPGAs Using Vivado > Simulation > Setting Up Design for Simulation

TABLE OF CONTENTS

Xilinx FPGA FPGA Forum

Setting Up Design for Simulation

FONT SIZE : AAA

Setting Up Design for Simulation

For simulating the design, you need to specify a testbench . The testbench contains  HDL fifi le(s) which provides the input to the design for simulation. It also prints and/ or checks the outputs. A more complex testbench may even do white box testing by  performing assertion checks on internal signals of the design. 

You need to add these testbench fifi les in addition to the design fifi les. While adding  source fifi les from the GUI menu ( fifi le → add sources ), Vivado provides an option to  add or create simulation source . You need to select this option for testbench fifi les  that are not part of the design being implemented on the FPGA. These testbench  fifi les are used (along with the design fifi les) for the purpose of simulation. Vivado  determines the HDL language and variants through the fifi le extensions. For example,  fifi les with .sv extension are considered as of type SystemVerilog .  

Each simulator provides some options that you need to set appropriately. You can  select the simulator and set the options by clicking on simulation settings. Simulation  is done in three stages Compilation, Elaboration and actual Simulation. Each stage  has its own set of options.

Compilation

Compilation is the stage where Verilog, VHDL, or System Verilog is read and a  parse tree representing the model is created and stored in the design library. Most of  the language-related errors are detected at this stage. XSIM compilation for Verilog/ SystemVerilog and VHDL is performed by xvlog and xvhdl , respectively. Some of  the options for xvlog/xvhdl are:

• Verilog options: To add and include paths for searching ‘include d fi les and also for defi ning Verilog macros ’defi ne from command line 

• Generics or parameter options: To change the default parameters for top-level module or entity

• nosort : To prevent Vivado from trying to auto-determine the dependencies across HDL fi les to determine the order of parsing 

• relax : To show some leniency toward LRM noncompliance but commonly used styles in HDL Elaboration Elaboration is the stage where parse trees are combined based on design hierarchy;  parameters are resolved and a simulation kernel code corresponding to the HDL  code is generated inside a design snapshot. XSIM elaboration is performed by xelab command. Some of the options for xelab are:

• snapshot : To specify the name of design snapshot meant for simulation. Default name is top-level module/entity . 

• debug_level : To specify the level of debug that may be performed. It impacts the level of optimization that can be performed by the simulation engine. Values could be:

– typical : For line tracing, waveform display, and deriver debugging 

– all : All of typical and debug of Xilinx precompiled library 

– off : No debugging. Provides the fastest simulation 

• relax : To show some leniency toward LRM noncompliance but commonly used styles in HDL. 

• mt_level : To use multi-threading for faster elaboration.

– auto : Determined the level automatically, based on machine confi guration. 

– off : No multi-threading 

– <num>: use max of <num> threads

Simulation

Simulation is the fifi nal stage where the simulation kernel corresponding to the design  is verififi ed and debugged by running it. In the context of Vivado’s inbuilt simulator,  xsim is the command for the actual simulation using the generated design snapshot.  Some of the options for simulation are:

• runtime : Time for which simulation should be run, before stopping. In a typical simulation, it is the setup time, after which initial simulation stops and control is returned to Tcl shell. Simulation can continue further from Tcl shell with commands run –all or run <time> . 

• wdb : The waveform database fi le that is generated from simulation. This database can be viewed by Vivado waveform viewer. 

• saif/saif_all_signals : Used to generate SAIF fi le for power analysis.There are also additional options under compilation/elaboration and simulation tabs which can be used for passing any options to the parser ( xvlog/xvhdl ), elaborator ( xelab ), or simulation engine ( xsim ).

  • XC4028XL-3HQ240I

    Manufacturer:Xilinx

  • FPGA XC4000X Family 28K Gates 2432 Cells 0.35um Technology 3.3V 240-Pin HSPQFP EP
  • Product Categories: Contrôleur logique

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XCV200E-7BG352I

    Manufacturer:Xilinx

  • FPGA Virtex-E Family 63.504K Gates 5292 Cells 400MHz 0.18um Technology 1.8V 352-Pin Metal BGA
  • Product Categories: Connecteurs

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XC4003A-5PQ100C

    Manufacturer:Xilinx

  • FPGA XC4000A Family 3K Gates 100 Cells 125MHz 5V 100-Pin PQFP
  • Product Categories:

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XCS30-4PQ240C

    Manufacturer:Xilinx

  • Spartan and Spartan-XL Families Field Programmable Gate Arrays FPGA
  • Product Categories: Interface IC

    Lifecycle:Obsolete -

    RoHS: -

  • XC5VLX110-1FF1760C

    Manufacturer:Xilinx

  • FPGA Virtex-5 LX Family 110592 Cells 65nm Technology 1V 1760-Pin FCBGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Active Active

    RoHS: No RoHS

Need Help?

Support

If you have any questions about the product and related issues, Please contact us.