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
|
|
|
|
2024-02-27 18:00:48 +01:00
|
|
|
#include "MinMax.hh"
|
2020-04-05 23:53:44 +02:00
|
|
|
#include "Vector.hh"
|
|
|
|
|
#include "Transition.hh"
|
|
|
|
|
#include "LibertyClass.hh"
|
|
|
|
|
#include "ConcreteLibrary.hh"
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
2020-04-05 20:35:51 +02:00
|
|
|
class TimingArcAttrs;
|
|
|
|
|
class InternalPowerAttrs;
|
|
|
|
|
class LeakagePowerAttrs;
|
2023-08-23 05:22:47 +02:00
|
|
|
class Debug;
|
|
|
|
|
class Report;
|
2020-04-05 20:35:51 +02:00
|
|
|
|
2018-09-28 17:54:21 +02:00
|
|
|
class LibertyBuilder
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
LibertyBuilder() {}
|
|
|
|
|
virtual ~LibertyBuilder() {}
|
2023-08-23 05:22:47 +02:00
|
|
|
void init(Debug *debug,
|
|
|
|
|
Report *report);
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual LibertyCell *makeCell(LibertyLibrary *library,
|
|
|
|
|
const char *name,
|
|
|
|
|
const char *filename);
|
|
|
|
|
virtual LibertyPort *makePort(LibertyCell *cell,
|
|
|
|
|
const char *name);
|
|
|
|
|
virtual LibertyPort *makeBusPort(LibertyCell *cell,
|
2023-02-19 01:20:40 +01:00
|
|
|
const char *bus_name,
|
2018-09-28 17:54:21 +02:00
|
|
|
int from_index,
|
2022-06-10 04:08:37 +02:00
|
|
|
int to_index,
|
|
|
|
|
BusDcl *bus_dcl);
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual LibertyPort *makeBundlePort(LibertyCell *cell,
|
|
|
|
|
const char *name,
|
|
|
|
|
ConcretePortSeq *members);
|
|
|
|
|
// Build timing arc sets and their arcs given a type and sense.
|
|
|
|
|
// Port functions and cell latches are also used by this builder
|
|
|
|
|
// to get the correct roles.
|
|
|
|
|
TimingArcSet *makeTimingArcs(LibertyCell *cell,
|
|
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
LibertyPort *related_out,
|
2023-08-23 05:22:47 +02:00
|
|
|
TimingArcAttrsPtr attrs,
|
|
|
|
|
int line);
|
2018-09-28 17:54:21 +02:00
|
|
|
InternalPower *makeInternalPower(LibertyCell *cell,
|
|
|
|
|
LibertyPort *port,
|
|
|
|
|
LibertyPort *related_port,
|
|
|
|
|
InternalPowerAttrs *attrs);
|
|
|
|
|
LeakagePower *makeLeakagePower(LibertyCell *cell,
|
|
|
|
|
LeakagePowerAttrs *attrs);
|
|
|
|
|
|
2022-06-08 19:03:41 +02:00
|
|
|
TimingArcSet *makeFromTransitionArcs(LibertyCell *cell,
|
|
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
LibertyPort *related_out,
|
2025-03-31 00:27:53 +02:00
|
|
|
const RiseFall *from_rf,
|
|
|
|
|
const TimingRole *role,
|
2022-06-25 20:59:07 +02:00
|
|
|
TimingArcAttrsPtr attrs);
|
2022-06-11 01:26:14 +02:00
|
|
|
TimingArcSet *makeCombinationalArcs(LibertyCell *cell,
|
|
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
bool to_rise,
|
|
|
|
|
bool to_fall,
|
2022-06-25 20:59:07 +02:00
|
|
|
TimingArcAttrsPtr attrs);
|
2023-10-04 23:33:09 +02:00
|
|
|
TimingArcSet *makeClockTreePathArcs(LibertyCell *cell,
|
|
|
|
|
LibertyPort *to_port,
|
2025-03-31 00:27:53 +02:00
|
|
|
const TimingRole *role,
|
2024-02-27 18:00:48 +01:00
|
|
|
const MinMax *min_max,
|
2023-10-04 23:33:09 +02:00
|
|
|
TimingArcAttrsPtr attrs);
|
2024-04-17 20:49:19 +02:00
|
|
|
TimingArcSet *makeMinPulseWidthArcs(LibertyCell *cell,
|
|
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
LibertyPort *related_out,
|
2025-03-31 00:27:53 +02:00
|
|
|
const TimingRole *role,
|
2024-04-17 20:49:19 +02:00
|
|
|
TimingArcAttrsPtr attrs);
|
2022-06-08 19:03:41 +02:00
|
|
|
|
2018-09-28 17:54:21 +02:00
|
|
|
protected:
|
|
|
|
|
ConcretePort *makeBusPort(const char *name,
|
|
|
|
|
int from_index,
|
|
|
|
|
int to_index,
|
|
|
|
|
ConcretePortSeq *members);
|
|
|
|
|
void makeBusPortBits(ConcreteLibrary *library,
|
|
|
|
|
LibertyCell *cell,
|
|
|
|
|
ConcretePort *bus_port,
|
2023-02-19 01:20:40 +01:00
|
|
|
const char *bus_name,
|
2018-09-28 17:54:21 +02:00
|
|
|
int from_index,
|
|
|
|
|
int to_index);
|
|
|
|
|
// Bus port bit (internal to makeBusPortBits).
|
2021-02-08 01:33:53 +01:00
|
|
|
virtual LibertyPort *makePort(LibertyCell *cell,
|
|
|
|
|
const char *bit_name,
|
|
|
|
|
int bit_index);
|
2018-09-28 17:54:21 +02:00
|
|
|
void makeBusPortBit(ConcreteLibrary *library,
|
|
|
|
|
LibertyCell *cell,
|
|
|
|
|
ConcretePort *bus_port,
|
2023-02-19 01:20:40 +01:00
|
|
|
const char *bus_name,
|
2018-09-28 17:54:21 +02:00
|
|
|
int index);
|
2024-01-07 21:44:04 +01:00
|
|
|
virtual TimingArcSet *makeTimingArcSet(LibertyCell *cell,
|
|
|
|
|
LibertyPort *from,
|
|
|
|
|
LibertyPort *to,
|
2025-03-31 00:27:53 +02:00
|
|
|
const TimingRole *role,
|
2024-01-07 21:44:04 +01:00
|
|
|
TimingArcAttrsPtr attrs);
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual TimingArcSet *makeTimingArcSet(LibertyCell *cell,
|
|
|
|
|
LibertyPort *from,
|
|
|
|
|
LibertyPort *to,
|
|
|
|
|
LibertyPort *related_out,
|
2025-03-31 00:27:53 +02:00
|
|
|
const TimingRole *role,
|
2022-06-25 20:59:07 +02:00
|
|
|
TimingArcAttrsPtr attrs);
|
2018-09-28 17:54:21 +02:00
|
|
|
virtual TimingArc *makeTimingArc(TimingArcSet *set,
|
2025-03-31 00:27:53 +02:00
|
|
|
const Transition *from_rf,
|
|
|
|
|
const Transition *to_rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingModel *model);
|
|
|
|
|
TimingArc *makeTimingArc(TimingArcSet *set,
|
2025-03-31 00:27:53 +02:00
|
|
|
const RiseFall *from_rf,
|
|
|
|
|
const RiseFall *to_rf,
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingModel *model);
|
|
|
|
|
TimingArcSet *makeLatchDtoQArcs(LibertyCell *cell,
|
|
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
2023-08-23 05:22:47 +02:00
|
|
|
TimingSense sense,
|
2022-06-25 20:59:07 +02:00
|
|
|
TimingArcAttrsPtr attrs);
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingArcSet *makeRegLatchArcs(LibertyCell *cell,
|
|
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
2025-03-31 00:27:53 +02:00
|
|
|
const RiseFall *from_rf,
|
2022-06-25 20:59:07 +02:00
|
|
|
TimingArcAttrsPtr attrs);
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingArcSet *makePresetClrArcs(LibertyCell *cell,
|
|
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
2025-03-31 00:27:53 +02:00
|
|
|
const RiseFall *to_rf,
|
2022-06-25 20:59:07 +02:00
|
|
|
TimingArcAttrsPtr attrs);
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingArcSet *makeTristateEnableArcs(LibertyCell *cell,
|
|
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
bool to_rise,
|
|
|
|
|
bool to_fall,
|
2022-06-25 20:59:07 +02:00
|
|
|
TimingArcAttrsPtr attrs);
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingArcSet *makeTristateDisableArcs(LibertyCell *cell,
|
|
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
bool to_rise,
|
|
|
|
|
bool to_fall,
|
2022-06-25 20:59:07 +02:00
|
|
|
TimingArcAttrsPtr attrs);
|
2023-08-23 05:22:47 +02:00
|
|
|
|
|
|
|
|
Debug *debug_;
|
|
|
|
|
Report *report_;
|
2018-09-28 17:54:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace
|