Penn ESE535 Spring 2008 -- DeHon 1 ESE535: Electronic Design Automation Day 8: February 13, 2008 Retiming.

Slides:



Advertisements
Similar presentations
ECE 667 Synthesis and Verification of Digital Circuits
Advertisements

Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Sequential Synthesis.
Chapter 4 Retiming.
Introduction to Algorithms
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 14: March 3, 2004 Scheduling Heuristics and Approximation.
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)
MAX FLOW APPLICATIONS CS302, Spring 2013 David Kauchak.
Parallel Scheduling of Complex DAGs under Uncertainty Grzegorz Malewicz.
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
1 Maximum Flow w s v u t z 3/33/3 1/91/9 1/11/1 3/33/3 4/74/7 4/64/6 3/53/5 1/11/1 3/53/5 2/22/2 
Caltech CS184a Fall DeHon1 CS184a: Computer Architecture (Structures and Organization) Day17: November 20, 2000 Time Multiplexing.
Tirgul 12 Algorithm for Single-Source-Shortest-Paths (s-s-s-p) Problem Application of s-s-s-p for Solving a System of Difference Constraints.
Penn ESE Spring DeHon 1 ESE (ESE534): Computer Organization Day 21: April 2, 2007 Time Multiplexing.
Circuit Retiming with Interconnect Delay CUHK CSE CAD Group Meeting One Evangeline Young Aug 19, 2003.
ECE Synthesis & Verification - Lecture 2 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Circuits Scheduling.
Shortest Paths Definitions Single Source Algorithms –Bellman Ford –DAG shortest path algorithm –Dijkstra All Pairs Algorithms –Using Single Source Algorithms.
Pipelining and Retiming 1 Pipelining  Adding registers along a path  split combinational logic into multiple cycles  increase clock rate  increase.
Penn ESE Fall DeHon 1 ESE (ESE534): Computer Organization Day 19: March 26, 2007 Retime 1: Transformations.
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 7: February 11, 2008 Static Timing Analysis and Multi-Level Speedup.
Retiming. Consider the Following Circuit Suppose T XOR = 3 ns, T pcq = 1 ns, T setup = 1 ns, then this circuit can be clocked at 1 ns + (3 x 3 ns) + 1.
Shortest Paths Definitions Single Source Algorithms
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 19: April 9, 2008 Routing 1.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 5: February 2, 2009 Architecture Synthesis (Provisioning, Allocation)
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 12: March 2, 2009 Sequential Optimization (FSM Encoding)
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 8: February 11, 2009 Dataflow.
CS294-6 Reconfigurable Computing Day 16 October 15, 1998 Retiming.
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.
Penn ESE525 Spring DeHon 1 ESE535: Electronic Design Automation Day 10: February 18, 2009 Partitioning 2 (spectral, network flow)
EDA (CS286.5b) Day 19 Covering and Retiming. “Final” Like Assignment #1 –longer –more breadth –focus since assignment #2 –…but ideas are cummulative –open.
All-Pairs Shortest Paths
ECE Synthesis & Verification 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Retiming.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 15: March 18, 2009 Static Timing Analysis and Multi-Level Speedup.
03/08/2005 © J.-H. Jiang1 Retiming and Resynthesis EECS 290A – Spring 2005 UC Berkeley.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 5: February 2, 2009 Architecture Synthesis (Provisioning, Allocation)
EDA (CS286.5b) Day 18 Retiming. Today Retiming –cycle time (clock period) –C-slow –initial states –register minimization.
Operations Research Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD4207 University of Palestine.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 12: February 13, 2002 Scheduling Heuristics and Approximation.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 24: April 18, 2011 Covering and Retiming.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 10: February 18, 2015 Architecture Synthesis (Provisioning, Allocation)
Diverse Routing Algorithms
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 7: February 3, 2002 Retiming.
MAX FLOW APPLICATIONS CS302, Spring 2012 David Kauchak.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 23: April 20, 2015 Static Timing Analysis and Multi-Level Speedup.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
ELEC692 VLSI Signal Processing Architecture Lecture 3
Penn ESE534 Spring DeHon 1 ESE534: Computer Organization Day 2: January 20, 2010 Universality, Gates, Logic Work Preclass Exercise.
Pipelining and Retiming
CALTECH CS137 Spring DeHon 1 CS137: Electronic Design Automation Day 5: April 12, 2004 Covering and Retiming.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 20: April 4, 2011 Static Timing Analysis and Multi-Level Speedup.
Penn ESE370 Fall DeHon 1 ESE370: Circuit-Level Modeling, Design, and Optimization for Digital Systems Day 20: October 25, 2010 Pass Transistors.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 15: March 13, 2013 High Level Synthesis II Dataflow Graph Sharing.
Instructor Neelima Gupta Edited by Divya Gaur(39, MCS '09) Thanks to: Bhavya(9), Deepika(10), Deepika Bisht(11) (MCS '09)
Approximation Algorithms based on linear programming.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 25: April 17, 2013 Covering and Retiming.
St. Edward’s University
CS137: Electronic Design Automation
The minimum cost flow problem
Instructor: Shengyu Zhang
Analysis of Algorithms
ESE535: Electronic Design Automation
CprE / ComS 583 Reconfigurable Computing
CS184a: Computer Architecture (Structures and Organization)
ESE535: Electronic Design Automation
Algorithms (2IL15) – Lecture 7
Timing Analysis and Optimization of Sequential Circuits
Constraint satisfaction problems
Presentation transcript:

Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 8: February 13, 2008 Retiming

