@@ -82,7 +82,7 @@ static t_wireconn_inf parse_wireconn_multinode(pugi::xml_node node,
8282 const std::vector<t_arch_switch_inf>& switches);
8383
8484// Process a <from> or <to> sub-node of a multinode wireconn
85- t_wire_switchpoints parse_wireconn_from_to_node (pugi::xml_node node, const pugiutil::loc_data& loc_data);
85+ static t_wire_switchpoints parse_wireconn_from_to_node (pugi::xml_node node, const pugiutil::loc_data& loc_data);
8686
8787/* parses the wire types specified in the comma-separated 'ch' char array into the vector wire_points_vec.
8888 * Spaces are trimmed off */
@@ -95,13 +95,13 @@ static void parse_comma_separated_wire_points(const char* ch, std::vector<t_wire
9595static void parse_num_conns (std::string num_conns, t_wireconn_inf& wireconn);
9696
9797/* Set connection from_side and to_side for custom switch block pattern*/
98- static void set_switch_func_type (SB_Side_Connection & conn, const char * func_type);
98+ static void set_switch_func_type (SBSideConnection & conn, const char * func_type);
9999
100100/* parse switch_override in wireconn */
101101static void parse_switch_override (const char * switch_override, t_wireconn_inf& wireconn, const std::vector<t_arch_switch_inf>& switches);
102102
103103/* checks for correctness of a unidir switchblock. */
104- static void check_unidir_switchblock (const t_switchblock_inf* sb);
104+ static void check_unidir_switchblock (const t_switchblock_inf& sb);
105105
106106/* checks for correctness of a bidir switchblock. */
107107static void check_bidir_switchblock (const t_permutation_map* permutation_map);
@@ -235,7 +235,7 @@ static t_wireconn_inf parse_wireconn_multinode(pugi::xml_node node,
235235 }
236236}
237237
238- t_wire_switchpoints parse_wireconn_from_to_node (pugi::xml_node node, const pugiutil::loc_data& loc_data) {
238+ static t_wire_switchpoints parse_wireconn_from_to_node (pugi::xml_node node, const pugiutil::loc_data& loc_data) {
239239 expect_only_attributes (node, {" type" , " switchpoint" }, loc_data);
240240
241241 size_t attribute_count = count_attributes (node, loc_data);
@@ -277,13 +277,13 @@ static void parse_switchpoint_order(const char* order, SwitchPointOrder& switchp
277277/* parses the wire types specified in the comma-separated 'ch' char array into the vector wire_points_vec.
278278 * Spaces are trimmed off */
279279static void parse_comma_separated_wire_types (const char * ch, std::vector<t_wire_switchpoints>& wire_switchpoints) {
280- auto types = vtr::split (ch, " ," );
280+ std::vector<std::string> types = vtr::split (ch, " ," );
281281
282282 if (types.empty ()) {
283283 archfpga_throw (__FILE__, __LINE__, " parse_comma_separated_wire_types: found empty wireconn wire type entry\n " );
284284 }
285285
286- for (const auto & type : types) {
286+ for (const std::string & type : types) {
287287 t_wire_switchpoints wsp;
288288 wsp.segment_name = type;
289289
@@ -293,15 +293,15 @@ static void parse_comma_separated_wire_types(const char* ch, std::vector<t_wire_
293293
294294/* parses the wirepoints specified in the comma-separated 'ch' char array into the vector wire_points_vec */
295295static void parse_comma_separated_wire_points (const char * ch, std::vector<t_wire_switchpoints>& wire_switchpoints) {
296- auto points = vtr::split (ch, " ," );
296+ std::vector<std::string> points = vtr::split (ch, " ," );
297297 if (points.empty ()) {
298298 archfpga_throw (__FILE__, __LINE__, " parse_comma_separated_wire_points: found empty wireconn wire point entry\n " );
299299 }
300300
301- for (const auto & point_str : points) {
301+ for (const std::string & point_str : points) {
302302 int point = vtr::atoi (point_str);
303303
304- for (auto & wire_switchpoint : wire_switchpoints) {
304+ for (t_wire_switchpoints & wire_switchpoint : wire_switchpoints) {
305305 wire_switchpoint.switchpoints .push_back (point);
306306 }
307307 }
@@ -313,7 +313,7 @@ static void parse_num_conns(std::string num_conns, t_wireconn_inf& wireconn) {
313313}
314314
315315// set sides for a specific conn for custom switch block pattern
316- static void set_switch_func_type (SB_Side_Connection & conn, const char * func_type) {
316+ static void set_switch_func_type (SBSideConnection & conn, const char * func_type) {
317317 if (0 == strcmp (func_type, " lt" )) {
318318 conn.set_sides (LEFT, TOP);
319319 } else if (0 == strcmp (func_type, " lr" )) {
@@ -399,7 +399,7 @@ void read_sb_switchfuncs(pugi::xml_node node, t_switchblock_inf& sb, const pugiu
399399 const char * func_formula = get_attribute (SubElem, " formula" , loc_data).as_string (nullptr );
400400
401401 // Used to index into permutation map of switchblock
402- SB_Side_Connection conn;
402+ SBSideConnection conn;
403403
404404 // go through all the possible cases of func_type
405405 set_switch_func_type (conn, func_type);
@@ -431,20 +431,20 @@ static void parse_switch_override(const char* switch_override, t_wireconn_inf& w
431431}
432432
433433/* checks for correctness of switch block read-in from the XML architecture file */
434- void check_switchblock (const t_switchblock_inf* sb, const t_arch* arch) {
434+ void check_switchblock (const t_switchblock_inf& sb, const t_arch* arch) {
435435 /* get directionality */
436- enum e_directionality directionality = sb-> directionality ;
436+ enum e_directionality directionality = sb. directionality ;
437437
438438 /* Check for errors in the switchblock descriptions */
439439 if (UNI_DIRECTIONAL == directionality) {
440440 check_unidir_switchblock (sb);
441441 } else {
442442 VTR_ASSERT (BI_DIRECTIONAL == directionality);
443- check_bidir_switchblock (&(sb-> permutation_map ));
443+ check_bidir_switchblock (&(sb. permutation_map ));
444444 }
445445
446446 /* check that specified wires exist */
447- for (const auto & wireconn : sb-> wireconns ) {
447+ for (const t_wireconn_inf & wireconn : sb. wireconns ) {
448448 check_wireconn (arch, wireconn);
449449 }
450450
@@ -456,9 +456,9 @@ void check_switchblock(const t_switchblock_inf* sb, const t_arch* arch) {
456456}
457457
458458/* checks for correctness of a unidirectional switchblock. hard exit if error found (to be changed to throw later) */
459- static void check_unidir_switchblock (const t_switchblock_inf* sb) {
459+ static void check_unidir_switchblock (const t_switchblock_inf& sb) {
460460 /* Check that the destination wire points are always the starting points (i.e. of wire point 0) */
461- for (const t_wireconn_inf& wireconn : sb-> wireconns ) {
461+ for (const t_wireconn_inf& wireconn : sb. wireconns ) {
462462 for (const t_wire_switchpoints& wire_to_points : wireconn.to_switchpoint_set ) {
463463 if (wire_to_points.switchpoints .size () > 1 || wire_to_points.switchpoints [0 ] != 0 ) {
464464 archfpga_throw (__FILE__, __LINE__, " Unidirectional switch blocks are currently only allowed to drive the start points of wire segments\n " );
@@ -472,7 +472,7 @@ static void check_bidir_switchblock(const t_permutation_map* permutation_map) {
472472 /* *** check that if side1->side2 is specified, then side2->side1 is not, as it is implicit ****/
473473
474474 /* variable used to index into the permutation map */
475- SB_Side_Connection conn;
475+ SBSideConnection conn;
476476
477477 /* iterate over all combinations of from_side -> to side */
478478 for (e_side from_side : TOTAL_2D_SIDES) {
@@ -486,7 +486,7 @@ static void check_bidir_switchblock(const t_permutation_map* permutation_map) {
486486 conn.set_sides (from_side, to_side);
487487
488488 /* check if a connection between these sides exists */
489- t_permutation_map::const_iterator it = (*permutation_map).find (conn);
489+ auto it = (*permutation_map).find (conn);
490490 if (it != (*permutation_map).end ()) {
491491 /* the two sides are connected */
492492 /* check if the opposite connection has been specified */
@@ -498,8 +498,6 @@ static void check_bidir_switchblock(const t_permutation_map* permutation_map) {
498498 }
499499 }
500500 }
501-
502- return ;
503501}
504502
505503static void check_wireconn (const t_arch* arch, const t_wireconn_inf& wireconn) {
0 commit comments