write_sdc crash after delete instance resolves #248

commit 3b7eba13dcfc90dc8f8b0b6c3959c9253c302eae
Author: James Cherry <cherry@parallaxsw.com>
Date:   Thu May 29 14:05:39 2025 -0700

    write_sdc crash after delete instance resolves #248

    Signed-off-by: James Cherry <cherry@parallaxsw.com>

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2025-05-31 11:12:59 -07:00
parent 79c90c3c70
commit 0b59461bdd
5 changed files with 42 additions and 4 deletions

View File

@ -119,6 +119,9 @@ public:
ExceptionThruSeq *thrus,
ExceptionTo *to,
bool own_pts) = 0;
void deleteInstance(const Instance *inst,
const Network *network);
// Default handlers.
virtual bool useEndClk() const { return false; }
virtual int pathMultiplier() const { return 0; }
@ -414,14 +417,14 @@ public:
Network *) {}
virtual void disconnectPinBefore(const Pin *,
Network *) {}
void deleteInstance(const Instance *inst,
const Network *network);
protected:
virtual void findHash(const Network *network);
void deletePin(const Pin *pin,
const Network *network);
void deleteInstance(const Instance *inst,
const Network *network);
virtual const char *cmdKeyword() const = 0;
PinSet *pins_;
@ -536,6 +539,8 @@ public:
Network *network);
virtual void disconnectPinBefore(const Pin *pin,
Network *network);
void deleteInstance(const Instance *inst,
const Network *network);
protected:
void findHash(const Network *network);
@ -553,8 +558,6 @@ protected:
void deleteEdge(const EdgePins &edge);
void deleteNet(const Net *net,
const Network *network);
void deleteInstance(const Instance *inst,
const Network *network);
void makeAllEdges(const Network *network);
void makePinEdges(const Network *network);
void makeNetEdges(const Network *network);

View File

@ -216,6 +216,7 @@ public:
// Build data structures for search.
void searchPreamble();
void deleteNetBefore(const Net *net);
void deleteInstanceBefore(const Instance *inst);
// SWIG sdc interface.
PortSeq allInputs(bool no_clks);

View File

@ -458,6 +458,20 @@ thrusIntersectPts(ExceptionThruSeq *thrus1,
return true;
}
void
ExceptionPath::deleteInstance(const Instance *inst,
const Network *network)
{
if (from_)
from_->deleteInstance(inst, network);
if (thrus_) {
for (ExceptionThru *thru : *thrus_)
thru->deleteInstance(inst, network);
}
if (to_)
to_->deleteInstance(inst, network);
}
////////////////////////////////////////////////////////////////
PathDelay::PathDelay(ExceptionFrom *from,

View File

@ -363,6 +363,25 @@ Sdc::deleteNetBefore(const Net *net)
}
}
// see Sdc::isConstrained
void
Sdc::deleteInstanceBefore(const Instance *inst)
{
instance_pvt_maps_[MinMax::minIndex()].erase(inst);
instance_pvt_maps_[MinMax::maxIndex()].erase(inst);
inst_derating_factors_.erase(inst);
inst_clk_gating_check_map_.erase(inst);
disabled_inst_ports_.erase(inst);
inst_latch_borrow_limit_map_.erase(inst);
inst_min_pulse_width_map_.erase(inst);
for (ExceptionPath *exception : exceptions_)
exception->deleteInstance(inst, network_);
first_from_inst_exceptions_.erase(inst);
first_thru_inst_exceptions_.erase(inst);
first_to_inst_exceptions_.erase(inst);
}
void
Sdc::makeCornersBefore()
{

View File

@ -4579,6 +4579,7 @@ void
Sta::deleteLeafInstanceBefore(const Instance *inst)
{
sim_->deleteInstanceBefore(inst);
sdc_->deleteInstanceBefore(inst);
}
void