Skip to content

util: genElapsedTime parses the timing line wherever it sits on the line - #4554

Merged
maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:genelapsedtime-prefixed-line
Sep 26, 2026
Merged

maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:genelapsedtime-prefixed-line

Conversation

@oharboe

@oharboe oharboe commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

What

genElapsedTime.py writes the per-stage summary row: elapsed time, peak memory and the sha1sum of the stage's results, the one place ORFS reports a hash of a stage's result. It parsed the timing line positionally, so a timing line with any prefix is "not understood" and the whole row is dropped silently: no "No elapsed time found" warning (the line was found), exit status 0. A RUN_CMD wrapper that stamps log lines ([ 123.45] Elapsed time: ...) is enough to trigger it.

Fix

Match the timing line with a regex anchored on its format, hours optional as run_command.py only emits them past an hour. An unprefixed line gives exactly the number it did before (fraction of a second dropped as before), and an unparseable line still reaches "Elapsed time not understood".

Test

flow/test/test_run_command.py:

  • test_genElapsedTime_parses_output asserted only that the stage name appeared, which it does even when the row is dropped; it now asserts the elapsed and memory columns.
  • New: a prefixed timing line (fails before this change) and the hours form.

flow/test/*.py all pass; black clean.

🤖 Generated with Claude Code

genElapsedTime.py writes the per-stage summary, the only place ORFS
reports a hash of a stage's result. It read the elapsed time
positionally: strip the line, delete "Elapsed time: ", split on "[h:]",
on the first "." and on ":". That works only when the timing line starts
the log line. Give it a prefix, as a RUN_CMD wrapper that stamps log
lines does ("[  123.45] "), and the prefix survives the delete, the
split on "." cuts at the prefix's own decimal point, and the line falls
to "Elapsed time not understood". The row is then skipped: elapsed,
peak memory and the sha1sum column vanish, "No elapsed time found" does
not fire because the line was found, and the exit status is 0.

Match the timing line with a regex anchored on its format instead,
hours optional as run_command.py only emits them past an hour. An
unprefixed line gives exactly the number it did before, fraction of a
second dropped as before, and an unparseable line still reaches "not
understood".

test_genElapsedTime_parses_output asserted only that the stage name
appeared, which it does even when the row is dropped; it now asserts
the elapsed and memory columns. Two cases are added: a prefixed line,
which fails before this change, and the hours form.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the elapsed time parsing logic in genElapsedTime.py to use a regular expression, allowing it to robustly parse timing lines that contain prefixes or optional hour fields. Additionally, corresponding unit tests have been added in test_run_command.py to verify these parsing capabilities. There are no review comments, and I have no feedback to provide.

@openroad-ci

openroad-ci commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit ae12237 · Jenkins build #3 · Baseline: build · View build on dashboard

62 design(s) checked — 0 with regression(s), 0 without a comparable baseline.

@maliberty
maliberty merged commit ba9e932 into The-OpenROAD-Project:master Sep 26, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants