Skip to content

Commit a4529b9

Browse files
committed
odb: add callback to BPin when adding or removing boxes so the gui and psm get updated
Signed-off-by: Peter Gadfort <[email protected]>
1 parent 118204e commit a4529b9

File tree

7 files changed

+41
-0
lines changed

7 files changed

+41
-0
lines changed

src/gui/src/search.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ void Search::inDbBPinCreate(odb::dbBPin* pin)
6161
clearShapes();
6262
}
6363

64+
void Search::inDbBPinAddBox(odb::dbBox* box)
65+
{
66+
clearShapes();
67+
}
68+
69+
void Search::inDbBPinRemoveBox(odb::dbBox* box)
70+
{
71+
clearShapes();
72+
}
73+
6474
void Search::inDbBPinDestroy(odb::dbBPin* pin)
6575
{
6676
clearShapes();

src/gui/src/search.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ class Search : public QObject, public odb::dbBlockCallBackObj
226226
const odb::dbPlacementStatus& status) override;
227227
void inDbPostMoveInst(odb::dbInst* inst) override;
228228
void inDbBPinCreate(odb::dbBPin* pin) override;
229+
void inDbBPinAddBox(odb::dbBox* box) override;
230+
void inDbBPinRemoveBox(odb::dbBox* box) override;
229231
void inDbBPinDestroy(odb::dbBPin* pin) override;
230232
void inDbFillCreate(odb::dbFill* fill) override;
231233
void inDbWireCreate(odb::dbWire* wire) override;

src/odb/include/odb/dbBlockCallBackObj.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ class dbBlockCallBackObj
125125

126126
// dbBPin Start
127127
virtual void inDbBPinCreate(dbBPin*) {}
128+
virtual void inDbBPinAddBox(dbBox*) {}
129+
virtual void inDbBPinRemoveBox(dbBox*) {}
128130
virtual void inDbBPinDestroy(dbBPin*) {}
129131
// dbBPin End
130132

src/odb/src/db/dbBPin.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ void _dbBPin::removeBox(_dbBox* box)
291291
{
292292
_dbBlock* block = (_dbBlock*) getOwner();
293293

294+
for (auto callback : block->_callbacks) {
295+
callback->inDbBPinRemoveBox((dbBox*) box);
296+
}
297+
294298
dbId<_dbBox> boxid = box->getOID();
295299
if (boxid == boxes_) {
296300
// at head of list, need to move head

src/odb/src/db/dbBox.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,11 @@ dbBox* dbBox::create(dbBPin* bpin_,
721721
bpin->boxes_ = box->getOID();
722722

723723
block->add_rect(box->shape_.rect);
724+
725+
for (auto callback : block->_callbacks) {
726+
callback->inDbBPinAddBox((dbBox*) box);
727+
}
728+
724729
return (dbBox*) box;
725730
}
726731

src/psm/include/psm/pdnsim.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ class PDNSim : public odb::dbBlockCallBackObj
103103
void inDbNetDestroy(odb::dbNet*) override;
104104
void inDbBTermPostConnect(odb::dbBTerm*) override;
105105
void inDbBTermPostDisConnect(odb::dbBTerm*, odb::dbNet*) override;
106+
void inDbBPinCreate(odb::dbBPin*) override;
107+
void inDbBPinAddBox(odb::dbBox*) override;
108+
void inDbBPinRemoveBox(odb::dbBox*) override;
106109
void inDbBPinDestroy(odb::dbBPin*) override;
107110
void inDbSWireAddSBox(odb::dbSBox*) override;
108111
void inDbSWireRemoveSBox(odb::dbSBox*) override;

src/psm/src/pdnsim.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,21 @@ void PDNSim::inDbBTermPostDisConnect(odb::dbBTerm*, odb::dbNet*)
232232
clearSolvers();
233233
}
234234

235+
void PDNSim::inDbBPinCreate(odb::dbBPin*)
236+
{
237+
clearSolvers();
238+
}
239+
240+
void PDNSim::inDbBPinAddBox(odb::dbBox*)
241+
{
242+
clearSolvers();
243+
}
244+
245+
void PDNSim::inDbBPinRemoveBox(odb::dbBox*)
246+
{
247+
clearSolvers();
248+
}
249+
235250
void PDNSim::inDbBPinDestroy(odb::dbBPin*)
236251
{
237252
clearSolvers();

0 commit comments

Comments
 (0)