Tasks/Chips & Compute Systems/Chip Design Automation

Optimize logic gate sizing under timing and design-rule penalties

Pick a library cell per instance to cut power under timing limits

gate_sizing Chips & Compute Systems Chip Design Automation
Background

A chip is built from millions of tiny logic gates, and the same gate comes in several sizes that do the identical job. A bigger one switches faster, but burns more power and is heavier for the gate feeding it to push. Picking a size for every gate, so that no signal arrives late and as little power as possible is wasted, is called gate sizing.

It is one of the last steps in chip design before a layout goes to a factory. It is hard because the right size differs from gate to gate and the gates pull on each other: enlarging one slows the gate in front of it, and the timing you start from describes the chip before you touched it.

instruction.mdthis is what the agent is given

Given a placed netlist described by CircuitOps IR tables, assign a library cell to every instance so as to minimize one score charging timing (TNS) and design-rule (slew / capacitance) violations, plus the leakage you spend clearing them. Your submission is re-run on sealed hidden cases; lower is better.

/app/methods/main/ ships a working but crude reference implementation. It is there to define the zero point and to show the plumbing, not to be the starting shape of your answer. You may delete all of it and design your method from scratch. The only fixed parts of a submission are the solve(...) contract and the .size output format below. What your method looks at, what it decides per instance, and how it searches are entirely yours to choose.

Hard Constraints

  • Submit an algorithm (solve), not precomputed answers. Do not key on case names.
  • Keep the exact signature solve(input_dir: str, output_path: str) -> None: read one case from input_dir, write a valid .size file to output_path.
  • Sequential cells and macros keep their original library cell. Only combinational cells may be resized.
  • A combinational cell may only move to a cell with the same func_id (logically equivalent, different drive strength or threshold), read from libcell_properties.csv.bz2.
  • List every instance exactly once, with no unknown instance or library-cell names. An illegal sizing scores nothing.
  • solve must be deterministic and case-name-independent.

What You Have

  • Visible cases at /app/data/<case>/ for each case in /app/data/manifest.json, each with IR_Tables/ (cell_properties, libcell_properties, pin_properties, net_properties and the graph edge tables, all *.csv.bz2) and design/ (compressed .v/.def/.sdc). The shared library is at /app/data/platform/ASAP7. Hidden cases are different designs, same format.
  • /app/methods/main/this directory is what gets graded. The shipped solver.py handles the contract and the .size format and applies a uniform strongest-drive upsize. Its score is the zero point: matching it earns nothing, and scoring worse earns nothing either. Rewrite it, throw it away and start over, or add any helper Python next to it (python3, numpy, pandas, scikit-learn available).
  • Your self-check surface (free, unlimited): python /app/selfcheck.py runs your current solver.py on the visible cases through the same legality gate and the same OpenROAD score the sealed grader uses, and prints the breakdown into 10*|TNS|, 20*slew, 20*cap and leakage. A case name limits it to that case (python /app/selfcheck.py <case>); the scoring pass takes minutes on the large cases.

What You Submit

/app/methods/main/solver.py must expose this exact signature. It and the .size format below are the only parts of a submission that are fixed:

def solve(input_dir: str, output_path: str) -> None:
    ...

The .size output is one line per instance:

<instance name> <library cell name>

There is no submit step and no per-attempt feedback. Work and self-check for as long as your run window allows, then leave your best solver.py in place; it is graded once at the end.

How It Is Judged

The grader copies methods/main/ into a clean sandbox, runs solve(...) on each hidden case, checks legality, then evaluates the sizing with a timing engine. The per-case score is

score = leakage_delta_uW + 10*|TNS_ns| + 20*slew_violation + 20*cap_violation

leakage_delta_uW is your leakage minus the original netlist's, so leaving a cell alone costs nothing. TNS is total negative slack; slew and cap are the summed amounts by which pins exceed their transition-time and load-capacitance limits. Each penalty term switches off entirely once its violation reaches zero, so driving a category to exactly 0 is worth more than driving it low. Scoring is per case against that case's own reference points, then averaged, so a case you ignore cannot be carried by one you optimize. Lower is better. Your solver's wall-clock time is not scored, though it is capped.

Metric

mean OpenROAD score over the sealed designs · lower is better

leakage_delta_uW + 10*|TNS_ns| + 20*slew_viol + 20*cap_viol, per hidden design

anchorvisible setheld-outreward
Bshipped template (uniform max-drive)8,293.4020,244.420.00
Shuman expert solution286.76919.260.60
Utheoretical bound (no violations)001.00
normalisation
m >= B0
B > m >= S0.6 * (u(B) - u(m)) / (u(B) - u(S))
m < S0.6 + 0.4 * (u(S) - u(m)) / (u(S) - u(U))

m = this run's held-out metric  ·  B = shipped template (uniform max-drive)  ·  S = human expert solution  ·  U = theoretical bound (no violations)

