aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-07-26 16:58:00 +0100
committerGitHub <noreply@github.com>2021-07-26 16:58:00 +0100
commiteb6817c259bf0a757eb923a7418a43d2dd32f732 (patch)
tree359d5fac8c010aa2415317626383db22c5c20848 /fpga_interchange
parent0b36616940e1c57bba568abef9af9b440f760ea8 (diff)
parentb4602ae5bf9b975c66f8c83241f4e12619bb5b02 (diff)
downloadnextpnr-eb6817c259bf0a757eb923a7418a43d2dd32f732.tar.gz
nextpnr-eb6817c259bf0a757eb923a7418a43d2dd32f732.tar.bz2
nextpnr-eb6817c259bf0a757eb923a7418a43d2dd32f732.zip
Merge pull request #780 from YosysHQ/gatecat/fix-io-inv
interchange: Search backwards for IO macro placements, too
Diffstat (limited to 'fpga_interchange')
-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));
+ }
}
}
}