aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/site_routing_storage.h
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-05-10 16:05:34 +0100
committerGitHub <noreply@github.com>2021-05-10 16:05:34 +0100
commit466de95312c366aaf09b2f542b1e09d2ce9d1075 (patch)
treeed973edac6d356c08eaff3ee9238e12d8d2eb176 /fpga_interchange/site_routing_storage.h
parent432b9d8bde2faf9fbcc39ab0b82d02ce5115cdc8 (diff)
parent45618faf36aed7e1240e2ec524b0156546a3d41b (diff)
downloadnextpnr-466de95312c366aaf09b2f542b1e09d2ce9d1075.tar.gz
nextpnr-466de95312c366aaf09b2f542b1e09d2ce9d1075.tar.bz2
nextpnr-466de95312c366aaf09b2f542b1e09d2ce9d1075.zip
Merge pull request #695 from acomodi/fix-illegal-site-thru
interchange: fix site-thru pip legality
Diffstat (limited to 'fpga_interchange/site_routing_storage.h')
-rw-r--r--fpga_interchange/site_routing_storage.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/fpga_interchange/site_routing_storage.h b/fpga_interchange/site_routing_storage.h
index a8ea51f5..2fbc246e 100644
--- a/fpga_interchange/site_routing_storage.h
+++ b/fpga_interchange/site_routing_storage.h
@@ -45,14 +45,25 @@ struct RouteNode
LEFT_SITE = 0,
// Has this path entered the site?
ENTERED_SITE = 1,
+ // Has this path left the site after entering it?
+ // This node should be discarded as being part of an illegal path
+ // which allows entering and exiting a site, situation that needs
+ // to be handled with a tile PIP.
+ LEFT_SITE_AFTER_ENTERING = 2,
};
bool has_left_site() const { return (flags & (1 << LEFT_SITE)) != 0; }
+ bool has_left_site_after_entering() const { return (flags & (1 << LEFT_SITE_AFTER_ENTERING)) != 0; }
+
bool can_leave_site() const { return !has_left_site(); }
+ bool is_valid_node() const { return !has_left_site_after_entering(); }
+
void mark_left_site() { flags |= (1 << LEFT_SITE); }
+ void mark_left_site_after_entering() { flags |= (has_entered_site() << LEFT_SITE_AFTER_ENTERING); }
+
bool has_entered_site() const { return (flags & (1 << ENTERED_SITE)) != 0; }
bool can_enter_site() const { return !has_entered_site(); }