FPGA Design Techniques Xilinx, Inc. All Rights Reserved

Similar documents
Timing Methodologies (cont d) Registers. Typical timing specifications. Synchronous System Model. Short Paths. System Clock Frequency

Measuring Metastability

FPGA Clocking. Clock related issues: distribution generation (frequency synthesis) multiplexing run time programming domain crossing

White Paper Understanding Metastability in FPGAs

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

Source-Synchronous Serialization and Deserialization (up to 1050 Mb/s) Author: NIck Sawyer

Modeling Latches and Flip-flops

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

Programmable Logic Design Grzegorz Budzyń Lecture. 10: FPGA clocking schemes

A New Paradigm for Synchronous State Machine Design in Verilog

Latch Timing Parameters. Flip-flop Timing Parameters. Typical Clock System. Clocking Overhead

Set-Reset (SR) Latch

EE552. Advanced Logic Design and Switching Theory. Metastability. Ashirwad Bahukhandi. (Ashirwad Bahukhandi)

LogiCORE IP AXI Performance Monitor v2.00.a

Modeling Registers and Counters

Low latency synchronization through speculation

Sequential Logic: Clocks, Registers, etc.

Cascaded Counters. Page 1 BYU

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

Lecture 7: Clocking of VLSI Systems

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Clocking. Figure by MIT OCW Spring /18/05 L06 Clocks 1

SDLC Controller. Documentation. Design File Formats. Verification

Using Altera MAX Series as Microcontroller I/O Expanders

CSE140: Components and Design Techniques for Digital Systems

Counters and Decoders

Sequential Logic Design Principles.Latches and Flip-Flops

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

Master/Slave Flip Flops

74LS193 Synchronous 4-Bit Binary Counter with Dual Clock

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

Rotary Encoder Interface for Spartan-3E Starter Kit

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Lecture 10: Multiple Clock Domains

路 論 Chapter 15 System-Level Physical Design

White Paper Utilizing Leveling Techniques in DDR3 SDRAM Memory Interfaces

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

Chapter 2 Clocks and Resets

Chapter 9 Latches, Flip-Flops, and Timers

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

LatticeECP3 High-Speed I/O Interface

Creating a Controllable Oscillator Using the Virtex-5 FPGA IODELAY Primitive Author: Martin Kellermann

CLOCK DOMAIN CROSSING CLOSING THE LOOP ON CLOCK DOMAIN FUNCTIONAL IMPLEMENTATION PROBLEMS

Switch Fabric Implementation Using Shared Memory

Distributed Elastic Switch Architecture for efficient Networks-on-FPGAs

DM74LS193 Synchronous 4-Bit Binary Counter with Dual Clock

DM74LS169A Synchronous 4-Bit Up/Down Binary Counter

Lecture 11: Sequential Circuit Design

Debouncing Switches. Mechanical switches are one of the most common interfaces to a uc.

9/14/ :38

DDS. 16-bit Direct Digital Synthesizer / Periodic waveform generator Rev Key Design Features. Block Diagram. Generic Parameters.

DM7474 Dual Positive-Edge-Triggered D-Type Flip-Flops with Preset, Clear and Complementary Outputs

Contents. Overview Memory Compilers Selection Guide

Asynchronous counters, except for the first block, work independently from a system clock.

Wiki Lab Book. This week is practice for wiki usage during the project.

Digital Logic Design Sequential circuits

White Paper FPGA Performance Benchmarking Methodology

Chapter 5 :: Memory and Logic Arrays

8254 PROGRAMMABLE INTERVAL TIMER

Memory unit. 2 k words. n bits per word

HT1632C 32 8 &24 16 LED Driver

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

DM74LS112A Dual Negative-Edge-Triggered Master-Slave J-K Flip-Flop with Preset, Clear, and Complementary Outputs

Memory Elements. Combinational logic cannot remember

Lecture 10: Sequential Circuits

Demystifying Data-Driven and Pausible Clocking Schemes

