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 "Transition.hh"
|
|
|
|
|
#include "SearchClass.hh"
|
2025-02-26 23:44:38 +01:00
|
|
|
#include "Sdc.hh"
|
2025-03-27 02:21:03 +01:00
|
|
|
#include "Path.hh"
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
2025-03-27 02:21:03 +01:00
|
|
|
class Path;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
class ClkInfo
|
|
|
|
|
{
|
|
|
|
|
public:
|
2023-01-19 19:23:45 +01:00
|
|
|
ClkInfo(const ClockEdge *clk_edge,
|
2018-09-28 17:54:21 +02:00
|
|
|
const Pin *clk_src,
|
|
|
|
|
bool is_propagated,
|
|
|
|
|
const Pin *gen_clk_src,
|
|
|
|
|
bool is_gen_clk_src_path,
|
2019-11-11 23:30:19 +01:00
|
|
|
const RiseFall *pulse_clk_sense,
|
2018-09-28 17:54:21 +02:00
|
|
|
Arrival insertion,
|
|
|
|
|
float latency,
|
|
|
|
|
ClockUncertainties *uncertainties,
|
|
|
|
|
PathAPIndex path_ap_index,
|
2025-03-27 02:21:03 +01:00
|
|
|
Path *crpr_clk_path,
|
2018-09-28 17:54:21 +02:00
|
|
|
const StaState *sta);
|
|
|
|
|
~ClkInfo();
|
|
|
|
|
const char *asString(const StaState *sta) const;
|
2023-01-19 19:23:45 +01:00
|
|
|
const ClockEdge *clkEdge() const { return clk_edge_; }
|
|
|
|
|
const Clock *clock() const;
|
2018-09-28 17:54:21 +02:00
|
|
|
const Pin *clkSrc() const { return clk_src_; }
|
|
|
|
|
bool isPropagated() const { return is_propagated_; }
|
|
|
|
|
const Pin *genClkSrc() const { return gen_clk_src_; }
|
|
|
|
|
bool isPulseClk() const { return is_pulse_clk_; }
|
2019-11-11 23:30:19 +01:00
|
|
|
RiseFall *pulseClkSense() const;
|
2018-09-28 17:54:21 +02:00
|
|
|
int pulseClkSenseTrIndex() const { return pulse_clk_sense_; }
|
|
|
|
|
float latency() const { return latency_; }
|
|
|
|
|
Arrival &insertion() { return insertion_; }
|
|
|
|
|
const Arrival &insertion() const { return insertion_; }
|
|
|
|
|
ClockUncertainties *uncertainties() const { return uncertainties_; }
|
|
|
|
|
PathAPIndex pathAPIndex() const { return path_ap_index_; }
|
2024-12-11 20:09:35 +01:00
|
|
|
// Clock path used for crpr resolution.
|
|
|
|
|
// Null for clocks because the path cannot point to itself.
|
2025-03-27 02:21:03 +01:00
|
|
|
Path *crprClkPath(const StaState *sta);
|
|
|
|
|
const Path *crprClkPath(const StaState *sta) const;
|
|
|
|
|
VertexId crprClkVertexId(const StaState *sta) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
bool hasCrprClkPin() const { return !crpr_clk_path_.isNull(); }
|
|
|
|
|
bool refsFilter(const StaState *sta) const;
|
|
|
|
|
// This clk_info/tag is used for a generated clock source path.
|
|
|
|
|
bool isGenClkSrcPath() const { return is_gen_clk_src_path_; }
|
2019-08-08 23:13:02 +02:00
|
|
|
size_t hash() const { return hash_; }
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void findHash(const StaState *sta);
|
|
|
|
|
|
|
|
|
|
private:
|
2023-01-19 19:23:45 +01:00
|
|
|
const ClockEdge *clk_edge_;
|
2018-09-28 17:54:21 +02:00
|
|
|
const Pin *clk_src_;
|
|
|
|
|
const Pin *gen_clk_src_;
|
2025-03-27 02:21:03 +01:00
|
|
|
Path crpr_clk_path_;
|
2018-09-28 17:54:21 +02:00
|
|
|
ClockUncertainties *uncertainties_;
|
|
|
|
|
Arrival insertion_;
|
|
|
|
|
float latency_;
|
2019-08-08 23:13:02 +02:00
|
|
|
size_t hash_;
|
2020-09-16 21:41:58 +02:00
|
|
|
bool is_propagated_:1;
|
|
|
|
|
bool is_gen_clk_src_path_:1;
|
|
|
|
|
bool is_pulse_clk_:1;
|
2019-11-11 23:30:19 +01:00
|
|
|
unsigned int pulse_clk_sense_:RiseFall::index_bit_count;
|
2018-09-28 17:54:21 +02:00
|
|
|
unsigned int path_ap_index_:path_ap_index_bit_count;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ClkInfoLess
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit ClkInfoLess(const StaState *sta);
|
|
|
|
|
~ClkInfoLess() {}
|
|
|
|
|
bool operator()(const ClkInfo *clk_info1,
|
|
|
|
|
const ClkInfo *clk_info2) const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
const StaState *sta_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ClkInfoHash
|
|
|
|
|
{
|
|
|
|
|
public:
|
2020-09-26 01:16:18 +02:00
|
|
|
size_t operator()(const ClkInfo *clk_info) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ClkInfoEqual
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ClkInfoEqual(const StaState *sta);
|
|
|
|
|
bool operator()(const ClkInfo *clk_info1,
|
2020-09-26 01:16:18 +02:00
|
|
|
const ClkInfo *clk_info2) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
const StaState *sta_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace
|