2018-09-28 17:54:21 +02:00
|
|
|
// OpenSTA, Static Timing Analyzer
|
2025-01-22 02:54:33 +01:00
|
|
|
// Copyright (c) 2025, Parallax Software, Inc.
|
2018-09-28 17:54:21 +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
|
2018-09-28 17:54:21 +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.
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2020-02-16 01:13:16 +01:00
|
|
|
#pragma once
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2021-08-13 04:52:50 +02:00
|
|
|
#include <functional>
|
|
|
|
|
|
2020-04-05 23:53:44 +02:00
|
|
|
#include "Map.hh"
|
|
|
|
|
#include "Set.hh"
|
|
|
|
|
#include "StringUtil.hh"
|
|
|
|
|
#include "Network.hh"
|
|
|
|
|
#include "LibertyClass.hh"
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
|
|
|
|
class Report;
|
|
|
|
|
class ConcreteLibrary;
|
|
|
|
|
class ConcreteCell;
|
|
|
|
|
class ConcretePin;
|
|
|
|
|
class ConcreteInstance;
|
|
|
|
|
class ConcreteNet;
|
|
|
|
|
class ConcreteTerm;
|
|
|
|
|
class ConcretePort;
|
|
|
|
|
class ConcreteBindingTbl;
|
|
|
|
|
class ConcreteLibertyLibraryIterator;
|
|
|
|
|
|
|
|
|
|
typedef Vector<ConcreteLibrary*> ConcreteLibrarySeq;
|
|
|
|
|
typedef Map<const char*, ConcreteLibrary*, CharPtrLess> ConcreteLibraryMap;
|
|
|
|
|
typedef ConcreteLibrarySeq::ConstIterator ConcreteLibraryIterator;
|
|
|
|
|
typedef Map<const char *, ConcreteInstance*,
|
|
|
|
|
CharPtrLess> ConcreteInstanceChildMap;
|
|
|
|
|
typedef Map<const char *, ConcreteNet*, CharPtrLess> ConcreteInstanceNetMap;
|
|
|
|
|
typedef Vector<ConcreteNet*> ConcreteNetSeq;
|
2023-06-28 19:01:39 +02:00
|
|
|
typedef Vector<ConcretePin*> ConcretePinSeq;
|
2018-09-28 17:54:21 +02:00
|
|
|
typedef Map<Cell*, Instance*> CellNetworkViewMap;
|
|
|
|
|
typedef Set<const ConcreteNet*> ConcreteNetSet;
|
|
|
|
|
|
|
|
|
|
// This adapter implements the network api for the concrete network.
|
|
|
|
|
// A superset of the Network api methods are implemented in the interface.
|
|
|
|
|
class ConcreteNetwork : public NetworkReader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ConcreteNetwork();
|
2023-03-10 04:15:31 +01:00
|
|
|
~ConcreteNetwork();
|
|
|
|
|
void clear() override;
|
|
|
|
|
bool linkNetwork(const char *top_cell_name,
|
|
|
|
|
bool make_black_boxes,
|
|
|
|
|
Report *report) override;
|
|
|
|
|
Instance *topInstance() const override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2023-03-10 04:15:31 +01:00
|
|
|
const char *name(const Library *library) const override;
|
|
|
|
|
ObjectId id(const Library *library) const override;
|
|
|
|
|
LibraryIterator *libraryIterator() const override;
|
|
|
|
|
LibertyLibraryIterator *libertyLibraryIterator() const override;
|
|
|
|
|
Library *findLibrary(const char *name) override;
|
|
|
|
|
LibertyLibrary *findLiberty(const char *name) override;
|
|
|
|
|
Cell *findCell(const Library *library,
|
|
|
|
|
const char *name) const override;
|
|
|
|
|
Cell *findAnyCell(const char *name) override;
|
|
|
|
|
CellSeq findCellsMatching(const Library *library,
|
|
|
|
|
const PatternMatch *pattern) const override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2023-03-10 04:15:31 +01:00
|
|
|
const char *name(const Cell *cell) const override;
|
2025-04-12 01:59:48 +02:00
|
|
|
std::string getAttribute(const Cell *cell,
|
|
|
|
|
const std::string &key) const override;
|
2025-05-18 18:37:10 +02:00
|
|
|
const AttributeMap &attributeMap(const Cell *cell) const override;
|
2023-03-10 04:15:31 +01:00
|
|
|
ObjectId id(const Cell *cell) const override;
|
|
|
|
|
Library *library(const Cell *cell) const override;
|
|
|
|
|
LibertyCell *libertyCell(Cell *cell) const override;
|
|
|
|
|
const LibertyCell *libertyCell(const Cell *cell) const override;
|
|
|
|
|
Cell *cell(LibertyCell *cell) const override;
|
|
|
|
|
const Cell *cell(const LibertyCell *cell) const override;
|
|
|
|
|
const char *filename(const Cell *cell) override;
|
|
|
|
|
Port *findPort(const Cell *cell,
|
|
|
|
|
const char *name) const override;
|
|
|
|
|
bool isLeaf(const Cell *cell) const override;
|
|
|
|
|
CellPortIterator *portIterator(const Cell *cell) const override;
|
|
|
|
|
CellPortBitIterator *portBitIterator(const Cell *cell) const override;
|
|
|
|
|
int portBitCount(const Cell *cell) const override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2023-03-10 04:15:31 +01:00
|
|
|
const char *name(const Port *port) const override;
|
|
|
|
|
ObjectId id(const Port *port) const override;
|
|
|
|
|
Cell *cell(const Port *port) const override;
|
|
|
|
|
LibertyPort *libertyPort(const Port *port) const override;
|
|
|
|
|
PortDirection *direction(const Port *port) const override;
|
|
|
|
|
bool isBundle(const Port *port) const override;
|
|
|
|
|
bool hasMembers(const Port *port) const override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2023-03-10 04:15:31 +01:00
|
|
|
bool isBus(const Port *port) const override;
|
|
|
|
|
int size(const Port *port) const override;
|
|
|
|
|
const char *busName(const Port *port) const override;
|
|
|
|
|
Port *findBusBit(const Port *port,
|
|
|
|
|
int index) const override;
|
|
|
|
|
int fromIndex(const Port *port) const override;
|
|
|
|
|
int toIndex(const Port *port) const override;
|
|
|
|
|
Port *findMember(const Port *port,
|
|
|
|
|
int index) const override;
|
|
|
|
|
PortMemberIterator *memberIterator(const Port *port) const override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2023-03-10 04:15:31 +01:00
|
|
|
const char *name(const Instance *instance) const override;
|
2025-04-12 01:59:48 +02:00
|
|
|
std::string getAttribute(const Instance *inst,
|
|
|
|
|
const std::string &key) const override;
|
2025-05-18 18:37:10 +02:00
|
|
|
const AttributeMap &attributeMap(const Instance *inst) const override;
|
2023-03-10 04:15:31 +01:00
|
|
|
ObjectId id(const Instance *instance) const override;
|
|
|
|
|
Cell *cell(const Instance *instance) const override;
|
|
|
|
|
Instance *parent(const Instance *instance) const override;
|
|
|
|
|
bool isLeaf(const Instance *instance) const override;
|
|
|
|
|
Instance *findChild(const Instance *parent,
|
|
|
|
|
const char *name) const override;
|
|
|
|
|
Pin *findPin(const Instance *instance,
|
|
|
|
|
const char *port_name) const override;
|
|
|
|
|
Pin *findPin(const Instance *instance,
|
|
|
|
|
const Port *port) const override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2023-03-10 04:15:31 +01:00
|
|
|
InstanceChildIterator *
|
|
|
|
|
childIterator(const Instance *instance) const override;
|
|
|
|
|
InstancePinIterator *
|
|
|
|
|
pinIterator(const Instance *instance) const override;
|
|
|
|
|
InstanceNetIterator *
|
|
|
|
|
netIterator(const Instance *instance) const override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2023-03-10 04:15:31 +01:00
|
|
|
ObjectId id(const Pin *pin) const override;
|
|
|
|
|
Instance *instance(const Pin *pin) const override;
|
|
|
|
|
Net *net(const Pin *pin) const override;
|
|
|
|
|
Term *term(const Pin *pin) const override;
|
|
|
|
|
Port *port(const Pin *pin) const override;
|
|
|
|
|
PortDirection *direction(const Pin *pin) const override;
|
|
|
|
|
VertexId vertexId(const Pin *pin) const override;
|
|
|
|
|
void setVertexId(Pin *pin,
|
|
|
|
|
VertexId id) override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2023-03-10 04:15:31 +01:00
|
|
|
ObjectId id(const Term *term) const override;
|
|
|
|
|
Net *net(const Term *term) const override;
|
|
|
|
|
Pin *pin(const Term *term) const override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2023-03-10 04:15:31 +01:00
|
|
|
const char *name(const Net *net) const override;
|
|
|
|
|
ObjectId id(const Net *net) const override;
|
|
|
|
|
Net *findNet(const Instance *instance,
|
|
|
|
|
const char *net_name) const override;
|
|
|
|
|
void findInstNetsMatching(const Instance *instance,
|
|
|
|
|
const PatternMatch *pattern,
|
|
|
|
|
NetSeq &matches) const override;
|
|
|
|
|
Instance *instance(const Net *net) const override;
|
|
|
|
|
bool isPower(const Net *net) const override;
|
|
|
|
|
bool isGround(const Net *net) const override;
|
|
|
|
|
NetPinIterator *pinIterator(const Net *net) const override;
|
|
|
|
|
NetTermIterator *termIterator(const Net *net) const override;
|
|
|
|
|
void mergeInto(Net *net,
|
|
|
|
|
Net *into_net) override;
|
|
|
|
|
Net *mergedInto(Net *net) override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2023-03-10 04:15:31 +01:00
|
|
|
ConstantPinIterator *constantPinIterator() override;
|
2018-09-28 17:54:21 +02:00
|
|
|
void addConstantNet(Net *net,
|
2023-03-10 04:15:31 +01:00
|
|
|
LogicValue value) override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
// Edit methods.
|
2023-03-10 04:15:31 +01:00
|
|
|
Library *makeLibrary(const char *name,
|
|
|
|
|
const char *filename) override;
|
|
|
|
|
LibertyLibrary *makeLibertyLibrary(const char *name,
|
|
|
|
|
const char *filename) override;
|
|
|
|
|
void deleteLibrary(Library *library) override;
|
|
|
|
|
Cell *makeCell(Library *library,
|
|
|
|
|
const char *name,
|
|
|
|
|
bool is_leaf,
|
|
|
|
|
const char *filename) override;
|
|
|
|
|
void deleteCell(Cell *cell) override;
|
|
|
|
|
void setName(Cell *cell,
|
|
|
|
|
const char *name) override;
|
|
|
|
|
void setIsLeaf(Cell *cell,
|
|
|
|
|
bool is_leaf) override;
|
2022-07-11 17:49:12 +02:00
|
|
|
void setAttribute(Cell *cell,
|
2025-04-12 01:59:48 +02:00
|
|
|
const std::string &key,
|
|
|
|
|
const std::string &value) override;
|
2023-03-10 04:15:31 +01:00
|
|
|
Port *makePort(Cell *cell,
|
|
|
|
|
const char *name) override;
|
|
|
|
|
Port *makeBusPort(Cell *cell,
|
|
|
|
|
const char *name,
|
|
|
|
|
int from_index,
|
|
|
|
|
int to_index) override;
|
|
|
|
|
void groupBusPorts(Cell *cell,
|
|
|
|
|
std::function<bool(const char*)> port_msb_first) override;
|
|
|
|
|
Port *makeBundlePort(Cell *cell,
|
|
|
|
|
const char *name,
|
|
|
|
|
PortSeq *members) override;
|
|
|
|
|
void setDirection(Port *port,
|
|
|
|
|
PortDirection *dir) override;
|
2018-09-28 17:54:21 +02:00
|
|
|
// For NetworkEdit.
|
2023-03-10 04:15:31 +01:00
|
|
|
Instance *makeInstance(LibertyCell *cell,
|
|
|
|
|
const char *name,
|
|
|
|
|
Instance *parent) override;
|
|
|
|
|
void makePins(Instance *inst) override;
|
2018-09-28 17:54:21 +02:00
|
|
|
// For linking.
|
2023-03-10 04:15:31 +01:00
|
|
|
Instance *makeInstance(Cell *cell,
|
|
|
|
|
const char *name,
|
|
|
|
|
Instance *parent) override;
|
|
|
|
|
void replaceCell(Instance *inst,
|
|
|
|
|
Cell *cell) override;
|
|
|
|
|
void deleteInstance(Instance *inst) override;
|
|
|
|
|
Pin *connect(Instance *inst,
|
|
|
|
|
Port *port,
|
|
|
|
|
Net *net) override;
|
|
|
|
|
Pin *connect(Instance *inst,
|
|
|
|
|
LibertyPort *port,
|
|
|
|
|
Net *net) override;
|
2022-07-11 17:49:12 +02:00
|
|
|
void setAttribute(Instance *inst,
|
2025-04-12 01:59:48 +02:00
|
|
|
const std::string &key,
|
|
|
|
|
const std::string &value) override;
|
2023-03-10 04:15:31 +01:00
|
|
|
void disconnectPin(Pin *pin) override;
|
|
|
|
|
void deletePin(Pin *pin) override;
|
|
|
|
|
Net *makeNet(const char *name,
|
|
|
|
|
Instance *parent) override;
|
|
|
|
|
void deleteNet(Net *net) override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
// For NetworkReader API.
|
2023-03-10 04:15:31 +01:00
|
|
|
Term *makeTerm(Pin *pin,
|
|
|
|
|
Net *net) override;
|
|
|
|
|
Pin *makePin(Instance *inst,
|
|
|
|
|
Port *port,
|
|
|
|
|
Net *net) override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
// Instance is the network view for cell.
|
2023-03-10 04:15:31 +01:00
|
|
|
void setCellNetworkView(Cell *cell,
|
|
|
|
|
Instance *inst) override;
|
|
|
|
|
Instance *cellNetworkView(Cell *cell) override;
|
|
|
|
|
void deleteCellNetworkViews() override;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2023-03-10 04:15:31 +01:00
|
|
|
void readNetlistBefore() override;
|
2025-01-22 02:35:21 +01:00
|
|
|
void setLinkFunc(LinkNetworkFunc link) override;
|
2023-01-19 19:23:45 +01:00
|
|
|
static ObjectId nextObjectId();
|
|
|
|
|
|
2023-03-13 18:13:42 +01:00
|
|
|
// Used by external tools.
|
|
|
|
|
void setTopInstance(Instance *top_inst);
|
|
|
|
|
void deleteTopInstance();
|
|
|
|
|
|
2018-09-28 17:54:21 +02:00
|
|
|
using Network::netIterator;
|
|
|
|
|
using Network::findPin;
|
|
|
|
|
using Network::findNet;
|
|
|
|
|
using Network::findNetsMatching;
|
|
|
|
|
using Network::libertyLibrary;
|
|
|
|
|
using Network::libertyCell;
|
|
|
|
|
using Network::libertyPort;
|
2019-06-15 06:03:11 +02:00
|
|
|
using Network::isLeaf;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void addLibrary(ConcreteLibrary *library);
|
|
|
|
|
void setName(const char *name);
|
|
|
|
|
void clearConstantNets();
|
2023-03-10 04:15:31 +01:00
|
|
|
void visitConnectedPins(const Net *net,
|
|
|
|
|
PinVisitor &visitor,
|
|
|
|
|
NetSet &visited_nets) const override;
|
2018-09-28 17:54:21 +02:00
|
|
|
Instance *makeConcreteInstance(ConcreteCell *cell,
|
|
|
|
|
const char *name,
|
|
|
|
|
Instance *parent);
|
|
|
|
|
void disconnectNetPin(ConcreteNet *cnet,
|
|
|
|
|
ConcretePin *cpin);
|
|
|
|
|
void connectNetPin(ConcreteNet *cnet,
|
|
|
|
|
ConcretePin *cpin);
|
|
|
|
|
|
|
|
|
|
// Cell lookup search order sequence.
|
|
|
|
|
ConcreteLibrarySeq library_seq_;
|
|
|
|
|
ConcreteLibraryMap library_map_;
|
2019-05-20 01:06:06 +02:00
|
|
|
Instance *top_instance_;
|
2019-03-13 01:25:53 +01:00
|
|
|
NetSet constant_nets_[2]; // LogicValue::zero/one
|
2025-01-22 02:35:21 +01:00
|
|
|
LinkNetworkFunc link_func_;
|
2018-09-28 17:54:21 +02:00
|
|
|
CellNetworkViewMap cell_network_view_map_;
|
2023-01-19 19:23:45 +01:00
|
|
|
static ObjectId object_id_;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
friend class ConcreteLibertyLibraryIterator;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ConcreteInstance
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
const char *name() const { return name_; }
|
2023-01-19 19:23:45 +01:00
|
|
|
ObjectId id() const { return id_; }
|
2018-09-28 17:54:21 +02:00
|
|
|
Cell *cell() const;
|
|
|
|
|
ConcreteInstance *parent() const { return parent_; }
|
|
|
|
|
ConcretePin *findPin(const char *port_name) const;
|
|
|
|
|
ConcretePin *findPin(const Port *port) const;
|
|
|
|
|
ConcreteNet *findNet(const char *net_name) const;
|
|
|
|
|
void findNetsMatching(const PatternMatch *pattern,
|
2023-01-19 19:23:45 +01:00
|
|
|
NetSeq &matches) const;
|
2018-09-28 17:54:21 +02:00
|
|
|
InstanceNetIterator *netIterator() const;
|
|
|
|
|
Instance *findChild(const char *name) const;
|
|
|
|
|
InstanceChildIterator *childIterator() const;
|
2025-04-12 01:59:48 +02:00
|
|
|
void setAttribute(const std::string &key,
|
|
|
|
|
const std::string &value);
|
|
|
|
|
std::string getAttribute(const std::string &key) const;
|
2025-05-18 18:37:10 +02:00
|
|
|
const AttributeMap &attributeMap() const { return attribute_map_; }
|
2018-09-28 17:54:21 +02:00
|
|
|
void addChild(ConcreteInstance *child);
|
|
|
|
|
void deleteChild(ConcreteInstance *child);
|
|
|
|
|
void addPin(ConcretePin *pin);
|
|
|
|
|
void deletePin(ConcretePin *pin);
|
|
|
|
|
void addNet(ConcreteNet *net);
|
|
|
|
|
void addNet(const char *name,
|
|
|
|
|
ConcreteNet *net);
|
|
|
|
|
void deleteNet(ConcreteNet *net);
|
2019-05-20 19:35:22 +02:00
|
|
|
void setCell(ConcreteCell *cell);
|
2019-05-20 01:06:06 +02:00
|
|
|
void initPins();
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2019-05-20 01:06:06 +02:00
|
|
|
protected:
|
2023-01-19 19:23:45 +01:00
|
|
|
ConcreteInstance(const char *name,
|
|
|
|
|
ConcreteCell *cell,
|
|
|
|
|
ConcreteInstance *parent);
|
2018-09-28 17:54:21 +02:00
|
|
|
~ConcreteInstance();
|
|
|
|
|
|
2019-05-20 01:06:06 +02:00
|
|
|
const char *name_;
|
2023-01-19 19:23:45 +01:00
|
|
|
ObjectId id_;
|
|
|
|
|
ConcreteCell *cell_;
|
2018-09-28 17:54:21 +02:00
|
|
|
ConcreteInstance *parent_;
|
|
|
|
|
// Array of pins indexed by pin->port->index().
|
2023-06-28 19:01:39 +02:00
|
|
|
ConcretePinSeq pins_;
|
2018-09-28 17:54:21 +02:00
|
|
|
ConcreteInstanceChildMap *children_;
|
|
|
|
|
ConcreteInstanceNetMap *nets_;
|
2022-07-11 17:49:12 +02:00
|
|
|
AttributeMap attribute_map_;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
friend class ConcreteNetwork;
|
|
|
|
|
friend class ConcreteInstancePinIterator;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ConcretePin
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
const char *name() const;
|
|
|
|
|
ConcreteInstance *instance() const { return instance_; }
|
|
|
|
|
ConcreteNet *net() const { return net_; }
|
|
|
|
|
ConcretePort *port() const { return port_; }
|
|
|
|
|
ConcreteTerm *term() const { return term_; }
|
2023-01-19 19:23:45 +01:00
|
|
|
ObjectId id() const { return id_; }
|
2019-11-11 16:28:42 +01:00
|
|
|
VertexId vertexId() const { return vertex_id_; }
|
|
|
|
|
void setVertexId(VertexId id);
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2019-07-01 07:30:53 +02:00
|
|
|
protected:
|
|
|
|
|
~ConcretePin() {}
|
2018-09-28 17:54:21 +02:00
|
|
|
ConcretePin(ConcreteInstance *instance,
|
|
|
|
|
ConcretePort *port,
|
|
|
|
|
ConcreteNet *net);
|
|
|
|
|
|
|
|
|
|
ConcreteInstance *instance_;
|
|
|
|
|
ConcretePort *port_;
|
|
|
|
|
ConcreteNet *net_;
|
|
|
|
|
ConcreteTerm *term_;
|
2023-01-19 19:23:45 +01:00
|
|
|
ObjectId id_;
|
2018-09-28 17:54:21 +02:00
|
|
|
// Doubly linked list of net pins.
|
|
|
|
|
ConcretePin *net_next_;
|
|
|
|
|
ConcretePin *net_prev_;
|
2019-11-11 16:28:42 +01:00
|
|
|
VertexId vertex_id_;
|
2018-09-28 17:54:21 +02:00
|
|
|
|
2019-07-01 07:30:53 +02:00
|
|
|
private:
|
2018-09-28 17:54:21 +02:00
|
|
|
friend class ConcreteNetwork;
|
|
|
|
|
friend class ConcreteNet;
|
|
|
|
|
friend class ConcreteNetPinIterator;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ConcreteTerm
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
const char *name() const;
|
2023-01-19 19:23:45 +01:00
|
|
|
ObjectId id() const { return id_; }
|
2018-09-28 17:54:21 +02:00
|
|
|
ConcreteNet *net() const { return net_; }
|
|
|
|
|
ConcretePin *pin() const { return pin_; }
|
|
|
|
|
|
2019-07-01 07:30:53 +02:00
|
|
|
protected:
|
|
|
|
|
~ConcreteTerm() {}
|
2018-09-28 17:54:21 +02:00
|
|
|
ConcreteTerm(ConcretePin *pin,
|
|
|
|
|
ConcreteNet *net);
|
|
|
|
|
|
|
|
|
|
ConcretePin *pin_;
|
|
|
|
|
ConcreteNet *net_;
|
2023-01-19 19:23:45 +01:00
|
|
|
ObjectId id_;
|
2018-09-28 17:54:21 +02:00
|
|
|
// Linked list of net terms.
|
|
|
|
|
ConcreteTerm *net_next_;
|
|
|
|
|
|
2019-07-01 07:30:53 +02:00
|
|
|
private:
|
2018-09-28 17:54:21 +02:00
|
|
|
friend class ConcreteNetwork;
|
|
|
|
|
friend class ConcreteNet;
|
|
|
|
|
friend class ConcreteNetTermIterator;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ConcreteNet
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
const char *name() const { return name_; }
|
2023-01-19 19:23:45 +01:00
|
|
|
ObjectId id() const { return id_; }
|
2018-09-28 17:54:21 +02:00
|
|
|
ConcreteInstance *instance() const { return instance_; }
|
|
|
|
|
void addPin(ConcretePin *pin);
|
|
|
|
|
void deletePin(ConcretePin *pin);
|
|
|
|
|
void addTerm(ConcreteTerm *term);
|
|
|
|
|
void deleteTerm(ConcreteTerm *term);
|
|
|
|
|
void mergeInto(ConcreteNet *net);
|
|
|
|
|
ConcreteNet *mergedInto() { return merged_into_; }
|
|
|
|
|
|
2019-05-20 01:06:06 +02:00
|
|
|
protected:
|
2018-09-28 17:54:21 +02:00
|
|
|
ConcreteNet(const char *name,
|
|
|
|
|
ConcreteInstance *instance);
|
2019-06-28 22:38:56 +02:00
|
|
|
~ConcreteNet();
|
2018-09-28 17:54:21 +02:00
|
|
|
const char *name_;
|
2023-01-19 19:23:45 +01:00
|
|
|
ObjectId id_;
|
2018-09-28 17:54:21 +02:00
|
|
|
ConcreteInstance *instance_;
|
|
|
|
|
// Pointer to head of linked list of pins.
|
|
|
|
|
ConcretePin *pins_;
|
|
|
|
|
// Pointer to head of linked list of terminals.
|
|
|
|
|
// These terminals correspond to the pins attached to the instance that
|
|
|
|
|
// contains this net in the hierarchy level above.
|
|
|
|
|
ConcreteTerm *terms_;
|
|
|
|
|
ConcreteNet *merged_into_;
|
|
|
|
|
|
|
|
|
|
friend class ConcreteNetwork;
|
|
|
|
|
friend class ConcreteNetTermIterator;
|
|
|
|
|
friend class ConcreteNetPinIterator;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace
|