Skip to content

Commit ecf64f3

Browse files
committed
equivalent tiles: added equivalent tile placement capability
This commit introduces two major features: - introduce the tile concept in the architecture XML. Top level pb_type is discarded and all the top level pb_type information are moved into the tile tags. This will cause CI build to fail as all the architectures do not include the tiles tag right now. - introduce the possibility to place blocks in equivalent tiles (SLICEL blocks into SLICEM ones). According to the XML architecture description there could be tiles equivalent to others that can be used during the placement step (this can bring to better placement solutions) Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 35d1036 commit ecf64f3

File tree

12 files changed

+2389
-192
lines changed

12 files changed

+2389
-192
lines changed

libs/libarchfpga/src/physical_types.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ std::vector<int> t_type_descriptor::get_clock_pins_indices() const {
140140
return indices;
141141
}
142142

143+
bool t_type_descriptor::is_available_tile_index(int index_to_check) const {
144+
auto search = this->available_tiles_indices.find(index_to_check);
145+
if (search != available_tiles_indices.end()) {
146+
return true;
147+
}
148+
149+
return false;
150+
}
151+
143152
/**
144153
* t_pb_graph_node
145154
*/

libs/libarchfpga/src/physical_types.h

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
#include <unordered_map>
3232
#include <string>
3333
#include <map>
34-
#include <unordered_map>
3534
#include <limits>
3635
#include <numeric>
36+
#include <unordered_set>
3737

3838
#include "vtr_ndmatrix.h"
3939
#include "vtr_hash.h"
@@ -556,6 +556,20 @@ constexpr int DEFAULT_SWITCH = -2;
556556
* pb_type: Internal subblocks and routing information for this physical block
557557
* pb_graph_head: Head of DAG of pb_types_nodes and their edges
558558
*
559+
*
560+
* num_equivalent_tiles: Specifies the number of equivalent physical types that can be used during placement.
561+
* If the value is `0` all the data structures relative to the equivalent tiles will be empty.
562+
* equivalent_tiles: Array containing pointers to the equivalent tiles. The number of elements contained is specified
563+
* by num_equivalent_tiles.
564+
* equivalent_tile_pin_mapping: Multi-dimensional array that, for each different equivalent tile contains a mapping between
565+
* the pins of the two tiles.
566+
* Example: equivalent_tile_pin_mapping[eq_tile_index][pin_index] = equivalent_pin_index
567+
* This is necessary to maintain consistency between two equivalent tiles that have the same pins
568+
* defined with different indeces.
569+
* equivalent_tile_inverse_pin_mapping: Multi-dimensional array that works as the previous one, but the mapping is inverse in this case.
570+
* Example: equivalent_tile_pin_mapping[eq_tile_index][equivalent_pin_index] = pin_index
571+
* available_tiles_indices: unordered map used to have a fast lookup on the available tiles.
572+
*
559573
* area: Describes how much area this logic block takes, if undefined, use default
560574
* type_timing_inf: timing information unique to this type
561575
* num_drivers: Total number of output drivers supplied
@@ -595,6 +609,13 @@ struct t_type_descriptor /* TODO rename this. maybe physical type descriptor or
595609
t_pb_type* pb_type = nullptr;
596610
t_pb_graph_node* pb_graph_head = nullptr;
597611

612+
/* Equivalent tiles information */
613+
int num_equivalent_tiles = 0;
614+
std::unordered_map<int, t_type_descriptor*> equivalent_tiles; /* [0..num_equivalent_tiles-1] */
615+
std::unordered_map<int, std::unordered_map<int, int>> equivalent_tile_pin_mapping; /* [0..num_equivalent_tiles-1][0..num_pins-1] */
616+
std::unordered_map<int, std::unordered_map<int, int>> equivalent_tile_inverse_pin_mapping; /* [0..num_equivalent_tiles-1][0..num_pins-1] */
617+
std::unordered_set<int> available_tiles_indices;
618+
598619
float area = 0;
599620

600621
/* This info can be determined from class_inf and pin_class but stored for faster access */
@@ -603,8 +624,15 @@ struct t_type_descriptor /* TODO rename this. maybe physical type descriptor or
603624

604625
int index = -1; /* index of type descriptor in array (allows for index referencing) */
605626

627+
/***********
628+
* Methods *
629+
***********/
630+
606631
/* Returns the indices of pins that contain a clock for this physical logic block */
607632
std::vector<int> get_clock_pins_indices() const;
633+
634+
/* Returns a boolean set to True if the input index belongs to an available tile, False otherwise */
635+
bool is_available_tile_index(int index_to_check) const;
608636
};
609637
typedef const t_type_descriptor* t_type_ptr;
610638

@@ -1200,6 +1228,7 @@ struct t_segment_inf {
12001228
std::vector<bool> cb;
12011229
std::vector<bool> sb;
12021230
//float Cmetal_per_m; /* Wire capacitance (per meter) */
1231+
t_metadata_dict* meta = nullptr;
12031232
};
12041233

12051234
enum class SwitchType {

0 commit comments

Comments
 (0)