Skip to content

odb: support DEF virtual route points#10364

Merged
maliberty merged 5 commits into
The-OpenROAD-Project:masterfrom
naveenvenk17:worker5-odb-def-virtual
May 12, 2026
Merged

odb: support DEF virtual route points#10364
maliberty merged 5 commits into
The-OpenROAD-Project:masterfrom
naveenvenk17:worker5-odb-def-virtual

Conversation

@naveenvenk17
Copy link
Copy Markdown
Contributor

Fixes #5670.

This teaches the DEF reader to map DEF 5.8 VIRTUAL ( x y ) routing points onto the existing OpenDB virtual-wire opcode, and teaches DEF output to preserve the sequential virtual point when writing the wire back.

A focused ODB regression reads a minimal DEF with a virtual routed point, checks the decoded wire opcode/point sequence, and verifies write_def preserves the VIRTUAL point.

Local testing:

  • git diff --cached --check
  • bazel test //src/odb/test:read_def_virtual could not be run locally because bazel/bazelisk is not installed in this Windows/WSL environment.

@github-actions github-actions Bot added the size/M label May 9, 2026
Copy link
Copy Markdown
Contributor

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

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 introduces support for VIRTUAL points in DEF files, enabling the ODB component to correctly parse, store, and write these constructs. The implementation involves tracking junction IDs during path creation and updating the DEF reader and writer logic to handle virtual wire segments. A new test case has been added to verify the round-trip of DEF files containing virtual routes. Feedback suggests improving error handling in the pathVirtualPoint method by logging an error when a virtual point is encountered without a valid preceding junction, as this violates the DEF specification and would improve debuggability for invalid input files.

Comment thread src/odb/src/defin/definNet.cpp Outdated
Comment on lines +334 to +336
if (_wire == nullptr || _cur_layer == nullptr || _prev_junction_id < 0) {
return;
}
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.

high

The method returns silently if _prev_junction_id < 0. According to the DEF 5.8 specification, a VIRTUAL point must follow a regular routing point. If it appears at the start of a path, it is an invalid construct. Adding an error message here would improve debuggability for invalid DEF files, as unexpected failures in routing-related constructs should be logged as errors to ensure they are not missed by the user.

References
  1. Unexpected failures during the routing flow should be logged as an error, not a warning, to ensure critical failure messages are not missed.

@naveenvenk17 naveenvenk17 force-pushed the worker5-odb-def-virtual branch from fe5cb9a to 9c99f77 Compare May 9, 2026 09:18
Signed-off-by: naveenvenk17 <naveenvenkat1711@gmail.com>
@naveenvenk17 naveenvenk17 force-pushed the worker5-odb-def-virtual branch from 9c99f77 to 2f3c8c0 Compare May 9, 2026 09:33
@naveenvenk17
Copy link
Copy Markdown
Contributor Author

Fixed the Jenkins message-id failure by moving the new ODB warning from duplicate ID 426 to free ID 469. Re-ran python etc/find_messages.py -d src/odb and git diff --check locally before force-pushing.

Signed-off-by: naveenvenk17 <naveenvenkat1711@gmail.com>
Signed-off-by: naveenvenk17 <naveenvenkat1711@gmail.com>
Signed-off-by: naveenvenk17 <naveenvenkat1711@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@maliberty
Copy link
Copy Markdown
Member

definNet.cpp needs a clang-format

Signed-off-by: naveenvenk17 <naveenvenkat1711@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@naveenvenk17
Copy link
Copy Markdown
Contributor Author

Thanks, fixed in 7899b13 by running clang-format on src/odb/src/defin/definNet.cpp.

@maliberty maliberty merged commit a0f6cbc into The-OpenROAD-Project:master May 12, 2026
16 checks passed
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.

"VIRTUAL" keyword in net's routing is unsupported

2 participants