remove the direct connected IPIN/OPIN from RR GSB builder

This commit is contained in:
tangxifan 2020-03-21 11:38:39 -06:00
parent 2ff2d65e58
commit 28123b8052
6 changed files with 88 additions and 2 deletions

View File

@ -12,6 +12,7 @@
/* Headers from vpr library */
#include "rr_graph_obj_util.h"
#include "openfpga_rr_graph_utils.h"
#include "annotate_rr_graph.h"
@ -264,9 +265,18 @@ RRGSB build_rr_gsb(const DeviceContext& vpr_device_ctx,
vpr_device_ctx.rr_graph.node_configurable_out_edges(inode).end())) {
continue;
}
/* Do not consider OPINs that directly drive an IPIN
* they are supposed to be handled by direct connection
*/
if (true == is_opin_direct_connected_ipin(vpr_device_ctx.rr_graph, inode)) {
continue;
}
/* Grid[x+1][y+1] Bottom side outputs pins */
rr_gsb.add_opin_node(inode, side_manager.get_side());
}
for (const RRNodeId& inode : temp_opin_rr_nodes[1]) {
/* Skip those has no configurable outgoing, they should NOT appear in the GSB connection
* This is for those grid output pins used by direct connections
@ -276,6 +286,13 @@ RRGSB build_rr_gsb(const DeviceContext& vpr_device_ctx,
continue;
}
/* Do not consider OPINs that directly drive an IPIN
* they are supposed to be handled by direct connection
*/
if (true == is_opin_direct_connected_ipin(vpr_device_ctx.rr_graph, inode)) {
continue;
}
/* Grid[x+1][y] TOP side outputs pins */
rr_gsb.add_opin_node(inode, side_manager.get_side());
}
@ -356,6 +373,13 @@ RRGSB build_rr_gsb(const DeviceContext& vpr_device_ctx,
ix, iy, IPIN, ipin_rr_node_grid_side);
/* Fill the ipin nodes of RRGSB */
for (const RRNodeId& inode : temp_ipin_rr_nodes) {
/* Do not consider IPINs that are directly connected by an OPIN
* they are supposed to be handled by direct connection
*/
if (true == is_ipin_direct_connected_opin(vpr_device_ctx.rr_graph, inode)) {
continue;
}
rr_gsb.add_ipin_node(inode, side_manager.get_side());
}
/* Clear the temp data */

View File

@ -674,6 +674,9 @@ TileDirect build_device_tile_direct(const DeviceContext& device_ctx,
arch_direct_id);
}
VTR_LOG("Built %lu tile-to-tile direct connections\n",
std::distance(tile_direct.directs().begin(), tile_direct.directs().end()));
return tile_direct;
}

View File

@ -159,7 +159,7 @@
</tiles>
<!-- ODIN II specific config ends -->
<!-- Physical descriptions begin -->
<layout tileable="true">
<layout tileable="false">
<!--auto_layout aspect_ratio="1.0"-->
<fixed_layout name="2x2" width="4" height="4">
<!--Perimeter of 'io' blocks with 'EMPTY' blocks at corners-->

View File

@ -128,4 +128,56 @@ std::vector<RRNodeId> get_rr_graph_non_configurable_driver_nodes(const RRGraph&
return driver_nodes;
}
/************************************************************************
* Check if an OPIN of a rr_graph is directly driving an IPIN
* To meet this requirement, the OPIN must:
* - Have only 1 fan-out
* - The only fan-out is an IPIN
***********************************************************************/
bool is_opin_direct_connected_ipin(const RRGraph& rr_graph,
const RRNodeId& node) {
/* We only accept OPIN */
VTR_ASSERT(OPIN == rr_graph.node_type(node));
if (1 != rr_graph.node_out_edges(node).size()) {
return false;
}
VTR_ASSERT(1 == rr_graph.node_out_edges(node).size());
for (const RREdgeId& edge: rr_graph.node_out_edges(node)) {
const RRNodeId& sink_node = rr_graph.edge_sink_node(edge);
if (IPIN != rr_graph.node_type(sink_node)) {
return false;
}
}
return true;
}
/************************************************************************
* Check if an IPIN of a rr_graph is directly connected to an OPIN
* To meet this requirement, the IPIN must:
* - Have only 1 fan-in
* - The only fan-in is an OPIN
***********************************************************************/
bool is_ipin_direct_connected_opin(const RRGraph& rr_graph,
const RRNodeId& node) {
/* We only accept IPIN */
VTR_ASSERT(IPIN == rr_graph.node_type(node));
if (1 != rr_graph.node_in_edges(node).size()) {
return false;
}
VTR_ASSERT(1 == rr_graph.node_in_edges(node).size());
for (const RREdgeId& edge: rr_graph.node_in_edges(node)) {
const RRNodeId& src_node = rr_graph.edge_src_node(edge);
if (OPIN != rr_graph.node_type(src_node)) {
return false;
}
}
return true;
}
} /* end namespace openfpga */

View File

@ -35,6 +35,12 @@ std::vector<RRNodeId> get_rr_graph_configurable_driver_nodes(const RRGraph& rr_g
std::vector<RRNodeId> get_rr_graph_non_configurable_driver_nodes(const RRGraph& rr_graph,
const RRNodeId& node);
bool is_opin_direct_connected_ipin(const RRGraph& rr_graph,
const RRNodeId& node);
bool is_ipin_direct_connected_opin(const RRGraph& rr_graph,
const RRNodeId& node);
} /* end namespace openfpga */
#endif

View File

@ -445,7 +445,8 @@ bool RRGSB::is_sb_node_passing_wire(const RRGraph& rr_graph,
* we should be able to find the node on the opposite side of the GSB!
*/
if (true != is_sb_node_exist_opposite_side(rr_graph, track_node, node_side)) {
VTR_LOG("GSB[%lu][%lu] track node:\n", get_x(), get_y());
VTR_LOG("GSB[%lu][%lu] track node[%lu] at %s:\n",
get_x(), get_y(), track_id, SIDE_STRING[node_side]);
rr_graph.print_node(track_node);
}
VTR_ASSERT (true == is_sb_node_exist_opposite_side(rr_graph, track_node, node_side));