ISim Hardware Co-Simulation Tutorial: Accelerating Floating Point Fast Fourier Transform Simulation

Similar documents
ISim Hardware Co-Simulation Tutorial: Accelerating Floating Point FFT Simulation

ISim Hardware Co-Simulation Tutorial: Accelerating Floating Point FFT Simulation

ISim Hardware Co-Simulation Tutorial: Processing Live Ethernet Traffic through Virtex-5 Embedded Ethernet MAC

ISE Simulator (ISim) In-Depth Tutorial. UG682 (v 13.1) March 1, 2011

ISim In-Depth Tutorial. UG682 (v13.4) January 18, 2012

Vivado Design Suite User Guide

Hierarchical Design Using Synopsys and Xilinx FPGAs

Quick Front-to-Back Overview Tutorial

Vivado Design Suite User Guide

AccelDSP Synthesis Tool

RTL Design and IP Generation Tutorial. PlanAhead Design Tool

PlanAhead Software Tutorial

Using Xilinx ChipScope Pro ILA Core with Project Navigator to Debug FPGA Applications. UG750 (v12.3) November 5, 2010

Hardware In The Loop (HIL) Simulation for the Zynq-7000 All Programmable SoC Author: Umang Parekh

PlanAhead Software Tutorial

ISE Tutorial. Using Xilinx ChipScope Pro ILA Core with Project Navigator to Debug FPGA Applications. UG750 (v14.4) December 18, 2012

ISim Hardware Co-Simulation Tutorial: Interacting with Spartan-6 Memory Controller and On-Board DDR2 Memory

I/O Pin Planning Tutorial. PlanAhead Design Tool

ChipScope Pro Software and Cores User Guide

ML605 GTX IBERT Design Creation

PlanAhead Software Tutorial

Vivado Design Suite Tutorial. Designing with IP

Vivado Design Suite User Guide

Vivado Design Suite Tutorial. Designing IP Subsystems Using IP Integrator

ML631 U2 DDR3 MIG Design Creation

Vivado Design Suite User Guide. Designing IP Subsystems Using IP Integrator

ML631 U1 DDR3 MIG Design Creation

ML605 Restoring Flash Contents

ISE Tutorial: Using Xilinx ChipScope Pro ILA Core with Project Navigator to Debug FPGA Applications

PlanAhead Software Tutorial

Synthesis Options FPGA and ASIC Technology Comparison - 1

Vivado Design Suite Tutorial. Using Constraints

VCU108 Built In Test July 2015

Vivado Design Suite Tutorial. Designing IP Subsystems Using IP Integrator

PlanAhead Software Tutorial

Virtual Input/Output v3.0

Partial Reconfiguration Tutorial. PlanAhead Design Tool

VCU110 GT IBERT Design Creation

EXOSTIV Dashboard Hands-on - MICA board

KC705 Ethernet Design Creation October 2012

VTR-2000 Evaluation and Product Development Platform. Instruction Sheet SOC Technologies Inc.

SP605 GTP IBERT Design Creation

ML605 PCIe x8 Gen1 Design Creation

FMC-MCM-1000 Evaluation and Product Development Platform. Instruction Sheet SOC Technologies Inc.

AC701 Ethernet Design Creation October 2014

AC701 Ethernet Design Creation June 2014

RTL and Technology Schematic Viewers Tutorial. UG685 (v13.1) March 1, 2011

Vivado Design Suite User Guide

PetaLinux SDK User Guide. Eclipse Plugin Guide

ZC706 GTX IBERT Design Creation June 2013

Xilinx 7 Series FPGA Libraries Guide for HDL Designs. UG768 (v 13.4) January 18, 2012

Supported Device Family (1) Supported User Interfaces. Simulation Models Supported S/W Drivers. Simulation. Notes:

ZC706 GTX IBERT Design Creation November 2014

SOC is disclosing this user manual (the "Documentation") to you solely for use in the development of designs to operate with SOC hardware devices. You

KC705 PCIe Design Creation with Vivado August 2012

BFM Simulation in Platform Studio

Xilinx Memory Interface Generator (MIG) User Guide

Vivado Design Suite Tutorial:

AC701 Built-In Self Test Flash Application April 2015

VTR-S1000. Quick-Start Guide. - Decoder Kit. Evaluation and Product Development Platform. Revision SOC Technologies Inc.

Spartan-6 Libraries Guide for HDL Designs. UG615 (v 13.1) March 1, 2011

KC705 Si5324 Design October 2012

Vivado Design Suite Tutorial. I/O and Clock Planning

Virtex-6 FPGA GTX Transceiver OTU1 Electrical Interface

Vivado Design Suite Tutorial: Implementation

ML605 Built-In Self Test Flash Application

LogiCORE IP 3GPP LTE Turbo Encoder v1.0 Bit-Accurate C Model. 3GPP LTE Turbo. [optional] UG490 (v1.0) April 25, 2008 [optional]

7 Series FPGAs Memory Interface Solutions (v1.9)

ML605 FMC Si570 Programming June 2012

Vivado Design Suite Tutorial. I/O and Clock Planning

KC705 GTX IBERT Design Creation October 2012

Utility Reduced Logic (v1.00a)

Vivado Design Suite Tutorial

Accelerating System Designs Requiring High-Bandwidth Connectivity with Targeted Reference Designs

VTR-4000B Evaluation and Product Development Platform. User Guide SOC Technologies Inc.

ISE Design Suite Software Manuals and Help

Vivado Design Suite Tutorial: High-Level Synthesis

Vivado Design Suite Tutorial. Design Flows Overview

Viterbi Decoder Block Decoding - Trellis Termination and Tail Biting Author: Michael Francis

Vivado Design Suite Tutorial. Designing IP Subsystems Using IP Integrator

I/O Pin Planning Tutorial. PlanAhead Design Tool

Vivado Design Suite Tutorial. Model-Based DSP Design using System Generator

ISim User Guide. UG660 (v13.4) January 27, 2012

Zynq-7000 Platform Software Development Using the ARM DS-5 Toolchain Author: Simon George and Prushothaman Palanichamy

SP605 MultiBoot Design

H264 Encoder Codec. API Specification. 04/27/2017 Revision SOC Technologies Inc.

ML605 Built-In Self Test Flash Application

Utility Bus Split (v1.00a)

Getting Started with the PowerPC and MicroBlaze Development Kit - Virtex-4 FX12 Edition. UG092 (v1.6) June 2, 2008

PetaLinux SDK User Guide. Firmware Upgrade Guide

Xilinx/Cadence PCB Guide. UG629 (v 13.1) March 1, 2011

Virtex-4 PowerPC Example Design. UG434 (v1.2) January 17, 2008

Vivado Design Suite User Guide

SP605 Standalone Applications

Partial Reconfiguration Tutorial. PlanAhead Design Tool

ML623 IBERT Getting Started Guide (ISE 12.1) UG725 (v2.0.1) January 28, 2011

EDK Concepts, Tools, and Techniques

Encoder Core. API Specification. Revision: SOC Technologies Inc.

StickIt! MPU-9150 Manual. How to install and use your new StickIt! MPU-9150 Module

PetaLinux SDK User Guide. Application Development Guide

Transcription:

ISim Hardware Co-Simulation Tutorial: Accelerating Floating Point Fast Fourier Transform Simulation UG817 (v 13.2) July 28, 2011

