Skip to content

Commit 5a39f71

Browse files
oharboeclaude
andcommitted
docs: document FAST_SETTINGS with ORFS source references
Add detailed documentation for each FAST_SETTINGS variable by tracing through the OpenROAD-flow-scripts TCL source to explain what OpenROAD commands each setting controls and why disabling them speeds up builds. - Add inline comments to FAST_SETTINGS dict in test/BUILD with per-setting stage, description, and source file reference - Add "Speed up your builds" section to README.md with table of settings, abstract_stage guidance, interactive timing queries, build profiling, and cache miss debugging - Add new use-case entries to the index table Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Øyvind Harboe <[email protected]>
1 parent eb1509d commit 5a39f71

File tree

2 files changed

+196
-2
lines changed

2 files changed

+196
-2
lines changed

README.md

Lines changed: 164 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ and easily actionable github issues for the OpenROAD and ORFS maintainers.
3030
| Create macros with LEF/LIB | [Work with macros and abstracts](#work-with-macros-and-abstracts) |
3131
| Quickly estimate macro sizes | [Mock area targets](#mock-area-targets) |
3232
| Tweak floorplan or placement settings | [Tweak and iterate on designs](#tweak-and-iterate-on-designs) |
33+
| Speed up CI or development builds | [Speed up your builds](#speed-up-your-builds) |
34+
| Profile build times | [Profile build times](#profile-build-times) |
35+
| Query timing interactively | [Query timing interactively](#query-timing-interactively) |
36+
| Monitor long-running builds | [Monitor long-running builds](#monitor-long-running-builds) |
3337
| Sweep design parameters | [Design space exploration](#design-space-exploration) |
3438
| Run formal verification | [sby/README.md](sby/README.md) |
3539
| Integrate Chisel designs | [toolchains/scala/README.md](toolchains/scala/README.md) |
@@ -335,7 +339,7 @@ orfs_flow(
335339

336340
By default, `abstract_stage` is set to `final` (the latest ORFS stage).
337341

338-
> **NOTE:** Abstracts can be generated starting from the `floorplan` stage, thus skipping the `synth` stage.
342+
> **NOTE:** Abstracts can be generated starting from the `place` stage, because pin placement happens during the place stage. The legal values for `abstract_stage` are: `place`, `cts`, `grt`, `route`, `final`.
339343
340344
Abstracts are useful for estimating sizes of macros with long build times and checking if they fit in upper-level modules without running the full place and route flow.
341345

@@ -365,7 +369,7 @@ orfs_flow(
365369

366370
### Fast floorplanning with mock abstracts
367371

368-
To skip place, cts, and route and create a mock abstract where you can check that macros fit at the top level, set `abstract_stage` to `floorplan`:
372+
To skip cts and route and create a mock abstract where you can check that macros fit at the top level, set `abstract_stage` to `place`:
369373

370374
> **WARNING:** Although mock abstracts can speed up turnaround times, skipping place, cts, or route can lead to errors that don't exist when these stages are run.
371375
@@ -444,6 +448,164 @@ git restore test/BUILD
444448
bazel run @bazel-orfs//test:tag_array_64x184_floorplan gui_floorplan
445449
```
446450

451+
## Speed up your builds
452+
453+
### Disable expensive operations for CI and development
454+
455+
For CI or iterative development where timing closure isn't needed, you can
456+
disable expensive operations. The `FAST_SETTINGS` dict in [test/BUILD](test/BUILD)
457+
shows the recommended settings:
458+
459+
| Setting | Stage | What it disables | Speed impact |
460+
|---------|-------|------------------|-------------|
461+
| `REMOVE_ABC_BUFFERS` = `"1"` | floorplan | Removes synthesis buffers instead of running `repair_timing_helper` (gate sizing, VT swapping). Without this, floorplan timing repair can run for hours. | Very high |
462+
| `GPL_TIMING_DRIVEN` = `"0"` | place | Timing-driven global placement. Skips timing path analysis and buffer removal during placement iterations. | High |
463+
| `GPL_ROUTABILITY_DRIVEN` = `"0"` | place | Routability-driven global placement. Skips routing congestion estimation during placement. | Moderate |
464+
| `SKIP_CTS_REPAIR_TIMING` = `"1"` | cts | Timing repair after clock tree synthesis. Skips iterative buffer insertion, gate sizing, gate cloning, and VT swapping. Can reduce CTS from hours to minutes. | Very high |
465+
| `SKIP_INCREMENTAL_REPAIR` = `"1"` | grt | Incremental repair during global routing. Skips two rounds of `repair_design` + `repair_timing` with incremental re-routing. | Very high |
466+
| `SKIP_REPORT_METRICS` = `"1"` | all | Metrics reporting (`report_checks`, `report_wns`, `report_tns`, `report_power`, `report_clock_skew`) at every stage. | Moderate |
467+
| `FILL_CELLS` = `""` | route | Fill cell insertion (`filler_placement`). Required for manufacturing but not for design exploration. | Low |
468+
| `TAPCELL_TCL` = `""` | floorplan | Custom tap/endcap cell placement script. Falls back to simple `cut_rows`. | Low |
469+
| `PWR_NETS_VOLTAGES` = `""` | final | IR drop analysis for power nets (`analyze_power_grid`). | Low |
470+
| `GND_NETS_VOLTAGES` = `""` | final | IR drop analysis for ground nets (`analyze_power_grid`). | Low |
471+
472+
Apply these settings in your `orfs_flow()` target:
473+
474+
```starlark
475+
FAST_SETTINGS = {
476+
"FILL_CELLS": "",
477+
"GND_NETS_VOLTAGES": "",
478+
"GPL_ROUTABILITY_DRIVEN": "0",
479+
"GPL_TIMING_DRIVEN": "0",
480+
"PWR_NETS_VOLTAGES": "",
481+
"REMOVE_ABC_BUFFERS": "1",
482+
"SKIP_CTS_REPAIR_TIMING": "1",
483+
"SKIP_INCREMENTAL_REPAIR": "1",
484+
"SKIP_REPORT_METRICS": "1",
485+
"TAPCELL_TCL": "",
486+
}
487+
488+
orfs_flow(
489+
name = "my_design",
490+
arguments = FAST_SETTINGS | {
491+
"CORE_UTILIZATION": "40",
492+
# ...
493+
},
494+
verilog_files = ["my_design.sv"],
495+
)
496+
```
497+
498+
### Set abstract_stage as early as possible
499+
500+
The `abstract_stage` parameter controls how far the flow runs. Setting it earlier
501+
skips all subsequent stages:
502+
503+
| `abstract_stage` | Stages built | Stages skipped |
504+
|------------------|--------------|----------------|
505+
| `"place"` | synth, floorplan, place | cts, grt, route, final |
506+
| `"cts"` | synth → cts | grt, route, final |
507+
| `"grt"` | synth → grt | route, final |
508+
| `"route"` | synth → route | final |
509+
| `"final"` (default) | All stages | None |
510+
511+
Abstract generation requires at least the `place` stage because pins are placed
512+
during placement. For macro size estimation, `"place"` is usually sufficient.
513+
For timing analysis, `"cts"` provides clock tree data without expensive routing.
514+
515+
### Query timing interactively
516+
517+
Open an interactive OpenROAD shell or GUI to investigate a completed stage:
518+
519+
```bash
520+
# GUI with timing loaded
521+
bazel run <target>_<stage> gui_<stage>
522+
523+
# Interactive TCL shell (no GUI)
524+
bazel run <target>_<stage> open_<stage>
525+
```
526+
527+
Useful TCL commands once inside OpenROAD:
528+
529+
| Command | What it shows |
530+
|---------|---------------|
531+
| `report_checks -path_delay max -group_count 5` | Top 5 worst setup timing paths |
532+
| `report_checks -path_delay max -through [get_pins *name*]` | Worst path through a specific pin |
533+
| `report_wns` | Worst negative slack |
534+
| `report_tns` | Total negative slack |
535+
| `get_cells -hier *name*` | Find instances by name pattern |
536+
537+
### Monitor long-running builds
538+
539+
ORFS stages can take minutes to hours. To monitor progress, watch the OpenROAD
540+
log files while a build is running.
541+
542+
**Find the active log file:**
543+
544+
```bash
545+
# Find the most recently modified .log file in the Bazel sandbox
546+
find /tmp -path "*/sandbox/*/logs/*.log" -newer /tmp/.bazel_start 2>/dev/null | head -5
547+
548+
# Or watch all ORFS log output from the sandbox
549+
tail -f $(find /tmp -path "*/sandbox/*/logs/*.log" -newer /tmp/.bazel_start 2>/dev/null | tail -1)
550+
```
551+
552+
**Monitor via the local flow** (easier, recommended for debugging):
553+
554+
```bash
555+
# Start the build in the local flow
556+
bazel run //test:L1MetadataArray_cts_deps
557+
tmp/test/L1MetadataArray_cts_deps/make do-cts &
558+
559+
# In another terminal, watch the log
560+
tail -f tmp/test/L1MetadataArray_cts_deps/logs/4_1_cts.log
561+
```
562+
563+
**What to look for in logs:**
564+
565+
| Log pattern | What it means |
566+
|-------------|---------------|
567+
| `repair_timing` | Timing repair loop — can run for hours on large designs. Look for iteration count and remaining violations. |
568+
| `Iteration` / `Overflow` | Global placement convergence. Overflow should decrease toward 0. |
569+
| `[WARNING]` slack values | Negative slack means timing violations. Large negative values suggest the clock period is too aggressive. |
570+
| `report_checks` | Timing report output. Check `Slack` at the bottom of each path. |
571+
| `estimate_parasitics` | Parasitic estimation — usually fast, indicates a stage transition. |
572+
573+
**Log file naming convention:**
574+
575+
Each ORFS stage produces numbered log files under `logs/`:
576+
577+
| Stage | Log files |
578+
|-------|-----------|
579+
| synth | `1_1_yosys_canonicalize.log`, `1_2_yosys.log` |
580+
| floorplan | `2_1_floorplan.log` through `2_4_floorplan_pdn.log` |
581+
| place | `3_1_place_gp_skip_io.log` through `3_5_place_dp.log` |
582+
| cts | `4_1_cts.log` |
583+
| grt | `5_1_grt.log` |
584+
| route | `5_2_route.log`, `5_3_fillcell.log` |
585+
| final | `6_1_merge.log`, `6_report.log` |
586+
587+
### Profile build times
588+
589+
Generate and analyze a Bazel build profile to find bottlenecks:
590+
591+
```bash
592+
bazel build <target> --profile=/tmp/profile.gz
593+
bazel analyze-profile /tmp/profile.gz
594+
```
595+
596+
The critical path output shows each action and its wall-clock time.
597+
598+
### Debug cache misses
599+
600+
Use `--explain` to understand why Bazel is rebuilding a target:
601+
602+
```bash
603+
bazel build <target> --explain=/tmp/explain.txt --verbose_explanations
604+
```
605+
606+
Avoid `bazel clean --expunge` — it forces a full rebuild. If you need to force-rebuild
607+
one target, use the [`PHONY` variable trick](#force-a-rebuild) instead.
608+
447609
## Design space exploration
448610

449611
bazel-orfs supports two approaches to design space exploration:

test/BUILD

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,38 @@ filegroup(
4545
visibility = ["//:__subpackages__"],
4646
)
4747

48+
# Settings to speed up CI builds by disabling expensive operations that are
49+
# only needed for timing closure and manufacturing sign-off.
50+
#
51+
# Setting Stage What it disables
52+
# ------- ----- ----------------
53+
# GPL_TIMING_DRIVEN=0 place Timing-driven global placement. Skips timing path
54+
# analysis during placement iterations and buffer
55+
# removal (remove_buffers). (global_place.tcl)
56+
# GPL_ROUTABILITY_DRIVEN=0 place Routability-driven global placement. Skips routing
57+
# congestion estimation during placement. (global_place.tcl)
58+
# SKIP_CTS_REPAIR_TIMING=1 cts CTS timing repair. Skips repair_timing_helper after
59+
# clock tree synthesis — buffer insertion, gate sizing,
60+
# VT swapping. Can reduce CTS from hours to minutes
61+
# on large designs. (cts.tcl)
62+
# SKIP_INCREMENTAL_REPAIR=1 grt Incremental repair during global routing. Skips two
63+
# rounds of repair_design + repair_timing with
64+
# incremental re-routing between them. (global_route.tcl)
65+
# REMOVE_ABC_BUFFERS=1 floorplan Removes synthesis buffers instead of running
66+
# repair_timing_helper in floorplan. The alternative
67+
# (=0) runs hours of gate sizing/VT swapping.
68+
# (floorplan.tcl)
69+
# SKIP_REPORT_METRICS=1 all Metrics reporting. Skips report_checks, report_wns,
70+
# report_tns, report_power, report_clock_skew at every
71+
# stage. Saves minutes per stage. (report_metrics.tcl)
72+
# FILL_CELLS="" route Fill cell insertion. Skips filler_placement for
73+
# manufacturing density requirements. (fillcell.tcl)
74+
# TAPCELL_TCL="" floorplan Custom tap/endcap cell placement. Falls back to
75+
# simple cut_rows. (tapcell.tcl)
76+
# PWR_NETS_VOLTAGES="" final IR drop analysis for power nets. Skips
77+
# analyze_power_grid. (final_report.tcl)
78+
# GND_NETS_VOLTAGES="" final IR drop analysis for ground nets. Skips
79+
# analyze_power_grid. (final_report.tcl)
4880
FAST_SETTINGS = {
4981
"FILL_CELLS": "",
5082
"GND_NETS_VOLTAGES": "",

0 commit comments

Comments
 (0)