@@ -123,17 +123,27 @@ void check_rr_graph(const t_graph_type graph_type,
123
123
124
124
t_rr_type to_rr_type = device_ctx.rr_nodes [to_node].type ();
125
125
126
- /* Only expect the following cases to have multiple edges
127
- * - chan <-> chan connections
128
- * - IPIN <-> chan connections (unique rr_node for IPIN nodes on multiple sides)
129
- * - OPIN <-> chan connections (unique rr_node for OPIN nodes on multiple sides)
126
+ /* It is unusual to have more than one programmable switch (in the same direction) between a from_node and a to_node,
127
+ * as the duplicate switch doesn't add more routing flexibility.
128
+ *
129
+ * However, such duplicate switches can occur for some types of nodes, which we allow below.
130
+ * Reasons one could have duplicate switches between two nodes include:
131
+ * - The two switches have different electrical characteristics.
132
+ * - Wires near the edges of an FPGA are often cut off, and the stubs connected together.
133
+ * A regular switch pattern could then result in one physical wire connecting multiple
134
+ * times to other wires, IPINs or OPINs.
135
+ *
136
+ * Only expect the following cases to have multiple edges
137
+ * - CHAN <-> CHAN connections
138
+ * - CHAN -> IPIN connections (unique rr_node for IPIN nodes on multiple sides)
139
+ * - OPIN -> CHAN connections (unique rr_node for OPIN nodes on multiple sides)
130
140
*/
131
- if (((to_rr_type != CHANX && to_rr_type != CHANY && rr_type != IPIN)
132
- || ( rr_type != CHANX && rr_type != CHANY))
133
- && (( to_rr_type != CHANX && to_rr_type != CHANY)
134
- || (rr_type != CHANX && rr_type != CHANY && rr_type != OPIN) )) {
141
+ bool is_chan_to_chan = (rr_type == CHANX || rr_type == CHANY) && ( to_rr_type == CHANY || to_rr_type == CHANX);
142
+ bool is_chan_to_ipin = (rr_type == CHANX || rr_type == CHANY) && to_rr_type == IPIN;
143
+ bool is_opin_to_chan = rr_type == OPIN && (to_rr_type == CHANX || to_rr_type == CHANY);
144
+ if (!(is_chan_to_chan || is_chan_to_ipin || is_opin_to_chan )) {
135
145
VPR_ERROR (VPR_ERROR_ROUTE,
136
- " in check_rr_graph: node %d (%s) connects to node %d (%s) %zu times - multi-connections only expected for CHAN->CHAN.\n " ,
146
+ " 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 " ,
137
147
inode, rr_node_typename[rr_type], to_node, rr_node_typename[to_rr_type], num_edges_to_node);
138
148
}
139
149
0 commit comments