interchange: site router: fix illegal site thru paths
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
This commit is contained in:
parent
432b9d8bde
commit
beff2b912c
@ -157,6 +157,7 @@ struct SiteExpansionLoop
|
|||||||
NPNR_ASSERT((*parent)->wire.type == SiteWire::SITE_WIRE);
|
NPNR_ASSERT((*parent)->wire.type == SiteWire::SITE_WIRE);
|
||||||
NPNR_ASSERT(node->can_leave_site());
|
NPNR_ASSERT(node->can_leave_site());
|
||||||
node->mark_left_site();
|
node->mark_left_site();
|
||||||
|
node->mark_left_site_after_entering();
|
||||||
} else if (wire.type == SiteWire::SITE_PORT_SOURCE) {
|
} else if (wire.type == SiteWire::SITE_PORT_SOURCE) {
|
||||||
// This is a backward walk, so this is considered entering
|
// This is a backward walk, so this is considered entering
|
||||||
// the site.
|
// the site.
|
||||||
@ -171,6 +172,7 @@ struct SiteExpansionLoop
|
|||||||
// the site.
|
// the site.
|
||||||
NPNR_ASSERT(node->can_leave_site());
|
NPNR_ASSERT(node->can_leave_site());
|
||||||
node->mark_left_site();
|
node->mark_left_site();
|
||||||
|
node->mark_left_site_after_entering();
|
||||||
} else {
|
} else {
|
||||||
NPNR_ASSERT((*parent)->wire.type == SiteWire::SITE_PORT_SOURCE);
|
NPNR_ASSERT((*parent)->wire.type == SiteWire::SITE_PORT_SOURCE);
|
||||||
NPNR_ASSERT(node->can_enter_site());
|
NPNR_ASSERT(node->can_enter_site());
|
||||||
@ -274,6 +276,16 @@ struct SiteExpansionLoop
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto node = new_node(wire, pip, &parent_node);
|
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)) {
|
if (targets.count(wire)) {
|
||||||
completed_routes.push_back(node.get_index());
|
completed_routes.push_back(node.get_index());
|
||||||
max_depth = std::max(max_depth, node->depth);
|
max_depth = std::max(max_depth, node->depth);
|
||||||
|
@ -45,14 +45,25 @@ struct RouteNode
|
|||||||
LEFT_SITE = 0,
|
LEFT_SITE = 0,
|
||||||
// Has this path entered the site?
|
// Has this path entered the site?
|
||||||
ENTERED_SITE = 1,
|
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() 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 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() { 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 has_entered_site() const { return (flags & (1 << ENTERED_SITE)) != 0; }
|
||||||
|
|
||||||
bool can_enter_site() const { return !has_entered_site(); }
|
bool can_enter_site() const { return !has_entered_site(); }
|
||||||
|
Loading…
Reference in New Issue
Block a user