Skip to content

Commit

Permalink
Added conditions to stream to preserve db backwards compatibility Sig…
Browse files Browse the repository at this point in the history
…ned-off-by: Andy Fox <[email protected]>

Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Mar 27, 2024
1 parent adc626b commit 623f3cc
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 64 deletions.
35 changes: 21 additions & 14 deletions src/odb/src/db/dbBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ dbOStream& operator<<(dbOStream& stream, const _dbBlock& block)
++cbitr)
(**cbitr)().inDbBlockStreamOutBefore(
(dbBlock*) &block); // client ECO initialization - payam

_dbDatabase* db = block.getImpl()->getDatabase();
dbOStreamScope scope(stream, "dbBlock");
stream << block._def_units;
stream << block._dbu_per_micron;
Expand All @@ -931,9 +931,11 @@ dbOStream& operator<<(dbOStream& stream, const _dbBlock& block)
stream << block._inst_hash;
stream << block._module_hash;
stream << block._modinst_hash;
stream << block._modbterm_hash;
stream << block._moditerm_hash;
stream << block._modnet_hash;
if (db->isSchema(db_schema_update_hierarchy)) {
stream << block._modbterm_hash;
stream << block._moditerm_hash;
stream << block._modnet_hash;
}
stream << block._powerdomain_hash;
stream << block._logicport_hash;
stream << block._powerswitch_hash;
Expand All @@ -956,10 +958,11 @@ dbOStream& operator<<(dbOStream& stream, const _dbBlock& block)
stream << *block._inst_tbl;
stream << *block._module_tbl;
stream << *block._modinst_tbl;
stream << *block._modbterm_tbl;
stream << *block._moditerm_tbl;
stream << *block._modnet_tbl;

if (db->isSchema(db_schema_update_hierarchy)) {
stream << *block._modbterm_tbl;
stream << *block._moditerm_tbl;
stream << *block._modnet_tbl;
}
stream << *block._powerdomain_tbl;
stream << *block._logicport_tbl;
stream << *block._powerswitch_tbl;
Expand Down Expand Up @@ -1044,9 +1047,11 @@ dbIStream& operator>>(dbIStream& stream, _dbBlock& block)
stream >> block._inst_hash;
stream >> block._module_hash;
stream >> block._modinst_hash;
stream >> block._modbterm_hash;
stream >> block._moditerm_hash;
stream >> block._modnet_hash;
if (db->isSchema(db_schema_update_hierarchy)) {
stream >> block._modbterm_hash;
stream >> block._moditerm_hash;
stream >> block._modnet_hash;
}
stream >> block._powerdomain_hash;
stream >> block._logicport_hash;
stream >> block._powerswitch_hash;
Expand Down Expand Up @@ -1078,9 +1083,11 @@ dbIStream& operator>>(dbIStream& stream, _dbBlock& block)
stream >> *block._inst_tbl;
stream >> *block._module_tbl;
stream >> *block._modinst_tbl;
stream >> *block._modbterm_tbl;
stream >> *block._moditerm_tbl;
stream >> *block._modnet_tbl;
if (db->isSchema(db_schema_update_hierarchy)) {
stream >> *block._modbterm_tbl;
stream >> *block._moditerm_tbl;
stream >> *block._modnet_tbl;
}
stream >> *block._powerdomain_tbl;
stream >> *block._logicport_tbl;
stream >> *block._powerswitch_tbl;
Expand Down
44 changes: 28 additions & 16 deletions src/odb/src/db/dbModBTerm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,27 +130,39 @@ _dbModBTerm::_dbModBTerm(_dbDatabase* db, const _dbModBTerm& r)

dbIStream& operator>>(dbIStream& stream, _dbModBTerm& obj)
{
stream >> obj._name;
stream >> obj._flags;
stream >> obj._parentPin;
stream >> obj._parent;
stream >> obj._modNet;
stream >> obj._next_net_modbterm;
stream >> obj._prev_net_modbterm;
stream >> obj._next_entry;
// User Code Begin <
dbBlock* block = (dbBlock*) (obj.getOwner());
_dbDatabase* db = (_dbDatabase*) (block->getDataBase());
if (db->isSchema(db_schema_update_hierarchy)) {
stream >> obj._name;
stream >> obj._flags;
stream >> obj._parentPin;
stream >> obj._parent;
stream >> obj._modNet;
stream >> obj._next_net_modbterm;
stream >> obj._prev_net_modbterm;
stream >> obj._next_entry;
}
// User Code End <
return stream;
}

dbOStream& operator<<(dbOStream& stream, const _dbModBTerm& obj)
{
stream << obj._name;
stream << obj._flags;
stream << obj._parentPin;
stream << obj._parent;
stream << obj._modNet;
stream << obj._next_net_modbterm;
stream << obj._prev_net_modbterm;
stream << obj._next_entry;
// User Code Begin <
dbBlock* block = (dbBlock*) (obj.getOwner());
_dbDatabase* db = (_dbDatabase*) (block->getDataBase());
if (db->isSchema(db_schema_update_hierarchy)) {
stream << obj._name;
stream << obj._flags;
stream << obj._parentPin;
stream << obj._parent;
stream << obj._modNet;
stream << obj._next_net_modbterm;
stream << obj._prev_net_modbterm;
stream << obj._next_entry;
}
// User Code End <
return stream;
}

Expand Down
40 changes: 26 additions & 14 deletions src/odb/src/db/dbModITerm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,25 +124,37 @@ _dbModITerm::_dbModITerm(_dbDatabase* db, const _dbModITerm& r)

