Clock Skewing EECS 290A Sequential Logic Synthesis and Verification.

Slides:



Advertisements
Similar presentations
Bellman-Ford algorithm
Advertisements

Single Source Shortest Paths
ECE 667 Synthesis and Verification of Digital Circuits
§3 Shortest Path Algorithms Given a digraph G = ( V, E ), and a cost function c( e ) for e  E( G ). The length of a path P from source to destination.
Weighted graphs Example Consider the following graph, where nodes represent cities, and edges show if there is a direct flight between each pair of cities.
* Bellman-Ford: single-source shortest distance * O(VE) for graphs with negative edges * Detects negative weight cycles * Floyd-Warshall: All pairs shortest.
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Sequential Synthesis.
CSC 2300 Data Structures & Algorithms April 13, 2007 Chapter 9. Graph Algorithms.
October 31, Algorithms and Data Structures Lecture XIII Simonas Šaltenis Nykredit Center for Database Research Aalborg University
CS138A Single Source Shortest Paths Peter Schröder.
CSE 101- Winter ‘15 Discussion Section January 26th 2015.
Sequential Timing Optimization. Long path timing constraints Data must not reach destination FF too late s i + d(i,j) + T setup  s j + P s i s j d(i,j)
FUNDAMENTAL PROBLEMS AND ALGORITHMS Graph Theory and Combinational © Giovanni De Micheli Stanford University.
CSE 780 Algorithms Advanced Algorithms Shortest path Shortest path tree Relaxation Bellman-Ford Alg.
Combining Technology Mapping and Retiming EECS 290A Sequential Logic Synthesis and Verification.
ECE Synthesis & Verification - Lecture 2 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Circuits Scheduling.
Jim Anderson Comp 122, Fall 2003 Single-source SPs - 1 Chapter 24: Single-Source Shortest Paths Given: A single source vertex in a weighted, directed graph.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lectures 3 Tuesday, 9/25/01 Graph Algorithms: Part 1 Shortest.
Shortest Path Problems
Shortest Paths Definitions Single Source Algorithms –Bellman Ford –DAG shortest path algorithm –Dijkstra All Pairs Algorithms –Using Single Source Algorithms.
1.1 Data Structure and Algorithm Lecture 11 Application of BFS  Shortest Path Topics Reference: Introduction to Algorithm by Cormen Chapter 25: Single-Source.
Pipelining and Retiming 1 Pipelining  Adding registers along a path  split combinational logic into multiple cycles  increase clock rate  increase.
1 8-ShortestPaths Shortest Paths in a Graph Fundamental Algorithms.
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 15 Shortest paths algorithms Properties of shortest paths Bellman-Ford algorithm.
EE290A 1 Retiming of AND- INVERTER graphs with latches Juliet Holwill 290A Project 10 May 2005.
Graph Algorithms: Shortest Path We are given a weighted, directed graph G = (V, E), with weight function w: E R mapping.
Continuous Retiming EECS 290A Sequential Logic Synthesis and Verification.
Shortest Paths Definitions Single Source Algorithms
1 Graph Algorithms Single source shortest paths problem Dana Shapira.
Tirgul 13. Unweighted Graphs Wishful Thinking – you decide to go to work on your sun-tan in ‘ Hatzuk ’ beach in Tel-Aviv. Therefore, you take your swimming.
Processing Rate Optimization by Sequential System Floorplanning Jia Wang 1, Ping-Chih Wu 2, and Hai Zhou 1 1 Electrical Engineering & Computer Science.
All-Pairs Shortest Paths
ECE Synthesis & Verification 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Retiming.
1 Shortest Path Calculations in Graphs Prof. S. M. Lee Department of Computer Science.
Graphs – Shortest Path (Weighted Graph) ORD DFW SFO LAX
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms Shortest-Path.
Jim Anderson Comp 122, Fall 2003 Single-source SPs - 1 Chapter 24: Single-Source Shortest Paths Given: A single source vertex in a weighted, directed graph.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
Algorithms: Design and Analysis Summer School 2013 at VIASM: Random Structures and Algorithms Lecture 3: Greedy algorithms Phan Th ị Hà D ươ ng 1.
Algorithm Course Dr. Aref Rashad February Algorithms Course..... Dr. Aref Rashad Part: 6 Shortest Path Algorithms.
05/04/06 1 Integrating Logic Synthesis, Tech mapping and Retiming Presented by Atchuthan Perinkulam Based on the above paper by A. Mishchenko et al, UCAL.
Combinational and Sequential Mapping with Priority Cuts Alan Mishchenko Sungmin Cho Satrajit Chatterjee Robert Brayton UC Berkeley.
Chapter 24: Single-Source Shortest Paths Given: A single source vertex in a weighted, directed graph. Want to compute a shortest path for each possible.
Lecture 16. Shortest Path Algorithms
Shortest Path Problems Dijkstra’s Algorithm. Introduction Many problems can be modeled using graphs with weights assigned to their edges: Airline flight.
The single-source shortest path problem (SSSP) input: a graph G = (V, E) with edge weights, and a specific source node s. goal: find a minimum weight (shortest)
CSE 2331 / 5331 Topic 12: Shortest Path Basics Dijkstra Algorithm Relaxation Bellman-Ford Alg.
ELEC692 VLSI Signal Processing Architecture Lecture 3
Pipelining and Retiming
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 13: Graphs Data Abstraction & Problem Solving with C++
Static Timing Analysis
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Retiming EECS 290A Sequential Logic Synthesis and Verification.
Data Structure Lecture 10 Thursday, 28 Aug 2005.
Single-Source Shortest Path
James D. Z. Ma Department of Electrical and Computer Engineering
Algorithms and Data Structures Lecture XIII
SAT-Based Optimization with Don’t-Cares Revisited
Lecture 11 Topics Application of BFS Shortest Path
Algorithms and Data Structures Lecture XIII
Lecture 13 Algorithm Analysis
Lecture 13 Algorithm Analysis
Integrating Logic Synthesis, Technology Mapping, and Retiming
Minimum Spanning Tree Algorithms
Lecture 13 Algorithm Analysis
Shortest Paths.
Graph Algorithms: Shortest Path
Timing Analysis and Optimization of Sequential Circuits
Presentation transcript:

Clock Skewing EECS 290A Sequential Logic Synthesis and Verification

Outline  Motivation  Graphs  Algorithms for the shortest path computation Dijkstra and Bellman-Ford Dijkstra and Bellman-Ford  Optimum cycle ratio computation Howard algorithm Howard algorithm  ASAP and ALAP skews  Clock skew as the shortest path  Retiming as discrete clock skewing

Motivation  When combinational optimization cannot help, sequential optimization holds some promise  Sequential optimization changes one or more of the following the clock cycle (clock skewing) the clock cycle (clock skewing) the number and positions of memory elements (retiming) the number and positions of memory elements (retiming) combinational logic (retiming and resynthesis) combinational logic (retiming and resynthesis)  Clock skewing is an “easy” way of reducing the clock period without moving latches Moving latches, if done on a mapped and placed netlist, may destroy placement, etc Moving latches, if done on a mapped and placed netlist, may destroy placement, etc

Directed Graphs  Graph is set of vertices and edges G = (V,E)  Each edge is directed (has a source and a sink)  A path is the sequence of vertices connected by edges  A cycle is the circular path  Graph is strongly connected if there exist a path from any vertex to any other vertex.  For the general formulation of the graph problems, each edge e has distance, d(e), and a latency, t(e)  In this lecture Graph is the “latch dependency graph” Graph is the “latch dependency graph” Vertices are latchesVertices are latches Edges are combinational paths between the latchesEdges are combinational paths between the latches Distance of an edge is its combinational delay Distance of an edge is its combinational delay Latency of an edge is 1 Latency of an edge is 1

Graph Problems  Optimum cycle ratio Given d(e) and t(e) for each edge e, for each cycle C in G we define a cycle ratio: Given d(e) and t(e) for each edge e, for each cycle C in G we define a cycle ratio:  (C) = D(C)/T(C), where D(C) =  ei  C d(e i ), T(C) =  ei  C t(e i )  (C) = D(C)/T(C), where D(C) =  ei  C d(e i ), T(C) =  ei  C t(e i ) The problem is to determine the min(max) ratio  * over all cycles C in G The problem is to determine the min(max) ratio  * over all cycles C in G  Shortest path Given d(e) for each edge e, and a source vertex s, determine the shortest path from s to any other vertex in G Given d(e) for each edge e, and a source vertex s, determine the shortest path from s to any other vertex in G

Shortest Path: Preliminaries  Start-shortest-path (G,s) For each vertex v  G For each vertex v  G w(v) = w(v) =  p(v) = NULLp(v) = NULL w(s) = 0 w(s) = 0 w(v) is the shortest path from vertex s to vertex v w(v) is the shortest path from vertex s to vertex v p(v) is the predecessor function, which gives for each node v, the previous node on the shortest path from s p(v) is the predecessor function, which gives for each node v, the previous node on the shortest path from s  Relax/tighten ( u, v, d() ) if ( w(v) > w(u) + d(u,v) ) w(v) = w(u) + d(u,v) p(v) = u u s v w(u)=3 w(v)=6 w(v)=4 w(v) > w(u) + w(u,v) 6 > w(v) = 4

Shortest Path: Dijkstra Algorithm  Start-shortest-path(G,s)  S= , Q w = V(G)  while ( Q w   ) U = Extract-Min( Q w ) U = Extract-Min( Q w ) S = S  {u} S = S  {u} for each vertex v, which is a successor of u for each vertex v, which is a successor of u Relax( u, v, d() )Relax( u, v, d() ) Update ordering in Q wUpdate ordering in Q w Q is a priority queue storing vertices by their distance S is the set of vertices, whose shortest path from s has already been found

Example T. H. Cormen, C. E. Leiserson, R. L. Rivest, Introduction to algorithms, New York: McGraw-Hill, 1990.

