From 3b3c39454b22977ce0999e979c7ffeffb95aa977 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Wed, 25 Mar 2020 17:55:28 -0600 Subject: [PATCH] update print_route() in VPR to show correct track_id when tileable routing is used --- vpr/src/route/route_common.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/vpr/src/route/route_common.cpp b/vpr/src/route/route_common.cpp index 4e1cda2ae..8fd661d05 100644 --- a/vpr/src/route/route_common.cpp +++ b/vpr/src/route/route_common.cpp @@ -1490,13 +1490,36 @@ void print_route(FILE* fp, const vtr::vector& traceba } else { /* IO Pad. */ fprintf(fp, " Pin: "); } + fprintf(fp, "%d ", device_ctx.rr_graph.node_pin_num(inode)); break; case CHANX: case CHANY: fprintf(fp, " Track: "); + /* Xifan Tang: + * The routing track id depends on the direction + * A routing track may have multiple track ids + * The track id is the starting point of a routing track + * - INC_DIRECTION: the first track id in the list + * - DEC_DIRECTION: the last track id in the list + * + * This is because (xlow, ylow) is always < (xhigh, yhigh) + * which is even true for DEC_DIRECTION routing tracks + */ + if (1 < device_ctx.rr_graph.node_track_ids(inode).size()) { + fprintf(fp, "("); + for (size_t itrack = 0; itrack < device_ctx.rr_graph.node_track_ids(inode).size(); ++itrack) { + if (0 < itrack) { + fprintf(fp, ", "); + } + fprintf(fp, "%d", device_ctx.rr_graph.node_track_ids(inode)[itrack]); + } + fprintf(fp, ") "); + } else { + VTR_ASSERT(1 == device_ctx.rr_graph.node_track_ids(inode).size()); + fprintf(fp, "%d ", device_ctx.rr_graph.node_track_num(inode)); + } break; - case SOURCE: case SINK: if (is_io_type(device_ctx.grid[ilow][jlow].type)) { @@ -1504,6 +1527,7 @@ void print_route(FILE* fp, const vtr::vector& traceba } else { /* IO Pad. */ fprintf(fp, " Class: "); } + fprintf(fp, "%d ", device_ctx.rr_graph.node_class_num(inode)); break; default: @@ -1513,7 +1537,7 @@ void print_route(FILE* fp, const vtr::vector& traceba break; } - fprintf(fp, "%d ", device_ctx.rr_graph.node_ptc_num(inode)); + //fprintf(fp, "%d ", device_ctx.rr_graph.node_ptc_num(inode)); if (!is_io_type(device_ctx.grid[ilow][jlow].type) && (rr_type == IPIN || rr_type == OPIN)) { int pin_num = device_ctx.rr_graph.node_ptc_num(inode);