Vivado Design Suite User Guide:Logic Simulation

1y ago
12 Views
2 Downloads
5.13 MB
276 Pages
Last View : 7d ago
Last Download : 3m ago
Upload by : Macey Ridenour
Transcription

See all versionsof this documentVivado Design Suite UserGuideLogic SimulationUG900 (v2022.1) April 21, 2022Xilinx is creating an environment where employees, customers, andpartners feel welcome and included. To that end, we’re removing noninclusive language from our products and related collateral. We’velaunched an internal initiative to remove language that could excludepeople or reinforce historical biases, including terms embedded in oursoftware and IPs. You may still find examples of non-inclusivelanguage in our older products as we work to make these changes andalign with evolving industry standards. Follow this link for moreinformation.

Table of ContentsChapter 1: Overview.7Navigating Content by Design Process. 7Logic Simulation Overview.7Supported Simulators.8Simulation Flow . 8Language and Encryption Support . 11Chapter 2: Preparing for Simulation.12Using Test Benches and Stimulus Files. 12Pointing to the Simulator Install Location. 13Compiling Simulation Libraries. 14Using Xilinx Simulation Libraries.19Using Simulation Settings. 28Adding or Creating Simulation Source Files. 32Generating a Netlist. 34Chapter 3: Simulating with Third-Party Simulators. 37Running Simulation Using Third Party Simulators with Vivado IDE. 38Dumping SAIF for Power Analysis.41Dumping VCD. 43Simulating IP.44Using a Custom DO File During an Integrated Simulation Run. 44Running Third-Party Simulators in Batch Mode.46Chapter 4: Simulating with Vivado Simulator. 47Running the Vivado Simulator.47Running Functional and Timing Simulation.65Saving Simulation Results. 68Distinguishing Between Multiple Simulation Runs.68Closing a Simulation. 69Adding a Simulation Start-up Script File.69Viewing Simulation Messages. 70UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com2

Using the launch simulation Command. 72Re-running the Simulation After Design Changes (relaunch). 73Using the Saved Simulator User Interface Settings.74Chapter 5: Analyzing Simulation Waveforms with VivadoSimulator. 76Using Wave Configurations and Windows. 76Opening a Previously Saved Simulation Run. 77Understanding HDL Objects in Waveform Configurations .78Customizing the Waveform. 81Controlling the Waveform Display . 87Organizing Waveforms.91Analyzing Waveforms. 93Analyzing AXI Interface Transactions. 98Chapter 6: Debugging a Design with Vivado Simulator. 113Debugging at the Source Level. 113Forcing Objects to Specific Values.117Power Analysis Using Vivado Simulator. 125Using the report drivers Tcl Command.127Using the Value Change Dump Feature. 127Using the log wave Tcl Command. 128Cross Probing Signals in the Object, Wave, and Text Editor Windows. 130Chapter 7: Simulating in Batch or Scripted Mode in VivadoSimulator.136Exporting Simulation Files and Scripts. 136Running the Vivado Simulator in Batch Mode.142Elaborating and Generating a Design Snapshot, xelab.144Simulating the Design Snapshot, xsim.155Example of Running Vivado Simulator in Standalone Mode. 159Project File (.prj) Syntax.160Predefined Macros. 161Library Mapping File (xsim.ini). 161Running Simulation Modes.162Using Tcl Commands and Scripts .165export simulation .166export ip user files.169UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com3

Appendix A: Compilation, Elaboration, Simulation, Netlist, andAdvanced Options. 172Compilation Options.172Elaboration Options. 174Simulation Options. 176Netlist Options.178Advanced Simulation Options. 179Appendix B: SystemVerilog Support in Vivado Simulator. 180Targeting SystemVerilog for a Specific File. 180Testbench Feature.187Appendix C: Universal Verification Methodology Support. 196Appendix D: VHDL 2008 Support in Vivado Simulator. 197Introduction . 197Compiling and Simulating.197Supported Features. 199Appendix E: Direct Programming Interface (DPI) in VivadoSimulator.201Introduction. 201Compiling C Code.201xsc Compiler. 202Binding Compiled C Code to SystemVerilog Using xelab. 204Data Types Allowed on the Boundary of C and SystemVerilog. 204Mapping for User-Defined Types. 205Support for svdpi.h Functions. 207DPI Examples Shipped with the Vivado Design Suite. 215Appendix F: SystemC Support in Vivado IDE. 216Selecting Simulation Model Type. 216Protected Models. 220Unprotected Models. 221SystemC Simulation Using Vivado. 222Running SystemC Simulation Using Vivado Simulator.224Appendix G: Automated Testbench Generation for Sub-Design. 225UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com4

generate vcd ports.225create testbench. 226Using Automated Testbench Generation on Example Design. 227Appendix H: Handling Special Cases.231Using Global Reset and 3-State. 231Delta Cycles and Race Conditions. 233Using the ASYNC REG Constraint.234Simulating Configuration Interfaces. 236Disabling Block RAM Collision Checks for Simulation. 239Dumping the Switching Activity Interchange Format File for Power Analysis. 240Skipping Compilation or Simulation. 240Appendix I: Value Rules in Vivado Simulator Tcl Commands. 242String Value Interpretation. 242Vivado Design Suite Simulation Logic. 242Appendix J: Vivado Simulator Mixed Language Support andLanguage Exceptions. 244Using Mixed Language Simulation. 244VHDL Language Support Exceptions. 250Verilog Language Support Exceptions . 251Appendix K: Vivado Simulator Quick Reference Guide. 254Appendix L: Using Xilinx Simulator Interface. 257Preparing the XSI Functions for Dynamic Linking. 257Writing the Test Bench Code. 259Compiling Your C/C Program. 260Preparing the Design Shared Library. 260XSI Function Reference.261Vivado Simulator VHDL Data Format.266Vivado Simulator Verilog Data Format. 269Appendix M: Additional Resources and Legal Notices. 272Xilinx Resources.272Documentation Navigator and Design Hubs. 272References.272Links to Additional Information on Third-Party Simulators.273UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com5

Training Resources.274Revision History. 274Please Read: Important Legal Notices. 275UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com6

Chapter 1: OverviewChapter 1OverviewNavigating Content by Design ProcessXilinx documentation is organized around a set of standard design processes to help you findrelevant content for your current development task. All Versal ACAP design process DesignHubs and the Design Flow Assistant materials can be found on the Xilinx.com website. Thisdocument covers the following design processes: Hardware, IP, and Platform Development: Creating the PL IP blocks for the hardwareplatform, creating PL kernels, functional simulation, and evaluating the Vivado timing,resource use, and power closure. Also involves developing the hardware platform for systemintegration. Topics in this document that apply to this design process include: Chapter 3: Simulating with Third-Party Simulators Chapter 4: Simulating with Vivado Simulator Appendix F: SystemC Support in Vivado IDELogic Simulation OverviewSimulation is a process of emulating real design behavior in a software environment. Simulationhelps verify the functionality of a design by injecting stimulus and observing the design outputs.This chapter provides an overview of the simulation process, and the simulation options in theVivado Design Suite.The process of simulation includes: Creating test benches, setting up libraries and specifying the simulation settings for Simulation Generating a Netlist (if performing post-synthesis or post-implementation simulation) Running a Simulation using Vivado simulator or third party simulators. See SupportedSimulators for more information on supported simulators.UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com7

