groupPorts port_is_big_endian -> port_msb_first

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2021-08-12 17:46:02 -07:00
parent 0c2255beee
commit 9495f5b793
5 changed files with 8 additions and 8 deletions

View File

@ -118,7 +118,7 @@ public:
// Group previously defined bus bit ports together. // Group previously defined bus bit ports together.
void groupBusPorts(const char bus_brkt_left, void groupBusPorts(const char bus_brkt_left,
const char bus_brkt_right, 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; size_t portCount() const;
void setName(const char *name); void setName(const char *name);
void addPort(ConcretePort *port); void addPort(ConcretePort *port);

View File

@ -177,7 +177,7 @@ public:
int from_index, int from_index,
int to_index); int to_index);
virtual void groupBusPorts(Cell *cell, 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, virtual Port *makeBundlePort(Cell *cell,
const char *name, const char *name,
PortSeq *members); PortSeq *members);

View File

@ -549,7 +549,7 @@ public:
int from_index, int from_index,
int to_index) = 0; int to_index) = 0;
virtual void groupBusPorts(Cell *cell, 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, virtual Port *makeBundlePort(Cell *cell,
const char *name, const char *name,
PortSeq *members) = 0; PortSeq *members) = 0;

View File

@ -376,7 +376,7 @@ typedef Map<const char*, BusPort*, CharPtrLess> BusPortMap;
void void
ConcreteCell::groupBusPorts(const char bus_brkt_left, ConcreteCell::groupBusPorts(const char bus_brkt_left,
const char bus_brkt_right, 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_left[2]{bus_brkt_left, '\0'};
const char bus_brkts_right[2]{bus_brkt_right, '\0'}; const char bus_brkts_right[2]{bus_brkt_right, '\0'};
@ -416,7 +416,7 @@ ConcreteCell::groupBusPorts(const char bus_brkt_left,
while (bus_iter.hasNext()) { while (bus_iter.hasNext()) {
BusPort *bus_port = bus_iter.next(); BusPort *bus_port = bus_iter.next();
const char *bus_name = bus_port->name(); 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(); ConcretePortSeq *members = bus_port->members();
sort(members, [&](ConcretePort *port1, sort(members, [&](ConcretePort *port1,
ConcretePort *port2) { ConcretePort *port2) {
@ -428,7 +428,7 @@ ConcreteCell::groupBusPorts(const char bus_brkt_left,
parseBusName(port2->name(), bus_brkts_left, bus_brkts_right, escape_, parseBusName(port2->name(), bus_brkts_left, bus_brkts_right, escape_,
bus_name, index2); bus_name, index2);
stringDelete(bus_name); stringDelete(bus_name);
return is_big_endian ? index1 > index2 : index1 < index2; return msb_first ? index1 > index2 : index1 < index2;
}); });
char *bus_name1; char *bus_name1;

View File

@ -639,12 +639,12 @@ ConcreteNetwork::makeBusPort(Cell *cell,
void void
ConcreteNetwork::groupBusPorts(Cell *cell, 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); Library *lib = library(cell);
ConcreteLibrary *clib = reinterpret_cast<ConcreteLibrary*>(lib); ConcreteLibrary *clib = reinterpret_cast<ConcreteLibrary*>(lib);
ConcreteCell *ccell = reinterpret_cast<ConcreteCell*>(cell); 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 * Port *