File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 2
2
#include < random>
3
3
#include < algorithm>
4
4
5
+ #include " rr_graph_util.h"
6
+
5
7
#include " vtr_memory.h"
6
8
#include " vtr_time.h"
7
9
8
10
#include " vpr_types.h"
9
11
#include " vpr_error.h"
10
12
11
13
#include " globals.h"
12
- #include " rr_graph_util.h"
13
14
14
15
int seg_index_of_cblock (t_rr_type from_rr_type, int to_node) {
15
16
/* Returns the segment number (distance along the channel) of the connection *
@@ -177,3 +178,20 @@ void reorder_rr_graph_nodes(const t_router_opts& router_opts) {
177
178
std::get<2 >(edge));
178
179
});
179
180
}
181
+
182
+ vtr::vector<RRNodeId, std::vector<RREdgeId>> get_fan_in_list () {
183
+ auto & rr_nodes = g_vpr_ctx.device ().rr_nodes ;
184
+
185
+ vtr::vector<RRNodeId, std::vector<RREdgeId>> node_fan_in_list;
186
+
187
+ node_fan_in_list.resize (rr_nodes.size (), std::vector<RREdgeId>(0 ));
188
+ node_fan_in_list.shrink_to_fit ();
189
+
190
+ // Walk the graph and increment fanin on all dwnstream nodes
191
+ rr_nodes.for_each_edge (
192
+ [&](RREdgeId edge, __attribute__ ((unused)) RRNodeId src, RRNodeId sink) {
193
+ node_fan_in_list[sink].push_back (edge);
194
+ });
195
+
196
+ return node_fan_in_list;
197
+ }
Original file line number Diff line number Diff line change 1
1
#ifndef RR_GRAPH_UTIL_H
2
2
#define RR_GRAPH_UTIL_H
3
3
4
+ #include " vpr_types.h"
5
+
4
6
int seg_index_of_cblock (t_rr_type from_rr_type, int to_node);
5
7
6
8
int seg_index_of_sblock (int from_node, int to_node);
7
9
8
10
void reorder_rr_graph_nodes (const t_router_opts& router_opts);
9
11
12
+ // This function generates and returns a vector indexed by RRNodeId
13
+ // containing a list of fan-in edges for each node.
14
+ vtr::vector<RRNodeId, std::vector<RREdgeId>> get_fan_in_list ();
15
+
10
16
#endif
You can’t perform that action at this time.
0 commit comments