Files
OpenSTA/include/sta/ClkNetwork.hh
T

88 lines
2.6 KiB
C++
Raw Normal View History

2020-08-08 18:44:19 -07:00
// OpenSTA, Static Timing Analyzer
2026-03-10 13:21:17 -07:00
// Copyright (c) 2026, Parallax Software, Inc.
2020-08-08 18:44:19 -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
2020-08-08 18:44:19 -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.
2020-08-08 18:44:19 -07:00
#pragma once
2026-01-03 16:59:35 -08:00
#include <map>
2020-08-08 18:44:19 -07:00
#include "GraphClass.hh"
2026-04-15 09:38:10 -07:00
#include "NetworkClass.hh"
2020-08-08 18:44:19 -07:00
#include "SdcClass.hh"
2026-04-15 09:38:10 -07:00
#include "StaState.hh"
2020-08-08 18:44:19 -07:00
namespace sta {
2026-01-03 16:59:35 -08:00
using PinClksMap = std::map<const Pin*, ClockSet>;
using ClkPinsMap = std::map<const Clock *, PinSet*>;
2020-08-08 18:44:19 -07:00
class Sta;
// Find clock network pins.
class ClkNetwork : public StaState
{
public:
2026-01-03 16:59:35 -08:00
ClkNetwork(Mode *mode,
StaState *sta);
2026-04-13 14:58:16 -07:00
~ClkNetwork() override;
2020-08-08 18:44:19 -07:00
void ensureClkNetwork();
void clear();
bool isClock(const Pin *pin) const;
2026-01-03 16:59:35 -08:00
bool isClock(const Vertex *vertex) const;
2020-08-10 18:31:20 -07:00
bool isClock(const Net *net) const;
2020-08-08 18:44:19 -07:00
bool isIdealClock(const Pin *pin) const;
2026-01-03 16:59:35 -08:00
bool isIdealClock(const Vertex *vertex) const;
2021-08-06 10:33:16 -07:00
bool isPropagatedClock(const Pin *pin) const;
2026-01-03 16:59:35 -08:00
const ClockSet *clocks(const Pin *pin) const;
const ClockSet *clocks(const Vertex *vertex) const;
const ClockSet *idealClocks(const Pin *pin) const;
2020-08-10 18:31:20 -07:00
const PinSet *pins(const Clock *clk);
2020-08-08 18:44:19 -07:00
void clkPinsInvalid();
2021-10-27 18:50:43 -07:00
float idealClkSlew(const Pin *pin,
const RiseFall *rf,
2026-01-03 16:59:35 -08:00
const MinMax *min_max) const;
2020-08-08 18:44:19 -07:00
protected:
void deletePinBefore(const Pin *pin);
void connectPinAfter(const Pin *pin);
void disconnectPinBefore(const Pin *pin);
friend class Sta;
private:
2026-01-03 16:59:35 -08:00
Mode *mode_;
2020-08-08 18:44:19 -07:00
void findClkPins();
void findClkPins(bool ideal_only,
2026-04-13 14:58:16 -07:00
PinClksMap &pin_clks_map);
2020-08-08 18:44:19 -07:00
2026-04-13 14:58:16 -07:00
bool clk_pins_valid_{false};
2020-08-08 18:44:19 -07:00
// pin -> clks
PinClksMap pin_clks_map_;
// pin -> ideal clks
PinClksMap pin_ideal_clks_map_;
// clock -> pins
ClkPinsMap clk_pins_map_;
};
2026-04-13 14:58:16 -07:00
} // namespace sta