Fix write_verilog escape seq Issue 3826#289
Fix write_verilog escape seq Issue 3826#289openroad-ci wants to merge 5 commits intoThe-OpenROAD-Project:masterfrom
Conversation
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
…d regression with another commit Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
|
Fix for The-OpenROAD-Project/OpenROAD-flow-scripts#3826 There are 2 src file changes and one testcase added in test/ directory to verify the golden output (.ok file), and one output is regoldened: src/sta/verilog/VerilogWriter.cc src/sta/network/VerilogNamespace.cc We also need to regolden the following test's expected putput in OpenROAD regression suite src/dbSta/test/hierwrite.tcl Details of fix in src/sta/network/VerilogNamespace.cc explaining the unescaping logic and the small bug I fixed there. The escaping logic was implemented in verilogToSta function. If any name in the Verilog input began with a "" it is considered an escaped name. In such a name, if either of "[" or "]" or "/" or "" is encountered, an extra "" is added and the leading "" (meaning the one on the front of the name) is skipped when storing as sta_name that is understood by code. There was a bug in the "unescaping" logic. Now when we convert from sta_name to a verilog name via staToVerilog or staToVerilog2 (to write into Verilog output), it should be inverse of the verilogToSta, i.e., if we encounter any "" in the name, it means it was escaped, so needs to be unescaped before writing as a verilog name. Unescaping logic is as follows if any character in sta_name was "", meaning it was escaped, and the following needs to be done : Ideally, we could just keep the logic of staToVerilog2 since it is a superset of staToVerilog but that would a bigger change. |
* Use a unique_ptr to avoid leaks * Use memmove instead of memcopy As both arguments can overlap, use memmove instead of memcopy * Fix code style issues
|
@vvbandeira PR-merge CI failed due to the OR regression fail. In this case, I think it is better to mark the CI as PASS because we can see the FAIL sign after bumping the OpenSTA version in OR. |
|
@vvbandeira is the OR CI running with version of the sta submodule? If so, then the failure would be of interest to this PR. |
Hi @maliberty yes the OR CI is running with the sta submodule, and this failure is related to my change- I debugged in detail too. The regression had a portname like this .in_$000({req_msg_a[15] in the expected verilog from write_verilog . caused the change that now the output verilog will have this $ sign in portname also escaped: .\in_$000 ({req_msg_a[15], So I think we needed to regolden the regression as this was a legit mistake in OpenSTA. Please note, even though both .in_$00 and .\in_$00 are readable portnames by read_verilog, an unescaped $ in verilog name is technically illegal so the latter should be correct. |
|
Ok so long as we know that it just an .ok update to OR. I plan to merge #288 first as it is quite large and I want to avoid merge conflicts in it. |
|
@jhkim-pii I plan to split the @maliberty |
No description provided.