2828#define PHYSICAL_TYPES_H
2929
3030#include < functional>
31+ #include < utility>
3132#include < vector>
3233#include < unordered_map>
3334#include < string>
@@ -129,7 +130,7 @@ struct t_metadata_dict : vtr::flat_map<
129130
130131 // Get metadata values matching key.
131132 //
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
133134 // per key.
134135 inline const t_metadata_value* one (vtr::interned_string key) const {
135136 auto values = get (key);
@@ -146,7 +147,7 @@ struct t_metadata_dict : vtr::flat_map<
146147 void add (vtr::interned_string key, vtr::interned_string value) {
147148 // Get the iterator to the key, which may already have elements if
148149 // add was called with this key in the past.
149- (*this )[key].emplace_back (t_metadata_value ( value) );
150+ (*this )[key].emplace_back (value);
150151 }
151152};
152153
@@ -181,11 +182,11 @@ constexpr std::array<e_side, NUM_SIDES> SIDES = {{TOP, RIGHT, BOTTOM, LEFT}};
181182constexpr std::array<const char *, NUM_SIDES> SIDE_STRING = {{" TOP" , " RIGHT" , " BOTTOM" , " LEFT" }}; // String versions of side orientations
182183
183184/* 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
189190};
190191
191192/* pb_type class */
@@ -263,10 +264,10 @@ enum e_sb_location {
263264 */
264265struct t_grid_loc_spec {
265266 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) ) {}
270271
271272 std::string start_expr; // Starting position (inclusive)
272273 std::string end_expr; // Ending position (inclusive)
@@ -280,7 +281,7 @@ struct t_grid_loc_spec {
280281
281282/* Definition of how to place physical logic block in the grid.
282283 * 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).
284285 *
285286 * The diagram below illustrates the layout specification.
286287 *
@@ -345,7 +346,7 @@ struct t_grid_loc_spec {
345346 */
346347struct t_grid_loc_def {
347348 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) )
349350 , priority(priority_val)
350351 , x(" 0" , " W-1" , " max(w+1,W)" , " w" ) // Fill in x direction, no repeat, incr by block width
351352 , 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 {
358359 // the largest priority wins.
359360
360361 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
362363
363364 // When 1 metadata tag is split among multiple t_grid_loc_def, one
364365 // t_grid_loc_def is arbitrarily chosen to own the metadata, and the other
@@ -648,7 +649,7 @@ struct t_physical_tile_type {
648649
649650 std::vector<t_class> class_inf; /* [0..num_class-1] */
650651
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
652653 // used during flat-routing to route the nets.
653654 // The starting number of primitive classes
654655 int primitive_class_starting_idx = -1 ;
@@ -755,7 +756,7 @@ struct t_capacity_range {
755756struct t_sub_tile {
756757 char * name = nullptr ;
757758
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
759760 // to the physical tile type.
760761 std::vector<int > sub_tile_to_tile_pin_indices;
761762
@@ -1601,7 +1602,7 @@ struct t_hash_segment_inf {
16011602enum class SwitchType {
16021603 MUX = 0 , // A configurable (buffered) mux (single-driver)
16031604 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)
16051606 SHORT, // A non-configurable electrically shorted connection (multi-driver)
16061607 BUFFER, // A non-configurable non-tristate-able buffer (uni-driver)
16071608 INVALID, // Unspecified, usually an error
@@ -1946,13 +1947,25 @@ struct t_noc_inf {
19461947 /* * A list of all routers in the NoC*/
19471948 std::vector<t_router> router_list;
19481949
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+
19491960 /* * Represents the name of a router tile on the FPGA device. This should match the name used in the arch file when
19501961 * describing a NoC router tile within the FPGA device*/
19511962 std::string noc_router_tile_name;
19521963};
19531964
19541965/* Detailed routing architecture */
19551966struct t_arch {
1967+ /* * Stores unique strings used as key and values in <metadata> tags,
1968+ * i.e. implements a flyweight pattern to save memory.*/
19561969 mutable vtr::string_internment strings;
19571970 std::vector<vtr::interned_string> interned_strings;
19581971
@@ -1992,7 +2005,7 @@ struct t_arch {
19922005 // nets from the circuit netlist are belonging to the constant network,
19932006 // and assigned to it accordingly.
19942007 //
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
19962009 // for the interchange netlist format, to determine which are the constants
19972010 // net names and which virtual cell is responsible to generate them.
19982011 // The information is present in the device database.
0 commit comments