Skip to content

rr_nodes: add fan-in list generator #1592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions vpr/src/route/rr_graph_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,20 @@ void reorder_rr_graph_nodes(const t_router_opts& router_opts) {
std::get<2>(edge));
});
}

vtr::vector<RRNodeId, std::vector<RREdgeId>> get_fan_in_list() {
auto& rr_nodes = g_vpr_ctx.device().rr_nodes;

vtr::vector<RRNodeId, std::vector<RREdgeId>> node_fan_in_list;

node_fan_in_list.resize(rr_nodes.size(), std::vector<RREdgeId>(0));
node_fan_in_list.shrink_to_fit();

//Walk the graph and increment fanin on all dwnstream nodes
rr_nodes.for_each_edge(
[&](RREdgeId edge, __attribute__((unused)) RRNodeId src, RRNodeId sink) {
node_fan_in_list[sink].push_back(edge);
});

return node_fan_in_list;
}
6 changes: 6 additions & 0 deletions vpr/src/route/rr_graph_util.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#ifndef RR_GRAPH_UTIL_H
#define RR_GRAPH_UTIL_H

#include "vpr_types.h"

int seg_index_of_cblock(t_rr_type from_rr_type, int to_node);

int seg_index_of_sblock(int from_node, int to_node);

void reorder_rr_graph_nodes(const t_router_opts& router_opts);

// This function generates and returns a vector indexed by RRNodeId
// containing a list of fan-in edges for each node.
vtr::vector<RRNodeId, std::vector<RREdgeId>> get_fan_in_list();

#endif