@@ -194,7 +194,7 @@ static void ProcessSubTiles(pugi::xml_node Node,
194194 * string interment storage.
195195 * @param loc_data Points to the location in the architecture file where the parser is reading.
196196 * @param pb_idx Used to assign unique values to index_in_logical_block field in
197- * t_pb_type for all pb_types under a logical block type.
197+ * t_pb_type for all pb_types under a logical block type.
198198 */
199199static void ProcessPb_Type (pugi::xml_node Parent,
200200 t_pb_type* pb_type,
@@ -253,7 +253,7 @@ static void ProcessMode(pugi::xml_node Parent,
253253 * @brief Processes <metadata> tags.
254254 *
255255 * @param strings String internment storage used to store strings used
256- * as keys and values in <metadata> tags.
256+ * as keys and values in <metadata> tags.
257257 * @param Parent An XML node pointing to the parent tag whose <metadata> children
258258 * are to be parsed.
259259 * @param loc_data Points to the location in the architecture file where the parser is reading.
@@ -358,7 +358,6 @@ static void ProcessPower(pugi::xml_node parent,
358358
359359static void ProcessClocks (pugi::xml_node Parent, t_clock_arch* clocks, const pugiutil::loc_data& loc_data);
360360
361-
362361static void ProcessPb_TypePowerEstMethod (pugi::xml_node Parent, t_pb_type* pb_type, const pugiutil::loc_data& loc_data);
363362static void ProcessPb_TypePort_Power (pugi::xml_node Parent, t_port* port, e_power_estimation_method power_method, const pugiutil::loc_data& loc_data);
364363
@@ -1746,10 +1745,9 @@ static void ProcessInterconnect(vtr::string_internment& strings,
17461745 }
17471746
17481747 mode->interconnect [interconnect_idx].annotations = (t_pin_to_pin_annotation*)vtr::calloc (num_annotations,
1749- sizeof (t_pin_to_pin_annotation));
1748+ sizeof (t_pin_to_pin_annotation));
17501749 mode->interconnect [interconnect_idx].num_annotations = num_annotations;
17511750
1752-
17531751 int annotation_idx = 0 ;
17541752 for (auto annot_child_name : {" delay_constant" , " delay_matrix" , " C_constant" , " C_matrix" , " pack_pattern" }) {
17551753 pugi::xml_node Cur2 = get_first_child (Cur, annot_child_name, loc_data, ReqOpt::OPTIONAL);
@@ -1767,7 +1765,7 @@ static void ProcessInterconnect(vtr::string_internment& strings,
17671765
17681766 /* Power */
17691767 mode->interconnect [interconnect_idx].interconnect_power = (t_interconnect_power*)vtr::calloc (1 ,
1770- sizeof (t_interconnect_power));
1768+ sizeof (t_interconnect_power));
17711769 mode->interconnect [interconnect_idx].interconnect_power ->port_info_initialized = false ;
17721770
17731771 /* get next iteration */
@@ -2907,7 +2905,6 @@ static void ProcessTiles(pugi::xml_node Node,
29072905 t_arch& arch,
29082906 const pugiutil::loc_data& loc_data,
29092907 const int num_of_avail_layer) {
2910-
29112908 // used to find duplicate tile names
29122909 std::set<std::string> tile_type_descriptors;
29132910
@@ -3805,7 +3802,7 @@ static void ProcessSegments(pugi::xml_node Parent,
38053802 tmp = get_attribute (SubElem, " name" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
38063803
38073804 // check if <mux> tag is defined in the architecture, otherwise we should look for <mux_inc> and <mux_dec>
3808- if (tmp){
3805+ if (tmp) {
38093806 /* Match names */
38103807 for (j = 0 ; j < NumSwitches; ++j) {
38113808 if (0 == strcmp (tmp, Switches[j].name .c_str ())) {
@@ -3814,22 +3811,21 @@ static void ProcessSegments(pugi::xml_node Parent,
38143811 }
38153812 if (j >= NumSwitches) {
38163813 archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
3817- " '%s' is not a valid mux name.\n " , tmp);
3814+ " '%s' is not a valid mux name.\n " , tmp);
38183815 }
38193816
38203817 /* Unidir muxes must have the same switch
3821- * for wire and opin fanin since there is
3822- * really only the mux in unidir. */
3818+ * for wire and opin fanin since there is
3819+ * really only the mux in unidir. */
38233820 Segs[i].arch_wire_switch = j;
38243821 Segs[i].arch_opin_switch = j;
3825- }
3826- else { // if a general mux is not defined, we should look for specific mux for each direction in the architecture file
3822+ } else { // if a general mux is not defined, we should look for specific mux for each direction in the architecture file
38273823 SubElem = get_single_child (Node, " mux_inc" , loc_data, ReqOpt::OPTIONAL);
38283824 tmp = get_attribute (SubElem, " name" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
3829- if (!tmp){
3825+ if (!tmp) {
38303826 archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
3831- " if mux is not specified in a wire segment, both mux_inc and mux_dec should be specified" );
3832- } else {
3827+ " if mux is not specified in a wire segment, both mux_inc and mux_dec should be specified" );
3828+ } else {
38333829 /* Match names */
38343830 for (j = 0 ; j < NumSwitches; ++j) {
38353831 if (0 == strcmp (tmp, Switches[j].name .c_str ())) {
@@ -3838,22 +3834,22 @@ static void ProcessSegments(pugi::xml_node Parent,
38383834 }
38393835 if (j >= NumSwitches) {
38403836 archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
3841- " '%s' is not a valid mux name.\n " , tmp);
3837+ " '%s' is not a valid mux name.\n " , tmp);
38423838 }
38433839
38443840 /* Unidir muxes must have the same switch
3845- * for wire and opin fanin since there is
3846- * really only the mux in unidir. */
3841+ * for wire and opin fanin since there is
3842+ * really only the mux in unidir. */
38473843 Segs[i].arch_wire_switch = j;
38483844 Segs[i].arch_opin_switch = j;
38493845 }
38503846
38513847 SubElem = get_single_child (Node, " mux_dec" , loc_data, ReqOpt::OPTIONAL);
38523848 tmp = get_attribute (SubElem, " name" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
3853- if (!tmp){
3849+ if (!tmp) {
38543850 archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
3855- " if mux is not specified in a wire segment, both mux_inc and mux_dec should be specified" );
3856- } else {
3851+ " if mux is not specified in a wire segment, both mux_inc and mux_dec should be specified" );
3852+ } else {
38573853 /* Match names */
38583854 for (j = 0 ; j < NumSwitches; ++j) {
38593855 if (0 == strcmp (tmp, Switches[j].name .c_str ())) {
@@ -3862,18 +3858,17 @@ static void ProcessSegments(pugi::xml_node Parent,
38623858 }
38633859 if (j >= NumSwitches) {
38643860 archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
3865- " '%s' is not a valid mux name.\n " , tmp);
3861+ " '%s' is not a valid mux name.\n " , tmp);
38663862 }
38673863
38683864 /* Unidir muxes must have the same switch
3869- * for wire and opin fanin since there is
3870- * really only the mux in unidir. */
3865+ * for wire and opin fanin since there is
3866+ * really only the mux in unidir. */
38713867 Segs[i].arch_wire_switch_dec = j;
38723868 Segs[i].arch_opin_switch_dec = j;
38733869 }
38743870 }
3875- }
3876- else {
3871+ } else {
38773872 VTR_ASSERT (BI_DIRECTIONAL == Segs[i].directionality );
38783873 SubElem = get_single_child (Node, " wire_switch" , loc_data);
38793874 tmp = get_attribute (SubElem, " name" , loc_data).value ();
@@ -3938,13 +3933,12 @@ static void ProcessSegments(pugi::xml_node Parent,
39383933 }
39393934}
39403935
3941-
3942- static void calculate_custom_SB_locations (const pugiutil::loc_data& loc_data, const pugi::xml_node& SubElem, const int grid_width, const int grid_height, t_switchblock_inf& sb){
3936+ static void calculate_custom_SB_locations (const pugiutil::loc_data& loc_data, const pugi::xml_node& SubElem, const int grid_width, const int grid_height, t_switchblock_inf& sb) {
39433937 auto startx_attr = get_attribute (SubElem, " startx" , loc_data, ReqOpt::OPTIONAL);
3944- auto endx_attr = get_attribute (SubElem, " endx" , loc_data, ReqOpt::OPTIONAL);
3938+ auto endx_attr = get_attribute (SubElem, " endx" , loc_data, ReqOpt::OPTIONAL);
39453939
39463940 auto starty_attr = get_attribute (SubElem, " starty" , loc_data, ReqOpt::OPTIONAL);
3947- auto endy_attr = get_attribute (SubElem, " endy" , loc_data, ReqOpt::OPTIONAL);
3941+ auto endy_attr = get_attribute (SubElem, " endy" , loc_data, ReqOpt::OPTIONAL);
39483942
39493943 auto repeatx_attr = get_attribute (SubElem, " repeatx" , loc_data, ReqOpt::OPTIONAL);
39503944 auto repeaty_attr = get_attribute (SubElem, " repeaty" , loc_data, ReqOpt::OPTIONAL);
@@ -3959,19 +3953,17 @@ static void calculate_custom_SB_locations(const pugiutil::loc_data& loc_data, co
39593953 vars.set_var_value (" W" , grid_width);
39603954 vars.set_var_value (" H" , grid_height);
39613955
3962-
39633956 sb.reg_x .start = startx_attr.empty () ? 0 : p.parse_formula (startx_attr.value (), vars);
39643957 sb.reg_y .start = starty_attr.empty () ? 0 : p.parse_formula (starty_attr.value (), vars);
39653958
39663959 sb.reg_x .end = endx_attr.empty () ? (grid_width - 1 ) : p.parse_formula (endx_attr.value (), vars);
3967- sb.reg_y .end = endy_attr.empty () ? (grid_height -1 ) : p.parse_formula (endy_attr.value (), vars);
3960+ sb.reg_y .end = endy_attr.empty () ? (grid_height - 1 ) : p.parse_formula (endy_attr.value (), vars);
39683961
39693962 sb.reg_x .repeat = repeatx_attr.empty () ? 0 : p.parse_formula (repeatx_attr.value (), vars);
39703963 sb.reg_y .repeat = repeaty_attr.empty () ? 0 : p.parse_formula (repeaty_attr.value (), vars);
39713964
39723965 sb.reg_x .incr = incrx_attr.empty () ? 1 : p.parse_formula (incrx_attr.value (), vars);
39733966 sb.reg_y .incr = incry_attr.empty () ? 1 : p.parse_formula (incry_attr.value (), vars);
3974-
39753967}
39763968
39773969/* Processes the switchblocklist section from the xml architecture file.
@@ -3985,10 +3977,10 @@ static void ProcessSwitchblocks(pugi::xml_node Parent, t_arch* arch, const pugiu
39853977 /* get the number of switchblocks */
39863978 int num_switchblocks = count_children (Parent, " switchblock" , loc_data);
39873979 arch->switchblocks .reserve (num_switchblocks);
3988-
3980+
39893981 int layout_index = -1 ;
3990- for (layout_index = 0 ; layout_index < (int ) arch->grid_layouts .size (); layout_index++){
3991- if (arch->grid_layouts .at (layout_index).name == arch->device_layout ){
3982+ for (layout_index = 0 ; layout_index < (int )arch->grid_layouts .size (); layout_index++) {
3983+ if (arch->grid_layouts .at (layout_index).name == arch->device_layout ) {
39923984 // found the used layout
39933985 break ;
39943986 }
@@ -4040,8 +4032,8 @@ static void ProcessSwitchblocks(pugi::xml_node Parent, t_arch* arch, const pugiu
40404032 }
40414033
40424034 /* get the switchblock coordinate only if sb.location is set to E_XY_SPECIFIED*/
4043- if (sb.location == e_sb_location::E_XY_SPECIFIED){
4044- if (arch->device_layout == " auto" ){
4035+ if (sb.location == e_sb_location::E_XY_SPECIFIED) {
4036+ if (arch->device_layout == " auto" ) {
40454037 archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem), " Specifying SB locations for auto layout devices are not supported yet!\n " );
40464038 }
40474039 expect_only_attributes (SubElem,
@@ -4052,25 +4044,24 @@ static void ProcessSwitchblocks(pugi::xml_node Parent, t_arch* arch, const pugiu
40524044
40534045 int grid_width = arch->grid_layouts .at (layout_index).width ;
40544046 int grid_height = arch->grid_layouts .at (layout_index).height ;
4055-
4047+
40564048 /* Absolute location that this SB must be applied to, -1 if not specified*/
40574049 sb.x = get_attribute (SubElem, " x" , loc_data, ReqOpt::OPTIONAL).as_int (-1 );
40584050 sb.y = get_attribute (SubElem, " y" , loc_data, ReqOpt::OPTIONAL).as_int (-1 );
40594051
40604052 // check if the absolute value is within the device grid width and height
4061- if (sb.x >= grid_width || sb.y >= grid_height) {
4062- archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem), \
4063- " Location (%d,%d) is not valid within the grid! grid dimensions are: (%d,%d)\n " , sb.x , sb.y , grid_width, grid_height);
4053+ if (sb.x >= grid_width || sb.y >= grid_height) {
4054+ archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
4055+ " Location (%d,%d) is not valid within the grid! grid dimensions are: (%d,%d)\n " , sb.x , sb.y , grid_width, grid_height);
40644056 }
4065-
4057+
40664058 /* if the the switchblock exact location is not specified and a region is specified within the architecture file,
40674059 * we have to parse the region specification and apply the SB pattern to all the locations fall into the specified
40684060 * region based on device width and height.
40694061 */
40704062 if (sb.x == -1 && sb.y == -1 ) {
40714063 calculate_custom_SB_locations (loc_data, SubElem, grid_width, grid_height, sb);
40724064 }
4073-
40744065 }
40754066
40764067 /* get switchblock permutation functions */
0 commit comments