Skip to content

Commit 76bf1b6

Browse files
oharboeclaude
andcommitted
flow: name the failure checkpoint after the step, <step>-failed.odb
run_step.tcl writes $RESULTS_DIR/<step>-failed.odb and .sdc instead of failed.odb, e.g. 3_3_place_gp-failed.odb. These are the names global_place, detail_place, pdn and global_route already write, and the <step>-failed.odb the Makefile and Tcl contracts name, so existing make targets and habits keep working, the name says which step failed, and write_endpoint_slack's *-failed check still applies. flow.sh passes the step name as STEP_NAME and removes only that step's stale checkpoint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 4bc2c11 commit 76bf1b6

6 files changed

Lines changed: 18 additions & 15 deletions

File tree

‎docs/contrib/MakefileContract.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Several of the rules exist for them.
8080
*Breaks:* caching a step's result, the QoR check against a baseline, and
8181
bisecting a regression.
8282
- **A failing step never calls `exit`.** It calls `error`, and
83-
`flow/scripts/run_step.tcl` writes `failed.odb` and `failed.sdc`
83+
`flow/scripts/run_step.tcl` writes `<step>-failed.odb` and `.sdc`
8484
(`WRITE_ON_FAILURE`).
8585
*Breaks:* the log and the exit status stop saying where the step failed,
8686
and there is no checkpoint to inspect.

‎docs/contrib/TclContract.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ to follow.
7070
*Breaks:* the guard is a code path no CI run exercises, and a missing
7171
variable or file shows up later, somewhere else, as a wrong result.
7272
- **A failing step never writes the file a successful step writes.** It
73-
calls `error`, and `flow/scripts/run_step.tcl` writes `failed.odb` and
74-
`failed.sdc` (`WRITE_ON_FAILURE`).
73+
calls `error`, and `flow/scripts/run_step.tcl` writes
74+
`<step>-failed.odb` and `.sdc` (`WRITE_ON_FAILURE`).
7575
*Breaks:* make, and any flow built on it, takes the file as proof that the
7676
step succeeded.
7777
- **A script never adds error numbers or checks that belong in OpenROAD.**

‎docs/user/FlowVariables.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ configuration file.
350350
| <a name="VIA_IN_PIN_MIN_LAYER"></a>VIA_IN_PIN_MIN_LAYER| Passed as -via_in_pin_bottom_layer to pin_access and detailed_route.| |
351351
| <a name="WIRE_LOAD_MODEL"></a>WIRE_LOAD_MODEL| Name of a Liberty wire_load group applied with set_wire_load_model whenever open.tcl reads timing. OpenSTA applies a wire-load model only to nets without parasitics, so it gives wire delay to timing read before placement and leaves placed and routed timing unaffected. An unknown name is an error. Empty, the default, applies none. A platform whose libraries define no wire_load group can supply one in a Liberty file listed in ADDITIONAL_LIBS.| |
352352
| <a name="WRITE_ODB_AND_SDC_EACH_STAGE"></a>WRITE_ODB_AND_SDC_EACH_STAGE| Save out .sdc and .odb file after each stage, useful to disable when using a single OpenROAD instance to run all stages of the flow.| 1|
353-
| <a name="WRITE_ON_FAILURE"></a>WRITE_ON_FAILURE| If set to 1, a step that fails writes the design as it was at the failure to $RESULTS_DIR/failed.odb and failed.sdc, then fails with the original error. `make web_failed.odb` opens it. Set to 0 where writing a large design on failure costs too much time or disk.| 1|
353+
| <a name="WRITE_ON_FAILURE"></a>WRITE_ON_FAILURE| If set to 1, a step that fails writes the design as it was at the failure to $RESULTS_DIR/<step>-failed.odb and .sdc, then fails with the original error. `make web_<step>-failed.odb` opens it, e.g. `make web_3_3_place_gp-failed.odb`. Set to 0 where writing a large design on failure costs too much time or disk.| 1|
354354
| <a name="YOSYS_FLAGS"></a>YOSYS_FLAGS| Flags to pass to yosys.| -v 3|
355355
## synth variables
356356

‎flow/scripts/flow.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ RUN_CMD="${RUN_CMD:-$PYTHON_EXE $SCRIPTS_DIR/run_command.py}"
1010

1111
echo "Running $2.tcl, stage $1"
1212

13-
# A failure checkpoint belongs to the step that failed last; one left by
14-
# an earlier run is not this step's.
15-
rm -f "$RESULTS_DIR/failed.odb" "$RESULTS_DIR/failed.sdc"
13+
# A failure checkpoint left by an earlier run of this step is stale.
14+
rm -f "$RESULTS_DIR/$1-failed.odb" "$RESULTS_DIR/$1-failed.sdc"
1615

1716
(
1817
trap 'mv "$LOG_DIR/$1.tmp.log" "$LOG_DIR/$1.log"' EXIT
18+
export STEP_NAME="$1"
1919
export STEP_TCL="$SCRIPTS_DIR/$2.tcl"
2020

2121
eval "$OPENROAD_EXE $OPENROAD_ARGS -exit \"$SCRIPTS_DIR/noop.tcl\"" \

‎flow/scripts/run_step.tcl‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Runs one step's script, $STEP_TCL, for flow.sh. With WRITE_ON_FAILURE=1,
22
# an error anywhere in the step writes the design as it was at the failure
3-
# to $RESULTS_DIR/failed.odb and failed.sdc, so it can be inspected without
4-
# running the step again; the step then fails with the original error.
3+
# to $RESULTS_DIR/$STEP_NAME-failed.odb and .sdc, e.g. 3_3_place_gp-failed.odb,
4+
# so it can be inspected without running the step again; the step then
5+
# fails with the original error.
56

67
proc write_failure_checkpoint { } {
78
if { !$::env(WRITE_ON_FAILURE) } {
@@ -12,9 +13,10 @@ proc write_failure_checkpoint { } {
1213
puts "No design loaded, no failure checkpoint written"
1314
return
1415
}
15-
puts "Writing failure checkpoint $::env(RESULTS_DIR)/failed.odb"
16-
write_sdc -no_timestamp $::env(RESULTS_DIR)/failed.sdc
17-
write_db $::env(RESULTS_DIR)/failed.odb
16+
set stem $::env(RESULTS_DIR)/$::env(STEP_NAME)-failed
17+
puts "Writing failure checkpoint $stem.odb"
18+
write_sdc -no_timestamp $stem.sdc
19+
write_db $stem.odb
1820
}
1921

2022
# Any status but 0 fails the step: an error, and a break, continue or

‎flow/scripts/variables.yaml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,9 +1767,10 @@ WRITE_ODB_AND_SDC_EACH_STAGE:
17671767
WRITE_ON_FAILURE:
17681768
description: >
17691769
If set to 1, a step that fails writes the design as it was at the
1770-
failure to $RESULTS_DIR/failed.odb and failed.sdc, then fails with
1771-
the original error. `make web_failed.odb` opens it. Set to 0 where
1772-
writing a large design on failure costs too much time or disk.
1770+
failure to $RESULTS_DIR/<step>-failed.odb and .sdc, then fails with
1771+
the original error. `make web_<step>-failed.odb` opens it, e.g.
1772+
`make web_3_3_place_gp-failed.odb`. Set to 0 where writing a large
1773+
design on failure costs too much time or disk.
17731774
stages:
17741775
- All stages
17751776
default: 1

0 commit comments

Comments
 (0)