diff --git a/openfpga/src/fabric/build_top_module_connection.cpp b/openfpga/src/fabric/build_top_module_connection.cpp index 2493c20c9..d5d4e7aea 100644 --- a/openfpga/src/fabric/build_top_module_connection.cpp +++ b/openfpga/src/fabric/build_top_module_connection.cpp @@ -753,17 +753,17 @@ static void add_top_module_nets_connect_sb_and_cb( * is_cb_exist() FOr RIGHT and BOTTOM side, find the adjacent RRGSB and then * use is_cb_exist() */ - if (TOP == side_manager.get_side() || LEFT == side_manager.get_side()) { + if (BOTTOM == side_manager.get_side() || LEFT == side_manager.get_side()) { if (false == rr_gsb.is_cb_exist(cb_type)) { continue; } } - if (RIGHT == side_manager.get_side() || BOTTOM == side_manager.get_side()) { + if (RIGHT == side_manager.get_side() || TOP == side_manager.get_side()) { /* Only for the condition where cbs are on perimeter, the neighbour cb will be invalid * Bypass in such case on finding neighbour cbs */ - if (BOTTOM == side_manager.get_side() && instance_sb_coordinate.y() == 0) { + if (TOP == side_manager.get_side() && instance_sb_coordinate.y() == device_rr_gsb.get_gsb_range().y()) { continue; } if (RIGHT == side_manager.get_side() && instance_sb_coordinate.x() == device_rr_gsb.get_gsb_range().x()) { diff --git a/openfpga/src/fabric/build_top_module_utils.cpp b/openfpga/src/fabric/build_top_module_utils.cpp index ebf52eb77..8b7c8f2e6 100644 --- a/openfpga/src/fabric/build_top_module_utils.cpp +++ b/openfpga/src/fabric/build_top_module_utils.cpp @@ -100,13 +100,13 @@ vtr::Point find_top_module_gsb_coordinate_by_sb_side( vtr::Point gsb_coordinate; - if ((TOP == sb_side) || (LEFT == sb_side)) { + if ((BOTTOM == sb_side) || (LEFT == sb_side)) { gsb_coordinate.set_x(rr_gsb.get_x()); gsb_coordinate.set_y(rr_gsb.get_y()); return gsb_coordinate; } - VTR_ASSERT((RIGHT == sb_side) || (BOTTOM == sb_side)); + VTR_ASSERT((RIGHT == sb_side) || (TOP == sb_side)); /* RIGHT side: x + 1 */ if (RIGHT == sb_side) { @@ -115,9 +115,9 @@ vtr::Point find_top_module_gsb_coordinate_by_sb_side( } /* BOTTOM side: y - 1 */ - if (BOTTOM == sb_side) { + if (TOP == sb_side) { gsb_coordinate.set_x(rr_gsb.get_x()); - gsb_coordinate.set_y(rr_gsb.get_y() - 1); + gsb_coordinate.set_y(rr_gsb.get_y() + 1); } return gsb_coordinate;