Files
OpenSTA/include/sta/StaState.hh
T

147 lines
4.8 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-01-03 16:59:35 -08:00
#include <vector>
#include "Scene.hh"
2018-09-28 08:54:21 -07:00
namespace sta {
class Report;
class Debug;
class Units;
class Network;
class NetworkEdit;
class NetworkReader;
class Graph;
2025-04-09 16:35:15 -07:00
class Edge;
2018-09-28 08:54:21 -07:00
class Levelize;
class Sim;
class Search;
class Parasitics;
class ArcDelayCalc;
class GraphDelayCalc;
class Latches;
2019-11-11 08:48:27 -07:00
class DispatchQueue;
2025-04-09 16:35:15 -07:00
class Variables;
2026-03-13 14:06:35 -07:00
class DelayOps;
2018-09-28 08:54:21 -07:00
2026-01-03 16:59:35 -08:00
using ModeSeq = std::vector<Mode*>;
using ModeSet = std::set<Mode*>;
2018-09-28 08:54:21 -07:00
// Most STA components use functionality in other components.
// This class simplifies the process of copying pointers to the
// components. It is deliberately simple to minimize circular
// dependencies between the it and the components.
class StaState
{
public:
// Make an empty state.
StaState();
2025-04-09 16:35:15 -07:00
StaState(const StaState *sta);
2018-09-28 08:54:21 -07:00
// Copy the state from sta. This is virtual so that a component
// can notify sub-components.
virtual void copyState(const StaState *sta);
2026-04-13 14:58:16 -07:00
virtual ~StaState() = default;
2018-09-28 08:54:21 -07:00
Report *report() { return report_; }
Report *report() const { return report_; }
2019-10-25 08:51:59 -07:00
void setReport(Report *report);
2018-09-28 08:54:21 -07:00
Debug *debug() { return debug_; }
Debug *debug() const { return debug_; }
2019-10-25 08:51:59 -07:00
void setDebug(Debug *debug);
2018-09-28 08:54:21 -07:00
Units *units() { return units_; }
Units *units() const { return units_; }
2020-02-12 09:19:36 -07:00
void copyUnits(const Units *units);
2018-09-28 08:54:21 -07:00
Network *network() { return network_; }
Network *network() const { return network_; }
NetworkEdit *networkEdit();
NetworkEdit *networkEdit() const;
NetworkReader *networkReader();
NetworkReader *networkReader() const;
Network *sdcNetwork() { return sdc_network_; }
Network *sdcNetwork() const { return sdc_network_; }
// Command network uses the SDC namespace.
Network *cmdNetwork() { return cmd_network_; }
Network *cmdNetwork() const { return cmd_network_; }
Graph *graph() { return graph_; }
Graph *graph() const { return graph_; }
2026-01-03 16:59:35 -08:00
Graph *&graphRef() { return graph_; }
2018-09-28 08:54:21 -07:00
Levelize *levelize() { return levelize_; }
Levelize *levelize() const { return levelize_; }
ArcDelayCalc *arcDelayCalc() { return arc_delay_calc_; }
ArcDelayCalc *arcDelayCalc() const { return arc_delay_calc_; }
GraphDelayCalc *graphDelayCalc() { return graph_delay_calc_; }
GraphDelayCalc *graphDelayCalc() const { return graph_delay_calc_; }
Search *search() { return search_; }
Search *search() const { return search_; }
2026-03-13 14:06:35 -07:00
const DelayOps *delayOps() const { return delay_ops_; }
2018-09-28 08:54:21 -07:00
Latches *latches() { return latches_; }
Latches *latches() const { return latches_; }
2026-07-19 10:28:43 -07:00
size_t threadCount() const { return thread_count_; }
2026-01-03 16:59:35 -08:00
bool crprActive(const Mode *mode) const;
2025-04-09 16:35:15 -07:00
Variables *variables() { return variables_; }
const Variables *variables() const { return variables_; }
// Edge is default cond disabled by timing_disable_cond_default_arcs var.
2026-01-03 16:59:35 -08:00
[[nodiscard]] bool isDisabledCondDefault(const Edge *edge) const;
// Edge is disabled internal bidirect output path.
[[nodiscard]] bool isDisabledBidirectInstPath(Edge *edge) const;
2026-01-03 16:59:35 -08:00
const SceneSeq &scenes() { return scenes_; }
const SceneSeq &scenes() const { return scenes_; }
bool multiScene() const { return scenes_.size() > 1; }
size_t scenePathCount() const;
DcalcAPIndex dcalcAnalysisPtCount() const;
2026-04-13 14:58:16 -07:00
SceneSet scenesSet();
2026-01-03 16:59:35 -08:00
ModeSeq &modes() { return modes_; }
const ModeSeq &modes() const { return modes_; }
bool multiMode() const { return modes_.size() > 1; }
2018-09-28 08:54:21 -07:00
protected:
Report *report_;
Debug *debug_;
Units *units_;
Network *network_;
Network *sdc_network_;
// Network used by command interpreter (SdcNetwork).
Network *cmd_network_;
2026-01-03 16:59:35 -08:00
SceneSeq scenes_;
ModeSeq modes_;
2018-09-28 08:54:21 -07:00
Graph *graph_;
Levelize *levelize_;
ArcDelayCalc *arc_delay_calc_;
GraphDelayCalc *graph_delay_calc_;
Search *search_;
2026-03-13 14:06:35 -07:00
DelayOps *delay_ops_;
2018-09-28 08:54:21 -07:00
Latches *latches_;
2025-04-10 14:16:00 -07:00
Variables *variables_;
2026-07-19 10:28:43 -07:00
size_t thread_count_;
2019-11-11 08:48:27 -07:00
DispatchQueue *dispatch_queue_;
2018-09-28 08:54:21 -07:00
};
2026-04-13 14:58:16 -07:00
} // namespace sta