From 74672531d116dae6e3a83a49800222b03df2dc5f Mon Sep 17 00:00:00 2001 From: James Cherry Date: Mon, 25 Nov 2019 13:48:53 -0700 Subject: [PATCH] exceptions don't merge when comments differ --- sdc/ExceptionPath.cc | 29 +++++++++++++++++++---------- sdc/ExceptionPath.hh | 2 +- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/sdc/ExceptionPath.cc b/sdc/ExceptionPath.cc index 41121fb3..49ceddf0 100644 --- a/sdc/ExceptionPath.cc +++ b/sdc/ExceptionPath.cc @@ -313,6 +313,12 @@ ExceptionPath::hash(ExceptionPt *missing_pt) const return hash; } +bool +ExceptionPath::mergeable(ExceptionPath *exception) const +{ + return stringEqualIf(comment_, exception->comment()); +} + bool ExceptionPath::mergeablePts(ExceptionPath *exception) const { @@ -598,7 +604,8 @@ PathDelay::typeString() const bool PathDelay::mergeable(ExceptionPath *exception) const { - return overrides(exception) + return ExceptionPath::mergeable(exception) + && overrides(exception) && exception->ignoreClkLatency() == ignore_clk_latency_ && exception->delay() == delay_; } @@ -666,15 +673,15 @@ FalsePath::typeString() const bool FalsePath::mergeable(ExceptionPath *exception) const { - return exception->isFalse() - && exception->priority() == priority() - && exception->minMax() == min_max_; + return ExceptionPath::mergeable(exception) + && overrides(exception); } bool FalsePath::overrides(ExceptionPath *exception) const { - return mergeable(exception); + return exception->priority() == priority() + && exception->minMax() == min_max_; } //////////////////////////////////////////////////////////////// @@ -790,7 +797,8 @@ MultiCyclePath::typeString() const bool MultiCyclePath::mergeable(ExceptionPath *exception) const { - return overrides(exception) + return ExceptionPath::mergeable(exception) + && overrides(exception) && exception->pathMultiplier() == path_multiplier_; } @@ -917,15 +925,16 @@ GroupPath::tighterThan(ExceptionPath *) const bool GroupPath::mergeable(ExceptionPath *exception) const { - return exception->isGroupPath() - && is_default_ == exception->isDefault() - && (name_ && exception->name() && stringEq(name_, exception->name())); + return ExceptionPath::mergeable(exception) + && overrides(exception); } bool GroupPath::overrides(ExceptionPath *exception) const { - return mergeable(exception); + return exception->isGroupPath() + && is_default_ == exception->isDefault() + && stringEqIf(name_, exception->name()); } //////////////////////////////////////////////////////////////// diff --git a/sdc/ExceptionPath.hh b/sdc/ExceptionPath.hh index 4aa641eb..e7e07721 100644 --- a/sdc/ExceptionPath.hh +++ b/sdc/ExceptionPath.hh @@ -98,7 +98,7 @@ public: size_t hash() const; size_t hash(ExceptionPt *missing_pt) const; // Mergeable properties (independent of exception points). - virtual bool mergeable(ExceptionPath *exception) const = 0; + virtual bool mergeable(ExceptionPath *exception) const; bool mergeablePts(ExceptionPath *exception) const; bool mergeablePts(ExceptionPath *exception2, ExceptionPt *missing_pt2,