Skip to content

Commit f2403ab

Browse files
committed
Merge remote-tracking branch 'private/master' into gpl-less-inflation
2 parents f590015 + b2207dd commit f2403ab

34 files changed

+1728
-992
lines changed

src/dbSta/test/cpp/TestHconn.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,6 @@ TEST_F(TestHconn, ConnectionMade)
945945
// Journalling test.
946946
// Undo everything and check initial state preserved
947947
//
948-
odb::dbDatabase::endEco(block_);
949948
odb::dbDatabase::undoEco(block_);
950949

951950
size_t restored_db_net_count = block_->getNets().size();

src/odb/include/odb/db.h

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,12 +1756,12 @@ class dbNet : public dbObject
17561756
{
17571757
public:
17581758
///
1759-
/// Get the net name.
1759+
/// Get the hierarchical net name (not a base name).
17601760
///
17611761
std::string getName() const;
17621762

17631763
///
1764-
/// Get the net name.
1764+
/// Need a version that does not do strdup every time
17651765
///
17661766
const char* getConstName() const;
17671767

@@ -2520,6 +2520,8 @@ class dbNet : public dbObject
25202520
/// Dump dbNet info for debugging
25212521
///
25222522
void dump() const;
2523+
2524+
void checkSanityModNetConsistency() const;
25232525
};
25242526

25252527
///////////////////////////////////////////////////////////////////////////////
@@ -2532,14 +2534,14 @@ class dbInst : public dbObject
25322534
{
25332535
public:
25342536
///
2535-
/// Get the instance name.
2537+
/// Get the hierarchical instance name (not a base name).
25362538
///
2537-
std::string getName();
2539+
std::string getName() const;
25382540

25392541
///
25402542
/// Need a version that does not do strdup every time
25412543
///
2542-
const char* getConstName();
2544+
const char* getConstName() const;
25432545

25442546
///
25452547
/// Compare, like !strcmp
@@ -2828,7 +2830,7 @@ class dbInst : public dbObject
28282830
///
28292831
/// Get the block of this instance.
28302832
///
2831-
dbBlock* getBlock();
2833+
dbBlock* getBlock() const;
28322834

28332835
///
28342836
/// Get the Master of this instance.
@@ -7407,46 +7409,46 @@ class dbDatabase : public dbObject
74077409
///
74087410

74097411
///
7410-
/// Begin collecting netlist changes on specified block.
7411-
///
7412-
/// NOTE: Eco changes can not be nested at this time.
7412+
/// Start collecting ECO changes on the specified block.
74137413
///
74147414
static void beginEco(dbBlock* block);
74157415

74167416
///
7417-
/// End collecting netlist changes on specified block.
7417+
/// Stop collecting ECO changes on the specified block.
74187418
///
74197419
static void endEco(dbBlock* block);
74207420

74217421
///
7422-
/// Returns true of the pending eco is empty
7422+
/// Commit the last ECO changes on the specified block.
74237423
///
7424-
static bool ecoEmpty(dbBlock* block);
7424+
static void commitEco(dbBlock* block);
74257425

74267426
///
7427-
/// Read the eco changes from the specified stream to be applied to the
7428-
/// specified block.
7427+
/// Undo the last ECO changes on the specified block.
74297428
///
7430-
static void readEco(dbBlock* block, const char* filename);
7429+
static void undoEco(dbBlock* block);
74317430

74327431
///
7433-
/// Write the eco netlist changes to the specified stream.
7432+
/// Returns true if the current ECO is empty
74347433
///
7435-
static void writeEco(dbBlock* block, const char* filename);
7436-
static int checkEco(dbBlock* block);
7434+
static bool ecoEmpty(dbBlock* block);
74377435

74387436
///
7439-
/// Commit any pending netlist changes.
7437+
/// Return true if the ECO stack is empty. The ECO stack holds
7438+
/// the nested uncommitted ECOs that can still be undone.
74407439
///
7441-
static void commitEco(dbBlock* block);
7440+
static bool ecoStackEmpty(dbBlock* block);
7441+
7442+
///
7443+
/// Read the ECO changes from the specified file to be applied to the
7444+
/// specified block.
7445+
///
7446+
static void readEco(dbBlock* block, const char* filename);
74427447

74437448
///
7444-
/// Undo any pending netlist changes. Only supports:
7445-
/// create and destroy of dbInst and dbNet
7446-
/// dbInst::swapMaster
7447-
/// connect and disconnect of dbBTerm and dbITerm
7449+
/// Write the ECO changes to the specified file.
74487450
///
7449-
static void undoEco(dbBlock* block);
7451+
static void writeEco(dbBlock* block, const char* filename);
74507452

74517453
///
74527454
/// links to utl::Logger

src/odb/src/db/dbBTerm.cpp

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,11 @@ dbBTerm* dbBTerm::create(dbNet* net_, const char* name)
619619
utl::ODB,
620620
"DB_ECO",
621621
1,
622-
"ECO: dbBTerm:create");
622+
"ECO: create dbBTerm '{}' on dbNet({}, {:p}) '{}'",
623+
name,
624+
net->getId(),
625+
static_cast<void*>(net),
626+
name);
623627
block->_journal->beginAction(dbJournal::CREATE_OBJECT);
624628
block->_journal->pushParam(dbBTermObj);
625629
block->_journal->pushParam(net->getId());
@@ -680,10 +684,13 @@ void _dbBTerm::connectModNet(_dbModNet* mod_net, _dbBlock* block)
680684
utl::ODB,
681685
"DB_ECO",
682686
1,
683-
"ECO: connect Bterm {} to modnet {}",
687+
"ECO: connect dbBTerm({} {:p}) '{}' to dbModNet({} {:p}) '{}'",
684688
bterm->getId(),
685-
mod_net->getId());
686-
689+
static_cast<void*>(bterm),
690+
bterm->_name,
691+
mod_net->getId(),
692+
static_cast<void*>(mod_net),
693+
((dbModNet*) mod_net)->getHierarchicalName());
687694
block->_journal->beginAction(dbJournal::CONNECT_OBJECT);
688695
block->_journal->pushParam(dbBTermObj);
689696
block->_journal->pushParam(bterm->getId());
@@ -714,9 +721,13 @@ void _dbBTerm::connectNet(_dbNet* net, _dbBlock* block)
714721
utl::ODB,
715722
"DB_ECO",
716723
1,
717-
"ECO: connect Bterm {} to net {}",
724+
"ECO: connect dbBTerm({} {:p}) '{}' to dbNet({} {:p}) '{}'",
718725
bterm->getId(),
719-
net->getId());
726+
static_cast<void*>(bterm),
727+
bterm->_name,
728+
net->getId(),
729+
static_cast<void*>(net),
730+
((dbNet*) net)->getName());
720731
block->_journal->beginAction(dbJournal::CONNECT_OBJECT);
721732
block->_journal->pushParam(dbBTermObj);
722733
block->_journal->pushParam(bterm->getId());
@@ -778,7 +789,10 @@ void dbBTerm::destroy(dbBTerm* bterm_)
778789
utl::ODB,
779790
"DB_ECO",
780791
1,
781-
"ECO: dbBTerm:destroy");
792+
"ECO: delete dbBTerm({}, {:p}) '{}'",
793+
bterm->getId(),
794+
static_cast<void*>(bterm),
795+
bterm->_name);
782796
block->_journal->beginAction(dbJournal::DELETE_OBJECT);
783797
block->_journal->pushParam(dbBTermObj);
784798
block->_journal->pushParam(bterm_->getId());
@@ -797,12 +811,18 @@ void _dbBTerm::disconnectNet(_dbBTerm* bterm, _dbBlock* block)
797811