u(x) = log(x + 10). Each case maps against its own anchors, clamped to [0, 1]; the two case rewards are then averaged.

Rollouts

244 minwall clock
-spend
-tokens
21versions, 16 kept
250 500 750 1,000 1,250 0 50 100 150 200 agent step (this harness reports no tokens or timestamps) case1 self-check score, lower is better human expert solution · visible · 286.76 v0 v1 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20
keptrevertedno scoreturning point
  1. v0Inherited baseline: same-func_id min-FO4 cell for every combinational cell229.164
  2. v1Slack and electrical-effort sizer; 1016 hold buffers turned into BUFx24legalization hung
  3. v2NLDM min-delay pick, original cell kept where slack exceeds 80 ps1,259.95
  4. v3Min-FO4 floor plus NLDM boost, no driver model727.664
  5. v4Driver-aware boost on top of the min-FO4 floor, never weaker than min-FO4Grow a cell only when its NLDM delay win beats the extra delay it adds to its own driver.181.995
  6. v5STA slack refresh, area cap 2.6, delay epsilon 0.99 admits NAND2x2187.092
  7. v6Leakage recovery: revert FO4-floor cells with over 120 ps slack180.959
  8. v7Second slew-repair growth pass after assignment180.959
  9. v8Recovery tightened to 200 ps; slew checks use a 1.45 load margin181.109
  10. v9Slew margin widened on high-fanout and originally violating nets181.224
  11. v10Leakage recovery dropped; it broke case2 cap under the min-FO4 floor180.748
  12. v11Cap legalize: shrink the sinks of any driver over its maxcap180.748
  13. v12Load margin folded into cap_ok; over-cap combo drivers upsized firstcase1 not re-scored
  14. v13Cap legalize on every overloaded driver output, positive-slack sinks firstCase2's cap violations sit on flop outputs; the driver is frozen, so shrink its load instead.180.414
  15. v14Slew repair and cap legalization alternated so neither pass breaks the other180.414
  16. v15Sinks of combinational drivers left alone; only frozen drivers get relief180.414
  17. v16Cap loop exits on raw maxcap instead of the margin-inflated load180.414
  18. v17Adaptive flop gate: shrink sinks only when 80+ flops sit at 1.25x maxcapLet the design choose: shrink flop sinks only where many frozen drivers are badly overloaded.180.414
  19. v18Docstring and comment cleanup; sizing behaviour identical to v17180.414
  20. v19Load margin removed from cap_okcase1 not re-scored
  21. v20No combo upsizing in the cap pass; case3 assignment back to v10180.748

Tuned on case1, confirmed on case3, case2 held out. case1 stalled at 180.4 from v13; later versions traded case2 cap against case3 TNS.

On the hidden set

