aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/arch_pack_io.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-07-26 16:01:21 +0100
committergatecat <gatecat@ds0.me>2021-07-26 16:01:53 +0100
commitb4602ae5bf9b975c66f8c83241f4e12619bb5b02 (patch)
tree1de81f2c2e8f5f3cf7665d82fc702aca08108b18 /fpga_interchange/arch_pack_io.cc
parent6be26fbde75bf5828d47457df2af10747599711a (diff)
downloadnextpnr-b4602ae5bf9b975c66f8c83241f4e12619bb5b02.tar.gz
nextpnr-b4602ae5bf9b975c66f8c83241f4e12619bb5b02.tar.bz2
nextpnr-b4602ae5bf9b975c66f8c83241f4e12619bb5b02.zip
interchange: Search backwards for IO macro placements, too
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'fpga_interchange/arch_pack_io.cc')
-rw-r--r--fpga_interchange/arch_pack_io.cc45
1 files changed, 32 insertions, 13 deletions
diff --git a/fpga_interchange/arch_pack_io.cc b/fpga_interchange/arch_pack_io.cc
index 85b0d202..3c7c566a 100644
--- a/fpga_interchange/arch_pack_io.cc
+++ b/fpga_interchange/arch_pack_io.cc
@@ -101,22 +101,41 @@ void Arch::place_iobufs(WireId pad_wire, NetInfo *net,
continue;
for (auto &port : cursor->ports) {
// Only consider routing downstream from outputs for now
- if (port.second.type != PORT_OUT || port.second.net == nullptr)
+ if (port.second.net == nullptr)
continue;
NetInfo *ni = port.second.net;
- WireId src_wire = ctx->getNetinfoSourceWire(ni);
- for (auto &usr : ni->users) {
- // Look for unplaced users in the same macro
- if (usr.cell->bel != BelId() || usr.cell->macro_parent != cursor->macro_parent)
+ if (port.second.type == PORT_OUT) {
+ WireId src_wire = ctx->getNetinfoSourceWire(ni);
+ for (auto &usr : ni->users) {
+ // Look for unplaced users in the same macro
+ if (usr.cell->bel != BelId() || usr.cell->macro_parent != cursor->macro_parent)
+ continue;
+ // Try and place using dedicated routing
+ if (search_routing_for_placement(this, src_wire, usr.cell, usr.port, true)) {
+ // Successful
+ placed_cells->insert(usr.cell);
+ place_queue.push(usr.cell);
+ if (ctx->verbose)
+ log_info("Placed %s at %s based on dedicated IO macro routing.\n", ctx->nameOf(usr.cell),
+ ctx->nameOfBel(usr.cell->bel));
+ }
+ }
+ } else {
+ auto &drv = ni->driver;
+ // Look for unplaced driver in the same macro
+ if (drv.cell->bel != BelId() || drv.cell->macro_parent != cursor->macro_parent)
continue;
- // Try and place using dedicated routing
- if (search_routing_for_placement(this, src_wire, usr.cell, usr.port, true)) {
- // Successful
- placed_cells->insert(usr.cell);
- place_queue.push(usr.cell);
- if (ctx->verbose)
- log_info("Placed %s at %s based on dedicated IO macro routing.\n", ctx->nameOf(usr.cell),
- ctx->nameOfBel(usr.cell->bel));
+ for (auto bel_pin : ctx->getBelPinsForCellPin(cursor, port.first)) {
+ // Try and place using dedicated routing
+ WireId dst_wire = ctx->getBelPinWire(cursor->bel, bel_pin);
+ if (search_routing_for_placement(this, dst_wire, drv.cell, drv.port, false)) {
+ // Successful
+ placed_cells->insert(drv.cell);
+ place_queue.push(drv.cell);
+ if (ctx->verbose)
+ log_info("Placed %s at %s based on dedicated IO macro routing.\n", ctx->nameOf(drv.cell),
+ ctx->nameOfBel(drv.cell->bel));
+ }
}
}
}