OpenSTA/include/sta/VisitPathEnds.hh

153 lines
4.5 KiB
C++
Raw Permalink Normal View History

2018-09-28 17:54:21 +02:00
// OpenSTA, Static Timing Analyzer
// Copyright (c) 2024, 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
2018-09-28 17:54:21 +02:00
// 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/>.
2018-09-28 17:54:21 +02:00
2020-02-16 01:13:16 +01:00
#pragma once
2018-09-28 17:54:21 +02:00
2020-04-05 23:53:44 +02:00
#include "SdcClass.hh"
#include "GraphClass.hh"
#include "SearchClass.hh"
#include "StaState.hh"
2018-09-28 17:54:21 +02:00
namespace sta {
class StaState;
class PathEndVisitor;
class VisitPathEnds : public StaState
{
public:
VisitPathEnds(const StaState *sta);
// All corners, unfiltered.
void visitPathEnds(Vertex *vertex,
PathEndVisitor *visitor);
2019-03-13 01:25:53 +01:00
// Use corner nullptr to visit PathEnds for all corners.
2018-09-28 17:54:21 +02:00
void visitPathEnds(Vertex *vertex,
const Corner *corner,
const MinMaxAll *min_max,
bool filtered,
PathEndVisitor *visitor);
bool checkEdgeEnabled(Edge *edge) const;
protected:
void visitClkedPathEnds(const Pin *pin,
Vertex *vertex,
const Corner *corner,
const MinMaxAll *min_max,
bool filtered,
PathEndVisitor *visitor,
bool &is_constrained);
virtual void visitCheckEnd(const Pin *pin,
Vertex *vertex,
Path *path,
2019-11-11 23:30:19 +01:00
const RiseFall *end_rf,
2018-09-28 17:54:21 +02:00
const PathAnalysisPt *path_ap,
bool filtered,
PathEndVisitor *visitor,
bool &is_constrained);
void visitCheckEndUnclked(const Pin *pin,
Vertex *vertex,
Path *path,
2019-11-11 23:30:19 +01:00
const RiseFall *end_rf,
2018-09-28 17:54:21 +02:00
const PathAnalysisPt *path_ap,
bool filtered,
PathEndVisitor *visitor,
bool &is_constrained);
void visitOutputDelayEnd(const Pin *pin,
Path *path,
2019-11-11 23:30:19 +01:00
const RiseFall *end_rf,
2018-09-28 17:54:21 +02:00
const PathAnalysisPt *path_ap,
bool filtered,
PathEndVisitor *visitor,
bool &is_constrained);
virtual void visitOutputDelayEnd1(OutputDelay *output_delay,
const Pin *pin,
Path *path,
2019-11-11 23:30:19 +01:00
const RiseFall *end_rf,
2018-09-28 17:54:21 +02:00
const ClockEdge *tgt_clk_edge,
PathVertex *ref_path,
const MinMax *min_max,
PathEndVisitor *visitor,
bool &is_constrained);
virtual void visitGatedClkEnd(const Pin *pin,
Vertex *vertex,
Path *path,
2019-11-11 23:30:19 +01:00
const RiseFall *end_rf,
2018-09-28 17:54:21 +02:00
const PathAnalysisPt *path_ap,
bool filtered,
PathEndVisitor *visitor,
bool &is_constrained);
float clockGatingMargin(const Clock *clk,
const Pin *clk_pin,
const Pin *enable_pin,
2019-11-11 23:30:19 +01:00
const RiseFall *enable_rf,
2018-09-28 17:54:21 +02:00
const SetupHold *setup_hold);
void visitDataCheckEnd(const Pin *pin,
Path *path,
2019-11-11 23:30:19 +01:00
const RiseFall *end_rf,
2018-09-28 17:54:21 +02:00
const PathAnalysisPt *path_ap,
bool filtered,
PathEndVisitor *visitor,
bool &is_constrained);
bool visitDataCheckEnd1(DataCheck *check,
const Pin *pin,
Path *path,
const Clock *src_clk,
2019-11-11 23:30:19 +01:00
const RiseFall *end_rf,
2018-09-28 17:54:21 +02:00
const MinMax *min_max,
const PathAnalysisPt *clk_ap,
const Pin *from_pin,
Vertex *from_vertex,
2019-11-11 23:30:19 +01:00
RiseFall *from_rf,
2018-09-28 17:54:21 +02:00
bool filtered,
PathEndVisitor *visitor,
bool &is_constrained);
virtual void visitUnconstrainedPathEnds(const Pin *pin,
Vertex *vertex,
const Corner *corner,
const MinMaxAll *min_max,
bool filtered,
PathEndVisitor *visitor);
bool falsePathTo(Path *path,
const Pin *pin,
2019-11-11 23:30:19 +01:00
const RiseFall *rf,
2018-09-28 17:54:21 +02:00
const MinMax *min_max);
PathDelay *pathDelayTo(Path *path,
const Pin *pin,
2019-11-11 23:30:19 +01:00
const RiseFall *rf,
2018-09-28 17:54:21 +02:00
const MinMax *min_max);
ExceptionPath *exceptionTo(const Path *path,
const Pin *pin,
2019-11-11 23:30:19 +01:00
const RiseFall *rf,
2018-09-28 17:54:21 +02:00
const ClockEdge *clk_edge,
const MinMax *min_max) const;
};
// Abstract base class used by visitPathEnds to visit vertex path ends.
class PathEndVisitor
{
public:
virtual ~PathEndVisitor() {}
virtual PathEndVisitor *copy() const = 0;
2018-09-28 17:54:21 +02:00
// Begin visiting the path ends for a vertex / path_index.
virtual void vertexBegin(Vertex *) {}
// Visit a path end. path_end is only valid during the call.
virtual void visit(PathEnd *path_end) = 0;
// End visiting the path ends for a vertex / path_index.
virtual void vertexEnd(Vertex *) {}
};
} // namespace