diff --git a/src/odb/include/odb/db.h b/src/odb/include/odb/db.h index 8d3e978417..3c1c08b684 100644 --- a/src/odb/include/odb/db.h +++ b/src/odb/include/odb/db.h @@ -2555,7 +2555,10 @@ class dbNet : public dbObject /// /// Check if this net is internal to the given module. /// A net is internal if all its iterms belong to instances within the module - /// and it has no bterms. + /// (excluding sub-modules) and it has no bterms. + /// - A dbNet is also considered internal if it has a corresponding modnet + /// connected to a module output port that is unconnected in its parent + /// module (isInternalTo == true). /// bool isInternalTo(dbModule* module) const; @@ -8620,6 +8623,11 @@ class dbModNet : public dbObject /// std::vector getNextModNetsInFanout() const; + /// + /// Returns the first connected dbModNet in the parent module hierarchy. + /// + dbModNet* getFirstParentModNet() const; + /// /// Traverses the hierarchy in search of the first mod net that satisfies the /// given condition. diff --git a/src/odb/src/db/CMakeLists.txt b/src/odb/src/db/CMakeLists.txt index a6db19ecfc..4eadccb673 100644 --- a/src/odb/src/db/CMakeLists.txt +++ b/src/odb/src/db/CMakeLists.txt @@ -85,6 +85,7 @@ add_library(db dbGroupPowerNetItr.cpp dbGroupGroundNetItr.cpp dbGDSLib.cpp + dbSwapMasterSanityChecker.cpp # Generator Code Begin cpp dbAccessPoint.cpp dbBusPort.cpp diff --git a/src/odb/src/db/dbModInst.cpp b/src/odb/src/db/dbModInst.cpp index 4be31cde14..eeca8268a0 100644 --- a/src/odb/src/db/dbModInst.cpp +++ b/src/odb/src/db/dbModInst.cpp @@ -32,6 +32,7 @@ #include "dbModNet.h" #include "dbModuleModInstItr.h" #include "dbModuleModInstModITermItr.h" +#include "dbSwapMasterSanityChecker.h" #include "odb/dbBlockCallBackObj.h" #include "odb/dbObject.h" #include "odb/dbSet.h" @@ -775,6 +776,11 @@ dbModInst* dbModInst::swapMaster(dbModule* new_module) } } + if (logger->debugCheck(utl::ODB, "replace_design_check_sanity", 1)) { + dbSwapMasterSanityChecker checker(new_mod_inst, new_module, logger); + checker.run(); + } + return new_mod_inst; } diff --git a/src/odb/src/db/dbModNet.cpp b/src/odb/src/db/dbModNet.cpp index 9af2a0cf56..ac6199461d 100644 --- a/src/odb/src/db/dbModNet.cpp +++ b/src/odb/src/db/dbModNet.cpp @@ -264,6 +264,15 @@ void dbModNet::dump() const getParent()->getName(), getParent()->getId()); + dbNet* related_net = findRelatedNet(); + if (related_net != nullptr) { + logger->report(" Related dbNet: {} (id={})", + related_net->getName(), + related_net->getId()); + } else { + logger->report(" Related dbNet: "); + } + logger->report(" ModITerms ({}):", getModITerms().size()); for (dbModITerm* moditerm : getModITerms()) { // For dbModITerm, get types from child dbModBTerm @@ -730,6 +739,18 @@ std::vector dbModNet::getNextModNetsInFanout() const return next_modnets; } +dbModNet* dbModNet::getFirstParentModNet() const +{ + for (dbModBTerm* mod_bterm : getModBTerms()) { + if (dbModITerm* parent_iterm = mod_bterm->getParentModITerm()) { + if (dbModNet* parent_net = parent_iterm->getModNet()) { + return parent_net; + } + } + } + return nullptr; +} + dbModNet* dbModNet::findInHierarchy( const std::function& condition, dbHierSearchDir dir) const diff --git a/src/odb/src/db/dbModule.cpp b/src/odb/src/db/dbModule.cpp index d82de0c1e8..8722b28e45 100644 --- a/src/odb/src/db/dbModule.cpp +++ b/src/odb/src/db/dbModule.cpp @@ -889,6 +889,12 @@ void _dbModule::copyModuleInsts(dbModule* old_module, } // Check if the flat net is an internal net within old_module + // - If the old net is an internal net, a new net should be created. + // - If the old net is an external net, a new net will be created later + // by boundary IO handling logic. + // - Note that if old modnet is connected to a dbModBTerm and its + // corresponding dbModITerm is unconnected (has_parent_modnet == false), + // a new net should be created. // - If old_module is uninstantiated module, every net in the module is // an internal net. // e.g., No module instance. @@ -901,6 +907,22 @@ void _dbModule::copyModuleInsts(dbModule* old_module, // net_name = u0/_001_ <-- External net crossing module // boundary. std::string old_net_name = old_net->getName(); + dbModNet* old_mod_net = old_iterm->getModNet(); + bool has_parent_modnet + = (old_mod_net && old_mod_net->getFirstParentModNet()); + if (old_net->isInternalTo(old_module) == false && has_parent_modnet) { + // Skip external net crossing module boundary. + // It will be connected later. + debugPrint(logger, + utl::ODB, + "replace_design", + 3, + " Skip: non-internal dbNet '{}' of old_module '{}'.\n", + old_net_name, + old_module->getHierarchicalName()); + continue; + } + new_net_name += block->getBaseName(old_net_name.c_str()); auto it = new_net_name_map.find(new_net_name); if (it != new_net_name_map.end()) { diff --git a/src/odb/src/db/dbSwapMasterSanityChecker.cpp b/src/odb/src/db/dbSwapMasterSanityChecker.cpp new file mode 100644 index 0000000000..0e8ca569ee --- /dev/null +++ b/src/odb/src/db/dbSwapMasterSanityChecker.cpp @@ -0,0 +1,552 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2020-2025, The OpenROAD Authors + +#include "dbSwapMasterSanityChecker.h" + +#include +#include +#include +#include + +#include "boost/container/small_vector.hpp" +#include "dbModule.h" +#include "odb/db.h" +#include "odb/dbSet.h" +#include "utl/Logger.h" + +namespace odb { + +dbSwapMasterSanityChecker::dbSwapMasterSanityChecker(dbModInst* new_mod_inst, + dbModule* src_module, + utl::Logger* logger) + : new_mod_inst_(new_mod_inst), + new_master_(new_mod_inst->getMaster()), + src_module_(src_module), + parent_(new_mod_inst->getParent()), + logger_(logger) +{ +} + +int dbSwapMasterSanityChecker::run() +{ + warn_count_ = 0; + error_count_ = 0; + + checkStructuralIntegrity(); + if (error_count_ > 0) { + // Structural integrity failed — remaining checks would dereference + // invalid pointers (e.g., null parent_ or new_master_). + logger_->error(utl::ODB, + 512, + "swapMaster structural integrity failed: {} error(s) " + "detected, aborting.", + error_count_); + } + + checkPortPinMatching(); + checkHierNetConnectivity(); + checkFlatNetConnectivity(); + checkInstanceHierarchy(); + checkHashTableIntegrity(); + checkNoDanglingObjects(); + checkCombinationalLoops(); + + const int total = warn_count_ + error_count_; + if (total == 0) { + logger_->info(utl::ODB, 496, "swapMaster sanity check passed (0 failures)"); + } else { + logger_->info(utl::ODB, + 497, + "swapMaster sanity check completed with {} warning(s) " + "and {} error(s)", + warn_count_, + error_count_); + } + + if (error_count_ > 0) { + logger_->error(utl::ODB, + 499, + "swapMaster sanity check: {} error(s) detected, " + "aborting. See warnings above for details.", + error_count_); + } + + return total; +} + +void dbSwapMasterSanityChecker::warnMsg(const std::string& msg) +{ + ++warn_count_; + logger_->warn(utl::ODB, 498, "SanityCheck(swapMaster) warning: {}", msg); +} + +void dbSwapMasterSanityChecker::errorMsg(const std::string& msg) +{ + ++error_count_; + logger_->warn(utl::ODB, 508, "SanityCheck(swapMaster) error: {}", msg); +} + +std::string dbSwapMasterSanityChecker::masterContext() const +{ + return fmt::format("module '{}' (inst '{}')", + new_master_->getName(), + new_mod_inst_->getName()); +} + +// 1. Structural integrity: basic pointer consistency [ERROR] +void dbSwapMasterSanityChecker::checkStructuralIntegrity() +{ + if (parent_ == nullptr) { + error("new_mod_inst '{}' has null parent", new_mod_inst_->getName()); + return; + } + + if (new_master_ == nullptr) { + error("new_mod_inst '{}' has null master", new_mod_inst_->getName()); + return; + } + + if (new_master_->getModInst() != new_mod_inst_) { + error("{}: getModInst() != new_mod_inst (reverse pointer mismatch)", + masterContext()); + } + + dbModInst* found = parent_->findModInst(new_mod_inst_->getName()); + if (found != new_mod_inst_) { + error("parent->findModInst('{}') does not return new_mod_inst", + new_mod_inst_->getName()); + } +} + +// 2. Port/pin matching: ModITerm <-> ModBTerm bidirectional links +// Broken links / count mismatch → ERROR, IO type mismatch → WARNING +void dbSwapMasterSanityChecker::checkPortPinMatching() +{ + const std::string ctx = masterContext(); + + // Count ModITerms while checking bidirectional links + int iterm_count = new_mod_inst_->getModITerms().size(); + for (dbModITerm* iterm : new_mod_inst_->getModITerms()) { + dbModBTerm* child_bterm = iterm->getChildModBTerm(); + if (child_bterm == nullptr) { + error("{}: ModITerm '{}' has null child ModBTerm", ctx, iterm->getName()); + continue; + } + + dbModITerm* back_iterm = child_bterm->getParentModITerm(); + if (back_iterm != iterm) { + error( + "{}: ModITerm '{}' -> child ModBTerm -> getParentModITerm() " + "doesn't point back", + ctx, + iterm->getName()); + } + + if (std::string(iterm->getName()) != std::string(child_bterm->getName())) { + error("{}: ModITerm name '{}' != child ModBTerm name '{}'", + ctx, + iterm->getName(), + child_bterm->getName()); + } + } + + // Count ModBTerms while checking parent ModITerm links + int bterm_count = 0; + for (dbModBTerm* bterm : new_master_->getModBTerms()) { + if (bterm->isBusPort()) { + continue; // Bus-level headers don't have ModITerms by design + } + ++bterm_count; + + dbModITerm* parent_iterm = bterm->getParentModITerm(); + if (parent_iterm == nullptr) { + error( + "{}: ModBTerm '{}' has null parent ModITerm", ctx, bterm->getName()); + continue; + } + if (parent_iterm->getParent() != new_mod_inst_) { + error("{}: ModBTerm '{}' parent ModITerm doesn't belong to new_mod_inst", + ctx, + bterm->getName()); + } + } + + if (iterm_count != bterm_count) { + error("{}: ModITerm count ({}) != ModBTerm count ({})", + ctx, + iterm_count, + bterm_count); + } + + // Check IO type consistency between new_master_ and src_module_ + for (dbModBTerm* new_bterm : new_master_->getModBTerms()) { + dbModBTerm* src_bterm = src_module_->findModBTerm(new_bterm->getName()); + if (src_bterm == nullptr) { + continue; + } + if (new_bterm->getIoType() != src_bterm->getIoType()) { + warn("{}: ModBTerm '{}' IO type mismatch: new={} src={}", + ctx, + new_bterm->getName(), + new_bterm->getIoType().getString(), + src_bterm->getIoType().getString()); + } + } +} + +// 3. Hierarchical net connectivity +// Wrong parent / missing reverse link → ERROR +// Zero connections / missing internal ModNet → WARNING +void dbSwapMasterSanityChecker::checkHierNetConnectivity() +{ + const std::string ctx = masterContext(); + + // Each ModITerm connected to a ModNet: net's parent should be parent_ + for (dbModITerm* iterm : new_mod_inst_->getModITerms()) { + dbModNet* mod_net = iterm->getModNet(); + if (mod_net == nullptr) { + continue; + } + + if (mod_net->getParent() != parent_) { + error( + "{}: ModITerm '{}' connected to ModNet '{}' whose parent is not " + "the parent module", + ctx, + iterm->getName(), + mod_net->getName()); + } + + // Verify reverse link: the ModNet's ModITerms should contain this iterm + bool found = false; + for (dbModITerm* net_iterm : mod_net->getModITerms()) { + if (net_iterm == iterm) { + found = true; + break; + } + } + if (found == false) { + error( + "{}: ModNet '{}' does not contain ModITerm '{}' in its " + "ModITerms list", + ctx, + mod_net->getName(), + iterm->getName()); + } + } + + // All ModNets inside new_master_: parent == new_master_, connectionCount > 0 + for (dbModNet* mod_net : new_master_->getModNets()) { + if (mod_net->getParent() != new_master_) { + error("{}: Internal ModNet '{}' parent is not new_master", + ctx, + mod_net->getName()); + } + if (mod_net->connectionCount() == 0) { + warn("{}: Internal ModNet '{}' has zero connections", + ctx, + mod_net->getName()); + } + } + + // Each ModBTerm in new_master_: should have internal ModNet connection + for (dbModBTerm* bterm : new_master_->getModBTerms()) { + if (bterm->isBusPort()) { + continue; // Bus-level headers don't carry internal ModNet connections + } + if (bterm->getModNet() == nullptr) { + warn("{}: ModBTerm '{}' has no internal ModNet connection", + ctx, + bterm->getName()); + } + } + + // Call checkSanity on each internal ModNet + for (dbModNet* mod_net : new_master_->getModNets()) { + mod_net->checkSanity(); + } +} + +// 4. Flat net connectivity +// Wrong block → ERROR +void dbSwapMasterSanityChecker::checkFlatNetConnectivity() +{ + const std::string ctx = masterContext(); + + // For each dbInst inside new_master_: verify flat net consistency + dbBlock* block = new_master_->getOwner(); + for (dbInst* inst : new_master_->getInsts()) { + if (inst->getModule() != new_master_) { + // This is checked in checkInstanceHierarchy, skip here + continue; + } + for (dbITerm* iterm : inst->getITerms()) { + dbNet* net = iterm->getNet(); + + // If ITerm has an internal ModNet but no flat net, the flat net + // backing the hierarchical connection is missing. + // Exception: if the ITerm is an output and the ModNet has no input + // consumers, the signal is a dead-end output (producer with no + // load) and the flat net absence is benign. + if (net == nullptr) { + dbModNet* mod_net = iterm->getModNet(); + if (mod_net != nullptr && mod_net->getParent() == new_master_) { + // Check if this is a dead-end output (no internal consumers) + bool has_input_consumer = false; + if (iterm->isOutputSignal()) { + for (dbITerm* net_iterm : mod_net->getITerms()) { + if (net_iterm->isInputSignal()) { + has_input_consumer = true; + break; + } + } + } else { + has_input_consumer = true; // ITerm itself is a consumer + } + if (has_input_consumer) { + error( + "{}: ITerm '{}' of inst '{}' has internal ModNet '{}' but " + "no flat net (missing internal net creation)", + ctx, + iterm->getName(), + inst->getName(), + mod_net->getName()); + } + } + continue; + } + + if (net->getBlock() != block) { + error("{}: ITerm '{}' of inst '{}' connected to net in wrong block", + ctx, + iterm->getName(), + inst->getName()); + } + } + } +} + +// 5. Instance hierarchy: verify instances belong to correct modules [ERROR] +void dbSwapMasterSanityChecker::checkInstanceHierarchy() +{ + const std::string ctx = masterContext(); + + // All dbInsts in new_master_: each inst's getModule() == new_master_ + for (dbInst* inst : new_master_->getInsts()) { + if (inst->getModule() != new_master_) { + error("{}: dbInst '{}' has wrong module pointer", ctx, inst->getName()); + } + } + + // All child ModInsts in new_master_: parent == new_master_, master != nullptr + for (dbModInst* child : new_master_->getModInsts()) { + if (child->getParent() != new_master_) { + error("{}: child ModInst '{}' has wrong parent", ctx, child->getName()); + } + if (child->getMaster() == nullptr) { + error("{}: child ModInst '{}' has null master", ctx, child->getName()); + } + } + + // Instance counts should match src_module_ + int new_db_inst_count = new_master_->getDbInstCount(); + int src_db_inst_count = src_module_->getDbInstCount(); + if (new_db_inst_count != src_db_inst_count) { + error("{}: dbInst count mismatch: new_master={} src_module={}", + ctx, + new_db_inst_count, + src_db_inst_count); + } + + int new_mod_inst_count = new_master_->getModInstCount(); + int src_mod_inst_count = src_module_->getModInstCount(); + if (new_mod_inst_count != src_mod_inst_count) { + error("{}: ModInst count mismatch: new_master={} src_module={}", + ctx, + new_mod_inst_count, + src_mod_inst_count); + } +} + +// 6. Hash table integrity: verify internal hash tables match actual sets +// [WARNING] +void dbSwapMasterSanityChecker::checkHashTableIntegrity() +{ + const std::string ctx = masterContext(); + + _dbModule* mod_impl = (_dbModule*) new_master_; + + // ModBTerm hash + int hash_bterm_count = static_cast(mod_impl->modbterm_hash_.size()); + int set_bterm_count = new_master_->getModBTerms().size(); + for (dbModBTerm* bterm : new_master_->getModBTerms()) { + // Cross-check: findModBTerm should return same object + dbModBTerm* found = new_master_->findModBTerm(bterm->getName()); + if (found != bterm) { + warn("{}: findModBTerm('{}') returns different object", + ctx, + bterm->getName()); + } + } + if (hash_bterm_count != set_bterm_count) { + warn("{}: modbterm_hash_ size ({}) != getModBTerms size ({})", + ctx, + hash_bterm_count, + set_bterm_count); + } + + // ModNet hash + int hash_net_count = static_cast(mod_impl->modnet_hash_.size()); + int set_net_count = new_master_->getModNets().size(); + if (hash_net_count != set_net_count) { + warn("{}: modnet_hash_ size ({}) != getModNets size ({})", + ctx, + hash_net_count, + set_net_count); + } + + // ModInst hash + int hash_modinst_count = static_cast(mod_impl->modinst_hash_.size()); + int set_modinst_count = new_master_->getModInsts().size(); + if (hash_modinst_count != set_modinst_count) { + warn("{}: modinst_hash_ size ({}) != getModInsts size ({})", + ctx, + hash_modinst_count, + set_modinst_count); + } + + // dbInst hash + int hash_dbinst_count = static_cast(mod_impl->dbinst_hash_.size()); + int set_dbinst_count = new_master_->getInsts().size(); + if (hash_dbinst_count != set_dbinst_count) { + warn("{}: dbinst_hash_ size ({}) != getInsts size ({})", + ctx, + hash_dbinst_count, + set_dbinst_count); + } +} + +// 7. No dangling objects: verify no orphaned ModNets remain [WARNING] +void dbSwapMasterSanityChecker::checkNoDanglingObjects() +{ + // Check ModNets in parent module for zero connections + // (new_master_ ModNets are already checked in checkHierNetConnectivity) + for (dbModNet* mod_net : parent_->getModNets()) { + if (mod_net->connectionCount() == 0) { + warn("ModNet '{}' in parent module has zero connections", + mod_net->getName()); + } + } +} + +// 8. Combinational loop detection in the flat netlist within new_master_ +// [ERROR] +void dbSwapMasterSanityChecker::checkCombinationalLoops() +{ + const std::string ctx = masterContext(); + + // Build instance index map for instances in new_master_ + std::unordered_map inst_to_idx; + std::vector insts; + for (dbInst* inst : new_master_->getInsts()) { + inst_to_idx[inst] = static_cast(insts.size()); + insts.push_back(inst); + } + + if (insts.empty()) { + return; + } + + const int n = static_cast(insts.size()); + + // Build adjacency list: edge from inst A to inst B if A has an output + // ITerm connected to a net that has an input ITerm on B. + std::vector> adj(n); + for (int i = 0; i < n; i++) { + for (dbITerm* iterm : insts[i]->getITerms()) { + if (!iterm->isOutputSignal()) { + continue; + } + dbNet* net = iterm->getNet(); + if (net == nullptr) { + continue; + } + for (dbITerm* sink : net->getITerms()) { + if (sink == iterm) { + continue; + } + if (!sink->isInputSignal()) { + continue; + } + auto it = inst_to_idx.find(sink->getInst()); + if (it != inst_to_idx.end()) { + adj[i].push_back(it->second); + } + } + } + } + + // Iterative DFS-based cycle detection with path tracking + enum DfsState + { + kUnvisited, + kInPath, + kProcessed + }; + std::vector state(n, kUnvisited); + std::vector path; + // DFS stack: (node, index into adj[node]) + std::vector> stack; + + for (int start = 0; start < n; start++) { + if (state[start] != kUnvisited) { + continue; + } + + stack.emplace_back(start, 0); + state[start] = kInPath; + path.push_back(start); + + while (!stack.empty()) { + auto& [u, edge_idx] = stack.back(); + + if (edge_idx < static_cast(adj[u].size())) { + int v = adj[u][edge_idx]; + ++edge_idx; + + if (state[v] == kInPath) { + // Found a cycle — collect instances in the loop + std::string loop_path; + bool in_loop = false; + for (int idx : path) { + if (idx == v) { + in_loop = true; + } + if (in_loop) { + if (loop_path.empty() == false) { + loop_path += " -> "; + } + loop_path += insts[idx]->getName(); + } + } + loop_path += " -> "; + loop_path += insts[v]->getName(); + error("{}: combinational loop detected: {}", ctx, loop_path); + return; + } + if (state[v] == kUnvisited) { + state[v] = kInPath; + path.push_back(v); + stack.emplace_back(v, 0); + } + } else { + // All neighbors processed, backtrack + path.pop_back(); + state[u] = kProcessed; + stack.pop_back(); + } + } + } +} + +} // namespace odb diff --git a/src/odb/src/db/dbSwapMasterSanityChecker.h b/src/odb/src/db/dbSwapMasterSanityChecker.h new file mode 100644 index 0000000000..8d4c46c160 --- /dev/null +++ b/src/odb/src/db/dbSwapMasterSanityChecker.h @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2020-2025, The OpenROAD Authors + +#pragma once + +#include + +#include "spdlog/fmt/fmt.h" // NOLINT(misc-include-cleaner) + +namespace utl { +class Logger; +} + +namespace odb { + +class dbModInst; +class dbModule; + +class dbSwapMasterSanityChecker +{ + public: + dbSwapMasterSanityChecker(dbModInst* new_mod_inst, + dbModule* src_module, + utl::Logger* logger); + + // Run all sanity checks. Returns total number of issues (warn + error). + // Calls logger_->error() (throws) if any error-level issue was found. + int run(); + + private: + void checkStructuralIntegrity(); + void checkPortPinMatching(); + void checkHierNetConnectivity(); + void checkFlatNetConnectivity(); + void checkInstanceHierarchy(); + void checkHashTableIntegrity(); + void checkNoDanglingObjects(); + void checkCombinationalLoops(); + + // Log a warning-level issue (non-fatal) + template + void warn(const std::string& fmt_str, const Args&... args) + { + warnMsg(fmt::format(fmt::runtime(fmt_str), args...)); + } + // Log an error-level issue (fatal — triggers logger_->error() at end of run) + template + void error(const std::string& fmt_str, const Args&... args) + { + errorMsg(fmt::format(fmt::runtime(fmt_str), args...)); + } + + void warnMsg(const std::string& msg); + void errorMsg(const std::string& msg); + + // Context string for log messages: "module '' (inst '')" + std::string masterContext() const; + + dbModInst* new_mod_inst_{nullptr}; + dbModule* new_master_{nullptr}; + dbModule* src_module_{nullptr}; + dbModule* parent_{nullptr}; + utl::Logger* logger_{nullptr}; + int warn_count_{0}; + int error_count_{0}; +}; + +} // namespace odb diff --git a/src/odb/test/cpp/TestSwapMasterUnusedPort.cpp b/src/odb/test/cpp/TestSwapMasterUnusedPort.cpp index 2e974bc4be..084aeb5c11 100644 --- a/src/odb/test/cpp/TestSwapMasterUnusedPort.cpp +++ b/src/odb/test/cpp/TestSwapMasterUnusedPort.cpp @@ -8,6 +8,7 @@ #include "gtest/gtest.h" #include "odb/db.h" #include "tst/fixture.h" +#include "utl/Logger.h" namespace odb { @@ -84,6 +85,9 @@ class TestSwapMasterUnusedPort : public tst::Fixture // - Expected: Internal Net (in1 -> buf_b) must exist even if in1 is unused. TEST_F(TestSwapMasterUnusedPort, SwapMasterUnusedPortInternalConn) { + // Enable sanity checker for swapMaster + logger_.setDebugLevel(utl::ODB, "replace_design_check_sanity", 1); + auto* buf_master = lib_->findMaster("BUF_X1"); ASSERT_NE(buf_master, nullptr); diff --git a/src/odb/test/replace_hier_mod1.ok b/src/odb/test/replace_hier_mod1.ok index 698b1b6a00..94f77ba8ee 100644 --- a/src/odb/test/replace_hier_mod1.ok +++ b/src/odb/test/replace_hier_mod1.ok @@ -127,6 +127,7 @@ Corner: slow Equivalence check - pre Repair timing output passed/skipped equivalence test ### swap bc1 to inv_chain ### +[INFO ODB-0496] swapMaster sanity check passed (0 failures) [INFO GPL-0006] Execute incremental mode global placement. [INFO GPL-0001] ---- Initialize GPL Main Data Structures [INFO GPL-0002] DBU: 2000 @@ -292,6 +293,7 @@ Corner: slow Equivalence check - swap (buffer_chain -> inv_chain) Repair timing output passed/skipped equivalence test ### swap bc1 back to buffer_chain ### +[INFO ODB-0496] swapMaster sanity check passed (0 failures) [INFO GPL-0006] Execute incremental mode global placement. [INFO GPL-0001] ---- Initialize GPL Main Data Structures [INFO GPL-0002] DBU: 2000 @@ -433,6 +435,7 @@ Corner: slow Equivalence check - swap for rollback (inv_chain -> buffer_chain) Repair timing output passed/skipped equivalence test ### swap bc1 back to inv_chain ### +[INFO ODB-0496] swapMaster sanity check passed (0 failures) [INFO GPL-0006] Execute incremental mode global placement. [INFO GPL-0001] ---- Initialize GPL Main Data Structures [INFO GPL-0002] DBU: 2000 diff --git a/src/odb/test/replace_hier_mod1.tcl b/src/odb/test/replace_hier_mod1.tcl index 231664f87b..18db22505b 100644 --- a/src/odb/test/replace_hier_mod1.tcl +++ b/src/odb/test/replace_hier_mod1.tcl @@ -42,6 +42,7 @@ run_equivalence_test replace_hier_mod1 \ puts "### swap bc1 to inv_chain ###" #set_debug_level ODB replace_design 1 +set_debug_level ODB replace_design_check_sanity 1 replace_hier_module bc1 inv_chain global_placement -skip_nesterov_place -incremental detailed_placement diff --git a/src/odb/test/replace_hier_mod2.ok b/src/odb/test/replace_hier_mod2.ok index d43bfdafe5..8bf3140d10 100644 --- a/src/odb/test/replace_hier_mod2.ok +++ b/src/odb/test/replace_hier_mod2.ok @@ -49,6 +49,7 @@ Cell type report: Count Area Inverter 9 33.78 Multi-Input combinational cell 37 192.68 Total 62 346.58 +[INFO ODB-0496] swapMaster sanity check passed (0 failures) [WARNING EST-0018] wire capacitance for corner default is zero. Use the set_wire_rc command to set wire resistance and capacitance. Startpoint: dpath.b_reg.out[4]$_DFFE_PP_ (rising edge-triggered flip-flop clocked by CLK) @@ -62,33 +63,29 @@ Path Type: max 0.32 0.32 v dpath.b_reg.out[4]$_DFFE_PP_/Q (sky130_fd_sc_hd__dfxtp_1) 0.00 0.32 v _330_/A (sky130_fd_sc_hd__xnor2_1) 0.58 0.89 ^ _330_/Y (sky130_fd_sc_hd__xnor2_1) - 0.00 0.89 ^ _551_/_103_/A (sky130_fd_sc_hd__nand4_1) - 0.19 1.08 v _551_/_103_/Y (sky130_fd_sc_hd__nand4_1) - 0.00 1.08 v _551_/_104_/A2 (sky130_fd_sc_hd__o221ai_1) - 0.25 1.33 ^ _551_/_104_/Y (sky130_fd_sc_hd__o221ai_1) - 0.00 1.33 ^ _551_/_163_/A (sky130_fd_sc_hd__buf_4) - 0.13 1.46 ^ _551_/_163_/X (sky130_fd_sc_hd__buf_4) - 0.00 1.46 ^ _551_/_080_/A (sky130_fd_sc_hd__nand2_1) - 0.07 1.53 v _551_/_080_/Y (sky130_fd_sc_hd__nand2_1) - 0.00 1.53 v _551_/_095_/A1 (sky130_fd_sc_hd__a21oi_1) - 0.14 1.67 ^ _551_/_095_/Y (sky130_fd_sc_hd__a21oi_1) - 0.00 1.67 ^ _551_/_134_/A2 (sky130_fd_sc_hd__o21ai_0) - 0.09 1.76 v _551_/_134_/Y (sky130_fd_sc_hd__o21ai_0) - 0.00 1.76 v _551_/_173_/A (sky130_fd_sc_hd__buf_4) - 0.13 1.88 v _551_/_173_/X (sky130_fd_sc_hd__buf_4) - 0.00 1.88 v _carry_out_and_/C (sky130_fd_sc_hd__and4_1) - 0.15 2.03 v _carry_out_and_/X (sky130_fd_sc_hd__and4_1) - 0.00 2.03 v carry_out (out) - 2.03 data arrival time + 0.00 0.89 ^ _551_/_091_/A1 (sky130_fd_sc_hd__a21oi_1) + 0.17 1.06 v _551_/_091_/Y (sky130_fd_sc_hd__a21oi_1) + 0.00 1.06 v _551_/_092_/A2 (sky130_fd_sc_hd__o21ai_0) + 0.23 1.29 ^ _551_/_092_/Y (sky130_fd_sc_hd__o21ai_0) + 0.00 1.29 ^ _551_/_095_/B1 (sky130_fd_sc_hd__a21oi_1) + 0.07 1.36 v _551_/_095_/Y (sky130_fd_sc_hd__a21oi_1) + 0.00 1.36 v _551_/_134_/A2 (sky130_fd_sc_hd__o21ai_0) + 0.14 1.50 ^ _551_/_134_/Y (sky130_fd_sc_hd__o21ai_0) + 0.00 1.50 ^ _551_/_173_/A (sky130_fd_sc_hd__buf_4) + 0.12 1.62 ^ _551_/_173_/X (sky130_fd_sc_hd__buf_4) + 0.00 1.62 ^ _carry_out_and_/C (sky130_fd_sc_hd__and4_1) + 0.14 1.76 ^ _carry_out_and_/X (sky130_fd_sc_hd__and4_1) + 0.00 1.76 ^ carry_out (out) + 1.76 data arrival time 1.00 1.00 max_delay 0.00 1.00 output external delay 1.00 data required time --------------------------------------------------------- 1.00 data required time - -2.03 data arrival time + -1.76 data arrival time --------------------------------------------------------- - -1.03 slack (VIOLATED) + -0.76 slack (VIOLATED) Cell type report for _551_ (LCU_16_KOGGE_STONE__551_) @@ -97,6 +94,7 @@ Cell type report: Count Area Inverter 5 18.77 Multi-Input combinational cell 82 384.12 Total 103 523.00 +[INFO ODB-0496] swapMaster sanity check passed (0 failures) [WARNING EST-0018] wire capacitance for corner default is zero. Use the set_wire_rc command to set wire resistance and capacitance. Startpoint: dpath.b_reg.out[4]$_DFFE_PP_ (rising edge-triggered flip-flop clocked by CLK) @@ -147,6 +145,7 @@ Cell type report: Count Area Total 62 346.58 Checking equivalence after swap #2 (Rollback)... Repair timing output passed/skipped equivalence test +[INFO ODB-0496] swapMaster sanity check passed (0 failures) [WARNING EST-0018] wire capacitance for corner default is zero. Use the set_wire_rc command to set wire resistance and capacitance. Startpoint: dpath.b_reg.out[4]$_DFFE_PP_ (rising edge-triggered flip-flop clocked by CLK) @@ -160,33 +159,29 @@ Path Type: max 0.32 0.32 v dpath.b_reg.out[4]$_DFFE_PP_/Q (sky130_fd_sc_hd__dfxtp_1) 0.00 0.32 v _330_/A (sky130_fd_sc_hd__xnor2_1) 0.58 0.89 ^ _330_/Y (sky130_fd_sc_hd__xnor2_1) - 0.00 0.89 ^ _551_/_103_/A (sky130_fd_sc_hd__nand4_1) - 0.19 1.08 v _551_/_103_/Y (sky130_fd_sc_hd__nand4_1) - 0.00 1.08 v _551_/_104_/A2 (sky130_fd_sc_hd__o221ai_1) - 0.25 1.33 ^ _551_/_104_/Y (sky130_fd_sc_hd__o221ai_1) - 0.00 1.33 ^ _551_/_163_/A (sky130_fd_sc_hd__buf_4) - 0.13 1.46 ^ _551_/_163_/X (sky130_fd_sc_hd__buf_4) - 0.00 1.46 ^ _551_/_080_/A (sky130_fd_sc_hd__nand2_1) - 0.07 1.53 v _551_/_080_/Y (sky130_fd_sc_hd__nand2_1) - 0.00 1.53 v _551_/_095_/A1 (sky130_fd_sc_hd__a21oi_1) - 0.14 1.67 ^ _551_/_095_/Y (sky130_fd_sc_hd__a21oi_1) - 0.00 1.67 ^ _551_/_134_/A2 (sky130_fd_sc_hd__o21ai_0) - 0.09 1.76 v _551_/_134_/Y (sky130_fd_sc_hd__o21ai_0) - 0.00 1.76 v _551_/_173_/A (sky130_fd_sc_hd__buf_4) - 0.13 1.88 v _551_/_173_/X (sky130_fd_sc_hd__buf_4) - 0.00 1.88 v _carry_out_and_/C (sky130_fd_sc_hd__and4_1) - 0.15 2.03 v _carry_out_and_/X (sky130_fd_sc_hd__and4_1) - 0.00 2.03 v carry_out (out) - 2.03 data arrival time + 0.00 0.89 ^ _551_/_091_/A1 (sky130_fd_sc_hd__a21oi_1) + 0.17 1.06 v _551_/_091_/Y (sky130_fd_sc_hd__a21oi_1) + 0.00 1.06 v _551_/_092_/A2 (sky130_fd_sc_hd__o21ai_0) + 0.23 1.29 ^ _551_/_092_/Y (sky130_fd_sc_hd__o21ai_0) + 0.00 1.29 ^ _551_/_095_/B1 (sky130_fd_sc_hd__a21oi_1) + 0.07 1.36 v _551_/_095_/Y (sky130_fd_sc_hd__a21oi_1) + 0.00 1.36 v _551_/_134_/A2 (sky130_fd_sc_hd__o21ai_0) + 0.14 1.50 ^ _551_/_134_/Y (sky130_fd_sc_hd__o21ai_0) + 0.00 1.50 ^ _551_/_173_/A (sky130_fd_sc_hd__buf_4) + 0.12 1.62 ^ _551_/_173_/X (sky130_fd_sc_hd__buf_4) + 0.00 1.62 ^ _carry_out_and_/C (sky130_fd_sc_hd__and4_1) + 0.14 1.76 ^ _carry_out_and_/X (sky130_fd_sc_hd__and4_1) + 0.00 1.76 ^ carry_out (out) + 1.76 data arrival time 1.00 1.00 max_delay 0.00 1.00 output external delay 1.00 data required time --------------------------------------------------------- 1.00 data required time - -2.03 data arrival time + -1.76 data arrival time --------------------------------------------------------- - -1.03 slack (VIOLATED) + -0.76 slack (VIOLATED) Cell type report for _551_ (LCU_16_KOGGE_STONE__551__1) @@ -195,6 +190,7 @@ Cell type report: Count Area Inverter 5 18.77 Multi-Input combinational cell 82 384.12 Total 103 523.00 +[INFO ODB-0496] swapMaster sanity check passed (0 failures) [WARNING EST-0018] wire capacitance for corner default is zero. Use the set_wire_rc command to set wire resistance and capacitance. Startpoint: dpath.b_reg.out[4]$_DFFE_PP_ (rising edge-triggered flip-flop clocked by CLK) diff --git a/src/odb/test/replace_hier_mod2.tcl b/src/odb/test/replace_hier_mod2.tcl index 195973b7c8..7d76c141af 100644 --- a/src/odb/test/replace_hier_mod2.tcl +++ b/src/odb/test/replace_hier_mod2.tcl @@ -27,6 +27,7 @@ report_cell_usage _551_ write_verilog_for_eqy replace_hier_mod2 before "None" #set_debug_level ODB replace_design 1 +set_debug_level ODB replace_design_check_sanity 1 # Swap #1. BRENT_KUNG -> KOGGE_STONE replace_hier_module _551_ LCU_16_KOGGE_STONE diff --git a/src/odb/test/replace_hier_mod3.ok b/src/odb/test/replace_hier_mod3.ok index c18fa0707f..9acc9090b1 100644 --- a/src/odb/test/replace_hier_mod3.ok +++ b/src/odb/test/replace_hier_mod3.ok @@ -49,6 +49,7 @@ Cell type report: Count Area Multi-Input combinational cell 82 384.12 Total 103 523.00 [WARNING ODB-0470] The modules cannot be swapped because the new module name LCU_16_KOGGE_STONE is identical to the existing module name. +[INFO ODB-0496] swapMaster sanity check passed (0 failures) Startpoint: gcd_1/dpath.b_reg.out[3]$_DFFE_PP_ (rising edge-triggered flip-flop clocked by CLK) Endpoint: carry_out (output port) diff --git a/src/odb/test/replace_hier_mod3.tcl b/src/odb/test/replace_hier_mod3.tcl index 36e4204990..51a84714c9 100644 --- a/src/odb/test/replace_hier_mod3.tcl +++ b/src/odb/test/replace_hier_mod3.tcl @@ -30,6 +30,7 @@ set_max_delay -to carry_out 1.0 report_checks -through gcd_1/_carry_out_and_/B -fields input_pins report_cell_usage gcd_1/_552_ +set_debug_level ODB replace_design_check_sanity 1 replace_hier_module gcd_1/_552_ LCU_16_KOGGE_STONE replace_hier_module gcd_1/_552_ LCU_16_BRENT_KUNG diff --git a/src/odb/test/replace_hier_mod4.ok b/src/odb/test/replace_hier_mod4.ok index dc653ec3ed..28442560b7 100644 --- a/src/odb/test/replace_hier_mod4.ok +++ b/src/odb/test/replace_hier_mod4.ok @@ -48,6 +48,7 @@ Cell type report: Count Area Inverter 5 18.77 Multi-Input combinational cell 82 384.12 Total 103 523.00 +[INFO ODB-0496] swapMaster sanity check passed (0 failures) Startpoint: gcd_1/dpath.b_reg.out[3]$_DFFE_PP_ (rising edge-triggered flip-flop clocked by CLK) Endpoint: carry_out (output port) diff --git a/src/odb/test/replace_hier_mod4.tcl b/src/odb/test/replace_hier_mod4.tcl index 8e5b76621d..b35c8383b8 100644 --- a/src/odb/test/replace_hier_mod4.tcl +++ b/src/odb/test/replace_hier_mod4.tcl @@ -38,6 +38,7 @@ set_max_delay -to carry_out 1.0 report_checks -through gcd_1/_carry_out_and_/B -fields input_pins report_cell_usage gcd_1/_552_ +set_debug_level ODB replace_design_check_sanity 1 replace_hier_module gcd_1/_552_ LCU_16_BRENT_KUNG report_checks -through gcd_1/_carry_out_and_/B -fields input_pins diff --git a/src/odb/test/replace_hier_mod5.tcl b/src/odb/test/replace_hier_mod5.tcl index b1741b9ada..c7a2f1f9c1 100644 --- a/src/odb/test/replace_hier_mod5.tcl +++ b/src/odb/test/replace_hier_mod5.tcl @@ -20,6 +20,7 @@ set_max_delay -to carry_out 1.0 report_checks -through gcd_1/_carry_out_and_/B -fields input_pins report_cell_usage gcd_1/_552_ +set_debug_level ODB replace_design_check_sanity 1 set result [catch { replace_hier_module gcd_1/_552_ LCU_16_BRENT_KUNG }] if { $result == 0 } { puts "Successfully replaced hier module" diff --git a/src/odb/test/replace_hier_mod6.ok b/src/odb/test/replace_hier_mod6.ok index 3cb1211c94..a46c0b1d8d 100644 --- a/src/odb/test/replace_hier_mod6.ok +++ b/src/odb/test/replace_hier_mod6.ok @@ -56,6 +56,7 @@ Cell type report: Count Area ============================================= ALU_16_HAN_CARLSON -> ALU_16_BRENT_KUNG ============================================= +[INFO ODB-0496] swapMaster sanity check passed (0 failures) Successfully replaced hier module [WARNING EST-0018] wire capacitance for corner default is zero. Use the set_wire_rc command to set wire resistance and capacitance. Startpoint: dpath.b_reg.out[0]$_DFFE_PP_ @@ -116,6 +117,7 @@ Repair timing output passed/skipped equivalence test ============================================= ALU_16_BRENT_KUNG -> ALU_16_KOGGE_STONE ============================================= +[INFO ODB-0496] swapMaster sanity check passed (0 failures) Successfully replaced hier module [WARNING EST-0018] wire capacitance for corner default is zero. Use the set_wire_rc command to set wire resistance and capacitance. Startpoint: dpath.b_reg.out[0]$_DFFE_PP_ @@ -171,6 +173,7 @@ Repair timing output passed/skipped equivalence test ============================================= ALU_16_KOGGE_STONE -> ALU_16_SKLANSKY ============================================= +[INFO ODB-0496] swapMaster sanity check passed (0 failures) Successfully replaced hier module [WARNING EST-0018] wire capacitance for corner default is zero. Use the set_wire_rc command to set wire resistance and capacitance. Startpoint: dpath.b_reg.out[0]$_DFFE_PP_ @@ -228,6 +231,7 @@ Repair timing output passed/skipped equivalence test ============================================= ALU_16_SKLANSKY -> ALU_16_HAN_CARLSON ============================================= +[INFO ODB-0496] swapMaster sanity check passed (0 failures) Successfully replaced hier module [WARNING EST-0018] wire capacitance for corner default is zero. Use the set_wire_rc command to set wire resistance and capacitance. Startpoint: dpath.b_reg.out[0]$_DFFE_PP_ diff --git a/src/odb/test/replace_hier_mod6.tcl b/src/odb/test/replace_hier_mod6.tcl index 21c4c47dd0..6b7e80fac7 100644 --- a/src/odb/test/replace_hier_mod6.tcl +++ b/src/odb/test/replace_hier_mod6.tcl @@ -31,6 +31,7 @@ report_cell_usage _120_ # - To enable the EQ check, you should set the envar "EQUIVALENCE_CHECK". write_verilog_for_eqy $test_name before "None" +set_debug_level ODB replace_design_check_sanity 1 proc do_swap { from_alu to_alu } { variable test_name puts "\n=============================================" diff --git a/src/odb/test/replace_hier_mod_report_checks.ok b/src/odb/test/replace_hier_mod_report_checks.ok index c93225ffbd..e6dfab4054 100644 --- a/src/odb/test/replace_hier_mod_report_checks.ok +++ b/src/odb/test/replace_hier_mod_report_checks.ok @@ -30,6 +30,7 @@ Path Type: max -0.39 slack (VIOLATED) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) Startpoint: r1 (rising edge-triggered flip-flop clocked by clk) Endpoint: r4 (rising edge-triggered flip-flop clocked by clk) Path Group: clk @@ -60,6 +61,7 @@ Path Type: max -0.39 slack (VIOLATED) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) Startpoint: r1 (rising edge-triggered flip-flop clocked by clk) Endpoint: r2 (rising edge-triggered flip-flop clocked by clk) Path Group: clk diff --git a/src/odb/test/replace_hier_mod_report_checks.tcl b/src/odb/test/replace_hier_mod_report_checks.tcl index b27e9fa8c6..2611bd2581 100644 --- a/src/odb/test/replace_hier_mod_report_checks.tcl +++ b/src/odb/test/replace_hier_mod_report_checks.tcl @@ -55,6 +55,7 @@ create_clock -period 0.3 clk # 7. OK report_checks +set_debug_level ODB replace_design_check_sanity 1 replace_hier_module bc1 inv_chain report_checks -through u1z replace_hier_module bc1 buffer_chain diff --git a/src/odb/test/replace_hier_mod_undo2.tcl b/src/odb/test/replace_hier_mod_undo2.tcl index 6b74466f7b..3382d4d68a 100644 --- a/src/odb/test/replace_hier_mod_undo2.tcl +++ b/src/odb/test/replace_hier_mod_undo2.tcl @@ -53,6 +53,7 @@ if { $block eq "NULL" } { } odb::dbDatabase_beginEco $block +set_debug_level ODB replace_design_check_sanity 1 puts "### module is swapped to Brent-Kung ###" replace_hier_module gcd_1/_552_ LCU_16_BRENT_KUNG report_cell_usage gcd_1/_552_ diff --git a/src/rsz/test/replace_arith_modules1.ok b/src/rsz/test/replace_arith_modules1.ok index f2a3a2815b..e46cc619bd 100644 --- a/src/rsz/test/replace_arith_modules1.ok +++ b/src/rsz/test/replace_arith_modules1.ok @@ -19,6 +19,70 @@ replace_arith_module -path_count 100 -target setup -slack_margin 0.0 [INFO RSZ-0152] Analyzing 100 critical paths with slack < 0.00 [INFO RSZ-0153] Identified 3788 violating endpoints [INFO RSZ-0154] Identified 64 critical arithmetic instances +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) [INFO RSZ-0160] 64 arithmetic instances have swapped to improve 'setup' target wns max -50.87 tns max -109848.91 diff --git a/src/rsz/test/replace_arith_modules1.tcl b/src/rsz/test/replace_arith_modules1.tcl index 65aacd2e85..6b93a39240 100644 --- a/src/rsz/test/replace_arith_modules1.tcl +++ b/src/rsz/test/replace_arith_modules1.tcl @@ -44,6 +44,7 @@ set num_instances [llength [get_cells -hier *]] puts "number instances in verilog is $num_instances" #set_debug_level RSZ replace_arith 1 +set_debug_level ODB replace_design_check_sanity 1 report_wns report_tns diff --git a/src/rsz/test/replace_arith_modules2.ok b/src/rsz/test/replace_arith_modules2.ok index 840b9697dd..06e54c7d93 100644 --- a/src/rsz/test/replace_arith_modules2.ok +++ b/src/rsz/test/replace_arith_modules2.ok @@ -19,6 +19,70 @@ replace_arith_module -path_count 100 -target setup -slack_margin 0.0 [INFO RSZ-0152] Analyzing 100 critical paths with slack < 0.00 [INFO RSZ-0153] Identified 3787 violating endpoints [INFO RSZ-0154] Identified 64 critical arithmetic instances +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) [INFO RSZ-0160] 64 arithmetic instances have swapped to improve 'setup' target wns max -50.87 tns max -109842.09 diff --git a/src/rsz/test/replace_arith_modules2.tcl b/src/rsz/test/replace_arith_modules2.tcl index c0e0b1fe9c..e0d36a2861 100644 --- a/src/rsz/test/replace_arith_modules2.tcl +++ b/src/rsz/test/replace_arith_modules2.tcl @@ -42,6 +42,7 @@ puts "number instances in verilog is $num_instances" #set_debug_level RSZ replace_arith 1 #set_debug_level ODB replace_design 10 +set_debug_level ODB replace_design_check_sanity 1 report_wns report_tns diff --git a/src/rsz/test/replace_arith_modules3.ok b/src/rsz/test/replace_arith_modules3.ok index f461764b6e..2dcd0339ff 100644 --- a/src/rsz/test/replace_arith_modules3.ok +++ b/src/rsz/test/replace_arith_modules3.ok @@ -86,6 +86,70 @@ replace_arith_module -path_count 100 -target setup -slack_margin 0.0 [INFO RSZ-0152] Analyzing 100 critical paths with slack < 0.00 [INFO RSZ-0153] Identified 3788 violating endpoints [INFO RSZ-0154] Identified 64 critical arithmetic instances +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) +[INFO ODB-0496] swapMaster sanity check passed (0 failures) [INFO RSZ-0160] 64 arithmetic instances have swapped to improve 'setup' target wns max -51.38 tns max -111292.37 diff --git a/src/rsz/test/replace_arith_modules3.tcl b/src/rsz/test/replace_arith_modules3.tcl index a68dfb809d..24d5211446 100644 --- a/src/rsz/test/replace_arith_modules3.tcl +++ b/src/rsz/test/replace_arith_modules3.tcl @@ -49,6 +49,7 @@ global_placement -skip_nesterov_place set num_instances [llength [get_cells -hier *]] puts "number instances in verilog is $num_instances" +set_debug_level ODB replace_design_check_sanity 1 report_wns report_tns diff --git a/test/orfs/gcd/rules-base.json b/test/orfs/gcd/rules-base.json index 7836b17390..2466e40df4 100644 --- a/test/orfs/gcd/rules-base.json +++ b/test/orfs/gcd/rules-base.json @@ -32,7 +32,7 @@ "compare": ">=" }, "cts__timing__setup__tns": { - "value": -1480.0, + "value": -1700.0, "compare": ">=" }, "cts__timing__hold__ws": {