Xilinx is disclosing this user guide, manual, release note, and/or specification (the Documentation ) to you solely for use in the development of designs to operate with Xilinx hardware devices. You may not reproduce, distribute, republish, download, display, post, or transmit the Documentation in any form or by any means including, but not limited to, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of Xilinx. Xilinx expressly disclaims any liability arising out of your use of the Documentation. Xilinx reserves the right, at its sole discretion, to change the Documentation without notice at any time. Xilinx assumes no obligation to correct any errors contained in the Documentation, or to advise you of any corrections or updates. Xilinx expressly disclaims any liability in connection with technical support or assistance that may be provided to you in connection with the Information. THE DOCUMENTATION IS DISCLOSED TO YOU AS-IS WITH NO WARRANTY OF ANY KIND. XILINX MAKES NO OTHER WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY, REGARDING THE DOCUMENTATION, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT OF THIRD-PARTY RIGHTS. IN NO EVENT WILL XILINX BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT, EXEMPLARY, SPECIAL, OR INCIDENTAL DAMAGES, INCLUDING ANY LOSS OF DATA OR LOST PROFITS, ARISING FROM YOUR USE OF THE DOCUMENTATION. Copyright 2002-2011 Xilinx Inc. All Rights Reserved. XILINX, the Xilinx logo, the Brand Window and other designated brands included herein are trademarks of Xilinx, Inc. All other trademarks are the property of their respective owners. The PowerPC name and logo are registered trademarks of IBM Corp., and used under license. All other trademarks are the property of their respective owners. 2 www.xilinx.com UG817 (v 13.2) July 28, 2011

Table of Contents Chapter 1 Introduction... 5 Prerequisites... 5 Tutorial Files... 5 Chapter 2 Tutorial... 7 Step 1: Generating a FFT Core in CORE Generator... 7 Step 2: Creating a Test Bench... 11 Step 3: Compiling the Design for Hardware Co-Simulation... 12 Step 4: Running ISim Hardware Co-Simulation... 13 Chapter 3 Benchmark...17 Appendix Additional Resources...19 UG817 (v 13.2) July 28, 2011 www.xilinx.com 3

4 www.xilinx.com UG817 (v 13.2) July 28, 2011

Chapter 1 Introduction This tutorial describes how to use ISim Hardware Co-simulation to accelerate the simulation of floating point fast Fourier Transform (FFT) and verify the FFT implementation on a Xilinx ML605 board. Digital Signal Processing (DSP) designs are typically very time-consuming to simulate in software due to their data and computation intensiveness. A fast bit-accurate model is often used to speed up the simulation of a DSP function, but it does not provide any cycle accuracy and is not straightforward to integrate with other Register Transfer Level (RTL) modules. A behavioral RTL model provides bit-and-cycle accuracy but is relatively slower to simulate. A structural RTL or gate-level model is even much slower to simulate. Sometimes an IP does not provide a fast bit-accurate model or even a behavioral RTL model, which leaves the slowest structural/gate-level simulation as the only choice. ISim hardware co-simulation provides an additional mean to simulate DSP functions by offloading intensive computations to FPGA. It can bring synthesizable HDL code, synthesized or protected netlists such as IP cores generated by CORE Generator into FPGA for co-simulation. That solves the problem on getting a bit-and-cycle accurate simulation models as well as bolstering the simulation performance. For many complex DSP designs, not only does it accelerate the simulation of a design, it verifies the implementation of the design on actual hardware. ISim hardware co-simulation complements RTL, post-synthesis, and post-implementation simulation to complete the verification tool suite. Prerequisites ISE Design Suite, version 13.2 Virtex -6 FPGA ML605 Evaluation Kit Design File: rdf0125_fft_sim_tutorial.zip Tutorial Files File fp_fft_top.v fp_fft_tb.v FloatingPointFFT.xise sim.tcl fp_fft_tb.wcfg fp_fft_tb.prj full_compile.bat Description Wrapper that instantiates the floating point FFT core. Top-level test bench that generates test vectors to exercise the FFT core. ISE project for this tutorial. Custom simulation command file that measures the ISim simulation time. Custom waveform configuration file. ISim project file for the command line flow. Windows batch file to fully compile the design for hardware co-simulation with the Fuse command line. UG817 (v 13.2) July 28, 2011 www.xilinx.com 5

