Files
OpenSTA/include/sta/NetworkClass.hh
T

193 lines
5.0 KiB
C++
Raw Normal View History

2018-09-28 08:54:21 -07:00
// OpenSTA, Static Timing Analyzer
2025-01-21 18:54:33 -07:00
// Copyright (c) 2025, 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 <string>
#include <map>
2023-06-15 08:59:56 -07:00
2020-04-05 14:53:44 -07:00
#include "Set.hh"
#include "Vector.hh"
#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;
typedef Iterator<Library*> LibraryIterator;
typedef Iterator<LibertyLibrary*> LibertyLibraryIterator;
typedef Vector<Cell*> CellSeq;
2023-01-19 11:23:45 -07:00
typedef Vector<const Port*> PortSeq;
2018-09-28 08:54:21 -07:00
typedef Iterator<Port*> CellPortIterator;
typedef Iterator<Port*> CellPortBitIterator;
typedef Iterator<Port*> PortMemberIterator;
2023-01-19 11:23:45 -07:00
typedef Vector<const Pin*> PinSeq;
typedef Vector<const Instance*> InstanceSeq;
typedef Vector<const Net*> NetSeq;
2024-02-27 10:00:48 -07:00
typedef std::vector<const Net*> ConstNetSeq;
2018-09-28 08:54:21 -07:00
typedef Iterator<Instance*> InstanceChildIterator;
typedef Iterator<Pin*> InstancePinIterator;
typedef Iterator<Net*> InstanceNetIterator;
typedef Iterator<Instance*> LeafInstanceIterator;
typedef Iterator<Net*> NetIterator;
2023-01-19 11:23:45 -07:00
typedef Iterator<const Pin*> NetPinIterator;
2018-09-28 08:54:21 -07:00
typedef Iterator<Term*> NetTermIterator;
2023-01-19 11:23:45 -07:00
typedef Iterator<const Pin*> ConnectedPinIterator;
2018-09-28 08:54:21 -07:00
typedef ConnectedPinIterator NetConnectedPinIterator;
typedef ConnectedPinIterator PinConnectedPinIterator;
2023-01-19 11:23:45 -07:00
typedef uint32_t ObjectId;
2025-05-18 09:37:10 -07:00
typedef std::map<std::string, std::string> AttributeMap;
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_;
};
////////////////////////////////////////////////////////////////
class CellSet : public Set<const Cell*, CellIdLess>
{
public:
CellSet(const Network *network);
};
class PortSet : public Set<const Port*, PortIdLess>
{
public:
PortSet(const Network *network);
};
class InstanceSet : public Set<const Instance*, InstanceIdLess>
{
public:
InstanceSet();
InstanceSet(const Network *network);
static int compare(const InstanceSet *set1,
const InstanceSet *set2,
const Network *network);
2023-06-15 09:52:32 -07:00
static bool intersects(const InstanceSet *set1,
const InstanceSet *set2,
const Network *network);
2023-01-19 11:23:45 -07:00
};
class PinSet : public Set<const Pin*, PinIdLess>
{
public:
PinSet();
PinSet(const Network *network);
static int compare(const PinSet *set1,
const PinSet *set2,
const Network *network);
2023-06-15 09:52:32 -07:00
static bool intersects(const PinSet *set1,
const PinSet *set2,
const Network *network);
2023-01-19 11:23:45 -07:00
};
class NetSet : public Set<const Net*, NetIdLess>
{
public:
NetSet();
NetSet(const Network *network);
static int compare(const NetSet *set1,
const NetSet *set2,
const Network *network);
2023-06-15 09:52:32 -07:00
static bool intersects(const NetSet *set1,
const NetSet *set2,
const Network *network);
2023-01-19 11:23:45 -07:00
};
2018-09-28 08:54:21 -07:00
} // namespace