Skip to content

test/odb: replace design_is_routed golden tests with C++ unit tests#10733

Open
maliberty wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:odb-design-is-routed-cpp-tests
Open

test/odb: replace design_is_routed golden tests with C++ unit tests#10733
maliberty wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:odb-design-is-routed-cpp-tests

Conversation

@maliberty

Copy link
Copy Markdown
Member

Converts the design_is_routed{1,2,3} and design_is_routed_fail{1,2} golden Tcl tests into TestDesignIsRouted C++ unit tests that assert the boolean result and verbose ODB-0232 warning behavior of dbBlock::designIsRouted() directly, rather than diffing serialized logs. This follows the C++-first testing strategy (docs/agents/testing-strategy.md): a golden test is retired in the same change that re-expresses its coverage in C++.

Coverage mapping

C++ test Behavior
RoutedSignalNet multi-pin signal net with wires → routed
SpecialNetsAreIgnored unrouted special net is skipped → routed
MixedSpecialAndRoutedSignalNets special + routed signal net → routed
UnroutedSignalNetFails multi-pin signal net, no wire/abutment → unrouted
UnroutedSignalNetWithSpecialNetsFails unrouted signal detected alongside special nets
VerboseWarnsForEachUnroutedNet verbose returns false and warns once per unrouted net (scans all)
NonVerboseEmitsNoWarning non-verbose reports unrouted without warning
SinglePinNetIsRouted ≤1-pin net is never flagged (new edge case)
EmptyDesignIsRouted no nets → routed (new edge case)

The last two assert more than the golden tests reached. design_is_routed binding coverage remains via test/flow.tcl and src/rsz/src/Resizer.tcl.

Notes

  • design_is_routed1.def is renamed to all_pins_placed2.def (its only remaining user); the Bazel glob picks it up, so the explicit data dep is dropped.
  • Registered in both CMake (OdbGTests) and Bazel (//src/odb/test/cpp:OdbGTests).

Convert the design_is_routed{1,2,3} and design_is_routed_fail{1,2} golden
Tcl tests into TestDesignIsRouted C++ unit tests that assert the boolean
result and verbose ODB-0232 warning behavior of dbBlock::designIsRouted()
directly, instead of diffing serialized logs.

The C++ tests cover the same behaviors (routed signal nets, ignored special
nets, mixed designs, and unrouted detection with and without verbose) plus
single-pin and empty-design edge cases the golden tests never reached.

design_is_routed1.def is retained (renamed to all_pins_placed2.def) since
all_pins_placed2 still uses it; the glob picks it up so the explicit Bazel
data dep is dropped. Registered in both CMake and Bazel.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty maliberty self-assigned this Jun 22, 2026

@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 replaces several legacy Tcl/DEF-based integration tests for the design_is_routed functionality with a comprehensive suite of C++ unit tests in src/odb/test/cpp/TestDesignIsRouted.cpp. The new unit tests thoroughly verify the behavior of dbBlock::designIsRouted() under various scenarios, including routed signal nets, ignored special nets, single-pin nets, empty designs, unrouted signal nets, and verbose vs. non-verbose warning counts. Legacy test files and their corresponding build configurations in CMake and Bazel have been removed. There are no review comments on this pull request, and I have no feedback to provide.

@maliberty maliberty marked this pull request as ready for review June 22, 2026 03:23
@maliberty maliberty requested a review from a team as a code owner June 22, 2026 03:23
@maliberty maliberty requested a review from osamahammad21 June 22, 2026 03:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e44977790

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

makeMultiPinNet("n2");

const int warnings_before = logger_.getWarningCount();
EXPECT_FALSE(block_->designIsRouted(/*verbose=*/true));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep Tcl -verbose coverage

This replacement exercises the verbose path only through the C++ API, but the deleted Tcl regressions were the only tests that invoked design_is_routed -verbose; a repo-wide check shows the remaining Tcl callers use non-verbose mode in test/flow.tcl:237 and production src/rsz/src/Resizer.tcl:366, while the flag parsing lives in src/odb/src/swig/tcl/odb.tcl:680-692. If the Tcl flag parsing or SWIG dispatch regresses, this new test still passes, so please keep one Tcl-level verbose regression or add an equivalent wrapper-level test.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant