mirror of
https://github.com/The-OpenROAD-Project/OpenSTA.git
synced 2026-09-07 11:51:47 +02:00
merge
This commit is contained in:
@@ -294,12 +294,4 @@ void
|
||||
sortClockSet(ClockSet * set,
|
||||
ClockSeq &clks);
|
||||
|
||||
// Clock source pins.
|
||||
class ClockPinIterator : public PinSet::Iterator
|
||||
{
|
||||
public:
|
||||
// Use range iterator on Clock::pins().
|
||||
ClockPinIterator(Clock *clk) __attribute__ ((deprecated));
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "Machine.hh"
|
||||
#include "DisallowCopyAssign.hh"
|
||||
#include "Map.hh"
|
||||
#include "StringUtil.hh"
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "StaConfig.hh"
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "StaConfig.hh"
|
||||
|
||||
#if (SSTA == 1)
|
||||
// Delays are Normal PDFs.
|
||||
#include "DelayNormal1.hh"
|
||||
|
||||
+65
-29
@@ -17,7 +17,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "MinMax.hh"
|
||||
#include "Fuzzy.hh"
|
||||
|
||||
// Delay values defined as floats.
|
||||
|
||||
@@ -32,6 +31,19 @@ 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,
|
||||
@@ -55,47 +67,71 @@ delayAsFloat(const Delay &delay)
|
||||
}
|
||||
|
||||
// mean late+/early- sigma
|
||||
float
|
||||
inline float
|
||||
delayAsFloat(const Delay &delay,
|
||||
const EarlyLate *early_late,
|
||||
const StaState *sta);
|
||||
float
|
||||
delaySigma2(const Delay &delay,
|
||||
const EarlyLate *early_late);
|
||||
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);
|
||||
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
|
||||
fuzzyGreater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
delayZero(const Delay &delay);
|
||||
bool
|
||||
fuzzyGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
delayInf(const Delay &delay);
|
||||
bool
|
||||
fuzzyLess(const Delay &delay1,
|
||||
delayEqual(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
bool
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
const StaState *sta);
|
||||
bool
|
||||
fuzzyLessEqual(const Delay &delay1,
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
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);
|
||||
|
||||
+49
-40
@@ -47,10 +47,6 @@ public:
|
||||
void operator-=(float delay);
|
||||
void operator-=(const Delay &delay);
|
||||
bool operator==(const Delay &delay) const;
|
||||
bool operator>(const Delay &delay) const;
|
||||
bool operator>=(const Delay &delay) const;
|
||||
bool operator<(const Delay &delay) const;
|
||||
bool operator<=(const Delay &delay) const;
|
||||
|
||||
private:
|
||||
float mean_;
|
||||
@@ -63,6 +59,19 @@ 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,
|
||||
@@ -75,7 +84,10 @@ makeDelay2(float delay,
|
||||
float sigma_late);
|
||||
|
||||
inline float
|
||||
delayAsFloat(const Delay &delay) { return delay.mean(); }
|
||||
delayAsFloat(const Delay &delay)
|
||||
{
|
||||
return delay.mean();
|
||||
}
|
||||
|
||||
// mean late+/early- sigma
|
||||
float
|
||||
@@ -85,58 +97,55 @@ delayAsFloat(const Delay &delay,
|
||||
float
|
||||
delaySigma2(const Delay &delay,
|
||||
const EarlyLate *early_late);
|
||||
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);
|
||||
const Delay &
|
||||
delayInitValue(const MinMax *min_max);
|
||||
bool
|
||||
delayIsInitValue(const Delay &delay,
|
||||
const MinMax *min_max);
|
||||
bool
|
||||
fuzzyZero(const Delay &delay);
|
||||
delayZero(const Delay &delay);
|
||||
bool
|
||||
fuzzyInf(const Delay &delay);
|
||||
delayInf(const Delay &delay);
|
||||
bool
|
||||
fuzzyEqual(const Delay &delay1,
|
||||
delayEqual(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
bool
|
||||
fuzzyLess(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
bool
|
||||
fuzzyLess(const Delay &delay1,
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
const StaState *sta);
|
||||
bool
|
||||
fuzzyLessEqual(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
fuzzyLessEqual(const Delay &delay1,
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
const StaState *sta);
|
||||
bool
|
||||
fuzzyGreater(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
fuzzyGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
bool
|
||||
fuzzyGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
bool
|
||||
fuzzyGreater(const Delay &delay1,
|
||||
delayGreater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
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);
|
||||
|
||||
+58
-49
@@ -50,10 +50,6 @@ public:
|
||||
void operator-=(float delay);
|
||||
void operator-=(const Delay &delay);
|
||||
bool operator==(const Delay &delay) const;
|
||||
bool operator>(const Delay &delay) const;
|
||||
bool operator>=(const Delay &delay) const;
|
||||
bool operator<(const Delay &delay) const;
|
||||
bool operator<=(const Delay &delay) const;
|
||||
|
||||
protected:
|
||||
static const int early_index = 0;
|
||||
@@ -70,28 +66,6 @@ const Delay delay_zero(0.0);
|
||||
void
|
||||
initDelayConstants();
|
||||
|
||||
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 char *
|
||||
delayAsString(const Delay &delay,
|
||||
const StaState *sta);
|
||||
@@ -104,46 +78,81 @@ 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
|
||||
fuzzyZero(const Delay &delay);
|
||||
delayZero(const Delay &delay);
|
||||
bool
|
||||
fuzzyInf(const Delay &delay);
|
||||
delayInf(const Delay &delay);
|
||||
bool
|
||||
fuzzyEqual(const Delay &delay1,
|
||||
delayEqual(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
bool
|
||||
fuzzyLess(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
bool
|
||||
fuzzyLess(const Delay &delay1,
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
const StaState *sta);
|
||||
bool
|
||||
fuzzyLessEqual(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
delayLess(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
fuzzyLessEqual(const Delay &delay1,
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
const StaState *sta);
|
||||
bool
|
||||
fuzzyGreater(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
delayLessEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
bool
|
||||
fuzzyGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2);
|
||||
bool
|
||||
fuzzyGreaterEqual(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
bool
|
||||
fuzzyGreater(const Delay &delay1,
|
||||
delayGreater(const Delay &delay1,
|
||||
const Delay &delay2,
|
||||
const MinMax *min_max);
|
||||
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);
|
||||
|
||||
@@ -493,6 +493,7 @@ public:
|
||||
Report *report,
|
||||
Debug *debug);
|
||||
bool isBuffer() const;
|
||||
bool isInverter() const;
|
||||
// Only valid when isBuffer() returns true.
|
||||
void bufferPorts(// Return values.
|
||||
LibertyPort *&input,
|
||||
@@ -522,6 +523,8 @@ protected:
|
||||
void makeTimingArcPortMaps();
|
||||
bool hasBufferFunc(const LibertyPort *input,
|
||||
const LibertyPort *output) const;
|
||||
bool hasInverterFunc(const LibertyPort *input,
|
||||
const LibertyPort *output) const;
|
||||
|
||||
LibertyLibrary *liberty_library_;
|
||||
float area_;
|
||||
@@ -633,6 +636,7 @@ public:
|
||||
float &fanout_load,
|
||||
bool &exists) const;
|
||||
void setFanoutLoad(float fanout_load);
|
||||
float capacitance() const;
|
||||
float capacitance(const RiseFall *rf,
|
||||
const MinMax *min_max) const;
|
||||
void capacitance(const RiseFall *rf,
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
// OpenSTA, Static Timing Analyzer
|
||||
// Copyright (c) 2020, 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/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
// This header contains global os/port specific definitions.
|
||||
|
||||
// Pragma placeholder for non-gcc compilers.
|
||||
#ifndef __GNUC__
|
||||
#define __attribute__(x)
|
||||
#endif // __GNUC__
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Microcruft Visual C++
|
||||
// Obtuse warning codes enabled by pragma.
|
||||
// 4018 = signed, unsigned mismatch
|
||||
// 4032 = unexpected type promotions
|
||||
// 4100 = unused argument
|
||||
// 4132 = uninitialized const
|
||||
// 4189 = unused local variable
|
||||
// 4201 = unnamed struct
|
||||
// 4222 = static class member declared static at file scope
|
||||
// 4234 = use of keyword reserved for future use
|
||||
// 4245 = negative const converted to unsigned
|
||||
// 4355 = use of 'this' in invalid context
|
||||
// 4505 = function not used
|
||||
// 4611 = setjmp used in C++ function
|
||||
// 4701 = variable used but not initialized
|
||||
#pragma warning( 3 : 4018 4032 4132 4189 4201 4222 4234 4505 4611 4701 )
|
||||
// Disable security warnings for posix functions.
|
||||
// _CRT_SECURE_NO_WARNINGS does not seem to work
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif // _MSC_VER
|
||||
|
||||
#if defined(_WINDOWS) || defined(_WIN32)
|
||||
// Export class definitions to DLLs.
|
||||
#define DllExport __declspec(dllexport)
|
||||
#include <stdarg.h>
|
||||
#define va_copy(d,s) ((d)=(s))
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp strncmp
|
||||
#define strtof(nptr,endptr) static_cast<float>(strtod(nptr,endptr))
|
||||
#define strtoull _strtoui64
|
||||
// Flex doesn't check for unistd.h.
|
||||
#define YY_NO_UNISTD_H
|
||||
namespace sta {
|
||||
int vsnprint(char *str, size_t size, const char *fmt, va_list args);
|
||||
}
|
||||
#else
|
||||
#define DllExport
|
||||
#include <stdint.h> // intptr_t
|
||||
#define vsnprint vsnprintf
|
||||
#endif // _WINDOWS
|
||||
|
||||
#include <stddef.h> // size_t
|
||||
|
||||
namespace sta {
|
||||
|
||||
int
|
||||
processorCount();
|
||||
|
||||
// Init elapsed (wall) time.
|
||||
void
|
||||
initElapsedTime();
|
||||
|
||||
// Elapsed/wall time (in seconds).
|
||||
double
|
||||
elapsedRunTime();
|
||||
|
||||
// User run time (in seconds).
|
||||
double
|
||||
userRunTime();
|
||||
|
||||
// System run time (in seconds).
|
||||
double
|
||||
systemRunTime();
|
||||
|
||||
// Memory usage in bytes.
|
||||
size_t
|
||||
memoryUsage();
|
||||
|
||||
} // namespace sta
|
||||
|
||||
@@ -323,6 +323,13 @@ public:
|
||||
virtual VertexId vertexId(const Pin *pin) const = 0;
|
||||
virtual void setVertexId(Pin *pin,
|
||||
VertexId id) = 0;
|
||||
// Return the physical X/Y coordinates of the pin.
|
||||
virtual void location(const Pin *pin,
|
||||
// Return values.
|
||||
double &x,
|
||||
double &y,
|
||||
bool &exists) const;
|
||||
|
||||
int pinCount();
|
||||
int pinCount(Instance *inst);
|
||||
int leafPinCount();
|
||||
|
||||
@@ -142,6 +142,7 @@ public:
|
||||
virtual TimingArc *checkArc() const { return nullptr; }
|
||||
// PathEndDataCheck data clock path.
|
||||
virtual const PathVertex *dataClkPath() const { return nullptr; }
|
||||
virtual int setupDefaultCycles() const { return 1; }
|
||||
|
||||
static bool less(const PathEnd *path_end1,
|
||||
const PathEnd *path_end2,
|
||||
@@ -181,6 +182,7 @@ public:
|
||||
static float checkSetupMcpAdjustment(const ClockEdge *src_clk_edge,
|
||||
const ClockEdge *tgt_clk_edge,
|
||||
const MultiCyclePath *mcp,
|
||||
int default_cycles,
|
||||
Sdc *sdc);
|
||||
|
||||
protected:
|
||||
@@ -425,6 +427,7 @@ private:
|
||||
|
||||
// Path constrained by an output delay.
|
||||
// If there is a reference pin, clk_path_ is the reference pin clock.
|
||||
// If there is a path delay PathEndPathDelay is used instead of this.
|
||||
class PathEndOutputDelay : public PathEndClkConstrainedMcp
|
||||
{
|
||||
public:
|
||||
@@ -544,6 +547,8 @@ protected:
|
||||
Crpr crpr,
|
||||
bool crpr_valid);
|
||||
Arrival requiredTimeNoCrpr(const StaState *sta) const;
|
||||
// setup uses zero cycle default
|
||||
virtual int setupDefaultCycles() const { return 0; }
|
||||
|
||||
private:
|
||||
PathVertex data_clk_path_;
|
||||
@@ -555,6 +560,7 @@ private:
|
||||
|
||||
// Path constrained by set_min/max_delay.
|
||||
// "Clocked" when path delay ends at timing check pin.
|
||||
// May end at output with set_output_delay.
|
||||
class PathEndPathDelay : public PathEndClkConstrained
|
||||
{
|
||||
public:
|
||||
@@ -587,6 +593,7 @@ public:
|
||||
virtual PathDelay *pathDelay() const { return path_delay_; }
|
||||
virtual ArcDelay margin(const StaState *sta) const;
|
||||
virtual float sourceClkOffset(const StaState *sta) const;
|
||||
virtual ClockEdge *targetClkEdge(const StaState *sta) const;
|
||||
virtual float targetClkTime(const StaState *sta) const;
|
||||
virtual Arrival targetClkArrivalNoCrpr(const StaState *sta) const;
|
||||
virtual float targetClkOffset(const StaState *sta) const;
|
||||
@@ -594,6 +601,7 @@ public:
|
||||
virtual Required requiredTime(const StaState *sta) const;
|
||||
virtual int exceptPathCmp(const PathEnd *path_end,
|
||||
const StaState *sta) const;
|
||||
bool hasOutputDelay() const { return output_delay_ != nullptr; }
|
||||
|
||||
protected:
|
||||
PathEndPathDelay(PathDelay *path_delay,
|
||||
@@ -610,8 +618,7 @@ protected:
|
||||
PathDelay *path_delay_;
|
||||
TimingArc *check_arc_;
|
||||
Edge *check_edge_;
|
||||
// Output delay is nullptr when there is no timing check or output
|
||||
// delay at the endpoint.
|
||||
// Output delay is nullptr when there is no output delay at the endpoint.
|
||||
OutputDelay *output_delay_;
|
||||
// Source clk arrival for set_min/max_delay -ignore_clk_latency.
|
||||
Arrival src_clk_arrival_;
|
||||
|
||||
@@ -1,197 +0,0 @@
|
||||
// OpenSTA, Static Timing Analyzer
|
||||
// Copyright (c) 2020, 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/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Sta.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
class PowerResult;
|
||||
class PwrActivity;
|
||||
class PropActivityVisitor;
|
||||
class BfsFwdIterator;
|
||||
|
||||
typedef UnorderedMap<const Pin*,PwrActivity> PwrActivityMap;
|
||||
|
||||
enum class PwrActivityOrigin
|
||||
{
|
||||
global,
|
||||
input,
|
||||
user,
|
||||
propagated,
|
||||
clock,
|
||||
constant,
|
||||
defaulted,
|
||||
unknown
|
||||
};
|
||||
|
||||
class PwrActivity
|
||||
{
|
||||
public:
|
||||
PwrActivity();
|
||||
PwrActivity(float activity,
|
||||
float duty,
|
||||
PwrActivityOrigin origin);
|
||||
float activity() const { return activity_; }
|
||||
float duty() const { return duty_; }
|
||||
PwrActivityOrigin origin() { return origin_; }
|
||||
const char *originName() const;
|
||||
void set(float activity,
|
||||
float duty,
|
||||
PwrActivityOrigin origin);
|
||||
bool isSet() const;
|
||||
|
||||
private:
|
||||
// In general activity is per clock cycle, NOT per second.
|
||||
float activity_;
|
||||
float duty_;
|
||||
PwrActivityOrigin origin_;
|
||||
};
|
||||
|
||||
// The Power class has access to Sta components directly for
|
||||
// convenience but also requires access to the Sta class member functions.
|
||||
class Power : public StaState
|
||||
{
|
||||
public:
|
||||
Power(Sta *sta);
|
||||
void power(const Corner *corner,
|
||||
// Return values.
|
||||
PowerResult &total,
|
||||
PowerResult &sequential,
|
||||
PowerResult &combinational,
|
||||
PowerResult ¯o,
|
||||
PowerResult &pad);
|
||||
void power(const Instance *inst,
|
||||
const Corner *corner,
|
||||
// Return values.
|
||||
PowerResult &result);
|
||||
void setGlobalActivity(float activity,
|
||||
float duty);
|
||||
void setInputActivity(float activity,
|
||||
float duty);
|
||||
void setInputPortActivity(const Port *input_port,
|
||||
float activity,
|
||||
float duty);
|
||||
PwrActivity &pinActivity(const Pin *pin);
|
||||
bool hasPinActivity(const Pin *pin);
|
||||
void setPinActivity(const Pin *pin,
|
||||
PwrActivity &activity);
|
||||
void setPinActivity(const Pin *pin,
|
||||
float activity,
|
||||
float duty,
|
||||
PwrActivityOrigin origin);
|
||||
// Activity is toggles per second.
|
||||
PwrActivity findClkedActivity(const Pin *pin);
|
||||
|
||||
protected:
|
||||
void preamble();
|
||||
void ensureActivities();
|
||||
|
||||
void power(const Instance *inst,
|
||||
LibertyCell *cell,
|
||||
const Corner *corner,
|
||||
// Return values.
|
||||
PowerResult &result);
|
||||
void findInputInternalPower(const Pin *to_pin,
|
||||
const LibertyPort *to_port,
|
||||
const Instance *inst,
|
||||
LibertyCell *cell,
|
||||
PwrActivity &to_activity,
|
||||
float load_cap,
|
||||
const DcalcAnalysisPt *dcalc_ap,
|
||||
// Return values.
|
||||
PowerResult &result);
|
||||
void findOutputInternalPower(const Pin *to_pin,
|
||||
const LibertyPort *to_port,
|
||||
const Instance *inst,
|
||||
LibertyCell *cell,
|
||||
PwrActivity &to_activity,
|
||||
float load_cap,
|
||||
const DcalcAnalysisPt *dcalc_ap,
|
||||
// Return values.
|
||||
PowerResult &result);
|
||||
void findLeakagePower(const Instance *inst,
|
||||
LibertyCell *cell,
|
||||
// Return values.
|
||||
PowerResult &result);
|
||||
void findSwitchingPower(LibertyCell *cell,
|
||||
const LibertyPort *to_port,
|
||||
PwrActivity &activity,
|
||||
float load_cap,
|
||||
const DcalcAnalysisPt *dcalc_ap,
|
||||
// Return values.
|
||||
PowerResult &result);
|
||||
const Clock *findInstClk(const Instance *inst);
|
||||
const Clock *findClk(const Pin *to_pin);
|
||||
PwrActivity findClkedActivity(const Pin *pin,
|
||||
const Clock *inst_clk);
|
||||
PwrActivity findActivity(const Pin *pin);
|
||||
float portVoltage(LibertyCell *cell,
|
||||
const LibertyPort *port,
|
||||
const DcalcAnalysisPt *dcalc_ap);
|
||||
float pgNameVoltage(LibertyCell *cell,
|
||||
const char *pg_port_name,
|
||||
const DcalcAnalysisPt *dcalc_ap);
|
||||
void seedActivities(BfsFwdIterator &bfs);
|
||||
void seedRegOutputActivities(const Instance *reg,
|
||||
Sequential *seq,
|
||||
LibertyPort *output,
|
||||
bool invert);
|
||||
void seedRegOutputActivities(const Instance *inst,
|
||||
BfsFwdIterator &bfs);
|
||||
PwrActivity evalActivity(FuncExpr *expr,
|
||||
const Instance *inst);
|
||||
PwrActivity evalActivity(FuncExpr *expr,
|
||||
const Instance *inst,
|
||||
const LibertyPort *cofactor_port,
|
||||
bool cofactor_positive);
|
||||
LibertyPort *findExprOutPort(FuncExpr *expr);
|
||||
float findInputDuty(const Pin *to_pin,
|
||||
const Instance *inst,
|
||||
FuncExpr *func,
|
||||
InternalPower *pwr);
|
||||
PwrActivity evalActivityDifference(FuncExpr *expr,
|
||||
const Instance *inst,
|
||||
const LibertyPort *cofactor_port);
|
||||
|
||||
private:
|
||||
PwrActivity global_activity_;
|
||||
PwrActivity input_activity_;
|
||||
PwrActivityMap activity_map_;
|
||||
bool activities_valid_;
|
||||
|
||||
friend class PropActivityVisitor;
|
||||
};
|
||||
|
||||
class PowerResult
|
||||
{
|
||||
public:
|
||||
PowerResult();
|
||||
void clear();
|
||||
float &internal() { return internal_; }
|
||||
float &switching() { return switching_; }
|
||||
float &leakage() { return leakage_; }
|
||||
float total() const;
|
||||
void incr(PowerResult &result);
|
||||
|
||||
private:
|
||||
float internal_;
|
||||
float switching_;
|
||||
float leakage_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@@ -0,0 +1,73 @@
|
||||
// OpenSTA, Static Timing Analyzer
|
||||
// Copyright (c) 2020, 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/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace sta {
|
||||
|
||||
enum class PwrActivityOrigin
|
||||
{
|
||||
global,
|
||||
input,
|
||||
user,
|
||||
propagated,
|
||||
clock,
|
||||
constant,
|
||||
defaulted,
|
||||
unknown
|
||||
};
|
||||
|
||||
class PwrActivity
|
||||
{
|
||||
public:
|
||||
PwrActivity();
|
||||
PwrActivity(float activity,
|
||||
float duty,
|
||||
PwrActivityOrigin origin);
|
||||
float activity() const { return activity_; }
|
||||
float duty() const { return duty_; }
|
||||
PwrActivityOrigin origin() { return origin_; }
|
||||
const char *originName() const;
|
||||
void set(float activity,
|
||||
float duty,
|
||||
PwrActivityOrigin origin);
|
||||
bool isSet() const;
|
||||
|
||||
private:
|
||||
// In general activity is per clock cycle, NOT per second.
|
||||
float activity_;
|
||||
float duty_;
|
||||
PwrActivityOrigin origin_;
|
||||
};
|
||||
|
||||
class PowerResult
|
||||
{
|
||||
public:
|
||||
PowerResult();
|
||||
void clear();
|
||||
float &internal() { return internal_; }
|
||||
float &switching() { return switching_; }
|
||||
float &leakage() { return leakage_; }
|
||||
float total() const;
|
||||
void incr(PowerResult &result);
|
||||
|
||||
private:
|
||||
float internal_;
|
||||
float switching_;
|
||||
float leakage_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "NetworkClass.hh"
|
||||
#include "SearchClass.hh"
|
||||
#include "SdcClass.hh"
|
||||
#include "Power.hh"
|
||||
#include "PowerClass.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
#include "Machine.hh"
|
||||
#include "DisallowCopyAssign.hh"
|
||||
|
||||
struct Tcl_Interp;
|
||||
|
||||
@@ -36,6 +36,9 @@ public:
|
||||
float &value,
|
||||
bool &exists) const;
|
||||
bool hasValue() const;
|
||||
void maxValue(// Return values
|
||||
float &max_value,
|
||||
bool &exists) const;
|
||||
bool empty() const;
|
||||
bool hasValue(const RiseFall *rf,
|
||||
const MinMax *min_max) const;
|
||||
|
||||
+14
-30
@@ -824,7 +824,6 @@ public:
|
||||
// Find the clocks defined for pin.
|
||||
ClockSet *findClocks(const Pin *pin) const;
|
||||
ClockSet *findLeafPinClocks(const Pin *pin) const;
|
||||
ClockIterator *clockIterator() __attribute__ ((deprecated));
|
||||
void sortedClocks(ClockSeq &clks);
|
||||
ClockSeq *clocks() { return &clocks_; }
|
||||
ClockSeq &clks() { return clocks_; }
|
||||
@@ -990,11 +989,8 @@ public:
|
||||
void deleteException(ExceptionPath *exception);
|
||||
void recordException(ExceptionPath *exception);
|
||||
void unrecordException(ExceptionPath *exception);
|
||||
// Annotate graph from constraints. If the graph exists when the
|
||||
// constraints are defined it is annotated incrementally. This is
|
||||
// called after building the graph to annotate any constraints that
|
||||
// were defined before the graph is built.
|
||||
void annotateGraph(bool annotate);
|
||||
void annotateGraph();
|
||||
void removeGraphAnnotations();
|
||||
|
||||
// Network edit before/after methods.
|
||||
void disconnectPinBefore(Pin *pin);
|
||||
@@ -1180,34 +1176,25 @@ protected:
|
||||
// Liberty library to look for defaults.
|
||||
LibertyLibrary *defaultLibertyLibrary();
|
||||
void annotateGraphConstrainOutputs();
|
||||
void annotateDisables(bool annotate);
|
||||
void annotateGraphDisabled(const Pin *pin,
|
||||
bool annotate);
|
||||
void setEdgeDisabledInstPorts(DisabledInstancePorts *disabled_inst,
|
||||
bool annotate);
|
||||
void annotateDisables();
|
||||
void annotateGraphDisabled(const Pin *pin);
|
||||
void setEdgeDisabledInstPorts(DisabledInstancePorts *disabled_inst);
|
||||
void setEdgeDisabledInstFrom(Pin *from_pin,
|
||||
bool disable_checks,
|
||||
bool annotate);
|
||||
bool disable_checks);
|
||||
void setEdgeDisabledInstPorts(DisabledPorts *disabled_port,
|
||||
Instance *inst,
|
||||
bool annotate);
|
||||
Instance *inst);
|
||||
void deleteClockLatenciesReferencing(Clock *clk);
|
||||
void deleteClockLatency(ClockLatency *latency);
|
||||
void deleteDeratingFactors();
|
||||
void annotateGraphOutputDelays(bool annotate);
|
||||
void annotateGraphDataChecks(bool annotate);
|
||||
void annotateGraphConstrained(const PinSet *pins,
|
||||
bool annotate);
|
||||
void annotateGraphConstrained(const InstanceSet *insts,
|
||||
bool annotate);
|
||||
void annotateGraphConstrained(const Instance *inst,
|
||||
bool annotate);
|
||||
void annotateGraphConstrained(const Pin *pin,
|
||||
bool annotate);
|
||||
void annotateHierClkLatency(bool annotate);
|
||||
void annotateGraphOutputDelays();
|
||||
void annotateGraphDataChecks();
|
||||
void annotateGraphConstrained(const PinSet *pins);
|
||||
void annotateGraphConstrained(const InstanceSet *insts);
|
||||
void annotateGraphConstrained(const Instance *inst);
|
||||
void annotateGraphConstrained(const Pin *pin);
|
||||
void annotateHierClkLatency();
|
||||
void annotateHierClkLatency(const Pin *hpin,
|
||||
ClockLatency *latency);
|
||||
void deannotateHierClkLatency(const Pin *hpin);
|
||||
void initInstancePvtMaps();
|
||||
void pinCaps(const Pin *pin,
|
||||
const RiseFall *rf,
|
||||
@@ -1257,9 +1244,6 @@ protected:
|
||||
void disconnectPinBefore(Pin *pin,
|
||||
ExceptionPathSet *exceptions);
|
||||
void clockGroupsDeleteClkRefs(Clock *clk);
|
||||
void makeVertexClkHpinDisables(Clock *clk,
|
||||
Vertex *vertex,
|
||||
FindClkHpinDisables &visitor);
|
||||
void clearGroupPathMap();
|
||||
|
||||
AnalysisType analysis_type_;
|
||||
|
||||
@@ -103,6 +103,11 @@ public:
|
||||
virtual VertexId vertexId(const Pin *pin) const;
|
||||
virtual void setVertexId(Pin *pin,
|
||||
VertexId id);
|
||||
virtual void location(const Pin *pin,
|
||||
// Return values.
|
||||
double &x,
|
||||
double &y,
|
||||
bool &exists) const;
|
||||
|
||||
virtual Net *net(const Term *term) const;
|
||||
virtual Pin *pin(const Term *term) const;
|
||||
@@ -120,7 +125,6 @@ public:
|
||||
virtual char pathEscape() const;
|
||||
virtual void setPathEscape(char escape);
|
||||
|
||||
|
||||
virtual bool isEditable() const;
|
||||
virtual LibertyLibrary *makeLibertyLibrary(const char *name,
|
||||
const char *filename);
|
||||
|
||||
@@ -752,7 +752,8 @@ public:
|
||||
const StaState *sta);
|
||||
void requiredSet(int arrival_index,
|
||||
Required required,
|
||||
const MinMax *min_max);
|
||||
const MinMax *min_max,
|
||||
const StaState *sta);
|
||||
// Return true if the requireds changed.
|
||||
bool requiredsSave(Vertex *vertex,
|
||||
const StaState *sta);
|
||||
|
||||
@@ -119,7 +119,8 @@ enum class ReportPathFormat { full,
|
||||
shorter,
|
||||
endpoint,
|
||||
summary,
|
||||
slack_only
|
||||
slack_only,
|
||||
json
|
||||
};
|
||||
|
||||
static const int tag_index_bits = 24;
|
||||
|
||||
+5
-46
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "Machine.hh"
|
||||
#include "DisallowCopyAssign.hh"
|
||||
#include "StringSeq.hh"
|
||||
#include "LibertyClass.hh"
|
||||
@@ -28,6 +29,7 @@
|
||||
#include "StaState.hh"
|
||||
#include "VertexVisitor.hh"
|
||||
#include "SearchClass.hh"
|
||||
#include "PowerClass.hh"
|
||||
|
||||
struct Tcl_Interp;
|
||||
|
||||
@@ -292,17 +294,8 @@ public:
|
||||
void removeClock(Clock *clk);
|
||||
// Update period/waveform for generated clocks from source pin clock.
|
||||
void updateGeneratedClks();
|
||||
// Use Sdc::findClock
|
||||
Clock *findClock(const char *name) const __attribute__ ((deprecated));
|
||||
// Use findClocksMatching.
|
||||
void findClocksMatching(PatternMatch *pattern,
|
||||
ClockSeq *clks) const __attribute__ ((deprecated));
|
||||
// Use Sdc::clockIterator.
|
||||
ClockIterator *clockIterator() const __attribute__ ((deprecated));
|
||||
// True if pin is defined as a clock source (pin may be hierarchical).
|
||||
bool isClockSrc(const Pin *pin) const;
|
||||
// Use Sdc::defaultArrivalClock.
|
||||
Clock *defaultArrivalClock() const __attribute__ ((deprecated));
|
||||
// Propagated (non-ideal) clocks.
|
||||
void setPropagatedClock(Clock *clk);
|
||||
void removePropagatedClock(Clock *clk);
|
||||
@@ -873,42 +866,6 @@ public:
|
||||
bool removal,
|
||||
bool clk_gating_setup,
|
||||
bool clk_gating_hold);
|
||||
PathEndSeq *reportTiming(ExceptionFrom *from,
|
||||
ExceptionThruSeq *thrus,
|
||||
ExceptionTo *to,
|
||||
// Use corner nullptr to report timing
|
||||
// for all corners.
|
||||
const Corner *corner,
|
||||
// max for setup checks.
|
||||
// min for hold checks.
|
||||
// min_max for setup and hold checks.
|
||||
const MinMaxAll *min_max,
|
||||
// Number of path ends to report in
|
||||
// each group.
|
||||
int group_count,
|
||||
// Number of paths to report for
|
||||
// each endpoint.
|
||||
int endpoint_count,
|
||||
// endpoint_count paths report unique pins
|
||||
// without rise/fall variations.
|
||||
bool unique_pins,
|
||||
// Min/max bounds for slack of
|
||||
// returned path ends.
|
||||
float slack_min,
|
||||
float slack_max,
|
||||
// Sort path ends by slack ignoring path groups.
|
||||
bool sort_by_slack,
|
||||
// Path groups to report.
|
||||
// Null or empty list reports all groups.
|
||||
PathGroupNameSet *group_names,
|
||||
// Predicates to filter the type of path
|
||||
// ends returned.
|
||||
bool setup,
|
||||
bool hold,
|
||||
bool recovery,
|
||||
bool removal,
|
||||
bool clk_gating_setup,
|
||||
bool clk_gating_hold) __attribute__ ((deprecated));
|
||||
void setReportPathFormat(ReportPathFormat format);
|
||||
void setReportPathFieldOrder(StringSeq *field_names);
|
||||
void setReportPathFields(bool report_input_pin,
|
||||
@@ -947,7 +904,6 @@ public:
|
||||
void delaysInvalid();
|
||||
// Invalidate all arrival and required times.
|
||||
void arrivalsInvalid();
|
||||
void setPathMinMax(const MinMaxAll *min_max) __attribute__ ((deprecated));
|
||||
void visitStartpoints(VertexVisitor *visitor);
|
||||
void visitEndpoints(VertexVisitor *visitor);
|
||||
// Find the fanin vertices for a group path.
|
||||
@@ -1379,6 +1335,8 @@ protected:
|
||||
void findClkPins();
|
||||
void findClkPins(bool ideal_only,
|
||||
PinSet &clk_pins);
|
||||
void sdcChangedGraph();
|
||||
void ensureGraphSdcAnnotated();
|
||||
|
||||
CmdNamespace cmd_namespace_;
|
||||
Instance *current_instance_;
|
||||
@@ -1397,6 +1355,7 @@ protected:
|
||||
bool link_make_black_boxes_;
|
||||
bool update_genclks_;
|
||||
EquivCells *equiv_cells_;
|
||||
bool graph_sdc_annotated_;
|
||||
// findClkPins
|
||||
PinSet clk_pins_;
|
||||
PinSet ideal_clk_pins_;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include "Machine.hh"
|
||||
#include "Vector.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Machine.hh"
|
||||
#include "DisallowCopyAssign.hh"
|
||||
#include "Vector.hh"
|
||||
#include "Transition.hh"
|
||||
|
||||
@@ -16,13 +16,19 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace sta {
|
||||
|
||||
using std::vector;
|
||||
|
||||
class Network;
|
||||
class LibertyCell;
|
||||
|
||||
void
|
||||
writeVerilog(const char *filename,
|
||||
bool sort,
|
||||
vector<LibertyCell*> *remove_cells,
|
||||
Network *network);
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user