Exception::delete* hash update resolves #325

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2025-11-04 16:57:28 -07:00
parent 28812daf20
commit 10a3cdc4d1
2 changed files with 39 additions and 20 deletions

View File

@ -144,7 +144,7 @@ typedef UnorderedMap<EdgePins, ExceptionPathSet*,
PinPairHash, PinPairEqual> EdgeExceptionsMap; PinPairHash, PinPairEqual> EdgeExceptionsMap;
typedef Vector<ExceptionThru*> ExceptionThruSeq; typedef Vector<ExceptionThru*> ExceptionThruSeq;
typedef Map<const Port*,InputDrive*> InputDriveMap; typedef Map<const Port*,InputDrive*> InputDriveMap;
typedef Map<int, ExceptionPathSet*, std::less<int> > ExceptionPathPtHash; typedef Map<size_t, ExceptionPathSet*, std::less<size_t> > ExceptionPathPtHash;
typedef Set<ClockLatency*, ClockLatencyLess> ClockLatencies; typedef Set<ClockLatency*, ClockLatencyLess> ClockLatencies;
typedef Map<const Pin*, ClockUncertainties*> PinClockUncertaintyMap; typedef Map<const Pin*, ClockUncertainties*> PinClockUncertaintyMap;
typedef Set<InterClockUncertainty*, InterClockUncertaintyLess> InterClockUncertaintySet; typedef Set<InterClockUncertainty*, InterClockUncertaintyLess> InterClockUncertaintySet;

View File

@ -630,7 +630,8 @@ FalsePath::overrides(ExceptionPath *exception) const
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
LoopPath::LoopPath(ExceptionThruSeq *thrus, bool own_pts) : LoopPath::LoopPath(ExceptionThruSeq *thrus,
bool own_pts) :
FalsePath(nullptr, thrus, nullptr, MinMaxAll::all(), own_pts, FalsePath(nullptr, thrus, nullptr, MinMaxAll::all(), own_pts,
falsePathPriority() + fromThruToPriority(nullptr, thrus, nullptr), falsePathPriority() + fromThruToPriority(nullptr, thrus, nullptr),
nullptr) nullptr)
@ -1128,32 +1129,41 @@ ExceptionFromTo::deletePin(const Pin *pin,
const Network *network) const Network *network)
{ {
if (pins_) { if (pins_) {
pins_->erase(pin); auto itr = pins_->find(pin);
if (itr != pins_->end()) {
pins_->erase(itr);
// Incrementally update hash. // Incrementally update hash.
hash_ -= network->id(pin) * hash_pin; hash_ -= network->id(pin) * hash_pin;
} }
} }
}
void void
ExceptionFromTo::deleteClock(Clock *clk) ExceptionFromTo::deleteClock(Clock *clk)
{ {
if (clks_) { if (clks_) {
clks_->erase(clk); auto itr = clks_->find(clk);
if (itr != clks_->end()) {
clks_->erase(itr);
// Incrementally update hash. // Incrementally update hash.
hash_ -= clk->index() * hash_clk; hash_ -= clk->index() * hash_clk;
} }
} }
}
void void
ExceptionFromTo::deleteInstance(const Instance *inst, ExceptionFromTo::deleteInstance(const Instance *inst,
const Network *network) const Network *network)
{ {
if (insts_) { if (insts_) {
insts_->erase(inst); auto itr = insts_->find(inst);
if (itr != insts_->end()) {
insts_->erase(itr);
// Incrementally update hash. // Incrementally update hash.
hash_ -= network->id(inst) * hash_inst; hash_ -= network->id(inst) * hash_inst;
} }
} }
}
void void
ExceptionFromTo::disconnectPinBefore(const Pin *pin, ExceptionFromTo::disconnectPinBefore(const Pin *pin,
@ -1782,33 +1792,42 @@ ExceptionThru::deletePin(const Pin *pin,
const Network *network) const Network *network)
{ {
if (pins_) { if (pins_) {
pins_->erase(pin); auto itr = pins_->find(pin);
if (itr != pins_->end()) {
pins_->erase(itr);
// Incrementally update hash. // Incrementally update hash.
hash_ -= network->id(pin) * hash_pin; hash_ -= network->id(pin) * hash_pin;
} }
} }
}
void void
ExceptionThru::deleteNet(const Net *net, ExceptionThru::deleteNet(const Net *net,
const Network *network) const Network *network)
{ {
if (nets_) { if (nets_) {
nets_->erase(net); auto itr = nets_->find(net);
if (itr != nets_->end()) {
nets_->erase(itr);
// Incrementally update hash. // Incrementally update hash.
hash_ -= network->id(net) * hash_net; hash_ -= network->id(net) * hash_net;
} }
} }
}
void void
ExceptionThru::deleteInstance(const Instance *inst, ExceptionThru::deleteInstance(const Instance *inst,
const Network *network) const Network *network)
{ {
if (insts_) { if (insts_) {
insts_->erase(inst); auto itr = insts_->find(inst);
if (itr != insts_->end()) {
insts_->erase(itr);
// Incrementally update hash. // Incrementally update hash.
hash_ -= network->id(inst) * hash_inst; hash_ -= network->id(inst) * hash_inst;
} }
} }
}
void void
ExceptionThru::deleteEdge(const EdgePins &edge) ExceptionThru::deleteEdge(const EdgePins &edge)