aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/site_router.cc
diff options
context:
space:
mode:
authorAlessandro Comodi <acomodi@antmicro.com>2021-05-10 14:03:44 +0200
committerAlessandro Comodi <acomodi@antmicro.com>2021-05-10 14:05:46 +0200
commitbeff2b912c2dfdd05334f642e1d86bbd197b16ef (patch)
tree71f1de5b732dc57caf05d1c3f201fa22abcf437a /fpga_interchange/site_router.cc
parent432b9d8bde2faf9fbcc39ab0b82d02ce5115cdc8 (diff)
downloadnextpnr-beff2b912c2dfdd05334f642e1d86bbd197b16ef.tar.gz
nextpnr-beff2b912c2dfdd05334f642e1d86bbd197b16ef.tar.bz2
nextpnr-beff2b912c2dfdd05334f642e1d86bbd197b16ef.zip
interchange: site router: fix illegal site thru paths
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Diffstat (limited to 'fpga_interchange/site_router.cc')
-rw-r--r--fpga_interchange/site_router.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/fpga_interchange/site_router.cc b/fpga_interchange/site_router.cc
index f8cc2208..561b1790 100644
--- a/fpga_interchange/site_router.cc
+++ b/fpga_interchange/site_router.cc
@@ -157,6 +157,7 @@ struct SiteExpansionLoop
NPNR_ASSERT((*parent)->wire.type == SiteWire::SITE_WIRE);
NPNR_ASSERT(node->can_leave_site());
node->mark_left_site();
+ node->mark_left_site_after_entering();
} else if (wire.type == SiteWire::SITE_PORT_SOURCE) {
// This is a backward walk, so this is considered entering
// the site.
@@ -171,6 +172,7 @@ struct SiteExpansionLoop
// the site.
NPNR_ASSERT(node->can_leave_site());
node->mark_left_site();
+ node->mark_left_site_after_entering();
} else {
NPNR_ASSERT((*parent)->wire.type == SiteWire::SITE_PORT_SOURCE);
NPNR_ASSERT(node->can_enter_site());
@@ -274,6 +276,16 @@ struct SiteExpansionLoop
}
auto node = new_node(wire, pip, &parent_node);
+
+ if (!node->is_valid_node()) {
+ if (verbose_site_router(ctx)) {
+ log_info(
+ "Pip %s is not a valid for this path because it has left the site after entering it.\n",
+ ctx->nameOfPip(pip));
+ }
+ continue;
+ }
+
if (targets.count(wire)) {
completed_routes.push_back(node.get_index());
max_depth = std::max(max_depth, node->depth);