Penn ESE535 Spring DeHon 2 Today Retiming –Cycle time (clock period) –C-slow –Initial states –Register minimization

Penn ESE535 Spring DeHon 3 Task Move registers to: –Preserve semantics –Minimize path length between registers Maximize reuse rate –…while minimizing number of registers required

Penn ESE535 Spring DeHon 4 Example: Same Semantics Externally: no observable difference

Penn ESE535 Spring DeHon 5 Problem Given: clocked circuit Goal: minimize clock period without changing (observable) behavior I.e. minimize maximum delay between any pair of registers Freedom: move placement of internal registers

Penn ESE535 Spring DeHon 6 Other Goals Minimize number of registers in circuit Achieve target cycle time Minimize number of registers while achieving target cycle time …start talking about minimizing cycle...

Penn ESE535 Spring DeHon 7 Simple Example Path Length (L) = 4 Can we do better?

Penn ESE535 Spring DeHon 8 Legal Register Moves Retiming Lag/Lead

Penn ESE535 Spring DeHon 9 Canonical Graph Representation Separate arc for each path Weight edges by number of registers (weight nodes by delay through node)

Penn ESE535 Spring DeHon 10 Critical Path Length Critical Path: Length of longest path of zero weight nodes Compute in O(|E|) time by levelizing network: Topological sort, push path lengths forward until find register.

Penn ESE535 Spring DeHon 11 Retiming Lag/Lead Retiming: Assign a lag to every vertex weight(e) = weight(e) + lag(head(e))-lag(tail(e))

Penn ESE535 Spring DeHon 12 Valid Retiming Retiming is valid as long as: –  e in graph weight(e) = weight(e) + lag(head(e))-lag(tail(e))  0 Assuming original circuit was a valid synchronous circuit, this guarantees: –non-negative register weights on all edges no travel backward in time :-) –all cycles have strictly positive register counts –propagation delay on each vertex is non-negative (assumed 1 for today)

Penn ESE535 Spring DeHon 13 Retiming Task Move registers  assign lags to nodes –lags define all locally legal moves Preserving non-negative edge weights –(previous slide) –guarantees collection of lags remains consistent globally

Penn ESE535 Spring DeHon 14 Retiming Transformation Properties invariant to retiming 1.number of registers around a cycle 2.delay along a cycle Cycle of length P must have –at least P/c registers on it to be retimeable to cycle c –Can be computed from invariant above

Penn ESE535 Spring DeHon 15 Optimal Retiming There is a retiming of –graph G –w/ clock cycle c –iff G-1/c has no cycles with negative edge weights G-   subtract  from each edge weight

Penn ESE535 Spring DeHon 16 1/c Intuition Want to place a register every c delay units Each register adds one Each delay subtracts 1/c As long as remains more positives than negatives around all cycles –can move registers to accommodate –Captures the regs=P/c constraints

Penn ESE535 Spring DeHon 17 G-1/c

Penn ESE535 Spring DeHon 18 Compute Retiming Lag(v) = shortest path to I/O in G-1/c Compute shortest paths in O(|V||E|) –Bellman-Ford –also use to detect negative weight cycles when c too small

Penn ESE535 Spring DeHon 19 Bellman Ford For I  0 to N –u i  (except u i =0 for IO) For k  0 to N –for e i,j  E u i  min(u i, u j +w(e i,j )) For e i,j  E //still update  negative cycle if u i >u j +w(e i,j ) –cycles detected

Penn ESE535 Spring DeHon 20 Apply to Example

Penn ESE535 Spring DeHon 21 Try c=1

Penn ESE535 Spring DeHon 22 Apply: Find Lags Negative weight cycles? Shortest paths?

Penn ESE535 Spring DeHon 23 Apply: Lags

Penn ESE535 Spring DeHon 24 Apply: Move Registers weight(e) = weight(e) + lag(head(e))-lag(tail(e))