held-out metricreward
shipped template (uniform max-drive)20,244.420.00
human expert solution919.260.60
theoretical bound (no violations)01.00
this run8,083.330.2224
119 minwall clock
$57.92spend
102.0Mtokens
42versions, 12 kept
0 300 600 900 1,200 1,500 $0 $10 $20 $30 $40 cumulative spend on the run case1 self-check score, lower is better human expert solution · visible · 286.76 v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 v25 v26 v27 v28 v29 v30 v31 v32 v33 v34 v35 v36 v37 v38 v39 v40 v41
keptrevertedno scoreturning point
  1. v0Shipped baseline: uniform minimum-FO4 cell per equivalence class229.1644 min · $0.97
  2. v1Uniform minimum fixed-load-delay cell1,549.578 min · $1.95
  3. v2Per-net load targets from original slack and DRV, six rounds of cap feedbackSize each net to a load target set by its own slack, instead of one library cell per function.186.21914 min · $3.20
  4. v3Tighter target effort, area ratio 1.482199.50914 min · $3.44
  5. v4Relaxed target effort, area ratio 1.222191.59415 min · $3.88
  6. v5Effort interpolated between v2 and the relaxed v4188.97816 min · $4.50
  7. v6Leave intentional HB* hold-delay buffers alone on setup-critical paths150.42518 min · $5.29
  8. v7Drop fractional INVxp33/xp67 drives from critical inverter choices147.22520 min · $5.74
  9. v8Drop xp33 variants from every critical class that has alternatives142.420 min · $6.09
  10. v9Also drop xp5 variants on critical paths155.55921 min · $6.47
  11. v10Restore sinks of fragile fixed-driver nets to their original cells185.31326 min · $8.21
  12. v11Fixed-driver sink restoration limited to broad-slack designscase2 only28 min · $9.04
  13. v12Also disable fast-cell exclusions in broad-slack modecase2 only30 min · $9.60
  14. v13Restore only sinks with predicted cap/slew ratio above 0.90case2 only30 min · $10.02
  15. v14Rank drive by the xN/xNpM suffix, separating output drive from input cap135.69232 min · $10.82
  16. v15Suffix drive ranking carried into the broad-slack regimecase2 only34 min · $11.48
  17. v16Gate exclusions and suffix ranking on a critical fraction above 0.60Let the design pick the policy: one regime for timing-starved designs, another for broad-slack ones.135.69235 min · $12.34
  18. v17Broad-slack stage effort relaxed from 4.5 to 5.5135.69237 min · $13.12
  19. v18Broad-slack stage effort 6.5case2 only38 min · $13.65
  20. v19Broad-slack criticality weight lowered from 0.75 to 0.40135.69240 min · $14.45
  21. v20Continuous input-cap pressure on sinks of stressed fixed-driver nets135.69242 min · $15.37
  22. v21Drop xp67 NAND2/NOR2 variants in suffix-drive mode134.95843 min · $16.11
  23. v22Merge of the v17 broad-slack effort and the v21 critical filter134.95845 min · $17.20
  24. v23Broad-slack base effort 5.7case2 only46 min · $17.87
  25. v24Broad-slack base effort 5.3case2 only47 min · $18.54
  26. v25Effort 5.5, weight 0.40, fixed-driver pressure and the v21 filter combinedcase2 only48 min · $19.39
  27. v26Broad-slack criticality weight 0.20case2 only50 min · $20.07
  28. v27Broad-slack criticality weight 0.00case2 only50 min · $20.59
  29. v28Fixed-driver pressure coefficient raised from 0.35 to 0.50case2 only53 min · $22.22
  30. v29Fixed-driver pressure coefficient lowered to 0.20case2 only54 min · $22.84
  31. v30Broad-slack criticality weight 0.50; case3 audit 31,462 against baseline 14,300134.95857 min · $24.66
  32. v31Mild arrival/period term to strengthen late critical stages136.3264 min · $29.58
  33. v32Broad-slack criticality weight 0.55case2 only66 min · $30.93
  34. v33Broad-slack criticality weight 0.60case2 only67 min · $31.65
  35. v34Third regime at fixed_fraction >= 0.10: cap-based ranking, base effort 5.5A design whose drivers are mostly fixed or macros cannot be sized; rank its cells by input cap, not by drive.134.95880 min · $39.77
  36. v35Fixed-heavy base effort 6.5case3 only81 min · $40.69
  37. v36Fixed-heavy base effort 7.5case3 only82 min · $41.38
  38. v37Fixed-heavy base effort 9.0case3 only84 min · $43.04
  39. v38Fixed-driver pressure added inside the fixed-heavy regime134.95885 min · $43.90
  40. v39Shipped FO4 as fixed-heavy anchor, v34 kept only above 0.50 output stresscase3 only91 min · $46.60
  41. v40Baseline-anchor stress threshold raised to 0.70no score attributed91 min · $46.97
  42. v41Baseline-anchor stress threshold lowered to 0.30case3 only92 min · $47.34

$47 over 92 min. v30 led both visible cases then failed the case3 holdout, forcing v34's fixed-heavy regime.

On the hidden set

held-out metricreward
shipped template (uniform max-drive)20,244.420.00
human expert solution919.260.60
theoretical bound (no violations)01.00
this run13,882.430.1549
99 minwall clock
$25.64spend
41.3Mtokens
22versions, 10 kept
175 200 225 250 275 $0 $7.5 $15 $22 cumulative spend on the run case1 self-check score, lower is better human expert solution · visible · 286.76 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22
keptrevertedno scoreturning point
  1. v1Inherited template: strongest-drive cell per func_id, ranked by fo4_delay229.1641 min · $0.31
  2. v2Uniform minimum fix_load_delay cell per func_iddid not finish7 min · $1.10
  3. v3Min fixed-load-delay only on output nets above 10 fF229.2659 min · $1.40
  4. v4Keep original cells on paths with over 100 ps positive slack233.97910 min · $1.53
  5. v5Restrict those keeps to pins under 80% of the transition limit229.28111 min · $1.69
  6. v6Pareto rule: within 1% of min FO4, take the lowest input capacitanceAsk which cell is fast enough while loading its own driver least, not which is fastest.201.11612 min · $2.01
  7. v7Widen the Pareto FO4 tolerance from 1% to 2%203.52813 min · $2.17
  8. v8Load-aware inverter sizing by output capacitance bands209.68814 min · $2.45
  9. v9Tolerance widened to 1.2%, just enough to pick AND2x2 over AND2x4200.67315 min · $2.62
  10. v10Override the NOR2 FO4 winner x2 with the moderate x1.5194.70216 min · $2.83
  11. v11BUFx3 instead of BUFx6f: half the input capacitance and leakageThe same trade aimed at buffers, where the library offers the widest choice of drive.182.32616 min · $3.00
  12. v12Another buffer step down, BUFx3 to BUFx2186.417 min · $3.17
  13. v13NOR2x1 replaces NOR2x1.5, dominating it on FO4, cap, area and leakageOne cell dominates another on delay, cap, area and leakage at once. The only version checked on all three visible cases.177.79517 min · $3.35
  14. v14Reduce NOR2 one further step, x1 to xp67179.7418 min · $3.51
  15. v15Load guard: keep the strong inverter/buffer above 30 fF routed load177.76750 min · $11.14
  16. v16Lower that guard threshold from 30 fF to 20 fF177.91361 min · $14.83
  17. v17Lower it again to 10 fF177.72668 min · $16.75
  18. v18Midpoint threshold of 15 fF177.91478 min · $19.44
  19. v19Apply the 20 fF guard only when most finite-slack cells are negative177.91397 min · $24.83
  20. v20Override AO22x2 with the lower-capacitance AO22x1179.11397 min · $24.83
  21. v21Override AOI22xp5 with the smaller AOI22xp33198.99198 min · $25.10
  22. v22Documentation-only cleanup; sizing behaviour identical to v19177.91398 min · $25.29

