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-04-05 23:53:44 +02:00
|
|
|
#include "DelayCalc.hh"
|
2020-04-05 20:35:51 +02:00
|
|
|
|
2026-01-04 01:59:35 +01:00
|
|
|
#include <map>
|
|
|
|
|
|
|
|
|
|
#include "ContainerHelpers.hh"
|
2020-04-05 23:53:44 +02:00
|
|
|
#include "StringUtil.hh"
|
|
|
|
|
#include "UnitDelayCalc.hh"
|
|
|
|
|
#include "LumpedCapDelayCalc.hh"
|
|
|
|
|
#include "DmpDelayCalc.hh"
|
|
|
|
|
#include "ArnoldiDelayCalc.hh"
|
2024-02-27 18:00:48 +01:00
|
|
|
#include "CcsCeffDelayCalc.hh"
|
2024-06-30 23:44:31 +02:00
|
|
|
#include "PrimaDelayCalc.hh"
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
2026-01-04 01:59:35 +01:00
|
|
|
typedef std::map<const char*, MakeArcDelayCalc, CharPtrLess> DelayCalcMap;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2019-03-13 01:25:53 +01:00
|
|
|
static DelayCalcMap *delay_calcs = nullptr;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
registerDelayCalcs()
|
|
|
|
|
{
|
|
|
|
|
registerDelayCalc("unit", makeUnitDelayCalc);
|
|
|
|
|
registerDelayCalc("lumped_cap", makeLumpedCapDelayCalc);
|
|
|
|
|
registerDelayCalc("dmp_ceff_elmore", makeDmpCeffElmoreDelayCalc);
|
|
|
|
|
registerDelayCalc("dmp_ceff_two_pole", makeDmpCeffTwoPoleDelayCalc);
|
2018-10-24 23:22:21 +02:00
|
|
|
registerDelayCalc("arnoldi", makeArnoldiDelayCalc);
|
2024-02-27 18:00:48 +01:00
|
|
|
registerDelayCalc("ccs_ceff", makeCcsCeffDelayCalc);
|
2024-06-30 23:44:31 +02:00
|
|
|
registerDelayCalc("prima", makePrimaDelayCalc);
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
registerDelayCalc(const char *name,
|
2026-01-04 01:59:35 +01:00
|
|
|
MakeArcDelayCalc maker)
|
2018-09-28 17:54:21 +02:00
|
|
|
{
|
2019-03-13 01:25:53 +01:00
|
|
|
if (delay_calcs == nullptr)
|
2018-09-28 17:54:21 +02:00
|
|
|
delay_calcs = new DelayCalcMap;
|
|
|
|
|
(*delay_calcs)[name] = maker;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
deleteDelayCalcs()
|
|
|
|
|
{
|
|
|
|
|
delete delay_calcs;
|
2019-03-13 01:25:53 +01:00
|
|
|
delay_calcs = nullptr;
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ArcDelayCalc *
|
|
|
|
|
makeDelayCalc(const char *name,
|
2026-01-04 01:59:35 +01:00
|
|
|
StaState *sta)
|
2018-09-28 17:54:21 +02:00
|
|
|
{
|
2026-01-04 01:59:35 +01:00
|
|
|
MakeArcDelayCalc maker = findKey(delay_calcs, name);
|
2018-09-28 17:54:21 +02:00
|
|
|
if (maker)
|
|
|
|
|
return maker(sta);
|
|
|
|
|
else
|
2019-03-13 01:25:53 +01:00
|
|
|
return nullptr;
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
isDelayCalcName(const char *name)
|
|
|
|
|
{
|
2026-01-04 01:59:35 +01:00
|
|
|
return delay_calcs->contains(name);
|
2018-09-28 17:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
2023-01-19 19:23:45 +01:00
|
|
|
StringSeq
|
2018-09-28 17:54:21 +02:00
|
|
|
delayCalcNames()
|
|
|
|
|
{
|
2023-01-19 19:23:45 +01:00
|
|
|
StringSeq names;
|
2024-06-27 22:57:58 +02:00
|
|
|
for (const auto [name, make_dcalc] : *delay_calcs)
|
2023-01-19 19:23:45 +01:00
|
|
|
names.push_back(name);
|
2018-09-28 17:54:21 +02:00
|
|
|
return names;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace
|