Skip to content

UPF: Added create_supply_net command#9767

Open
Waleed99i wants to merge 2 commits intoThe-OpenROAD-Project:masterfrom
Waleed99i:upf-create-supply-net
Open

UPF: Added create_supply_net command#9767
Waleed99i wants to merge 2 commits intoThe-OpenROAD-Project:masterfrom
Waleed99i:upf-create-supply-net

Conversation

@Waleed99i
Copy link

Description:
This draft PR adds internal support for creating supply nets in the UPF module. Supply nets are important for power distribution in designs and can be used in future UPF commands.

Changes include:

src/upf/src/upf.cpp: Added create_supply_net function that creates a new net in the current block, checks for duplicates, and logs success/failure.

src/upf/include/upf/upf.h: Declared create_supply_net function for internal use.

src/upf/src/upf.i: Added SWIG binding create_supply_net_cmd for possible Tcl access.

src/upf/src/upf.tcl: Added Tcl wrapper procedure create_supply_net for future scripting support.

Notes:

No changes to existing UPF commands or APIs.

Logging ID 62 follows the pattern in upf.cpp.

This PR is submitted as a draft for review; testing and further integration will be added in future PRs.Will be updated soon maybe ..

Motivation:

Addresses the missing internal UPF option for supply nets as discussed in Issue #5617.

Lays the groundwork for future UPF commands that require supply nets.

Signed-off-by: Waleed <waleedakram059@gmail.com>
Copy link
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 a new create_supply_net command for the UPF module. The implementation is straightforward, adding the function declaration, implementation, SWIG binding, and Tcl wrapper.

My review has identified a couple of issues:

  • The same logging ID is used for multiple messages, which should be unique.
  • The created 'supply net' is not correctly typed as a supply net (e.g., POWER or GROUND), and defaults to a SIGNAL net, which is likely incorrect.

Please see the detailed comments for suggestions on how to address these points.

return false;
}

net = odb::dbNet::create(block, name.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The newly created net has a default sig_type of SIGNAL. A supply net should be of type POWER or GROUND. This could lead to incorrect behavior in downstream tools. Please set the signal type of the net after creation using net->setSigType(). You may need to add a parameter to the create_supply_net command to specify whether it's a power or ground net.

Comment on lines +57 to +59
bool create_supply_net(utl::Logger* logger,
odb::dbBlock* block,
const std::string& name)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The same message ID 62 is used for multiple log messages (warning, error, and info) within this function. Each log message should have a unique ID to allow for individual suppression and easier identification. Please use unique IDs for each message. For example, you could use 62 for the warning, 63 for the error, and 64 for the info message.

References
  1. Define tunable parameters as named constants instead of using hardcoded magic numbers.

Signed-off-by: Waleed <waleedakram059@gmail.com>
@Waleed99i Waleed99i marked this pull request as ready for review March 17, 2026 22:15
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.

1 participant