Skip to content

Commit e5af061

Browse files
authored
Merge pull request #2492 from verilog-to-routing/router_lookahead_file_extension
Router lookahead file extension
2 parents 109c5ad + 375ce09 commit e5af061

File tree

3 files changed

+18
-54
lines changed

3 files changed

+18
-54
lines changed

doc/src/vpr/command_line_usage.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ Use the options below to override this default naming behaviour.
350350

351351
.. option:: --read_rr_graph <file>
352352

353-
Reads in the routing resource graph named <file> loads it for use during the placement and routing stages. Expects a file extension of either ``.xml`` and ``.bin``.
353+
Reads in the routing resource graph named <file> loads it for use during the placement and routing stages. Expects a file extension of either ``.xml`` or ``.bin``.
354354

355355
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.
356356

@@ -368,22 +368,22 @@ Use the options below to override this default naming behaviour.
368368

369369
.. option:: --read_router_lookahead <file>
370370

371-
Reads the lookahead data from the specified file instead of computing it.
371+
Reads the lookahead data from the specified file instead of computing it. Expects a file extension of either ``.capnp`` or ``.bin``.
372372

373373
.. option:: --write_router_lookahead <file>
374374

375-
Writes the lookahead data to the specified file.
375+
Writes the lookahead data to the specified file. Accepted file extensions are ``.capnp``, ``.bin``, and ``.csv``.
376376

377377
.. option:: --read_placement_delay_lookup <file>
378378

379-
Reads the placement delay lookup from the specified file instead of computing it.
379+
Reads the placement delay lookup from the specified file instead of computing it. Expects a file extension of either ``.capnp`` or ``.bin``.
380380

381381
.. option:: --write_placement_delay_lookup <file>
382382

383-
Writes the placement delay lookup to the specified file.
383+
Writes the placement delay lookup to the specified file. Expects a file extension of either ``.capnp`` or ``.bin``.
384384
.. option:: --write_initial_place_file <file>
385385

386-
Writes out the the placement chosen by the initial placement algorithm to the specified file
386+
Writes out the the placement chosen by the initial placement algorithm to the specified file.
387387

388388
.. option:: --outfile_prefix <string>
389389

vpr/src/route/router_lookahead_map.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ void MapLookahead::write(const std::string& file_name) const {
463463
}
464464
dump_readable_router_lookahead_map(file_name, wire_cost_map_size, get_wire_cost_entry);
465465
} else {
466-
VTR_ASSERT(vtr::check_file_name_extension(file_name, ".capnp"));
466+
VTR_ASSERT(vtr::check_file_name_extension(file_name, ".capnp") || vtr::check_file_name_extension(file_name, ".bin"));
467467
write_router_lookahead(file_name);
468468
}
469469
}

vpr/src/route/router_lookahead_map_utils.cpp

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static void dijkstra_flood_to_ipins(RRNodeId node, util::t_chan_ipins_delays& ch
2626
* @param itile
2727
* @return Return the maximum ptc number of the SOURCE/OPINs of a tile type
2828
*/
29-
static int get_tile_src_opin_max_ptc_from_rr_graph(int itile);
29+
static int get_tile_src_opin_max_ptc(int itile);
3030

3131
static t_physical_tile_loc pick_sample_tile(int layer_num, t_physical_tile_type_ptr tile_type, t_physical_tile_loc prev);
3232

@@ -338,7 +338,7 @@ t_src_opin_delays compute_router_src_opin_lookahead(bool is_flat) {
338338

339339
// Get the maximum OPIN ptc for each tile type to reserve src_opin_delays
340340
for (int itile = 0; itile < (int)device_ctx.physical_tile_types.size(); itile++) {
341-
tile_max_ptc[itile] = get_tile_src_opin_max_ptc_from_rr_graph(itile);
341+
tile_max_ptc[itile] = get_tile_src_opin_max_ptc(itile);
342342
}
343343

344344
// 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
11141114
}
11151115
}
11161116

1117-
static int get_tile_src_opin_max_ptc_from_rr_graph(int itile) {
1117+
static int get_tile_src_opin_max_ptc(int itile) {
11181118
const auto& device_ctx = g_vpr_ctx.device();
11191119
const auto& physical_tile = device_ctx.physical_tile_types[itile];
1120-
const auto& rr_graph = device_ctx.rr_graph;
1121-
const int num_layers = device_ctx.grid.get_num_layers();
1122-
int max_ptc = OPEN;
1120+
int max_ptc = 0;
11231121

1124-
// Find a layer that has instances of the tile type
1125-
int tile_layer_num = OPEN;
1126-
for (int layer_num = 0; layer_num < num_layers; layer_num++) {
1127-
if (device_ctx.grid.num_instances(&physical_tile, layer_num) > 0) {
1128-
tile_layer_num = layer_num;
1129-
break;
1122+
// Output pin
1123+
for (const auto& class_inf: physical_tile.class_inf) {
1124+
if (class_inf.type != e_pin_type::DRIVER) {
1125+
continue;
11301126
}
1131-
}
1132-
1133-
if (tile_layer_num == OPEN) {
1134-
VTR_LOG_WARN("Found no sample locations for %s\n",
1135-
physical_tile.name);
1136-
max_ptc = OPEN;
1137-
} else {
1138-
for (e_rr_type rr_type : {SOURCE, OPIN}) {
1139-
t_physical_tile_loc sample_loc(OPEN, OPEN, OPEN);
1140-
sample_loc = pick_sample_tile(tile_layer_num, &physical_tile, sample_loc);
1141-
1142-
if (sample_loc.x == OPEN && sample_loc.y == OPEN && sample_loc.layer_num == OPEN) {
1143-
//No untried instances of the current tile type left
1144-
VTR_LOG_WARN("Found no sample locations for %s in %s\n",
1145-
rr_node_typename[rr_type],
1146-
physical_tile.name);
1147-
return OPEN;
1148-
}
1149-
1150-
const std::vector<RRNodeId>& rr_nodes_at_loc = device_ctx.rr_graph.node_lookup().find_grid_nodes_at_all_sides(sample_loc.layer_num,
1151-
sample_loc.x,
1152-
sample_loc.y,
1153-
rr_type);
1154-
for (RRNodeId node_id : rr_nodes_at_loc) {
1155-
int ptc = rr_graph.node_ptc_num(node_id);
1156-
// For the time being, we decide to not let the lookahead explore the node inside the clusters
1157-
if (!is_inter_cluster_node(&physical_tile,
1158-
rr_type,
1159-
ptc)) {
1160-
continue;
1161-
}
1162-
1163-
if (ptc >= max_ptc) {
1164-
max_ptc = ptc;
1165-
}
1127+
for (const auto& pin_ptc : class_inf.pinlist) {
1128+
if (pin_ptc > max_ptc) {
1129+
max_ptc = pin_ptc;
11661130
}
11671131
}
11681132
}

0 commit comments

Comments
 (0)