OpenSTA/include/sta/dcalc/GraphDelayCalc.hh

142 lines
4.7 KiB
C++
Raw Normal View History

2018-09-28 17:54:21 +02:00
// OpenSTA, Static Timing Analyzer
2020-03-07 03:50:37 +01:00
// Copyright (c) 2020, Parallax Software, Inc.
2018-09-28 17:54:21 +02:00
//
// 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/>.
2020-02-16 01:13:16 +01:00
#pragma once
2018-09-28 17:54:21 +02:00
#include <string>
2020-04-05 20:35:51 +02:00
#include "util/DisallowCopyAssign.hh"
#include "graph/GraphClass.hh"
#include "dcalc/DcalcAnalysisPt.hh"
#include "search/StaState.hh"
2018-09-28 17:54:21 +02:00
namespace sta {
using std::string;
class BfsFwdIterator;
class SearchPred;
class DelayCalcObserver;
class Parasitic;
class Corner;
// Base class for graph delay calculator.
// This class annotates the arc delays and slews on the graph by calling
// the timing arc delay calculation primitive through an implementation
// of the ArcDelayCalc abstract class.
// This class does not traverse the graph or call an arc delay
// calculator. Use it with applications that use an external delay
// calculator and annotate all edge delays.
class GraphDelayCalc : public StaState
{
public:
explicit GraphDelayCalc(StaState *sta);
virtual ~GraphDelayCalc() {}
virtual void copyState(const StaState *sta);
// Find arc delays and vertex slews thru level.
virtual void findDelays(Level /* level */) {};
// Invalidate all delays/slews.
virtual void delaysInvalid() {};
// Invalidate vertex and downstream delays/slews.
virtual void delayInvalid(Vertex * /* vertex */) {}
;
virtual void delayInvalid(const Pin * /* pin */) {};
virtual void deleteVertexBefore(Vertex * /* vertex */) {};
// Reset to virgin state.
virtual void clear() {}
// Returned string is owned by the caller.
virtual string *reportDelayCalc(Edge *edge,
TimingArc *arc,
const Corner *corner,
const MinMax *min_max,
int digits);
// Percentage (0.0:1.0) change in delay that causes downstream
// delays to be recomputed during incremental delay calculation.
virtual float incrementalDelayTolerance();
virtual void setIncrementalDelayTolerance(float /* tol */) {}
// Set the observer for edge delay changes.
virtual void setObserver(DelayCalcObserver *observer);
// pin_cap = net pin capacitances + port external pin capacitance,
// wire_cap = annotated net capacitance + port external wire capacitance.
virtual void loadCap(const Pin *drvr_pin,
Parasitic *drvr_parasitic,
2019-11-11 23:30:19 +01:00
const RiseFall *rf,
2018-09-28 17:54:21 +02:00
const DcalcAnalysisPt *dcalc_ap,
// Return values.
float &pin_cap,
float &wire_cap) const;
2019-05-28 07:46:24 +02:00
// Load pin_cap + wire_cap including parasitic.
2018-11-26 18:15:52 +01:00
virtual float loadCap(const Pin *drvr_pin,
2019-11-11 23:30:19 +01:00
const RiseFall *to_rf,
2018-11-26 18:15:52 +01:00
const DcalcAnalysisPt *dcalc_ap) const;
2019-05-28 07:46:24 +02:00
// Load pin_cap + wire_cap including parasitic min/max for rise/fall.
virtual float loadCap(const Pin *drvr_pin,
const DcalcAnalysisPt *dcalc_ap) const;
2018-11-26 18:15:52 +01:00
// Load pin_cap + wire_cap.
2018-09-28 17:54:21 +02:00
virtual float loadCap(const Pin *drvr_pin,
Parasitic *drvr_parasitic,
2019-11-11 23:30:19 +01:00
const RiseFall *rf,
2018-09-28 17:54:21 +02:00
const DcalcAnalysisPt *dcalc_ap) const;
virtual void netCaps(const Pin *drvr_pin,
2019-11-11 23:30:19 +01:00
const RiseFall *rf,
2018-09-28 17:54:21 +02:00
const DcalcAnalysisPt *dcalc_ap,
// Return values.
float &pin_cap,
float &wire_cap,
float &fanout,
bool &has_set_load) const;
2018-11-26 18:15:52 +01:00
virtual float ceff(Edge *edge,
TimingArc *arc,
2018-12-14 08:53:17 +01:00
const DcalcAnalysisPt *dcalc_ap);
2020-03-30 18:05:56 +02:00
virtual bool isIdealClk(const Vertex *vertex);
2018-09-28 17:54:21 +02:00
// Precedence:
// SDF annotation
// Liberty library
// (ignores set_min_pulse_width constraint)
void minPulseWidth(const Pin *pin,
2019-11-11 23:30:19 +01:00
const RiseFall *hi_low,
2018-09-28 17:54:21 +02:00
DcalcAPIndex ap_index,
const MinMax *min_max,
// Return values.
float &min_width,
bool &exists);
// Precedence:
// SDF annotation
// Liberty library
void minPeriod(const Pin *pin,
// Return values.
float &min_period,
bool &exists);
private:
DISALLOW_COPY_AND_ASSIGN(GraphDelayCalc);
};
// Abstract base class for edge delay change observer.
class DelayCalcObserver
{
public:
DelayCalcObserver() {}
virtual ~DelayCalcObserver() {}
virtual void delayChangedFrom(Vertex *vertex) = 0;
virtual void delayChangedTo(Vertex *vertex) = 0;
virtual void checkDelayChangedTo(Vertex *vertex) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(DelayCalcObserver);
};
} // namespace