From 4e7267d837c91c84900d655c391e6c82407778de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Fri, 22 May 2026 17:52:30 +0200 Subject: [PATCH 1/5] syn: Restore load-bearing `(int)` casts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partially revert a recent tidying commit which introduced a bug by removing those casts. Signed-off-by: Martin Povišer --- src/syn/src/flow/combinational_mapper.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/syn/src/flow/combinational_mapper.cc b/src/syn/src/flow/combinational_mapper.cc index 541ba79ba11..5451c692ad5 100644 --- a/src/syn/src/flow/combinational_mapper.cc +++ b/src/syn/src/flow/combinational_mapper.cc @@ -677,8 +677,8 @@ void Mapping::prepareMatches(const int npriority_cuts, int psSlot = 0; ClassMatch* matchBuf = allocMatches(nmatches_max); - for (int i = -1; i < cache[n1->fid].ps.size(); i++) { - for (int j = -1; j < cache[n2->fid].ps.size(); j++) { + for (int i = -1; i < (int) cache[n1->fid].ps.size(); i++) { + for (int j = -1; j < (int) cache[n2->fid].ps.size(); j++) { Net* n1Cut = ((i == -1) ? t1 : cache[n1->fid].ps[i].cut); Net* n2Cut = ((j == -1) ? t2 : cache[n2->fid].ps[j].cut); int n1CutLen = (i == -1) ? 1 : cutLen(n1Cut); From 67d6bb8bd641c078f6ace78a1524c8690f76efd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Fri, 22 May 2026 19:16:31 +0200 Subject: [PATCH 2/5] syn: Add slot check to parse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: Claude (various models) Signed-off-by: Martin Povišer --- src/syn/src/ir/Parse.cc | 8 +++++++- src/syn/test/parse_test.cc | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/syn/src/ir/Parse.cc b/src/syn/src/ir/Parse.cc index 793d3916f69..82a7de98112 100644 --- a/src/syn/src/ir/Parse.cc +++ b/src/syn/src/ir/Parse.cc @@ -539,7 +539,13 @@ class Parser error("unknown cell keyword: " + keyword); } - (void) id; + const uint32_t expected_slots = std::max(width, 1u); + if (g->tableSize() != id + expected_slots) { + error("'" + keyword + "' declared output width " + std::to_string(width) + + " but produced " + std::to_string(g->tableSize() - id) + " slot" + + (g->tableSize() - id == 1 ? "" : "s")); + } + expectNewline(); } diff --git a/src/syn/test/parse_test.cc b/src/syn/test/parse_test.cc index 3c79b1bcfef..bdecddbe8bf 100644 --- a/src/syn/test/parse_test.cc +++ b/src/syn/test/parse_test.cc @@ -2,6 +2,7 @@ // Copyright (c) 2026, The OpenROAD Authors #include +#include #include "gtest/gtest.h" #include "syn/ir/Graph.h" @@ -189,4 +190,13 @@ TEST(ParseTest, NonConsecutiveIds) } } +TEST(ParseTest, RejectsDeclaredWidthMismatch) +{ + std::istringstream is( + "%3:8 = input \"a\"\n" + "%11:8 = input \"b\"\n" + "%19:16 = mul %3:8 %11:8\n"); + EXPECT_THROW({ (void) Graph::parse(is); }, std::runtime_error); +} + } // namespace syn From 7da01e5040288ef33e4c73598caf65d09d3c0bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Fri, 22 May 2026 19:17:57 +0200 Subject: [PATCH 3/5] syn: Add combinational mapper unit tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: Claude (various models) Signed-off-by: Martin Povišer --- src/syn/include/syn/synthesis.h | 5 + src/syn/test/BUILD | 16 +++ src/syn/test/CMakeLists.txt | 2 +- src/syn/test/cm_test.cc | 246 ++++++++++++++++++++++++++++++++ src/syn/test/cm_test_cells.lib | 125 ++++++++++++++++ 5 files changed, 393 insertions(+), 1 deletion(-) create mode 100644 src/syn/test/cm_test.cc create mode 100644 src/syn/test/cm_test_cells.lib diff --git a/src/syn/include/syn/synthesis.h b/src/syn/include/syn/synthesis.h index 7cb80063988..49f6283138c 100644 --- a/src/syn/include/syn/synthesis.h +++ b/src/syn/include/syn/synthesis.h @@ -117,10 +117,15 @@ class Synthesis : public sta::dbStaState // Free-function entry points re-declared here so tests don't need to // pull in the private flow/ headers. The Synthesis methods of the same // names forward to these. +void bitblast(Graph& g, bool blast_arith = true); void mapSequentials(Graph& g, sta::Network* network, utl::Logger* logger, const Synthesis& syn); +void mapCombinationals(Graph& g, + sta::Network* network, + utl::Logger* logger, + const Synthesis& syn); void abcRoundtrip(Graph& g, const std::string& commands, utl::Logger* logger); void livenessOpt(Graph& g, utl::Logger* logger, diff --git a/src/syn/test/BUILD b/src/syn/test/BUILD index f34b22e9f55..c233c97fb82 100644 --- a/src/syn/test/BUILD +++ b/src/syn/test/BUILD @@ -76,6 +76,22 @@ cc_test( ], ) +cc_test( + name = "cm_test", + srcs = [ + "cm_test.cc", + "equivalence_check.h", + ], + data = ["cm_test_cells.lib"], + features = ["-layering_check"], + deps = [ + "//src/syn", + "//src/syn/src/ir", + "//src/tst", + "@googletest//:gtest", + ], +) + cc_test( name = "abc_test", srcs = ["abc_test.cc"], diff --git a/src/syn/test/CMakeLists.txt b/src/syn/test/CMakeLists.txt index 16839c990e1..3f6d23ade6d 100644 --- a/src/syn/test/CMakeLists.txt +++ b/src/syn/test/CMakeLists.txt @@ -32,7 +32,7 @@ target_link_libraries(liveness_test GTest::gtest syn_flow syn_ir utl_lib) gtest_discover_tests(liveness_test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) add_dependencies(build_and_test liveness_test) -foreach(_t abc_test sm_test) +foreach(_t abc_test sm_test cm_test) add_executable(${_t} ${_t}.cc) target_link_libraries(${_t} ${_syn_test_libs} syn_lib syn_flow syn_ir tst) gtest_discover_tests(${_t} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/syn/test/cm_test.cc b/src/syn/test/cm_test.cc new file mode 100644 index 00000000000..2ee5165e0fb --- /dev/null +++ b/src/syn/test/cm_test.cc @@ -0,0 +1,246 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2026, The OpenROAD Authors + +#include +#include +#include +#include + +#include "equivalence_check.h" +#include "gtest/gtest.h" +#include "syn/ir/Graph.h" +#include "syn/ir/Instance.h" +#include "syn/synthesis.h" +#include "tst/fixture.h" + +// ABC ships its own main() that wins over gtest_main when linked in. +// Provide our own to force the gtest entry point. +int main(int argc, char** argv) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} + +namespace syn { + +struct CmTestCase +{ + std::string_view name; + std::string_view ir; + // Best observed post-mapping area + 20% headroom. + float area_threshold; +}; + +// Net IDs 0/1/2 are the constant tie-off slots; instance IDs start at %3. +static const CmTestCase kCmTestCases[] = { + {.name = "SingleAnd", + .ir = R"( +%3:1 = input "a" +%4:1 = input "b" +%5:1 = and %3 %4 +%6:0 = output "y" %5 +)", + .area_threshold = 3.6f}, + + {.name = "NandFromAndThenNot", + .ir = R"( +%3:1 = input "a" +%4:1 = input "b" +%5:1 = and %3 %4 +%6:1 = not %5 +%7:0 = output "y" %6 +)", + .area_threshold = 2.4f}, + + {.name = "NorFromOrThenNot", + .ir = R"( +%3:1 = input "a" +%4:1 = input "b" +%5:1 = or %3 %4 +%6:1 = not %5 +%7:0 = output "y" %6 +)", + .area_threshold = 2.4f}, + + {.name = "Andnot", + .ir = R"( +%3:1 = input "a" +%4:1 = input "b" +%5:1 = andnot %3 %4 +%6:0 = output "y" %5 +)", + .area_threshold = 3.6f}, + + {.name = "AoiPattern", + .ir = R"( +%3:1 = input "a" +%4:1 = input "b" +%5:1 = input "c" +%6:1 = or %4 %5 +%7:1 = and %3 %6 +%8:1 = not %7 +%9:0 = output "y" %8 +)", + .area_threshold = 4.8f}, + + {.name = "OrOfAnds", + .ir = R"( +%3:1 = input "a" +%4:1 = input "b" +%5:1 = input "c" +%6:1 = input "d" +%7:1 = and %3 %4 +%8:1 = and %5 %6 +%9:1 = or %7 %8 +%10:0 = output "y" %9 +)", + .area_threshold = 7.2f}, + + {.name = "SharedFanin", + .ir = R"( +%3:1 = input "a" +%4:1 = input "b" +%5:1 = input "c" +%6:1 = and %3 %4 +%7:1 = and %3 %5 +%8:0 = output "y1" %6 +%9:0 = output "y2" %7 +)", + .area_threshold = 7.2f}, + + {.name = "FourInputAndTree", + .ir = R"( +%3:1 = input "a" +%4:1 = input "b" +%5:1 = input "c" +%6:1 = input "d" +%7:1 = and %3 %4 +%8:1 = and %5 %6 +%9:1 = and %7 %8 +%10:0 = output "y" %9 +)", + .area_threshold = 7.2f}, + + // y = (a & !s) | (b & s) + {.name = "MuxFromAig", + .ir = R"( +%3:1 = input "a" +%4:1 = input "b" +%5:1 = input "s" +%6:1 = andnot %3 %5 +%7:1 = and %4 %5 +%8:1 = or %6 %7 +%9:0 = output "y" %8 +)", + .area_threshold = 8.4f}, + + {.name = "ConstantOutput", + .ir = R"( +%3:0 = output "y0" 0 +%4:0 = output "y1" 1 +)", + .area_threshold = 2.4f}, + + {.name = "InverterOnly", + .ir = R"( +%3:1 = input "a" +%4:1 = not %3 +%5:0 = output "y" %4 +)", + .area_threshold = 1.2f}, + + // 12-bit adder: bitblast lowers `adc` to Han-Carlson AIG. Output is + // the 12-bit sum, dropping the carry-out at bit 12. + {.name = "Adder12", + .ir = R"( +%3:12 = input "a" +%15:12 = input "b" +%27:13 = adc %3:12 %15:12 0 +%40:0 = output "y" %27+0:12 +)", + .area_threshold = 280.8f}, + + // Truncated 6x6 unsigned multiplier (syn::Mul outputWidth = a.width()). + // bitblast lowers it to a Wallace tree feeding a Han-Carlson adder. + {.name = "Multiplier6", + .ir = R"( +%3:6 = input "a" +%9:6 = input "b" +%15:6 = mul %3:6 %9:6 +%21:0 = output "y" %15:6 +)", + .area_threshold = 265.2f}, +}; + +class CmTest : public tst::Fixture, + public ::testing::WithParamInterface +{ + protected: + void SetUp() override + { + Fixture::SetUp(); + readLiberty(getFilePath("_main/src/syn/test/cm_test_cells.lib")); + synthesis_ = std::make_unique(getDb(), + getSta(), + /*resizer=*/nullptr, + getLogger()); + } + + std::unique_ptr synthesis_; +}; + +TEST_P(CmTest, MapsBelowAreaAndIsEquivalent) +{ + const CmTestCase& tc = GetParam(); + + // bitblast lowers xor/adc/mul/… to AIG; mapper only handles And/Andnot/Or. + std::istringstream gold_is{std::string(tc.ir)}; + std::unique_ptr gold = Graph::parse(gold_is); + bitblast(*gold); + gold->normalize(); + + std::istringstream gate_is{std::string(tc.ir)}; + std::unique_ptr gate = Graph::parse(gate_is); + bitblast(*gate); + + mapCombinationals(*gate, getSta()->network(), getLogger(), *synthesis_); + + // Surviving instances must be Targets, plus IR scaffolding and the + // naming-only Nots that cm.cc:integrate() leaves behind. + float area = 0.0f; + gate->forEachInstance([&](const Instance* inst) { + if (inst->is() || inst->is() || inst->is() + || inst->is() || inst->is() || inst->is() + || inst->is()) { + return; + } + if (!inst->is()) { + std::ostringstream os; + gate->dumpInstance(os, inst); + ADD_FAILURE() << "Non-Target instance survived combinational mapping in " + "case " + << tc.name << ": " << os.str(); + return; + } + if (auto* t = inst->try_as()) { + area += t->cell()->area(); + } + }); + + EXPECT_LE(area, tc.area_threshold) + << "Mapped area " << area << " exceeds threshold " << tc.area_threshold + << " (best observed + 20% headroom) for case " << tc.name; + + EXPECT_TRUE(equivalenceCheck( + *gold, *gate, /*inputsDefined=*/true, /*allowRefinement=*/false)) + << "Combinational mapping changed the function for case " << tc.name; +} + +INSTANTIATE_TEST_SUITE_P(Cm, + CmTest, + ::testing::ValuesIn(kCmTestCases), + [](const ::testing::TestParamInfo& info) { + return std::string(info.param.name); + }); + +} // namespace syn diff --git a/src/syn/test/cm_test_cells.lib b/src/syn/test/cm_test_cells.lib new file mode 100644 index 00000000000..ee1b5294ed0 --- /dev/null +++ b/src/syn/test/cm_test_cells.lib @@ -0,0 +1,125 @@ +library(cm_test) { + delay_model : table_lookup; + time_unit : "1ns"; + voltage_unit : "1V"; + current_unit : "1mA"; + capacitive_load_unit(1, pf); + + cell(INV) { + area : 1; + pin(A) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "!A"; } + } + + cell(BUF) { + area : 2; + pin(A) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "A"; } + } + + cell(AND2) { + area : 3; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "A&B"; } + } + + cell(OR2) { + area : 3; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "A|B"; } + } + + cell(NAND2) { + area : 2; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "!(A&B)"; } + } + + cell(NOR2) { + area : 2; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "!(A|B)"; } + } + + cell(ANDNOT2) { + area : 3; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "A&!B"; } + } + + cell(ORNOT2) { + area : 3; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "A|!B"; } + } + + cell(XOR2) { + area : 5; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "(A&!B)|(!A&B)"; } + } + + cell(XNOR2) { + area : 5; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "(A&B)|(!A&!B)"; } + } + + cell(MUX2) { + area : 7; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(S) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "(A&!S)|(B&S)"; } + } + + cell(AOI21) { + area : 4; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(C) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "!(A&(B|C))"; } + } + + cell(OAI21) { + area : 4; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(C) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "!(A|(B&C))"; } + } + + cell(AO21) { + area : 5; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(C) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "A&(B|C)"; } + } + + cell(OA21) { + area : 5; + pin(A) { direction : input; capacitance : 0.001; } + pin(B) { direction : input; capacitance : 0.001; } + pin(C) { direction : input; capacitance : 0.001; } + pin(Y) { direction : output; function : "A|(B&C)"; } + } + + cell(TIELO) { + area : 1; + pin(Y) { direction : output; function : "0"; } + } + + cell(TIEHI) { + area : 1; + pin(Y) { direction : output; function : "1"; } + } +} From abc7d28d222852747c44029e7822a66221beab60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Fri, 22 May 2026 19:44:38 +0200 Subject: [PATCH 4/5] Add bazel tidying/linting exclusions for slang-elab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: Claude (various models) Signed-off-by: Martin Povišer --- bazel/bzl_fmt_test.sh | 9 +++++++-- bazel/bzl_lint_test.sh | 10 +++++++--- bazel/bzl_tidy.sh | 10 +++++++--- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/bazel/bzl_fmt_test.sh b/bazel/bzl_fmt_test.sh index c117698c867..30bfe5026c8 100755 --- a/bazel/bzl_fmt_test.sh +++ b/bazel/bzl_fmt_test.sh @@ -11,8 +11,13 @@ TOOL="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" [ -L MODULE.bazel ] || { echo "MODULE.bazel missing from runfiles" >&2; exit 1; } WORKSPACE="$(dirname "$(readlink MODULE.bazel)")" cd "$WORKSPACE" -# `git ls-files` skips submodule contents (src/sta, third-party/abc). +# `-c submodule.recurse=false` keeps git ls-files from descending into +# submodules (src/sta, third-party/abc, third-party/slang-elab and the +# fmt sub-submodule nested in it) — we never want to reformat files +# owned by another repo. The override is needed because CI sets +# submodule.recurse=true globally. # Explicit -mode=check -lint=off separates format errors from lint warnings, # and overrides the repo-root .buildifier.json default (mode: fix). -git ls-files '*.bazel' '*.bzl' '**/BUILD' 'BUILD' '**/WORKSPACE' 'WORKSPACE' -z \ +git -c submodule.recurse=false ls-files \ + '*.bazel' '*.bzl' '**/BUILD' 'BUILD' '**/WORKSPACE' 'WORKSPACE' -z \ | xargs -0 "$TOOL" -mode=check -lint=off diff --git a/bazel/bzl_lint_test.sh b/bazel/bzl_lint_test.sh index ae68c422b3a..b686f807181 100755 --- a/bazel/bzl_lint_test.sh +++ b/bazel/bzl_lint_test.sh @@ -11,8 +11,12 @@ TOOL="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" [ -L MODULE.bazel ] || { echo "MODULE.bazel missing from runfiles" >&2; exit 1; } WORKSPACE="$(dirname "$(readlink MODULE.bazel)")" cd "$WORKSPACE" -# `git ls-files` skips submodule contents (src/sta, third-party/abc), so -# we never try to reformat files owned by another repo. +# `-c submodule.recurse=false` keeps git ls-files from descending into +# submodules (src/sta, third-party/abc, third-party/slang-elab and the +# fmt sub-submodule nested in it) — we never want to reformat files +# owned by another repo. The override is needed because CI sets +# submodule.recurse=true globally. # Explicit -mode=check overrides the repo-root .buildifier.json default. -git ls-files '*.bazel' '*.bzl' '**/BUILD' 'BUILD' '**/WORKSPACE' 'WORKSPACE' -z \ +git -c submodule.recurse=false ls-files \ + '*.bazel' '*.bzl' '**/BUILD' 'BUILD' '**/WORKSPACE' 'WORKSPACE' -z \ | xargs -0 "$TOOL" -mode=check -lint=warn diff --git a/bazel/bzl_tidy.sh b/bazel/bzl_tidy.sh index 4a7e01e83a6..3af5cb921e3 100755 --- a/bazel/bzl_tidy.sh +++ b/bazel/bzl_tidy.sh @@ -6,7 +6,11 @@ set -euo pipefail TOOL="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" cd "${BUILD_WORKSPACE_DIRECTORY:-$PWD}" -# `git ls-files` skips submodule contents (src/sta, third-party/abc), -# so we never rewrite files owned by another repo. -git ls-files '*.bazel' '*.bzl' '**/BUILD' 'BUILD' '**/WORKSPACE' 'WORKSPACE' -z \ +# `-c submodule.recurse=false` keeps git ls-files from descending into +# submodules (src/sta, third-party/abc, third-party/slang-elab and the +# fmt sub-submodule nested in it) — we never want to rewrite files +# owned by another repo. The override is needed because CI sets +# submodule.recurse=true globally. +git -c submodule.recurse=false ls-files \ + '*.bazel' '*.bzl' '**/BUILD' 'BUILD' '**/WORKSPACE' 'WORKSPACE' -z \ | xargs -0 "$TOOL" -mode=fix -lint=fix From dba6a8e8e58402b9f8f319386311acdbddb0f397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Fri, 22 May 2026 20:46:56 +0200 Subject: [PATCH 5/5] syn: Rm redundant header for pedantic build's sake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Povišer --- src/syn/BUILD | 2 -- src/syn/src/flow/CMakeLists.txt | 2 +- src/syn/src/flow/bitblast.cc | 3 +-- src/syn/src/flow/bitblast.h | 12 ------------ src/syn/src/flow/combinational_mapper.cc | 2 -- src/syn/src/flow/combinational_mapper.h | 24 ------------------------ src/syn/src/synthesis.cpp | 2 -- src/syn/test/bitblast_test.cc | 3 +-- 8 files changed, 3 insertions(+), 47 deletions(-) delete mode 100644 src/syn/src/flow/bitblast.h delete mode 100644 src/syn/src/flow/combinational_mapper.h diff --git a/src/syn/BUILD b/src/syn/BUILD index 5fb9371ebf4..2587717e93c 100644 --- a/src/syn/BUILD +++ b/src/syn/BUILD @@ -16,9 +16,7 @@ cc_library( srcs = [ "src/flow/abc.cc", "src/flow/bitblast.cc", - "src/flow/bitblast.h", "src/flow/combinational_mapper.cc", - "src/flow/combinational_mapper.h", "src/flow/combinational_mapper_npn.cc", "src/flow/combinational_mapper_npn.h", "src/flow/constant_fold.cc", diff --git a/src/syn/src/flow/CMakeLists.txt b/src/syn/src/flow/CMakeLists.txt index 556102ac8c6..e974110313c 100644 --- a/src/syn/src/flow/CMakeLists.txt +++ b/src/syn/src/flow/CMakeLists.txt @@ -15,7 +15,7 @@ add_library(syn_flow ) set(_syn_flow_stage ${CMAKE_CURRENT_BINARY_DIR}/include/flow) -foreach(_h bitblast.h combinational_mapper.h combinational_mapper_npn.h export.h import.h opt_gatefusion.h) +foreach(_h combinational_mapper_npn.h export.h import.h opt_gatefusion.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${_h} ${_syn_flow_stage}/${_h} COPYONLY) endforeach() diff --git a/src/syn/src/flow/bitblast.cc b/src/syn/src/flow/bitblast.cc index 3c3095394d1..d01b08be948 100644 --- a/src/syn/src/flow/bitblast.cc +++ b/src/syn/src/flow/bitblast.cc @@ -4,8 +4,6 @@ // Bitblast pass: converts arithmetic operations and muxes // to And/Andnot/Or/Xor/Not gates. -#include "flow/bitblast.h" - #include #include #include @@ -22,6 +20,7 @@ #include "syn/ir/Graph.h" #include "syn/ir/Instance.h" #include "syn/ir/Net.h" +#include "syn/synthesis.h" namespace syn { diff --git a/src/syn/src/flow/bitblast.h b/src/syn/src/flow/bitblast.h deleted file mode 100644 index 118a7e1dcab..00000000000 --- a/src/syn/src/flow/bitblast.h +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// Copyright (c) 2026, The OpenROAD Authors - -#pragma once - -namespace syn { - -class Graph; - -void bitblast(Graph& g, bool blast_arith); - -} // namespace syn diff --git a/src/syn/src/flow/combinational_mapper.cc b/src/syn/src/flow/combinational_mapper.cc index 5451c692ad5..7355ba8983a 100644 --- a/src/syn/src/flow/combinational_mapper.cc +++ b/src/syn/src/flow/combinational_mapper.cc @@ -5,8 +5,6 @@ // standard cells from a liberty library using cut-based technology // mapping with NPN canonicalization. -#include "flow/combinational_mapper.h" - #include #include #include diff --git a/src/syn/src/flow/combinational_mapper.h b/src/syn/src/flow/combinational_mapper.h deleted file mode 100644 index 075c109c9b7..00000000000 --- a/src/syn/src/flow/combinational_mapper.h +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// Copyright (c) 2026, The OpenROAD Authors - -#pragma once - -namespace sta { -class Network; -} - -namespace utl { -class Logger; -} - -namespace syn { - -class Graph; -class Synthesis; - -void mapCombinationals(Graph& g, - sta::Network* network, - utl::Logger* logger, - const Synthesis& syn); - -} // namespace syn diff --git a/src/syn/src/synthesis.cpp b/src/syn/src/synthesis.cpp index 74fec8c2f98..d035dd29890 100644 --- a/src/syn/src/synthesis.cpp +++ b/src/syn/src/synthesis.cpp @@ -15,8 +15,6 @@ #include "db_sta/dbSta.hh" #include "elab/driver.h" -#include "flow/bitblast.h" -#include "flow/combinational_mapper.h" #include "flow/constant_fold.h" #include "flow/export.h" #include "flow/import.h" diff --git a/src/syn/test/bitblast_test.cc b/src/syn/test/bitblast_test.cc index d745f5ccb98..c50e241fef2 100644 --- a/src/syn/test/bitblast_test.cc +++ b/src/syn/test/bitblast_test.cc @@ -9,6 +9,7 @@ #include "syn/ir/Graph.h" #include "syn/ir/Instance.h" #include "syn/ir/Net.h" +#include "syn/synthesis.h" int main(int argc, char** argv) { @@ -18,8 +19,6 @@ int main(int argc, char** argv) namespace syn { -void bitblast(Graph& g, bool blast_arith = true); - // Rule 11 (Substitution): a & ~(a & b) → a & ~b (= andnot) TEST(BitblastTest, Rule11_Substitution) {