Skip to content

check_rr_graph: fix bug when checking multi-connections between nodes #1579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions vpr/src/route/check_rr_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,27 @@ void check_rr_graph(const t_graph_type graph_type,

t_rr_type to_rr_type = device_ctx.rr_nodes[to_node].type();

/* Only expect the following cases to have multiple edges
* - chan <-> chan connections
* - IPIN <-> chan connections (unique rr_node for IPIN nodes on multiple sides)
* - OPIN <-> chan connections (unique rr_node for OPIN nodes on multiple sides)
/* It is unusual to have more than one programmable switch (in the same direction) between a from_node and a to_node,
* as the duplicate switch doesn't add more routing flexibility.
*
* However, such duplicate switches can occur for some types of nodes, which we allow below.
* Reasons one could have duplicate switches between two nodes include:
* - The two switches have different electrical characteristics.
* - Wires near the edges of an FPGA are often cut off, and the stubs connected together.
* A regular switch pattern could then result in one physical wire connecting multiple
* times to other wires, IPINs or OPINs.
*
* Only expect the following cases to have multiple edges
* - CHAN <-> CHAN connections
* - CHAN -> IPIN connections (unique rr_node for IPIN nodes on multiple sides)
* - OPIN -> CHAN connections (unique rr_node for OPIN nodes on multiple sides)
*/
if (((to_rr_type != CHANX && to_rr_type != CHANY && rr_type != IPIN)
|| (rr_type != CHANX && rr_type != CHANY))
&& ((to_rr_type != CHANX && to_rr_type != CHANY)
|| (rr_type != CHANX && rr_type != CHANY && rr_type != OPIN))) {
bool is_chan_to_chan = (rr_type == CHANX || rr_type == CHANY) && (to_rr_type == CHANY || to_rr_type == CHANX);
bool is_chan_to_ipin = (rr_type == CHANX || rr_type == CHANY) && to_rr_type == IPIN;
bool is_opin_to_chan = rr_type == OPIN && (to_rr_type == CHANX || to_rr_type == CHANY);
if (!(is_chan_to_chan || is_chan_to_ipin || is_opin_to_chan)) {
VPR_ERROR(VPR_ERROR_ROUTE,
"in check_rr_graph: node %d (%s) connects to node %d (%s) %zu times - multi-connections only expected for CHAN->CHAN.\n",
"in check_rr_graph: node %d (%s) connects to node %d (%s) %zu times - multi-connections only expected for CHAN<->CHAN, CHAN->IPIN, OPIN->CHAN.\n",
inode, rr_node_typename[rr_type], to_node, rr_node_typename[to_rr_type], num_edges_to_node);
}

Expand Down