Files
OpenSTA/include/sta/NetworkClass.hh
T

177 lines
4.3 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
2023-01-19 11:23:45 -07:00
#include <cstdint>
2025-05-18 09:37:10 -07:00
#include <map>
2026-01-03 16:59:35 -08:00
#include <set>
2026-04-15 09:38:10 -07:00
#include <string>
2026-01-03 16:59:35 -08:00
#include <unordered_set>
2026-04-15 09:38:10 -07:00
#include <vector>
2023-06-15 08:59:56 -07:00
2020-04-05 14:53:44 -07:00
#include "Iterator.hh"
2018-09-28 08:54:21 -07:00
namespace sta {
class Network;
class NetworkEdit;
class NetworkReader;
class Library;
class Cell;
class Port;
class PortDirection;
class Instance;
class Pin;
class Term;
class Net;
class ConstantPinIterator;
class ViewType;
class LibertyLibrary;
2026-01-03 16:59:35 -08:00
using LibraryIterator = Iterator<Library*>;
using LibertyLibraryIterator = Iterator<LibertyLibrary*>;
using CellSeq = std::vector<Cell*>;
using PortSeq = std::vector<const Port*>;
using CellPortIterator = Iterator<Port*>;
using CellPortBitIterator = Iterator<Port*>;
using PortMemberIterator = Iterator<Port*>;
using PinSeq = std::vector<const Pin*>;
using PinUnorderedSet = std::unordered_set<const Pin*>;
using InstanceSeq = std::vector<const Instance*>;
using NetSeq = std::vector<const Net*>;
using ConstNetSeq = std::vector<const Net*>;
using InstanceChildIterator = Iterator<Instance*>;
using InstancePinIterator = Iterator<Pin*>;
using InstanceNetIterator = Iterator<Net*>;
using LeafInstanceIterator = Iterator<Instance*>;
using NetIterator = Iterator<Net*>;
using NetPinIterator = Iterator<const Pin*>;
using NetTermIterator = Iterator<Term*>;
using ConnectedPinIterator = Iterator<const Pin*>;
using NetConnectedPinIterator = ConnectedPinIterator;
using PinConnectedPinIterator = ConnectedPinIterator;
using ObjectId = uint32_t;
2026-03-28 19:13:35 -07:00
using AttributeMap = std::map<std::string, std::string, std::less<>>;
2023-01-19 11:23:45 -07:00
enum class LogicValue : unsigned { zero, one, unknown, rise, fall };
2018-09-28 08:54:21 -07:00
2023-01-19 11:23:45 -07:00
class CellIdLess
2018-09-28 08:54:21 -07:00
{
public:
2023-01-19 11:23:45 -07:00
CellIdLess(const Network *network);
bool operator()(const Cell *cell1,
const Cell *cell2) const;
private:
const Network *network_;
2018-09-28 08:54:21 -07:00
};
2023-01-19 11:23:45 -07:00
class PortIdLess
{
public:
PortIdLess(const Network *network);
bool operator()(const Port *port1,
const Port *port2) const;
private:
const Network *network_;
};
class InstanceIdLess
{
public:
InstanceIdLess(const Network *network);
bool operator()(const Instance *inst1,
const Instance *inst2) const;
private:
const Network *network_;
};
class PinIdLess
{
public:
PinIdLess(const Network *network);
bool operator()(const Pin *pin1,
const Pin *pin2) const;
private:
const Network *network_;
};
class PinIdHash
{
public:
PinIdHash(const Network *network);
size_t operator()(const Pin *pin) const;
private:
const Network *network_;
};
class NetIdLess
{
public:
NetIdLess(const Network *network);
bool operator()(const Net *net1,
const Net *net2) const;
private:
const Network *network_;
};
////////////////////////////////////////////////////////////////
2026-01-03 16:59:35 -08:00
class CellSet : public std::set<const Cell*, CellIdLess>
2023-01-19 11:23:45 -07:00
{
public:
CellSet(const Network *network);
};
2026-01-03 16:59:35 -08:00
class PortSet : public std::set<const Port*, PortIdLess>
2023-01-19 11:23:45 -07:00
{
public:
PortSet(const Network *network);
};
2026-01-03 16:59:35 -08:00
class InstanceSet : public std::set<const Instance*, InstanceIdLess>
2023-01-19 11:23:45 -07:00
{
public:
InstanceSet();
InstanceSet(const Network *network);
};
2026-01-03 16:59:35 -08:00
class PinSet : public std::set<const Pin*, PinIdLess>
2023-01-19 11:23:45 -07:00
{
public:
PinSet();
PinSet(const Network *network);
};
2026-01-03 16:59:35 -08:00
class NetSet : public std::set<const Net*, NetIdLess>
2023-01-19 11:23:45 -07:00
{
public:
NetSet();
NetSet(const Network *network);
};
2018-09-28 08:54:21 -07:00
2026-04-13 14:58:16 -07:00
} // namespace sta