VLSI Clock Domain Crossing

Similar documents
EE178 Spring 2018 Lecture Module 5. Eric Crabill

EE178 Lecture Module 4. Eric Crabill SJSU / Xilinx Fall 2005

EE273 Lecture 14 Synchronizer Design November 11, Today s Assignment

EE273 Lecture 15 Synchronizer Design

Figure 1 shows a simple implementation of a clock switch, using an AND-OR type multiplexer logic.

Lecture 13: Clock and Synchronization. TIE Logic Synthesis Arto Perttula Tampere University of Technology Spring 2017

Clock Domain Crossing. Presented by Abramov B. 1

EECS150 - Digital Design Lecture 15 Finite State Machines. Announcements

EITF35: Introduction to Structured VLSI Design

EECS 373 Design of Microprocessor-Based Systems


EECS150 - Digital Design Lecture 10 - Interfacing. Recap and Topics

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

Universal Asynchronous Receiver- Transmitter (UART)

Digital System Design

DEDICATED TO EMBEDDED SOLUTIONS

Asynchronous (Ripple) Counters

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

EE241 - Spring 2005 Advanced Digital Integrated Circuits

Synchronous Sequential Design

CMOS Implementation of Reliable Synchronizer for Multi clock domain System-on-chip

More on Flip-Flops Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <98> 98

Glitches/hazards and how to avoid them. What to do when the state machine doesn t fit!

EE241 - Spring 2007 Advanced Digital Integrated Circuits. Announcements

Asynchronous inputs. 9 - Metastability and Clock Recovery. A simple synchronizer. Only one synchronizer per input

Clock and Asynchronous Signals

Counter dan Register

Outline. EECS150 - Digital Design Lecture 27 - Asynchronous Sequential Circuits. Cross-coupled NOR gates. Asynchronous State Transition Diagram

EE273 Lecture 11 Pipelined Timing Closed-Loop Timing November 2, Today s Assignment

Synchronization in Asynchronously Communicating Digital Systems

EECS 373 Design of Microprocessor-Based Systems

FIFO Memories: Solution to Reduce FIFO Metastability

Metastability Analysis of Synchronizer

EECS 373 Design of Microprocessor-Based Systems

Lec 24 Sequential Logic Revisited Sequential Circuit Design and Timing

Chapter 3 Unit Combinational

ESE 570 STATIC SEQUENTIAL CMOS LOGIC CELLS. Kenneth R. Laker, University of Pennsylvania, updated 25Mar15

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

TKT-1212 Digitaalijärjestelmien toteutus. Lecture 13 - Clock and Synchronization Erno Salminen, Spring 2013

Synchronizers and Arbiters

Digital Logic & Computer Design CS Professor Dan Moldovan Spring Chapter 3 :: Sequential Logic Design

Sequential Circuits. Sequential Logic. Circuits with Feedback. Simplest Circuits with Feedback. Memory with Cross-coupled Gates.

Robust Synchronization using the Wagging Technique

Synchronous Sequential Logic

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

Unit 9 Latches and Flip-Flops. Dept. of Electrical and Computer Eng., NCTU 1

Logic Design. Flip Flops, Registers and Counters

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Sequential Circuits

! Two inverters form a static memory cell " Will hold value as long as it has power applied

Sequential Logic. Sequential Circuits. ! Timing Methodologies " Cascading flip-flops for proper operation " Clock skew

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

ECE321 Electronics I

Product Level MTBF Calculation

EEC 118 Lecture #9: Sequential Logic. Rajeevan Amirtharajah University of California, Davis Jeff Parkhurst Intel Corporation

The outputs are formed by a combinational logic function of the inputs to the circuit or the values stored in the flip-flops (or both).

Automated Verification and Clock Frequency Characteristics in CDC Solution

INTRODUCTION TO SEQUENTIAL CIRCUITS

Outcomes. Spiral 1 / Unit 6. Flip-Flops FLIP FLOPS AND REGISTERS. Flip-flops and Registers. Outputs only change once per clock period

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Sequential Circuits

ECEN454 Digital Integrated Circuit Design. Sequential Circuits. Sequencing. Output depends on current inputs

Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1