v1-v14 cost $3.51 and 18 min; v15-v22 cost $21.78 and 80 more, since the big cases are minutes of OpenROAD each. Score stopped moving at v13.

On the hidden set

held-out metricreward
shipped template (uniform max-drive)20,244.420.00
human expert solution919.260.60
theoretical bound (no violations)01.00
this run12,258.200.1155
720 minwall clock
$41.14spend
64.8Mtokens
15versions, 15 kept
150 180 210 240 270 300 $0 $10 $20 $30 $40 cumulative spend on the run case1 self-check score, lower is better human expert solution · visible · 286.76 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15
keptrevertedno scoreturning point
  1. v1Full rewrite: OpenROAD-driven surgical sizing, greedy moves checked by re-route+STASize from the design, not the library tables: repair the real violators, then move one instance at a time under a checkpoint.199.8284 min · $9.77
  2. v2Checkpoint selects the submitted point of the greedy run; slew-tightening beta sweep182.76138 min · $14.23
  3. v3Move objective in score units, moves ranked by gain per unit area167.57154 min · $15.13
  4. v4Nested slew ladder, DRV repair inside the checkpoint, cached per-net slew limits165.92177 min · $16.42
  5. v5Ladder reserves budget for its closing checkpoint; clean-finish repair loop168.36296 min · $21.84
  6. v6Light checkpoints reuse the global route; start from the template basin when it winsMeasure the inherited uniform template with a real checkpoint and, when it wins, optimise from it instead.148.11328 min · $24.63
  7. v7Basin comparison gets a full re-route rather than stale-route parasiticsnot re-measured338 min · $25.02
  8. v8Re-extract parasitics before every measurement; incremental STA was staleSwapping 6770 cells and back read TNS -138.1 ns, not -156.3: every accept/reject so far rested on stale timing.147.37378 min · $28.13
  9. v9Deterministic cell ordering; the no-OpenROAD fallback becomes the uniform template148.16394 min · $30.01
  10. v10Template basin measured right after P1; the two basins split the wall clock147.99420 min · $31.16
  11. v11Seed full-checkpoint cost from the opening route; solver capped at 5400 s per case147.64491 min · $33.74
  12. v12Track light- and full-checkpoint cost separately so P2 still validates on big designs147.99561 min · $35.87
  13. v13Load-side repair: shrink the loads of nets whose driver is a flop or a macro147.46616 min · $37.62
  14. v14Cells shrunk by load-side repair are excluded from driver-side upsizing147.99665 min · $39.60
  15. v15Load-side repair never touches cells that are themselves violating drivers147.72694 min · $40.51

First snapshot at 84 min and $9.77; most of the 12 h went on OpenROAD waits. It tuned at a 5400 s per-case cap, but the grader allows 2400 s.

On the hidden set

held-out metricreward
shipped template (uniform max-drive)20,244.420.00
human expert solution919.260.60
theoretical bound (no violations)01.00
this run20,930.110
38 minwall clock
$2.35spend
15.1Mtokens
1versions, 1 kept

No trajectory curve: this run left one comparable self-check measurement, so there is nothing to plot against spend. The versions and what each one changed are below.

  1. v10Swap all to strongest, then downsize at 50% cap / 70% slew margin; no place or routeDownsize off a strongest-drive start, guarding each move with cap and slew margins instead of a re-route.305.80337 min · $2.15

Only snapshot, at 37 min and $2.15 of a $2.35 run. case1 reads 305.803, but the sealed designs came back at 15,102 and 97,855.

On the hidden set

held-out metricreward
shipped template (uniform max-drive)20,244.420.00
human expert solution919.260.60
theoretical bound (no violations)01.00
this run56,478.810