UPF: Added create_supply_net command#9767
UPF: Added create_supply_net command#9767Waleed99i wants to merge 2 commits intoThe-OpenROAD-Project:masterfrom
Conversation
Signed-off-by: Waleed <waleedakram059@gmail.com>
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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.
src/upf/src/upf.cpp
Outdated
| bool create_supply_net(utl::Logger* logger, | ||
| odb::dbBlock* block, | ||
| const std::string& name) |
There was a problem hiding this comment.
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
- Define tunable parameters as named constants instead of using hardcoded magic numbers.
Signed-off-by: Waleed <waleedakram059@gmail.com>
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.