dbIStream& operator>>(dbIStream& stream, _dbModITerm& obj)
{
stream >> obj._name;
stream >> obj._parent;
stream >> obj._childPort;
stream >> obj._modNet;
stream >> obj._next_net_moditerm;
stream >> obj._prev_net_moditerm;
stream >> obj._next_entry;
// User Code Begin <
dbBlock* block = (dbBlock*) (obj.getOwner());
_dbDatabase* db = (_dbDatabase*) (block->getDataBase());
if (db->isSchema(db_schema_update_hierarchy)) {
stream >> obj._name;
stream >> obj._parent;
stream >> obj._childPort;
stream >> obj._modNet;
stream >> obj._next_net_moditerm;
stream >> obj._prev_net_moditerm;
stream >> obj._next_entry;
}
// User Code End <
return stream;
}

dbOStream& operator<<(dbOStream& stream, const _dbModITerm& obj)
{
stream << obj._name;
stream << obj._parent;
stream << obj._childPort;
stream << obj._modNet;
stream << obj._next_net_moditerm;
stream << obj._prev_net_moditerm;
stream << obj._next_entry;
// User Code Begin <
dbBlock* block = (dbBlock*) (obj.getOwner());
_dbDatabase* db = (_dbDatabase*) (block->getDataBase());
if (db->isSchema(db_schema_update_hierarchy)) {
stream << obj._name;
stream << obj._parent;
stream << obj._childPort;
stream << obj._modNet;
stream << obj._next_net_moditerm;
stream << obj._prev_net_moditerm;
stream << obj._next_entry;
}
// User Code End <
return stream;
}

Expand Down
13 changes: 11 additions & 2 deletions src/odb/src/db/dbModInst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ _dbModInst::_dbModInst(_dbDatabase* db)
_name = nullptr;
_parent = 0;
_module_next = 0;
_moditerms = 0;
_master = 0;
_group = 0;
_group_next = 0;
Expand Down Expand Up @@ -154,7 +155,11 @@ dbIStream& operator>>(dbIStream& stream, _dbModInst& obj)
stream >> obj._master;
stream >> obj._group_next;
stream >> obj._group;
stream >> obj._moditerms;
dbBlock* block = (dbBlock*) (obj.getOwner());
_dbDatabase* db = (_dbDatabase*) (block->getDataBase());
if (db->isSchema(db_schema_update_hierarchy)) {
stream >> obj._moditerms;
}
return stream;
}

Expand All @@ -167,7 +172,11 @@ dbOStream& operator<<(dbOStream& stream, const _dbModInst& obj)
stream << obj._master;
stream << obj._group_next;
stream << obj._group;
stream << obj._moditerms;
dbBlock* block = (dbBlock*) (obj.getOwner());
_dbDatabase* db = (_dbDatabase*) (block->getDataBase());
if (db->isSchema(db_schema_update_hierarchy)) {
stream << obj._moditerms;
}
return stream;
}

Expand Down
40 changes: 26 additions & 14 deletions src/odb/src/db/dbModNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,37 @@ _dbModNet::_dbModNet(_dbDatabase* db, const _dbModNet& r)

dbIStream& operator>>(dbIStream& stream, _dbModNet& obj)
{
stream >> obj._name;
stream >> obj._parent;
stream >> obj._next_entry;
stream >> obj._moditerms;
stream >> obj._modbterms;
stream >> obj._iterms;
stream >> obj._bterms;
// User Code Begin <
dbBlock* block = (dbBlock*) (obj.getOwner());
_dbDatabase* db = (_dbDatabase*) (block->getDataBase());
if (db->isSchema(db_schema_update_hierarchy)) {
stream >> obj._name;
stream >> obj._parent;
stream >> obj._next_entry;
stream >> obj._moditerms;
stream >> obj._modbterms;
stream >> obj._iterms;
stream >> obj._bterms;
}
// User Code End <
return stream;
}

dbOStream& operator<<(dbOStream& stream, const _dbModNet& obj)
{
stream << obj._name;
stream << obj._parent;
stream << obj._next_entry;
stream << obj._moditerms;
stream << obj._modbterms;
stream << obj._iterms;
stream << obj._bterms;
// User Code Begin <
dbBlock* block = (dbBlock*) (obj.getOwner());
_dbDatabase* db = (_dbDatabase*) (block->getDataBase());
if (db->isSchema(db_schema_update_hierarchy)) {
stream << obj._name;
stream << obj._parent;
stream << obj._next_entry;
stream << obj._moditerms;
stream << obj._modbterms;
stream << obj._iterms;
stream << obj._bterms;
}
// User Code End <
return stream;
}

Expand Down
20 changes: 16 additions & 4 deletions src/odb/src/db/dbModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,14 @@ dbIStream& operator>>(dbIStream& stream, _dbModule& obj)
stream >> obj._insts;
stream >> obj._mod_inst;
stream >> obj._modinsts;
stream >> obj._modnets;
stream >> obj._modbterms;
// User Code Begin <
dbBlock* block = (dbBlock*) (obj.getOwner());
_dbDatabase* db = (_dbDatabase*) (block->getDataBase());
if (db->isSchema(db_schema_update_hierarchy)) {
stream >> obj._modnets;
stream >> obj._modbterms;
}
// User Code End <
return stream;
}

Expand All @@ -164,8 +170,14 @@ dbOStream& operator<<(dbOStream& stream, const _dbModule& obj)
stream << obj._insts;
stream << obj._mod_inst;
stream << obj._modinsts;
stream << obj._modnets;
stream << obj._modbterms;
// User Code Begin <
dbBlock* block = (dbBlock*) (obj.getOwner());
_dbDatabase* db = (_dbDatabase*) (block->getDataBase());
if (db->isSchema(db_schema_update_hierarchy)) {
stream << obj._modnets;
stream << obj._modbterms;
}
// User Code End <
return stream;
}

Expand Down

0 comments on commit 623f3cc

Please sign in to comment.