keep route file updated with tileable rr_graph

This commit is contained in:
tangxifan 2019-08-13 15:37:42 -06:00
parent c7526cb43c
commit 4cffd8ac2d
3 changed files with 44 additions and 1 deletions

View File

@ -341,6 +341,33 @@ void add_edges_for_two_rr_nodes(const t_rr_graph* rr_graph,
}
/************************************************************************
* Get the track_id of a routing track w.r.t its coordinator
* In tileable routing architecture, the track_id changes SB by SB.
* Therefore the track_ids are stored in a vector, indexed by the relative coordinator
* based on the starting point of the track
* For routing tracks in INC_DIRECTION
* (xlow, ylow) should be the starting point
*
* (xlow, ylow) (xhigh, yhigh)
* track_id[0] -------------------------------> track_id[xhigh - xlow + yhigh - ylow]
*
* For routing tracks in DEC_DIRECTION
* (xhigh, yhigh) should be the starting point
*
* (xlow, ylow) (xhigh, yhigh)
* track_id[0] <------------------------------- track_id[xhigh - xlow + yhigh - ylow]
*
*
***********************************************************************/
short get_rr_node_actual_track_id(const t_rr_node* track_rr_node,
const DeviceCoordinator& coord) {
DeviceCoordinator low_coord(track_rr_node->xlow, track_rr_node->ylow);
size_t offset = (int)abs((int)coord.get_x() - (int)low_coord.get_x() + (int)coord.get_y() - (int)low_coord.get_y());
return track_rr_node->track_ids[offset];
}
/************************************************************************
* Get the coordinator of a starting point of a routing track
* For routing tracks in INC_DIRECTION

View File

@ -35,6 +35,9 @@ void add_edges_for_two_rr_nodes(const t_rr_graph* rr_graph,
const std::vector<int> des_rr_node,
const std::vector<short> driver_switches);
short get_rr_node_actual_track_id(const t_rr_node* track_rr_node,
const DeviceCoordinator& coord);
DeviceCoordinator get_track_rr_node_start_coordinator(const t_rr_node* track_rr_node);
DeviceCoordinator get_track_rr_node_end_coordinator(const t_rr_node* track_rr_node);

View File

@ -20,6 +20,8 @@
#include "buffer_insertion.h"
/* end */
#include "rr_graph_builder_utils.h"
/* Xifan TANG: useful functions for pb_pin_eq_auto_detect */
void reassign_rr_node_net_num_from_scratch();
@ -1214,7 +1216,18 @@ void print_route(char *route_file) {
break;
}
fprintf(fp, "%d ", rr_node[inode].ptc_num);
/* A kind of dirty fix for tileable routing,
* the track_ids is allocated by tileable routing.
* If the vector is not empty, it means tileable routing is enabled
* we need another function to get the track_id rather than ptc_num
*/
if (0 == rr_node[inode].track_ids.size()) {
fprintf(fp, "%d ", rr_node[inode].ptc_num);
} else {
/* Xifan Tang: for routing tracks, get the actual track ids */
DeviceCoordinator cur_coord(ilow, jlow);
fprintf(fp, "%d ", get_rr_node_actual_track_id(&(rr_node[inode]), cur_coord));
}
/* Uncomment line below if you're debugging and want to see the switch types *
* used in the routing. */