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.
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);

View File

@ -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);

View File

@ -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;

View File

@ -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'};
@ -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) {
@ -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;

View File

@ -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 *