2018-09-28 17:54:21 +02:00
|
|
|
// OpenSTA, Static Timing Analyzer
|
2025-01-22 02:54:33 +01:00
|
|
|
// Copyright (c) 2025, 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
|
2022-01-04 18:17:08 +01:00
|
|
|
// 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
|
2022-01-04 18:17:08 +01:00
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2025-01-22 02:54:33 +01:00
|
|
|
//
|
|
|
|
|
// 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.
|
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,
|
2025-03-27 02:21:03 +01:00
|
|
|
Path *ref_path,
|
2018-09-28 17:54:21 +02:00
|
|
|
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,
|
2025-03-31 00:27:53 +02:00
|
|
|
const 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() {}
|
2021-12-16 01:21:57 +01:00
|
|
|
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
|