28
28
#define PHYSICAL_TYPES_H
29
29
30
30
#include < functional>
31
+ #include < utility>
31
32
#include < vector>
32
33
#include < unordered_map>
33
34
#include < string>
@@ -129,7 +130,7 @@ struct t_metadata_dict : vtr::flat_map<
129
130
130
131
// Get metadata values matching key.
131
132
//
132
- // Returns nullptr if key is not found or if multiple values are prsent
133
+ // Returns nullptr if key is not found or if multiple values are present
133
134
// per key.
134
135
inline const t_metadata_value* one (vtr::interned_string key) const {
135
136
auto values = get (key);
@@ -146,7 +147,7 @@ struct t_metadata_dict : vtr::flat_map<
146
147
void add (vtr::interned_string key, vtr::interned_string value) {
147
148
// Get the iterator to the key, which may already have elements if
148
149
// add was called with this key in the past.
149
- (*this )[key].emplace_back (t_metadata_value ( value) );
150
+ (*this )[key].emplace_back (value);
150
151
}
151
152
};
152
153
@@ -181,11 +182,11 @@ constexpr std::array<e_side, NUM_SIDES> SIDES = {{TOP, RIGHT, BOTTOM, LEFT}};
181
182
constexpr std::array<const char *, NUM_SIDES> SIDE_STRING = {{" TOP" , " RIGHT" , " BOTTOM" , " LEFT" }}; // String versions of side orientations
182
183
183
184
/* pin location distributions */
184
- enum e_pin_location_distr {
185
- E_SPREAD_PIN_DISTR ,
186
- E_PERIMETER_PIN_DISTR ,
187
- E_SPREAD_INPUTS_PERIMETER_OUTPUTS_PIN_DISTR ,
188
- E_CUSTOM_PIN_DISTR
185
+ enum class e_pin_location_distr {
186
+ SPREAD ,
187
+ PERIMETER ,
188
+ SPREAD_INPUTS_PERIMETER_OUTPUTS ,
189
+ CUSTOM
189
190
};
190
191
191
192
/* pb_type class */
@@ -263,10 +264,10 @@ enum e_sb_location {
263
264
*/
264
265
struct t_grid_loc_spec {
265
266
t_grid_loc_spec (std::string start, std::string end, std::string repeat, std::string incr)
266
- : start_expr(start)
267
- , end_expr(end)
268
- , repeat_expr(repeat)
269
- , incr_expr(incr) {}
267
+ : start_expr(std::move( start) )
268
+ , end_expr(std::move( end) )
269
+ , repeat_expr(std::move( repeat) )
270
+ , incr_expr(std::move( incr) ) {}
270
271
271
272
std::string start_expr; // Starting position (inclusive)
272
273
std::string end_expr; // Ending position (inclusive)
@@ -280,7 +281,7 @@ struct t_grid_loc_spec {
280
281
281
282
/* Definition of how to place physical logic block in the grid.
282
283
* This defines a region of the grid to be set to a specific type
283
- * (provided it's priority is high enough to override other blocks).
284
+ * (provided its priority is high enough to override other blocks).
284
285
*
285
286
* The diagram below illustrates the layout specification.
286
287
*
@@ -345,7 +346,7 @@ struct t_grid_loc_spec {
345
346
*/
346
347
struct t_grid_loc_def {
347
348
t_grid_loc_def (std::string block_type_val, int priority_val)
348
- : block_type(block_type_val)
349
+ : block_type(std::move( block_type_val) )
349
350
, priority(priority_val)
350
351
, x(" 0" , " W-1" , " max(w+1,W)" , " w" ) // Fill in x direction, no repeat, incr by block width
351
352
, y(" 0" , " H-1" , " max(h+1,H)" , " h" ) // Fill in y direction, no repeat, incr by block height
@@ -358,7 +359,7 @@ struct t_grid_loc_def {
358
359
// the largest priority wins.
359
360
360
361
t_grid_loc_spec x; // Horizontal location specification
361
- t_grid_loc_spec y; // Veritcal location specification
362
+ t_grid_loc_spec y; // Vertical location specification
362
363
363
364
// When 1 metadata tag is split among multiple t_grid_loc_def, one
364
365
// t_grid_loc_def is arbitrarily chosen to own the metadata, and the other
@@ -648,7 +649,7 @@ struct t_physical_tile_type {
648
649
649
650
std::vector<t_class> class_inf; /* [0..num_class-1] */
650
651
651
- // Primitive class is refered to a classes that are in the primitive blocks. These classes are
652
+ // Primitive class is referred to a classes that are in the primitive blocks. These classes are
652
653
// used during flat-routing to route the nets.
653
654
// The starting number of primitive classes
654
655
int primitive_class_starting_idx = -1 ;
@@ -755,7 +756,7 @@ struct t_capacity_range {
755
756
struct t_sub_tile {
756
757
char * name = nullptr ;
757
758
758
- // Mapping between the sub tile 's pins and the physical pins corresponding
759
+ // Mapping between the subtile 's pins and the physical pins corresponding
759
760
// to the physical tile type.
760
761
std::vector<int > sub_tile_to_tile_pin_indices;
761
762
@@ -1601,7 +1602,7 @@ struct t_hash_segment_inf {
1601
1602
enum class SwitchType {
1602
1603
MUX = 0 , // A configurable (buffered) mux (single-driver)
1603
1604
TRISTATE, // A configurable tristate-able buffer (multi-driver)
1604
- PASS_GATE, // A configurable pass transitor switch (multi-driver)
1605
+ PASS_GATE, // A configurable pass transistor switch (multi-driver)
1605
1606
SHORT, // A non-configurable electrically shorted connection (multi-driver)
1606
1607
BUFFER, // A non-configurable non-tristate-able buffer (uni-driver)
1607
1608
INVALID, // Unspecified, usually an error
@@ -1946,13 +1947,25 @@ struct t_noc_inf {
1946
1947
/* * A list of all routers in the NoC*/
1947
1948
std::vector<t_router> router_list;
1948
1949
1950
+ /* * Stores NoC routers that have a different latency than the NoC-wide router latency.
1951
+ * (router_user_id, overridden router latency)*/
1952
+ std::map<int , double > router_latency_overrides;
1953
+ /* * Stores NoC links that have a different latency than the NoC-wide link latency.
1954
+ * ((source router id, destination router id), overridden link latency)*/
1955
+ std::map<std::pair<int , int >, double > link_latency_overrides;
1956
+ /* * Stores NoC links that have a different bandwidth than the NoC-wide link bandwidth.
1957
+ * ((source router id, destination router id), overridden link bandwidth)*/
1958
+ std::map<std::pair<int , int >, double > link_bandwidth_overrides;
1959
+
1949
1960
/* * Represents the name of a router tile on the FPGA device. This should match the name used in the arch file when
1950
1961
* describing a NoC router tile within the FPGA device*/
1951
1962
std::string noc_router_tile_name;
1952
1963
};
1953
1964
1954
1965
/* Detailed routing architecture */
1955
1966
struct t_arch {
1967
+ /* * Stores unique strings used as key and values in <metadata> tags,
1968
+ * i.e. implements a flyweight pattern to save memory.*/
1956
1969
mutable vtr::string_internment strings;
1957
1970
std::vector<vtr::interned_string> interned_strings;
1958
1971
@@ -1992,7 +2005,7 @@ struct t_arch {
1992
2005
// nets from the circuit netlist are belonging to the constant network,
1993
2006
// and assigned to it accordingly.
1994
2007
//
1995
- // NOTE: At the moment, the constant cells and nets are primarly used
2008
+ // NOTE: At the moment, the constant cells and nets are primarily used
1996
2009
// for the interchange netlist format, to determine which are the constants
1997
2010
// net names and which virtual cell is responsible to generate them.
1998
2011
// The information is present in the device database.
0 commit comments