Skip to content

Commit 4cea411

Browse files
committed
[lib][rr_graph] remove ipin_switch from rr graph reader
1 parent 1d90309 commit 4cea411

File tree

6 files changed

+3
-66
lines changed

6 files changed

+3
-66
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 & 7 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) {
@@ -159,8 +157,7 @@ void alloc_and_load_rr_indexed_data(const RRGraphView& rr_graph,
159157
}
160158

161159
load_rr_indexed_data_T_values(rr_graph,
162-
wire_to_ipin_switch,
163-
rr_indexed_data);
160+
rr_indexed_data);
164161

165162
fixup_rr_indexed_data_T_values(rr_indexed_data, total_num_segment);
166163

@@ -515,7 +512,6 @@ static float get_delay_normalization_fac(const vtr::vector<RRIndexedDataId, t_rr
515512
* - Placement Delay Matrix computation
516513
*/
517514
static void load_rr_indexed_data_T_values(const RRGraphView& rr_graph,
518-
const RRSwitchId wire_to_ipin_switch,
519515
vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data) {
520516
vtr::vector<RRNodeId, std::vector<RREdgeId>> fan_in_list = get_fan_in_list(rr_graph);
521517

@@ -617,8 +613,7 @@ static void load_rr_indexed_data_T_values(const RRGraphView& rr_graph,
617613
{
618614
if (ipin_switch_count == 0) {
619615
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;
616+
rr_indexed_data[RRIndexedDataId(IPIN_COST_INDEX)].T_linear = 0.0;
622617
} else {
623618
float average_ipin_switch_T_del = ipin_switch_T_total / ipin_switch_count;
624619
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);

0 commit comments

Comments
 (0)