Network bus brkts use library values

This commit is contained in:
James Cherry 2019-06-28 11:51:43 -07:00
parent d108a15c56
commit 88331ab9b1
5 changed files with 12 additions and 24 deletions

View File

@ -355,9 +355,11 @@ BusPort::setTo(int to)
typedef Map<const char*, BusPort*, CharPtrLess> BusPortMap; typedef Map<const char*, BusPort*, CharPtrLess> BusPortMap;
void void
ConcreteCell::groupBusPorts(const char *bus_brkts_left, ConcreteCell::groupBusPorts(const char bus_brkt_left,
const char *bus_brkts_right) const char bus_brkt_right)
{ {
const char bus_brkts_left[2]{bus_brkt_left, '\0'};
const char bus_brkts_right[2]{bus_brkt_right, '\0'};
BusPortMap port_map; BusPortMap port_map;
// Find ungrouped bus ports. // Find ungrouped bus ports.
// Remove bus bit ports from the ports_ vector during the scan by // Remove bus bit ports from the ports_ vector during the scan by
@ -370,7 +372,8 @@ ConcreteCell::groupBusPorts(const char *bus_brkts_left,
const char *port_name = port->name(); const char *port_name = port->name();
char *bus_name; char *bus_name;
int index; int index;
parseBusName(port_name, bus_brkts_left, bus_brkts_right, bus_name, index); parseBusName(port_name, bus_brkts_left, bus_brkts_right,
bus_name, index);
if (bus_name) { if (bus_name) {
if (!port->isBusBit()) { if (!port->isBusBit()) {
BusPort *bus_port = port_map.findKey(bus_name); BusPort *bus_port = port_map.findKey(bus_name);

View File

@ -112,8 +112,8 @@ public:
ConcretePort *makeBundlePort(const char *name, ConcretePort *makeBundlePort(const char *name,
ConcretePortSeq *members); ConcretePortSeq *members);
// Group previously defined bus bit ports together. // Group previously defined bus bit ports together.
void groupBusPorts(const char *bus_brkts_left, void groupBusPorts(const char bus_brkt_left,
const char *bus_brkts_right); const char bus_brkt_right);
size_t portCount() const; size_t portCount() const;
void setName(const char *name); void setName(const char *name);
virtual void addPort(ConcretePort *port); virtual void addPort(ConcretePort *port);

View File

@ -626,8 +626,10 @@ ConcreteNetwork::makeBusPort(Cell *cell,
void void
ConcreteNetwork::groupBusPorts(Cell *cell) ConcreteNetwork::groupBusPorts(Cell *cell)
{ {
Library *lib = library(cell);
ConcreteLibrary *clib = reinterpret_cast<ConcreteLibrary*>(lib);
ConcreteCell *ccell = reinterpret_cast<ConcreteCell*>(cell); ConcreteCell *ccell = reinterpret_cast<ConcreteCell*>(cell);
ccell->groupBusPorts(bus_brkts_left_, bus_brkts_right_); ccell->groupBusPorts(clib->busBrktLeft(), clib->busBrktRight());
} }
Port * Port *

View File

@ -27,9 +27,7 @@ namespace sta {
Network::Network() : Network::Network() :
default_liberty_(nullptr), default_liberty_(nullptr),
divider_('/'), divider_('/'),
escape_('\\'), escape_('\\')
bus_brkts_left_("["),
bus_brkts_right_("]")
{ {
} }
@ -1050,14 +1048,6 @@ Network::setPathEscape(char escape)
escape_ = escape; escape_ = escape;
} }
void
Network::setBusBrkts(char bus_brkt_left,
char bus_brkt_right)
{
bus_brkts_left_ = new char[2]{bus_brkt_left, '\0'};
bus_brkts_right_ = new char[2]{bus_brkt_right, '\0'};
}
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
typedef Vector<InstanceChildIterator *> InstanceChildIteratorSeq; typedef Vector<InstanceChildIterator *> InstanceChildIteratorSeq;

View File

@ -425,11 +425,6 @@ public:
// Escape prefix for path dividers in path names. // Escape prefix for path dividers in path names.
virtual char pathEscape() const { return escape_; } virtual char pathEscape() const { return escape_; }
virtual void setPathEscape(char escape); virtual void setPathEscape(char escape);
// Multiple brakets are supported but generally there is only one.
virtual void setBusBrkts(char bus_brkt_left,
char bus_brkt_right);
virtual const char *busBrktsRight() const { return bus_brkts_right_; }
virtual const char *busBrktsLeft() const { return bus_brkts_left_; }
protected: protected:
Pin *findPinLinear(const Instance *instance, Pin *findPinLinear(const Instance *instance,
@ -474,8 +469,6 @@ protected:
LibertyLibrary *default_liberty_; LibertyLibrary *default_liberty_;
char divider_; char divider_;
char escape_; char escape_;
const char *bus_brkts_left_;
const char *bus_brkts_right_;
NetDrvrPinsMap net_drvr_pin_map_; NetDrvrPinsMap net_drvr_pin_map_;
private: private: