Skip to content

Commit

Permalink
Removed next/prev interface from dbModBTerm, reduced to just next. Si…
Browse files Browse the repository at this point in the history
…gned-off-by: Andy Fox. [email protected]

Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Aug 6, 2024
1 parent f34ef08 commit 7d7cc35
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 59 deletions.
6 changes: 1 addition & 5 deletions src/odb/include/odb/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -7168,10 +7168,9 @@ class dbBusPort : public dbObject
// User Code Begin dbBusPort
// get element by bit index in bus (allows for up/down)
// linear access
dbModBTerm* getBusIndexedElement(int index) const;
dbModBTerm* getBusIndexedElement(int index);
void setFirstMember(dbModBTerm*);
dbModBTerm* getFirstMember();

dbSet<dbModBTerm> getBusPortMembers();
int getSize() const;
bool getUpdown() const;
Expand Down Expand Up @@ -7605,9 +7604,6 @@ class dbModBTerm : public dbObject
bool isBusPort() const;
void setBusPort(dbBusPort*);
dbBusPort* getBusPort() const;
dbModBTerm* getNext() const;
dbModBTerm* getPrev() const;

static dbModBTerm* create(dbModule* parentModule, const char* name);

private:
Expand Down
7 changes: 0 additions & 7 deletions src/odb/src/codeGenerator/schema/chip/dbModBterm.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@
"flags":["private"],
"schema":"db_schema_update_hierarchy",
"parent":"dbBlock"
},
{
"name":"_prev_entry",
"type":"dbId<_dbModBTerm>",
"flags":["private"],
"schema":"db_schema_odb_busport",
"parent":"dbBlock"
}
],
"constructors":[],
Expand Down
14 changes: 7 additions & 7 deletions src/odb/src/db/dbBusPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ dbModule* dbBusPort::getParent() const
element is at offset 1 in the array
b[5:1] element is at offset 4 in the array
*/
dbModBTerm* dbBusPort::getBusIndexedElement(int index) const
dbModBTerm* dbBusPort::getBusIndexedElement(int index)
{
_dbBusPort* obj = (_dbBusPort*) this;
_dbBlock* block_ = (_dbBlock*) obj->getOwner();
Expand All @@ -290,13 +290,13 @@ dbModBTerm* dbBusPort::getBusIndexedElement(int index) const
return (dbModBTerm*) (block_->_modbterm_tbl->getPtr(obj->getId() + offset
+ 1));
}
dbModBTerm* cur = (dbModBTerm*) (block_->_modbterm_tbl->getPtr(obj->_port));
if (cur != nullptr) {
cur = cur->getPrev();
for (int i = 0; i < offset; i++) {
cur = cur->getPrev();
int i = 0;
dbSet<dbModBTerm> busport_members = getBusPortMembers();
for (auto cur : busport_members) {
if (i == offset) {
return cur;
}
return cur;
i++;
}
}
return nullptr;
Expand Down
39 changes: 0 additions & 39 deletions src/odb/src/db/dbModBTerm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ bool _dbModBTerm::operator==(const _dbModBTerm& rhs) const
if (_next_entry != rhs._next_entry) {
return false;
}
if (_prev_entry != rhs._prev_entry) {
return false;
}

return true;
}
Expand All @@ -102,7 +99,6 @@ void _dbModBTerm::differences(dbDiff& diff,
DIFF_FIELD(_prev_net_modbterm);
DIFF_FIELD(_busPort);
DIFF_FIELD(_next_entry);
DIFF_FIELD(_prev_entry);
DIFF_END
}

Expand All @@ -118,7 +114,6 @@ void _dbModBTerm::out(dbDiff& diff, char side, const char* field) const
DIFF_OUT_FIELD(_prev_net_modbterm);
DIFF_OUT_FIELD(_busPort);
DIFF_OUT_FIELD(_next_entry);
DIFF_OUT_FIELD(_prev_entry);

DIFF_END
}
Expand All @@ -140,7 +135,6 @@ _dbModBTerm::_dbModBTerm(_dbDatabase* db, const _dbModBTerm& r)
_prev_net_modbterm = r._prev_net_modbterm;
_busPort = r._busPort;
_next_entry = r._next_entry;
_prev_entry = r._prev_entry;
}

dbIStream& operator>>(dbIStream& stream, _dbModBTerm& obj)
Expand Down Expand Up @@ -172,9 +166,6 @@ dbIStream& operator>>(dbIStream& stream, _dbModBTerm& obj)
if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
stream >> obj._next_entry;
}
if (obj.getDatabase()->isSchema(db_schema_odb_busport)) {
stream >> obj._prev_entry;
}
return stream;
}

Expand Down Expand Up @@ -207,9 +198,6 @@ dbOStream& operator<<(dbOStream& stream, const _dbModBTerm& obj)
if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
stream << obj._next_entry;
}
if (obj.getDatabase()->isSchema(db_schema_odb_busport)) {
stream << obj._prev_entry;
}
return stream;
}

Expand Down Expand Up @@ -348,14 +336,7 @@ dbModBTerm* dbModBTerm::create(dbModule* parentModule, const char* name)
ZALLOCATED(modbterm->_name);
modbterm->_parent = module->getOID();
modbterm->_next_entry = module->_modbterms;
// set back pointer.
if (module->_modbterms != 0) {
_dbModBTerm* head_entry = block->_modbterm_tbl->getPtr(module->_modbterms);
head_entry->_prev_entry = modbterm->getOID();
}
modbterm->_prev_entry = 0;
module->_modbterms = modbterm->getOID();

return (dbModBTerm*) modbterm;
}

Expand Down Expand Up @@ -439,26 +420,6 @@ void dbModBTerm::setBusPort(dbBusPort* bus_port)
_modbterm->_busPort = bus_port->getId();
}

dbModBTerm* dbModBTerm::getNext() const
{
_dbModBTerm* _modbterm = (_dbModBTerm*) this;
if (_modbterm->_next_entry != 0) {
_dbBlock* block_ = (_dbBlock*) _modbterm->getOwner();
return (dbModBTerm*) block_->_modbterm_tbl->getPtr(_modbterm->_next_entry);
}
return nullptr;
}

dbModBTerm* dbModBTerm::getPrev() const
{
_dbModBTerm* _modbterm = (_dbModBTerm*) this;
if (_modbterm->_prev_entry != 0) {
_dbBlock* block_ = (_dbBlock*) _modbterm->getOwner();
return (dbModBTerm*) block_->_modbterm_tbl->getPtr(_modbterm->_prev_entry);
}
return nullptr;
}

// User Code End dbModBTermPublicMethods
} // namespace odb
// Generator Code End Cpp
1 change: 0 additions & 1 deletion src/odb/src/db/dbModBTerm.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class _dbModBTerm : public _dbObject
dbId<_dbModBTerm> _prev_net_modbterm;
dbId<_dbBusPort> _busPort;
dbId<_dbModBTerm> _next_entry;
dbId<_dbModBTerm> _prev_entry;

// User Code Begin Fields
void* _sta_port = nullptr;
Expand Down

0 comments on commit 7d7cc35

Please sign in to comment.