Skip to content

Commit 89885eb

Browse files
author
Umar Iqbal
committed
Replacing device_ctx.rr_segments with rr_graph.rr_segments from respective files
1 parent d456bc2 commit 89885eb

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

vpr/src/power/power.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ static void power_usage_routing(t_power_usage* power_usage,
912912
wire_length = rr_graph.node_yhigh(rr_node) - rr_graph.node_ylow(rr_node) + 1;
913913
}
914914
int seg_index = device_ctx.rr_indexed_data[rr_graph.node_cost_index(rr_node)].seg_index;
915-
C_wire = wire_length * device_ctx.rr_segments[seg_index].Cmetal;
915+
C_wire = wire_length * rr_graph.rr_segments(seg_index).Cmetal;
916916
//(double)power_ctx.commonly_used->tile_length);
917917
VTR_ASSERT(node_power->selected_input < node_fan_in);
918918

vpr/src/power/power_sizing.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,19 +378,20 @@ static double power_count_transistors_switchbox() {
378378
power_ctx.arch->mux_transistor_size));
379379

380380
auto& device_ctx = g_vpr_ctx.device();
381+
const auto& rr_graph = device_ctx.rr_graph;
381382

382383
for (size_t seg_idx = 0; seg_idx < device_ctx.rr_segments.size(); seg_idx++) {
383384
/* In each switchbox, the different types of segments occur with relative freqencies.
384385
* Thus the total number of wires of each segment type is (#tracks * freq * 2).
385386
* The (x2) factor accounts for vertical and horizontal tracks.
386387
* Of the wires of each segment type only (1/seglength) will have a mux&buffer.
387388
*/
388-
float freq_frac = (float)device_ctx.rr_segments[seg_idx].frequency
389+
float freq_frac = (float)rr_graph.rr_segments(seg_idx).frequency
389390
/ (float)MAX_CHANNEL_WIDTH;
390391

391392
transistor_cnt += transistors_per_buf_mux * 2 * freq_frac
392393
* power_ctx.solution_inf.channel_width
393-
* (1 / (float)device_ctx.rr_segments[seg_idx].length);
394+
* (1 / (float)rr_graph.rr_segments(seg_idx).length);
394395
}
395396

396397
return transistor_cnt;

vpr/src/route/router_lookahead_extended_map.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ std::pair<float, float> ExtendedMapLookahead::get_expected_delay_and_cong(RRNode
229229
float expected_cost = expected_delay_cost + expected_cong_cost;
230230

231231
VTR_LOGV_DEBUG(f_router_debug, "Requested lookahead from node %d to %d\n", size_t(from_node), size_t(to_node));
232-
const std::string& segment_name = device_ctx.rr_segments[from_seg_index].name;
232+
const std::string& segment_name = rr_graph.rr_segments(from_seg_index).name;
233233
VTR_LOGV_DEBUG(f_router_debug, "Lookahead returned %s (%d) with distance (%d, %d)\n",
234234
segment_name.c_str(), from_seg_index,
235235
dx, dy);

vpr/src/route/rr_graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2444,7 +2444,7 @@ std::string describe_rr_node(int inode) {
24442444
if (seg_index < (int)device_ctx.rr_segments.size()) {
24452445
msg += vtr::string_fmt(" track: %d longline: %d",
24462446
rr_node.track_num(),
2447-
device_ctx.rr_segments[seg_index].longline);
2447+
rr_graph.rr_segments(seg_index).longline);
24482448
} else {
24492449
msg += vtr::string_fmt(" track: %d seg_type: ILLEGAL_SEG_INDEX %d",
24502450
rr_node.track_num(),

vpr/src/util/vpr_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ std::string rr_node_arch_name(int inode) {
219219
auto cost_index = rr_graph.node_cost_index(RRNodeId(inode));
220220
int seg_index = device_ctx.rr_indexed_data[cost_index].seg_index;
221221

222-
rr_node_arch_name += device_ctx.rr_segments[seg_index].name;
222+
rr_node_arch_name += rr_graph.rr_segments(seg_index).name;
223223
}
224224

225225
return rr_node_arch_name;

0 commit comments

Comments
 (0)