start fixing the bug in thru channels

This commit is contained in:
tangxifan 2020-08-19 12:18:35 -06:00
parent d7efdf35b6
commit af1c7c6f29
3 changed files with 46 additions and 8 deletions

View File

@ -172,7 +172,21 @@ size_t get_grid_num_classes(const t_grid_tile& cur_grid,
* When height_offset == height - 1, it means that the grid is at the top side of this multi-width and multi-height block * When height_offset == height - 1, it means that the grid is at the top side of this multi-width and multi-height block
***********************************************************************/ ***********************************************************************/
bool is_chanx_exist(const DeviceGrid& grids, bool is_chanx_exist(const DeviceGrid& grids,
const vtr::Point<size_t>& chanx_coord) { const vtr::Point<size_t>& chanx_coord,
const bool& through_channel) {
if ((1 > chanx_coord.x()) || (chanx_coord.x() > grids.width() - 2)) {
return false;
}
if (chanx_coord.y() > grids.height() - 2) {
return false;
}
if (true == through_channel) {
return true;
}
return (grids[chanx_coord.x()][chanx_coord.y()].height_offset == grids[chanx_coord.x()][chanx_coord.y()].type->height - 1); return (grids[chanx_coord.x()][chanx_coord.y()].height_offset == grids[chanx_coord.x()][chanx_coord.y()].type->height - 1);
} }
@ -192,9 +206,26 @@ bool is_chanx_exist(const DeviceGrid& grids,
* If the CHANY is in the middle of a multi-width and multi-height grid * If the CHANY is in the middle of a multi-width and multi-height grid
* it should locate at a grid whose width_offset is lower than the its width defined in physical_tile * it should locate at a grid whose width_offset is lower than the its width defined in physical_tile
* When height_offset == height - 1, it means that the grid is at the top side of this multi-width and multi-height block * When height_offset == height - 1, it means that the grid is at the top side of this multi-width and multi-height block
*
* If through channel is allowed, the chany will always exists
* unless it falls out of the grid array
***********************************************************************/ ***********************************************************************/
bool is_chany_exist(const DeviceGrid& grids, bool is_chany_exist(const DeviceGrid& grids,
const vtr::Point<size_t>& chany_coord) { const vtr::Point<size_t>& chany_coord,
const bool& through_channel) {
if (chany_coord.x() > grids.width() - 2) {
return false;
}
if ((1 > chany_coord.y()) || (chany_coord.y() > grids.height() - 2)) {
return false;
}
if (true == through_channel) {
return true;
}
return (grids[chany_coord.x()][chany_coord.y()].width_offset == grids[chany_coord.x()][chany_coord.y()].type->width - 1); return (grids[chany_coord.x()][chany_coord.y()].width_offset == grids[chany_coord.x()][chany_coord.y()].type->width - 1);
} }

View File

@ -40,10 +40,12 @@ size_t get_grid_num_classes(const t_grid_tile& cur_grid,
const e_pin_type& pin_type); const e_pin_type& pin_type);
bool is_chanx_exist(const DeviceGrid& grids, bool is_chanx_exist(const DeviceGrid& grids,
const vtr::Point<size_t>& chanx_coord); const vtr::Point<size_t>& chanx_coord,
const bool& through_channel=false);
bool is_chany_exist(const DeviceGrid& grids, bool is_chany_exist(const DeviceGrid& grids,
const vtr::Point<size_t>& chany_coord); const vtr::Point<size_t>& chany_coord,
const bool& through_channel=false);
bool is_chanx_right_to_multi_height_grid(const DeviceGrid& grids, bool is_chanx_right_to_multi_height_grid(const DeviceGrid& grids,
const vtr::Point<size_t>& chanx_coord, const vtr::Point<size_t>& chanx_coord,

View File

@ -186,7 +186,8 @@ size_t estimate_num_chanx_rr_nodes(const DeviceGrid& grids,
vtr::Point<size_t> chanx_coord(ix, iy); vtr::Point<size_t> chanx_coord(ix, iy);
/* Bypass if the routing channel does not exist when through channels are not allowed */ /* Bypass if the routing channel does not exist when through channels are not allowed */
if (false == is_chanx_exist(grids, chanx_coord)) { if ( (false == through_channel)
&& (false == is_chanx_exist(grids, chanx_coord))) {
continue; continue;
} }
@ -237,11 +238,13 @@ size_t estimate_num_chany_rr_nodes(const DeviceGrid& grids,
for (size_t iy = 1; iy < grids.height() - 1; ++iy) { for (size_t iy = 1; iy < grids.height() - 1; ++iy) {
vtr::Point<size_t> chany_coord(ix, iy); vtr::Point<size_t> chany_coord(ix, iy);
/* Bypass if the routing channel does not exist when through channels are not allowed */ /* Bypass if the routing channel does not exist when through channel are not allowed */
if (false == is_chany_exist(grids, chany_coord)) { if ( (false == through_channel)
&& (false == is_chany_exist(grids, chany_coord))) {
continue; continue;
} }
bool force_start = false; bool force_start = false;
bool force_end = false; bool force_end = false;
@ -922,7 +925,9 @@ void load_chany_rr_nodes_basic_info(RRGraph& rr_graph,
ChanNodeDetails chany_details = build_unidir_chan_node_details(chan_width, grids.height() - 2, ChanNodeDetails chany_details = build_unidir_chan_node_details(chan_width, grids.height() - 2,
force_start, force_end, segment_infs); force_start, force_end, segment_infs);
/* Force node_ids from the previous chanx */ /* Force node_ids from the previous chany
* This will not be applied when the routing channel is cut off (force to start)
*/
if (0 < track_node_ids.size()) { if (0 < track_node_ids.size()) {
/* Rotate should be done based on a typical case of routing tracks. /* Rotate should be done based on a typical case of routing tracks.
* Tracks on the borders are not regularly started and ended, * Tracks on the borders are not regularly started and ended,