2020-08-09 03:44:19 +02:00
|
|
|
// OpenSTA, Static Timing Analyzer
|
2025-01-22 02:54:33 +01:00
|
|
|
// Copyright (c) 2025, Parallax Software, Inc.
|
2020-08-09 03:44:19 +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
|
2020-08-09 03:44:19 +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.
|
2020-08-09 03:44:19 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Map.hh"
|
|
|
|
|
#include "Set.hh"
|
|
|
|
|
#include "StaState.hh"
|
|
|
|
|
#include "NetworkClass.hh"
|
|
|
|
|
#include "GraphClass.hh"
|
|
|
|
|
#include "SdcClass.hh"
|
|
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
|
|
|
|
typedef Map<const Pin*, ClockSet> PinClksMap;
|
2023-01-19 19:23:45 +01:00
|
|
|
typedef Map<const Clock *, PinSet*> ClkPinsMap;
|
2020-08-09 03:44:19 +02:00
|
|
|
|
|
|
|
|
class Sta;
|
|
|
|
|
|
|
|
|
|
// Find clock network pins.
|
|
|
|
|
// This is not as reliable as Search::isClock but is much cheaper.
|
|
|
|
|
class ClkNetwork : public StaState
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ClkNetwork(StaState *sta);
|
2023-01-19 19:23:45 +01:00
|
|
|
~ClkNetwork();
|
2020-08-09 03:44:19 +02:00
|
|
|
void ensureClkNetwork();
|
|
|
|
|
void clear();
|
|
|
|
|
bool isClock(const Pin *pin) const;
|
2020-08-11 03:31:20 +02:00
|
|
|
bool isClock(const Net *net) const;
|
2020-08-09 03:44:19 +02:00
|
|
|
bool isIdealClock(const Pin *pin) const;
|
2021-08-06 19:33:16 +02:00
|
|
|
bool isPropagatedClock(const Pin *pin) const;
|
2020-08-09 03:44:19 +02:00
|
|
|
const ClockSet *clocks(const Pin *pin);
|
|
|
|
|
const ClockSet *idealClocks(const Pin *pin);
|
2020-08-11 03:31:20 +02:00
|
|
|
const PinSet *pins(const Clock *clk);
|
2020-08-09 03:44:19 +02:00
|
|
|
void clkPinsInvalid();
|
2021-10-28 03:50:43 +02:00
|
|
|
float idealClkSlew(const Pin *pin,
|
|
|
|
|
const RiseFall *rf,
|
|
|
|
|
const MinMax *min_max);
|
2020-08-09 03:44:19 +02:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void deletePinBefore(const Pin *pin);
|
|
|
|
|
void connectPinAfter(const Pin *pin);
|
|
|
|
|
void disconnectPinBefore(const Pin *pin);
|
|
|
|
|
friend class Sta;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void findClkPins();
|
|
|
|
|
void findClkPins(bool ideal_only,
|
|
|
|
|
PinClksMap &clk_pin_map);
|
|
|
|
|
|
|
|
|
|
bool clk_pins_valid_;
|
|
|
|
|
// pin -> clks
|
|
|
|
|
PinClksMap pin_clks_map_;
|
|
|
|
|
// pin -> ideal clks
|
|
|
|
|
PinClksMap pin_ideal_clks_map_;
|
|
|
|
|
// clock -> pins
|
|
|
|
|
ClkPinsMap clk_pins_map_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace
|