EEE2135 Digital Logic Design Chapter 6. Latches/Flip-Flops and Registers/Counters 서강대학교 전자공학과

EE141-Fall 2010 Digital Integrated Circuits. Announcements. Homework #8 due next Tuesday. Project Phase 3 plan due this Sat.

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

EECS150 - Digital Design Lecture 3 - Timing

Metastability and Synchronizers A Tutorial

PRE J. Figure 25.1a J-K flip-flop with Asynchronous Preset and Clear inputs

Asynchronous Counter

Lecture 8: Sequential Logic

Unit 11. Latches and Flip-Flops

cascading flip-flops for proper operation clock skew Hardware description languages and sequential logic

Sequential logic. Circuits with feedback. How to control feedback? Sequential circuits. Timing methodologies. Basic registers

Other Flip-Flops. Lecture 27 1

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

Counters

Traversing Digital Design. EECS Components and Design Techniques for Digital Systems. Lec 22 Sequential Logic - Advanced

More Digital Circuits

The NOR latch is similar to the NAND latch

6.S084 Tutorial Problems L05 Sequential Circuits

Chapter 1: Switching Algebra Chapter 2: Logical Levels, Timing & Delays. Introduction to latches Chapter 9: Binary Arithmetic

EE141-Fall 2010 Digital Integrated Circuits. Announcements. Synchronous Timing. Latch Parameters. Class Material. Homework #8 due next Tuesday

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic.

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

CHAPTER 6 COUNTERS & REGISTERS

Registers and Counters

EECS150 - Digital Design Lecture 3 - Timing

6. Sequential Logic Flip-Flops

Advanced Digital Logic Design EECS 303

Digital Logic Design ENEE x. Lecture 19

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

CS 110 Computer Architecture. Finite State Machines, Functional Units. Instructor: Sören Schwertfeger.

Momentary Changes in Outputs. State Machine Signaling. Oscillatory Behavior. Hazards/Glitches. Types of Hazards. Static Hazards

EL302 DIGITAL INTEGRATED CIRCUITS LAB #3 CMOS EDGE TRIGGERED D FLIP-FLOP. Due İLKER KALYONCU, 10043

Sequential Circuit Design: Principle

CSE140: Components and Design Techniques for Digital Systems. More D-Flip-Flops. Tajana Simunic Rosing. Sources: TSR, Katz, Boriello & Vahid

Sequencing. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall,

Measurements of metastability in MUTEX on an FPGA

Combinational vs Sequential

CPE/EE 427, CPE 527 VLSI Design I Sequential Circuits. Sequencing

Transcription:

VLSI Clock Domain Crossing Giorgos Dimitrakopoulos Electrical and Computer Engineering Democritus University of Thrace dimitrak@ee.duth.gr

Clock relationships Asynchronous Clock domains completely unrelated Plesiochronous The frequency of one clock domain is the ratio of the frequency of the other clock domain Mesochronous Same frequency Constant or slowly changing jitter

Send data across clock domains: Metastability

Time to resolve Metastability Flip-flop output transitions happens significantly later than the nominal C-Q delay. then we know that the flipflop was metastable.

Main Effect of Metastability Normal operation: Clock Clock R R1 R2 R3 Clock R R1 R2 R3 T CL R R1 R2 R3 FF1 Long Delay (FF1) may lead to failure: T CL FF2 24 2009 Ran Ginosar

Another Effect of Metastability R FF1 R1 R2 FF2 R3 FF3 R4 Clock Fork: Short and long paths Clock R R1 R2 R3 R4 T CL 25 2009 Ran Ginosar

Failure means that a flip-flop became metastable after the clock s sampling edge, and that it is still metastable S time later short window TW around the clock s sampling edge (sort of setupand- hold time ) The probability of D s having changed within the TW window, is TW/TC = TWFC (FC is the clock frequency) D may not change every cycle; if it changes at a rate FD

The Two-FF Synchronizer: PREVIEW Control synchronizer Use out after one clock cycle Metastable X settles after time S = T t SU Failure rate too high? add another FF / another cycle IN FF1 X FF2 OUT S Clock IN FF1 X FF2 FF3 OUT S 2009 Ran Ginosar

