Skip to content

Commit 6eb6a8f

Browse files
committed
moved loop variable definitions to loop
1 parent 1193d3b commit 6eb6a8f

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

vpr/src/pack/pb_type_graph_annotations.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ static void inferr_unspecified_pb_graph_edge_delays(t_pb_graph_edge* pb_graph_pi
4040
static t_pb_graph_pin* find_clock_pin(t_pb_graph_node* gnode, const char* clock, int line_num);
4141

4242
void load_pb_graph_pin_to_pin_annotations(t_pb_graph_node* pb_graph_node) {
43-
int i, j, k;
4443
const t_pb_type* pb_type;
4544
t_pin_to_pin_annotation* annotations;
4645

@@ -49,7 +48,7 @@ void load_pb_graph_pin_to_pin_annotations(t_pb_graph_node* pb_graph_node) {
4948
/* Load primitive critical path delays */
5049
if (pb_type->is_primitive()) {
5150
annotations = pb_type->annotations;
52-
for (i = 0; i < pb_type->num_annotations; i++) {
51+
for (int i = 0; i < pb_type->num_annotations; i++) {
5352
if (annotations[i].type == E_ANNOT_PIN_TO_PIN_DELAY) {
5453
for (const auto& [key, val] : annotations[i].annotation_entries) {
5554
if (key == E_ANNOT_PIN_TO_PIN_DELAY_MAX
@@ -72,10 +71,10 @@ void load_pb_graph_pin_to_pin_annotations(t_pb_graph_node* pb_graph_node) {
7271
}
7372
} else {
7473
/* Load interconnect delays */
75-
for (i = 0; i < pb_type->num_modes; i++) {
76-
for (j = 0; j < pb_type->modes[i].num_interconnect; j++) {
74+
for (int i = 0; i < pb_type->num_modes; i++) {
75+
for (int j = 0; j < pb_type->modes[i].num_interconnect; j++) {
7776
annotations = pb_type->modes[i].interconnect[j].annotations;
78-
for (k = 0; k < pb_type->modes[i].interconnect[j].num_annotations; k++) {
77+
for (int k = 0; k < pb_type->modes[i].interconnect[j].num_annotations; k++) {
7978
if (annotations[k].type == E_ANNOT_PIN_TO_PIN_DELAY) {
8079
for (const auto& [key, val] : annotations[k].annotation_entries) {
8180
if (key == E_ANNOT_PIN_TO_PIN_DELAY_MAX
@@ -114,9 +113,9 @@ void load_pb_graph_pin_to_pin_annotations(t_pb_graph_node* pb_graph_node) {
114113
inferr_unspecified_pb_graph_node_delays(pb_graph_node);
115114

116115
//Recursively annotate child pb's
117-
for (i = 0; i < pb_type->num_modes; i++) {
118-
for (j = 0; j < pb_type->modes[i].num_pb_type_children; j++) {
119-
for (k = 0; k < pb_type->modes[i].pb_type_children[j].num_pb; k++) {
116+
for (int i = 0; i < pb_type->num_modes; i++) {
117+
for (int j = 0; j < pb_type->modes[i].num_pb_type_children; j++) {
118+
for (int k = 0; k < pb_type->modes[i].pb_type_children[j].num_pb; k++) {
120119
load_pb_graph_pin_to_pin_annotations(&pb_graph_node->child_pb_graph_nodes[i][j][k]);
121120
}
122121
}

vpr/src/power/power.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,6 @@ static void power_usage_blocks(t_power_usage* power_usage) {
646646
*/
647647
static void power_usage_clock(t_power_usage* power_usage,
648648
std::vector<t_clock_network>& clock_arch) {
649-
size_t clock_idx;
650649
auto& power_ctx = g_vpr_ctx.power();
651650

652651
/* Initialization */
@@ -658,23 +657,21 @@ static void power_usage_clock(t_power_usage* power_usage,
658657
return;
659658
}
660659

661-
for (clock_idx = 0; clock_idx < clock_arch.size();
662-
clock_idx++) {
660+
for (auto& clock : clock_arch) {
663661
t_power_usage clock_power;
664662

665663
/* Assume the global clock is active even for combinational circuits */
666664
if (clock_arch.size() == 1) {
667-
if (clock_arch[clock_idx].dens == 0) {
668-
clock_arch[clock_idx].dens = 2;
669-
clock_arch[clock_idx].prob = 0.5;
665+
if (clock.dens == 0) {
666+
clock.dens = 2;
667+
clock.prob = 0.5;
670668

671669
// This will need to change for multi-clock
672-
clock_arch[clock_idx].period = power_ctx.solution_inf.T_crit;
670+
clock.period = power_ctx.solution_inf.T_crit;
673671
}
674672
}
675673
/* find the power dissipated by each clock network */
676-
power_usage_clock_single(&clock_power,
677-
&clock_arch[clock_idx]);
674+
power_usage_clock_single(&clock_power, &clock);
678675
power_add_usage(power_usage, &clock_power);
679676
}
680677

0 commit comments

Comments
 (0)