graph LR subgraph P0["Partition 0"] A(("A")) B(("B")) C(("C")) end subgraph P1["Partition 1"] D(("D")) E(("E")) end A ===|"net_1 โ"| D B -..-|"net_2 โ"| D B ===|"net_3 โ"| E linkStyle 0 stroke:#4caf50,stroke-width:3px linkStyle 1 stroke:#4caf50,stroke-width:2px linkStyle 2 stroke:#4caf50,stroke-width:3px style P0 fill:#e3f2fd,color:#1565c0 style P1 fill:#fce4ec,color:#c62828 style A fill:#bbdefb,stroke:#1565c0 style B fill:#bbdefb,stroke:#1565c0 style C fill:#bbdefb,stroke:#1565c0 style D fill:#ffcdd2,stroke:#c62828 style E fill:#ffcdd2,stroke:#c62828
graph LR subgraph Cells["Standard Cells"] G1("Gate A") G2("Gate B") G3("Gate C") end subgraph Nets["Hyperedge (Net)"] direction LR N1(("โก")) end G1 --- N1 G2 --- N1 G3 --- N1 style Cells fill:#e8f5e9,color:#2e7d32 style Nets fill:#fff9c4,color:#f9a825 style G1 fill:#c8e6c9,stroke:#2e7d32 style G2 fill:#c8e6c9,stroke:#2e7d32 style G3 fill:#c8e6c9,stroke:#2e7d32 style N1 fill:#fff9c4,stroke:#f9a825,stroke-width:3px
graph TD subgraph Modules["Modules (Cells)"] M1((Mโ)) M2((Mโ)) M3((Mโ)) M4((Mโ)) end subgraph NetNodes["Nets"] N1{Nโ} N2{Nโ} N3{Nโ} end M1 --- N1 M2 --- N1 M2 --- N2 M3 --- N2 M3 --- N3 M4 --- N3 M4 --- N1 style Modules fill:#e3f2fd style NetNodes fill:#fff9c4 style M1 fill:#bbdefb,stroke:#1565c0 style M2 fill:#bbdefb,stroke:#1565c0 style M3 fill:#bbdefb,stroke:#1565c0 style M4 fill:#bbdefb,stroke:#1565c0 style N1 fill:#fff9c4,stroke:#f9a825 style N2 fill:#fff9c4,stroke:#f9a825 style N3 fill:#fff9c4,stroke:#f9a825
flowchart LR A["Initialize:\nRandom Partition"] --> B["Compute Gain\nfor All Moves"] B --> C{"Select Best\nMove (max gain)"} C -->|"Legal?"| D["Execute Move\n& Lock Module"] D --> E["Update Gains\nof Neighbors"] E --> F{"Any More\nMoves?"} F -->|"Yes"| C F -->|"No"| G["Restore Best\nSolution Found"] style A fill:#e3f2fd,stroke:#1565c0 style B fill:#bbdefb,stroke:#1565c0 style C fill:#fff9c4,stroke:#f9a825 style D fill:#e8f5e9,stroke:#2e7d32 style E fill:#f3e5f5,stroke:#7b1fa2 style F fill:#fff9c4,stroke:#f9a825 style G fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px
graph LR subgraph PartA["Partition A"] V(("v")) X(("x")) end subgraph PartB["Partition B"] Y(("y")) Z(("z")) end V ===|"FS = 2"| X V -..-|"TE = 1"| Y linkStyle 0 stroke:#4caf50,stroke-width:3px linkStyle 1 stroke:#f44336,stroke-width:2px style PartA fill:#e3f2fd style PartB fill:#fce4ec style V fill:#bbdefb,stroke:#1565c0,stroke-width:3px style X fill:#bbdefb,stroke:#1565c0 style Y fill:#ffcdd2,stroke:#c62828 style Z fill:#ffcdd2,stroke:#c62828
flowchart LR subgraph GainBucket["Gain Buckets"] G3["g = +3"] --> N2(( )) G2["g = +2"] --> N3(( )) G1["g = +1"] --> N4(( )) G0["g = 0"] --> N5(( )) GM1["g = -1"] --> N6(( )) end subgraph MaxGain["โก Max Gain Pointer"] M(("โ g = +3")) end M --> G3 style GainBucket fill:#e8f5e9 style MaxGain fill:#fff9c4,stroke:#f9a825,stroke-width:3px style G3 fill:#c8e6c9,stroke:#2e7d32 style G2 fill:#c8e6c9,stroke:#2e7d32 style G1 fill:#c8e6c9,stroke:#2e7d32 style G0 fill:#c8e6c9,stroke:#2e7d32 style GM1 fill:#ffcdd2,stroke:#c62828
flowchart LR subgraph Pass1["Pass 1"] P1A["Init Buckets"] --> P1B["Move Modules"] P1B --> P1C["Lock All"] P1C --> P1D["Record Best"] end subgraph Pass2["Pass 2"] P2A["Unlock All\nRecompute"] --> P2B["Move Modules"] P2B --> P2C["Lock All"] P2C --> P2D["Record Best"] end Pass1 --> Pass2 Pass2 --> Conv{"Improvement?"} Conv -->|"Yes"| Pass2 Conv -->|"No"| Done["โ Done"] style Pass1 fill:#e3f2fd style Pass2 fill:#e3f2fd style Done fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px style Conv fill:#fff9c4,stroke:#f9a825
flowchart LR subgraph Coarsening["Coarsening Phase"] L0["Original Graph\n(65 modules)"] --> L1["Level 1\n(30 clusters)"] L1 --> L2["Level 2\n(15 clusters)"] end subgraph Partitioning["Partitioning Phase"] L2 --> P["FM Partition\non Coarsest"] end subgraph Refinement["Refinement Phase"] P --> R1["Uncoarsen\n& Refine"] R1 --> R2["Uncoarsen\n& Refine"] R2 --> Final["Final\nPartition"] end style Coarsening fill:#e3f2fd style Partitioning fill:#fff9c4 style Refinement fill:#e8f5e9 style L0 fill:#bbdefb,stroke:#1565c0 style L1 fill:#bbdefb,stroke:#1565c0 style L2 fill:#90caf9,stroke:#1565c0 style P fill:#fff9c4,stroke:#f9a825,stroke-width:3px style R1 fill:#c8e6c9,stroke:#2e7d32 style R2 fill:#c8e6c9,stroke:#2e7d32 style Final fill:#a5d6a7,stroke:#2e7d32,stroke-width:3px
graph TD subgraph Contracted["Contracted Graph"] AB("Cluster {A,B}") CD("Cluster {C,D}") AB --- CN1{N1} AB --- CN2{N2} CD --- CN2 CD --- CN3{N3} end subgraph Original["Original Netlist"] A((A)) --- N1{N1} A --- N2{N2} B((B)) --- N1 B --- N2 C((C)) --- N2 C --- N3{N3} D((D)) --- N3 end style Original fill:#e3f2fd style Contracted fill:#e8f5e9 style A fill:#bbdefb,stroke:#1565c0 style B fill:#bbdefb,stroke:#1565c0 style C fill:#ffcdd2,stroke:#c62828 style D fill:#ffcdd2,stroke:#c62828 style AB fill:#90caf9,stroke:#1565c0,stroke-width:3px style CD fill:#ef9a9a,stroke:#c62828,stroke-width:3px
graph LR subgraph Sphere["sphere_netlist"] S2["2-pin: 467"] S3["3-pin: 84"] S4["4-pin: 66"] S1["1-pin: 1"] S13["13-pin: 2"] S26["26-pin: 3"] end style Sphere fill:#e3f2fd style S2 fill:#bbdefb style S3 fill:#90caf9 style S4 fill:#64b5f6 style S1 fill:#ffcdd2 style S13 fill:#fff9c4 style S26 fill:#fff9c4
graph LR subgraph Hopf["sphere3hopf"] H2["2-pin: 2314"] H3["3-pin: 323"] H4["4-pin: 1"] H5["5-pin: 81"] H6["6-pin: 17"] H7["7-pin: 3"] H8["8-pin: 1"] H9["9-pin: 16"] H11["11-pin: 35"] end style Hopf fill:#fce4ec style H2 fill:#ffcdd2 style H3 fill:#ef9a9a style H4 fill:#e57373 style H5 fill:#ffcdd2 style H6 fill:#ef9a9a style H7 fill:#e57373 style H8 fill:#ffcdd2 style H9 fill:#ef9a9a style H11 fill:#e57373
graph TD subgraph Tests["Test Suite โ 39 Tests"] FM["FM Partition\n19 tests"] ML["Multi-Level\n11 tests"] Yosys["Yosys JSON\n7 tests"] Other["Other\n2 tests"] end FM --> Legal("Legalize โ ") FM --> Optimize("Optimize โ ") ML --> Bi("Bi: dwarf, p1, ibm01/03/18 โ ") ML --> KWay("K-Way: dwarf โ ") Yosys --> KPIN("k-pin count โ ") Yosys --> MLBi("ML Bi: sphere, sphere3hopf โ ") Yosys --> MLKW("ML K-Way: sphere, sphere3hopf โ ") style Tests fill:#e8f5e9 style FM fill:#e3f2fd style ML fill:#fce4ec style Yosys fill:#fff9c4 style Other fill:#f3e5f5 style Legal fill:#c8e6c9 style Optimize fill:#c8e6c9 style Bi fill:#ffcdd2 style KWay fill:#ffcdd2 style KPIN fill:#fff9c4 style MLBi fill:#fff9c4 style MLKW fill:#fff9c4
graph LR subgraph Nets["Nets (Hyperedges)"] N1["Nโ\n(gap=3)"] N2["Nโ\n(gap=2) โ min"] N3["Nโ\n(gap=5)"] end subgraph Modules["Modules"] A((A)) B((B)) C((C)) end N1 --- A N2 --- A N2 --- B N3 --- B N3 --- C style Nets fill:#fff9c4 style Modules fill:#e3f2fd style N1 fill:#fff9c4,stroke:#f9a825 style N2 fill:#ffeb3b,stroke:#f57f17,stroke-width:3px style N3 fill:#fff9c4,stroke:#f9a825 style A fill:#bbdefb,stroke:#1565c0 style B fill:#bbdefb,stroke:#1565c0 style C fill:#bbdefb,stroke:#1565c0
flowchart LR A["โ Setup\n(min_maximal_matching)"] --> B["โก Construct\nBipartite Graph"] B --> C["โข Purge\nDuplicate Nets"] C --> D["โฃ Reconstruct\nClean Graph"] D --> E["โค Build\nHierNetlist"] style A fill:#e3f2fd,stroke:#1565c0 style B fill:#bbdefb,stroke:#1565c0 style C fill:#fff9c4,stroke:#f9a825 style D fill:#e8f5e9,stroke:#2e7d32 style E fill:#f3e5f5,stroke:#7b1fa2