Skip to content

Commit cfe5151

Browse files
Removed initial temperature boosting for NoC designs. Removed print_noc_grid() calls.
1 parent a71ade5 commit cfe5151

File tree

3 files changed

+50
-70
lines changed

3 files changed

+50
-70
lines changed

vpr/src/place/initial_placement.cpp

Lines changed: 49 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,57 +1192,55 @@ static int findFirstInteger(const std::string& str) {
11921192
}
11931193
}
11941194

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

12471245
static void initial_noc_placement(const t_noc_opts& noc_opts) {
12481246
auto& place_ctx = g_vpr_ctx.placement();
@@ -1347,8 +1345,6 @@ static void initial_noc_placement(const t_noc_opts& noc_opts) {
13471345
// populate internal data structures to maintain route, bandwidth usage, and latencies
13481346
initial_noc_routing();
13491347

1350-
print_noc_grid();
1351-
13521348
// Only NoC related costs are considered
13531349
t_placer_costs costs;
13541350

@@ -1434,7 +1430,6 @@ void initial_placement(enum e_pad_loc_type pad_loc_type, const char* constraints
14341430
if (noc_opts.noc) {
14351431
// NoC routers are placed before other blocks
14361432
initial_noc_placement(noc_opts);
1437-
print_noc_grid();
14381433
}
14391434

14401435
//Assign scores to blocks and placement macros according to how difficult they are to place

vpr/src/place/initial_placement.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ struct t_grid_empty_locs_block_type {
3838
int num_of_empty_locs_in_y_axis;
3939
};
4040

41-
42-
43-
void print_noc_grid();
44-
4541
/**
4642
* @brief Tries to find an initial placement location for each block considering floorplanning constraints
4743
* and throws an error out if it fails after max number of attempts.

vpr/src/place/place.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,8 +1024,6 @@ void try_place(const Netlist<>& net_list,
10241024
sprintf(msg,
10251025
"\nNoC Placement Costs. noc_aggregate_bandwidth_cost: %g noc_latency_cost: %g noc_latency_constraints_cost: %d", costs.noc_aggregate_bandwidth_cost, costs.noc_latency_cost, get_number_of_traffic_flows_with_latency_cons_met());
10261026
VTR_LOG("NoC Placement Costs. noc_aggregate_bandwidth_cost: %g, noc_latency_cost: %g, noc_latency_constraints_cost: %d, \n", costs.noc_aggregate_bandwidth_cost, costs.noc_latency_cost, get_number_of_traffic_flows_with_latency_cons_met());
1027-
1028-
print_noc_grid();
10291027
}
10301028
update_screen(ScreenUpdatePriority::MAJOR, msg, PLACEMENT, timing_info);
10311029
// Print out swap statistics
@@ -1350,16 +1348,7 @@ static float starting_t(const t_annealing_state* state, t_placer_costs* costs, t
13501348
VTR_LOG("std_dev: %g, average cost: %g, starting temp: %g\n", std_dev, av, 20. * std_dev);
13511349
#endif
13521350

1353-
float init_temp = 0.0;
1354-
1355-
/* We use a constructive initial placement and a low starting temperature
1356-
* by default, but that can cause problems with NoCs as the initial logical
1357-
* locations are random. Use a higher starting T in that case.*/
1358-
// if (noc_opts.noc) {
1359-
// init_temp = 20. * std_dev;
1360-
// } else {
1361-
init_temp = std_dev / 64;
1362-
// }
1351+
float init_temp = std_dev / 64;
13631352

13641353
return init_temp;
13651354
}

0 commit comments

Comments
 (0)