The Two-FF Synchronizer : PREVIEW Data too? Synchronize only the control line! Not the data! The synchronized control used as Load-Enable RDY FF1 data enable REG RDY FF1 data FF2 enable REG S Clock B S Clock B S = T t CL t SU S = 2T t CL 2t SU 2009 Ran Ginosar

a) Q1 could switch at the beginning of clock cycle 1 and Q2 will copy that on clock cycle 2 b) Q1 could completely miss D1. It will surely rise on cycle 2, and Q2 will rise one cycle later c) FF1 could become metastable, but its output stays low. It later resolves so that Q1 rises (the bold rising edge). This will happen before the end of the cycle. Then Q2 rises in cycle 2. d) FF1 could become metastable, its output stays low, and when it resolves, the output still stays low. This appears the same as case (b). Q1 is forced to rise in cycle 2, and Q2 rises in cycle 3. e) FF1 goes metastable, and its output goes high. Later, it resolves to low (we see a glitch on Q1). By the end of cycle 1, Q1 is low. It rises in cycle 2, and Q2 rises in cycle 3. f) FF1 goes metastable, its output goes high, and it later resolves to high. Q1 appears the same as case (a). Q2 rises in cycle 2.

R1 R2 R Once input signal stable, output Q2 will resolve in 2 or 3 cycles depending on the state of the first flip-flop

2FF Synchronizer Handshake Requests sent must be held up long enough so that the receiver manages to capture them( three edge requirement )

Control Synchronizer F V TX FSM A2 R A R2 RX FSM R3 D EDGE DETECTOR RCV clock R2 R3 D 34 2009 Ran Ginosar

-- TRANSMITTER (inputs V, A, output R) if rising_edge(tx_clock) then A2 <= A1; A1 <= A; -- 2 FFs A3 <= A2; F <= A3 xor A2; -- 1 shot case (tx_fsm_state) is when idle => if (V = '1') then tx_fsm_state <= req; R <= '1'; end if; when req => if (A2 = '1') then tx_fsm_state <= waiting; R <= '0'; end if; when waiting => if (A2 = '0') then tx_fsm_state <= idle; end if; when others => tx_fsm_state <= idle; R <= '0'; end case; end if; -- RECEIVER (input R, output A) if rising_edge(rx_clock) then R2 <= R1; R1 <= R; -- 2 FFs R3 <= R2; D <= R3 xor R2; case (rx_fsm_state) is when idle => if (R2 = '1') then rx_fsm_state <= ack; A <= '1'; end if; when ack => if (R2 = 0') then rx_fsm_state <= idle; A <= '0'; end if; when others => rx_fsm_state <= idle; A <= '0'; end case; end if; -- 1 shot 35 2009 Ran Ginosar

How much latency? Worst case RàR2 is two Rx cycles (best: ~1) One more Rx cycle for R2àACK Worst case AàA2 is two Tx cycles One Tx cycle A2àR- Three Rx cycles R- à A- (best: 2) Three Tx cycles A- à next R Total worst case: 6 Tx cycles + 6 Rx cycles Total best case: 5+5 IDLE IDLE V R2 R2 A2 A2&V REQ/R=1 A2 ACK/A=1 WAIT 36 2009 Ran Ginosar

Longer Latency (in phase mesochronous clocks) CLK-TX CLK-RX R R1 R2 A A1 A2 Data Cycle = 12 Cycles R, A1, A2 are in the CLK-TX domain, and R1, R2, A are in the CLK-RX domain 37 2009 Ran Ginosar

Short Latency (off mesochronous phase clocks) CLK-TX CLK-RX R R1 R2 A A1 A2 Data Cycle = 10 Cycles 38 2009 Ran Ginosar

Sync FIFO behavior Once you write new data the read side would need 2 RCV cycles to understand their presence plus 1 RCV cycle to read them out When the FIFO becomes full and a read takes place the send side would require 2 SND cycles to understand that there is empty space in the FIFO plus 1 SND cycle to put a new word in the FIFO Total of 3 x rcv_cycles + 3 x snd_cycles More sync stages would increase the latency If rcv_cycle can be equal to snd_cycle (frequencies can be dynamically changing) 6 FIFO slots are needed at least