@@ -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
@@ -1749,10 +1748,9 @@ static void ProcessInterconnect(vtr::string_internment& strings,
1749
1748
}
1750
1749
1751
1750
mode->interconnect [interconnect_idx].annotations = (t_pin_to_pin_annotation*)vtr::calloc (num_annotations,
1752
- sizeof (t_pin_to_pin_annotation));
1751
+ sizeof (t_pin_to_pin_annotation));
1753
1752
mode->interconnect [interconnect_idx].num_annotations = num_annotations;
1754
1753
1755
-
1756
1754
int annotation_idx = 0 ;
1757
1755
for (auto annot_child_name : {" delay_constant" , " delay_matrix" , " C_constant" , " C_matrix" , " pack_pattern" }) {
1758
1756
pugi::xml_node Cur2 = get_first_child (Cur, annot_child_name, loc_data, ReqOpt::OPTIONAL);
@@ -1770,7 +1768,7 @@ static void ProcessInterconnect(vtr::string_internment& strings,
1770
1768
1771
1769
/* Power */
1772
1770
mode->interconnect [interconnect_idx].interconnect_power = (t_interconnect_power*)vtr::calloc (1 ,
1773
- sizeof (t_interconnect_power));
1771
+ sizeof (t_interconnect_power));
1774
1772
mode->interconnect [interconnect_idx].interconnect_power ->port_info_initialized = false ;
1775
1773
1776
1774
/* get next iteration */
@@ -3805,63 +3803,61 @@ static std::vector<t_segment_inf> ProcessSegments(pugi::xml_node Parent,
3805
3803
tmp = get_attribute (SubElem, " name" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
3806
3804
3807
3805
// check if <mux> tag is defined in the architecture, otherwise we should look for <mux_inc> and <mux_dec>
3808
- if (tmp){
3806
+ if (tmp) {
3809
3807
/* Match names */
3810
3808
int switch_idx = find_switch_by_name (switches, tmp);
3811
3809
if (switch_idx < 0 ) {
3812
3810
archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
3813
- " '%s' is not a valid mux name.\n " , tmp);
3811
+ " '%s' is not a valid mux name.\n " , tmp);
3814
3812
}
3815
3813
3816
3814
/* Unidir muxes must have the same switch
3817
- * for wire and opin fanin since there is
3818
- * really only the mux in unidir. */
3815
+ * for wire and opin fanin since there is
3816
+ * really only the mux in unidir. */
3819
3817
Segs[i].arch_wire_switch = switch_idx;
3820
3818
Segs[i].arch_opin_switch = switch_idx;
3821
- }
3822
- else { // if a general mux is not defined, we should look for specific mux for each direction in the architecture file
3819
+ } else { // if a general mux is not defined, we should look for specific mux for each direction in the architecture file
3823
3820
SubElem = get_single_child (Node, " mux_inc" , loc_data, ReqOpt::OPTIONAL);
3824
3821
tmp = get_attribute (SubElem, " name" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
3825
- if (!tmp){
3822
+ if (!tmp) {
3826
3823
archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
3827
- " if mux is not specified in a wire segment, both mux_inc and mux_dec should be specified" );
3828
- } else {
3824
+ " if mux is not specified in a wire segment, both mux_inc and mux_dec should be specified" );
3825
+ } else {
3829
3826
/* Match names */
3830
3827
int switch_idx = find_switch_by_name (switches, tmp);
3831
3828
if (switch_idx < 0 ) {
3832
3829
archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
3833
- " '%s' is not a valid mux name.\n " , tmp);
3830
+ " '%s' is not a valid mux name.\n " , tmp);
3834
3831
}
3835
3832
3836
3833
/* Unidir muxes must have the same switch
3837
- * for wire and opin fanin since there is
3838
- * really only the mux in unidir. */
3834
+ * for wire and opin fanin since there is
3835
+ * really only the mux in unidir. */
3839
3836
Segs[i].arch_wire_switch = switch_idx;
3840
3837
Segs[i].arch_opin_switch = switch_idx;
3841
3838
}
3842
3839
3843
3840
SubElem = get_single_child (Node, " mux_dec" , loc_data, ReqOpt::OPTIONAL);
3844
3841
tmp = get_attribute (SubElem, " name" , loc_data, ReqOpt::OPTIONAL).as_string (nullptr );
3845
- if (!tmp){
3842
+ if (!tmp) {
3846
3843
archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
3847
- " if mux is not specified in a wire segment, both mux_inc and mux_dec should be specified" );
3848
- } else {
3844
+ " if mux is not specified in a wire segment, both mux_inc and mux_dec should be specified" );
3845
+ } else {
3849
3846
/* Match names */
3850
3847
int switch_idx = find_switch_by_name (switches, tmp);
3851
3848
if (switch_idx < 0 ) {
3852
3849
archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
3853
- " '%s' is not a valid mux name.\n " , tmp);
3850
+ " '%s' is not a valid mux name.\n " , tmp);
3854
3851
}
3855
3852
3856
3853
/* Unidir muxes must have the same switch
3857
- * for wire and opin fanin since there is
3858
- * really only the mux in unidir. */
3854
+ * for wire and opin fanin since there is
3855
+ * really only the mux in unidir. */
3859
3856
Segs[i].arch_wire_switch_dec = switch_idx;
3860
3857
Segs[i].arch_opin_switch_dec = switch_idx;
3861
3858
}
3862
3859
}
3863
- }
3864
- else {
3860
+ } else {
3865
3861
VTR_ASSERT (BI_DIRECTIONAL == Segs[i].directionality );
3866
3862
SubElem = get_single_child (Node, " wire_switch" , loc_data);
3867
3863
tmp = get_attribute (SubElem, " name" , loc_data).value ();
@@ -3920,13 +3916,12 @@ static std::vector<t_segment_inf> ProcessSegments(pugi::xml_node Parent,
3920
3916
return Segs;
3921
3917
}
3922
3918
3923
-
3924
- 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){
3919
+ 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) {
3925
3920
auto startx_attr = get_attribute (SubElem, " startx" , loc_data, ReqOpt::OPTIONAL);
3926
- auto endx_attr = get_attribute (SubElem, " endx" , loc_data, ReqOpt::OPTIONAL);
3921
+ auto endx_attr = get_attribute (SubElem, " endx" , loc_data, ReqOpt::OPTIONAL);
3927
3922
3928
3923
auto starty_attr = get_attribute (SubElem, " starty" , loc_data, ReqOpt::OPTIONAL);
3929
- auto endy_attr = get_attribute (SubElem, " endy" , loc_data, ReqOpt::OPTIONAL);
3924
+ auto endy_attr = get_attribute (SubElem, " endy" , loc_data, ReqOpt::OPTIONAL);
3930
3925
3931
3926
auto repeatx_attr = get_attribute (SubElem, " repeatx" , loc_data, ReqOpt::OPTIONAL);
3932
3927
auto repeaty_attr = get_attribute (SubElem, " repeaty" , loc_data, ReqOpt::OPTIONAL);
@@ -3941,19 +3936,17 @@ static void calculate_custom_SB_locations(const pugiutil::loc_data& loc_data, co
3941
3936
vars.set_var_value (" W" , grid_width);
3942
3937
vars.set_var_value (" H" , grid_height);
3943
3938
3944
-
3945
3939
sb.reg_x .start = startx_attr.empty () ? 0 : p.parse_formula (startx_attr.value (), vars);
3946
3940
sb.reg_y .start = starty_attr.empty () ? 0 : p.parse_formula (starty_attr.value (), vars);
3947
3941
3948
3942
sb.reg_x .end = endx_attr.empty () ? (grid_width - 1 ) : p.parse_formula (endx_attr.value (), vars);
3949
- sb.reg_y .end = endy_attr.empty () ? (grid_height -1 ) : p.parse_formula (endy_attr.value (), vars);
3943
+ sb.reg_y .end = endy_attr.empty () ? (grid_height - 1 ) : p.parse_formula (endy_attr.value (), vars);
3950
3944
3951
3945
sb.reg_x .repeat = repeatx_attr.empty () ? 0 : p.parse_formula (repeatx_attr.value (), vars);
3952
3946
sb.reg_y .repeat = repeaty_attr.empty () ? 0 : p.parse_formula (repeaty_attr.value (), vars);
3953
3947
3954
3948
sb.reg_x .incr = incrx_attr.empty () ? 1 : p.parse_formula (incrx_attr.value (), vars);
3955
3949
sb.reg_y .incr = incry_attr.empty () ? 1 : p.parse_formula (incry_attr.value (), vars);
3956
-
3957
3950
}
3958
3951
3959
3952
/* Processes the switchblocklist section from the xml architecture file.
@@ -3967,10 +3960,10 @@ static void ProcessSwitchblocks(pugi::xml_node Parent, t_arch* arch, const pugiu
3967
3960
/* get the number of switchblocks */
3968
3961
int num_switchblocks = count_children (Parent, " switchblock" , loc_data);
3969
3962
arch->switchblocks .reserve (num_switchblocks);
3970
-
3963
+
3971
3964
int layout_index = -1 ;
3972
- for (layout_index = 0 ; layout_index < (int ) arch->grid_layouts .size (); layout_index++){
3973
- if (arch->grid_layouts .at (layout_index).name == arch->device_layout ){
3965
+ for (layout_index = 0 ; layout_index < (int )arch->grid_layouts .size (); layout_index++) {
3966
+ if (arch->grid_layouts .at (layout_index).name == arch->device_layout ) {
3974
3967
// found the used layout
3975
3968
break ;
3976
3969
}
@@ -4022,8 +4015,8 @@ static void ProcessSwitchblocks(pugi::xml_node Parent, t_arch* arch, const pugiu
4022
4015
}
4023
4016
4024
4017
/* get the switchblock coordinate only if sb.location is set to E_XY_SPECIFIED*/
4025
- if (sb.location == e_sb_location::E_XY_SPECIFIED){
4026
- if (arch->device_layout == " auto" ){
4018
+ if (sb.location == e_sb_location::E_XY_SPECIFIED) {
4019
+ if (arch->device_layout == " auto" ) {
4027
4020
archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem), " Specifying SB locations for auto layout devices are not supported yet!\n " );
4028
4021
}
4029
4022
expect_only_attributes (SubElem,
@@ -4034,25 +4027,24 @@ static void ProcessSwitchblocks(pugi::xml_node Parent, t_arch* arch, const pugiu
4034
4027
4035
4028
int grid_width = arch->grid_layouts .at (layout_index).width ;
4036
4029
int grid_height = arch->grid_layouts .at (layout_index).height ;
4037
-
4030
+
4038
4031
/* Absolute location that this SB must be applied to, -1 if not specified*/
4039
4032
sb.x = get_attribute (SubElem, " x" , loc_data, ReqOpt::OPTIONAL).as_int (-1 );
4040
4033
sb.y = get_attribute (SubElem, " y" , loc_data, ReqOpt::OPTIONAL).as_int (-1 );
4041
4034
4042
4035
// check if the absolute value is within the device grid width and height
4043
- if (sb.x >= grid_width || sb.y >= grid_height) {
4044
- archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem), \
4045
- " Location (%d,%d) is not valid within the grid! grid dimensions are: (%d,%d)\n " , sb.x , sb.y , grid_width, grid_height);
4036
+ if (sb.x >= grid_width || sb.y >= grid_height) {
4037
+ archfpga_throw (loc_data.filename_c_str (), loc_data.line (SubElem),
4038
+ " Location (%d,%d) is not valid within the grid! grid dimensions are: (%d,%d)\n " , sb.x , sb.y , grid_width, grid_height);
4046
4039
}
4047
-
4040
+
4048
4041
/* if the the switchblock exact location is not specified and a region is specified within the architecture file,
4049
4042
* we have to parse the region specification and apply the SB pattern to all the locations fall into the specified
4050
4043
* region based on device width and height.
4051
4044
*/
4052
4045
if (sb.x == -1 && sb.y == -1 ) {
4053
4046
calculate_custom_SB_locations (loc_data, SubElem, grid_width, grid_height, sb);
4054
4047
}
4055
-
4056
4048
}
4057
4049
4058
4050
/* get switchblock permutation functions */
0 commit comments