Skip to content

Commit 8271fa9

Browse files
authored
Merge pull request #1596 from tangxifan/rr_graph_dead_code_removal
Remove Legacy Codes about `trim_empty_channels` and `trim_obs_channels`
2 parents 78807c7 + fc4f474 commit 8271fa9

File tree

6 files changed

+0
-110
lines changed

6 files changed

+0
-110
lines changed

vpr/src/base/SetupVPR.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,6 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts)
356356
RouterOpts->reorder_rr_graph_nodes_threshold = Options.reorder_rr_graph_nodes_threshold;
357357
RouterOpts->reorder_rr_graph_nodes_seed = Options.reorder_rr_graph_nodes_seed;
358358

359-
//TODO document these?
360-
RouterOpts->trim_empty_channels = false; /* DEFAULT */
361-
RouterOpts->trim_obs_channels = false; /* DEFAULT */
362-
363359
RouterOpts->initial_pres_fac = Options.initial_pres_fac;
364360
RouterOpts->base_cost_type = Options.base_cost_type;
365361
RouterOpts->first_iter_pres_fac = Options.first_iter_pres_fac;

vpr/src/base/ShowSetup.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,6 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
252252
VPR_FATAL_ERROR(VPR_ERROR_UNKNOWN, "Unknown check_route value\n");
253253
}
254254

255-
VTR_LOG("RouterOpts.trim_empty_chan: %s\n", (RouterOpts.trim_empty_channels ? "true" : "false"));
256-
VTR_LOG("RouterOpts.trim_obs_chan: %s\n", (RouterOpts.trim_obs_channels ? "true" : "false"));
257255
VTR_LOG("RouterOpts.acc_fac: %f\n", RouterOpts.acc_fac);
258256
VTR_LOG("RouterOpts.bb_factor: %d\n", RouterOpts.bb_factor);
259257
VTR_LOG("RouterOpts.bend_cost: %f\n", RouterOpts.bend_cost);
@@ -395,8 +393,6 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
395393
VTR_LOG("%d\n", RouterOpts.fixed_channel_width);
396394
}
397395

398-
VTR_LOG("RouterOpts.trim_empty_chan: %s\n", (RouterOpts.trim_empty_channels ? "true" : "false"));
399-
VTR_LOG("RouterOpts.trim_obs_chan: %s\n", (RouterOpts.trim_obs_channels ? "true" : "false"));
400396
VTR_LOG("RouterOpts.acc_fac: %f\n", RouterOpts.acc_fac);
401397
VTR_LOG("RouterOpts.bb_factor: %d\n", RouterOpts.bb_factor);
402398
VTR_LOG("RouterOpts.bend_cost: %f\n", RouterOpts.bend_cost);

