Skip to content

Commit d0c68cc

Browse files
rename Switchblock_Lookup --> SwitchblockLookupKey
1 parent 2b069a0 commit d0c68cc

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

vpr/src/route/rr_graph_generation/build_switchblocks.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static void compute_wireconn_connections(
226226
e_directionality directionality,
227227
const t_chan_details& from_chan_details,
228228
const t_chan_details& to_chan_details,
229-
Switchblock_Lookup sb_conn,
229+
SwitchblockLookupKey sb_conn,
230230
int from_x,
231231
int from_y,
232232
int from_layer,
@@ -793,7 +793,7 @@ static void compute_wire_connections(int x_coord,
793793
from_x = from_y = to_x = to_y = from_layer = to_layer = UNDEFINED;
794794

795795
SBSideConnection side_conn(from_side, to_side); /* for indexing into this switchblock's permutation funcs */
796-
Switchblock_Lookup sb_conn(x_coord, y_coord, layer_coord, from_side, to_side); /* for indexing into FPGA's switchblock map */
796+
SwitchblockLookupKey sb_conn(x_coord, y_coord, layer_coord, from_side, to_side); /* for indexing into FPGA's switchblock map */
797797

798798
// Can't connect a switchblock side to itself
799799
if (from_side == to_side) {
@@ -853,7 +853,7 @@ static void compute_wireconn_connections(
853853
e_directionality directionality,
854854
const t_chan_details& from_chan_details,
855855
const t_chan_details& to_chan_details,
856-
Switchblock_Lookup sb_conn,
856+
SwitchblockLookupKey sb_conn,
857857
int from_x,
858858
int from_y,
859859
int from_layer,
@@ -1024,7 +1024,7 @@ static void compute_wireconn_connections(
10241024
//
10251025
//Coverity flags this (false positive), so annotate coverity ignores it:
10261026
// coverity[swapped_arguments : Intentional]
1027-
Switchblock_Lookup sb_conn_reverse(sb_conn.x_coord, sb_conn.y_coord, sb_conn.layer_coord, sb_conn.to_side, sb_conn.from_side);
1027+
SwitchblockLookupKey sb_conn_reverse(sb_conn.x_coord, sb_conn.y_coord, sb_conn.layer_coord, sb_conn.to_side, sb_conn.from_side);
10281028
(*sb_conns)[sb_conn_reverse].push_back(sb_reverse_edge);
10291029
}
10301030
}

vpr/src/route/rr_graph_generation/build_switchblocks.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Used to index into a map which specifies which destination wire segments this source wire should
1717
* connect to.
1818
*/
19-
class Switchblock_Lookup {
19+
class SwitchblockLookupKey {
2020
public:
2121
int x_coord; ///< x coordinate of switchblock connection
2222
int y_coord; ///< y coordinate of switchblock connection
@@ -25,17 +25,17 @@ class Switchblock_Lookup {
2525
e_side to_side; ///< destination side of switchblock connection
2626

2727
/// @brief Empty constructor initializes everything to 0
28-
Switchblock_Lookup() {
28+
SwitchblockLookupKey() {
2929
x_coord = y_coord = layer_coord = -1; //TODO: use set function
3030
}
3131

3232
/// @brief Constructor for initializing member variables
33-
Switchblock_Lookup(int set_x, int set_y, int set_layer, e_side set_from, e_side set_to) {
33+
SwitchblockLookupKey(int set_x, int set_y, int set_layer, e_side set_from, e_side set_to) {
3434
this->set_coords(set_x, set_y, set_layer, set_from, set_to);
3535
}
3636

3737
/// @brief Constructor for initializing member variables with default layer number (0), used for single die FPGA
38-
Switchblock_Lookup(int set_x, int set_y, e_side set_from, e_side set_to) {
38+
SwitchblockLookupKey(int set_x, int set_y, e_side set_from, e_side set_to) {
3939
this->set_coords(set_x, set_y, 0, set_from, set_to);
4040
}
4141

@@ -49,7 +49,7 @@ class Switchblock_Lookup {
4949
}
5050

5151
/// @brief Overload == operator which is used by std::unordered_map
52-
bool operator==(const Switchblock_Lookup& obj) const {
52+
bool operator==(const SwitchblockLookupKey& obj) const {
5353
bool result;
5454
if (x_coord == obj.x_coord && y_coord == obj.y_coord
5555
&& from_side == obj.from_side && to_side == obj.to_side
@@ -63,7 +63,7 @@ class Switchblock_Lookup {
6363
};
6464

6565
struct t_hash_Switchblock_Lookup {
66-
size_t operator()(const Switchblock_Lookup& obj) const noexcept {
66+
size_t operator()(const SwitchblockLookupKey& obj) const noexcept {
6767
std::size_t hash = std::hash<int>{}(obj.x_coord);
6868
vtr::hash_combine(hash, obj.y_coord);
6969
vtr::hash_combine(hash, obj.layer_coord);
@@ -106,7 +106,7 @@ struct t_switchblock_edge {
106106
* A matrix specifying connections for all switchblocks in an FPGA would be sparse and possibly very large,
107107
* so we use an unordered map to take advantage of the sparsity.
108108
*/
109-
typedef std::unordered_map<Switchblock_Lookup, std::vector<t_switchblock_edge>, t_hash_Switchblock_Lookup> t_sb_connection_map;
109+
typedef std::unordered_map<SwitchblockLookupKey, std::vector<t_switchblock_edge>, t_hash_Switchblock_Lookup> t_sb_connection_map;
110110

111111
/************ Functions ************/
112112

vpr/src/route/rr_graph_generation/rr_graph2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ vtr::NdMatrix<int, 2> get_number_track_to_track_inter_die_conn(t_sb_connection_m
10851085
if (!is_sb_conn_layer_crossing(from_side, to_side)) { //this connection is not crossing any layer
10861086
continue;
10871087
} else {
1088-
Switchblock_Lookup sb_coord(x, y, layer, from_side, to_side);
1088+
SwitchblockLookupKey sb_coord(x, y, layer, from_side, to_side);
10891089
if (sb_conn_map->count(sb_coord) > 0) {
10901090
std::vector<t_switchblock_edge>& conn_vector = (*sb_conn_map)[sb_coord];
10911091
for (int iconn = 0; iconn < (int)conn_vector.size(); ++iconn) {
@@ -1533,7 +1533,7 @@ static void get_switchblocks_edges(RRGraphBuilder& rr_graph_builder,
15331533
auto& device_ctx = g_vpr_ctx.device();
15341534

15351535
/* get coordinate to index into the SB map */
1536-
Switchblock_Lookup sb_coord(tile_x, tile_y, layer, from_side, to_side);
1536+
SwitchblockLookupKey sb_coord(tile_x, tile_y, layer, from_side, to_side);
15371537
if (sb_conn_map->count(sb_coord) > 0) {
15381538
/* get reference to the connections vector which lists all destination wires for a given source wire
15391539
* at a specific coordinate sb_coord */

0 commit comments

Comments
 (0)