graph TD A[Clock Source] --> B[Clock Tree] B --> C[FF1] B --> D[FF2] B --> E[FF3] B --> F[FFn] style A fill:#fff3e0,stroke:#e65100,color:#2e3440,stroke-width:3px style B fill:#e3f2fd,stroke:#1565c0,color:#2e3440,stroke-width:3px style C fill:#c8e6c9,stroke:#2e7d32,color:#2e3440,stroke-width:3px style D fill:#c8e6c9,stroke:#2e7d32,color:#2e3440,stroke-width:3px style E fill:#c8e6c9,stroke:#2e7d32,color:#2e3440,stroke-width:3px style F fill:#c8e6c9,stroke:#2e7d32,color:#2e3440,stroke-width:3px
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:#fff3e0,stroke:#e65100,color:#2e3440,stroke-width:3px style B fill:#e3f2fd,stroke:#1565c0,color:#2e3440,stroke-width:3px style C fill:#c8e6c9,stroke:#2e7d32,color:#2e3440,stroke-width:3px
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:#fff3e0,stroke:#e65100,color:#2e3440,stroke-width:3px style B fill:#ffcdd2,stroke:#c62828,color:#2e3440,stroke-width:3px style D fill:#ffcdd2,stroke:#c62828,color:#2e3440,stroke-width:3px style G fill:#ffcdd2,stroke:#c62828,color:#2e3440,stroke-width:3px style H fill:#c8e6c9,stroke:#2e7d32,color:#2e3440,stroke-width:3px
graph LR DME[DMEAlgorithm] -->|uses| DC[DelayCalculator] DC -->|implements| Linear[LinearDelayCalculator] DC -->|implements| Elmore[ElmoreDelayCalculator] style DME fill:#fff3e0,stroke:#e65100,color:#2e3440,stroke-width:3px style DC fill:#e3f2fd,stroke:#1565c0,color:#2e3440,stroke-width:3px style Linear fill:#c8e6c9,stroke:#2e7d32,color:#2e3440,stroke-width:3px style Elmore fill:#c8e6c9,stroke:#2e7d32,color:#2e3440,stroke-width:3px
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