Chapter 1: Introduction File full_compile.sh incr_compile.bat incr_compile.sh run_isim.bat run_isim.sh Description Linux shell script to fully compile the design for hardware co-simulation with the Fuse command line. Windows batch file to incrementally compile the test bench for hardware co-simulation with the Fuse command line. Linux shell script to incrementally compile the test bench for hardware co-simulation with the Fuse command line. Windows batch file to launch the ISim simulation. Linux shell script to launch the ISim simulation. Note When performing this tutorial, all data files must be copied to your current working directory. 6 www.xilinx.com UG817 (v 13.2) July 28, 2011

Chapter 2 Tutorial This tutorial describes how to use ISim Hardware Co-simulation to accelerate the simulation of floating point Fast Fourier Transform (FFT) and verify the FFT implementation on a Xilinx ML605 board. This tutorial is separated into four sections that contain the steps you need to perform to run an FFT design through ISim hardware co-simulation. Perform the steps in the order that they are presented. These sections are as follows. 1. Generating a FFT Core in CORE Generator 2. Creating a Test Bench 3. Compiling the Design for Hardware Co-Simulation 4. Running ISim Hardware Co-Simulation Step 1: Generating a FFT Core in CORE Generator In this tutorial, we will use the Fast Fourier Transform IP core in the CORE Generator tool and create an ISim hardware co-simulation test bench that runs on the Virtex -6 FPGA ML605 Evaluation Kit. Note The screen captures in this tutorial are based on the Fast Fourier Transform version 7.1. The CORE Generator GUI might look different in later versions of the tool. 1. Launch the ISE Project Navigator. 2. Choose File > New Project to open the New Project Wizard. Enter a project name (FloatingPointFFT) and location. Click Next. UG817 (v 13.2) July 28, 2011 www.xilinx.com 7

Chapter 2: Tutorial 3. On the Project Settings page, choose the part for the ML605 board, which is Virtex -6 device XC6VLX240T, package FF1156, and speed -1. Select ISim as the simulator and Verilog as the preferred language. Click Next and then Finish to complete the project creation. 4. Choose Project > New Source to open the New Source Wizard. Select IP (CORE Generator & Architecture Wizard) and name the IP as fp_fft_core. Click Next. 5. Select Fast Fourier Transform version 7.1 from the IP list. Click Next and then Finish. 8 www.xilinx.com UG817 (v 13.2) July 28, 2011

Chapter 2: Tutorial 6. After launching the FFT core user interface, set the Transform Length to 16384. Select Pipelined, Streaming I/O as the implementation. Click Next. 7. Set the Data Format to Floating Point, and the Output Ordering to Natural Order. Click Next. UG817 (v 13.2) July 28, 2011 www.xilinx.com 9

Chapter 2: Tutorial 8. Choose Use 4-multiplier structure (performance optimization) for the Complex Multipliers option. Click Generate to generate the core. 9. Add a top-level module, fp_fft_top, that instantiates the generated fp_fft_core IP core. This is required because ISim hardware co-simulation only supports a Hardware Definition Language (HDL) top-level module. You can use the completed fp_fft_top.v provided in this tutorial. Choose Project > Add Source. Add the fp_fft_top.v. 10 www.xilinx.com UG817 (v 13.2) July 28, 2011

Chapter 2: Tutorial Step 2: Creating a Test Bench 1. Add a Verilog test bench module fp_fft_tb.v that generates test vectors to exercise the fp_fft_top instance. You can use the completed fp_fft_tb.v file provided in this tutorial. Choose Project > Add Source. Add the fp_fft_tb.v. The test bench has four 32-bit by 16384 arrays fft_xn_re_data, fft_xn_im_data, fft_xk_re_data, fft_xk_im_data, for storing the real and imaginary components of the FFT input vector xn and output vector xk. When the simulation starts, the test bench loads the FFT input vector from a data file fft_xn_data.txt into fft_xn_re_data and fft_xn_im_data array. After the FFT computation is done, the test bench stores the values in the fft_xk_re_data and fft_xk_im_data array in a result file fft_xk_data.txt. Both fft_xn_data.txt and fft_xk_data.txt store one data point per line. Each data point compromises two 32-bit hexadecimal values, the real and imaginary part respectively, separated by a space. The hexadecimal values are the binary representation of the floating point numbers using the IEEE 754 standard. Note The TXT data files must be in the directory from which the simulation is being run. The Verilog tasks defined in the test bench include: clear_fft_xk_data Fills the fft_xk_re_data and fft_xk_im_data array with zeros. load_fft_xn_data Load the data samples from the data file, fft_xn_data.txt, into the fft_xn_re_data and fft_xn_im_data array. save_fft_xk_data Save the data samples in the fft_xn_re_data and fft_xn_im_data array to the result file, fft_xk_data.txt. UG817 (v 13.2) July 28, 2011 www.xilinx.com 11

Chapter 2: Tutorial Step 3: Compiling the Design for Hardware Co-Simulation After you create the test bench and the custom constraints file, you can compile the design for hardware co-simulation using the ISim compiler. This can be done in Project Navigator by enabling Hardware Co-Simulation on a selected instance in your design. The selected instance, including its submodules, are co-simulated in hardware during the ISim simulation. Other modules are simulated in software. 1. Switch to the Simulation View in Project Navigator. Right-click the dut fp_fft_top instance from the Pane of the Design Panel, and click Source Properties. 2. Select the Hardware Co-Simulation category. Check the Enable Hardware Co-Simulation check box. Set the Clock Port to clk. Select ML605 (JTAG) as the Target Board for the Hardware Co-Simulation. Leave the Enable Incremental Implementation option unchecked. Note The enabled instance for Hardware Co-Simulation is now marked with a special icon. The Enable Incremental Implementation option can be used after the design has been compiled for Hardware Co-Simulation. If the instance selected for Hardware Co-Simulation does not change in subsequent runs, you can turn on this option to skip the synthesis, implementation, and bitstream generation for Hardware Co-Simulation. It allows the test-bench or any portion simulated in software to be modified and simulated again quickly. 3. Select the fp_fft_tb instance from the Pane of the Design panel. Go to the Pane of the Design panel, right-click on Simulate Behavioral Model and click Process Properties. 4. Change the Property display level to Advanced. Set the properties for the Simulate Behavioral Model process. 5. Run the Simulate Behavioral Model process for the fp_fft_tb instance. 12 www.xilinx.com UG817 (v 13.2) July 28, 2011

Chapter 2: Tutorial Compiling the Design on the Command Line You can invoke the ISim compiler through the Fuse command line tool. You must provide Fuse a project file, the design top level module(s), and other optional arguments such as libraries to link in and library search paths. To compile the design for hardware co-simulation, you must provide the following extra arguments: fuse -prj [project file] [top level modules] -hwcosim_instance [instance] -hwcosim_clock [clock] -hwcosim_board [board] -hwcosim_constraints [constraints file] -hwcosim_incremental [0 1] hwcosim_instance: Specifies the full hierarchical path of the instance to co-simulate in hardware hwcosim_clock: Specifies the port name of the clock input for the instance. This is the clock in the lock-step portion, that is to be controlled by the test bench. For a design with multiple clocks, specify the fastest clock using this option so that ISim can optimize the simulation. Other clock ports are treated as regular data ports. hwcosim_board: Specifies the identifier of the hardware board to use for co-simulation. hwcosim_constraints (optional): Specifies the custom constraints file that provides additional constraints for implementing the instance for hardware co-simulation. We also use the constraints file to specify which ports of the instance are mapped to external I/Os or clocks. hwcosim_incremental (optional): Specifies whether Fuse should reuse the last generated hardware co-simulation bitstream and skip the implementation flow. For example, to compile the FFT design for this tutorial, you can run the Fuse command line as follows: fuse -prj fp_fft_tb.prj fp_fft_tb o fp_fft_tb.exe -hwcosim_instance /fp_fft_tb/dut -hwcosim_clock clk -hwcosim_board ml605-jtag Step 4: Running ISim Hardware Co-Simulation The simulation executable generated by the compiler runs in the same way in both software simulation and hardware co-simulation flow. Project Navigator automatically launches the simulation executable in GUI mode after the compilation finishes. UG817 (v 13.2) July 28, 2011 www.xilinx.com 13

