Skip to content

Commit

Permalink
groupPorts port_is_big_endian -> port_msb_first
Browse files Browse the repository at this point in the history
Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Aug 13, 2021
1 parent 0c2255b commit 9495f5b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/sta/ConcreteLibrary.hh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public:
// Group previously defined bus bit ports together.
void groupBusPorts(const char bus_brkt_left,
const char bus_brkt_right,
std::function<bool(const char*)> port_big_endian_pred);
std::function<bool(const char*)> port_msb_first);
size_t portCount() const;
void setName(const char *name);
void addPort(ConcretePort *port);
Expand Down
2 changes: 1 addition & 1 deletion include/sta/ConcreteNetwork.hh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public:
int from_index,
int to_index);
virtual void groupBusPorts(Cell *cell,
std::function<bool(const char*)> port_is_big_endian);
std::function<bool(const char*)> port_msb_first);
virtual Port *makeBundlePort(Cell *cell,
const char *name,
PortSeq *members);
Expand Down
2 changes: 1 addition & 1 deletion include/sta/Network.hh
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ public:
int from_index,
int to_index) = 0;
virtual void groupBusPorts(Cell *cell,
std::function<bool(const char*)> port_is_big_endian) = 0;
std::function<bool(const char*)> port_msb_first) = 0;
virtual Port *makeBundlePort(Cell *cell,
const char *name,
PortSeq *members) = 0;
Expand Down
6 changes: 3 additions & 3 deletions network/ConcreteLibrary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ typedef Map<const char*, BusPort*, CharPtrLess> BusPortMap;
void
ConcreteCell::groupBusPorts(const char bus_brkt_left,
const char bus_brkt_right,
std::function<bool(const char*)> port_is_big_endian)
std::function<bool(const char*)> port_msb_first)
{
const char bus_brkts_left[2]{bus_brkt_left, '\0'};
const char bus_brkts_right[2]{bus_brkt_right, '\0'};
Expand Down Expand Up @@ -416,7 +416,7 @@ ConcreteCell::groupBusPorts(const char bus_brkt_left,
while (bus_iter.hasNext()) {
BusPort *bus_port = bus_iter.next();
const char *bus_name = bus_port->name();
bool is_big_endian = port_is_big_endian(bus_name);
bool msb_first = port_msb_first(bus_name);
ConcretePortSeq *members = bus_port->members();
sort(members, [&](ConcretePort *port1,
ConcretePort *port2) {
Expand All @@ -428,7 +428,7 @@ ConcreteCell::groupBusPorts(const char bus_brkt_left,
parseBusName(port2->name(), bus_brkts_left, bus_brkts_right, escape_,
bus_name, index2);
stringDelete(bus_name);
return is_big_endian ? index1 > index2 : index1 < index2;
return msb_first ? index1 > index2 : index1 < index2;
});

char *bus_name1;
Expand Down
4 changes: 2 additions & 2 deletions network/ConcreteNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -639,12 +639,12 @@ ConcreteNetwork::makeBusPort(Cell *cell,

void
ConcreteNetwork::groupBusPorts(Cell *cell,
std::function<bool(const char*)> port_is_big_endian)
std::function<bool(const char*)> port_msb_first)
{
Library *lib = library(cell);
ConcreteLibrary *clib = reinterpret_cast<ConcreteLibrary*>(lib);
ConcreteCell *ccell = reinterpret_cast<ConcreteCell*>(cell);
ccell->groupBusPorts(clib->busBrktLeft(), clib->busBrktRight(), port_is_big_endian);
ccell->groupBusPorts(clib->busBrktLeft(), clib->busBrktRight(), port_msb_first);
}

Port *
Expand Down

0 comments on commit 9495f5b

Please sign in to comment.