Chapter 1: OverviewSupported SimulatorsFollowing are the supported simulators in the Vivado Design Suite:Table 1: Supported SimulatorsSimulatorIntegrated with VivadoIntegrated Design EnvironmentVersionVivado Simulator2022.1Integrated with the Vivado integrateddesign environment, where eachsimulation launch appears as aframework of windows within theVivado IDE.Siemens EDA Questa AdvancedSimulator2021.3YesSiemens EDA ModelSim SimulatorSynopsys Verilog Compiler Simulator(VCS)Aldec Rivera-PRO SimulatorAldec Active-HDLCadence Xcelium Parallel 09.002YesSee the Vivado Design Suite User Guide: Release Notes, Installation, and Licensing (UG973) for thesupported versions of third-party simulators.For more information about the Vivado IDE and the Vivado Design Suite flow, see: Vivado Design Suite User Guide: Using the Vivado IDE (UG893) Vivado Design Suite User Guide: Design Flows Overview (UG892)Simulation FlowSimulation can be applied at several points in the design flow. It is one of the first steps afterdesign entry and one of the last steps after implementation as part of verifying the endfunctionality and performance of the design.Simulation is an iterative process and is typically repeated until both the design functionality andtiming requirements are satisfied.The following figure illustrates the simulation flow for a typical design:UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com8

Chapter 1: OverviewFigure 1: Simulation FlowRTL DesignBehavioral Simulation(Verify Design Behaves asIntended)SynthesizePost Synthesis SimulationImplement (Place andRoute)Post ImplementationSimulation(Close to Emulating HW)Debug the DesignX23703-021320Behavioral Simulation at the Register Transfer LevelRegister Transfer Level (RTL) behavioral simulation can include: RTL Code Instantiated UNISIM library components Instantiated UNIMACRO components UNISIM gate-level model (for the Vivado logic analyzer) SECUREIP LibraryRTL-level simulation lets you simulate and verify your design prior to any translation made bysynthesis or implementation tools. You can verify your designs as a module or an entity, a block,a device, or a system.UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com9

Chapter 1: OverviewRTL simulation is typically performed to verify code syntax, and to confirm that the code isfunctioning as intended. In this step, the design is primarily described in RTL and consequently,no timing information is required.RTL simulation is not architecture-specific unless the design contains an instantiated devicelibrary component. To support instantiation, Xilinx provides the UNISIM library.When you verify your design at the behavioral RTL you can fix design issues earlier and savedesign cycles.Keeping the initial design creation limited to behavioral code allows for: More readable code Faster and simpler simulation Code portability (the ability to migrate to different device families) Code reuse (the ability to use the same code in future designs)Post-Synthesis SimulationYou can simulate a synthesized netlist to verify that the synthesized design meets the functionalrequirements and behaves as expected. Although it is not typical, you can perform timingsimulation with estimated timing numbers at this simulation point.The functional simulation netlist is a hierarchical, folded netlist expanded to the primitive moduleand entity level; the lowest level of hierarchy consists of primitives and macro primitives.These primitives are contained in the UNISIMS VER library for Verilog, and the UNISIM libraryfor VHDL.Related InformationUNISIM LibraryPost-Implementation SimulationYou can perform functional or timing simulation after implementation. Timing simulation is theclosest emulation to actually downloading a design to a device. It allows you to ensure that theimplemented design meets functional and timing requirements and has the expected behavior inthe device.IMPORTANT! Performing a thorough timing simulation ensures that the completed design is free ofdefects that could otherwise be missed, such as:UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com10

Chapter 1: Overview Post-synthesis and post-implementation functionality changes that are caused by: Synthesis properties or constraints that create mismatches (such as full case andparallel case) UNISIM properties applied in the Xilinx Design Constraints (XDC) file The interpretation of language during simulation by different simulators Dual port RAM collisions Missing, or improperly applied timing constraints Operation of asynchronous paths Functional issues due to optimization techniquesLanguage and Encryption SupportThe Vivado simulator supports: VHDL, see IEEE Standard VHDL Language Reference Manual (IEEE-STD-1076-1993) and partof VHDL-2008. Verilog, see IEEE Standard Verilog Hardware Description Language (IEEE-STD-1364-2001). SystemVerilog, see IEEE Standard for SystemVerilog--Unified Hardware Design, Specification,and Verification Language (IEEE-STD-1800-2009). IEEE P1735 encryption, see Recommended Practice for Encryption and Management ofElectronic Design Intellectual Property (IP) (IEEE-STD-P1735).UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com11