54LS193 DM54LS193 DM74LS193 Synchronous 4-Bit Up Down Binary Counters with Dual Clock

54LS169 DM54LS169A DM74LS169A Synchronous 4-Bit Up Down Binary Counter

DM54161 DM74161 DM74163 Synchronous 4-Bit Counters

Combinational Logic Design Process

DS1225Y 64k Nonvolatile SRAM

A Pausible Bisynchronous FIFO for GALS Systems

Topics of Chapter 5 Sequential Machines. Memory elements. Memory element terminology. Clock terminology

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 16 Timing and Clock Issues

DS1220Y 16k Nonvolatile SRAM

Hunting Asynchronous CDC Violations in the Wild

Computer Systems Structure Main Memory Organization

ASYNCHRONOUS COUNTERS

54191 DM54191 DM74191 Synchronous Up Down 4-Bit Binary Counter with Mode Control

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

Lecture 10: Latch and Flip-Flop Design. Outline

Alpha CPU and Clock Design Evolution

Dual DIMM DDR2 and DDR3 SDRAM Interface Design Guidelines

2.1 CAN Bit Structure The Nominal Bit Rate of the network is uniform throughout the network and is given by:

DM74LS191 Synchronous 4-Bit Up/Down Counter with Mode Control

Best Practises for LabVIEW FPGA Design Flow. uk.ni.com ireland.ni.com

Module 3: Floyd, Digital Fundamental

Managing High-Speed Clocks

Prototyping ARM Cortex -A Processors using FPGA platforms

Introduction to Xilinx System Generator Part II. Evan Everett and Michael Wu ELEC Spring 2013

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

8 by 8 dot matrix LED displays with Cascadable Serial driver B32CDM8 B48CDM8 B64CDM8 General Description

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

Transcription:

FPGA esign Techniques

Objectives After completing this module, you will be able to: Increase design performance by duplicating flip-flops Increase design performance by adding pipeline stages Increase board performance by using I/O flip-flops Build reliable synchronization circuits FPGA esign Techniques 4-3

Outline uplicating Flip-flops Pipelining I/O Flip-flops Synchronization Circuits Summary FPGA esign Techniques 4-4

uplicating Flip-Flops High-fanout nets can be slow and hard to route fn1 uplicating flip-flops can fix both problems Reduced fanout shortens net delays Each flip-flop can fanout to a different physical region of the chip to help with routing fn1 esign tradeoffs Gain routability and performance fn1 esign area increases FPGA esign Techniques 4-5

Tips on uplicating Flip-Flops Name duplicated flip-flops _a, _b: NOT _1, _2 Numbered flip-flops are mapped by default into the same slice You generally want duplicated flip-flops to be separated Especially if the loads are spread across the chip Explicitly create duplicate flip-flops in your HL code Most synthesis tools have automatic fanout-control features However, they do not always pick the best division of loads Also, duplicated flip-flops will be named _1, _2 Many synthesis tools will optimize-out duplicated flip-flops Tell your synthesis tool to keep redundant logic o not duplicate flip-flops that are sourced by asynchronous signals Synchronize the signal first Feed synchronized signal to multiple flip-flops FPGA esign Techniques 4-6

uplicating Flip-Flops Example Source flip-flop drives two register banks that are constrained to different regions of the chip Source flip-flop and pad are not constrained PERIO = 5 ns timing constraint Implemented with default options Longest path = 6.806 ns Fails to meet timing constraint FPGA esign Techniques 4-7

uplicating Flip-Flops Example Source flip-flop has been duplicated Each flip-flop drives a region of the chip Each flip-flop can be placed closer to the register that it is driving Shorter routing delays Longest path = 4.666 ns Meets timing constraint FPGA esign Techniques 4-8

Outline uplicating Flip-Flops Pipelining I/O Flip-flops Synchronization Circuits Summary FPGA esign Techniques 4-9

Pipelining Concept f MAX = n MHz two logic levels f MAX 2n MHz one level one level FPGA esign Techniques 4-10

