Skip to content

Commit

Permalink
odb: making imposible for 2+ DFT objects to exist in a block
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Garay <[email protected]>
  • Loading branch information
fgaray committed Mar 5, 2024
1 parent b0804bc commit 767b671
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
5 changes: 0 additions & 5 deletions src/odb/include/odb/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down
13 changes: 4 additions & 9 deletions src/odb/src/db/dbBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions src/odb/src/db/dbDft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/odb/src/db/dbDft.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;

Expand Down
2 changes: 1 addition & 1 deletion src/odb/test/cpp/scan/TestScanChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> instances_names = {"i1", "i2", "i3"};

Expand Down

0 comments on commit 767b671

Please sign in to comment.