2018-09-28 17:54:21 +02:00
|
|
|
// OpenSTA, Static Timing Analyzer
|
2026-03-10 21:21:17 +01:00
|
|
|
// Copyright (c) 2026, 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 "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;
|
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:
|
2026-02-28 01:57:08 +01:00
|
|
|
LibertyBuilder(Debug *debug,
|
|
|
|
|
Report *report);
|
|
|
|
|
LibertyCell *makeCell(LibertyLibrary *library,
|
|
|
|
|
const char *name,
|
|
|
|
|
const char *filename);
|
|
|
|
|
LibertyPort *makePort(LibertyCell *cell,
|
|
|
|
|
const char *name);
|
|
|
|
|
LibertyPort *makeBusPort(LibertyCell *cell,
|
|
|
|
|
const char *bus_name,
|
|
|
|
|
int from_index,
|
|
|
|
|
int to_index,
|
|
|
|
|
BusDcl *bus_dcl);
|
|
|
|
|
LibertyPort *makeBundlePort(LibertyCell *cell,
|
|
|
|
|
const char *name,
|
|
|
|
|
ConcretePortSeq *members);
|
2018-09-28 17:54:21 +02:00
|
|
|
// 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,
|
2026-01-04 01:59:35 +01:00
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
LibertyPort *related_out,
|
|
|
|
|
TimingArcAttrsPtr attrs,
|
2023-08-23 05:22:47 +02:00
|
|
|
int line);
|
2022-06-08 19:03:41 +02:00
|
|
|
TimingArcSet *makeFromTransitionArcs(LibertyCell *cell,
|
2026-01-04 01:59:35 +01:00
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
LibertyPort *related_out,
|
|
|
|
|
const RiseFall *from_rf,
|
|
|
|
|
const TimingRole *role,
|
|
|
|
|
TimingArcAttrsPtr attrs);
|
2022-06-11 01:26:14 +02:00
|
|
|
TimingArcSet *makeCombinationalArcs(LibertyCell *cell,
|
2026-01-04 01:59:35 +01:00
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
bool to_rise,
|
|
|
|
|
bool to_fall,
|
|
|
|
|
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,
|
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,
|
2026-01-04 01:59:35 +01:00
|
|
|
int from_index,
|
|
|
|
|
int to_index,
|
|
|
|
|
ConcretePortSeq *members);
|
2018-09-28 17:54:21 +02:00
|
|
|
void makeBusPortBits(ConcreteLibrary *library,
|
2026-01-04 01:59:35 +01:00
|
|
|
LibertyCell *cell,
|
|
|
|
|
ConcretePort *bus_port,
|
|
|
|
|
const char *bus_name,
|
|
|
|
|
int from_index,
|
|
|
|
|
int to_index);
|
2018-09-28 17:54:21 +02:00
|
|
|
// Bus port bit (internal to makeBusPortBits).
|
2026-02-28 01:57:08 +01:00
|
|
|
LibertyPort *makePort(LibertyCell *cell,
|
|
|
|
|
const char *bit_name,
|
|
|
|
|
int bit_index);
|
2018-09-28 17:54:21 +02:00
|
|
|
void makeBusPortBit(ConcreteLibrary *library,
|
2026-01-04 01:59:35 +01:00
|
|
|
LibertyCell *cell,
|
|
|
|
|
ConcretePort *bus_port,
|
|
|
|
|
const char *bus_name,
|
|
|
|
|
int index);
|
2026-02-28 01:57:08 +01:00
|
|
|
TimingArc *makeTimingArc(TimingArcSet *set,
|
|
|
|
|
const Transition *from_rf,
|
|
|
|
|
const Transition *to_rf,
|
|
|
|
|
TimingModel *model);
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingArc *makeTimingArc(TimingArcSet *set,
|
2026-01-04 01:59:35 +01:00
|
|
|
const RiseFall *from_rf,
|
|
|
|
|
const RiseFall *to_rf,
|
|
|
|
|
TimingModel *model);
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingArcSet *makeLatchDtoQArcs(LibertyCell *cell,
|
2026-01-04 01:59:35 +01:00
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
2023-08-23 05:22:47 +02:00
|
|
|
TimingSense sense,
|
2026-01-04 01:59:35 +01:00
|
|
|
TimingArcAttrsPtr attrs);
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingArcSet *makeRegLatchArcs(LibertyCell *cell,
|
2026-01-04 01:59:35 +01:00
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
const RiseFall *from_rf,
|
|
|
|
|
TimingArcAttrsPtr attrs);
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingArcSet *makePresetClrArcs(LibertyCell *cell,
|
2026-01-04 01:59:35 +01:00
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
const RiseFall *to_rf,
|
|
|
|
|
TimingArcAttrsPtr attrs);
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingArcSet *makeTristateEnableArcs(LibertyCell *cell,
|
2026-01-04 01:59:35 +01:00
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
bool to_rise,
|
|
|
|
|
bool to_fall,
|
|
|
|
|
TimingArcAttrsPtr attrs);
|
2018-09-28 17:54:21 +02:00
|
|
|
TimingArcSet *makeTristateDisableArcs(LibertyCell *cell,
|
2026-01-04 01:59:35 +01:00
|
|
|
LibertyPort *from_port,
|
|
|
|
|
LibertyPort *to_port,
|
|
|
|
|
bool to_rise,
|
|
|
|
|
bool to_fall,
|
|
|
|
|
TimingArcAttrsPtr attrs);
|
2023-08-23 05:22:47 +02:00
|
|
|
|
|
|
|
|
Debug *debug_;
|
|
|
|
|
Report *report_;
|
2018-09-28 17:54:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace
|