Integrate iFill metal fill#65
Open
zhaoxueyan1 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new iFill metal-fill flow to ecc-tools (rule JSON parsing + DBU conversion + conservative rectangular fill generation + iDB/vectorization integration), exposes it as run_ifill in Tcl, and fixes DEF FILLS serialization to use the correct IdbFill type path.
Changes:
- Introduces
ifill_core(fill generation) andifill_rule_parser(OpenROAD fin-style JSON rules → DBU) plus a runner that writes fills into iDB. - Adds
ifill_apiand a Tcl commandrun_ifill -rules <json> [-area {lx ly ux uy}] [-reset_fill 1], and wires iFill into the build. - Updates DEF writer to serialize layer fills vs via fills via
IdbFill::IdbFillType.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/operation/iFill/test/ifill_core_test.cpp | Adds a small unit test executable validating fill tiling, spacing, shape orientation, and rule parsing. |
| src/operation/iFill/test/CMakeLists.txt | Builds/registers test_ifill_core with CTest. |
| src/operation/iFill/source/ifill_runner.h | Declares runner options and the runner entrypoint. |
| src/operation/iFill/source/ifill_runner.cpp | Integrates rule parsing + vectorization occupancy + iDB fill list writeback. |
| src/operation/iFill/source/ifill_rule_parser.h | Declares the OpenROAD-style rule loader API. |
| src/operation/iFill/source/ifill_rule_parser.cpp | Implements JSON parsing and DBU conversion for layer fill rules. |
| src/operation/iFill/source/ifill_core.h | Defines core data structures and the fill generator API. |
| src/operation/iFill/source/ifill_core.cpp | Implements conservative rectangular fill generation with spacing rules. |
| src/operation/iFill/source/CMakeLists.txt | Adds ifill_core / ifill_runner libraries and their dependencies. |
| src/operation/iFill/CMakeLists.txt | Adds iFill subdirectories (source/api/test). |
| src/operation/iFill/api/ifill_api.h | Introduces a singleton API facade for iFill. |
| src/operation/iFill/api/ifill_api.cpp | Implements API call-through to the runner. |
| src/operation/iFill/api/CMakeLists.txt | Builds the ifill_api library. |
| src/operation/CMakeLists.txt | Wires iFill into the overall operation build. |
| src/interface/tcl/tcl_register.h | Registers iFill Tcl commands into the global Tcl registry. |
| src/interface/tcl/tcl_ifill/tcl_register_ifill.h | Adds registerCmdIFill() for run_ifill. |
| src/interface/tcl/tcl_ifill/tcl_ifill.h | Declares the run_ifill Tcl command class. |
| src/interface/tcl/tcl_ifill/tcl_ifill.cpp | Implements run_ifill argument parsing and invocation of ifill_api. |
| src/interface/tcl/tcl_ifill/CMakeLists.txt | Builds the tcl_ifill library and links it into the Tcl build. |
| src/interface/tcl/CMakeLists.txt | Adds and links the new tcl_ifill target. |
| src/database/manager/builder/def_builder/def_write.cpp | Fixes DEF FILLS serialization to emit LAYER ... RECT ... vs VIA ... (x y) based on fill type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+10
to
+15
| TclRunIFill::TclRunIFill(const char* cmd_name) : TclCmd(cmd_name) | ||
| { | ||
| addOption(new TclStringOption("-rules", 0)); | ||
| addOption(new TclIntListOption("-area", 1)); | ||
| addOption(new TclIntOption("-reset_fill", 1, 0)); | ||
| } |
Comment on lines
+1
to
+4
| #include <cassert> | ||
| #include <filesystem> | ||
| #include <fstream> | ||
| #include <vector> |
Comment on lines
+57
to
+72
| const std::filesystem::path path = std::filesystem::temp_directory_path() / "ifill_rule_test.json"; | ||
| std::ofstream out(path); | ||
| out << R"json({ | ||
| "layers": { | ||
| "Mx": { | ||
| "names": ["M1", "M2"], | ||
| "non-opc": { | ||
| "width": [2.0, 1.0], | ||
| "height": [1.0, 1.0], | ||
| "space_to_fill": 0.3, | ||
| "space_to_non_fill": 0.7 | ||
| } | ||
| } | ||
| } | ||
| })json"; | ||
| out.close(); |
Comment on lines
+74
to
+82
| const auto rules = ifill::loadLayerFillRules(path.string(), 1000); | ||
|
|
||
| assert(rules.size() == 2); | ||
| assert(rules[0].layer_name == "M1"); | ||
| assert((rules[0].shapes == std::vector<ifill::FillShape>{{2000, 1000}, {1000, 1000}})); | ||
| assert(rules[0].space_to_fill == 300); | ||
| assert(rules[0].space_to_non_fill == 700); | ||
| assert(rules[1].layer_name == "M2"); | ||
| } |
Comment on lines
+63
to
+68
| std::vector<LayerFillRule> loadLayerFillRules(const std::string& rule_file, int32_t dbu_per_micron) | ||
| { | ||
| std::ifstream in(rule_file); | ||
| if (!in.is_open()) { | ||
| throw std::runtime_error("failed to open ifill rule file: " + rule_file); | ||
| } |
Comment on lines
1116
to
+1120
| writestr("FILLS %d ;\n", fill_list->get_num_fill()); | ||
|
|
||
| for (IdbFill* fill : fill_list->get_fill_list()) { | ||
| writestr(" - LAYER %s ", fill->get_layer()->get_layer()->get_name().c_str()); | ||
| if (fill->get_type() == IdbFill::IdbFillType::kLayer) { | ||
| writestr(" - LAYER %s ", fill->get_layer()->get_layer()->get_name().c_str()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
iFillmetal-fill module with OpenROADfin-style JSON rule parsing, DBU conversion, conservative rectangular fill generation, and iDB/vectorization integration.run_ifill -rules <json> [-area {lx ly ux uy}] [-reset_fill 1]through Tcl and wire the module into the ecc-tools CMake build.FILLSserialization so layer fills and via fills are written through the correctIdbFilltype path.Verification
cmake --build build-ifill --target tcl_ifill -j1cmake --build build-ifill --target ifill_api -j1cmake --build build-ifill --target ecc_bin -j1ctest --test-dir build-ifill -R test_ifill_core --output-on-failure./bin/ecc_bin -script build-ifill/ifill_smoke.tcl, then verified generated DEF containsFILLSentries with- LAYER ... RECT ...