graph TD A[Clock Source] --> B[Clock Tree] B --> C[FF1] B --> D[FF2] B --> E[FF3] B --> F[FFn] style A fill:#ff9800 style B fill:#2196f3 style C fill:#4caf50 style D fill:#4caf50 style E fill:#4caf50 style F fill:#4caf50
flowchart LR A["Phase 1:\n Bottom-Up"] --> B["Phase 2: Top-Down"] B --> C["prescribed-skew \n (not necessarily zero) Clock Tree"] style A fill:#ff9800 style B fill:#2196f3 style C fill:#4caf50
flowchart LR A[Calculate tapping point] --> B{extend_left < 0?} B -->|Yes| C["Right branch too short\n Set extend_left = 0"] B -->|No| D{extend_left > distance?} D -->|Yes| E["Left branch too short\n Set extend_left = distance"] D -->|No| F["Normal case\n Use calculated value"] C --> G[Mark node.need_elongation = True] E --> G F --> H[Assign wire lengths normally] style A fill:#ff9800 style G fill:#f44336 style H fill:#4caf50
graph LR DME[DMEAlgorithm] -->|uses| DC[DelayCalculator] DC -->|implements| Linear[LinearDelayCalculator] DC -->|implements| Elmore[ElmoreDelayCalculator] style DME fill:#ff9800 style DC fill:#2196f3 style Linear fill:#4caf50 style Elmore fill:#4caf50
classDiagram class DelayCalculator { <> +calculate_wire_delay(length, load_cap) +calculate_wire_delay_per_unit(load_cap) +calculate_wire_cap(length) +calculate_tapping_point(node_left, node_right, distance) } class LinearDelayCalculator { +delay_per_unit +cap_per_unit } class ElmoreDelayCalculator { +unit_res +unit_cap } DelayCalculator <|-- LinearDelayCalculator DelayCalculator <|-- ElmoreDelayCalculator