Chapter 2: Preparing for SimulationChapter 2Preparing for SimulationThis chapter describes the components that you need when you simulate a Xilinx device in theVivado Integrated Design Environment (IDE).Set up the following before performing the simulation: Create a test bench that reflects the simulation actions you want to run. Set up an install location in Vivado IDE (if not using the Vivado simulator). Compile your libraries (if not using the Vivado simulator). Select and declare the libraries you need to use. Specify the simulation settings such as target simulator, the simulation top module name, topmodule (design under test), display the simulation set, and define the compilation, elaboration,simulation, netlist, and advanced options. Generate a Netlist (if performing post-synthesis or post-implementation simulation).Using Test Benches and Stimulus FilesA test bench is Hardware Description Language (HDL) code written for the simulator that: Instantiates and initializes the design. Generates and applies stimulus to the design. Monitors the design output result and checks for functional correctness (optional).You can also set up the test bench to display the simulation output to a file, a waveform, or to adisplay screen. A test bench can be simple in structure and can sequentially apply stimulus tospecific inputs.A test bench can also be complex, and can include: Subroutine calls Stimulus that is read in from external files Conditional stimulus Other more complex structuresUG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com12

Chapter 2: Preparing for SimulationThe advantages of a test bench over interactive simulation are that it: Allows repeatable simulation throughout the design process Provides documentation of the test conditionsThe following bullets are recommendations for creating an effective test bench. Always specify the timescale in Verilog test bench files. For example: timescale 1ns/1ps Initialize all inputs to the design within the test bench at simulation time zero to properlybegin simulation with known values. Apply stimulus data after 100 ns to account for the default Global Set/Reset (GSR) pulse usedin functional and timing-based simulation. Begin the clock source before the Global Set/Reset (GSR) is released.For more information about test benches, see Writing Efficient Test Benches (XAPP199).TIP: When you create a test bench, remember that the GSR pulse occurs automatically in the postsynthesis and post-implementation timing simulation. This holds all registers in reset for the first 100 ns ofthe simulation.Related InformationUsing Global Reset and 3-StatePointing to the Simulator Install LocationTo define the installation path:1. Select Tools Settings Tool Settings 3rd Party Simulators.2. In Third-Party simulators tab of the Settings dialog box, select the simulator under the InstallPaths as shown in the following figure, and browse to the installation path.3. Select the appropriate simulator under Default Compiled Library Paths and browse to therelevant compiled library paths. You can set the library paths at a later point of time. SeeCompiling Simulation Libraries for more information on how to compile libraries for yoursimulator.Note: Installing Vivado simulator is part of Vivado IDE Installation. Hence, you do not need to setup aninstall location for Vivado simulator.UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com13

Chapter 2: Preparing for SimulationCompiling Simulation LibrariesIMPORTANT! With Vivado simulator, there is no need to compile the simulation libraries. However, youmust compile the libraries when using a third-party simulator.The Vivado Design Suite provides simulation models as a set of files and libraries. Your simulationtool must compile these files prior to design simulation. The simulation libraries contain thedevice and IP behavioral and timing models. The compiled libraries can be used by multipledesign projects.UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com14

