Sta update latest 0505#357
Conversation
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
|
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for a -mode argument in the write_sdc command and refactors the Sta class to track the current mode independently of the command scene. Review feedback highlights a critical bug in VerilogWriter.cc where C-style strings are compared by address rather than content, and a potential logic error in Sdc.tcl where a pointer is used instead of a mode name. Additionally, the removal of an empty string check in setCmdMode and a typo in the documentation example should be addressed.
| && (network_->direction(port)->isAnyOutput() | ||
| || (include_pwr_gnd_ && network_->direction(port)->isPowerGround())) | ||
| && !stringEqual(network_->name(port), network_->name(net))) { | ||
| && network_->name(port) != network_->name(net)) { |
There was a problem hiding this comment.
This condition compares two const char* pointers using !=, which compares their memory addresses instead of their string content. This is a bug. The previous implementation used !stringEqual(...), which was likely correct. You should use a proper string comparison method, such as strcmp or by converting the C-style strings to std::string before comparison.
&& std::string(network_->name(port)) != std::string(network_->name(net))) {There was a problem hiding this comment.
Hallucination: Both Network::name(Port*) and Network::name(Net*) return std::string, not const char*. operator!= on std::string does content comparison. No bug
| set mode [cmd_mode] | ||
| if { [info exists keys(-mode)] } { | ||
| set mode $keys(-mode) | ||
| } |
There was a problem hiding this comment.
There is a potential bug in how the mode variable is being set. The [cmd_mode] command returns a Mode* object, not the mode's name as a string. When this object is passed to write_sdc_cmd, it will likely be converted to a string representation of the pointer, causing findMode in the C++ code to fail when no -mode is specified. You should use [cmd_mode_name] to retrieve the name of the current mode.
set mode [cmd_mode_name]
if { [info exists keys(-mode)] } {
set mode $keys(-mode)
}
There was a problem hiding this comment.
Search.i:822 cmd_mode() returns Mode* (SWIG pointer string _xxx_p_Mode).
Sdc.i:96 write_sdc_cmd expects std::string mode_name.
Line 72 set mode [cmd_mode] passes pointer string to wrapper expecting mode name --> findMode fails.
Line 48 already uses [cmd_mode_name] for prev_mode. Same pattern needed in line 72
| } | ||
|
|
||
| void | ||
| Sta::setCmdMode(std::string_view mode_name) |
There was a problem hiding this comment.
The check for an empty mode_name has been removed from this function. The previous implementation had a check if (!mode_name.empty()). Without it, calling setCmdMode with an empty string could lead to a Mode with an empty name being created, which might result in an invalid state or unexpected behavior. It would be safer to restore a check for an empty mode_name at the beginning of the function.
There was a problem hiding this comment.
Commit f622da7 removed if (!mode_name.empty()) guard. Now empty mode_name:
- findKey miss (no "" entry)
- Falls to else branch → new Mode("", ...) registered in map
- Invalid Mode with empty name lingers
Fix: guard early in function:
void
Sta::setCmdMode(std::string_view mode_name)
{
if (mode_name.empty())
return;
Mode *mode = findKey(mode_name_map_, std::string(mode_name));
...
Or report_->error(...) instead of silent return.
|
|
||
| The write_sdc command supports a -mode argument. | ||
|
|
||
| read_sdc [-mode mode] |
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: James Cherry <cherry@parallaxsw.com>
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
|
OpenROAD compilation will not succeed as we need the change in src/dbSta/CMakeLists.txt to update ${OPENSTA_HOME}/tcl/Variables.tcl to ${OPENSTA_HOME}/sdc/Variables.tcl as this file has been moved in OpenSTA to sdc/ from tcl/ |
Weekly upstream pull 05/05 has fix for one parallaxsw/OpenSTA#429 and another memory leak