1 / 65

CS137: Electronic Design Automation

CS137: Electronic Design Automation. Day 18: March 13, 2002 Retiming. Today. Retiming cycle time (clock period) C-slow initial states register minimization Necessary delays (time permitting). Task. Move registers to: Preserve semantics Minimize path length between registers

mkellerman
Download Presentation

CS137: Electronic Design Automation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS137:Electronic Design Automation Day 18: March 13, 2002 Retiming

  2. Today • Retiming • cycle time (clock period) • C-slow • initial states • register minimization • Necessary delays (time permitting)

  3. Task • Move registers to: • Preserve semantics • Minimize path length between registers • (make path length 1 for maximum throughput or reuse) • Maximize reuse rate • …while minimizing number of registers required

  4. 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

  5. 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...

  6. Simple Example Path Length (L) = 4 Can we do better?

  7. Legal Register Moves • Retiming Lag/Lead

  8. Canonical Graph Representation Separate arc for each path Weight edges by number of registers (weight nodes by delay through node)

  9. 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.

  10. Retiming Lag/Lead Retiming: Assign a lag to every vertex weight(e) = weight(e) + lag(head(e))-lag(tail(e))

  11. 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)

  12. 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

  13. Retiming Transformation • N.B.: unchanged by retiming • number of registers around a cycle • delay along a cycle • Cycle of length P must have • at least P/c registers on it • to be retimeable to cycle c

  14. 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 a from each edge weight

  15. 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

  16. G-1/c

  17. 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

  18. Bellman Ford • For I0 to N • ui  (except ui=0 for IO) • For k0 to N • for ei,jE • ui min(ui ,uj+w(ei,j)) • For ei,jE //still updatenegative cycle • if ui >uj+w(ei,j) • cycles detected

  19. Apply to Example

  20. Try c=1

  21. Apply: Find Lags Negative weight cycles? Shortest paths?

  22. Apply: Lags

  23. Apply: Move Registers 1 1 1 1 1 weight(e) = weight(e) + lag(head(e))-lag(tail(e))

  24. Apply: Retimed

  25. Apply: Retimed Design

  26. Revise Example (fanout delay)

  27. Revised: Graph

  28. Revised: Graph

  29. Revised: C=1?

  30. Revised: C=2?

  31. Revised: Lag

  32. 0 -1 0 Revised: Lag Take ceiling to convert to integer lags:

  33. 0 -1 0 Revised: Apply Lag -1

  34. 0 -1 0 Revised: Apply Lag -1 1 1 0 1 1 0 0 1 0 1 1 1 0

  35. Revised: Retimed 1 1 0 1 1 0 1 0 0 1 0 1 1

  36. Pipelining • We can use this retiming to pipeline • Assume we have enough (infinite supply) registers at edge of circuit • Retime them into circuit

  37. C>1 ==> Pipeline

  38. Add Registers

  39. Pipeline Retiming: Lag

  40. Pipelined Retimed

  41. Real Cycle

  42. Real Cycle

  43. Cycle C=1?

  44. Cycle C=2?

  45. Cycle: C-slow Cycle=c  C-slow network has Cycle=1

  46. 2-slow Cycle  C=1

  47. 2-Slow Lags

  48. 2-Slow Retime

  49. Retimed 2-Slow Cycle

  50. 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

More Related