Skip to content

Commit c9cc32d

Browse files
make format
1 parent cfe5151 commit c9cc32d

12 files changed

+16
-88
lines changed

vpr/src/base/vpr_types.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ t_ext_pin_util_targets::t_ext_pin_util_targets(float default_in_util, float defa
99

1010
t_ext_pin_util_targets::t_ext_pin_util_targets(const std::vector<std::string>& specs)
1111
: t_ext_pin_util_targets(1., 1.) {
12-
1312
if (specs.size() == 1 && specs[0] == "auto") {
1413
//No user-specified pin utilizations, infer them automatically.
1514
//
@@ -168,7 +167,6 @@ t_pack_high_fanout_thresholds::t_pack_high_fanout_thresholds(int threshold)
168167

169168
t_pack_high_fanout_thresholds::t_pack_high_fanout_thresholds(const std::vector<std::string>& specs)
170169
: t_pack_high_fanout_thresholds(128) {
171-
172170
if (specs.size() == 1 && specs[0] == "auto") {
173171
//No user-specified high fanout thresholds, infer them automatically.
174172
//

vpr/src/noc/noc_router.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ int NocRouter::get_router_layer_position(void) const {
2828
}
2929

3030
t_physical_tile_loc NocRouter::get_router_physical_location(void) const {
31-
3231
const int x = get_router_grid_position_x();
3332
const int y = get_router_grid_position_y();
3433
const int layer = get_router_layer_position();

vpr/src/noc/noc_router.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ class NocRouter {
8686
*/
8787
int get_router_layer_position(void) const;
8888

89-
9089
/**
9190
* @brief Gets the physical location where the the physical router is located
9291
* @return t_physical_tile_loc that contains x-y coordinates and the layer number

vpr/src/noc/noc_traffic_flows.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ void NocTrafficFlows::finished_noc_traffic_flows_setup(void) {
8989
int number_of_traffic_flows = noc_traffic_flows.size();
9090
traffic_flow_routes.resize(number_of_traffic_flows);
9191

92-
9392
const int num_flows = get_number_of_traffic_flows();
9493
double bandwidth_sum = 0.0;
9594
double inverse_latency_sum = 0.0;

vpr/src/pack/cluster.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
282282
t_ext_pin_util target_ext_pin_util = helper_ctx.target_external_pin_util.get_pin_util(cluster_ctx.clb_nlist.block_type(clb_index)->name);
283283
int high_fanout_threshold = helper_ctx.high_fanout_thresholds.get_threshold(cluster_ctx.clb_nlist.block_type(clb_index)->name);
284284
update_cluster_stats(istart, clb_index,
285-
is_clock, //Set of clock nets
285+
is_clock, //Set of clock nets
286286
is_global, //Set of global nets (currently all clocks)
287287
packer_opts.global_clocks,
288288
packer_opts.alpha, packer_opts.beta,

vpr/src/pack/cluster_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,7 @@ void try_fill_cluster(const t_packer_opts& packer_opts,
15941594
attraction_groups);
15951595

15961596
update_cluster_stats(next_molecule, clb_index,
1597-
is_clock, //Set of all clocks
1597+
is_clock, //Set of all clocks
15981598
is_global, //Set of all global signals (currently clocks)
15991599
packer_opts.global_clocks, packer_opts.alpha, packer_opts.beta, packer_opts.timing_driven,
16001600
packer_opts.connection_driven,

vpr/src/pack/pack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bool try_pack(t_packer_opts* packer_opts,
7373
helper_ctx.num_models += count_models(library_models);
7474

7575
is_clock = alloc_and_load_is_clock(packer_opts->global_clocks);
76-
// is_global = find_likely_global_ctrl_nets(is_clock);
76+
// is_global = find_likely_global_ctrl_nets(is_clock);
7777
is_global.insert(is_clock.begin(), is_clock.end());
7878

7979
size_t num_p_inputs = 0;

vpr/src/place/initial_placement.cpp

Lines changed: 5 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,16 +1141,13 @@ bool place_one_block(const ClusterBlockId& blk_id,
11411141
return placed_macro;
11421142
}
11431143

1144-
11451144
static double calculate_noc_cost(const t_placer_costs& costs, const t_noc_opts& noc_opts) {
11461145
double noc_cost = 0.0;
11471146
noc_cost = (noc_opts.noc_placement_weighting) * ((costs.noc_aggregate_bandwidth_cost * costs.noc_aggregate_bandwidth_cost_norm) + (costs.noc_latency_cost * costs.noc_latency_cost_norm));
11481147
return noc_cost;
11491148
}
11501149

1151-
11521150
static bool assess_noc_swap(double delta_cost, double prob) {
1153-
11541151
if (delta_cost <= 0.0) {
11551152
return true;
11561153
}
@@ -1161,7 +1158,7 @@ static bool assess_noc_swap(double delta_cost, double prob) {
11611158

11621159
float random_num = vtr::frand();
11631160
if (random_num < prob) {
1164-
return true;
1161+
return true;
11651162
} else {
11661163
return false;
11671164
}
@@ -1192,56 +1189,6 @@ static int findFirstInteger(const std::string& str) {
11921189
}
11931190
}
11941191

1195-
//void print_noc_grid() {
1196-
//
1197-
// auto& place_ctx = g_vpr_ctx.placement();
1198-
// auto& cluster_ctx = g_vpr_ctx.clustering();
1199-
// auto& noc_ctx = g_vpr_ctx.noc();
1200-
// const int num_layers = g_vpr_ctx.device().grid.get_num_layers();
1201-
//
1202-
// const auto router_block_type = cluster_ctx.clb_nlist.block_type(noc_ctx.noc_traffic_flows_storage.get_router_clusters_in_netlist()[0]);
1203-
// const auto& compressed_noc_grid = place_ctx.compressed_block_grids[router_block_type->index];
1204-
//
1205-
// static int grid_arr[10][10];
1206-
//
1207-
// for (int i = 0; i < 10; i++) {
1208-
// for (int j = 0; j < 10; j++) {
1209-
// grid_arr[i][j] = -1;
1210-
// }
1211-
// }
1212-
//
1213-
// const std::vector<ClusterBlockId>& router_bids = noc_ctx.noc_traffic_flows_storage.get_router_clusters_in_netlist();
1214-
//
1215-
// // Iterate over all routers
1216-
// for (auto router_bid : router_bids) {
1217-
//
1218-
// std::string router_name = cluster_ctx.clb_nlist.block_name(router_bid);
1219-
// int router_id = findFirstInteger(router_name);
1220-
//
1221-
// auto compressed_loc = get_compressed_loc_approx(compressed_noc_grid,place_ctx.block_locs[router_bid].loc, num_layers);
1222-
//
1223-
// int placed_router_x = compressed_loc[0].x;
1224-
// int placed_router_y = compressed_loc[0].y;
1225-
// grid_arr[placed_router_x][placed_router_y] = router_id;
1226-
// }
1227-
//
1228-
// std::cout << std::endl;
1229-
// for (int i = 0; i < 10; i++) {
1230-
// for (int j = 0; j < 10; j++) {
1231-
// if (grid_arr[j][i] >= 0) {
1232-
// std::cout << std::setw(2) << std::setfill('0') << grid_arr[j][i] << "\t";
1233-
// } else {
1234-
// std::cout << std::setw(2) << std::setfill(' ') << "X-" << "\t";
1235-
// }
1236-
//
1237-
// }
1238-
// std::cout << std::endl;
1239-
// }
1240-
//
1241-
// std::cout << std::endl;
1242-
//
1243-
//}
1244-
12451192
static void initial_noc_placement(const t_noc_opts& noc_opts) {
12461193
auto& place_ctx = g_vpr_ctx.placement();
12471194
auto& noc_ctx = g_vpr_ctx.noc();
@@ -1257,14 +1204,12 @@ static void initial_noc_placement(const t_noc_opts& noc_opts) {
12571204
std::vector<ClusterBlockId> unfixed_routers;
12581205

12591206
for (auto router_blk_id : router_blk_ids) {
1260-
12611207
// The block is fixed and was placed in mark_fixed_blocks()
12621208
if (is_block_placed((router_blk_id))) {
12631209
continue;
12641210
}
12651211

12661212
if (is_cluster_constrained(router_blk_id)) {
1267-
12681213
auto block_type = cluster_ctx.clb_nlist.block_type(router_blk_id);
12691214
const PartitionRegion& pr = floorplanning_ctx.cluster_constraints[router_blk_id];
12701215

@@ -1340,7 +1285,7 @@ static void initial_noc_placement(const t_noc_opts& noc_opts) {
13401285
break;
13411286
}
13421287
}
1343-
} // end for of random router placement
1288+
} // end for of random router placement
13441289

13451290
// populate internal data structures to maintain route, bandwidth usage, and latencies
13461291
initial_noc_routing();
@@ -1372,19 +1317,18 @@ static void initial_noc_placement(const t_noc_opts& noc_opts) {
13721317
e_create_move create_move_outcome = e_create_move::ABORT;
13731318
clear_move_blocks(blocks_affected);
13741319
// Shrink the range limit over time
1375-
float r_lim_decayed = 1.0f + (N_MOVES-i_move) * (max_r_lim/N_MOVES);
1320+
float r_lim_decayed = 1.0f + (N_MOVES - i_move) * (max_r_lim / N_MOVES);
13761321
create_move_outcome = propose_router_swap(blocks_affected, r_lim_decayed);
13771322

13781323
if (create_move_outcome != e_create_move::ABORT) {
1379-
13801324
apply_move_blocks(blocks_affected);
13811325

13821326
double noc_aggregate_bandwidth_delta_c = 0.0;
13831327
double noc_latency_delta_c = 0.0;
13841328
find_affected_noc_routers_and_update_noc_costs(blocks_affected, noc_aggregate_bandwidth_delta_c, noc_latency_delta_c, noc_opts);
13851329
double delta_cost = (noc_opts.noc_placement_weighting) * (noc_latency_delta_c * costs.noc_latency_cost_norm + noc_aggregate_bandwidth_delta_c * costs.noc_aggregate_bandwidth_cost_norm);
13861330

1387-
double prob = starting_prob - i_move*prob_step;
1331+
double prob = starting_prob - i_move * prob_step;
13881332
bool move_accepted = assess_noc_swap(delta_cost, prob);
13891333

13901334
if (move_accepted) {
@@ -1396,7 +1340,7 @@ static void initial_noc_placement(const t_noc_opts& noc_opts) {
13961340
if (costs.cost < checkpoint.get_cost() || !checkpoint.is_valid()) {
13971341
checkpoint.save_checkpoint(costs.cost);
13981342
}
1399-
} else { // The proposed move is rejected
1343+
} else { // The proposed move is rejected
14001344
revert_move_blocks(blocks_affected);
14011345
revert_noc_traffic_flow_routes(blocks_affected);
14021346
}
@@ -1406,10 +1350,8 @@ static void initial_noc_placement(const t_noc_opts& noc_opts) {
14061350
if (checkpoint.get_cost() < costs.cost) {
14071351
checkpoint.restore_checkpoint(noc_opts, costs);
14081352
}
1409-
14101353
}
14111354

1412-
14131355
void initial_placement(enum e_pad_loc_type pad_loc_type, const char* constraints_file, const t_noc_opts& noc_opts) {
14141356
vtr::ScopedStartFinishTimer timer("Initial Placement");
14151357

vpr/src/place/move_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,8 @@ bool find_compatible_compressed_loc_in_range(t_logical_block_type_ptr type,
10671067
VTR_ASSERT(to_loc.y <= search_range.ymax);
10681068

10691069
if (from_loc.x == to_loc.x && from_loc.y == to_loc.y && from_loc.layer_num == to_layer_num) {
1070-
continue; //Same from/to location -- try again for new y-position
1071-
} else if (check_empty) { // Check if the location has at least one empty sub-tile
1070+
continue; //Same from/to location -- try again for new y-position
1071+
} else if (check_empty) { // Check if the location has at least one empty sub-tile
10721072
t_pl_loc to_uncompressed_loc;
10731073
compressed_grid_to_loc(type, to_loc, to_uncompressed_loc);
10741074
const t_physical_tile_loc to_phy_uncompressed_loc{to_uncompressed_loc.x, to_uncompressed_loc.y, to_uncompressed_loc.layer};

vpr/src/place/noc_place_checkpoint.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#include "noc_place_checkpoint.h"
33
#include "noc_place_utils.h"
44

5-
RouterPlacementCheckpoint::RouterPlacementCheckpoint() :
6-
valid_(false),
7-
cost_(std::numeric_limits<double>::infinity()) {
5+
RouterPlacementCheckpoint::RouterPlacementCheckpoint()
6+
: valid_(false)
7+
, cost_(std::numeric_limits<double>::infinity()) {
88
const auto& noc_ctx = g_vpr_ctx.noc();
99

1010
// Get all router clusters in the net-list
@@ -41,7 +41,6 @@ void RouterPlacementCheckpoint::restore_checkpoint(const t_noc_opts& noc_opts, t
4141

4242
// Clear all physical routers in placement
4343
for (const auto& phy_router : noc_phy_routers) {
44-
4544
auto phy_loc = phy_router.get_router_physical_location();
4645

4746
place_ctx.grid_blocks.set_usage(phy_loc, 0);
@@ -59,7 +58,6 @@ void RouterPlacementCheckpoint::restore_checkpoint(const t_noc_opts& noc_opts, t
5958
}
6059
}
6160

62-
6361
// Place routers based on router_locations_
6462
for (const auto& router_loc : router_locations_) {
6563
ClusterBlockId router_blk_id = router_loc.first;
@@ -72,7 +70,7 @@ void RouterPlacementCheckpoint::restore_checkpoint(const t_noc_opts& noc_opts, t
7270
reinitialize_noc_routing(noc_opts, costs);
7371
}
7472

75-
bool RouterPlacementCheckpoint::is_valid() const{
73+
bool RouterPlacementCheckpoint::is_valid() const {
7674
return valid_;
7775
}
7876

vpr/src/place/noc_place_checkpoint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class RouterPlacementCheckpoint {
1616
RouterPlacementCheckpoint& operator=(const RouterPlacementCheckpoint& other) = delete;
1717

1818
void save_checkpoint(double cost);
19-
void restore_checkpoint(const t_noc_opts& noc_opts, t_placer_costs& costs);
19+
void restore_checkpoint(const t_noc_opts& noc_opts, t_placer_costs& costs);
2020
bool is_valid() const;
2121
double get_cost() const;
2222
};

vpr/src/place/noc_place_utils.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,6 @@ static bool select_random_router_cluster(ClusterBlockId& b_from, t_pl_loc& from,
499499
}
500500

501501
e_create_move propose_router_swap(t_pl_blocks_to_be_moved& blocks_affected, float rlim) {
502-
503502
// block ID for the randomly selected router cluster
504503
ClusterBlockId b_from;
505504
// current location of the randomly selected router cluster
@@ -534,7 +533,6 @@ e_create_move propose_router_swap(t_pl_blocks_to_be_moved& blocks_affected, floa
534533
}
535534

536535
e_create_move propose_router_swap_flow_centroid(t_pl_blocks_to_be_moved& blocks_affected) {
537-
538536
auto& noc_ctx = g_vpr_ctx.noc();
539537
auto& place_ctx = g_vpr_ctx.placement();
540538
const auto& grid = g_vpr_ctx.device().grid;
@@ -590,7 +588,6 @@ e_create_move propose_router_swap_flow_centroid(t_pl_blocks_to_be_moved& blocks_
590588
}
591589
}
592590

593-
594591
t_pl_loc centroid_loc(OPEN, OPEN, OPEN, OPEN);
595592

596593
if (acc_weight > 0.0) {
@@ -609,14 +606,10 @@ e_create_move propose_router_swap_flow_centroid(t_pl_blocks_to_be_moved& blocks_
609606
return e_create_move::ABORT;
610607
}
611608

612-
613609
const auto& physical_type = grid.get_physical_type({centroid_loc.x, centroid_loc.y, centroid_loc.layer});
614610

615611
// If the calculated centroid does not have a compatible type, find a compatible location nearby
616612
if (!is_tile_compatible(physical_type, cluster_from_type)) {
617-
618-
619-
620613
//Determine centroid location in the compressed space of the current block
621614
auto compressed_centroid_loc = get_compressed_loc_approx(compressed_noc_grid,
622615
{centroid_loc.x, centroid_loc.y, 0, centroid_loc.layer},
@@ -649,7 +642,7 @@ e_create_move propose_router_swap_flow_centroid(t_pl_blocks_to_be_moved& blocks_
649642
bool legal = find_compatible_compressed_loc_in_range(cluster_from_type,
650643
delta_cx,
651644
compressed_from_loc[0],
652-
{min_cx, max_cx, min_cy, max_cy},
645+
{min_cx, max_cx, min_cy, max_cy},
653646
compressed_to_loc,
654647
false,
655648
compressed_from_loc[0].layer_num,

0 commit comments

Comments
 (0)