OpenSTA/include/sta/LibertyClass.hh

183 lines
4.4 KiB
C++
Raw Permalink Normal View History

2018-09-28 17:54:21 +02:00
// OpenSTA, Static Timing Analyzer
// 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
// 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/>.
//
// 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
#include <memory>
2020-04-05 23:53:44 +02:00
#include "Vector.hh"
#include "Map.hh"
#include "Set.hh"
2018-09-28 17:54:21 +02:00
namespace sta {
class Units;
class Unit;
class LibertyLibrary;
class LibertyCell;
class LibertyPort;
class Pvt;
class OperatingConditions;
class BusDcl;
class ModeDef;
class ModeValueDef;
class TableTemplate;
class Table;
class TableModel;
class TableAxis;
class GateTimingModel;
class CheckTimingModel;
class ScaleFactors;
class Wireload;
class WireloadSelection;
class TimingArcSet;
class TimingArc;
class TimingArcAttrs;
2018-09-28 17:54:21 +02:00
class InternalPower;
class LeakagePower;
class Sequential;
class FuncExpr;
class TimingModel;
class TimingRole;
class Transition;
2019-11-11 23:30:19 +01:00
class RiseFall;
class RiseFallBoth;
liberty ccs support commit 8f90f9e7ba1eb29621faa3efed9154501c600537 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Feb 3 09:02:22 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 0bb6b07fd965dc948a63ed383ac05893af4cbd87 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Feb 2 08:07:17 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 408a19ae7750bdd41641ac6efebec0df565987bc Author: James Cherry <cherry@parallaxsw.com> Date: Wed Feb 1 16:55:03 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a193adf0efdfa9c2a3b4272609e03f9279fc3479 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Feb 1 16:37:36 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit f26f47698ccd3a43d31f031f5cb6a70f0ffe1f91 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Feb 1 10:34:41 2023 -0700 cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 54613569fcb9d714b77833d54492b4dc8121a966 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Feb 1 10:18:20 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 4e34c391abc46e9e98d78725e139d739aff7fd44 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Feb 1 09:05:43 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 7b1e5af344948d84f82621d054efa206508a5cb8 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 31 08:58:23 2023 -0700 table report Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 501a53715f27a1ada6477f29b2efdc96fbaec8be Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 31 08:33:53 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e68cd932db03724e1344259d79bd6397cca777d2 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 30 11:47:01 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 1b279d3ae1e4a8fc156ee92999eab92e6a0a50ff Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 29 13:56:05 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 43e039650373f9a9bb9e7b7cae6b48d7d2db455b Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 29 11:54:08 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 648965c2433f4e7ed87371fced85e80d0198df10 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 27 19:16:39 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 02ac4e3e3f3f97308ff71a2f9984aa3aacb6e7ee Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 24 09:40:22 2023 -0700 ccs liberty Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2023-02-08 17:23:24 +01:00
class ReceiverModel;
class Statetable;
class StatetableRow;
2018-09-28 17:54:21 +02:00
2019-06-21 06:41:49 +02:00
typedef Vector<LibertyLibrary*> LibertyLibrarySeq;
2018-09-28 17:54:21 +02:00
typedef Vector<LibertyCell*> LibertyCellSeq;
typedef Vector<Sequential*> SequentialSeq;
typedef Map<LibertyCell*, LibertyCellSeq*> LibertyCellEquivMap;
typedef Vector<LibertyPort*> LibertyPortSeq;
typedef Set<LibertyPort*> LibertyPortSet;
2018-12-05 23:18:41 +01:00
typedef std::pair<const LibertyPort*,const LibertyPort*> LibertyPortPair;
2018-09-28 17:54:21 +02:00
typedef Set<LibertyCell*> LibertyCellSet;
typedef std::shared_ptr<Table> TablePtr;
typedef std::shared_ptr<TimingArcAttrs> TimingArcAttrsPtr;
typedef std::shared_ptr<TableAxis> TableAxisPtr;
liberty ccs support commit 8f90f9e7ba1eb29621faa3efed9154501c600537 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Feb 3 09:02:22 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 0bb6b07fd965dc948a63ed383ac05893af4cbd87 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Feb 2 08:07:17 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 408a19ae7750bdd41641ac6efebec0df565987bc Author: James Cherry <cherry@parallaxsw.com> Date: Wed Feb 1 16:55:03 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a193adf0efdfa9c2a3b4272609e03f9279fc3479 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Feb 1 16:37:36 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit f26f47698ccd3a43d31f031f5cb6a70f0ffe1f91 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Feb 1 10:34:41 2023 -0700 cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 54613569fcb9d714b77833d54492b4dc8121a966 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Feb 1 10:18:20 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 4e34c391abc46e9e98d78725e139d739aff7fd44 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Feb 1 09:05:43 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 7b1e5af344948d84f82621d054efa206508a5cb8 Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 31 08:58:23 2023 -0700 table report Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 501a53715f27a1ada6477f29b2efdc96fbaec8be Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 31 08:33:53 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e68cd932db03724e1344259d79bd6397cca777d2 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 30 11:47:01 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 1b279d3ae1e4a8fc156ee92999eab92e6a0a50ff Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 29 13:56:05 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 43e039650373f9a9bb9e7b7cae6b48d7d2db455b Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 29 11:54:08 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 648965c2433f4e7ed87371fced85e80d0198df10 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 27 19:16:39 2023 -0700 ccs Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 02ac4e3e3f3f97308ff71a2f9984aa3aacb6e7ee Author: James Cherry <cherry@parallaxsw.com> Date: Tue Jan 24 09:40:22 2023 -0700 ccs liberty Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2023-02-08 17:23:24 +01:00
typedef std::shared_ptr<ReceiverModel> ReceiverModelPtr;
typedef std::vector<StatetableRow> StatetableRows;
2018-09-28 17:54:21 +02:00
2019-03-13 01:25:53 +01:00
enum class ScaleFactorType : unsigned {
pin_cap,
wire_cap,
wire_res,
min_period,
2018-09-28 17:54:21 +02:00
// Liberty attributes have rise/fall suffix.
2019-03-13 01:25:53 +01:00
cell,
hold,
setup,
recovery,
removal,
nochange,
skew,
leakage_power,
internal_power,
2018-09-28 17:54:21 +02:00
// Liberty attributes have rise/fall prefix.
2019-03-13 01:25:53 +01:00
transition,
2018-09-28 17:54:21 +02:00
// Liberty attributes have low/high suffix (indexed as rise/fall).
2019-03-13 01:25:53 +01:00
min_pulse_width,
unknown,
};
const int scale_factor_type_count = int(ScaleFactorType::unknown) + 1;
2018-09-28 17:54:21 +02:00
// Enough bits to hold a ScaleFactorType enum.
const int scale_factor_bits = 4;
2019-03-13 01:25:53 +01:00
enum class WireloadTree { worst_case, best_case, balanced, unknown };
2018-09-28 17:54:21 +02:00
2019-03-13 01:25:53 +01:00
enum class WireloadMode { top, enclosed, segmented, unknown };
2018-09-28 17:54:21 +02:00
2019-03-13 01:25:53 +01:00
enum class TimingSense {
positive_unate,
negative_unate,
non_unate,
none,
unknown
};
const int timing_sense_count = int(TimingSense::unknown) + 1;
2018-09-28 17:54:21 +02:00
const int timing_sense_bit_count = 3;
2019-03-13 01:25:53 +01:00
enum class TableAxisVariable {
total_output_net_capacitance,
equal_or_opposite_output_net_capacitance,
input_net_transition,
input_transition_time,
related_pin_transition,
constrained_pin_transition,
output_pin_transition,
connect_delay,
related_out_total_output_net_capacitance,
time,
iv_output_voltage,
input_noise_width,
input_noise_height,
input_voltage,
output_voltage,
path_depth,
path_distance,
normalized_voltage,
unknown
};
enum class PathType { clk, data, clk_and_data };
const int path_type_count = 2;
class LibertyPortLess
{
public:
bool operator()(const LibertyPort *port1, const LibertyPort *port2) const;
};
2018-09-28 17:54:21 +02:00
class LibertyPortNameLess
{
public:
bool operator()(const LibertyPort *port1, const LibertyPort *port2) const;
};
class LibertyPortPairLess
{
public:
2019-03-21 18:48:50 +01:00
bool operator()(const LibertyPortPair &pair1,
const LibertyPortPair &pair2) const;
2018-09-28 17:54:21 +02:00
};
bool
timingArcSetLess(const TimingArcSet *set1,
const TimingArcSet *set2);
class TimingArcSetLess
{
public:
bool
operator()(const TimingArcSet *set1,
const TimingArcSet *set2) const
{
return timingArcSetLess(set1, set2);
}
};
} // namespace