Chapter 2: Tutorial In the Instances and Processes view, the instance selected for hardware co-simulation is indicated with a special icon. As the instance runs in hardware, you cannot expand it to see its internal signals and submodules. 14 www.xilinx.com UG817 (v 13.2) July 28, 2011

Chapter 2: Tutorial Before the simulation starts, ISim programs the FPGA with the bitstream file generated for hardware co-simulation. You might notice the message in the ISim console window: Downloading bitstream, please wait till status is READY. After the FPGA is configured, the console shows Bitstream download is complete. READY for simulation. From this point, you can run the simulation and interact with the ISim GUI the same way you do in the software simulation flow. UG817 (v 13.2) July 28, 2011 www.xilinx.com 15

16 www.xilinx.com UG817 (v 13.2) July 28, 2011

Chapter 3 Benchmark The following table compares the performance 1 between ISim simulation and ISim hardware co-simulation. The FFT design takes about 65700 simulation clock cycles to finish. The compilation time measures the time taken to compile the FFT design into a simulation executable using the ISim compiler (Fuse). ISim hardware co-simulation takes more time for compilation as it runs through synthesis, implementation, and bitstream generation for the portion of design under co-simulation. As the number of simulation cycles increases, the performance gain in simulation using ISim hardware co-simulation becomes more substantial and amortizes the overhead in compilation. As a good practice, you can first simulate your design in software for a small number of cycles to verify a few test cases. Then you switch to ISim hardware co-simulation for a longer simulation with more comprehensive test cases. Using the Enable Incremental Implementation option, you can reuse the previously generated bitstream to save the compilation time if the portion of design under co-simulation has not changed. The compilation time could be even faster than a regular ISim compilation because only a subset of the design is recompiled. You can thus continuously modify the test bench or other portions of design that are simulated in software and achieve more design turns per day. Simulation performance varies on different hardware co-simulation interfaces. The JTAG co-simulation interface is readily available on almost any FPGA board with a JTAG port. It consumes fewer resources on FPGA for implementing the hardware co-simulation interface; however, its latency and throughput are worse than other interfaces like Ethernet. The point-to-point Ethernet co-simulation interface supports an Ethernet connection of 10/100/1000 Gbps and achieves a much higher throughput than JTAG; however, it consumes more resources on FPGA for implementing the hardware co-simulation interface and is not supported on all boards. 1. The benchmark was performed using ISE 13.2 on a machine with a Core i7 2.8GHz CPU, 8GB RAM, and running a 64-bit Windows OS. UG817 (v 13.2) July 28, 2011 www.xilinx.com 17

Chapter 3: Benchmark Comparison on Simulation Performance Note Speed-ups relative to ISim simulation are in parenthesis Compilation Time Simulation Time Total Time ISim simulation 49s 1383s 1432s ISim hardware co-simulation on ML605 through JTAG 2 ISim hardware co-simulation on ML605 through JTAG 2 (Enable Incremental Implementation) ISim hardware co-simulation on ML605 through point-to-point Ethernet 3 ISim hardware co-simulation on ML605 through point-to-point Ethernet 3 (Enable Incremental Implementation) 685s (0.07x) 90s (15x) 775s (1.8x) 5s (10x) 90s (15x) 95s (15x) 887s (0.05x) 5s (277x) 892s (1.6x) 5s (10x) 5s (277x) 10s (143x) 2. The JTAG co-simulation interface uses a Platform Cable USB with the speed configured to 12 MHz. 3. The point-to-point Ethernet co-simulation interface uses a Gigabit Ethernet connection directly connecting the PC and the ML605 board. 18 www.xilinx.com UG817 (v 13.2) July 28, 2011

Appendix Additional Resources Xilinx Glossary - http://www.xilinx.com/support/documentation/sw_manuals/glossary.pdf Xilinx Documentation - http://www.xilinx.com/support/documentation Xilinx Support - http://www.xilinx.com/support UG817 (v 13.2) July 28, 2011 www.xilinx.com 19