mirror of
https://github.com/The-OpenROAD-Project/OpenSTA.git
synced 2026-05-30 00:24:12 +08:00
@@ -119,15 +119,15 @@ public:
|
||||
ArcDcalcResult(size_t load_count);
|
||||
void setLoadCount(size_t load_count);
|
||||
ArcDelay &gateDelay() { return gate_delay_; }
|
||||
void setGateDelay(ArcDelay gate_delay);
|
||||
void setGateDelay(const ArcDelay &gate_delay);
|
||||
Slew &drvrSlew() { return drvr_slew_; }
|
||||
void setDrvrSlew(Slew drvr_slew);
|
||||
ArcDelay wireDelay(size_t load_idx) const;
|
||||
void setDrvrSlew(const Slew &drvr_slew);
|
||||
const ArcDelay &wireDelay(size_t load_idx) const;
|
||||
void setWireDelay(size_t load_idx,
|
||||
ArcDelay wire_delay);
|
||||
Slew loadSlew(size_t load_idx) const;
|
||||
const ArcDelay &wire_delay);
|
||||
const Slew &loadSlew(size_t load_idx) const;
|
||||
void setLoadSlew(size_t load_idx,
|
||||
Slew load_slew);
|
||||
const Slew &load_slew);
|
||||
|
||||
protected:
|
||||
ArcDelay gate_delay_;
|
||||
|
||||
@@ -24,27 +24,326 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "StaConfig.hh"
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
|
||||
// IWYU pragma: begin_exports
|
||||
#if (SSTA == 1)
|
||||
// Delays are Normal PDFs.
|
||||
#include "DelayNormal1.hh"
|
||||
#elif (SSTA == 2)
|
||||
// Delays are Normal PDFs with early/late sigma.
|
||||
#include "DelayNormal2.hh"
|
||||
#else
|
||||
// Delays are floats.
|
||||
#include "DelayFloat.hh"
|
||||
#endif
|
||||
// IWYU pragma: end_exports
|
||||
#include "StaConfig.hh"
|
||||
#include "MinMax.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
class StaState;
|
||||
|
||||
class Delay
|
||||
{
|
||||
public:
|
||||
Delay();
|
||||
Delay(float mean);
|
||||
Delay(float mean,
|
||||
// std_dev^2
|
||||
float std_dev2);
|
||||
Delay(float mean,
|
||||
float mean_shift,
|
||||
// std_dev^2
|
||||
float std_dev2,
|
||||
float skewness);
|
||||
void setValues(float mean,
|
||||
float mean_shift,
|
||||
float std_dev2,
|
||||
float skewnes);
|
||||
float mean() const { return values_[0]; }
|
||||
void setMean(float mean);
|
||||
float meanShift() const { return values_[1]; }
|
||||
void setMeanShift(float mean_shift);
|
||||
float stdDev() const;
|
||||
// std_dev ^ 2
|
||||
float stdDev2() const { return values_[2]; }
|
||||
void setStdDev(float std_dev);
|
||||
float skewness() const { return values_[3]; }
|
||||
void setSkewness(float skewness);
|
||||
|
||||
void operator=(float delay);
|
||||
|
||||
private:
|
||||
std::array<float, 4> values_;
|
||||
};
|
||||
|
||||
// Delay with doubles for accumulating Delays.
|
||||
// Only a subset of operations are required for DelayDbl.
|
||||
class DelayDbl
|
||||
{
|
||||
public:
|
||||
DelayDbl();
|
||||
DelayDbl(double value);
|
||||
double mean() const { return values_[0]; }
|
||||
void setMean(double mean);
|
||||
double meanShift() const { return values_[1]; }
|
||||
// std_dev ^ 2
|
||||
double stdDev2() const { return values_[2]; }
|
||||
double stdDev() const;
|
||||
double skewness() const { return values_[3]; }
|
||||
void setValues(double mean,
|
||||
double mean_shift,
|
||||
double std_dev2,
|
||||
double skewnes);
|
||||
|
||||
void operator=(double delay);
|
||||
|
||||
private:
|
||||
std::array<double, 4> values_;
|
||||
};
|
||||
|
||||
using ArcDelay = Delay;
|
||||
using Slew = Delay;
|
||||
using Arrival = Delay;
|
||||
using Required = Delay;
|
||||
using Slack = Delay;
|
||||
|
||||
const Delay delay_zero(0.0);
|
||||
|
||||
class DelayOps
|
||||
{
|
||||
public:
|
||||
virtual ~DelayOps() {}
|
||||
virtual float stdDev2(const Delay &delay,
|
||||
const EarlyLate *early_late) const = 0;
|
||||
virtual float asFloat(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta) const = 0;
|
||||
virtual double asFloat(const DelayDbl &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta) const = 0;
|
||||
virtual bool isZero(const Delay &delay) const = 0;
|
||||
virtual bool isInf(const Delay &delay) const = 0;
|
||||
virtual bool equal(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const = 0;
|
||||
virtual bool less(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const = 0;
|
||||
virtual bool less(const DelayDbl &delay1,
|
||||
const DelayDbl &delay2,
|
||||
const StaState *sta) const = 0;
|
||||
virtual bool lessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const = 0;
|
||||
virtual bool greater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const = 0;
|
||||
virtual bool greaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const = 0;
|
||||
virtual Delay sum(const Delay &delay1,
|
||||
const Delay &delay2) const = 0;
|
||||
virtual Delay sum(const Delay &delay1,
|
||||
float delay2) const = 0;
|
||||
virtual Delay diff(const Delay &delay1,
|
||||
const Delay &delay2) const = 0;
|
||||
virtual Delay diff(const Delay &delay1,
|
||||
float delay2) const = 0;
|
||||
virtual Delay diff(float delay1,
|
||||
const Delay &delay2) const = 0;
|
||||
virtual void incr(Delay &delay1,
|
||||
const Delay &delay2) const = 0;
|
||||
virtual void incr(DelayDbl &delay1,
|
||||
const Delay &delay2) const = 0;
|
||||
virtual void decr(Delay &delay1,
|
||||
const Delay &delay2) const = 0;
|
||||
virtual void decr(DelayDbl &delay1,
|
||||
const Delay &delay2) const = 0;
|
||||
virtual Delay product(const Delay &delay1,
|
||||
float delay2) const = 0;
|
||||
virtual Delay div(float delay1,
|
||||
const Delay &delay2) const = 0;
|
||||
virtual const char *asStringVariance(const Delay &delay,
|
||||
int digits,
|
||||
const StaState *sta) const = 0;
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
initDelayConstants();
|
||||
|
||||
inline float
|
||||
square(float x)
|
||||
{
|
||||
return x * x;
|
||||
}
|
||||
|
||||
inline double
|
||||
square(double x)
|
||||
{
|
||||
return x * x;
|
||||
}
|
||||
|
||||
inline float
|
||||
cube(float x)
|
||||
{
|
||||
return x * x * x;
|
||||
}
|
||||
|
||||
inline double
|
||||
cube(double x)
|
||||
{
|
||||
return x * x * x;
|
||||
}
|
||||
|
||||
Delay
|
||||
makeDelay(float mean,
|
||||
float mean_shift,
|
||||
float std_dev,
|
||||
float skewness);
|
||||
Delay
|
||||
makeDelay(float mean,
|
||||
float std_dev);
|
||||
Delay
|
||||
makeDelay2(float mean,
|
||||
float std_dev);
|
||||
void
|
||||
delaySetMean(Delay &delay,
|
||||
float mean);
|
||||
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const StaState *sta);
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta);
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
int digits,
|
||||
const StaState *sta);
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
bool report_variance,
|
||||
int digits,
|
||||
const StaState *sta);
|
||||
|
||||
float
|
||||
delayAsFloat(const Delay &delay);
|
||||
float
|
||||
delayAsFloat(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta);
|
||||
float
|
||||
delayAsFloat(const DelayDbl &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta);
|
||||
|
||||
Delay
|
||||
delayDblAsDelay(DelayDbl &delay);
|
||||
|
||||
Delay
|
||||
delaySum(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
Delay
|
||||
delaySum(const Delay &delay1,
|
||||
float delay2,
|
||||
const StaState *sta);
|
||||
Delay
|
||||
delayDiff(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
Delay
|
||||
delayDiff(const Delay &delay1,
|
||||
float delay2,
|
||||
const StaState *sta);
|
||||
Delay
|
||||
delayDiff(float delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
void
|
||||
delayIncr(Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
void
|
||||
delayIncr(DelayDbl &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
void
|
||||
delayIncr(Delay &delay1,
|
||||
float delay2,
|
||||
const StaState *sta);
|
||||
void
|
||||
delayDecr(Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
void
|
||||
delayDecr(DelayDbl &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
Delay
|
||||
delayProduct(const Delay &delay1,
|
||||
float delay2,
|
||||
const StaState *sta);
|
||||
Delay
|
||||
delayDiv(float delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
|
||||
const Delay &
|
||||
delayInitValue(const MinMax *min_max);
|
||||
bool
|
||||
delayIsInitValue(const Delay &delay,
|
||||
const MinMax *min_max);
|
||||
bool
|
||||
delayZero(const Delay &delay,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayInf(const Delay &delay,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLess(const DelayDbl &delay1,
|
||||
const DelayDbl &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
|
||||
// delay1-delay2 subtracting sigma instead of addiing.
|
||||
Delay
|
||||
delayRemove(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
// OpenSTA, Static Timing Analyzer
|
||||
// Copyright (c) 2026, Parallax Software, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
// The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software.
|
||||
//
|
||||
// Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
//
|
||||
// This notice may not be removed or altered from any source distribution.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MinMax.hh"
|
||||
|
||||
// Delay values defined as floats.
|
||||
|
||||
namespace sta {
|
||||
|
||||
class StaState;
|
||||
|
||||
using Delay = float;
|
||||
// Delay double for accumulating Delays.
|
||||
using DelayDbl = double;
|
||||
|
||||
const Delay delay_zero = 0.0;
|
||||
|
||||
void
|
||||
initDelayConstants();
|
||||
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const StaState *sta);
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const StaState *sta,
|
||||
int digits);
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta,
|
||||
int digits);
|
||||
|
||||
inline Delay
|
||||
makeDelay(float delay,
|
||||
float,
|
||||
float)
|
||||
{
|
||||
return delay;
|
||||
}
|
||||
|
||||
inline Delay
|
||||
makeDelay2(float delay,
|
||||
float,
|
||||
float)
|
||||
{
|
||||
return delay;
|
||||
}
|
||||
|
||||
inline float
|
||||
delayAsFloat(const Delay &delay)
|
||||
{
|
||||
return delay;
|
||||
}
|
||||
|
||||
// mean late+/early- sigma
|
||||
inline float
|
||||
delayAsFloat(const Delay &delay,
|
||||
const EarlyLate *,
|
||||
const StaState *)
|
||||
{
|
||||
return delay;
|
||||
}
|
||||
|
||||
inline float
|
||||
delaySigma2(const Delay &,
|
||||
const EarlyLate *)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
const Delay &
|
||||
delayInitValue(const MinMax *min_max);
|
||||
bool
|
||||
delayIsInitValue(const Delay &delay,
|
||||
const MinMax *min_max);
|
||||
bool
|
||||
delayZero(const Delay &delay);
|
||||
bool
|
||||
delayInf(const Delay &delay);
|
||||
bool
|
||||
delayEqual(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
bool
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
|
||||
// delay1-delay2 subtracting sigma instead of addiing.
|
||||
Delay
|
||||
delayRemove(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
float
|
||||
delayRatio(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
|
||||
} // namespace
|
||||
90
include/sta/DelayNormal.hh
Normal file
90
include/sta/DelayNormal.hh
Normal file
@@ -0,0 +1,90 @@
|
||||
// OpenSTA, Static Timing Analyzer
|
||||
// Copyright (c) 2025, Parallax Software, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
// The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software.
|
||||
//
|
||||
// Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
//
|
||||
// This notice may not be removed or altered from any source distribution.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Delay.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
class DelayOpsNormal : public DelayOps
|
||||
{
|
||||
public:
|
||||
float stdDev2(const Delay &delay,
|
||||
const EarlyLate *early_late) const override;
|
||||
float asFloat(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta) const override;
|
||||
double asFloat(const DelayDbl &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta) const override;
|
||||
|
||||
bool isZero(const Delay &delay) const override;
|
||||
bool isInf(const Delay &delay) const override;
|
||||
bool equal(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool less(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool less(const DelayDbl &delay1,
|
||||
const DelayDbl &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool lessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool greater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool greaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
Delay sum(const Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
Delay sum(const Delay &delay1,
|
||||
float delay2) const override;
|
||||
Delay diff(const Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
Delay diff(const Delay &delay1,
|
||||
float delay2) const override;
|
||||
Delay diff(float delay1,
|
||||
const Delay &delay2) const override;
|
||||
void incr(Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
void incr(DelayDbl &delay1,
|
||||
const Delay &delay2) const override;
|
||||
void decr(Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
void decr(DelayDbl &delay1,
|
||||
const Delay &delay2) const override;
|
||||
Delay product(const Delay &delay1,
|
||||
float delay2) const override;
|
||||
Delay div(float delay1,
|
||||
const Delay &delay2) const override;
|
||||
const char *asStringVariance(const Delay &delay,
|
||||
int digits,
|
||||
const StaState *sta) const override;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@@ -1,203 +0,0 @@
|
||||
// OpenSTA, Static Timing Analyzer
|
||||
// Copyright (c) 2026, Parallax Software, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
// The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software.
|
||||
//
|
||||
// Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
//
|
||||
// This notice may not be removed or altered from any source distribution.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MinMax.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
class Delay;
|
||||
class DelayDbl;
|
||||
class StaState;
|
||||
|
||||
// Normal distribution with std deviation.
|
||||
class Delay
|
||||
{
|
||||
public:
|
||||
Delay();
|
||||
Delay(const Delay &delay);
|
||||
Delay(const DelayDbl &delay);
|
||||
Delay(float mean);
|
||||
Delay(float mean,
|
||||
float sigma2);
|
||||
float mean() const { return mean_; }
|
||||
float sigma() const;
|
||||
// sigma^2
|
||||
float sigma2() const;
|
||||
void operator=(const Delay &delay);
|
||||
void operator=(float delay);
|
||||
void operator+=(const Delay &delay);
|
||||
void operator+=(float delay);
|
||||
Delay operator+(const Delay &delay) const;
|
||||
Delay operator+(float delay) const;
|
||||
Delay operator-(const Delay &delay) const;
|
||||
Delay operator-(float delay) const;
|
||||
Delay operator-() const;
|
||||
void operator-=(float delay);
|
||||
void operator-=(const Delay &delay);
|
||||
bool operator==(const Delay &delay) const;
|
||||
|
||||
private:
|
||||
float mean_;
|
||||
// Sigma^2
|
||||
float sigma2_;
|
||||
|
||||
friend class DelayDbl;
|
||||
};
|
||||
|
||||
// Dwlay with doubles for accumulating delays.
|
||||
class DelayDbl
|
||||
{
|
||||
public:
|
||||
DelayDbl();
|
||||
float mean() const { return mean_; }
|
||||
float sigma() const;
|
||||
// sigma^2
|
||||
float sigma2() const;
|
||||
void operator=(float delay);
|
||||
void operator+=(const Delay &delay);
|
||||
void operator-=(const Delay &delay);
|
||||
|
||||
private:
|
||||
double mean_;
|
||||
// Sigma^2
|
||||
double sigma2_;
|
||||
|
||||
friend class Delay;
|
||||
};
|
||||
|
||||
const Delay delay_zero(0.0);
|
||||
|
||||
void
|
||||
initDelayConstants();
|
||||
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const StaState *sta);
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const StaState *sta,
|
||||
int digits);
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta,
|
||||
int digits);
|
||||
|
||||
Delay
|
||||
makeDelay(float delay,
|
||||
float sigma_early,
|
||||
float sigma_late);
|
||||
|
||||
Delay
|
||||
makeDelay2(float delay,
|
||||
// sigma^2
|
||||
float sigma_early,
|
||||
float sigma_late);
|
||||
|
||||
inline float
|
||||
delayAsFloat(const Delay &delay)
|
||||
{
|
||||
return delay.mean();
|
||||
}
|
||||
|
||||
// mean late+/early- sigma
|
||||
float
|
||||
delayAsFloat(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta);
|
||||
float
|
||||
delaySigma2(const Delay &delay,
|
||||
const EarlyLate *early_late);
|
||||
const Delay &
|
||||
delayInitValue(const MinMax *min_max);
|
||||
bool
|
||||
delayIsInitValue(const Delay &delay,
|
||||
const MinMax *min_max);
|
||||
bool
|
||||
delayZero(const Delay &delay);
|
||||
bool
|
||||
delayInf(const Delay &delay);
|
||||
bool
|
||||
delayEqual(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
bool
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
|
||||
// delay1-delay2 subtracting sigma instead of addiing.
|
||||
Delay delayRemove(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
float
|
||||
delayRatio(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
|
||||
// Most non-operator functions on Delay are not defined as member
|
||||
// functions so they can be defined on floats, where there is no class
|
||||
// to define them.
|
||||
|
||||
Delay operator+(float delay1,
|
||||
const Delay &delay2);
|
||||
// Used for parallel gate delay calc.
|
||||
Delay operator/(float delay1,
|
||||
const Delay &delay2);
|
||||
// Used for parallel gate delay calc.
|
||||
Delay operator*(const Delay &delay1,
|
||||
float delay2);
|
||||
|
||||
} // namespace
|
||||
@@ -1,214 +0,0 @@
|
||||
// OpenSTA, Static Timing Analyzer
|
||||
// Copyright (c) 2026, Parallax Software, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
// The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software.
|
||||
//
|
||||
// Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
//
|
||||
// This notice may not be removed or altered from any source distribution.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MinMax.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
class Delay;
|
||||
class DelayDbl;
|
||||
class StaState;
|
||||
|
||||
// Normal distribution with early(left)/late(right) std deviations.
|
||||
class Delay
|
||||
{
|
||||
public:
|
||||
Delay();
|
||||
Delay(const Delay &delay);
|
||||
Delay(const DelayDbl &delay);
|
||||
Delay(float mean);
|
||||
Delay(float mean,
|
||||
float sigma2_early,
|
||||
float sigma2_late);
|
||||
float mean() const { return mean_; }
|
||||
float sigma(const EarlyLate *early_late) const;
|
||||
// sigma^2
|
||||
float sigma2(const EarlyLate *early_late) const;
|
||||
float sigma2Early() const;
|
||||
float sigma2Late() const;
|
||||
void operator=(const Delay &delay);
|
||||
void operator=(float delay);
|
||||
void operator+=(const Delay &delay);
|
||||
void operator+=(float delay);
|
||||
Delay operator+(const Delay &delay) const;
|
||||
Delay operator+(float delay) const;
|
||||
Delay operator-(const Delay &delay) const;
|
||||
Delay operator-(float delay) const;
|
||||
Delay operator-() const;
|
||||
void operator-=(float delay);
|
||||
void operator-=(const Delay &delay);
|
||||
bool operator==(const Delay &delay) const;
|
||||
|
||||
protected:
|
||||
static const int early_index = 0;
|
||||
static const int late_index = 1;
|
||||
|
||||
private:
|
||||
float mean_;
|
||||
// Sigma^2
|
||||
float sigma2_[EarlyLate::index_count];
|
||||
|
||||
friend class DelayDbl;
|
||||
};
|
||||
|
||||
// Dwlay with doubles for accumulating delays.
|
||||
class DelayDbl
|
||||
{
|
||||
public:
|
||||
DelayDbl();
|
||||
float mean() const { return mean_; }
|
||||
float sigma() const;
|
||||
// sigma^2
|
||||
float sigma2() const;
|
||||
void operator=(float delay);
|
||||
void operator+=(const Delay &delay);
|
||||
void operator-=(const Delay &delay);
|
||||
|
||||
protected:
|
||||
static const int early_index = 0;
|
||||
static const int late_index = 1;
|
||||
|
||||
private:
|
||||
double mean_;
|
||||
// Sigma^2
|
||||
double sigma2_[EarlyLate::index_count];
|
||||
|
||||
friend class Delay;
|
||||
};
|
||||
|
||||
const Delay delay_zero(0.0);
|
||||
|
||||
void
|
||||
initDelayConstants();
|
||||
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const StaState *sta);
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const StaState *sta,
|
||||
int digits);
|
||||
const char *
|
||||
delayAsString(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta,
|
||||
int digits);
|
||||
|
||||
Delay
|
||||
makeDelay(float delay,
|
||||
float sigma_early,
|
||||
float sigma_late);
|
||||
|
||||
Delay
|
||||
makeDelay2(float delay,
|
||||
// sigma^2
|
||||
float sigma_early,
|
||||
float sigma_late);
|
||||
|
||||
inline float
|
||||
delayAsFloat(const Delay &delay)
|
||||
{
|
||||
return delay.mean();
|
||||
}
|
||||
|
||||
// mean late+/early- sigma
|
||||
float
|
||||
delayAsFloat(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta);
|
||||
float
|
||||
delaySigma2(const Delay &delay,
|
||||
const EarlyLate *early_late);
|
||||
const Delay &
|
||||
delayInitValue(const MinMax *min_max);
|
||||
bool
|
||||
delayIsInitValue(const Delay &delay,
|
||||
const MinMax *min_max);
|
||||
bool
|
||||
delayZero(const Delay &delay);
|
||||
bool
|
||||
delayInf(const Delay &delay);
|
||||
bool
|
||||
delayEqual(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
bool
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayGreater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
|
||||
// delay1-delay2 subtracting sigma instead of addiing.
|
||||
Delay delayRemove(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
float
|
||||
delayRatio(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
|
||||
// Most non-operator functions on Delay are not defined as member
|
||||
// functions so they can be defined on floats, where there is no class
|
||||
// to define them.
|
||||
|
||||
Delay operator+(float delay1,
|
||||
const Delay &delay2);
|
||||
// Used for parallel gate delay calc.
|
||||
Delay operator/(float delay1,
|
||||
const Delay &delay2);
|
||||
// Used for parallel gate delay calc.
|
||||
Delay operator*(const Delay &delay1,
|
||||
float delay2);
|
||||
|
||||
} // namespace
|
||||
90
include/sta/DelayScalar.hh
Normal file
90
include/sta/DelayScalar.hh
Normal file
@@ -0,0 +1,90 @@
|
||||
// OpenSTA, Static Timing Analyzer
|
||||
// Copyright (c) 2025, Parallax Software, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
// The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software.
|
||||
//
|
||||
// Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
//
|
||||
// This notice may not be removed or altered from any source distribution.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Delay.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
class DelayOpsScalar : public DelayOps
|
||||
{
|
||||
public:
|
||||
float stdDev2(const Delay &delay,
|
||||
const EarlyLate *early_late) const override;
|
||||
float asFloat(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta) const override;
|
||||
double asFloat(const DelayDbl &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta) const override;
|
||||
|
||||
bool isZero(const Delay &delay) const override;
|
||||
bool isInf(const Delay &delay) const override;
|
||||
bool equal(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool less(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool less(const DelayDbl &delay1,
|
||||
const DelayDbl &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool lessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool greater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool greaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
Delay sum(const Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
Delay sum(const Delay &delay1,
|
||||
float delay2) const override;
|
||||
Delay diff(const Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
Delay diff(const Delay &delay1,
|
||||
float delay2) const override;
|
||||
Delay diff(float delay1,
|
||||
const Delay &delay2) const override;
|
||||
void incr(Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
void incr(DelayDbl &delay1,
|
||||
const Delay &delay2) const override;
|
||||
void decr(Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
void decr(DelayDbl &delay1,
|
||||
const Delay &delay2) const override;
|
||||
Delay product(const Delay &delay1,
|
||||
float delay2) const override;
|
||||
Delay div(float delay1,
|
||||
const Delay &delay2) const override;
|
||||
const char *asStringVariance(const Delay &delay,
|
||||
int digits,
|
||||
const StaState *sta) const override;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
98
include/sta/DelaySkewNormal.hh
Normal file
98
include/sta/DelaySkewNormal.hh
Normal file
@@ -0,0 +1,98 @@
|
||||
// OpenSTA, Static Timing Analyzer
|
||||
// Copyright (c) 2025, Parallax Software, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
// The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software.
|
||||
//
|
||||
// Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
//
|
||||
// This notice may not be removed or altered from any source distribution.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Delay.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
class DelayOpsSkewNormal : public DelayOps
|
||||
{
|
||||
public:
|
||||
float stdDev2(const Delay &delay,
|
||||
const EarlyLate *early_late) const override;
|
||||
float asFloat(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta) const override;
|
||||
double asFloat(const DelayDbl &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta) const override;
|
||||
|
||||
bool isZero(const Delay &delay) const override;
|
||||
bool isInf(const Delay &delay) const override;
|
||||
bool equal(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool less(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool less(const DelayDbl &delay1,
|
||||
const DelayDbl &delay2,
|
||||
const StaState *sta) const override;
|
||||
bool lessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *) const override;
|
||||
bool greater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *) const override;
|
||||
bool greaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const StaState *) const override;
|
||||
Delay sum(const Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
Delay sum(const Delay &delay1,
|
||||
float delay2) const override;
|
||||
Delay diff(const Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
Delay diff(const Delay &delay1,
|
||||
float delay2) const override;
|
||||
Delay diff(float delay1,
|
||||
const Delay &delay2) const override;
|
||||
void incr(Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
void incr(DelayDbl &delay1,
|
||||
const Delay &delay2) const override;
|
||||
void decr(Delay &delay1,
|
||||
const Delay &delay2) const override;
|
||||
void decr(DelayDbl &delay1,
|
||||
const Delay &delay2) const override;
|
||||
Delay product(const Delay &delay1,
|
||||
float delay2) const override;
|
||||
Delay div(float delay1,
|
||||
const Delay &delay2) const override;
|
||||
const char *asStringVariance(const Delay &delay,
|
||||
int digits,
|
||||
const StaState *sta) const override;
|
||||
|
||||
private:
|
||||
float skewnessSum(const Delay &delay1,
|
||||
const Delay &delay2) const;
|
||||
double skewnessSum(double std_dev1,
|
||||
double skewness1,
|
||||
double std_dev2,
|
||||
double skewness2) const;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@@ -58,13 +58,7 @@ static constexpr ObjectIdx vertex_idx_null = object_idx_null;
|
||||
class Graph : public StaState
|
||||
{
|
||||
public:
|
||||
// slew_rf_count is
|
||||
// 0 no slews
|
||||
// 1 one slew for rise/fall
|
||||
// 2 rise/fall slews
|
||||
// ap_count is the dcalc analysis point count.
|
||||
Graph(StaState *sta,
|
||||
int slew_rf_count,
|
||||
DcalcAPIndex ap_count);
|
||||
void makeGraph();
|
||||
~Graph();
|
||||
@@ -100,6 +94,8 @@ public:
|
||||
const Slew &slew(const Vertex *vertex,
|
||||
const RiseFall *rf,
|
||||
DcalcAPIndex ap_index);
|
||||
const Slew &slew(const Vertex *vertex,
|
||||
size_t index);
|
||||
void setSlew(Vertex *vertex,
|
||||
const RiseFall *rf,
|
||||
DcalcAPIndex ap_index,
|
||||
@@ -128,13 +124,13 @@ public:
|
||||
Edge *&edge,
|
||||
const TimingArc *&arc) const;
|
||||
|
||||
ArcDelay arcDelay(const Edge *edge,
|
||||
const TimingArc *arc,
|
||||
DcalcAPIndex ap_index) const;
|
||||
const ArcDelay &arcDelay(const Edge *edge,
|
||||
const TimingArc *arc,
|
||||
DcalcAPIndex ap_index) const;
|
||||
void setArcDelay(Edge *edge,
|
||||
const TimingArc *arc,
|
||||
DcalcAPIndex ap_index,
|
||||
ArcDelay delay);
|
||||
const ArcDelay &delay);
|
||||
// Alias for arcDelays using library wire arcs.
|
||||
const ArcDelay &wireArcDelay(const Edge *edge,
|
||||
const RiseFall *rf,
|
||||
@@ -222,7 +218,6 @@ protected:
|
||||
// driver/source (top level input, instance pin output) vertex
|
||||
// in pin_bidirect_drvr_vertex_map
|
||||
PinVertexMap pin_bidirect_drvr_vertex_map_;
|
||||
int slew_rf_count_;
|
||||
DcalcAPIndex ap_count_;
|
||||
// Sdf period check annotations.
|
||||
PeriodCheckAnnotations *period_check_annotations_;
|
||||
@@ -258,8 +253,6 @@ public:
|
||||
[[nodiscard]] bool isRoot() const{ return level_ == 0; }
|
||||
[[nodiscard]] bool hasFanin() const;
|
||||
[[nodiscard]] bool hasFanout() const;
|
||||
Slew *slews() { return slews_; }
|
||||
const Slew *slews() const { return slews_; }
|
||||
Path *paths() const { return paths_; }
|
||||
Path *makePaths(uint32_t count);
|
||||
void setPaths(Path *paths);
|
||||
@@ -298,14 +291,18 @@ protected:
|
||||
bool is_bidirect_drvr,
|
||||
bool is_reg_clk);
|
||||
void clear();
|
||||
void setSlews(Slew *slews);
|
||||
Slew *slews() { return std::bit_cast<Slew*>(slews_); }
|
||||
const Slew *slews() const { return std::bit_cast<const Slew*>(slews_); }
|
||||
float *slewsFloat() { return slews_; }
|
||||
const float *slewsFloat() const { return slews_; }
|
||||
void setSlews(float *slews);
|
||||
|
||||
Pin *pin_;
|
||||
EdgeId in_edges_; // Edges to this vertex.
|
||||
EdgeId out_edges_; // Edges from this vertex.
|
||||
|
||||
// Delay calc
|
||||
Slew *slews_;
|
||||
float *slews_;
|
||||
// Search
|
||||
Path *paths_;
|
||||
|
||||
@@ -356,8 +353,9 @@ public:
|
||||
TimingSense sense() const;
|
||||
TimingArcSet *timingArcSet() const { return arc_set_; }
|
||||
void setTimingArcSet(TimingArcSet *set);
|
||||
ArcDelay *arcDelays() const { return arc_delays_; }
|
||||
void setArcDelays(ArcDelay *arc_delays);
|
||||
float *arcDelays() { return arc_delays_; }
|
||||
const float *arcDelays() const { return arc_delays_; }
|
||||
void setArcDelays(float *delays);
|
||||
bool delay_Annotation_Is_Incremental() const {return delay_annotation_is_incremental_;};
|
||||
void setDelayAnnotationIsIncremental(bool is_incr);
|
||||
// Edge is disabled to break combinational loops.
|
||||
@@ -398,7 +396,7 @@ protected:
|
||||
EdgeId vertex_in_link_; // Vertex in edges list.
|
||||
EdgeId vertex_out_next_; // Vertex out edges doubly linked list.
|
||||
EdgeId vertex_out_prev_;
|
||||
ArcDelay *arc_delays_;
|
||||
float *arc_delays_;
|
||||
union {
|
||||
uintptr_t bits_;
|
||||
std::vector<bool> *seq_;
|
||||
|
||||
@@ -245,8 +245,8 @@ protected:
|
||||
|
||||
bool annotateDelaySlew(Edge *edge,
|
||||
const TimingArc *arc,
|
||||
ArcDelay &gate_delay,
|
||||
Slew &gate_slew,
|
||||
const ArcDelay &gate_delay,
|
||||
const Slew &gate_slew,
|
||||
const Scene *scene,
|
||||
const MinMax *min_max);
|
||||
bool annotateLoadDelays(Vertex *drvr_vertex,
|
||||
|
||||
@@ -33,44 +33,11 @@
|
||||
|
||||
namespace sta {
|
||||
|
||||
class InternalPowerModel;
|
||||
|
||||
using InternalPowerModels =
|
||||
std::array<std::shared_ptr<InternalPowerModel>, RiseFall::index_count>;
|
||||
|
||||
class InternalPower
|
||||
{
|
||||
public:
|
||||
InternalPower(LibertyPort *port,
|
||||
LibertyPort *related_port,
|
||||
LibertyPort *related_pg_pin,
|
||||
const std::shared_ptr<FuncExpr> &when,
|
||||
InternalPowerModels &models);
|
||||
//InternalPower(InternalPower &&other) noexcept;
|
||||
LibertyCell *libertyCell() const;
|
||||
LibertyPort *port() const { return port_; }
|
||||
LibertyPort *relatedPort() const { return related_port_; }
|
||||
FuncExpr *when() const { return when_.get(); }
|
||||
LibertyPort *relatedPgPin() const { return related_pg_pin_; }
|
||||
float power(const RiseFall *rf,
|
||||
const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap) const;
|
||||
const InternalPowerModel *model(const RiseFall *rf) const;
|
||||
|
||||
protected:
|
||||
LibertyPort *port_;
|
||||
LibertyPort *related_port_;
|
||||
LibertyPort *related_pg_pin_;
|
||||
std::shared_ptr<FuncExpr> when_;
|
||||
InternalPowerModels models_;
|
||||
};
|
||||
|
||||
class InternalPowerModel
|
||||
{
|
||||
public:
|
||||
InternalPowerModel(TableModel *model);
|
||||
~InternalPowerModel();
|
||||
InternalPowerModel();
|
||||
InternalPowerModel(std::shared_ptr<TableModel> model);
|
||||
float power(const LibertyCell *cell,
|
||||
const Pvt *pvt,
|
||||
float in_slew,
|
||||
@@ -80,7 +47,7 @@ public:
|
||||
float in_slew,
|
||||
float load_cap,
|
||||
int digits) const;
|
||||
const TableModel *model() const { return model_; }
|
||||
const TableModel *model() const { return model_.get(); }
|
||||
|
||||
protected:
|
||||
void findAxisValues(float in_slew,
|
||||
@@ -95,7 +62,36 @@ protected:
|
||||
bool checkAxes(const TableModel *model);
|
||||
bool checkAxis(const TableAxis *axis);
|
||||
|
||||
TableModel *model_;
|
||||
std::shared_ptr<TableModel> model_;
|
||||
};
|
||||
|
||||
using InternalPowerModels = std::array<InternalPowerModel, RiseFall::index_count>;
|
||||
|
||||
class InternalPower
|
||||
{
|
||||
public:
|
||||
InternalPower(LibertyPort *port,
|
||||
LibertyPort *related_port,
|
||||
LibertyPort *related_pg_pin,
|
||||
const std::shared_ptr<FuncExpr> &when,
|
||||
const InternalPowerModels &models);
|
||||
LibertyCell *libertyCell() const;
|
||||
LibertyPort *port() const { return port_; }
|
||||
LibertyPort *relatedPort() const { return related_port_; }
|
||||
FuncExpr *when() const { return when_.get(); }
|
||||
LibertyPort *relatedPgPin() const { return related_pg_pin_; }
|
||||
float power(const RiseFall *rf,
|
||||
const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap) const;
|
||||
const InternalPowerModel &model(const RiseFall *rf) const;
|
||||
|
||||
protected:
|
||||
LibertyPort *port_;
|
||||
LibertyPort *related_port_;
|
||||
LibertyPort *related_pg_pin_;
|
||||
std::shared_ptr<FuncExpr> when_;
|
||||
InternalPowerModels models_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -589,7 +589,7 @@ public:
|
||||
LibertyPort *related_port,
|
||||
LibertyPort *related_pg_pin,
|
||||
const std::shared_ptr<FuncExpr> &when,
|
||||
InternalPowerModels &models);
|
||||
const InternalPowerModels &models);
|
||||
void makeLeakagePower(LibertyPort *related_pg_port,
|
||||
FuncExpr *when,
|
||||
float power);
|
||||
|
||||
@@ -37,14 +37,22 @@ public:
|
||||
void gateDelay(const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap,
|
||||
bool pocv_enabled,
|
||||
// Return values.
|
||||
ArcDelay &gate_delay,
|
||||
Slew &drvr_slew) const override;
|
||||
float &gate_delay,
|
||||
float &drvr_slew) const override;
|
||||
void gateDelayPocv(const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap,
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode,
|
||||
// Return values.
|
||||
ArcDelay &gate_delay,
|
||||
Slew &drvr_slew) const override;
|
||||
std::string reportGateDelay(const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap,
|
||||
bool pocv_enabled,
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode,
|
||||
int digits) const override;
|
||||
float driveResistance(const Pvt *pvt) const override;
|
||||
|
||||
@@ -64,13 +72,15 @@ public:
|
||||
float from_slew,
|
||||
float to_slew,
|
||||
float related_out_cap,
|
||||
bool pocv_enabled) const override;
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode) const override;
|
||||
std::string reportCheckDelay(const Pvt *pvt,
|
||||
float from_slew,
|
||||
const char *from_slew_annotation,
|
||||
float to_slew,
|
||||
float related_out_cap,
|
||||
bool pocv_enabled,
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode,
|
||||
int digits) const override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -45,14 +45,14 @@ public:
|
||||
const StaState *sta);
|
||||
Path(Vertex *vertex,
|
||||
Tag *tag,
|
||||
Arrival arrival,
|
||||
const Arrival &arrival,
|
||||
Path *prev_path,
|
||||
Edge *prev_edge,
|
||||
TimingArc *prev_arc,
|
||||
const StaState *sta);
|
||||
Path(Vertex *vertex,
|
||||
Tag *tag,
|
||||
Arrival arrival,
|
||||
const Arrival &arrival,
|
||||
Path *prev_path,
|
||||
Edge *prev_edge,
|
||||
TimingArc *prev_arc,
|
||||
@@ -62,11 +62,11 @@ public:
|
||||
bool isNull() const;
|
||||
// prev_path null
|
||||
void init(Vertex *vertex,
|
||||
Arrival arrival,
|
||||
const Arrival &arrival,
|
||||
const StaState *sta);
|
||||
void init(Vertex *vertex,
|
||||
Tag *tag,
|
||||
Arrival arrival,
|
||||
const Arrival &arrival,
|
||||
Path *prev_path,
|
||||
Edge *prev_edge,
|
||||
TimingArc *prev_arc,
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
const StaState *sta);
|
||||
void init(Vertex *vertex,
|
||||
Tag *tag,
|
||||
Arrival arrival,
|
||||
const Arrival &arrival,
|
||||
const StaState *sta);
|
||||
|
||||
Vertex *vertex(const StaState *sta) const;
|
||||
@@ -98,14 +98,12 @@ public:
|
||||
const MinMax *minMax(const StaState *sta) const;
|
||||
PathAPIndex pathAnalysisPtIndex(const StaState *sta) const;
|
||||
DcalcAPIndex dcalcAnalysisPtIndex(const StaState *sta) const;
|
||||
Arrival &arrival() { return arrival_; }
|
||||
const Arrival &arrival() const { return arrival_; }
|
||||
void setArrival(Arrival arrival);
|
||||
Required &required() { return required_; }
|
||||
const Required &required() const {return required_; }
|
||||
void setRequired(const Required &required);
|
||||
Slack slack(const StaState *sta) const;
|
||||
Slew slew(const StaState *sta) const;
|
||||
const Slew &slew(const StaState *sta) const;
|
||||
// This takes the same time as prevPath and prevArc combined.
|
||||
Path *prevPath() const;
|
||||
void setPrevPath(Path *prev_path);
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
virtual const char *typeName() const = 0;
|
||||
virtual int exceptPathCmp(const PathEnd *path_end,
|
||||
const StaState *sta) const;
|
||||
virtual Arrival dataArrivalTime(const StaState *sta) const;
|
||||
virtual const Arrival &dataArrivalTime(const StaState *sta) const;
|
||||
// Arrival time with source clock offset.
|
||||
Arrival dataArrivalTimeOffset(const StaState *sta) const;
|
||||
virtual Required requiredTime(const StaState *sta) const = 0;
|
||||
|
||||
36
include/sta/PocvMode.hh
Normal file
36
include/sta/PocvMode.hh
Normal file
@@ -0,0 +1,36 @@
|
||||
// OpenSTA, Static Timing Analyzer
|
||||
// Copyright (c) 2025, Parallax Software, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
// The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software.
|
||||
//
|
||||
// Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
//
|
||||
// This notice may not be removed or altered from any source distribution.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace sta {
|
||||
|
||||
enum class PocvMode { scalar, normal, skew_normal };
|
||||
|
||||
const char *
|
||||
pocvModeName(PocvMode mode);
|
||||
PocvMode
|
||||
findPocvMode(const char *mode_name);
|
||||
|
||||
} // namespace
|
||||
@@ -982,11 +982,11 @@ public:
|
||||
bool report_cap,
|
||||
bool report_slew,
|
||||
bool report_fanout,
|
||||
bool report_variation,
|
||||
bool report_src_attr);
|
||||
ReportField *findReportPathField(const char *name);
|
||||
void setReportPathDigits(int digits);
|
||||
void setReportPathNoSplit(bool no_split);
|
||||
void setReportPathSigmas(bool report_sigmas);
|
||||
void reportPathEnd(PathEnd *end);
|
||||
void reportPathEnds(PathEndSeq *ends);
|
||||
ReportPath *reportPath() { return report_path_; }
|
||||
@@ -998,7 +998,7 @@ public:
|
||||
const SetupHold *setup_hold,
|
||||
bool include_internal_latency,
|
||||
int digits);
|
||||
float findWorstClkSkew(const SetupHold *setup_hold,
|
||||
Delay findWorstClkSkew(const SetupHold *setup_hold,
|
||||
bool include_internal_latency);
|
||||
|
||||
void reportClkLatency(ConstClockSeq &clks,
|
||||
@@ -1126,12 +1126,15 @@ public:
|
||||
|
||||
void reportArrivalWrtClks(const Pin *pin,
|
||||
const Scene *scene,
|
||||
bool report_variance,
|
||||
int digits);
|
||||
void reportRequiredWrtClks(const Pin *pin,
|
||||
const Scene *scene,
|
||||
bool report_variance,
|
||||
int digits);
|
||||
void reportSlackWrtClks(const Pin *pin,
|
||||
const Scene *scene,
|
||||
bool report_variance,
|
||||
int digits);
|
||||
|
||||
Slew slew(Vertex *vertex,
|
||||
@@ -1139,9 +1142,9 @@ public:
|
||||
const SceneSeq &scenes,
|
||||
const MinMax *min_max);
|
||||
|
||||
ArcDelay arcDelay(Edge *edge,
|
||||
TimingArc *arc,
|
||||
DcalcAPIndex ap_index);
|
||||
const ArcDelay &arcDelay(Edge *edge,
|
||||
TimingArc *arc,
|
||||
DcalcAPIndex ap_index);
|
||||
// True if the timing arc has been back-annotated.
|
||||
bool arcDelayAnnotated(Edge *edge,
|
||||
TimingArc *arc,
|
||||
@@ -1403,12 +1406,13 @@ public:
|
||||
// TCL variable sta_crpr_mode.
|
||||
CrprMode crprMode() const;
|
||||
void setCrprMode(CrprMode mode);
|
||||
// TCL variable sta_pocv_enabled.
|
||||
// TCL variable sta_pocv_mode.
|
||||
// Parametric on chip variation (statisical sta).
|
||||
bool pocvEnabled() const;
|
||||
void setPocvEnabled(bool enabled);
|
||||
PocvMode pocvMode() const;
|
||||
void setPocvMode(PocvMode mode);
|
||||
// Number of std deviations from mean to use for normal distributions.
|
||||
void setSigmaFactor(float factor);
|
||||
float pocvQuantile();
|
||||
void setPocvQuantile(float quantile);
|
||||
// TCL variable sta_propagate_gated_clock_enable.
|
||||
// Propagate gated clock enable arrivals.
|
||||
bool propagateGatedClockEnable() const;
|
||||
@@ -1505,17 +1509,20 @@ protected:
|
||||
|
||||
void reportDelaysWrtClks(const Pin *pin,
|
||||
const Scene *scene,
|
||||
bool report_variance,
|
||||
int digits,
|
||||
bool find_required,
|
||||
PathDelayFunc get_path_delay);
|
||||
void reportDelaysWrtClks(Vertex *vertex,
|
||||
const Scene *scene,
|
||||
bool report_variance,
|
||||
int digits,
|
||||
bool find_required,
|
||||
PathDelayFunc get_path_delay);
|
||||
void reportDelaysWrtClks(Vertex *vertex,
|
||||
const ClockEdge *clk_edge,
|
||||
const Scene *scene,
|
||||
bool report_variance,
|
||||
int digits,
|
||||
PathDelayFunc get_path_delay);
|
||||
RiseFallMinMaxDelay findDelaysWrtClks(Vertex *vertex,
|
||||
@@ -1525,6 +1532,7 @@ protected:
|
||||
std::string formatDelay(const RiseFall *rf,
|
||||
const MinMax *min_max,
|
||||
const RiseFallMinMaxDelay &delays,
|
||||
bool report_variance,
|
||||
int digits);
|
||||
|
||||
void connectDrvrPinAfter(Vertex *vertex);
|
||||
|
||||
@@ -47,6 +47,7 @@ class GraphDelayCalc;
|
||||
class Latches;
|
||||
class DispatchQueue;
|
||||
class Variables;
|
||||
class DelayOps;
|
||||
|
||||
using ModeSeq = std::vector<Mode*>;
|
||||
using ModeSet = std::set<Mode*>;
|
||||
@@ -96,10 +97,10 @@ public:
|
||||
GraphDelayCalc *graphDelayCalc() const { return graph_delay_calc_; }
|
||||
Search *search() { return search_; }
|
||||
Search *search() const { return search_; }
|
||||
const DelayOps *delayOps() const { return delay_ops_; }
|
||||
Latches *latches() { return latches_; }
|
||||
Latches *latches() const { return latches_; }
|
||||
unsigned threadCount() const { return thread_count_; }
|
||||
float sigmaFactor() const { return sigma_factor_; }
|
||||
bool crprActive(const Mode *mode) const;
|
||||
Variables *variables() { return variables_; }
|
||||
const Variables *variables() const { return variables_; }
|
||||
@@ -133,11 +134,11 @@ protected:
|
||||
ArcDelayCalc *arc_delay_calc_;
|
||||
GraphDelayCalc *graph_delay_calc_;
|
||||
Search *search_;
|
||||
DelayOps *delay_ops_;
|
||||
Latches *latches_;
|
||||
Variables *variables_;
|
||||
int thread_count_;
|
||||
DispatchQueue *dispatch_queue_;
|
||||
float sigma_factor_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -33,12 +33,14 @@
|
||||
#include "Transition.hh"
|
||||
#include "LibertyClass.hh"
|
||||
#include "TimingModel.hh"
|
||||
#include "Variables.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
class Unit;
|
||||
class Units;
|
||||
class Report;
|
||||
class TableModels;
|
||||
class Table;
|
||||
class TableModel;
|
||||
class TableAxis;
|
||||
@@ -63,43 +65,41 @@ class GateTableModel : public GateTimingModel
|
||||
{
|
||||
public:
|
||||
GateTableModel(LibertyCell *cell,
|
||||
TableModel *delay_model,
|
||||
TableModelsEarlyLate delay_sigma_models,
|
||||
TableModel *slew_model,
|
||||
TableModelsEarlyLate slew_sigma_models,
|
||||
TableModels *delay_models,
|
||||
TableModels *slew_models,
|
||||
ReceiverModelPtr receiver_model,
|
||||
OutputWaveforms *output_waveforms);
|
||||
GateTableModel(LibertyCell *cell,
|
||||
TableModel *delay_model,
|
||||
TableModel *slew_model);
|
||||
TableModels *delay_models,
|
||||
TableModels *slew_models);
|
||||
~GateTableModel() override;
|
||||
void gateDelay(const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap,
|
||||
bool pocv_enabled,
|
||||
// Return values.
|
||||
ArcDelay &gate_delay,
|
||||
Slew &drvr_slew) const override;
|
||||
// deprecated 2024-01-07
|
||||
// related_out_cap arg removed.
|
||||
void gateDelay(const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap,
|
||||
float related_out_cap,
|
||||
bool pocv_enabled,
|
||||
ArcDelay &gate_delay,
|
||||
Slew &drvr_slew) const __attribute__ ((deprecated));
|
||||
float &gate_delay,
|
||||
float &drvr_slew) const override;
|
||||
// Fill in pocv parameters in gate_delay, drvr_slew.
|
||||
void gateDelayPocv(const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap,
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode,
|
||||
// Return values.
|
||||
ArcDelay &gate_delay,
|
||||
Slew &drvr_slew) const override;
|
||||
std::string reportGateDelay(const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap,
|
||||
bool pocv_enabled,
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode,
|
||||
int digits) const override;
|
||||
float driveResistance(const Pvt *pvt) const override;
|
||||
|
||||
const TableModel *delayModel() const { return delay_model_.get(); }
|
||||
const TableModel *slewModel() const { return slew_model_.get(); }
|
||||
const TableModel *delaySigmaModel(const EarlyLate *el) const;
|
||||
const TableModel *slewSigmaModel(const EarlyLate *el) const;
|
||||
const TableModels *delayModels() const { return delay_models_.get(); }
|
||||
const TableModel *delayModel() const;
|
||||
const TableModels *slewModels() const { return slew_models_.get(); }
|
||||
const TableModel *slewModel() const;
|
||||
const ReceiverModel *receiverModel() const { return receiver_model_.get(); }
|
||||
OutputWaveforms *outputWaveforms() const { return output_waveforms_.get(); }
|
||||
// Check the axes before making the model.
|
||||
@@ -138,10 +138,8 @@ protected:
|
||||
float &axis_value3) const;
|
||||
static bool checkAxis(const TableAxis *axis);
|
||||
|
||||
std::unique_ptr<TableModel> delay_model_;
|
||||
TableModelsEarlyLate delay_sigma_models_;
|
||||
std::unique_ptr<TableModel> slew_model_;
|
||||
TableModelsEarlyLate slew_sigma_models_;
|
||||
std::unique_ptr<TableModels> delay_models_;
|
||||
std::unique_ptr<TableModels> slew_models_;
|
||||
ReceiverModelPtr receiver_model_;
|
||||
std::unique_ptr<OutputWaveforms> output_waveforms_;
|
||||
};
|
||||
@@ -150,25 +148,24 @@ class CheckTableModel : public CheckTimingModel
|
||||
{
|
||||
public:
|
||||
CheckTableModel(LibertyCell *cell,
|
||||
TableModel *model,
|
||||
TableModelsEarlyLate sigma_models);
|
||||
CheckTableModel(LibertyCell *cell,
|
||||
TableModel *model);
|
||||
TableModels *check_models);
|
||||
~CheckTableModel() override;
|
||||
ArcDelay checkDelay(const Pvt *pvt,
|
||||
float from_slew,
|
||||
float to_slew,
|
||||
float related_out_cap,
|
||||
bool pocv_enabled) const override;
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode) const override;
|
||||
std::string reportCheckDelay(const Pvt *pvt,
|
||||
float from_slew,
|
||||
const char *from_slew_annotation,
|
||||
float to_slew,
|
||||
float related_out_cap,
|
||||
bool pocv_enabled,
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode,
|
||||
int digits) const override;
|
||||
const TableModel *model() const { return model_.get(); }
|
||||
const TableModel *sigmaModel(const EarlyLate *el) const;
|
||||
const TableModels *checkModels() const { return check_models_.get(); }
|
||||
const TableModel *checkModel() const;
|
||||
|
||||
// Check the axes before making the model.
|
||||
// Return true if the model axes are supported.
|
||||
@@ -202,8 +199,7 @@ protected:
|
||||
int digits) const;
|
||||
static bool checkAxis(const TableAxis *axis);
|
||||
|
||||
std::unique_ptr<TableModel> model_;
|
||||
TableModelsEarlyLate sigma_models_;
|
||||
std::unique_ptr<TableModels> check_models_;
|
||||
};
|
||||
|
||||
class TableAxis
|
||||
@@ -311,6 +307,8 @@ public:
|
||||
|
||||
private:
|
||||
void clear();
|
||||
float findValueOrder2(float axis_value1, float axis_value2) const;
|
||||
float findValueOrder3(float axis_value1, float axis_value2, float axis_value3) const;
|
||||
std::string reportValueOrder0(const char *result_name,
|
||||
const char *comment1,
|
||||
const Unit *table_unit,
|
||||
@@ -408,6 +406,34 @@ protected:
|
||||
bool is_scaled_:1;
|
||||
};
|
||||
|
||||
// cell/transition/check nldm/ocv/lvf models for one rise/fall edge.
|
||||
class TableModels
|
||||
{
|
||||
public:
|
||||
TableModels();
|
||||
TableModels(TableModel *model);
|
||||
~TableModels();
|
||||
TableModel *model() const { return model_.get(); }
|
||||
void setModel(TableModel *model);
|
||||
TableModel *sigma(const EarlyLate *early_late) const;
|
||||
void setSigma(TableModel *table,
|
||||
const EarlyLate *early_late);
|
||||
TableModel *meanShift() const { return mean_shift_.get(); }
|
||||
void setMeanShift(TableModel *table);
|
||||
TableModel *skewness() const { return skewness_.get(); }
|
||||
void setSkewness(TableModel *table);
|
||||
TableModel *stdDev() const { return std_dev_.get(); }
|
||||
void setStdDev(TableModel *table);
|
||||
|
||||
protected:
|
||||
std::unique_ptr<TableModel> model_;
|
||||
// Note early/late can point to the same model.
|
||||
std::array<TableModel*, EarlyLate::index_count> sigma_;
|
||||
std::unique_ptr<TableModel> std_dev_;
|
||||
std::unique_ptr<TableModel> mean_shift_;
|
||||
std::unique_ptr<TableModel> skewness_;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
class ReceiverModel
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "Delay.hh"
|
||||
#include "LibertyClass.hh"
|
||||
#include "Variables.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
@@ -52,14 +53,23 @@ public:
|
||||
virtual void gateDelay(const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap,
|
||||
bool pocv_enabled,
|
||||
// Return values.
|
||||
ArcDelay &gate_delay,
|
||||
Slew &drvr_slew) const = 0;
|
||||
float &gate_delay,
|
||||
float &drvr_slew) const = 0;
|
||||
// Fill in pocv parameters in gate_delay, drvr_slew.
|
||||
virtual void gateDelayPocv(const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap,
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode,
|
||||
// Return values.
|
||||
ArcDelay &gate_delay,
|
||||
Slew &drvr_slew) const = 0;
|
||||
virtual std::string reportGateDelay(const Pvt *pvt,
|
||||
float in_slew,
|
||||
float load_cap,
|
||||
bool pocv_enabled,
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode,
|
||||
int digits) const = 0;
|
||||
virtual float driveResistance(const Pvt *pvt) const = 0;
|
||||
};
|
||||
@@ -74,13 +84,15 @@ public:
|
||||
float from_slew,
|
||||
float to_slew,
|
||||
float related_out_cap,
|
||||
bool pocv_enabled) const = 0;
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode) const = 0;
|
||||
virtual std::string reportCheckDelay(const Pvt *pvt,
|
||||
float from_slew,
|
||||
const char *from_slew_annotation,
|
||||
float to_slew,
|
||||
float related_out_cap,
|
||||
bool pocv_enabled,
|
||||
const MinMax *min_max,
|
||||
PocvMode pocv_mode,
|
||||
int digits) const = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "PocvMode.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
enum class CrprMode { same_pin, same_transition };
|
||||
@@ -72,8 +74,11 @@ public:
|
||||
// TCL variable sta_input_port_default_clock.
|
||||
bool useDefaultArrivalClock() { return use_default_arrival_clock_; }
|
||||
void setUseDefaultArrivalClock(bool enable);
|
||||
bool pocvEnabled() const { return pocv_enabled_; }
|
||||
void setPocvEnabled(bool enabled);
|
||||
bool pocvEnabled() const;
|
||||
PocvMode pocvMode() const { return pocv_mode_; }
|
||||
void setPocvMode(PocvMode mode);
|
||||
float pocvQuantile() const { return pocv_quantile_; }
|
||||
void setPocvQuantile(float quartile);
|
||||
|
||||
private:
|
||||
bool crpr_enabled_;
|
||||
@@ -88,7 +93,8 @@ private:
|
||||
bool dynamic_loop_breaking_;
|
||||
bool propagate_all_clks_;
|
||||
bool use_default_arrival_clock_;
|
||||
bool pocv_enabled_;
|
||||
PocvMode pocv_mode_;
|
||||
float pocv_quantile_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user