vpr/src/base/vpr_types.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,8 +1185,6 @@ struct t_router_opts {
11851185
enum e_route_type route_type;
11861186
int fixed_channel_width;
11871187
int min_channel_width_hint; ///<Hint to binary search of what the minimum channel width is
1188-
bool trim_empty_channels;
1189-
bool trim_obs_channels;
11901188
enum e_router_algorithm router_algorithm;
11911189
enum e_base_cost_type base_cost_type;
11921190
float astar_fac;

vpr/src/route/rr_graph.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@ static void build_rr_graph(const t_graph_type graph_type,
301301
const float R_minW_pmos,
302302
const enum e_base_cost_type base_cost_type,
303303
const enum e_clock_modeling clock_modeling,
304-
const bool trim_empty_channels,
305-
const bool trim_obs_channels,
306304
const t_direct_inf* directs,
307305
const int num_directs,
308306
int* wire_to_rr_ipin_switch,
@@ -362,8 +360,6 @@ void create_rr_graph(const t_graph_type graph_type,
362360
det_routing_arch->R_minW_pmos,
363361
router_opts.base_cost_type,
364362
router_opts.clock_modeling,
365-
router_opts.trim_empty_channels,
366-
router_opts.trim_obs_channels,
367363
directs, num_directs,
368364
&det_routing_arch->wire_to_rr_ipin_switch,
369365
Warnings);
@@ -424,8 +420,6 @@ static void build_rr_graph(const t_graph_type graph_type,
424420
const float R_minW_pmos,
425421
const enum e_base_cost_type base_cost_type,
426422
const enum e_clock_modeling clock_modeling,
427-
const bool trim_empty_channels,
428-
const bool trim_obs_channels,
429423
const t_direct_inf* directs,
430424
const int num_directs,
431425
int* wire_to_rr_ipin_switch,
@@ -490,7 +484,6 @@ static void build_rr_graph(const t_graph_type graph_type,
490484
t_chan_details chan_details_y;
491485

492486
alloc_and_load_chan_details(grid, &nodes_per_chan,
493-
trim_empty_channels, trim_obs_channels,
494487
num_seg_details, seg_details,
495488
chan_details_x, chan_details_y);
496489

vpr/src/route/rr_graph2.cpp

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,6 @@ t_seg_details* alloc_and_load_seg_details(int* max_chan_width,
365365

366366
void alloc_and_load_chan_details(const DeviceGrid& grid,
367367
const t_chan_width* nodes_per_chan,
368-
const bool trim_empty_channels,
369-
const bool trim_obs_channels,
370368
const int num_seg_details,
371369
const t_seg_details* seg_details,
372370
t_chan_details& chan_details_x,
@@ -376,11 +374,6 @@ void alloc_and_load_chan_details(const DeviceGrid& grid,
376374
chan_details_y = init_chan_details(grid, nodes_per_chan,
377375
num_seg_details, seg_details, SEG_DETAILS_Y);
378376

379-
/* Obstruct channel segment details based on grid block widths/heights */
380-
obstruct_chan_details(grid, nodes_per_chan,
381-
trim_empty_channels, trim_obs_channels,
382-
chan_details_x, chan_details_y);
383-
384377
/* Adjust segment start/end based on obstructed channels, if any */
385378
adjust_chan_details(grid, nodes_per_chan,
386379
chan_details_x, chan_details_y);
@@ -432,84 +425,6 @@ t_chan_details init_chan_details(const DeviceGrid& grid,
432425
return chan_details;
433426
}
434427

435-
void obstruct_chan_details(const DeviceGrid& grid,
436-
const t_chan_width* nodes_per_chan,
437-
const bool trim_empty_channels,
438-
const bool trim_obs_channels,
439-
t_chan_details& chan_details_x,
440-
t_chan_details& chan_details_y) {
441-
auto& device_ctx = g_vpr_ctx.device();
442-
443-
/* Iterate grid to find and obstruct based on multi-width/height blocks */
444-
for (size_t x = 0; x < grid.width() - 1; ++x) {
445-
for (size_t y = 0; y < grid.height() - 1; ++y) {
446-
if (!trim_obs_channels)
447-
continue;
448-
449-
if (grid[x][y].type == device_ctx.EMPTY_PHYSICAL_TILE_TYPE)
450-
continue;
451-
if (grid[x][y].width_offset > 0 || grid[x][y].height_offset > 0)
452-
continue;
453-
if (grid[x][y].type->width == 1 && grid[x][y].type->height == 1)
454-
continue;
455-
456-
if (grid[x][y].type->height > 1) {
457-
for (int dx = 0; dx <= grid[x][y].type->width - 1; ++dx) {
458-
for (int dy = 0; dy < grid[x][y].type->height - 1; ++dy) {
459-
for (int track = 0; track < nodes_per_chan->max; ++track) {
460-
chan_details_x[x + dx][y + dy][track].set_length(0);
461-
}
462-
}
463-
}
464-
}
465-
if (grid[x][y].type->width > 1) {
466-
for (int dy = 0; dy <= grid[x][y].type->height - 1; ++dy) {
467-
for (int dx = 0; dx < grid[x][y].type->width - 1; ++dx) {
468-
for (int track = 0; track < nodes_per_chan->max; ++track) {
469-
chan_details_y[x + dx][y + dy][track].set_length(0);
470-
}
471-
}
472-
}
473-
}
474-
}
475-
}
476-
477-
/* Iterate grid again to find and obstruct based on neighboring EMPTY and/or IO types */
478-
for (size_t x = 0; x <= grid.width() - 2; ++x) { //-2 for no perim channels
479-
for (size_t y = 0; y <= grid.height() - 2; ++y) { //-2 for no perim channels
480-
481-
if (!trim_empty_channels)
482-
continue;
483-
484-
if (is_io_type(grid[x][y].type)) {
485-
if ((x == 0) || (y == 0))
486-
continue;
487-
}
488-
if (grid[x][y].type == device_ctx.EMPTY_PHYSICAL_TILE_TYPE) {
489-
if ((x == grid.width() - 2) && is_io_type(grid[x + 1][y].type)) //-2 for no perim channels
490-
continue;
491-
if ((y == grid.height() - 2) && is_io_type(grid[x][y + 1].type)) //-2 for no perim channels
492-
continue;
493-
}
494-
495-
if (is_io_type(grid[x][y].type) || (grid[x][y].type == device_ctx.EMPTY_PHYSICAL_TILE_TYPE)) {
496-
if (is_io_type(grid[x][y + 1].type) || (grid[x][y + 1].type == device_ctx.EMPTY_PHYSICAL_TILE_TYPE)) {
497-
for (int track = 0; track < nodes_per_chan->max; ++track) {
498-
chan_details_x[x][y][track].set_length(0);
499-
}
500-
}
501-
}
502-
if (is_io_type(grid[x][y].type) || (grid[x][y].type == device_ctx.EMPTY_PHYSICAL_TILE_TYPE)) {
503-
if (is_io_type(grid[x + 1][y].type) || (grid[x + 1][y].type == device_ctx.EMPTY_PHYSICAL_TILE_TYPE)) {
504-
for (int track = 0; track < nodes_per_chan->max; ++track) {
505-
chan_details_y[x][y][track].set_length(0);
506-
}
507-
}
508-
}
509-
}
510-
}
511-
}
512-
513428
void adjust_chan_details(const DeviceGrid& grid,
514429
const t_chan_width* nodes_per_chan,
515430
t_chan_details& chan_details_x,

vpr/src/route/rr_graph2.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ t_seg_details* alloc_and_load_seg_details(int* max_chan_width,
104104

105105
void alloc_and_load_chan_details(const DeviceGrid& grid,
106106
const t_chan_width* nodes_per_chan,
107-
const bool trim_empty_channels,
108-
const bool trim_obs_channels,
109107
const int num_seg_details,
110108
const t_seg_details* seg_details,
111109
t_chan_details& chan_details_x,
@@ -115,12 +113,6 @@ t_chan_details init_chan_details(const DeviceGrid& grid,
115113
const int num_seg_details,
116114
const t_seg_details* seg_details,
117115
const enum e_seg_details_type seg_details_type);
118-
void obstruct_chan_details(const DeviceGrid& grid,
119-
const t_chan_width* nodes_per_chan,
120-
const bool trim_empty_channels,
121-
const bool trim_obs_channels,
122-
t_chan_details& chan_details_x,
123-
t_chan_details& chan_details_y);
124116
void adjust_chan_details(const DeviceGrid& grid,
125117
const t_chan_width* nodes_per_chan,
126118
t_chan_details& chan_details_x,

0 commit comments

Comments
 (0)