Skip to content

Commit 3a6bccc

Browse files
authored
Merge pull request #3358 from verilog-to-routing/remove_ipin_rr_switch_id
Remove ipin rr switch
2 parents 907664c + 03307ec commit 3a6bccc

21 files changed

+67
-148
lines changed

libs/librrgraph/src/io/rr_graph_reader.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ void load_rr_file(RRGraphBuilder* rr_graph_builder,
6666
const t_arch* arch,
6767
t_chan_width* chan_width,
6868
const e_base_cost_type base_cost_type,
69-
RRSwitchId* wire_to_rr_ipin_switch,
70-
int* wire_to_rr_ipin_switch_between_dice,
7169
const char* read_rr_graph_name,
7270
std::string* loaded_rr_graph_filename,
7371
bool read_edge_metadata,
@@ -86,8 +84,6 @@ void load_rr_file(RRGraphBuilder* rr_graph_builder,
8684
RrGraphSerializer reader(
8785
graph_type,
8886
base_cost_type,
89-
wire_to_rr_ipin_switch,
90-
wire_to_rr_ipin_switch_between_dice,
9187
do_check_rr_graph,
9288
read_rr_graph_name,
9389
loaded_rr_graph_filename,

libs/librrgraph/src/io/rr_graph_reader.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ void load_rr_file(RRGraphBuilder* rr_graph_builder,
2323
const t_arch* arch,
2424
t_chan_width* chan_width,
2525
const e_base_cost_type base_cost_type,
26-
RRSwitchId* wire_to_rr_ipin_switch,
27-
int* wire_to_rr_ipin_switch_between_dice,
2826
const char* read_rr_graph_name,
2927
std::string* loaded_rr_graph_filename,
3028
bool read_edge_metadata,

libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
274274
RrGraphSerializer(
275275
const e_graph_type graph_type,
276276
const enum e_base_cost_type base_cost_type,
277-
RRSwitchId* wire_to_rr_ipin_switch,
278-
int* wire_to_rr_ipin_switch_between_dice,
279277
bool do_check_rr_graph,
280278
const char* read_rr_graph_name,
281279
std::string* loaded_rr_graph_filename,
@@ -297,9 +295,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
297295
MetadataStorage<std::tuple<int, int, short>>* rr_edge_metadata,
298296
vtr::string_internment* strings,
299297
bool is_flat)
300-
: wire_to_rr_ipin_switch_(wire_to_rr_ipin_switch)
301-
, wire_to_rr_ipin_switch_between_dice_(wire_to_rr_ipin_switch_between_dice)
302-
, chan_width_(chan_width)
298+
: chan_width_(chan_width)
303299
, rr_nodes_(rr_nodes)
304300
, rr_graph_builder_(rr_graph_builder)
305301
, rr_graph_(rr_graph)
@@ -1147,20 +1143,6 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
11471143
return nullptr;
11481144
}
11491145
inline void finish_rr_graph_rr_edges(void*& /*ctx*/) final {
1150-
/*initialize a vector that keeps track of the number of wire to ipin switches
1151-
* There should be only one wire to ipin switch. In case there are more, make sure to
1152-
* store the most frequent switch */
1153-
const auto& rr_graph = (*rr_graph_);
1154-
std::vector<int> count_for_wire_to_ipin_switches;
1155-
count_for_wire_to_ipin_switches.resize(rr_switch_inf_->size(), 0);
1156-
//switch for same layer Track to IPIN connection
1157-
//first is index, second is count
1158-
std::pair<int, int> most_frequent_switch(-1, 0);
1159-
//switch for different layer Track to IPIN connection
1160-
std::vector<int> count_for_wire_to_ipin_switches_between_dice;
1161-
count_for_wire_to_ipin_switches_between_dice.resize(rr_switch_inf_->size(), 0);
1162-
std::pair<int,int> most_frequent_switch_between_dice(-1,0);
1163-
11641146
// Partition the rr graph edges for efficient access to
11651147
// configurable/non-configurable edge subsets. Must be done after RR
11661148
// switches have been allocated.
@@ -1183,36 +1165,8 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
11831165
"switch_id %zu is larger than num_rr_switches %zu",
11841166
switch_id, rr_switch_inf_->size());
11851167
}
1186-
auto node = (*rr_nodes_)[source_node];
1187-
1188-
/*Keeps track of the number of the specific type of switch that connects a wire to an ipin
1189-
* use the pair data structure to keep the maximum*/
1190-
if (rr_graph.node_type(node.id()) == e_rr_type::CHANX || rr_graph.node_type(node.id()) == e_rr_type::CHANY) {
1191-
if(rr_graph.node_type(RRNodeId(sink_node)) == e_rr_type::IPIN){
1192-
if (rr_graph.node_layer_low(RRNodeId(sink_node)) == rr_graph.node_layer_low(RRNodeId(source_node))) {
1193-
count_for_wire_to_ipin_switches[switch_id]++;
1194-
if (count_for_wire_to_ipin_switches[switch_id] > most_frequent_switch.second) {
1195-
most_frequent_switch.first = switch_id;
1196-
most_frequent_switch.second = count_for_wire_to_ipin_switches[switch_id];
1197-
}
1198-
} else{
1199-
VTR_ASSERT(rr_graph.node_layer_low(RRNodeId(sink_node)) != rr_graph.node_layer_low(RRNodeId(source_node)));
1200-
count_for_wire_to_ipin_switches_between_dice[switch_id]++;
1201-
if(count_for_wire_to_ipin_switches_between_dice[switch_id] > most_frequent_switch_between_dice.second){
1202-
most_frequent_switch_between_dice.first = switch_id;
1203-
most_frequent_switch_between_dice.second = count_for_wire_to_ipin_switches_between_dice[switch_id];
1204-
}
1205-
}
1206-
}
1207-
}
12081168
}
12091169
}
1210-
1211-
VTR_ASSERT(wire_to_rr_ipin_switch_ != nullptr);
1212-
*wire_to_rr_ipin_switch_ = (RRSwitchId)most_frequent_switch.first;
1213-
1214-
VTR_ASSERT(wire_to_rr_ipin_switch_between_dice_ != nullptr);
1215-
*wire_to_rr_ipin_switch_between_dice_ = most_frequent_switch_between_dice.first;
12161170
}
12171171

12181172
inline EdgeWalker get_rr_graph_rr_edges(void*& /*ctx*/) final {
@@ -1844,7 +1798,6 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
18441798
segment_inf_y_,
18451799
segment_inf_z_,
18461800
*rr_indexed_data_,
1847-
*wire_to_rr_ipin_switch_,
18481801
base_cost_type_,
18491802
echo_enabled_,
18501803
echo_file_name_);
@@ -2194,8 +2147,6 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
21942147
std::array<uxsd::enum_loc_side, 16> side_map_;
21952148

21962149
// Output for loads, and constant data for writes.
2197-
RRSwitchId* wire_to_rr_ipin_switch_;
2198-
int* wire_to_rr_ipin_switch_between_dice_;
21992150
t_chan_width* chan_width_;
22002151
t_rr_graph_storage* rr_nodes_;
22012152
RRGraphBuilder* rr_graph_builder_;

libs/librrgraph/src/io/rr_graph_writer.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ void write_rr_graph(RRGraphBuilder* rr_graph_builder,
4242
RrGraphSerializer reader(
4343
/*graph_type=*/e_graph_type(),
4444
/*base_cost_type=*/e_base_cost_type(),
45-
/*wire_to_rr_ipin_switch=*/nullptr,
46-
/*wire_to_rr_ipin_switch_between_dice=*/nullptr,
4745
/*do_check_rr_graph=*/false,
4846
/*read_rr_graph_name=*/nullptr,
4947
/*read_rr_graph_filename=*/nullptr,

libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ static void load_rr_indexed_data_base_costs(const RRGraphView& rr_graph,
3030
static float get_delay_normalization_fac(const vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data, const bool echo_enabled, const char* echo_file_name);
3131

3232
static void load_rr_indexed_data_T_values(const RRGraphView& rr_graph,
33-
const RRSwitchId wire_to_ipin_switch,
3433
vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data);
3534

3635
/**
@@ -87,7 +86,6 @@ void alloc_and_load_rr_indexed_data(const RRGraphView& rr_graph,
8786
const std::vector<t_segment_inf>& segment_inf_y,
8887
const std::vector<t_segment_inf>& segment_inf_z,
8988
vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data,
90-
const RRSwitchId wire_to_ipin_switch,
9189
e_base_cost_type base_cost_type,
9290
const bool echo_enabled,
9391
const char* echo_file_name) {
@@ -158,9 +156,7 @@ void alloc_and_load_rr_indexed_data(const RRGraphView& rr_graph,
158156
rr_indexed_data[index].seg_index = seg_ptr->seg_index;
159157
}
160158

161-
load_rr_indexed_data_T_values(rr_graph,
162-
wire_to_ipin_switch,
163-
rr_indexed_data);
159+
load_rr_indexed_data_T_values(rr_graph, rr_indexed_data);
164160

165161
fixup_rr_indexed_data_T_values(rr_indexed_data, total_num_segment);
166162

@@ -515,7 +511,6 @@ static float get_delay_normalization_fac(const vtr::vector<RRIndexedDataId, t_rr
515511
* - Placement Delay Matrix computation
516512
*/
517513
static void load_rr_indexed_data_T_values(const RRGraphView& rr_graph,
518-
const RRSwitchId wire_to_ipin_switch,
519514
vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data) {
520515
vtr::vector<RRNodeId, std::vector<RREdgeId>> fan_in_list = get_fan_in_list(rr_graph);
521516

@@ -617,8 +612,7 @@ static void load_rr_indexed_data_T_values(const RRGraphView& rr_graph,
617612
{
618613
if (ipin_switch_count == 0) {
619614
VTR_LOG_WARN("No IPIN switches found. Setting T_linear to 0\n");
620-
float default_ipin_switch_T_del = rr_graph.rr_switch_inf(RRSwitchId(wire_to_ipin_switch)).Tdel;
621-
rr_indexed_data[RRIndexedDataId(IPIN_COST_INDEX)].T_linear = default_ipin_switch_T_del;
615+
rr_indexed_data[RRIndexedDataId(IPIN_COST_INDEX)].T_linear = 0.0;
622616
} else {
623617
float average_ipin_switch_T_del = ipin_switch_T_total / ipin_switch_count;
624618
rr_indexed_data[RRIndexedDataId(IPIN_COST_INDEX)].T_linear = average_ipin_switch_T_del;

libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ void alloc_and_load_rr_indexed_data(const RRGraphView& rr_graph,
1212
const std::vector<t_segment_inf>& segment_inf_y,
1313
const std::vector<t_segment_inf>& segment_inf_z,
1414
vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data,
15-
const RRSwitchId wire_to_ipin_switch,
1615
e_base_cost_type base_cost_type,
1716
const bool echo_enabled,
1817
const char* echo_file_name);

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;

0 commit comments

Comments
 (0)