From ebf5636e7be6abb965db09b6de79bad004e064b7 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 26 Jun 2020 17:10:51 -0600 Subject: [PATCH] add verbose output to edge sorting for GSBs --- openfpga/src/annotation/annotate_rr_graph.cpp | 20 ++++++++++++++++++- openfpga/src/annotation/annotate_rr_graph.h | 3 ++- openfpga/src/base/openfpga_link_arch.cpp | 3 ++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/openfpga/src/annotation/annotate_rr_graph.cpp b/openfpga/src/annotation/annotate_rr_graph.cpp index 644f4541c..3815c6305 100644 --- a/openfpga/src/annotation/annotate_rr_graph.cpp +++ b/openfpga/src/annotation/annotate_rr_graph.cpp @@ -446,20 +446,38 @@ void annotate_device_rr_gsb(const DeviceContext& vpr_device_ctx, * output ports of the GSB *******************************************************************/ void sort_device_rr_gsb_chan_node_in_edges(const RRGraph& rr_graph, - DeviceRRGSB& device_rr_gsb) { + DeviceRRGSB& device_rr_gsb, + const bool& verbose_output) { vtr::ScopedStartFinishTimer timer("Sort incoming edges for each routing track output node of General Switch Block(GSB)"); /* Note that the GSB array is smaller than the grids by 1 column and 1 row!!! */ vtr::Point gsb_range = device_rr_gsb.get_gsb_range(); + VTR_LOGV(verbose_output, + "Start sorting edges for GSBs up to [%lu][%lu]\n", + gsb_range.x(), gsb_range.y()); + + size_t gsb_cnt = 0; + /* For each switch block, determine the size of array */ for (size_t ix = 0; ix < gsb_range.x(); ++ix) { for (size_t iy = 0; iy < gsb_range.y(); ++iy) { vtr::Point gsb_coordinate(ix, iy); RRGSB& rr_gsb = device_rr_gsb.get_mutable_gsb(gsb_coordinate); rr_gsb.sort_chan_node_in_edges(rr_graph); + + gsb_cnt++; /* Update counter */ + + /* Print info */ + VTR_LOG("[%lu%] Sorted edges for GSB[%lu][%lu]\r", + 100 * gsb_cnt / (gsb_range.x() * gsb_range.y()), + ix, iy); } } + + /* Report number of unique mirrors */ + VTR_LOG("Sorted edges for %d General Switch Blocks (GSBs).\n", + gsb_range.x() * gsb_range.y()); } /******************************************************************** diff --git a/openfpga/src/annotation/annotate_rr_graph.h b/openfpga/src/annotation/annotate_rr_graph.h index 69346a481..9ba879553 100644 --- a/openfpga/src/annotation/annotate_rr_graph.h +++ b/openfpga/src/annotation/annotate_rr_graph.h @@ -20,7 +20,8 @@ void annotate_device_rr_gsb(const DeviceContext& vpr_device_ctx, const bool& verbose_output); void sort_device_rr_gsb_chan_node_in_edges(const RRGraph& rr_graph, - DeviceRRGSB& device_rr_gsb); + DeviceRRGSB& device_rr_gsb, + const bool& verbose_output); void annotate_rr_graph_circuit_models(const DeviceContext& vpr_device_ctx, const Arch& openfpga_arch, diff --git a/openfpga/src/base/openfpga_link_arch.cpp b/openfpga/src/base/openfpga_link_arch.cpp index ff8bd6151..06ad2ac27 100644 --- a/openfpga/src/base/openfpga_link_arch.cpp +++ b/openfpga/src/base/openfpga_link_arch.cpp @@ -124,7 +124,8 @@ int link_arch(OpenfpgaContext& openfpga_ctx, if (true == cmd_context.option_enable(cmd, opt_sort_edge)) { sort_device_rr_gsb_chan_node_in_edges(g_vpr_ctx.device().rr_graph, - openfpga_ctx.mutable_device_rr_gsb()); + openfpga_ctx.mutable_device_rr_gsb(), + cmd_context.option_enable(cmd, opt_verbose)); } /* Build multiplexer library */