Skip to content

Commit fa2d648

Browse files
committed
[vpr][src] remove use cases of ipin_rr_switch
1 parent 4cea411 commit fa2d648

File tree

10 files changed

+23
-41
lines changed

10 files changed

+23
-41
lines changed

vpr/src/base/stats.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ void routing_stats(const Netlist<>& net_list,
6969
float R_minW_pmos,
7070
float grid_logic_tile_area,
7171
e_directionality directionality,
72-
RRSwitchId wire_to_ipin_switch,
7372
bool is_flat) {
7473
const DeviceContext& device_ctx = g_vpr_ctx.device();
7574
auto& rr_graph = device_ctx.rr_graph;
@@ -116,8 +115,12 @@ void routing_stats(const Netlist<>& net_list,
116115
VTR_LOG("\tTotal used logic block area: %g\n", used_area);
117116

118117
if (route_type == e_route_type::DETAILED) {
119-
count_routing_transistors(directionality, num_rr_switch, wire_to_ipin_switch,
120-
segment_inf, R_minW_nmos, R_minW_pmos, is_flat);
118+
count_routing_transistors(directionality,
119+
num_rr_switch,
120+
segment_inf,
121+
R_minW_nmos,
122+
R_minW_pmos,
123+
is_flat);
121124
get_segment_usage_stats(segment_inf);
122125
}
123126

vpr/src/base/stats.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ void routing_stats(const Netlist<>& net_list,
2121
float R_minW_pmos,
2222
float grid_logic_tile_area,
2323
e_directionality directionality,
24-
RRSwitchId wire_to_ipin_switch,
2524
bool is_flat);
2625

2726
void print_wirelen_prob_dist(bool is_flat);

vpr/src/base/vpr_api.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,6 @@ void vpr_analysis(const Netlist<>& net_list,
15001500
vpr_setup.RoutingArch.R_minW_pmos,
15011501
Arch.grid_logic_tile_area,
15021502
vpr_setup.RoutingArch.directionality,
1503-
vpr_setup.RoutingArch.wire_to_rr_ipin_switch,
15041503
is_flat);
15051504

15061505
if (vpr_setup.TimingEnabled) {

vpr/src/base/vpr_types.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,14 +1493,6 @@ struct t_det_routing_arch {
14931493
/// wires from another die to ipins in different die
14941494
int wire_to_arch_ipin_switch_between_dice = -1;
14951495

1496-
/// keeps track of the type of RR graph switch
1497-
/// that connects wires to ipins in the RR graph
1498-
RRSwitchId wire_to_rr_ipin_switch;
1499-
1500-
/// keeps track of the type of RR graph switch that connects wires
1501-
/// from another die to ipins in different die in the RR graph
1502-
int wire_to_rr_ipin_switch_between_dice = -1;
1503-
15041496
/// Resistance (in Ohms) of a minimum width nmos transistor.
15051497
/// Used only in the FPGA area model.
15061498
float R_minW_nmos;

vpr/src/route/rr_graph_generation/rr_graph.cpp

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ static void build_rr_graph(e_graph_type graph_type,
366366
const std::vector<t_direct_inf>& directs,
367367
const std::vector<t_scatter_gather_pattern>& scatter_gather_patterns,
368368
const std::vector<t_layer_def>& interposer_inf,
369-
RRSwitchId& wire_to_rr_ipin_switch,
370369
bool is_flat,
371370
int* Warnings,
372371
const int route_verbosity);
@@ -455,8 +454,6 @@ void create_rr_graph(e_graph_type graph_type,
455454
device_ctx.arch,
456455
&mutable_device_ctx.chan_width,
457456
router_opts.base_cost_type,
458-
&det_routing_arch.wire_to_rr_ipin_switch,
459-
&det_routing_arch.wire_to_arch_ipin_switch_between_dice,
460457
det_routing_arch.read_rr_graph_filename.c_str(),
461458
&mutable_device_ctx.loaded_rr_graph_filename,
462459
router_opts.read_rr_edge_metadata,
@@ -492,7 +489,6 @@ void create_rr_graph(e_graph_type graph_type,
492489
directs,
493490
device_ctx.arch->scatter_gather_patterns,
494491
device_ctx.arch->grid_layout().layers,
495-
det_routing_arch.wire_to_rr_ipin_switch,
496492
is_flat,
497493
Warnings,
498494
router_opts.route_verbosity);
@@ -512,7 +508,6 @@ void create_rr_graph(e_graph_type graph_type,
512508
det_routing_arch.R_minW_pmos,
513509
router_opts.base_cost_type,
514510
directs,
515-
det_routing_arch.wire_to_rr_ipin_switch,
516511
det_routing_arch.shrink_boundary, // Shrink to the smallest boundary, no routing wires for empty zone
517512
det_routing_arch.perimeter_cb, // Now I/O or any programmable blocks on perimeter can have full cb access (both cbx and cby)
518513
det_routing_arch.through_channel, // Allow/Prohibit through tracks across multi-height and multi-width grids
@@ -693,7 +688,6 @@ static void build_rr_graph(e_graph_type graph_type,
693688
const std::vector<t_direct_inf>& directs,
694689
const std::vector<t_scatter_gather_pattern>& scatter_gather_patterns,
695690
const std::vector<t_layer_def>& interposer_inf,
696-
RRSwitchId& wire_to_rr_ipin_switch,
697691
bool is_flat,
698692
int* Warnings,
699693
const int route_verbosity) {
@@ -1115,9 +1109,7 @@ static void build_rr_graph(e_graph_type graph_type,
11151109
g_vpr_ctx.mutable_device().switch_fanin_remap,
11161110
device_ctx.all_sw_inf,
11171111
R_minW_nmos,
1118-
R_minW_pmos,
1119-
wire_to_arch_ipin_switch,
1120-
wire_to_rr_ipin_switch);
1112+
R_minW_pmos);
11211113

11221114
// Partition the rr graph edges for efficient access to configurable/non-configurable
11231115
// edge subsets. Must be done after RR switches have been allocated
@@ -1126,7 +1118,7 @@ static void build_rr_graph(e_graph_type graph_type,
11261118
// Save the channel widths for the newly constructed graph
11271119
device_ctx.chan_width = nodes_per_chan;
11281120

1129-
rr_graph_externals(segment_inf, segment_inf_x, segment_inf_y, segment_inf_z, wire_to_rr_ipin_switch, base_cost_type);
1121+
rr_graph_externals(segment_inf, segment_inf_x, segment_inf_y, segment_inf_z, base_cost_type);
11301122

11311123
const VibDeviceGrid vib_grid;
11321124
check_rr_graph(device_ctx.rr_graph,
@@ -1236,22 +1228,18 @@ void build_tile_rr_graph(RRGraphBuilder& rr_graph_builder,
12361228
delayless_switch);
12371229

12381230
t_arch_switch_fanin switch_fanin_remap;
1239-
RRSwitchId dummy_sw_id;
12401231
alloc_and_load_rr_switch_inf(rr_graph_builder,
12411232
switch_fanin_remap,
12421233
sw_map,
12431234
det_routing_arch.R_minW_nmos,
1244-
det_routing_arch.R_minW_pmos,
1245-
det_routing_arch.wire_to_arch_ipin_switch,
1246-
dummy_sw_id);
1235+
det_routing_arch.R_minW_pmos);
12471236
rr_graph_builder.partition_edges();
12481237
}
12491238

12501239
void rr_graph_externals(const std::vector<t_segment_inf>& segment_inf,
12511240
const std::vector<t_segment_inf>& segment_inf_x,
12521241
const std::vector<t_segment_inf>& segment_inf_y,
12531242
const std::vector<t_segment_inf>& segment_inf_z,
1254-
RRSwitchId wire_to_rr_ipin_switch,
12551243
e_base_cost_type base_cost_type) {
12561244
const DeviceContext& device_ctx = g_vpr_ctx.device();
12571245
const RRGraphView& rr_graph = device_ctx.rr_graph;
@@ -1260,9 +1248,9 @@ void rr_graph_externals(const std::vector<t_segment_inf>& segment_inf,
12601248
vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data = mutable_device_ctx.rr_indexed_data;
12611249
bool echo_enabled = getEchoEnabled() && isEchoFileEnabled(E_ECHO_RR_GRAPH_INDEXED_DATA);
12621250
const char* echo_file_name = getEchoFileName(E_ECHO_RR_GRAPH_INDEXED_DATA);
1263-
add_rr_graph_C_from_switches(rr_graph.rr_switch_inf(wire_to_rr_ipin_switch).Cin);
1251+
add_rr_graph_C_from_switches();
12641252
alloc_and_load_rr_indexed_data(rr_graph, grid, segment_inf, segment_inf_x, segment_inf_y, segment_inf_z,
1265-
rr_indexed_data, wire_to_rr_ipin_switch, base_cost_type, echo_enabled, echo_file_name);
1253+
rr_indexed_data, base_cost_type, echo_enabled, echo_file_name);
12661254
//load_rr_index_segments(segment_inf.size());
12671255
}
12681256

vpr/src/route/rr_graph_generation/rr_graph.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ void rr_graph_externals(const std::vector<t_segment_inf>& segment_inf,
4747
const std::vector<t_segment_inf>& segment_inf_x,
4848
const std::vector<t_segment_inf>& segment_inf_y,
4949
const std::vector<t_segment_inf>& segment_inf_z,
50-
RRSwitchId wire_to_rr_ipin_switch,
5150
e_base_cost_type base_cost_type);
5251

5352
std::vector<vtr::Matrix<int>> alloc_and_load_actual_fc(const std::vector<t_physical_tile_type>& types,

vpr/src/route/rr_graph_generation/rr_graph_area.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,11 @@ static void count_bidir_routing_transistors(int num_switch, float R_minW_nmos, f
205205
break;
206206

207207
case e_rr_type::IPIN:
208-
RRSwitchId switch_id = RRSwitchId(rr_graph.edge_switch(RRNodeId(from_node), iedge));
209-
if (ipin_switch_count.find(switch_id) == ipin_switch_count.end()) {
210-
ipin_switch_count[switch_id] = 0;
208+
iswitch = rr_graph.edge_switch(RRNodeId(from_node), iedge);
209+
if (ipin_switch_count.find(RRSwitchId(iswitch)) == ipin_switch_count.end()) {
210+
ipin_switch_count[RRSwitchId(iswitch)] = 0;
211211
}
212-
ipin_switch_count[switch_id]++;
212+
ipin_switch_count[RRSwitchId(iswitch)]++;
213213
num_inputs_to_cblock[to_node]++;
214214
max_inputs_to_cblock = std::max(max_inputs_to_cblock, num_inputs_to_cblock[to_node]);
215215

@@ -369,6 +369,7 @@ static void count_unidir_routing_transistors(std::vector<t_segment_inf>& /*segme
369369

370370
ntrans = 0;
371371
std::unordered_map<RRSwitchId, size_t> ipin_switch_count;
372+
RRSwitchId switch_id;
372373
for (const RRNodeId from_rr_node : device_ctx.rr_graph.nodes()) {
373374
size_t from_node = size_t(from_rr_node);
374375
from_rr_type = rr_graph.node_type(from_rr_node);
@@ -436,7 +437,7 @@ static void count_unidir_routing_transistors(std::vector<t_segment_inf>& /*segme
436437
break;
437438

438439
case e_rr_type::IPIN:
439-
RRSwitchId switch_id = RRSwitchId(rr_graph.edge_switch(RRNodeId(from_node), iedge));
440+
switch_id = RRSwitchId(rr_graph.edge_switch(RRNodeId(from_node), iedge));
440441
if (ipin_switch_count.find(switch_id) == ipin_switch_count.end()) {
441442
ipin_switch_count[switch_id] = 0;
442443
}

vpr/src/route/rr_graph_generation/rr_graph_area.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
void count_routing_transistors(enum e_directionality directionality,
77
int num_switch,
8-
RRSwitchId wire_to_ipin_switch,
98
std::vector<t_segment_inf>& segment_inf,
109
float R_minW_nmos,
1110
float R_minW_pmos,

vpr/src/route/rr_graph_generation/tileable_rr_graph/tileable_rr_graph_builder.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ void build_tileable_unidir_rr_graph(const std::vector<t_physical_tile_type>& typ
8282
const float R_minW_pmos,
8383
const e_base_cost_type& base_cost_type,
8484
const std::vector<t_direct_inf>& directs,
85-
RRSwitchId& wire_to_rr_ipin_switch,
8685
const bool& shrink_boundary,
8786
const bool& perimeter_cb,
8887
const bool& through_channel,
@@ -276,7 +275,11 @@ void build_tileable_unidir_rr_graph(const std::vector<t_physical_tile_type>& typ
276275
// Allocate and load routing resource switches, which are derived from the switches from the architecture file,
277276
// based on their fanin in the rr graph. This routine also adjusts the rr nodes to point to these new rr switches
278277
device_ctx.rr_graph_builder.init_fan_in();
279-
alloc_and_load_rr_switch_inf(device_ctx.rr_graph_builder, device_ctx.switch_fanin_remap, device_ctx.all_sw_inf, R_minW_nmos, R_minW_pmos, wire_to_arch_ipin_switch, wire_to_rr_ipin_switch);
278+
alloc_and_load_rr_switch_inf(device_ctx.rr_graph_builder,
279+
device_ctx.switch_fanin_remap,
280+
device_ctx.all_sw_inf,
281+
R_minW_nmos,
282+
R_minW_pmos);
280283

281284
// Save the channel widths for the newly constructed graph
282285
device_ctx.chan_width = chan_width;
@@ -291,7 +294,7 @@ void build_tileable_unidir_rr_graph(const std::vector<t_physical_tile_type>& typ
291294
// Allocate external data structures
292295
// a. cost_index
293296
// b. RC tree
294-
rr_graph_externals(segment_inf, segment_inf_x, segment_inf_y, segment_inf_z, wire_to_rr_ipin_switch, base_cost_type);
297+
rr_graph_externals(segment_inf, segment_inf_x, segment_inf_y, segment_inf_z, base_cost_type);
295298

296299
// Sanitizer for the rr_graph, check connectivities of rr_nodes
297300
// Essential check for rr_graph, build look-up and

vpr/src/route/rr_graph_generation/tileable_rr_graph/tileable_rr_graph_builder.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ void build_tileable_unidir_rr_graph(const std::vector<t_physical_tile_type>& typ
2727
const float R_minW_pmos,
2828
const e_base_cost_type& base_cost_type,
2929
const std::vector<t_direct_inf>& directs,
30-
RRSwitchId& wire_to_rr_ipin_switch,
3130
const bool& shrink_boundary,
3231
const bool& perimeter_cb,
3332
const bool& through_channel,

0 commit comments

Comments
 (0)