Skip to content

Integrate iFill metal fill#65

Open
zhaoxueyan1 wants to merge 1 commit into
mainfrom
integrate-ifill
Open

Integrate iFill metal fill#65
zhaoxueyan1 wants to merge 1 commit into
mainfrom
integrate-ifill

Conversation

@zhaoxueyan1

Copy link
Copy Markdown
Member

Summary

  • Add an iFill metal-fill module with OpenROAD fin-style JSON rule parsing, DBU conversion, conservative rectangular fill generation, and iDB/vectorization integration.
  • Expose run_ifill -rules <json> [-area {lx ly ux uy}] [-reset_fill 1] through Tcl and wire the module into the ecc-tools CMake build.
  • Fix DEF FILLS serialization so layer fills and via fills are written through the correct IdbFill type path.

Verification

  • cmake --build build-ifill --target tcl_ifill -j1
  • cmake --build build-ifill --target ifill_api -j1
  • cmake --build build-ifill --target ecc_bin -j1
  • ctest --test-dir build-ifill -R test_ifill_core --output-on-failure
  • ./bin/ecc_bin -script build-ifill/ifill_smoke.tcl, then verified generated DEF contains FILLS entries with - LAYER ... RECT ...

Copilot AI review requested due to automatic review settings June 9, 2026 03:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and ifill_rule_parser (OpenROAD fin-style JSON rules → DBU) plus a runner that writes fills into iDB.
  • Adds ifill_api and a Tcl command run_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());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants