odb: impl 3dblox verilog writer#9813
odb: impl 3dblox verilog writer#9813openroad-ci wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
Conversation
Signed-off-by: Ahmed R. Mohamed <ahmed@precisioninno.com>
There was a problem hiding this comment.
Code Review
The pull request introduces a new Verilog writer for 3Dblox, enabling the generation of Verilog connectivity files for hierarchical chiplets. This functionality is integrated into the OpenRoad class and exposed via Tcl commands. New unit and integration tests have been added to cover the new features, including specific tests for bump path filtering. The changes are well-structured and leverage modern C++ features like std::ranges::sort. One comment has been updated to reference a rule regarding the use of named constants instead of magic numbers.
|
|
||
| #include <memory> | ||
| #include <set> | ||
| #include <iostream> |
There was a problem hiding this comment.
The <iostream> header is typically used for std::cin, std::cout, std::cerr, etc. If these are only used in the corresponding .cc implementation file, it's generally better to include <iostream> there instead of in the header file. This helps to minimize compilation dependencies for files that include OpenRoad.hh.
There was a problem hiding this comment.
This is weird! I do not remember adding it myself. I thought it was in the file from the beginning. I'll remove it.
| // Write the Verilog connectivity file for this HIER chiplet. | ||
| writeVerilog(current_dir_path + chip->getName() + ".v", chip); |
There was a problem hiding this comment.
The writeDbx method now has a side effect of writing a Verilog connectivity file. While this might be intended for hierarchical chiplets, the method name writeDbx (presumably for 'write Dbx') does not clearly indicate this additional output. Consider renaming the method to better reflect its full functionality or making the Verilog writing an explicit, optional step if it's not always required when writing a Dbx file.
| const std::map< | ||
| dbChipInst*, | ||
| std::vector<std::pair<std::string, std::string>>>::const_iterator it | ||
| = inst_connections.find(chip_inst); |
| for (size_t j = 0; j < conns.size(); j++) { | ||
| const bool is_last = (j + 1 == conns.size()); | ||
| fmt::print(verilog_file, | ||
| " .{}({}){}\n", | ||
| conns[j].first, | ||
| conns[j].second, | ||
| is_last ? "" : ","); |
There was a problem hiding this comment.
| name = "Test3DBloxParser", | ||
| srcs = [ | ||
| "Test3DBloxParser.cpp", | ||
| "Test3DBloxVerilogWriter.cpp", |
There was a problem hiding this comment.
Adding Test3DBloxVerilogWriter.cpp to the srcs of Test3DBloxParser might lead to less modular test organization. It would be clearer to create a separate cc_test target for Test3DBloxVerilogWriter.cpp if its tests are distinct from Test3DBloxParser. This improves test discoverability and allows for more granular test execution.
| add_executable(TestGDSIn TestGDSIn.cpp) | ||
| add_executable(TestChips TestChips.cpp) | ||
| add_executable(Test3DBloxParser Test3DBloxParser.cpp) | ||
| add_executable(Test3DBloxParser Test3DBloxParser.cpp Test3DBloxVerilogWriter.cpp) |
There was a problem hiding this comment.
There was a problem hiding this comment.
Please address. It needs a separate executable IMO.
|
clang-tidy review says "All clean, LGTM! 👍" |
osamahammad21
left a comment
There was a problem hiding this comment.
I think having 3 test cases just for the verilog writer is an overkill, we should pick only one. I think that write_3dblox_verilog_nets is sufficient, but you think otherwise, choose whichever you prefer.
|
|
||
| #include <memory> | ||
| #include <set> | ||
| #include <iostream> |
| add_executable(TestGDSIn TestGDSIn.cpp) | ||
| add_executable(TestChips TestChips.cpp) | ||
| add_executable(Test3DBloxParser Test3DBloxParser.cpp) | ||
| add_executable(Test3DBloxParser Test3DBloxParser.cpp Test3DBloxVerilogWriter.cpp) |
There was a problem hiding this comment.
Please address. It needs a separate executable IMO.
|
|
||
| sta::define_cmd_args "write_3dblox_verilog" {filename} | ||
|
|
||
| proc write_3dblox_verilog { args } { |
There was a problem hiding this comment.
@maliberty @precisionmoon Do you think we need to expose this command?
Closes: #9709