798812
// Journal
799813
if (block->_journal) {
800-
debugPrint(block->getImpl()->getLogger(),
801-
utl::ODB,
802-
"DB_ECO",
803-
1,
804-
"ECO: disconnect bterm {}",
805-
bterm->getId());
814+
debugPrint(
815+
block->getImpl()->getLogger(),
816+
utl::ODB,
817+
"DB_ECO",
818+
1,
819+
"ECO: disconnect dbBTerm({} {:p}) '{}' from dbNet({} {:p}) '{}'",
820+
bterm->getId(),
821+
static_cast<void*>(bterm),
822+
bterm->_name,
823+
net->getId(),
824+
static_cast<void*>(net),
825+
net->_name);
806826
block->_journal->beginAction(dbJournal::DISCONNECT_OBJECT);
807827
block->_journal->pushParam(dbBTermObj);
808828
block->_journal->pushParam(bterm->getId());
@@ -849,12 +869,18 @@ void _dbBTerm::disconnectModNet(_dbBTerm* bterm, _dbBlock* block)
849869
_dbModNet* mod_net = block->_modnet_tbl->getPtr(bterm->_mnet);
850870

851871
if (block->_journal) {
852-
debugPrint(block->getImpl()->getLogger(),
853-
utl::ODB,
854-
"DB_ECO",
855-
1,
856-
"ECO: disconnect bterm {}",
857-
bterm->getId());
872+
debugPrint(
873+
block->getImpl()->getLogger(),
874+
utl::ODB,
875+
"DB_ECO",
876+
1,
877+
"ECO: disconnect dbBTerm({} {:p}) '{}' from dbModNet({} {:p}) '{}'",
878+
bterm->getId(),
879+
static_cast<void*>(bterm),
880+
bterm->_name,
881+
mod_net->getId(),
882+
static_cast<void*>(mod_net),
883+
((dbModNet*) mod_net)->getHierarchicalName());
858884
block->_journal->beginAction(dbJournal::DISCONNECT_OBJECT);
859885
block->_journal->pushParam(dbBTermObj);
860886
block->_journal->pushParam(bterm->getId());

src/odb/src/db/dbBlock.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ _dbBlock::_dbBlock(_dbDatabase* db)
422422
_searchDb = nullptr;
423423
_extmi = nullptr;
424424
_journal = nullptr;
425-
_journal_pending = nullptr;
426425
}
427426

428427
_dbBlock::~_dbBlock()
@@ -517,7 +516,6 @@ _dbBlock::~_dbBlock()
517516
(*_cbitr)->removeOwner();
518517
}
519518
delete _journal;
520-
delete _journal_pending;
521519
}
522520

523521
void dbBlock::clear()
@@ -561,11 +559,6 @@ void dbBlock::clear()
561559
delete block->_journal;
562560
block->_journal = nullptr;
563561
}
564-
565-
if (block->_journal_pending) {
566-
delete block->_journal_pending;
567-
block->_journal_pending = nullptr;
568-
}
569562
}
570563

571564
void _dbBlock::initialize(_dbChip* chip,

src/odb/src/db/dbBlock.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <functional>
77
#include <list>
88
#include <map>
9+
#include <stack>
910
#include <string>
1011
#include <unordered_map>
1112
#include <vector>
@@ -301,7 +302,7 @@ class _dbBlock : public _dbObject
301302
void* _extmi;
302303

303304
dbJournal* _journal;
304-
dbJournal* _journal_pending;
305+
std::stack<dbJournal*> _journal_stack;
305306

306307
_dbBlock(_dbDatabase* db);
307308
~_dbBlock();

0 commit comments

Comments
 (0)