OpenSTA/include/sta/DelayFloat.hh

145 lines
3.0 KiB
C++
Raw Permalink Normal View History

2018-09-28 17:54:21 +02:00
// OpenSTA, Static Timing Analyzer
// Copyright (c) 2024, 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/>.
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 "MinMax.hh"
2018-09-28 17:54:21 +02:00
// Delay values defined as floats.
namespace sta {
class StaState;
2018-09-28 17:54:21 +02:00
typedef float Delay;
// Delay double for accumulating Delays.
typedef double DelayDbl;
2018-09-28 17:54:21 +02:00
const Delay delay_zero = 0.0;
void
initDelayConstants();
2020-07-12 01:24:48 +02:00
const char *
delayAsString(const Delay &delay,
const StaState *sta);
const char *
delayAsString(const Delay &delay,
const StaState *sta,
int digits);
const char *
delayAsString(const Delay &delay,
const EarlyLate *early_late,
const StaState *sta,
int digits);
2018-11-26 18:15:52 +01:00
inline Delay
makeDelay(float delay,
float,
float)
{
return delay;
}
2018-09-28 17:54:21 +02:00
2018-12-11 19:47:04 +01:00
inline Delay
makeDelay2(float delay,
float,
float)
{
return delay;
}
inline float
delayAsFloat(const Delay &delay)
{
return delay;
}
// mean late+/early- sigma
2020-07-12 01:24:48 +02:00
inline float
delayAsFloat(const Delay &delay,
2020-07-12 01:24:48 +02:00
const EarlyLate *,
const StaState *)
{
return delay;
}
inline float
delaySigma2(const Delay &,
const EarlyLate *)
{
return 0.0;
}
const Delay &
delayInitValue(const MinMax *min_max);
bool
delayIsInitValue(const Delay &delay,
const MinMax *min_max);
bool
2020-07-12 01:24:48 +02:00
delayZero(const Delay &delay);
bool
2020-07-12 01:24:48 +02:00
delayInf(const Delay &delay);
bool
delayEqual(const Delay &delay1,
const Delay &delay2);
bool
delayLess(const Delay &delay1,
2020-07-12 02:43:30 +02:00
const Delay &delay2,
const StaState *sta);
bool
2020-07-12 01:24:48 +02:00
delayLess(const Delay &delay1,
2019-03-13 01:25:53 +01:00
const Delay &delay2,
2020-07-12 02:43:30 +02:00
const MinMax *min_max,
const StaState *sta);
bool
2020-07-12 01:24:48 +02:00
delayLessEqual(const Delay &delay1,
2020-07-12 02:43:30 +02:00
const Delay &delay2,
const StaState *sta);
2020-07-12 01:24:48 +02:00
bool
delayLessEqual(const Delay &delay1,
const Delay &delay2,
2020-07-12 02:43:30 +02:00
const MinMax *min_max,
const StaState *sta);
2020-07-12 01:24:48 +02:00
bool
delayGreater(const Delay &delay1,
const Delay &delay2,
2020-07-12 02:43:30 +02:00
const StaState *sta);
2020-07-12 01:24:48 +02:00
bool
delayGreaterEqual(const Delay &delay1,
2020-07-12 02:43:30 +02:00
const Delay &delay2,
const StaState *sta);
2020-07-12 01:24:48 +02:00
bool
delayGreaterEqual(const Delay &delay1,
const Delay &delay2,
2020-07-12 02:43:30 +02:00
const MinMax *min_max,
const StaState *sta);
bool
delayGreater(const Delay &delay1,
const Delay &delay2,
const MinMax *min_max,
const StaState *sta);
2020-05-31 03:09:14 +02:00
2020-07-12 02:43:30 +02:00
// delay1-delay2 subtracting sigma instead of addiing.
2020-05-31 03:09:14 +02:00
Delay
delayRemove(const Delay &delay1,
const Delay &delay2);
float
delayRatio(const Delay &delay1,
const Delay &delay2);
2018-09-28 17:54:21 +02:00
} // namespace