Shortest Path: Bellman-Ford  The limitation of Dijkstra is that it only works for positive distances w(u,v)  Bellman-Ford overcomes this limitation and can detect a negative cycle  Start-shortest-path(G,s)  for i = 1 to i < |V(G)| for each edge (u,v)  E(G) for each edge (u,v)  E(G) relax( u, v, d() )relax( u, v, d() )  for each edge (u,v)  E(G) if w(v) > w(u) + d(u,v) if w(v) > w(u) + d(u,v) return FALSEreturn FALSE  return TRUE

Example

Efficient Implementation of Bellman-Ford  If w(u) is not tightened in the current iteration, u cannot affect the distances of its successors in the next iteration  Start-shortest-path(G,s)  Q = {s} /* Q is a FIFO queue */  while ( Q   ) u = Extract from Q u = Extract from Q for each edge (u,v)  E(G) for each edge (u,v)  E(G) relax( u, v, d() )relax( u, v, d() ) if ( distance of v has changed )if ( distance of v has changed ) Insert v into Q Insert v into Q  Check for negative cycle

Optimum Cycle Ratio  Determine the min(max) ratio  * over all cycles C in G  Applications:  Problem 1: Find the loop, which has the largest combinational delay per one memory element The circuit cannot be clocked faster than this delay The circuit cannot be clocked faster than this delay  Problem 2: Find the loop, which has the smallest combinational delay per one memory element If the circuit is implemented with transparent latches, this delay should satisfy some constraints If the circuit is implemented with transparent latches, this delay should satisfy some constraints

Latch-to-Latch Max Delay  Native method: Cut at the latch boundary Cut at the latch boundary For each pair (i, j) of latches For each pair (i, j) of latches Set arrival times of latch i to 0, the rest of latches to - Set arrival times of latch i to 0, the rest of latches to -  Perform DFS from latch j to find its combinational delayPerform DFS from latch j to find its combinational delay  Better method: Cut at the latch boundary Cut at the latch boundary For each latch i For each latch i Set arrival times of latch i to 0, the rest of latches to - Set arrival times of latch i to 0, the rest of latches to -  Move through the TFO cone of latch i in the topological order and propagate the arrival times through the fanoutsMove through the TFO cone of latch i in the topological order and propagate the arrival times through the fanouts Collect the latches j such that their arrival times is more than - Collect the latches j such that their arrival times is more than - 

Cycle Ratio Algorithms A. Dasdan, “Experimental analysis of the fastest optimum cycle ratio and mean algorithms”, ACM TODAES, vol. 9(4), pp , 2004

Overview of Howard’s Algorithm  This is a Bellman-Ford algorithm with a cycle detection subroutine, which gradually tightens the lower bound on the Max Cycle Ratio (MCR)  Exponential in the worst case but efficient in practice  Heuristics are used for faster convergence Find a good starting cycle ratio Find a good starting cycle ratio Detect only relevant changes Detect only relevant changes  Preprocessing the graph Remove non-cyclic branches Remove non-cyclic branches Decompose into strongly commented components Decompose into strongly commented components

Notation for Howard’s Algorithm  u, v are vertices, which represent latches  w(u,v) is the distance between u and v, which represents the combinational delay Defined for adjacent vertices only Defined for adjacent vertices only  d(u) is the longest distance from u to any vertex v  p(u) is the successor function For each node u returns the node v such that the distance between u and v is the longest (equal to d(u)) For each node u returns the node v such that the distance between u and v is the longest (equal to d(u))  r is the current best maximum ratio for any loop Initialized to a longest self-loop and refined to r’ in procedure FindRatio() Initialized to a longest self-loop and refined to r’ in procedure FindRatio()

MCR: Find Ratio Initialization Searching for a new cycle Determining a new ratio Trying to find a longer loop Updating the ratio

Howard’s Algorithm Initialization Trying to find longer loops Heuristic to speed up convergence Constraint propagation

Clock Skew  Zero-skew Clock arrives at all latches at the same time Clock arrives at all latches at the same time  Non-trivial skew Each latch has a skew (a phase of the clock signal at this latch) Each latch has a skew (a phase of the clock signal at this latch)  ASAP (“as soon as possible”) and ALAP (“as late as possible”) skews at a latch define a timing window (sequential slack), which the clock at the latch should satisfy for the design to meet the timing constraints The sequential slacks at different latches are not independent The sequential slacks at different latches are not independent  Clock skew optimization is a fundamental problem, tightly related to retiming and other sequential transformations Skewing changes the skews of the latches, retiming moves the latches according to the allowed skews Skewing changes the skews of the latches, retiming moves the latches according to the allowed skews

Example PI PO Clock period = 3 Buffer delay = 1 Initial ALAP ASAP ALAP skew = -1 ASAP skew = -3 PI PO PI PO skew = 0 skew = -1 skew = -3

ASAP and ALAP Skew Computation  Given a clock period r, set the weight of an edge (u,v) to be w’(u,v) = w(u,v) - r  Connect the latches depending on PIs to the source vertex s  Connect the latches, which produce POs to the sink vertex t  Run Bellman-Form to find the shortest path from s to u This is the ASAP skew of latch u This is the ASAP skew of latch u  Run Bellman-Form to find the shortest reverse path from t to u This is the ALAP skew of latch u This is the ALAP skew of latch u t s u