diff options
-rw-r--r-- | common/route.cc | 18 | ||||
-rw-r--r-- | frontend/json/jsonparse.cc | 4 |
2 files changed, 17 insertions, 5 deletions
diff --git a/common/route.cc b/common/route.cc index e9fe2204..79bf13b0 100644 --- a/common/route.cc +++ b/common/route.cc @@ -77,8 +77,13 @@ void route_design(Design *design, bool verbose) auto src_pos = chip.getBelPosition(src_bel); - auto src_wire = chip.getWireBelPin( - src_bel, portPinFromId(net_info->driver.port)); + IdString driver_port = net_info->driver.port; + + auto driver_port_it = net_info->driver.cell->pins.find(driver_port); + if (driver_port_it != net_info->driver.cell->pins.end()) + driver_port = driver_port_it->second; + + auto src_wire = chip.getWireBelPin(src_bel, portPinFromId(driver_port)); if (src_wire == WireId()) log_error("No wire found for port %s on source bel.\n", @@ -110,8 +115,15 @@ void route_design(Design *design, bool verbose) chip.estimateDelay(src_pos, dst_pos)); } + IdString user_port = user_it.port; + + auto user_port_it = user_it.cell->pins.find(user_port); + + if (user_port_it != user_it.cell->pins.end()) + user_port = user_port_it->second; + auto dst_wire = - chip.getWireBelPin(dst_bel, portPinFromId(user_it.port)); + chip.getWireBelPin(dst_bel, portPinFromId(user_port)); if (dst_wire == WireId()) log_error("No wire found for port %s on destination bel.\n", diff --git a/frontend/json/jsonparse.cc b/frontend/json/jsonparse.cc index 92590902..82874703 100644 --- a/frontend/json/jsonparse.cc +++ b/frontend/json/jsonparse.cc @@ -421,8 +421,8 @@ void json_import_ports(Design *design, const string &modname, // // Pick a name for this port if (is_bus) - this_port.name = - port_info.name.str() + "[" + std::to_string(index) + "]"; + this_port.name = port_info.name.str() + "[" + + std::to_string(index) + "]"; else this_port.name = port_info.name; this_port.type = port_info.type; |