@@ -194,7 +194,7 @@ static void ProcessSubTiles(pugi::xml_node Node,
194
194
* string interment storage.
195
195
* @param loc_data Points to the location in the architecture file where the parser is reading.
196
196
* @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.
198
198
*/
199
199
static void ProcessPb_Type (pugi::xml_node Parent,
200
200
t_pb_type* pb_type,
@@ -253,7 +253,7 @@ static void ProcessMode(pugi::xml_node Parent,
253
253
* @brief Processes <metadata> tags.
254
254
*
255
255
* @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.
257
257
* @param Parent An XML node pointing to the parent tag whose <metadata> children
258
258
* are to be parsed.
259
259
* @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,
358
358
359
359
static void ProcessClocks (pugi::xml_node Parent, t_clock_arch* clocks, const pugiutil::loc_data& loc_data);
360
360
361
-
362
361
static void ProcessPb_TypePowerEstMethod (pugi::xml_node Parent, t_pb_type* pb_type, const pugiutil::loc_data& loc_data);
363
362
static void ProcessPb_TypePort_Power (pugi::xml_node Parent, t_port* port, e_power_estimation_method power_method, const pugiutil::loc_data& loc_data);
364
363
@@ -1746,10 +1745,9 @@ static void ProcessInterconnect(vtr::string_internment& strings,
1746
1745
}
1747
1746
1748
1747
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));
1750
1749
mode->interconnect [interconnect_idx].num_annotations = num_annotations;
1751
1750
1752
-
1753
1751
int annotation_idx = 0 ;
1754
1752
for (auto annot_child_name : {" delay_constant" , " delay_matrix" , " C_constant" , " C_matrix" , " pack_pattern" }) {
1755
1753
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,
1767
1765
1768
1766
/* Power */
1769
1767
mode->interconnect [interconnect_idx].interconnect_power = (t_interconnect_power*)vtr::calloc (1 ,
1770
- sizeof (t_interconnect_power));
1768
+ sizeof (t_interconnect_power));
1771
1769
mode->interconnect [interconnect_idx].interconnect_power ->port_info_initialized = false ;
1772
1770
1773
1771
/* get next iteration */
@@ -2907,7 +2905,6 @@ static void ProcessTiles(pugi::xml_node Node,
2907
2905
t_arch& arch,
2908
2906
const pugiutil::loc_data& loc_data,
2909
2907
const int num_of_avail_layer) {
2910
-
2911
2908
// used to find duplicate tile names
2912
2909
std::set<std::string> tile_type_descriptors;
2913
2910
@@ -3805,7 +3802,7 @@ static void ProcessSegments(pugi::xml_node Parent,
3805
3802
tmp = get_attribute (SubElem, " name" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
3806
3803
3807
3804
// 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) {
3809
3806
/* Match names */
3810
3807
for (j = 0 ; j < NumSwitches; ++j) {
3811
3808
if (0 == strcmp (tmp, Switches[j].name .c_str ())) {
@@ -3814,22 +3811,21 @@ static void ProcessSegments(pugi::xml_node Parent,
3814
3811
}
3815
3812
if (j >= NumSwitches) {
3816
3813
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);
3818
3815
}
3819
3816
3820
3817
/* 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. */
3823
3820
Segs[i].arch_wire_switch = j;
3824
3821
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
3827
3823
SubElem = get_single_child (Node, " mux_inc" , loc_data, ReqOpt::OPTIONAL);
3828
3824
tmp = get_attribute (SubElem, " name" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
3829
- if (!tmp){
3825
+ if (!tmp) {
3830
3826
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 {
3833
3829
/* Match names */
3834
3830
for (j = 0 ; j < NumSwitches; ++j) {
3835
3831
if (0 == strcmp (tmp, Switches[j].name .c_str ())) {
@@ -3838,22 +3834,22 @@ static void ProcessSegments(pugi::xml_node Parent,
3838
3834
}
3839
3835
if (j >= NumSwitches) {
3840
3836
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);
3842
3838
}
3843
3839
3844
3840
/* 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. */
3847
3843
Segs[i].arch_wire_switch = j;
3848
3844
Segs[i].arch_opin_switch = j;
3849
3845
}
3850
3846
3851
3847
SubElem = get_single_child (Node, " mux_dec" , loc_data, ReqOpt::OPTIONAL);
3852
3848
tmp = get_attribute (SubElem, " name" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
3853
- if (!tmp){
3849
+ if (!tmp) {
3854
3850
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 {
3857
3853
/* Match names */
3858
3854
for (j = 0 ; j < NumSwitches; ++j) {
3859
3855
if (0 == strcmp (tmp, Switches[j].name .c_str ())) {
@@ -3862,18 +3858,17 @@ static void ProcessSegments(pugi::xml_node Parent,
3862
3858
}
3863
3859
if (j >= NumSwitches) {
3864
3860
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);
3866
3862
}
3867
3863
3868
3864
/* 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. */
3871
3867
Segs[i].arch_wire_switch_dec = j;
3872
3868
Segs[i].arch_opin_switch_dec = j;
3873
3869
}
3874
3870
}
3875
- }
3876
- else {
3871
+ } else {
3877
3872
VTR_ASSERT (BI_DIRECTIONAL == Segs[i].directionality );
3878
3873
SubElem = get_single_child (Node, " wire_switch" , loc_data);
3879
3874
tmp = get_attribute (SubElem, " name" , loc_data).value ();
@@ -3938,13 +3933,12 @@ static void ProcessSegments(pugi::xml_node Parent,
3938
3933
}
3939
3934
}
3940
3935
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) {
3943
3937
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);
3945
3939
3946
3940
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);
3948
3942
3949
3943
auto repeatx_attr = get_attribute (SubElem, " repeatx" , loc_data, ReqOpt::OPTIONAL);
3950
3944
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
3959
3953
vars.set_var_value (" W" , grid_width);
3960
3954
vars.set_var_value (" H" , grid_height);
3961
3955
3962
-
3963
3956
sb.reg_x .start = startx_attr.empty () ? 0 : p.parse_formula (startx_attr.value (), vars);
3964
3957
sb.reg_y .start = starty_attr.empty () ? 0 : p.parse_formula (starty_attr.value (), vars);
3965
3958
3966
3959
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);
3968
3961
3969
3962
sb.reg_x .repeat = repeatx_attr.empty () ? 0 : p.parse_formula (repeatx_attr.value (), vars);
3970
3963
sb.reg_y .repeat = repeaty_attr.empty () ? 0 : p.parse_formula (repeaty_attr.value (), vars);
3971
3964
3972
3965
sb.reg_x .incr = incrx_attr.empty () ? 1 : p.parse_formula (incrx_attr.value (), vars);
3973
3966
sb.reg_y .incr = incry_attr.empty () ? 1 : p.parse_formula (incry_attr.value (), vars);
3974
-
3975
3967
}
3976
3968
3977
3969
/* 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
3985
3977
/* get the number of switchblocks */
3986
3978
int num_switchblocks = count_children (Parent, " switchblock" , loc_data);
3987
3979
arch->switchblocks .reserve (num_switchblocks);
3988
-
3980
+
3989
3981
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 ) {
3992
3984
// found the used layout
3993
3985
break ;
3994
3986
}
@@ -4040,8 +4032,8 @@ static void ProcessSwitchblocks(pugi::xml_node Parent, t_arch* arch, const pugiu
4040
4032
}
4041
4033
4042
4034
/* 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" ) {
4045
4037
archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem), " Specifying SB locations for auto layout devices are not supported yet!\n " );
4046
4038
}
4047
4039
expect_only_attributes (SubElem,
@@ -4052,25 +4044,24 @@ static void ProcessSwitchblocks(pugi::xml_node Parent, t_arch* arch, const pugiu
4052
4044
4053
4045
int grid_width = arch->grid_layouts .at (layout_index).width ;
4054
4046
int grid_height = arch->grid_layouts .at (layout_index).height ;
4055
-
4047
+
4056
4048
/* Absolute location that this SB must be applied to, -1 if not specified*/
4057
4049
sb.x = get_attribute (SubElem, " x" , loc_data, ReqOpt::OPTIONAL).as_int (-1 );
4058
4050
sb.y = get_attribute (SubElem, " y" , loc_data, ReqOpt::OPTIONAL).as_int (-1 );
4059
4051
4060
4052
// 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);
4064
4056
}
4065
-
4057
+
4066
4058
/* if the the switchblock exact location is not specified and a region is specified within the architecture file,
4067
4059
* we have to parse the region specification and apply the SB pattern to all the locations fall into the specified
4068
4060
* region based on device width and height.
4069
4061
*/
4070
4062
if (sb.x == -1 && sb.y == -1 ) {
4071
4063
calculate_custom_SB_locations (loc_data, SubElem, grid_width, grid_height, sb);
4072
4064
}
4073
-
4074
4065
}
4075
4066
4076
4067
/* get switchblock permutation functions */
0 commit comments