OpenSTA/liberty/LibertyBuilder.hh

147 lines
4.6 KiB
C++
Raw Normal View History

2018-09-28 17:54:21 +02:00
// OpenSTA, Static Timing Analyzer
2020-03-07 03:50:37 +01:00
// Copyright (c) 2020, 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
// 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/>.
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 "DisallowCopyAssign.hh"
#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;
2018-09-28 17:54:21 +02:00
class LibertyBuilder
{
public:
LibertyBuilder() {}
virtual ~LibertyBuilder() {}
virtual LibertyCell *makeCell(LibertyLibrary *library,
const char *name,
const char *filename);
virtual LibertyPort *makePort(LibertyCell *cell,
const char *name);
virtual LibertyPort *makeBusPort(LibertyCell *cell,
const char *name,
int from_index,
int to_index);
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,
TimingArcAttrs *attrs);
InternalPower *makeInternalPower(LibertyCell *cell,
LibertyPort *port,
LibertyPort *related_port,
InternalPowerAttrs *attrs);
LeakagePower *makeLeakagePower(LibertyCell *cell,
LeakagePowerAttrs *attrs);
protected:
ConcretePort *makeBusPort(const char *name,
int from_index,
int to_index,
ConcretePortSeq *members);
void makeBusPortBits(ConcreteLibrary *library,
LibertyCell *cell,
ConcretePort *bus_port,
const char *name,
int from_index,
int to_index);
// Bus port bit (internal to makeBusPortBits).
virtual ConcretePort *makePort(LibertyCell *cell,
const char *bit_name,
int bit_index);
void makeBusPortBit(ConcreteLibrary *library,
LibertyCell *cell,
ConcretePort *bus_port,
const char *name,
int index);
virtual TimingArcSet *makeTimingArcSet(LibertyCell *cell,
LibertyPort *from,
LibertyPort *to,
LibertyPort *related_out,
TimingRole *role,
TimingArcAttrs *attrs);
virtual TimingArc *makeTimingArc(TimingArcSet *set,
2019-11-11 23:30:19 +01:00
Transition *from_rf,
Transition *to_rf,
2018-09-28 17:54:21 +02:00
TimingModel *model);
TimingArc *makeTimingArc(TimingArcSet *set,
2019-11-11 23:30:19 +01:00
RiseFall *from_rf,
RiseFall *to_rf,
2018-09-28 17:54:21 +02:00
TimingModel *model);
TimingArcSet *makeCombinationalArcs(LibertyCell *cell,
LibertyPort *from_port,
LibertyPort *to_port,
LibertyPort *related_out,
bool to_rise,
bool to_fall,
TimingArcAttrs *attrs);
TimingArcSet *makeLatchDtoQArcs(LibertyCell *cell,
LibertyPort *from_port,
LibertyPort *to_port,
LibertyPort *related_out,
TimingArcAttrs *attrs);
TimingArcSet *makeRegLatchArcs(LibertyCell *cell,
LibertyPort *from_port,
LibertyPort *to_port,
LibertyPort *related_out,
2019-11-11 23:30:19 +01:00
RiseFall *from_rf,
2018-09-28 17:54:21 +02:00
TimingArcAttrs *attrs);
TimingArcSet *makeFromTransitionArcs(LibertyCell *cell,
LibertyPort *from_port,
LibertyPort *to_port,
LibertyPort *related_out,
2019-11-11 23:30:19 +01:00
RiseFall *from_rf,
2018-09-28 17:54:21 +02:00
TimingRole *role,
TimingArcAttrs *attrs);
TimingArcSet *makePresetClrArcs(LibertyCell *cell,
LibertyPort *from_port,
LibertyPort *to_port,
LibertyPort *related_out,
2019-11-11 23:30:19 +01:00
RiseFall *to_rf,
2018-09-28 17:54:21 +02:00
TimingArcAttrs *attrs);
TimingArcSet *makeTristateEnableArcs(LibertyCell *cell,
LibertyPort *from_port,
LibertyPort *to_port,
LibertyPort *related_out,
bool to_rise,
bool to_fall,
TimingArcAttrs *attrs);
TimingArcSet *makeTristateDisableArcs(LibertyCell *cell,
LibertyPort *from_port,
LibertyPort *to_port,
LibertyPort *related_out,
bool to_rise,
bool to_fall,
TimingArcAttrs *attrs);
private:
DISALLOW_COPY_AND_ASSIGN(LibertyBuilder);
};
} // namespace