Penn ESE535 Spring DeHon 25 Apply: Retimed

Penn ESE535 Spring DeHon 26 Apply: Retimed Design

Penn ESE535 Spring DeHon 27 Revise Example (fanout delay)

Penn ESE535 Spring DeHon 28 Revised: Graph

Penn ESE535 Spring DeHon 29 Revised: Graph

Penn ESE535 Spring DeHon 30 Revised: C=1?

Penn ESE535 Spring DeHon 31 Revised: C=2?

Penn ESE535 Spring DeHon 32 Revised: Lag

Penn ESE535 Spring DeHon 33 Revised: Lag Take ceiling to convert to integer lags: 0 0

Penn ESE535 Spring DeHon 34 Revised: Apply Lag 0 0

Penn ESE535 Spring DeHon 35 Revised: Apply Lag

Penn ESE535 Spring DeHon 36 Revised: Retimed

Penn ESE535 Spring DeHon 37 Pipelining We can use this retiming to pipeline Assume we have enough (infinite supply) registers at edge of circuit Retime them into circuit

Penn ESE535 Spring DeHon 38 C>1 ==> Pipeline

Penn ESE535 Spring DeHon 39 Add Registers G n

Penn ESE535 Spring DeHon 40 Add Registers n G G-1/1

Penn ESE535 Spring DeHon 41 Pipeline Retiming: Lag

Penn ESE535 Spring DeHon 42 Pipelined Retimed

Penn ESE535 Spring DeHon 43 Real Cycle

Penn ESE535 Spring DeHon 44 Real Cycle

Penn ESE535 Spring DeHon 45 Cycle C=1?

Penn ESE535 Spring DeHon 46 Cycle C=2?

Penn ESE535 Spring DeHon 47 Cycle: C-slow Cycle=c  C-slow network has Cycle=1

Penn ESE535 Spring DeHon 48 2-slow Cycle  C=1

Penn ESE535 Spring DeHon 49 2-Slow Lags

Penn ESE535 Spring DeHon 50 2-Slow Retime

Penn ESE535 Spring DeHon 51 Retimed 2-Slow Cycle

Penn ESE535 Spring DeHon 52 C-Slow applicable? Available parallelism –solve C identical, independent problems e.g. process packets (blocks) separately e.g. independent regions in images Commutative operators –e.g. max example

Penn ESE535 Spring DeHon 53 Max Example

Penn ESE535 Spring DeHon 54 Max Example

Penn ESE535 Spring DeHon 55 Note Algorithm/examples shown –for special case of unit-delay nodes For general delay, –a bit more complicated –still polynomial

Penn ESE535 Spring DeHon 56 Initial State What about initial state? 0 1

Penn ESE535 Spring DeHon 57 Initial State 0

Penn ESE535 Spring DeHon 58 Initial State In general, constraints  satisfiable?

Penn ESE535 Spring DeHon 59 Initial State ,1? 1 0

Penn ESE535 Spring DeHon 60 Initial State 1 0 Cycle1: 1 Cycle2: /(0*/in)=1 init=0 Cycle1: 1 Cycle2: /(/init*/in)=in init=1 Cycle1: 0 Cycle2: /(/init*/in)=1 ? Cycle1: /init Cycle2: /(/init*/in)=in+init init

Penn ESE535 Spring DeHon 61 Initial State Cannot always get exactly the same initial state behavior on the retimed circuit –without additional care in the retiming transformation –sometimes have to modify structure of retiming to preserve initial behavior Only a problem for startup transient –if you’re willing to clock to get into initial state, not a limitation

Penn ESE535 Spring DeHon 62 Minimize Registers

Penn ESE535 Spring DeHon 63 Minimize Registers Number of registers:  w(e) After retime:  w(e)+  (FI(v)-FO(v))lag(v) delta only in lags So want to minimize:  (FI(v)-FO(v))lag(v) –subject to earlier constraints non-negative register weights, delays positive cycle counts

Penn ESE535 Spring DeHon 64 Minimize Registers Can be formulated as flow problem Can add cycle time constraints to flow problem Time: O(|V||E|log(|V|)log|(|V| 2 /|E|))

Penn ESE535 Spring DeHon 65 Summary Can move registers to minimize cycle time Formulate as a lag assignment to every node Optimally solve cycle time in O(|V||E|) time Also –Compute multithreaded computations –Minimize registers Watch out for initial values

Penn ESE535 Spring DeHon 66 Admin Homework #2 due Monday Reading for Monday on web

Penn ESE535 Spring DeHon 67 Big Ideas Exploit freedom Formulate transformations (lag assignment) Express legality constraints Technique: –graph algorithms –network flow