From 767b671d1a82c8050b862870af6cd0ab7a6470b9 Mon Sep 17 00:00:00 2001 From: Felipe Garay Date: Thu, 22 Feb 2024 15:28:53 -0800 Subject: [PATCH] odb: making imposible for 2+ DFT objects to exist in a block Signed-off-by: Felipe Garay --- src/odb/include/odb/db.h | 5 ----- src/odb/src/db/dbBlock.cpp | 13 ++++--------- src/odb/src/db/dbDft.cpp | 7 +++++++ src/odb/src/db/dbDft.h | 3 +++ src/odb/test/cpp/scan/TestScanChain.cpp | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/odb/include/odb/db.h b/src/odb/include/odb/db.h index a421b30ee2b..b91dc140ec9 100644 --- a/src/odb/include/odb/db.h +++ b/src/odb/include/odb/db.h @@ -1361,11 +1361,6 @@ class dbBlock : public dbObject /// dbExtControl* getExtControl(); - /// - /// Get the dbDft object for persistent dft structs - /// - dbDft* createDft(); - /// /// Get the dbDft object for persistent dft structs /// diff --git a/src/odb/src/db/dbBlock.cpp b/src/odb/src/db/dbBlock.cpp index acdca1bc2f5..78f72d55445 100644 --- a/src/odb/src/db/dbBlock.cpp +++ b/src/odb/src/db/dbBlock.cpp @@ -316,7 +316,10 @@ _dbBlock::_dbBlock(_dbDatabase* db) _extControl = new dbExtControl(); _dft_tbl = new dbTable<_dbDft>( - db, this, (GetObjTbl_t) &_dbBlock::getObjectTable, dbDftObj); + db, this, (GetObjTbl_t) &_dbBlock::getObjectTable, dbDftObj, 4096, 12); + _dbDft* dft_ptr = _dft_tbl->create(); + dft_ptr->initialize(); + _dft = dft_ptr->getId(); _net_hash.setTable(_net_tbl); _inst_hash.setTable(_inst_tbl); @@ -2239,14 +2242,6 @@ dbExtControl* dbBlock::getExtControl() return (block->_extControl); } -dbDft* dbBlock::createDft() -{ - _dbBlock* block = (_dbBlock*) this; - _dbDft* dft = block->_dft_tbl->create(); - block->_dft = dft->getId(); - return (dbDft*) dft; -} - dbDft* dbBlock::getDft() const { _dbBlock* block = (_dbBlock*) this; diff --git a/src/odb/src/db/dbDft.cpp b/src/odb/src/db/dbDft.cpp index e455e98b2b0..22888b929a6 100644 --- a/src/odb/src/db/dbDft.cpp +++ b/src/odb/src/db/dbDft.cpp @@ -135,6 +135,13 @@ _dbDft::~_dbDft() delete scan_chains_; } +// User Code Begin PrivateMethods +void _dbDft::initialize() +{ + scan_inserted_ = false; +} +// User Code End PrivateMethods + //////////////////////////////////////////////////////////////////// // // dbDft - Methods diff --git a/src/odb/src/db/dbDft.h b/src/odb/src/db/dbDft.h index 5942a0186ea..8fb3d3481c3 100644 --- a/src/odb/src/db/dbDft.h +++ b/src/odb/src/db/dbDft.h @@ -61,6 +61,9 @@ class _dbDft : public _dbObject void differences(dbDiff& diff, const char* field, const _dbDft& rhs) const; void out(dbDiff& diff, char side, const char* field) const; dbObjectTable* getObjectTable(dbObjectType type); + // User Code Begin Methods + void initialize(); + // User Code End Methods bool scan_inserted_; diff --git a/src/odb/test/cpp/scan/TestScanChain.cpp b/src/odb/test/cpp/scan/TestScanChain.cpp index f6455d67a00..67fee5b0443 100644 --- a/src/odb/test/cpp/scan/TestScanChain.cpp +++ b/src/odb/test/cpp/scan/TestScanChain.cpp @@ -71,7 +71,7 @@ class TestScanChain : public testing::Test db_ = create2LevetDbWithBTerms(); block_ = db_->getChip()->getBlock(); tmp_path_ = testTmpPath("results", "TestScanChain"); - dft_ = block_->createDft(); + dft_ = block_->getDft(); std::vector instances_names = {"i1", "i2", "i3"};