Pipelining Considerations Are there enough flip-flops available? Refer to the Map Report You generally will not run out of FFS Are there multiple logic levels between flip-flops? If there is only one logic level between flip-flops, pipelining will not improve performance Exception: Long carry-logic chains can benefit from pipelining Refer to the Post-Map Static Timing Report or Post-Place & Route Static Timing Report Can the system tolerate latency? FPGA esign Techniques 4-11

Latency in Pipelines Each pipeline stage adds one clock cycle of delay before the first output will be available Also called filling the pipeline After the pipeline is filled, a new output is available every clock cycle FPGA esign Techniques 4-12

Pipelining Example Original circuit Two logic levels between SOURCE_FFS and EST_FF f MAX = ~207 MHz LUT LUT LUT SOURCE_FFS EST_FF LUT FPGA esign Techniques 4-13

Pipelining Example Pipelined circuit One logic level between each set of flip-flops f MAX = ~347 MHz LUT LUT LUT SOURCE_FFS EST_FF LUT PIPE_FFS FPGA esign Techniques 4-14

Pipelining uestions Given the original circuit, what is wrong with the pipelined circuit? How can the problem be corrected? FPGA esign Techniques 4-15

Pipelining Answers What is wrong with the pipelined circuit? Latency mismatch Older data is mixed with newer data Circuit output is incorrect How can the problem be corrected? Add a flip-flop on SELECT All data inputs now experience the same amount of latency FPGA esign Techniques 4-16

Outline uplicating Flip-Flops Pipelining I/O Flip-flops Synchronization Circuits Summary FPGA esign Techniques 4-17

I/O Flip-Flop Overview Each Virtex -II I/O Block contains six flip-flops IF on the input, OF on the output, ENBFF on the 3-state enable Single or ouble ata Rate support Benefits of using I/O flip-flops Guaranteed setup, hold, and clock-to-out times when the clock signal comes from a BUFG Programmable delay on input flip-flop Programmable slew rate on output flip-flop FPGA esign Techniques 4-18

Programmable Input elay elay is added to the input of the IF or IL to guarantee 0 ns hold time Trades an increase in setup time for a decrease in hold time elay is controlled by the IOBELAY attribute NONE is the default if CLK is driven by a CM IF is the default if CLK is not driven by a CM NONE IF elay IF CE BUFG FPGA esign Techniques 4-19

Programmable Input elay Example XC2V250-5 (v1.90 Virtex -II speed files) CLK is a CM output (default delay is NONE) IF t SU = 4.0 ns t H = 0.0 ns NONE t SU = 1.3 ns t H = 0.0 ns CLK is not a CM output (default delay is IF) IF t SU = 1.2 ns t H = 0.0 ns NONE t SU = -1.5 ns t H = 1.7 ns FPGA esign Techniques 4-20

Programmable Output Slew Rate Only the LVTTL and LVCMOS I/O standards support programmable slew rate Slew rate can be SLOW or FAST By default, the slew rate is SLOW Slew rate is controlled by attributes Specified in the Constraints Editor or the UCF file FPGA esign Techniques 4-21

Accessing I/O Flip-Flops uring synthesis Timing-driven synthesis can force flip-flops into IOBs Some tools support attributes or synthesis directives to mark flip-flops for placement in an IOB Xilinx Constraint Editor Select the Misc tab Specify individual registers that should be placed in the IOB Need to know the instance name of each register uring the Map phase of implementation Map Properties, Pack I/O Registers/Latches into IOBs is on by default Timing-driven packing will also move registers into IOBs for critical paths FPGA esign Techniques 4-22

Outline uplicating Flip-Flops Pipelining I/O Flip-flops Synchronization Circuits Summary FPGA esign Techniques 4-23

