@@ -41,16 +41,16 @@ using vtr::t_formula_data;
41
41
/* ---- Functions for Parsing Switchblocks from Architecture ----*/
42
42
43
43
// Load an XML wireconn specification into a t_wireconn_inf
44
- t_wireconn_inf parse_wireconn (pugi::xml_node node, const pugiutil::loc_data& loc_data, const t_arch_switch_inf* Switches , int num_switches);
44
+ t_wireconn_inf parse_wireconn (pugi::xml_node node, const pugiutil::loc_data& loc_data, const t_arch_switch_inf* switches , int num_switches);
45
45
46
46
// Process the desired order of a wireconn
47
47
static void parse_switchpoint_order (const char * order, SwitchPointOrder& switchpoint_order);
48
48
49
49
// Process a wireconn defined in the inline style (using attributes)
50
- void parse_wireconn_inline (pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* Switches , int num_switches);
50
+ void parse_wireconn_inline (pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* switches , int num_switches);
51
51
52
52
// Process a wireconn defined in the multinode style (more advanced specification)
53
- void parse_wireconn_multinode (pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* Switches , int num_switches);
53
+ void parse_wireconn_multinode (pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* switches , int num_switches);
54
54
55
55
// Process a <from> or <to> sub-node of a multinode wireconn
56
56
t_wire_switchpoints parse_wireconn_from_to_node (pugi::xml_node node, const pugiutil::loc_data& loc_data);
@@ -66,7 +66,7 @@ static void parse_comma_separated_wire_points(const char* ch, std::vector<t_wire
66
66
static void parse_num_conns (std::string num_conns, t_wireconn_inf& wireconn);
67
67
68
68
/* parse switch_override in wireconn */
69
- static void parse_switch_override (const char * switch_override, t_wireconn_inf& wireconn, const t_arch_switch_inf* Switches , int num_switches);
69
+ static void parse_switch_override (const char * switch_override, t_wireconn_inf& wireconn, const t_arch_switch_inf* switches , int num_switches);
70
70
71
71
/* checks for correctness of a unidir switchblock. */
72
72
static void check_unidir_switchblock (const t_switchblock_inf* sb);
@@ -82,7 +82,7 @@ static void check_wireconn(const t_arch* arch, const t_wireconn_inf& wireconn);
82
82
/* ---- Functions for Parsing Switchblocks from Architecture ----*/
83
83
84
84
/* Reads-in the wire connections specified for the switchblock in the xml arch file */
85
- void read_sb_wireconns (const t_arch_switch_inf* Switches , int num_switches, pugi::xml_node Node, t_switchblock_inf* sb, const pugiutil::loc_data& loc_data) {
85
+ void read_sb_wireconns (const t_arch_switch_inf* switches , int num_switches, pugi::xml_node Node, t_switchblock_inf* sb, const pugiutil::loc_data& loc_data) {
86
86
/* Make sure that Node is a switchblock */
87
87
check_node (Node, " switchblock" , loc_data);
88
88
@@ -97,31 +97,31 @@ void read_sb_wireconns(const t_arch_switch_inf* Switches, int num_switches, pugi
97
97
SubElem = get_first_child (Node, " wireconn" , loc_data);
98
98
}
99
99
for (int i = 0 ; i < num_wireconns; i++) {
100
- t_wireconn_inf wc = parse_wireconn (SubElem, loc_data, Switches , num_switches); // need to pass in switch info for switch override
100
+ t_wireconn_inf wc = parse_wireconn (SubElem, loc_data, switches , num_switches); // need to pass in switch info for switch override
101
101
sb->wireconns .push_back (wc);
102
102
SubElem = SubElem.next_sibling (SubElem.name ());
103
103
}
104
104
105
105
return ;
106
106
}
107
107
108
- t_wireconn_inf parse_wireconn (pugi::xml_node node, const pugiutil::loc_data& loc_data, const t_arch_switch_inf* Switches , int num_switches) {
108
+ t_wireconn_inf parse_wireconn (pugi::xml_node node, const pugiutil::loc_data& loc_data, const t_arch_switch_inf* switches , int num_switches) {
109
109
t_wireconn_inf wc;
110
110
111
111
size_t num_children = count_children (node, " from" , loc_data, ReqOpt::OPTIONAL);
112
112
num_children += count_children (node, " to" , loc_data, ReqOpt::OPTIONAL);
113
113
114
114
if (num_children == 0 ) {
115
- parse_wireconn_inline (node, loc_data, wc, Switches , num_switches);
115
+ parse_wireconn_inline (node, loc_data, wc, switches , num_switches);
116
116
} else {
117
117
VTR_ASSERT (num_children > 0 );
118
- parse_wireconn_multinode (node, loc_data, wc, Switches , num_switches);
118
+ parse_wireconn_multinode (node, loc_data, wc, switches , num_switches);
119
119
}
120
120
121
121
return wc;
122
122
}
123
123
124
- void parse_wireconn_inline (pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* Switches , int num_switches) {
124
+ void parse_wireconn_inline (pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* switches , int num_switches) {
125
125
// Parse an inline wireconn definition, using attributes
126
126
expect_only_attributes (node, {" num_conns" , " from_type" , " to_type" , " from_switchpoint" , " to_switchpoint" , " from_order" , " to_order" , " switch_override" }, loc_data);
127
127
@@ -150,13 +150,13 @@ void parse_wireconn_inline(pugi::xml_node node, const pugiutil::loc_data& loc_da
150
150
151
151
char_prop = get_attribute (node, " to_order" , loc_data, ReqOpt::OPTIONAL).value ();
152
152
parse_switchpoint_order (char_prop, wc.to_switchpoint_order );
153
-
153
+
154
154
// parse switch overrides if they exist:
155
155
char_prop = get_attribute (node, " switch_override" , loc_data, ReqOpt::OPTIONAL).value ();
156
- parse_switch_override (char_prop, wc, Switches , num_switches);
156
+ parse_switch_override (char_prop, wc, switches , num_switches);
157
157
}
158
158
159
- void parse_wireconn_multinode (pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* Switches , int num_switches) {
159
+ void parse_wireconn_multinode (pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* switches , int num_switches) {
160
160
expect_only_children (node, {" from" , " to" }, loc_data);
161
161
162
162
/* get the connection style */
@@ -170,7 +170,7 @@ void parse_wireconn_multinode(pugi::xml_node node, const pugiutil::loc_data& loc
170
170
parse_switchpoint_order (char_prop, wc.to_switchpoint_order );
171
171
172
172
char_prop = get_attribute (node, " switch_override" , loc_data, ReqOpt::OPTIONAL).value ();
173
- parse_switch_override (char_prop, wc, Switches , num_switches);
173
+ parse_switch_override (char_prop, wc, switches , num_switches);
174
174
175
175
size_t num_from_children = count_children (node, " from" , loc_data);
176
176
size_t num_to_children = count_children (node, " to" , loc_data);
@@ -341,17 +341,16 @@ void read_sb_switchfuncs(pugi::xml_node Node, t_switchblock_inf* sb, const pugiu
341
341
return ;
342
342
}
343
343
344
- static void parse_switch_override (const char * switch_override, t_wireconn_inf& wireconn, const t_arch_switch_inf* Switches, int num_switches){
345
-
344
+ static void parse_switch_override (const char * switch_override, t_wireconn_inf& wireconn, const t_arch_switch_inf* switches, int num_switches) {
346
345
// check to see if user did not specify a switch_override
347
346
if (switch_override == std::string (" " )) {
348
347
wireconn.switch_override_indx = DEFAULT_SWITCH; // Default
349
348
return ;
350
349
}
351
350
352
351
// iterate through the valid switch names in the arch looking for the requested switch_override
353
- for (int i = 0 ; i < num_switches; i++){
354
- if (0 == strcmp (switch_override, Switches [i].name )){
352
+ for (int i = 0 ; i < num_switches; i++) {
353
+ if (0 == strcmp (switch_override, switches [i].name )) {
355
354
wireconn.switch_override_indx = i;
356
355
return ;
357
356
}
0 commit comments