@@ -125,6 +125,11 @@ static void ProcessTilesTags(pugi::xml_node Node,
125
125
t_arch& arch,
126
126
const t_default_fc_spec &arch_def_fc,
127
127
const pugiutil::loc_data& loc_data);
128
+ static void ProcessTileExtraModes (pugi::xml_node Node,
129
+ t_type_descriptor *Type,
130
+ t_type_descriptor **Types,
131
+ int NumTypes,
132
+ const pugiutil::loc_data& loc_data);
128
133
static void ProcessComplexBlocks (pugi::xml_node Node,
129
134
t_type_descriptor ** Types,
130
135
int NumTypes,
@@ -2692,7 +2697,7 @@ static void ProcessTiles(pugi::xml_node Node,
2692
2697
t_type_descriptor ** Types,
2693
2698
int *NumTypes,
2694
2699
const pugiutil::loc_data& loc_data) {
2695
- pugi::xml_node CurType, Prev ;
2700
+ pugi::xml_node CurType;
2696
2701
pugi::xml_node Cur;
2697
2702
t_type_descriptor * Type;
2698
2703
int i;
@@ -2789,22 +2794,54 @@ static void ProcessTilesTags(pugi::xml_node Node,
2789
2794
Cur = get_single_child (CurType, " fc" , loc_data, OPTIONAL);
2790
2795
Process_Fc (Cur, Type, arch.Segments , arch_def_fc, loc_data);
2791
2796
2792
- // Load switchblock type and location overrides
2797
+ /* Load switchblock type and location overrides */
2793
2798
Cur = get_single_child (CurType, " switchblock_locations" , loc_data, OPTIONAL);
2794
2799
ProcessSwitchblockLocations (Cur, Type, arch, loc_data);
2795
2800
2801
+ /* Load possible modes (pb_types which are compatible with the current tile) */
2802
+ Cur = get_single_child (CurType, " equivalent_tiles" , loc_data, OPTIONAL);
2803
+ if (Cur) {
2804
+ ProcessTileExtraModes (Cur, Type, Types, NumTypes, loc_data);
2805
+ }
2806
+
2796
2807
/* Free this node and get its next sibling node */
2797
2808
CurType = CurType.next_sibling (CurType.name ());
2798
2809
}
2799
2810
}
2800
2811
2812
+ /* TODO Add documentation */
2813
+ static void ProcessTileExtraModes (pugi::xml_node Node,
2814
+ t_type_descriptor *Type,
2815
+ t_type_descriptor **Types,
2816
+ int NumTypes,
2817
+ const pugiutil::loc_data& loc_data) {
2818
+ pugi::xml_node CurType;
2819
+
2820
+ Type->num_equivalent_tiles = count_children (Node, " mode" , loc_data);
2821
+ Type->equivalent_tiles = (t_type_descriptor **) vtr::malloc (Type->num_equivalent_tiles * sizeof (t_type_descriptor *));
2822
+ int index = 0 ;
2823
+ CurType = Node.first_child ();
2824
+ while (CurType && index < Type->num_equivalent_tiles ) {
2825
+ const char *equivalent_tile_name = get_attribute (CurType, " name" , loc_data).value ();
2826
+
2827
+ Type->equivalent_tiles [index ] = get_correspondent_tile (Types, NumTypes, equivalent_tile_name);
2828
+ if (Type->equivalent_tiles [index ] == nullptr ) {
2829
+ archfpga_throw (loc_data.filename_c_str (), loc_data.line (CurType),
2830
+ " No tiles found correspondent to equivalent tile name: '%s'.\n " , Type->pb_type ->name );
2831
+ }
2832
+
2833
+ index ++;
2834
+ CurType = CurType.next_sibling (CurType.name ());
2835
+ }
2836
+ }
2837
+
2801
2838
static void ProcessComplexBlocks (pugi::xml_node Node,
2802
2839
t_type_descriptor ** Types,
2803
2840
int NumTypes,
2804
2841
t_arch& arch,
2805
2842
const bool timing_enabled,
2806
2843
const pugiutil::loc_data& loc_data) {
2807
- pugi::xml_node CurPbType, Prev ;
2844
+ pugi::xml_node CurPbType;
2808
2845
t_type_descriptor * Type;
2809
2846
2810
2847
map<string, int > pb_types;
0 commit comments