Synchronization Circuits What is a synchronization circuit? Captures an asynchronous input signal and outputs it on a clock edge Why do I need synchronization circuits? Prevent setup and hold time violations End result is a more reliable design When do I need synchronization circuits? Signals cross between unrelated clock domains Between related clock domains, a path-specific timing constraint is sufficient Chip inputs that are asynchronous FPGA esign Techniques 4-24

Setup and Hold Time Violations Violations occur when the flip-flop input changes too close to a clock edge Three possible results: Flip-flop clocks in old data value Flip-flop clocks in new data value Flip-flop output becomes metastable FPGA esign Techniques 4-25

Metastability Flip-flop output enters a transitory state Neither a valid 0 nor a valid 1 May be interpreted as 0 by some loads and as 1 by others Remains in this state for an unpredictable length of time before settling to a valid 0 or 1 ue to its statistical nature, the occurrence of metastable events can only be reduced, not eliminated Mean Time Between Failures (MTBF) is exponentially related to the length of time the flip-flop is given to recover A few extra ns of recovery time can dramatically reduce the chances of a metastable event The circuits shown in this section allow a full clock cycle for metastable recovery FPGA esign Techniques 4-26

Synchronization Circuit #1 Use when input pulses will always be at least one clock period wide The extra flip-flops guard against metastability Guards against metastability Asynchronous Input Synchronized signal FF1 FF2 CLK FPGA esign Techniques 4-27

Synchronization Circuit #2 Use when input pulses may be less than one clock period wide FF1 captures short pulses VCC Guards against metastability Synchronized signal FF1 FF2 FF3 Asynchronous Input CLK CLR FPGA esign Techniques 4-28

Capturing a Bus Leading edge detector Input pulses must be at least one CLK period wide Asynchronous Input Clk One-shot enable CLK FF1 FF2 CE Synchronized bus inputs n bit bus Sync_Reg FPGA esign Techniques 4-29

Capturing a Bus Leading edge detector Input pulses may be less than one CLK period wide VCC One-shot enable Asynchronous Input Clk CLK FF1 CLR FF2 FF3 n bit bus Sync_Reg CE Synchronized bus inputs FPGA esign Techniques 4-30

Synchronization Circuit #3 Use a FIFO to cross domains Asynchronous Input Clk Wr System Clk Rd FIFO Flags Asynchronous Input Clk Wr Write Addr ata System Clk Read Addr Full AlmostFull Rd PortA - Write Port BlockRAM PortB - Read Port ata HalfFull Empty AlmostEmpty HalfEmpty FPGA esign Techniques 4-31

Outline uplicating Flip-Flops Pipelining I/O Flip-flops Synchronization Circuits Summary FPGA esign Techniques 4-32

Review uestions High fanout is one reason to duplicate a flip-flop. What is another reason? Give an example of a time when you do not need to resynchronize a signal that crosses between clock domains What is the purpose of the extra flip-flop in the synchronization circuits shown in this module? FPGA esign Techniques 4-33

Answers High fanout is one reason to duplicate a flip-flop. What is another reason? Loads are divided between multiple locations on the chip Give an example of a time when you do not need to resynchronize a signal that crosses between clock domains Well-defined phase relationship between the clocks Example: Clocks are the same frequency, 180º out of phase Use a path-specific constraint to ensure that data paths will meet timing What is the purpose of the extra flip-flop in the synchronization circuits shown in this module? To allow the first flip-flop time to recover from metastability FPGA esign Techniques 4-34

Summary You can increase circuit performance by: uplicating flip-flops Adding pipeline stages Using I/O flip-flops Some tradeoffs uplicating flip-flops increases circuit area Pipelining introduces latency I/O flip-flop programmable delay trades off setup time and hold time Synchronization circuits increase reliability FPGA esign Techniques 4-35

Where Can I Learn More? ata Book: http://support.xilinx.com ocumentation atabook Switching Characteristics etailed Functional escription > Input/Output Blocks (IOBs) Application Notes: http://support.xilinx.com ocumentation App Notes XAPP094: Metastability Recovery XAPP225: ata to Clock Phase Alignment FPGA esign Techniques 4-36