Chapter 2: Preparing for SimulationDuring the compilation process, Vivado creates a default initialization file that the simulator usesto reference the compiled libraries. The compile simlib command creates the file in thelibrary output directory specified during library compilation. The default initialization file containscontrol variables that specify reference library paths, optimization, compiler, and simulatorsettings. If the correct initialization file is not found in the path, you cannot run simulation ondesigns that include Xilinx primitives.The name of the initialization file varies depending on the simulator you are using, as follows: Questa Advanced Simulator/ModelSim: modelsim.ini Xcelium: cds.lib VCS: synopsys sim.setup Riviera/Active-HDL: library.cfgFor more information on the simulator-specific compiled library file, see the third-partysimulation tool documentation.IMPORTANT! Compilation of the libraries is typically a one-time operation, as long as you are using thesame version of tools. However, any change to the Vivado tools or the simulator versions requires thatlibraries be recompiled.You can compile libraries using the Vivado IDE or using Tcl commands, as described in thefollowing sections.Compiling Simulation Libraries Using Vivado IDESelect Tools Compile Simulation Libraries to open the dialog box shown in the following figure.UG900 (v2022.1) April 21, 2022Vivado Design Suite User Guide: Logic SimulationSend Feedbackwww.xilinx.com15

Chapter 2: Preparing for SimulationFigure 2: Compile Simulation Libraries Dialog BoxSet the following options: Simulator: From the simulator drop-down menu, select a simulator. Language: Compiles libraries for the specified language. If this option is not specified, then thelanguage is set to correspond with the selected simulator (above). For multi-languagesimulators, both Verilog and VHDL libraries are compiled. Library: Specifies the simulation l

RTL simulation is typically performed to verify code syntax, and to confirm that the code is functioning as intended. In this step, the design is primarily described in RTL and consequently, no timing information is required. RTL simulation is not architecture-specific unless the design contains an instantiated device library component.

Related Documents:

For more information about the Vivado IDE and the Vivado Design Suite flow, see: Vivado Design Suite User Guide: Using the Vivado IDE (UG893) [Ref 4] Vivado Design Suite User Guide: Design Flows Overview (UG892) [Ref 12] Simulation Flow Simulation can be applied at several points in the design flow. It is one of the first steps after .

For more information about the Vivado IDE and the Vivado Design Suite flow, see: Vivado Design Suite User Guide: Using the Vivado IDE (UG893) [Ref 3] Vivado Design Suite User Guide: Design Flows Overview (UG892) [Ref 11] Simulation Flow Simulation can be applied at several points in the design flow. It is one of the first steps after .

Vivado Design Suite 2016.2 Release Notes www.xilinx.com 5 UG973 (v2016.2) June 8, 2016 Chapter 1 Release Notes 2016.2 What's New Vivado Design Suite 2016.2 and updated UltraFast Design Methodology Guide for the Vivado Design Suite (UG949) [Ref 1] Available Now. Get Vivado Design Suite 2016.2 with support for Virtex UltraScale and Defense-Grade .

2 Vivado Partial Reconfiguration - Documentation UG909: Vivado Design Suite User Guide - Partial Reconfiguration. UG947: Vivado Design Suite Tutorial - Partial Reconfiguration. You can follow this for the Xilinx-provided ug947-vivado-partial-reconfiguration-tutorial.zip file (this is a Verilog design for

more information on the different design flow modes, see this link in the Vivado Design Suite User Guide: Design Flows Overview (UG892). Note: Installation, licensing, and release information is available in the Vivado Design Suite User Guide: Release Notes, Installation, and Licensing (UG973). W o r k i n g w i t h t h e V i v a d o I D E

those objects, in the Xilinx Vivado Design Suite. It consists of the following: Chapter 1, Vivado Design Suite First Class Objects: Describes the various design and device objects used by the Vivado Design Suite to model the FPGA design database. Presents the objects sorted according to specific categories, with links to detailed

See the Vivado Design Suite User Guide: Release Notes, Installation, and Licensing (UG973) for a complete list and description of the system and software requirements. Configuring MATLAB to the Vivado Design Suite Before you begin, you should verify that MATLAB is configured to the Vivado Design Suite. Do the following: 1. Configure MATLAB.

Guide (UG911). For more information about XDC, see the Vivado Design Suite User Guide: Using Constraints (UG903). CAUTION! Do not migrate from ISE Design Suite to Vivado Design Suite while in the middle of an in-progress ISE Design Suite project, because design constraints and scripts are not compatible between these environments.