Files
OpenSTA/include/sta/Sta.hh
T

1650 lines
66 KiB
C++
Raw Normal View History

2018-09-28 08:54:21 -07:00
// OpenSTA, Static Timing Analyzer
2026-03-10 13:21:17 -07:00
// Copyright (c) 2026, Parallax Software, Inc.
2018-09-28 08:54:21 -07: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 10:17:08 -07:00
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2018-09-28 08:54:21 -07:00
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
2022-01-04 10:17:08 -07:00
// along with this program. If not, see <https://www.gnu.org/licenses/>.
2025-01-21 18:54:33 -07: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 08:54:21 -07:00
2020-02-15 17:13:16 -07:00
#pragma once
2018-09-28 08:54:21 -07:00
2026-04-24 11:54:28 -07:00
#include <map>
2018-09-28 08:54:21 -07:00
#include <string>
2026-01-03 16:59:35 -08:00
#include <string_view>
2026-04-15 09:38:10 -07:00
#include <vector>
2020-04-05 11:35:51 -07:00
2026-04-15 09:38:10 -07:00
#include "ArcDelayCalc.hh"
#include "CircuitSim.hh"
#include "GraphClass.hh"
2020-04-05 14:53:44 -07:00
#include "LibertyClass.hh"
#include "NetworkClass.hh"
#include "ParasiticsClass.hh"
2020-07-31 09:42:24 -07:00
#include "PowerClass.hh"
2025-05-26 15:33:51 -07:00
#include "Property.hh"
2026-01-03 16:59:35 -08:00
#include "RiseFallMinMaxDelay.hh"
2026-04-15 09:38:10 -07:00
#include "Scene.hh"
#include "SdcClass.hh"
#include "SearchClass.hh"
#include "StaState.hh"
#include "StringUtil.hh"
#include "Variables.hh"
#include "VertexVisitor.hh"
2018-09-28 08:54:21 -07:00
struct Tcl_Interp;
namespace sta {
// Don't include headers to minimize dependencies.
class MinMax;
class MinMaxAll;
2019-11-11 15:30:19 -07:00
class RiseFallBoth;
class RiseFall;
2025-01-21 18:35:21 -07:00
class VerilogReader;
2018-09-28 08:54:21 -07:00
class ReportPath;
class CheckTiming;
2026-01-03 16:59:35 -08:00
class CheckSlews;
class CheckFanouts;
class CheckCapacitances;
2018-09-28 08:54:21 -07:00
class CheckMinPulseWidths;
class CheckMinPeriods;
class CheckMaxSkews;
class PatternMatch;
class CheckPeriods;
class LibertyReader;
class SearchPred;
2026-01-03 16:59:35 -08:00
class Scene;
2018-09-28 08:54:21 -07:00
class ClkSkews;
class ReportField;
2019-06-20 21:41:49 -07:00
class EquivCells;
2026-01-03 16:59:35 -08:00
class StaSimObserver;
2026-05-13 12:59:35 -04:00
class LevelizeObserver;
2026-01-03 16:59:35 -08:00
class GraphLoop;
2018-09-28 08:54:21 -07:00
2026-03-28 19:13:35 -07:00
using ModeNameMap = std::map<std::string, Mode*, std::less<>>;
2026-01-03 16:59:35 -08:00
using SceneNameMap = std::map<std::string, Scene*>;
using SlowDrvrIterator = Iterator<Instance*>;
2026-03-08 15:51:50 -07:00
using CheckError = StringSeq;
2026-01-03 16:59:35 -08:00
using CheckErrorSeq = std::vector<CheckError*>;
2019-03-12 17:25:53 -07:00
enum class CmdNamespace { sta, sdc };
2026-04-13 14:58:16 -07:00
using ParasiticsNameMap = std::map<std::string, Parasitics*, std::less<>>;
2026-01-03 16:59:35 -08:00
using GraphLoopSeq = std::vector<GraphLoop*>;
2026-05-12 11:24:24 -07:00
using ReportFieldGetValue = std::function<std::string (const Path *path,
const StaState *sta)>;
2018-09-28 08:54:21 -07:00
// Initialize sta functions that are not part of the Sta class.
void initSta();
// Call before exit to make leak detection simpler for purify and valgrind.
void
deleteAllMemory();
// The Lord, God, King, Master of the Timing Universe.
// This class is a FACADE used to present an API to the collection of
// objects that hold the collective state of the static timing analyzer.
// It should only hold pointers to objects so that only the referenced
// class declarations and not their definitions are needed by this header.
//
// The report object is not owned by the sta object.
class Sta : public StaState
{
public:
// The Sta is a FACTORY for the components.
// makeComponents calls the make{Component} virtual functions.
// Ideally this would be called by the Sta constructor, but a
// virtual function called in a base class constructor does not
// call the derived class function.
virtual void makeComponents();
// Call copyState for each component to notify it that some
// pointers to some components have changed.
// This must be called after changing any of the StaState components.
virtual void updateComponentsState();
2026-04-13 14:58:16 -07:00
~Sta() override;
2018-09-28 08:54:21 -07:00
// Singleton accessor used by tcl command interpreter.
static Sta *sta();
static void setSta(Sta *sta);
// Default number of threads to use.
virtual int defaultThreadCount() const;
void setThreadCount(int thread_count);
2026-01-03 16:59:35 -08:00
// define_corners compatibility.
2026-03-08 15:51:50 -07:00
void makeScenes(const StringSeq &scene_names);
2026-01-03 16:59:35 -08:00
void makeScene(const std::string &name,
const std::string &mode_name,
2026-03-08 15:51:50 -07:00
const StringSeq &liberty_min_files,
const StringSeq &liberty_max_files,
2026-01-03 16:59:35 -08:00
const std::string &spef_min_file,
const std::string &spef_max_file);
Scene *findScene(const std::string &name) const;
// Pattern match name.
SceneSeq findScenes(const std::string &name) const;
SceneSeq findScenes(const std::string &name,
ModeSeq &modes) const;
Scene *cmdScene() const;
void setCmdScene(Scene *scene);
SceneSeq makeSceneSeq(Scene *scene) const;
2026-05-01 10:01:10 -07:00
Mode *cmdMode() const { return cmd_mode_; }
2026-01-03 16:59:35 -08:00
const std::string &cmdModeName();
2026-03-28 19:13:35 -07:00
void setCmdMode(std::string_view mode_name);
Mode *findMode(std::string_view mode_name) const;
2026-01-03 16:59:35 -08:00
ModeSeq findModes(const std::string &mode_name) const;
Sdc *cmdSdc() const;
2026-03-28 19:13:35 -07:00
virtual LibertyLibrary *readLiberty(std::string_view filename,
2026-01-03 16:59:35 -08:00
Scene *scene,
const MinMaxAll *min_max,
bool infer_latches);
2026-02-04 18:33:04 -07:00
// tmp public
void readLibertyAfter(LibertyLibrary *liberty,
Scene *scene,
2026-04-18 08:45:04 -07:00
const MinMaxAll *min_max);
2026-03-28 19:13:35 -07:00
bool readVerilog(std::string_view filename);
2018-09-28 08:54:21 -07:00
// Network readers call this to notify the Sta to delete any previously
// linked network.
void readNetlistBefore();
// Return true if successful.
2024-07-22 16:13:19 -07:00
bool linkDesign(const char *top_cell_name,
bool make_black_boxes);
2018-09-28 08:54:21 -07:00
2026-03-28 19:13:35 -07:00
bool readSdf(std::string_view filename,
std::string_view path,
Scene *scene,
bool unescaped_dividers,
bool incremental_only,
MinMaxAll *cond_use);
2018-09-28 08:54:21 -07:00
// SDC Swig API.
Instance *currentInstance() const;
void setCurrentInstance(Instance *inst);
2026-01-03 16:59:35 -08:00
virtual void setAnalysisType(AnalysisType analysis_type,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setOperatingConditions(OperatingConditions *op_cond,
2026-01-03 16:59:35 -08:00
const MinMaxAll *min_max,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setTimingDerate(TimingDerateType type,
2026-01-03 16:59:35 -08:00
PathClkOrData clk_data,
const RiseFallBoth *rf,
const EarlyLate *early_late,
float derate,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// Delay type is always net for net derating.
void setTimingDerate(const Net *net,
2026-01-03 16:59:35 -08:00
PathClkOrData clk_data,
const RiseFallBoth *rf,
const EarlyLate *early_late,
float derate,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setTimingDerate(const Instance *inst,
2026-01-03 16:59:35 -08:00
TimingDerateCellType type,
PathClkOrData clk_data,
const RiseFallBoth *rf,
const EarlyLate *early_late,
float derate,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setTimingDerate(const LibertyCell *cell,
2026-01-03 16:59:35 -08:00
TimingDerateCellType type,
PathClkOrData clk_data,
const RiseFallBoth *rf,
const EarlyLate *early_late,
float derate,
Sdc *sdc);
void unsetTimingDerate(Sdc *sdc);
2023-01-19 11:23:45 -07:00
void setInputSlew(const Port *port,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float slew,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// Set port external pin load (set_load -pin port).
2023-01-19 11:23:45 -07:00
void setPortExtPinCap(const Port *port,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float cap,
Sdc *sdc);
2023-01-19 11:23:45 -07:00
void portExtCaps(const Port *port,
const MinMax *min_max,
2026-01-03 16:59:35 -08:00
const Sdc *sdc,
float &pin_cap,
float &wire_cap,
int &fanout);
2018-09-28 08:54:21 -07:00
// Set port external wire load (set_load -wire port).
2023-01-19 11:23:45 -07:00
void setPortExtWireCap(const Port *port,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float cap,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// Set net wire capacitance (set_load -wire net).
2023-01-19 11:23:45 -07:00
void setNetWireCap(const Net *net,
2026-04-13 14:58:16 -07:00
bool subtract_pin_cap,
2026-01-03 16:59:35 -08:00
const MinMaxAll *min_max,
float cap,
Sdc *sdc);
2023-02-22 14:50:49 -07:00
// Remove all "set_load net" annotations.
2026-01-03 16:59:35 -08:00
void removeNetLoadCaps(Sdc *sdc) const;
2018-09-28 08:54:21 -07:00
// Set port external fanout (used by wireload models).
2023-01-19 11:23:45 -07:00
void setPortExtFanout(const Port *port,
2026-01-03 16:59:35 -08:00
int fanout,
const MinMaxAll *min_max,
Sdc *sdc);
// Liberty port capacitance.
float capacitance(const LibertyPort *port,
2026-01-03 16:59:35 -08:00
Scene *scene,
const MinMax *min_max);
2018-09-28 08:54:21 -07:00
// pin_cap = net pin capacitances + port external pin capacitance,
// wire_cap = annotated net capacitance + port external wire capacitance.
2023-01-19 11:23:45 -07:00
void connectedCap(const Pin *drvr_pin,
2026-01-03 16:59:35 -08:00
const RiseFall *rf,
const Scene *scene,
const MinMax *min_max,
float &pin_cap,
float &wire_cap) const;
2023-01-19 11:23:45 -07:00
void connectedCap(const Net *net,
2026-01-03 16:59:35 -08:00
Scene *scene,
const MinMax *min_max,
float &pin_cap,
float &wire_cap) const;
2023-01-19 11:23:45 -07:00
void setResistance(const Net *net,
2026-01-03 16:59:35 -08:00
const MinMaxAll *min_max,
float res,
Sdc *sdc);
2023-01-19 11:23:45 -07:00
void setDriveCell(const LibertyLibrary *library,
2026-01-03 16:59:35 -08:00
const LibertyCell *cell,
const Port *port,
const LibertyPort *from_port,
2026-04-15 09:38:10 -07:00
const DriveCellSlews &from_slews,
2026-01-03 16:59:35 -08:00
const LibertyPort *to_port,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
Sdc *sdc);
2023-01-19 11:23:45 -07:00
void setDriveResistance(const Port *port,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float res,
Sdc *sdc);
2023-01-19 11:23:45 -07:00
void setLatchBorrowLimit(const Pin *pin,
2026-01-03 16:59:35 -08:00
float limit,
Sdc *sdc);
2023-01-19 11:23:45 -07:00
void setLatchBorrowLimit(const Instance *inst,
2026-01-03 16:59:35 -08:00
float limit,
Sdc *sdc);
2023-01-19 11:23:45 -07:00
void setLatchBorrowLimit(const Clock *clk,
2026-01-03 16:59:35 -08:00
float limit,
Sdc *sdc);
2019-11-11 15:30:19 -07:00
void setMinPulseWidth(const RiseFallBoth *rf,
2026-01-03 16:59:35 -08:00
float min_width,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setMinPulseWidth(const Pin *pin,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
float min_width,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setMinPulseWidth(const Instance *inst,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
float min_width,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setMinPulseWidth(const Clock *clk,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
float min_width,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setWireload(Wireload *wireload,
2026-01-03 16:59:35 -08:00
const MinMaxAll *min_max,
Sdc *sdc);
void setWireloadMode(WireloadMode mode,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setWireloadSelection(WireloadSelection *selection,
2026-01-03 16:59:35 -08:00
const MinMaxAll *min_max,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setSlewLimit(Clock *clk,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
2026-04-13 14:58:16 -07:00
PathClkOrData clk_data,
2026-01-03 16:59:35 -08:00
const MinMax *min_max,
float slew,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setSlewLimit(Port *port,
2026-01-03 16:59:35 -08:00
const MinMax *min_max,
float slew,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setSlewLimit(Cell *cell,
2026-01-03 16:59:35 -08:00
const MinMax *min_max,
float slew,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setCapacitanceLimit(Cell *cell,
2026-01-03 16:59:35 -08:00
const MinMax *min_max,
float cap,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setCapacitanceLimit(Port *port,
2026-01-03 16:59:35 -08:00
const MinMax *min_max,
float cap,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setCapacitanceLimit(Pin *pin,
2026-01-03 16:59:35 -08:00
const MinMax *min_max,
float cap,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setFanoutLimit(Cell *cell,
2026-01-03 16:59:35 -08:00
const MinMax *min_max,
float fanout,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setFanoutLimit(Port *port,
2026-01-03 16:59:35 -08:00
const MinMax *min_max,
float fanout,
Sdc *sdc);
void setMaxArea(float area,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
2026-03-28 19:13:35 -07:00
void makeClock(std::string_view name,
2026-04-16 18:42:26 -07:00
const PinSet &pins,
2026-01-03 16:59:35 -08:00
bool add_to_pins,
float period,
2026-04-16 18:42:26 -07:00
const FloatSeq &waveform,
2026-03-28 19:13:35 -07:00
std::string_view comment,
2026-01-03 16:59:35 -08:00
const Mode *mode);
2018-09-28 08:54:21 -07:00
// edges size must be 3.
2026-03-28 19:13:35 -07:00
void makeGeneratedClock(std::string_view name,
2026-04-16 18:42:26 -07:00
const PinSet &pins,
2026-01-03 16:59:35 -08:00
bool add_to_pins,
Pin *src_pin,
Clock *master_clk,
int divide_by,
int multiply_by,
float duty_cycle,
bool invert,
bool combinational,
2026-04-16 18:42:26 -07:00
const IntSeq &edges,
const FloatSeq &edge_shifts,
2026-03-28 19:13:35 -07:00
std::string_view comment,
2026-01-03 16:59:35 -08:00
const Mode *mode);
void removeClock(Clock *clk,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// Update period/waveform for generated clocks from source pin clock.
void updateGeneratedClks();
// True if pin is defined as a clock source (pin may be hierarchical).
2026-01-03 16:59:35 -08:00
bool isClockSrc(const Pin *pin,
const Sdc *sdc) const;
2018-09-28 08:54:21 -07:00
// Propagated (non-ideal) clocks.
2026-01-03 16:59:35 -08:00
void setPropagatedClock(Clock *clk,
const Mode *mode);
void removePropagatedClock(Clock *clk,
const Mode *mode);
void setPropagatedClock(Pin *pin,
const Mode *mode);
void removePropagatedClock(Pin *pin,
const Mode *mode);
2026-04-13 14:58:16 -07:00
void setClockSlew(Clock *clk,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float slew,
Sdc *sdc);
void removeClockSlew(Clock *clk,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// Clock latency.
// Latency can be on a clk, pin, or clk/pin combination.
void setClockLatency(Clock *clk,
2026-01-03 16:59:35 -08:00
Pin *pin,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
float delay,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void removeClockLatency(const Clock *clk,
2026-01-03 16:59:35 -08:00
const Pin *pin,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// Clock insertion delay (source latency).
void setClockInsertion(const Clock *clk,
2026-01-03 16:59:35 -08:00
const Pin *pin,
const RiseFallBoth *rf,
const MinMaxAll *min_max,
const EarlyLateAll *early_late,
float delay,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void removeClockInsertion(const Clock *clk,
2026-01-03 16:59:35 -08:00
const Pin *pin,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// Clock uncertainty.
2026-01-03 16:59:35 -08:00
void setClockUncertainty(Clock *clk,
const SetupHoldAll *setup_hold,
float uncertainty);
void removeClockUncertainty(Clock *clk,
const SetupHoldAll *setup_hold);
void setClockUncertainty(Pin *pin,
const SetupHoldAll *setup_hold,
float uncertainty,
Sdc *sdc);
void removeClockUncertainty(Pin *pin,
const SetupHoldAll *setup_hold,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// Inter-clock uncertainty.
2026-01-03 16:59:35 -08:00
void setClockUncertainty(Clock *from_clk,
const RiseFallBoth *from_rf,
Clock *to_clk,
const RiseFallBoth *to_rf,
const SetupHoldAll *setup_hold,
float uncertainty,
Sdc *sdc);
void removeClockUncertainty(Clock *from_clk,
const RiseFallBoth *from_rf,
Clock *to_clk,
const RiseFallBoth *to_rf,
const SetupHoldAll *setup_hold,
Sdc *sdc);
2026-04-13 14:58:16 -07:00
ClockGroups *makeClockGroups(std::string_view name,
2026-01-03 16:59:35 -08:00
bool logically_exclusive,
bool physically_exclusive,
bool asynchronous,
bool allow_paths,
2026-04-13 14:58:16 -07:00
std::string_view comment,
2026-01-03 16:59:35 -08:00
Sdc *sdc);
2026-03-15 14:35:24 -07:00
void removeClockGroupsLogicallyExclusive(Sdc *sdc);
void removeClockGroupsLogicallyExclusive(const std::string &name,
2026-01-03 16:59:35 -08:00
Sdc *sdc);
2026-03-15 14:35:24 -07:00
void removeClockGroupsPhysicallyExclusive(Sdc *sdc);
void removeClockGroupsPhysicallyExclusive(const std::string &name,
2026-01-03 16:59:35 -08:00
Sdc *sdc);
2026-03-15 14:35:24 -07:00
void removeClockGroupsAsynchronous(Sdc *sdc);
void removeClockGroupsAsynchronous(const std::string &name,
2026-01-03 16:59:35 -08:00
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void makeClockGroup(ClockGroups *clk_groups,
2026-01-03 16:59:35 -08:00
ClockSet *clks,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setClockSense(PinSet *pins,
2026-01-03 16:59:35 -08:00
ClockSet *clks,
ClockSense sense,
Sdc *sdc);
2019-11-11 15:30:19 -07:00
void setClockGatingCheck(const RiseFallBoth *rf,
2026-01-03 16:59:35 -08:00
const SetupHold *setup_hold,
float margin,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setClockGatingCheck(Clock *clk,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const SetupHold *setup_hold,
float margin,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setClockGatingCheck(Instance *inst,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const SetupHold *setup_hold,
float margin,
LogicValue active_value,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setClockGatingCheck(Pin *pin,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const SetupHold *setup_hold,
float margin,
LogicValue active_value,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setDataCheck(Pin *from,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *from_rf,
Pin *to,
const RiseFallBoth *to_rf,
Clock *clk,
const SetupHoldAll *setup_hold,
float margin,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void removeDataCheck(Pin *from,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *from_rf,
Pin *to,
const RiseFallBoth *to_rf,
Clock *clk,
const SetupHoldAll *setup_hold,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// set_disable_timing cell [-from] [-to]
// Disable all edges thru cell if from/to are null.
// Bus and bundle ports are NOT supported.
void disable(LibertyCell *cell,
2026-01-03 16:59:35 -08:00
LibertyPort *from,
LibertyPort *to,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void removeDisable(LibertyCell *cell,
2026-01-03 16:59:35 -08:00
LibertyPort *from,
LibertyPort *to,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// set_disable_timing liberty port.
// Bus and bundle ports are NOT supported.
2026-01-03 16:59:35 -08:00
void disable(LibertyPort *port,
Sdc *sdc);
void removeDisable(LibertyPort *port,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// set_disable_timing port (top level instance port).
// Bus and bundle ports are NOT supported.
2026-01-03 16:59:35 -08:00
void disable(Port *port,
Sdc *sdc);
void removeDisable(Port *port,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// set_disable_timing instance [-from] [-to].
// Disable all edges thru instance if from/to are null.
// Bus and bundle ports are NOT supported.
// Hierarchical instances are NOT supported.
void disable(Instance *inst,
2026-01-03 16:59:35 -08:00
LibertyPort *from,
LibertyPort *to,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void removeDisable(Instance *inst,
2026-01-03 16:59:35 -08:00
LibertyPort *from,
LibertyPort *to,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// set_disable_timing pin
2026-01-03 16:59:35 -08:00
void disable(Pin *pin,
Sdc *sdc);
void removeDisable(Pin *pin,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// set_disable_timing [get_timing_arc -of_objects instance]]
2026-01-03 16:59:35 -08:00
void disable(Edge *edge,
Sdc *sdc);
void removeDisable(Edge *edge,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// set_disable_timing [get_timing_arc -of_objects lib_cell]]
2026-01-03 16:59:35 -08:00
void disable(TimingArcSet *arc_set,
Sdc *sdc);
void removeDisable(TimingArcSet *arc_set,
Sdc *sdc);
2026-01-15 16:30:52 -07:00
[[nodiscard]] bool isConstant(const Pin *pin,
const Mode *mode) const;
2018-09-28 08:54:21 -07:00
// Edge is disabled by constant.
2026-01-03 16:59:35 -08:00
[[nodiscard]] bool isDisabledConstant(Edge *edge,
const Mode *mode);
2018-09-28 08:54:21 -07:00
// Return a set of constant pins that disabled edge.
// Caller owns the returned set.
2026-01-03 16:59:35 -08:00
PinSet disabledConstantPins(Edge *edge,
const Mode *mode);
2018-09-28 08:54:21 -07:00
// Edge timing sense with propagated constants.
2026-01-03 16:59:35 -08:00
TimingSense simTimingSense(Edge *edge,
const Mode *mode);
2018-09-28 08:54:21 -07:00
// Edge is disabled by set_disable_timing constraint.
2026-01-03 16:59:35 -08:00
[[nodiscard]] bool isDisabledConstraint(Edge *edge,
const Sdc *sdc);
2018-09-28 08:54:21 -07:00
// Edge is disabled to break combinational loops.
2026-01-03 16:59:35 -08:00
[[nodiscard]] bool isDisabledLoop(Edge *edge) const;
2018-09-28 08:54:21 -07:00
// Edge is disabled bidirect net path.
2026-01-03 16:59:35 -08:00
[[nodiscard]] bool isDisabledBidirectNetPath(Edge *edge) const;
[[nodiscard]] bool isDisabledPresetClr(Edge *edge) const;
2018-09-28 08:54:21 -07:00
// Return a vector of graph edges that are disabled, sorted by
// from/to vertex names. Caller owns the returned vector.
2026-01-03 16:59:35 -08:00
EdgeSeq disabledEdges(const Mode *mode);
EdgeSeq disabledEdgesSorted(const Mode *mode);
void disableClockGatingCheck(Instance *inst,
Sdc *sdc);
void disableClockGatingCheck(Pin *pin,
Sdc *sdc);
void removeDisableClockGatingCheck(Instance *inst,
Sdc *sdc);
void removeDisableClockGatingCheck(Pin *pin,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void setLogicValue(Pin *pin,
2026-01-03 16:59:35 -08:00
LogicValue value,
Mode *mode);
2018-09-28 08:54:21 -07:00
void setCaseAnalysis(Pin *pin,
2026-01-03 16:59:35 -08:00
LogicValue value,
Mode *mode);
void removeCaseAnalysis(Pin *pin,
Mode *mode);
2023-04-06 11:12:06 -07:00
void setInputDelay(const Pin *pin,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const Clock *clk,
const RiseFall *clk_rf,
const Pin *ref_pin,
bool source_latency_included,
bool network_latency_included,
const MinMaxAll *min_max,
bool add,
float delay,
Sdc *sdc);
2023-04-06 11:12:06 -07:00
void removeInputDelay(const Pin *pin,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const Clock *clk,
const RiseFall *clk_rf,
const MinMaxAll *min_max,
Sdc *sdc);
2023-04-06 11:12:06 -07:00
void setOutputDelay(const Pin *pin,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const Clock *clk,
const RiseFall *clk_rf,
const Pin *ref_pin,
bool source_latency_included,
bool network_latency_included,
const MinMaxAll *min_max,
bool add,
float delay,
Sdc *sdc);
2023-04-06 11:12:06 -07:00
void removeOutputDelay(const Pin *pin,
2026-01-03 16:59:35 -08:00
const RiseFallBoth *rf,
const Clock *clk,
const RiseFall *clk_rf,
const MinMaxAll *min_max,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void makeFalsePath(ExceptionFrom *from,
2026-01-03 16:59:35 -08:00
ExceptionThruSeq *thrus,
ExceptionTo *to,
const MinMaxAll *min_max,
2026-03-28 19:13:35 -07:00
std::string_view comment,
2026-01-03 16:59:35 -08:00
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void makeMulticyclePath(ExceptionFrom *from,
2026-01-03 16:59:35 -08:00
ExceptionThruSeq *thrus,
ExceptionTo *to,
const MinMaxAll *min_max,
bool use_end_clk,
int path_multiplier,
2026-03-28 19:13:35 -07:00
std::string_view comment,
2026-01-03 16:59:35 -08:00
Sdc *sdc);
2018-09-28 08:54:21 -07:00
void makePathDelay(ExceptionFrom *from,
2026-01-03 16:59:35 -08:00
ExceptionThruSeq *thrus,
ExceptionTo *to,
const MinMax *min_max,
bool ignore_clk_latency,
2025-05-20 14:52:04 -07:00
bool break_path,
2026-01-03 16:59:35 -08:00
float delay,
2026-03-28 19:13:35 -07:00
std::string_view comment,
2026-01-03 16:59:35 -08:00
Sdc *sdc);
2026-03-28 19:13:35 -07:00
void makeGroupPath(std::string_view name,
2026-01-03 16:59:35 -08:00
bool is_default,
ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
2026-03-28 19:13:35 -07:00
std::string_view comment,
2026-01-03 16:59:35 -08:00
Sdc *sdc);
2025-10-25 10:02:34 -07:00
// Deprecated 10/24/2025
2026-03-28 19:13:35 -07:00
bool isGroupPathName(std::string_view group_name,
2026-01-03 16:59:35 -08:00
const Sdc *sdc) __attribute__ ((deprecated));
2026-03-28 19:13:35 -07:00
bool isPathGroupName(std::string_view group_name,
2026-01-03 16:59:35 -08:00
const Sdc *sdc) const;
2026-03-08 15:51:50 -07:00
StringSeq pathGroupNames(const Sdc *sdc) const;
2018-09-28 08:54:21 -07:00
void resetPath(ExceptionFrom *from,
2026-01-03 16:59:35 -08:00
ExceptionThruSeq *thrus,
ExceptionTo *to,
const MinMaxAll *min_max,
Sdc *sdc);
2018-09-28 08:54:21 -07:00
// Make an exception -from specification.
ExceptionFrom *makeExceptionFrom(PinSet *from_pins,
2026-01-03 16:59:35 -08:00
ClockSet *from_clks,
InstanceSet *from_insts,
const RiseFallBoth *from_rf,
const Sdc *sdc);
2018-09-28 08:54:21 -07:00
void checkExceptionFromPins(ExceptionFrom *from,
2026-03-28 19:13:35 -07:00
std::string_view filename,
2026-01-03 16:59:35 -08:00
int line,
const Sdc *sdc) const;
2018-09-28 08:54:21 -07:00
void deleteExceptionFrom(ExceptionFrom *from);
// Make an exception -through specification.
ExceptionThru *makeExceptionThru(PinSet *pins,
2026-01-03 16:59:35 -08:00
NetSet *nets,
InstanceSet *insts,
const RiseFallBoth *rf,
const Sdc *sdc);
2018-09-28 08:54:21 -07:00
void deleteExceptionThru(ExceptionThru *thru);
// Make an exception -to specification.
ExceptionTo *makeExceptionTo(PinSet *to_pins,
2026-01-03 16:59:35 -08:00
ClockSet *to_clks,
InstanceSet *to_insts,
const RiseFallBoth *rf,
const RiseFallBoth *end_rf,
const Sdc *sdc);
2018-09-28 08:54:21 -07:00
void checkExceptionToPins(ExceptionTo *to,
2026-01-03 16:59:35 -08:00
const char *file,
int line,
const Sdc *sdc) const;
2018-09-28 08:54:21 -07:00
void deleteExceptionTo(ExceptionTo *to);
2026-01-03 16:59:35 -08:00
2023-01-19 11:23:45 -07:00
InstanceSet findRegisterInstances(ClockSet *clks,
const RiseFallBoth *clk_rf,
2026-04-13 14:58:16 -07:00
bool registers,
2026-01-03 16:59:35 -08:00
bool latches,
const Mode *mode);
2023-01-19 11:23:45 -07:00
PinSet findRegisterDataPins(ClockSet *clks,
const RiseFallBoth *clk_rf,
bool registers,
2026-01-03 16:59:35 -08:00
bool latches,
const Mode *mode);
2023-01-19 11:23:45 -07:00
PinSet findRegisterClkPins(ClockSet *clks,
const RiseFallBoth *clk_rf,
bool registers,
2026-01-03 16:59:35 -08:00
bool latches,
const Mode *mode);
2023-01-19 11:23:45 -07:00
PinSet findRegisterAsyncPins(ClockSet *clks,
const RiseFallBoth *clk_rf,
bool registers,
2026-01-03 16:59:35 -08:00
bool latches,
const Mode *mode);
2023-01-19 11:23:45 -07:00
PinSet findRegisterOutputPins(ClockSet *clks,
const RiseFallBoth *clk_rf,
bool registers,
2026-01-03 16:59:35 -08:00
bool latches,
const Mode *mode);
2023-01-19 11:23:45 -07:00
PinSet findFaninPins(PinSeq *to,
bool flat,
bool startpoints_only,
int inst_levels,
int pin_levels,
bool thru_disabled,
2026-01-03 16:59:35 -08:00
bool thru_constants,
const Mode *mode);
2023-01-19 11:23:45 -07:00
InstanceSet
2018-09-28 08:54:21 -07:00
findFaninInstances(PinSeq *to,
2026-01-03 16:59:35 -08:00
bool flat,
bool startpoints_only,
int inst_levels,
int pin_levels,
bool thru_disabled,
bool thru_constants,
const Mode *mode);
2023-01-19 11:23:45 -07:00
PinSet
2018-09-28 08:54:21 -07:00
findFanoutPins(PinSeq *from,
2026-01-03 16:59:35 -08:00
bool flat,
bool endpoints_only,
int inst_levels,
int pin_levels,
bool thru_disabled,
bool thru_constants,
const Mode *mode);
2023-01-19 11:23:45 -07:00
InstanceSet
2018-09-28 08:54:21 -07:00
findFanoutInstances(PinSeq *from,
2026-01-03 16:59:35 -08:00
bool flat,
bool endpoints_only,
int inst_levels,
int pin_levels,
bool thru_disabled,
bool thru_constants,
const Mode *mode);
2018-09-28 08:54:21 -07:00
2023-04-09 22:22:39 -07:00
// The set of clocks that arrive at vertex in the clock network.
2026-01-03 16:59:35 -08:00
ClockSet clocks(const Pin *pin,
const Mode *mode);
2023-04-09 22:22:39 -07:00
// Clock domains for a pin.
2026-01-03 16:59:35 -08:00
ClockSet clockDomains(const Pin *pin,
const Mode *mode);
2018-09-28 08:54:21 -07:00
2026-01-03 16:59:35 -08:00
////////////////////////////////////////////////////////////////
2021-03-06 06:44:12 -07:00
// net=null check all nets
2026-01-03 16:59:35 -08:00
void reportSlewChecks(const Net *net,
size_t max_count,
bool violators,
bool verbose,
const SceneSeq &scenes,
const MinMax *min_max);
void checkSlewsPreamble();
// requires checkSlewsPreamble()
2020-06-08 20:37:46 -07:00
void checkSlew(const Pin *pin,
2026-01-03 16:59:35 -08:00
const SceneSeq &scenes,
const MinMax *min_max,
bool check_clks,
// Return values.
Slew &slew,
float &limit,
float &slack,
const RiseFall *&rf,
const Scene *&Scene);
void maxSlewCheck(// Return values.
2023-01-19 11:23:45 -07:00
const Pin *&pin,
Slew &slew,
float &slack,
float &limit);
2022-04-13 19:35:12 -07:00
void findSlewLimit(const LibertyPort *port,
2026-01-03 16:59:35 -08:00
const Scene *scene,
2022-04-13 19:11:49 -07:00
const MinMax *min_max,
// Return values.
float &limit,
bool &exists);
2026-01-03 16:59:35 -08:00
size_t maxSlewViolationCount();
2020-06-02 11:08:48 -07:00
2026-01-03 16:59:35 -08:00
////////////////////////////////////////////////////////////////
// net == nullptr to check all.
void reportFanoutChecks(const Net *net,
size_t max_count,
bool violators,
bool verbose,
const SceneSeq &scenes,
const MinMax *min_max);
void checkFanoutPreamble();
// requires checkFanoutPreamble()
void checkFanout(const Pin *pin,
2026-01-03 16:59:35 -08:00
const Mode *mode,
const MinMax *min_max,
// Return values.
float &fanout,
float &limit,
float &slack);
// Return the pin etc with max fanout check min slack.
void maxFanoutMinSlackPin(const ModeSeq &modes,
// Return values.
const Pin *&pin,
float &fanout,
float &limit,
float &slack,
const Mode *&mode);
size_t fanoutViolationCount(const MinMax *min_max,
const ModeSeq &modes);
////////////////////////////////////////////////////////////////
2021-03-07 10:21:53 -07:00
// net=null check all nets
2026-01-03 16:59:35 -08:00
void reportCapacitanceChecks(const Net *net,
size_t max_count,
bool violators,
bool verbose,
const SceneSeq &scenes,
const MinMax *min_max);
size_t maxCapacitanceViolationCount();
void checkCapacitancesPreamble(const SceneSeq &scenes);
2020-06-12 14:51:46 -07:00
// requires checkCapacitanceLimitPreamble()
2020-06-09 09:43:59 -07:00
void checkCapacitance(const Pin *pin,
2026-01-03 16:59:35 -08:00
const SceneSeq &scenes,
const MinMax *min_max,
// Return values.
float &capacitance,
float &limit,
float &slack,
const RiseFall *&rf,
const Scene *&scene);
void maxCapacitanceCheck(// Return values.
2023-01-19 11:23:45 -07:00
const Pin *&pin,
float &capacitance,
float &slack,
float &limit);
2020-06-02 11:08:48 -07:00
2026-01-03 16:59:35 -08:00
////////////////////////////////////////////////////////////////
void reportMinPulseWidthChecks(const Net *net,
size_t max_count,
bool violators,
bool verbose,
const SceneSeq &scenes);
////////////////////////////////////////////////////////////////
void reportMinPeriodChecks(const Net *net,
size_t max_count,
bool violators,
bool verbose,
const SceneSeq &scenes);
2018-09-28 08:54:21 -07:00
2026-01-03 16:59:35 -08:00
////////////////////////////////////////////////////////////////
void reportMaxSkewChecks(const Net *net,
size_t max_count,
bool violators,
bool verbose,
const SceneSeq &scenes);
2018-11-26 09:15:52 -08:00
2018-09-28 08:54:21 -07:00
////////////////////////////////////////////////////////////////
// User visible but non SDC commands.
// Clear all state except network, scenes and liberty libraries.
2026-01-29 16:35:54 -07:00
void clear();
// Clear all state except network, scenes liberty libraries, and sdc.
void clearNonSdc();
2018-09-28 08:54:21 -07:00
// Namespace used by command interpreter.
CmdNamespace cmdNamespace();
void setCmdNamespace(CmdNamespace namespc);
2026-01-03 16:59:35 -08:00
OperatingConditions *operatingConditions(const MinMax *min_max,
const Sdc *sdc) const;
2018-09-28 08:54:21 -07:00
// Set the delay on a timing arc.
// Required/arrival times are incrementally updated.
void setArcDelay(Edge *edge,
2026-01-03 16:59:35 -08:00
TimingArc *arc,
const Scene *scene,
const MinMaxAll *min_max,
ArcDelay delay);
2018-09-28 08:54:21 -07:00
// Set annotated slew on a vertex for delay calculation.
void setAnnotatedSlew(Vertex *vertex,
2026-01-03 16:59:35 -08:00
const Scene *scene,
const MinMaxAll *min_max,
const RiseFallBoth *rf,
float slew);
2026-05-27 10:50:44 -07:00
void unsetAnnotatedSlew(Vertex *vertex,
const Scene *scene,
const MinMaxAll *min_max,
const RiseFallBoth *rf);
2026-03-28 19:13:35 -07:00
void writeSdf(std::string_view filename,
2026-01-03 16:59:35 -08:00
const Scene *scene,
char divider,
2021-11-08 16:49:43 -07:00
bool include_typ,
2026-01-03 16:59:35 -08:00
int digits,
bool gzip,
bool no_timestamp,
bool no_version);
2018-09-28 08:54:21 -07:00
// Remove all delay and slew annotations.
void removeDelaySlewAnnotations();
2026-01-03 16:59:35 -08:00
// Instance specific process/voltage/temperature.
// Defaults to operating condition if instance is not annotated.
const Pvt *pvt(Instance *inst,
const MinMax *min_max,
Sdc *sdc);
void setPvt(Instance *inst,
const MinMaxAll *min_max,
float process,
float voltage,
float temperature,
Sdc *sdc);
// Pvt may be shared among multiple instances.
void setPvt(const Instance *inst,
const MinMaxAll *min_max,
const Pvt &pvt,
Sdc *sdc);
void setVoltage(const MinMax *min_max,
float voltage,
Sdc *sdc);
void setVoltage(const Net *net,
const MinMax *min_max,
float voltage,
Sdc *sdc);
2025-04-09 16:35:15 -07:00
2026-01-03 16:59:35 -08:00
CheckErrorSeq &checkTiming(const Mode *mode,
bool no_input_delay,
bool no_output_delay,
bool reg_multiple_clks,
bool reg_no_clks,
bool unconstrained_endpoints,
bool loops,
bool generated_clks);
2018-09-28 08:54:21 -07:00
// Path from/thrus/to filter.
// from/thrus/to are owned and deleted by Search.
2023-01-20 11:19:39 -07:00
// PathEnds in the returned PathEndSeq are owned by Search PathGroups
// and deleted on next call.
2026-01-03 16:59:35 -08:00
PathEndSeq findPathEnds(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to,
bool unconstrained,
const SceneSeq &scenes,
// max for setup checks.
// min for hold checks.
// min_max for setup and hold checks.
const MinMaxAll *min_max,
// Number of path ends to report in
// each group.
int group_path_count,
// Number of paths to report for
// each endpoint.
int endpoint_path_count,
// endpoint_path_count paths report unique pins
// without rise/fall variations.
bool unique_pins,
// endpoint_path_count paths report paths with
// unique pins and rise/fall edges.
bool unique_edges,
// Min/max bounds for slack of
// returned path ends.
float slack_min,
float slack_max,
// Sort path ends by slack ignoring path groups.
bool sort_by_slack,
// Path groups to report.
// Empty list reports all groups.
2026-03-08 15:51:50 -07:00
StringSeq &group_names,
2026-01-03 16:59:35 -08:00
// Predicates to filter the type of path
// ends returned.
bool setup,
bool hold,
bool recovery,
bool removal,
bool clk_gating_setup,
bool clk_gating_hold);
2018-09-28 08:54:21 -07:00
void setReportPathFormat(ReportPathFormat format);
2026-03-08 15:51:50 -07:00
void setReportPathFieldOrder(const StringSeq &field_names);
2026-05-12 11:24:24 -07:00
void setReportPathFields(const StringSeq &fields);
2026-03-28 19:13:35 -07:00
ReportField *findReportPathField(std::string_view name);
2026-05-12 11:24:24 -07:00
ReportField *findReportPathFieldAbrev(std::string_view name);
void makeReportPathField(std::string_view name,
std::string_view name_abrev,
std::string_view title,
size_t width,
bool left_justify,
Unit *unit,
const ReportFieldGetValue &get_value);
2018-09-28 08:54:21 -07:00
void setReportPathDigits(int digits);
void setReportPathNoSplit(bool no_split);
2018-12-20 22:41:54 -08:00
void reportPathEnd(PathEnd *end);
void reportPathEnds(PathEndSeq *ends);
2018-09-28 08:54:21 -07:00
ReportPath *reportPath() { return report_path_; }
2025-02-01 14:53:28 -08:00
void reportPath(const Path *path);
2023-10-04 14:33:09 -07:00
// Report clk skews for clks.
void reportClkSkew(ConstClockSeq &clks,
2026-01-03 16:59:35 -08:00
const SceneSeq &scenes,
const SetupHold *setup_hold,
2024-05-09 18:06:44 -07:00
bool include_internal_latency,
2026-01-03 16:59:35 -08:00
int digits);
2026-03-13 14:06:35 -07:00
Delay findWorstClkSkew(const SetupHold *setup_hold,
2024-05-09 18:06:44 -07:00
bool include_internal_latency);
2024-02-27 10:00:48 -07:00
void reportClkLatency(ConstClockSeq &clks,
2026-01-03 16:59:35 -08:00
const SceneSeq &scenes,
bool include_internal_latency,
2024-02-27 10:00:48 -07:00
int digits);
2023-10-04 14:33:09 -07:00
// Find min/max/rise/fall delays for clk.
ClkDelays findClkDelays(const Clock *clk,
2026-01-03 16:59:35 -08:00
const Scene *scene,
bool include_internal_latency);
2023-10-04 14:33:09 -07:00
2018-09-28 08:54:21 -07:00
// Update arrival times for all pins.
// If necessary updateTiming propagates arrivals around latch
// loops until the arrivals converge.
// If full=false update arrivals incrementally.
// If full=true update all arrivals from scratch.
2021-11-06 20:02:22 -07:00
// NOTE WELL: There is rarely any reason to call updateTiming directly because
// arrival/required/slack functions implicitly update timing incrementally.
2021-11-06 20:02:22 -07:00
// If you are calling this function you are either very confused or there is
// bug that should be reported.
2018-09-28 08:54:21 -07:00
void updateTiming(bool full);
2019-11-30 10:27:41 -08:00
// Invalidate all delay calculations. Arrivals also invalidated.
2024-06-27 13:57:58 -07:00
void delaysInvalid() const;
2018-09-28 08:54:21 -07:00
// Invalidate all arrival and required times.
void arrivalsInvalid();
2024-01-29 12:26:27 -07:00
PinSet startpointPins();
PinSet endpointPins();
2026-01-03 16:59:35 -08:00
VertexSet &endpoints();
2022-12-13 16:12:46 -10:00
int endpointViolationCount(const MinMax *min_max);
2018-09-28 08:54:21 -07:00
// Find all required times after updateTiming().
void findRequireds();
2026-06-16 12:00:17 -07:00
void findRequired(Vertex *vertex);
2025-05-22 09:25:56 -07:00
std::string reportDelayCalc(Edge *edge,
TimingArc *arc,
2026-01-03 16:59:35 -08:00
const Scene *scene,
2025-05-22 09:25:56 -07:00
const MinMax *min_max,
int digits);
2026-05-01 10:32:20 -07:00
void writeSdc(std::string_view filename,
std::string_view mode_name,
bool leaf,
bool native,
int digits,
bool gzip,
bool no_timestamp);
2026-01-03 16:59:35 -08:00
void writeSdc(const Sdc *sdc,
2026-03-28 19:13:35 -07:00
std::string_view filename,
2026-01-03 16:59:35 -08:00
// Map hierarchical pins and instances to leaf pins and instances.
bool leaf,
// Replace non-sdc get functions with OpenSTA equivalents.
bool native,
int digits,
2021-11-15 07:31:29 -07:00
bool gzip,
2026-01-03 16:59:35 -08:00
bool no_timestamp);
2018-09-28 08:54:21 -07:00
// The sum of all negative endpoints slacks.
// Incrementally updated.
Slack totalNegativeSlack(const MinMax *min_max);
2026-01-03 16:59:35 -08:00
Slack totalNegativeSlack(const Scene *scene,
const MinMax *min_max);
2018-12-05 14:18:41 -08:00
// Worst endpoint slack and vertex.
2018-09-28 08:54:21 -07:00
// Incrementally updated.
2022-05-31 21:56:11 -07:00
Slack worstSlack(const MinMax *min_max);
2018-12-05 14:18:41 -08:00
void worstSlack(const MinMax *min_max,
2026-01-03 16:59:35 -08:00
// Return values.
Slack &worst_slack,
Vertex *&worst_vertex);
void worstSlack(const Scene *scene,
const MinMax *min_max,
// Return values.
Slack &worst_slack,
Vertex *&worst_vertex);
2025-03-26 18:21:03 -07:00
Path *vertexWorstArrivalPath(Vertex *vertex,
2021-03-27 17:46:35 -07:00
const RiseFall *rf,
const MinMax *min_max);
2025-03-26 18:21:03 -07:00
Path *vertexWorstArrivalPath(Vertex *vertex,
const MinMax *min_max);
Path *vertexWorstRequiredPath(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max);
Path *vertexWorstRequiredPath(Vertex *vertex,
const MinMax *min_max);
Path *vertexWorstSlackPath(Vertex *vertex,
const MinMax *min_max);
Path *vertexWorstSlackPath(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max);
2018-09-28 08:54:21 -07:00
2021-10-04 17:49:19 -07:00
// Find the min clock period for rise/rise and fall/fall paths of a clock
// using the slack. This does NOT correctly predict min period when there
// are paths between different clocks.
float findClkMinPeriod(const Clock *clk,
bool include_port_paths);
2018-09-28 08:54:21 -07:00
// The following arrival/required/slack functions incrementally
// update timing to the level of the vertex. They do NOT do multiple
// passes required propagate arrivals around latch loops.
// See Sta::updateTiming() to propagate arrivals around latch loops.
2026-01-03 16:59:35 -08:00
Arrival arrival(const Pin *pin,
const RiseFallBoth *rf,
const MinMax *min_max);
Arrival arrival(Vertex *vertex,
const RiseFallBoth *rf,
const SceneSeq &scenes,
const MinMax *min_max);
Required required(Vertex *vertex,
const RiseFallBoth *rf,
const SceneSeq &scenes,
const MinMax *min_max);
Slack slack(const Net *net,
const MinMax *min_max);
Slack slack(const Pin *pin,
const RiseFallBoth *rf,
const SceneSeq &scenes,
const MinMax *min_max);
Slack slack(Vertex *vertex,
const MinMax *min_max);
Slack slack(Vertex *vertex,
const RiseFall *rf,
const MinMax *min_max);
Slack slack(Vertex *vertex,
const RiseFallBoth *rf,
const SceneSeq &scenes,
const MinMax *min_max);
void slacks(Vertex *vertex,
Slack (&slacks)[RiseFall::index_count][MinMax::index_count]);
2025-10-25 10:02:34 -07:00
// Worst slack for an endpoint in a path group.
Slack endpointSlack(const Pin *pin,
2026-03-28 19:13:35 -07:00
std::string_view path_group_name,
2026-01-03 16:59:35 -08:00
const MinMax *min_max);
void reportArrivalWrtClks(const Pin *pin,
const Scene *scene,
2026-03-13 14:06:35 -07:00
bool report_variance,
2026-01-03 16:59:35 -08:00
int digits);
void reportRequiredWrtClks(const Pin *pin,
const Scene *scene,
2026-03-13 14:06:35 -07:00
bool report_variance,
2026-01-03 16:59:35 -08:00
int digits);
void reportSlackWrtClks(const Pin *pin,
const Scene *scene,
2026-03-13 14:06:35 -07:00
bool report_variance,
2026-01-03 16:59:35 -08:00
int digits);
Slew slew(Vertex *vertex,
const RiseFallBoth *rf,
const SceneSeq &scenes,
const MinMax *min_max);
2026-04-13 14:58:16 -07:00
ArcDelay arcDelay(Edge *edge,
TimingArc *arc,
DcalcAPIndex ap_index);
2018-09-28 08:54:21 -07:00
// True if the timing arc has been back-annotated.
bool arcDelayAnnotated(Edge *edge,
2026-01-03 16:59:35 -08:00
TimingArc *arc,
const Scene *scene,
const MinMax *min_max);
2018-09-28 08:54:21 -07:00
// Set/unset the back-annotation flag for a timing arc.
void setArcDelayAnnotated(Edge *edge,
2026-01-03 16:59:35 -08:00
TimingArc *arc,
const Scene *scene,
const MinMax *min_max,
bool annotated);
2018-09-28 08:54:21 -07:00
// Make sure levels are up to date and return vertex level.
Level vertexLevel(Vertex *vertex);
2025-04-17 16:53:55 -07:00
GraphLoopSeq &graphLoops();
2018-09-28 08:54:21 -07:00
TagIndex tagCount() const;
TagGroupIndex tagGroupCount() const;
int clkInfoCount() const;
2025-03-26 18:21:03 -07:00
int pathCount() const;
int vertexPathCount(Vertex *vertex) const;
Vertex *maxPathCountVertex() const;
2018-09-28 08:54:21 -07:00
// Propagate liberty constant functions and pins tied high/low through
2026-01-03 16:59:35 -08:00
// combinational logic and registers. This is mode/sdc independent.
// Used by OpenROAD/Restructure.cpp
void findLogicConstants();
2026-01-03 16:59:35 -08:00
LogicValue simLogicValue(const Pin *pin,
const Mode *mode);
// Clear propagated sim constants.
2021-06-21 18:35:34 -07:00
void clearLogicConstants();
2024-01-22 11:17:08 -07:00
// Instances sorted by max driver pin slew.
InstanceSeq slowDrivers(int count);
2018-09-28 08:54:21 -07:00
2026-04-13 14:58:16 -07:00
Parasitics *makeConcreteParasitics(std::string_view name,
std::string_view filename);
2018-09-28 08:54:21 -07:00
// Annotate hierarchical "instance" with parasitics.
// The parasitic analysis point is ap_name.
// The parasitic memory footprint is much smaller if parasitic
// networks (dspf) are reduced and deleted after reading each net
// with reduce_to and delete_after_reduce.
// Return true if successful.
2026-03-28 19:13:35 -07:00
bool readSpef(std::string_view name,
std::string_view filename,
2026-01-03 16:59:35 -08:00
Instance *instance,
Scene *scene,
2021-05-15 16:55:10 -07:00
const MinMaxAll *min_max,
2026-01-03 16:59:35 -08:00
bool pin_cap_included,
bool keep_coupling_caps,
float coupling_cap_factor,
bool reduce);
Parasitics *findParasitics(const std::string &name);
void reportParasiticAnnotation(const std::string &spef_name,
bool report_unannotated);
2018-09-28 08:54:21 -07:00
// Parasitics.
void findPiElmore(Pin *drvr_pin,
2026-01-03 16:59:35 -08:00
const RiseFall *rf,
const MinMax *min_max,
float &c2,
float &rpi,
float &c1,
bool &exists) const;
2018-09-28 08:54:21 -07:00
void findElmore(Pin *drvr_pin,
2026-01-03 16:59:35 -08:00
Pin *load_pin,
const RiseFall *rf,
const MinMax *min_max,
float &elmore,
bool &exists) const;
2018-09-28 08:54:21 -07:00
void makePiElmore(Pin *drvr_pin,
2026-01-03 16:59:35 -08:00
const RiseFall *rf,
const MinMaxAll *min_max,
float c2,
float rpi,
float c1);
2018-09-28 08:54:21 -07:00
void setElmore(Pin *drvr_pin,
2026-01-03 16:59:35 -08:00
Pin *load_pin,
const RiseFall *rf,
const MinMaxAll *min_max,
float elmore);
2020-08-16 18:18:42 -07:00
void deleteParasitics();
2021-03-14 14:16:13 -07:00
Parasitic *makeParasiticNetwork(const Net *net,
bool includes_pin_caps,
2026-01-03 16:59:35 -08:00
const Scene *scene,
const MinMax *min_max);
2018-09-28 08:54:21 -07:00
2025-04-09 16:35:15 -07:00
////////////////////////////////////////////////////////////////
2018-09-28 08:54:21 -07:00
// TCL network edit function support.
2025-04-09 16:35:15 -07:00
2018-09-28 08:54:21 -07:00
virtual Instance *makeInstance(const char *name,
2026-01-03 16:59:35 -08:00
LibertyCell *cell,
Instance *parent);
2018-09-28 08:54:21 -07:00
virtual void deleteInstance(Instance *inst);
// replace_cell
virtual void replaceCell(Instance *inst,
2026-01-03 16:59:35 -08:00
Cell *to_cell);
2019-06-14 12:05:34 -07:00
virtual void replaceCell(Instance *inst,
2026-01-03 16:59:35 -08:00
LibertyCell *to_lib_cell);
2018-09-28 08:54:21 -07:00
virtual Net *makeNet(const char *name,
2026-01-03 16:59:35 -08:00
Instance *parent);
2018-09-28 08:54:21 -07:00
virtual void deleteNet(Net *net);
// connect_net
virtual void connectPin(Instance *inst,
2026-01-03 16:59:35 -08:00
Port *port,
Net *net);
2019-05-03 08:07:00 -07:00
virtual void connectPin(Instance *inst,
2026-01-03 16:59:35 -08:00
LibertyPort *port,
Net *net);
2018-09-28 08:54:21 -07:00
// disconnect_net
virtual void disconnectPin(Pin *pin);
2023-06-28 10:01:39 -07:00
virtual void makePortPin(const char *port_name,
PortDirection *dir);
2026-01-28 11:56:40 -07:00
// Notify STA that the network has changed without using the network
// editing API. For example, reading a netlist without using the
// builtin network readers.
2020-05-06 14:12:55 -07:00
void networkChanged();
2026-01-29 16:35:54 -07:00
// Network changed but all SDC references to instance/net/pin/port are preserved.
void networkChangedNonSdc();
2023-01-19 11:23:45 -07:00
void deleteLeafInstanceBefore(const Instance *inst);
void deleteInstancePinsBefore(const Instance *inst);
2018-09-28 08:54:21 -07:00
// Network edit before/after methods.
2023-01-19 11:23:45 -07:00
void makeInstanceAfter(const Instance *inst);
2018-09-28 08:54:21 -07:00
// Replace the instance cell with to_cell.
// equivCells(from_cell, to_cell) must be true.
2023-01-19 11:23:45 -07:00
virtual void replaceEquivCellBefore(const Instance *inst,
2026-01-03 16:59:35 -08:00
const LibertyCell *to_cell);
2023-01-19 11:23:45 -07:00
virtual void replaceEquivCellAfter(const Instance *inst);
2018-09-28 08:54:21 -07:00
// Replace the instance cell with to_cell.
// equivCellPorts(from_cell, to_cell) must be true.
2023-01-19 11:23:45 -07:00
virtual void replaceCellBefore(const Instance *inst,
2026-01-03 16:59:35 -08:00
const LibertyCell *to_cell);
2023-01-19 11:23:45 -07:00
virtual void replaceCellAfter(const Instance *inst);
2023-06-28 10:01:39 -07:00
virtual void makePortPinAfter(Pin *pin);
2023-01-19 11:23:45 -07:00
virtual void connectPinAfter(const Pin *pin);
virtual void disconnectPinBefore(const Pin *pin);
virtual void deleteNetBefore(const Net *net);
virtual void deleteInstanceBefore(const Instance *inst);
virtual void deletePinBefore(const Pin *pin);
2018-09-28 08:54:21 -07:00
////////////////////////////////////////////////////////////////
2026-01-03 16:59:35 -08:00
void ensureClkNetwork(const Mode *mode);
void clkPinsInvalid(const Mode *mode);
2020-08-10 18:31:20 -07:00
// The following functions assume ensureClkNetwork() has been called.
2026-01-03 16:59:35 -08:00
bool isClock(const Pin *pin,
2026-03-02 16:26:14 -08:00
const Mode *mode);
2026-01-03 16:59:35 -08:00
bool isClock(const Net *net,
2026-03-02 16:26:14 -08:00
const Mode *mode);
2026-01-03 16:59:35 -08:00
bool isIdealClock(const Pin *pin,
2026-03-02 16:26:14 -08:00
const Mode *mode);
2026-01-03 16:59:35 -08:00
bool isPropagatedClock(const Pin *pin,
2026-03-02 16:26:14 -08:00
const Mode *mode);
2026-01-03 16:59:35 -08:00
const PinSet *pins(const Clock *clk,
const Mode *mode);
2020-06-25 07:35:07 -07:00
2020-08-08 18:44:19 -07:00
////////////////////////////////////////////////////////////////
2020-06-25 07:35:07 -07:00
2018-09-28 08:54:21 -07:00
void setTclInterp(Tcl_Interp *interp);
Tcl_Interp *tclInterp();
2024-12-31 15:49:51 -08:00
// Ensure a network has been read, and linked.
Network *ensureLinked();
2024-12-31 15:49:51 -08:00
// Ensure a network has been read, linked and liberty libraries exist.
Network *ensureLibLinked();
2019-11-03 09:48:22 -08:00
void ensureLevelized();
2026-05-13 12:59:35 -04:00
// Replace the Levelize observer. Takes ownership; deletes any prior
// observer. Subclass StaLevelizeObserver to extend the default behavior
// (Search + GraphDelayCalc forwarding) without re-implementing it.
void setLevelizeObserver(LevelizeObserver *observer);
2018-09-28 08:54:21 -07:00
// Ensure that the timing graph has been built.
Graph *ensureGraph();
2019-11-03 09:48:22 -08:00
void ensureClkArrivals();
2026-01-03 16:59:35 -08:00
2018-09-28 08:54:21 -07:00
// Find all arc delays and vertex slews with delay calculator.
virtual void findDelays();
// Find arc delays and vertex slews thru to level of to_vertex.
virtual void findDelays(Vertex *to_vertex);
// Find arc delays and vertex slews thru to level.
virtual void findDelays(Level level);
// Percentage (0.0:1.0) change in delay that causes downstream
// delays to be recomputed during incremental delay calculation.
// Defaults to 0.0 for maximum accuracy and slowest incremental speed.
void setIncrementalDelayTolerance(float tol);
// Make graph and find delays.
void searchPreamble();
// Define the delay calculator implementation.
2026-03-28 19:13:35 -07:00
void setArcDelayCalc(std::string_view delay_calc_name);
2018-09-28 08:54:21 -07:00
void setDebugLevel(const char *what,
2026-01-03 16:59:35 -08:00
int level);
2018-09-28 08:54:21 -07:00
// Delays and arrivals downsteam from inst are invalid.
2023-01-19 11:23:45 -07:00
void delaysInvalidFrom(const Instance *inst);
2018-09-28 08:54:21 -07:00
// Delays and arrivals downsteam from pin are invalid.
2023-01-19 11:23:45 -07:00
void delaysInvalidFrom(const Pin *pin);
2018-09-28 08:54:21 -07:00
void delaysInvalidFrom(Vertex *vertex);
// Delays to driving pins of net (fanin) are invalid.
// Arrivals downsteam from net are invalid.
2023-01-19 11:23:45 -07:00
void delaysInvalidFromFanin(const Net *net);
void delaysInvalidFromFanin(const Pin *pin);
2018-09-28 08:54:21 -07:00
void delaysInvalidFromFanin(Vertex *vertex);
2023-01-19 11:23:45 -07:00
void replaceCellPinInvalidate(const LibertyPort *from_port,
2026-01-03 16:59:35 -08:00
Vertex *vertex,
const LibertyCell *to_cell);
2018-09-28 08:54:21 -07:00
2018-11-26 09:15:52 -08:00
// Power API.
2026-01-03 16:59:35 -08:00
void reportPowerDesign(const Scene *scene,
int digits);
void reportPowerInsts(const InstanceSeq &insts,
const Scene *scene,
int digits);
void reportPowerHighestInsts(size_t count,
const Scene *scene,
int digits);
void reportPowerDesignJson(const Scene *scene,
int digits);
void reportPowerInstsJson(const InstanceSeq &insts,
const Scene *scene,
int digits);
2018-11-26 09:15:52 -08:00
Power *power() { return power_; }
const Power *power() const { return power_; }
2026-01-03 16:59:35 -08:00
void power(const Scene *scene,
// Return values.
PowerResult &total,
PowerResult &sequential,
PowerResult &combinational,
PowerResult &clock,
PowerResult &macro,
PowerResult &pad);
2023-01-19 11:23:45 -07:00
PowerResult power(const Instance *inst,
2026-01-03 16:59:35 -08:00
const Scene *scene);
PwrActivity activity(const Pin *pin,
const Scene *scene);
2018-11-26 09:15:52 -08:00
2026-03-28 19:13:35 -07:00
void writeTimingModel(std::string_view lib_name,
std::string_view cell_name,
std::string_view filename,
2026-01-03 16:59:35 -08:00
const Scene *scene);
2022-06-08 08:29:53 -07:00
2019-06-20 21:41:49 -07:00
// Find equivalent cells in equiv_libs.
// Optionally add mappings for cells in map_libs.
void makeEquivCells(LibertyLibrarySeq *equiv_libs,
2026-01-03 16:59:35 -08:00
LibertyLibrarySeq *map_libs);
2019-06-20 21:41:49 -07:00
LibertyCellSeq *equivCells(LibertyCell *cell);
2026-03-08 13:50:22 -07:00
void writePathSpice(const Path *path,
2026-03-28 19:13:35 -07:00
std::string_view spice_filename,
std::string_view subckt_filename,
std::string_view lib_subckt_filename,
std::string_view model_filename,
std::string_view power_name,
std::string_view gnd_name,
CircuitSim ckt_sim);
2025-04-09 16:35:15 -07:00
////////////////////////////////////////////////////////////////
// TCL Variables
// TCL variable sta_crpr_enabled.
// Common Reconvergent Clock Removal (CRPR).
// Timing check source/target common clock path overlap for search
// with analysis mode on_chip_variation.
bool crprEnabled() const;
void setCrprEnabled(bool enabled);
// TCL variable sta_crpr_mode.
CrprMode crprMode() const;
void setCrprMode(CrprMode mode);
2026-03-13 14:06:35 -07:00
// TCL variable sta_pocv_mode.
2025-04-09 16:35:15 -07:00
// Parametric on chip variation (statisical sta).
2026-03-13 14:06:35 -07:00
PocvMode pocvMode() const;
void setPocvMode(PocvMode mode);
2025-04-09 16:35:15 -07:00
// Number of std deviations from mean to use for normal distributions.
2026-03-13 14:06:35 -07:00
float pocvQuantile();
void setPocvQuantile(float quantile);
2025-04-09 16:35:15 -07:00
// TCL variable sta_propagate_gated_clock_enable.
// Propagate gated clock enable arrivals.
bool propagateGatedClockEnable() const;
void setPropagateGatedClockEnable(bool enable);
// TCL variable sta_preset_clear_arcs_enabled.
// Enable search through preset/clear arcs.
bool presetClrArcsEnabled() const;
void setPresetClrArcsEnabled(bool enable);
// TCL variable sta_cond_default_arcs_enabled.
// Enable/disable default arcs when conditional arcs exist.
bool condDefaultArcsEnabled() const;
void setCondDefaultArcsEnabled(bool enabled);
// TCL variable sta_internal_bidirect_instance_paths_enabled.
// Enable/disable timing from bidirect pins back into the instance.
bool bidirectInstPathsEnabled() const;
void setBidirectInstPathsEnabled(bool enabled);
// TCL variable sta_recovery_removal_checks_enabled.
bool recoveryRemovalChecksEnabled() const;
void setRecoveryRemovalChecksEnabled(bool enabled);
// TCL variable sta_gated_clock_checks_enabled.
bool gatedClkChecksEnabled() const;
void setGatedClkChecksEnabled(bool enabled);
// TCL variable sta_dynamic_loop_breaking.
bool dynamicLoopBreaking() const;
void setDynamicLoopBreaking(bool enable);
// TCL variable sta_propagate_all_clocks.
// Clocks defined after sta_propagate_all_clocks is true
// are propagated (existing clocks are not effected).
bool propagateAllClocks() const;
void setPropagateAllClocks(bool prop);
// TCL var sta_clock_through_tristate_enabled.
bool clkThruTristateEnabled() const;
void setClkThruTristateEnabled(bool enable);
// TCL variable sta_input_port_default_clock.
bool useDefaultArrivalClock() const;
void setUseDefaultArrivalClock(bool enable);
////////////////////////////////////////////////////////////////
2025-05-26 15:33:51 -07:00
Properties &properties() { return properties_; }
2018-09-28 08:54:21 -07:00
protected:
// Default constructors that are called by makeComponents in the Sta
// constructor. These can be redefined by a derived class to
// specialize the sta components.
2025-04-09 16:35:15 -07:00
virtual void makeVariables();
2018-09-28 08:54:21 -07:00
virtual void makeReport();
virtual void makeDebug();
virtual void makeUnits();
virtual void makeNetwork();
2019-11-02 19:32:09 -07:00
virtual void makeSdcNetwork();
2018-09-28 08:54:21 -07:00
virtual void makeGraph();
2026-01-03 16:59:35 -08:00
virtual void makeDefaultScene();
2018-09-28 08:54:21 -07:00
virtual void makeLevelize();
virtual void makeArcDelayCalc();
virtual void makeGraphDelayCalc();
virtual void makeSearch();
2020-08-08 18:44:19 -07:00
virtual void makeLatches();
2018-09-28 08:54:21 -07:00
virtual void makeCheckTiming();
2026-01-03 16:59:35 -08:00
virtual void makeCheckSlews();
virtual void makeCheckFanouts();
virtual void makeCheckCapacitances();
2018-09-28 08:54:21 -07:00
virtual void makeCheckMinPulseWidths();
virtual void makeCheckMinPeriods();
virtual void makeCheckMaxSkews();
virtual void makeReportPath();
2018-11-26 09:15:52 -08:00
virtual void makePower();
virtual void makeClkSkews();
2018-09-28 08:54:21 -07:00
virtual void makeObservers();
NetworkEdit *networkCmdEdit();
2026-03-28 19:13:35 -07:00
LibertyLibrary *readLibertyFile(std::string_view filename,
2026-01-03 16:59:35 -08:00
Scene *scene,
const MinMaxAll *min_max,
bool infer_latches);
2018-09-28 08:54:21 -07:00
void delayCalcPreamble();
2023-01-19 11:23:45 -07:00
void delaysInvalidFrom(const Port *port);
2018-09-28 08:54:21 -07:00
void deleteEdge(Edge *edge);
void netParasiticCaps(Net *net,
2026-01-03 16:59:35 -08:00
const RiseFall *rf,
const MinMax *min_max,
float &pin_cap,
float &wire_cap) const;
2023-01-19 11:23:45 -07:00
const Pin *findNetParasiticDrvrPin(const Net *net) const;
2018-09-28 08:54:21 -07:00
void exprConstantPins(FuncExpr *expr,
2026-01-03 16:59:35 -08:00
const Instance *inst,
const Mode *mode,
// Return value.
PinSet &pins);
void reportDelaysWrtClks(const Pin *pin,
const Scene *scene,
2026-03-13 14:06:35 -07:00
bool report_variance,
2026-01-03 16:59:35 -08:00
int digits,
2026-03-02 13:22:13 -08:00
bool find_required,
2026-04-13 14:58:16 -07:00
const PathDelayFunc &get_path_delay);
2026-01-03 16:59:35 -08:00
void reportDelaysWrtClks(Vertex *vertex,
const Scene *scene,
2026-03-13 14:06:35 -07:00
bool report_variance,
2026-01-03 16:59:35 -08:00
int digits,
2026-03-02 13:22:13 -08:00
bool find_required,
2026-04-13 14:58:16 -07:00
const PathDelayFunc &get_path_delay);
2026-04-24 11:54:28 -07:00
void reportDelaysWrtClks(const ClockEdge *clk_edge,
2026-03-13 14:06:35 -07:00
bool report_variance,
2026-01-03 16:59:35 -08:00
int digits,
2026-04-24 11:54:28 -07:00
DelaysWrtClks &clk_delays);
2026-01-03 16:59:35 -08:00
std::string formatDelay(const RiseFall *rf,
const MinMax *min_max,
const RiseFallMinMaxDelay &delays,
2026-03-13 14:06:35 -07:00
bool report_variance,
2026-01-03 16:59:35 -08:00
int digits);
2018-09-28 08:54:21 -07:00
void connectDrvrPinAfter(Vertex *vertex);
void connectLoadPinAfter(Vertex *vertex);
Path *latchEnablePath(Path *q_path,
2026-01-03 16:59:35 -08:00
Edge *d_q_edge,
const ClockEdge *en_clk_edge);
2018-09-28 08:54:21 -07:00
void clockSlewChanged(Clock *clk);
void maxSkewPreamble();
bool idealClockMode();
void disableAfter();
void findFaninPins(Vertex *vertex,
2026-01-03 16:59:35 -08:00
bool flat,
bool startpoints_only,
int inst_levels,
int pin_levels,
PinSet &fanin,
SearchPred &pred,
const Mode *mode);
2018-09-28 08:54:21 -07:00
void findFaninPins(Vertex *to,
2026-01-03 16:59:35 -08:00
bool flat,
int inst_levels,
int pin_levels,
VertexSet &visited,
SearchPred *pred,
int inst_level,
int pin_level,
const Mode *mode);
2018-09-28 08:54:21 -07:00
void findFanoutPins(Vertex *vertex,
2026-01-03 16:59:35 -08:00
bool flat,
bool endpoints_only,
int inst_levels,
int pin_levels,
PinSet &fanout,
SearchPred &pred,
const Mode *mode);
2018-09-28 08:54:21 -07:00
void findFanoutPins(Vertex *from,
2026-01-03 16:59:35 -08:00
bool flat,
int inst_levels,
int pin_levels,
VertexSet &visited,
SearchPred *pred,
int inst_level,
int pin_level,
const Mode *mode);
void findRegisterPreamble(const Mode *mode);
2018-09-28 08:54:21 -07:00
bool crossesHierarchy(Edge *edge) const;
2018-11-26 09:15:52 -08:00
void powerPreamble();
2026-01-03 16:59:35 -08:00
void powerPreamble(const Scene *scene);
2020-11-09 20:50:05 -07:00
virtual void replaceCell(Instance *inst,
Cell *to_cell,
LibertyCell *to_lib_cell);
2022-02-19 18:31:52 -07:00
void clkSkewPreamble();
2022-10-05 13:39:40 -07:00
void setCmdNamespace1(CmdNamespace namespc);
void setThreadCount1(int thread_count);
2026-01-03 16:59:35 -08:00
void updateLibertyScenes();
void updateSceneLiberty(Scene *scene,
2026-03-08 15:51:50 -07:00
const StringSeq &liberty_min_files,
const StringSeq &liberty_max_files);
2026-04-18 08:45:04 -07:00
void updateSceneLiberty(Scene *scene,
const StringSeq &liberty_files,
const MinMaxAll *min_max);
2026-01-03 16:59:35 -08:00
Scene *makeScene(const std::string &name,
Mode *mode,
Parasitics *parasitics_min,
Parasitics *parasitics_max);
Scene *makeScene(const std::string &name,
Mode *mode,
Parasitics *parasitics);
void deleteScenes();
2026-04-22 11:13:25 -07:00
void checkLibrarayPocv();
2018-09-28 08:54:21 -07:00
2026-04-13 14:58:16 -07:00
Scene *cmd_scene_{nullptr};
2026-05-01 10:01:10 -07:00
Mode *cmd_mode_{nullptr};
2026-04-13 14:58:16 -07:00
CmdNamespace cmd_namespace_{CmdNamespace::sdc};
Instance *current_instance_{nullptr};
2026-01-03 16:59:35 -08:00
SceneNameMap scene_name_map_;
ModeNameMap mode_name_map_;
ParasiticsNameMap parasitics_name_map_;
2026-04-13 14:58:16 -07:00
VerilogReader *verilog_reader_{nullptr};
CheckTiming *check_timing_{nullptr};
CheckSlews *check_slews_{nullptr};
CheckFanouts *check_fanouts_{nullptr};
CheckCapacitances *check_capacitances_{nullptr};
CheckMinPulseWidths *check_min_pulse_widths_{nullptr};
CheckMinPeriods *check_min_periods_{nullptr};
CheckMaxSkews *check_max_skews_{nullptr};
ClkSkews *clk_skews_{nullptr};
ReportPath *report_path_{nullptr};
Power *power_{nullptr};
Tcl_Interp *tcl_interp_{nullptr};
bool update_genclks_{false};
EquivCells *equiv_cells_{nullptr};
Properties properties_{this};
2018-09-28 08:54:21 -07:00
// Singleton sta used by tcl command interpreter.
2026-04-13 14:58:16 -07:00
inline static Sta *sta_{nullptr};
2018-09-28 08:54:21 -07:00
};
2026-04-13 14:58:16 -07:00
} // namespace sta