From 96e3cd90750c2441c4cddb5b343a2e25f234603f Mon Sep 17 00:00:00 2001 From: amin1377 Date: Tue, 20 Feb 2024 15:40:15 -0500 Subject: [PATCH 1/4] vpr: router: accept to dump to both capnp and bin extension --- vpr/src/route/router_lookahead_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpr/src/route/router_lookahead_map.cpp b/vpr/src/route/router_lookahead_map.cpp index 1bbbdb86b7e..41f7562cd02 100644 --- a/vpr/src/route/router_lookahead_map.cpp +++ b/vpr/src/route/router_lookahead_map.cpp @@ -463,7 +463,7 @@ void MapLookahead::write(const std::string& file_name) const { } dump_readable_router_lookahead_map(file_name, wire_cost_map_size, get_wire_cost_entry); } else { - VTR_ASSERT(vtr::check_file_name_extension(file_name, ".capnp")); + VTR_ASSERT(vtr::check_file_name_extension(file_name, ".capnp") || vtr::check_file_name_extension(file_name, ".bin")); write_router_lookahead(file_name); } } From 3f8d4058177ff4b32f448ed802e0f4f2d2abb7f1 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Tue, 20 Feb 2024 15:49:40 -0500 Subject: [PATCH 2/4] document: add the file extensions of router lookahead file to the doc --- doc/src/vpr/command_line_usage.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/vpr/command_line_usage.rst b/doc/src/vpr/command_line_usage.rst index fa0cd49017b..68943d2ea06 100644 --- a/doc/src/vpr/command_line_usage.rst +++ b/doc/src/vpr/command_line_usage.rst @@ -350,7 +350,7 @@ Use the options below to override this default naming behaviour. .. option:: --read_rr_graph - Reads in the routing resource graph named loads it for use during the placement and routing stages. Expects a file extension of either ``.xml`` and ``.bin``. + Reads in the routing resource graph named loads it for use during the placement and routing stages. Expects a file extension of either ``.xml`` or ``.bin``. The routing resource graph overthrows all the architecture definitions regarding switches, nodes, and edges. Other information such as grid information, block types, and segment information are matched with the architecture file to ensure accuracy. @@ -368,22 +368,22 @@ Use the options below to override this default naming behaviour. .. option:: --read_router_lookahead - Reads the lookahead data from the specified file instead of computing it. + Reads the lookahead data from the specified file instead of computing it. Expects a file extension of either ``.capnp`` or ``.bin``. .. option:: --write_router_lookahead - Writes the lookahead data to the specified file. + Writes the lookahead data to the specified file. Accepted fine extensions are ``.capnp``, ``.bin``, and ``.csv``. .. option:: --read_placement_delay_lookup - Reads the placement delay lookup from the specified file instead of computing it. + Reads the placement delay lookup from the specified file instead of computing it. Expects a file extension of either ``.capnp`` or ``.bin``. .. option:: --write_placement_delay_lookup - Writes the placement delay lookup to the specified file. + Writes the placement delay lookup to the specified file. Expects a file extension of either ``.capnp`` or ``.bin``. .. option:: --write_initial_place_file - Writes out the the placement chosen by the initial placement algorithm to the specified file + Writes out the the placement chosen by the initial placement algorithm to the specified file. .. option:: --outfile_prefix From 77711955f4a27de325b1dad91cc46f99ea6b6294 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Tue, 20 Feb 2024 16:00:28 -0500 Subject: [PATCH 3/4] document: fix a type --- doc/src/vpr/command_line_usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/vpr/command_line_usage.rst b/doc/src/vpr/command_line_usage.rst index 68943d2ea06..692098afadc 100644 --- a/doc/src/vpr/command_line_usage.rst +++ b/doc/src/vpr/command_line_usage.rst @@ -372,7 +372,7 @@ Use the options below to override this default naming behaviour. .. option:: --write_router_lookahead - Writes the lookahead data to the specified file. Accepted fine extensions are ``.capnp``, ``.bin``, and ``.csv``. + Writes the lookahead data to the specified file. Accepted file extensions are ``.capnp``, ``.bin``, and ``.csv``. .. option:: --read_placement_delay_lookup From 375ce0942515365eedf2e3ad1a5345803a7a7135 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Thu, 22 Feb 2024 14:50:13 -0500 Subject: [PATCH 4/4] vpr: router: get the max ptc of pins from the pin physical number instead of rr graph --- vpr/src/route/router_lookahead_map_utils.cpp | 58 ++++---------------- 1 file changed, 11 insertions(+), 47 deletions(-) diff --git a/vpr/src/route/router_lookahead_map_utils.cpp b/vpr/src/route/router_lookahead_map_utils.cpp index f34b45db594..3094c97e4d5 100644 --- a/vpr/src/route/router_lookahead_map_utils.cpp +++ b/vpr/src/route/router_lookahead_map_utils.cpp @@ -26,7 +26,7 @@ static void dijkstra_flood_to_ipins(RRNodeId node, util::t_chan_ipins_delays& ch * @param itile * @return Return the maximum ptc number of the SOURCE/OPINs of a tile type */ -static int get_tile_src_opin_max_ptc_from_rr_graph(int itile); +static int get_tile_src_opin_max_ptc(int itile); static t_physical_tile_loc pick_sample_tile(int layer_num, t_physical_tile_type_ptr tile_type, t_physical_tile_loc prev); @@ -338,7 +338,7 @@ t_src_opin_delays compute_router_src_opin_lookahead(bool is_flat) { // Get the maximum OPIN ptc for each tile type to reserve src_opin_delays for (int itile = 0; itile < (int)device_ctx.physical_tile_types.size(); itile++) { - tile_max_ptc[itile] = get_tile_src_opin_max_ptc_from_rr_graph(itile); + tile_max_ptc[itile] = get_tile_src_opin_max_ptc(itile); } // Resize src_opin_delays to accomodate enough ptc and layer @@ -1114,55 +1114,19 @@ static void dijkstra_flood_to_ipins(RRNodeId node, util::t_chan_ipins_delays& ch } } -static int get_tile_src_opin_max_ptc_from_rr_graph(int itile) { +static int get_tile_src_opin_max_ptc(int itile) { const auto& device_ctx = g_vpr_ctx.device(); const auto& physical_tile = device_ctx.physical_tile_types[itile]; - const auto& rr_graph = device_ctx.rr_graph; - const int num_layers = device_ctx.grid.get_num_layers(); - int max_ptc = OPEN; + int max_ptc = 0; - // Find a layer that has instances of the tile type - int tile_layer_num = OPEN; - for (int layer_num = 0; layer_num < num_layers; layer_num++) { - if (device_ctx.grid.num_instances(&physical_tile, layer_num) > 0) { - tile_layer_num = layer_num; - break; + // Output pin + for (const auto& class_inf: physical_tile.class_inf) { + if (class_inf.type != e_pin_type::DRIVER) { + continue; } - } - - if (tile_layer_num == OPEN) { - VTR_LOG_WARN("Found no sample locations for %s\n", - physical_tile.name); - max_ptc = OPEN; - } else { - for (e_rr_type rr_type : {SOURCE, OPIN}) { - t_physical_tile_loc sample_loc(OPEN, OPEN, OPEN); - sample_loc = pick_sample_tile(tile_layer_num, &physical_tile, sample_loc); - - if (sample_loc.x == OPEN && sample_loc.y == OPEN && sample_loc.layer_num == OPEN) { - //No untried instances of the current tile type left - VTR_LOG_WARN("Found no sample locations for %s in %s\n", - rr_node_typename[rr_type], - physical_tile.name); - return OPEN; - } - - const std::vector& rr_nodes_at_loc = device_ctx.rr_graph.node_lookup().find_grid_nodes_at_all_sides(sample_loc.layer_num, - sample_loc.x, - sample_loc.y, - rr_type); - for (RRNodeId node_id : rr_nodes_at_loc) { - int ptc = rr_graph.node_ptc_num(node_id); - // For the time being, we decide to not let the lookahead explore the node inside the clusters - if (!is_inter_cluster_node(&physical_tile, - rr_type, - ptc)) { - continue; - } - - if (ptc >= max_ptc) { - max_ptc = ptc; - } + for (const auto& pin_ptc : class_inf.pinlist) { + if (pin_ptc > max_ptc) { + max_ptc = pin_ptc; } } }