Skip to content

Commit 058192e

Browse files
committed
Add comments around edge sorting.
Signed-off-by: Keith Rothman <[email protected]>
1 parent eb13bd0 commit 058192e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

vpr/src/route/rr_graph_storage.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class edge_compare_src_node_and_configurable_first {
254254
const std::vector<t_rr_switch_inf>& rr_switch_inf_;
255255
};
256256

257-
void t_rr_graph_storage::assign_edges() {
257+
void t_rr_graph_storage::assign_first_edges() {
258258
VTR_ASSERT(first_edge_.empty());
259259

260260
// Last element is a dummy element
@@ -418,14 +418,19 @@ void t_rr_graph_storage::partition_edges() {
418418
VTR_ASSERT(remapped_edges_);
419419

420420
const auto& device_ctx = g_vpr_ctx.device();
421+
// This sort ensures two things:
422+
// - Edges are stored in ascending source node order. This is required
423+
// by assign_first_edges()
424+
// - Edges within a source node have the configurable edges before the
425+
// non-configurable edges.
421426
std::stable_sort(
422427
edge_sort_iterator(this, 0),
423428
edge_sort_iterator(this, edge_src_node_.size()),
424429
edge_compare_src_node_and_configurable_first(device_ctx.rr_switch_inf));
425430

426431
partitioned_ = true;
427432

428-
assign_edges();
433+
assign_first_edges();
429434

430435
VTR_ASSERT_SAFE(validate());
431436
}

vpr/src/route/rr_graph_storage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ class t_rr_graph_storage {
340340

341341
// Take allocated edges in edge_src_node_/ edge_dest_node_ / edge_switch_
342342
// sort, and assign the first edge for each
343-
void assign_edges();
343+
void assign_first_edges();
344344

345345
// Verify that first_edge_ array correctly partitions rr edge data.
346346
bool verify_first_edges() const;

0 commit comments

Comments
 (0)