Skip to content

Commit

Permalink
Add support for CellInfo->pins in router
Browse files Browse the repository at this point in the history
Signed-off-by: Clifford Wolf <[email protected]>
  • Loading branch information
cliffordwolf committed Jun 13, 2018
1 parent 1a3d0f2 commit 794fc6d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
18 changes: 15 additions & 3 deletions common/route.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions frontend/json/jsonparse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 794fc6d

Please sign in to comment.