Skip to content

Commit bfaa5eb

Browse files
get rid of warnings during compiatlion
1 parent b51b50f commit bfaa5eb

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

vpr/src/route/router_lookahead/router_lookahead_map_utils.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ t_chan_ipins_delays compute_router_chan_ipin_lookahead(int route_verbosity) {
482482

483483
// We assume that the routing connectivity of each instance of a physical tile is the same,
484484
// and so only measure one instance of each type
485-
for (int layer_num = 0; layer_num < device_ctx.grid.get_num_layers(); layer_num++) {
485+
for (int layer_num = 0; layer_num < (int)device_ctx.grid.get_num_layers(); layer_num++) {
486486
for (const t_physical_tile_type& tile_type : device_ctx.physical_tile_types) {
487487
if (device_ctx.grid.num_instances(&tile_type, layer_num) == 0) {
488488
continue;
@@ -756,7 +756,7 @@ t_routing_cost_map get_routing_cost_map(int longest_seg_length,
756756
continue;
757757
}
758758
// TODO: Temporary - After testing benchmarks this can be deleted
759-
VTR_ASSERT(rr_graph.node_layer(start_node) == from_layer_num);
759+
VTR_ASSERT(rr_graph.node_layer(start_node) == (int)from_layer_num);
760760

761761
sample_nodes.emplace_back(start_node);
762762
}
@@ -767,13 +767,13 @@ t_routing_cost_map get_routing_cost_map(int longest_seg_length,
767767
//This is to ensure we sample 'unusual' wire types which may not exist in all channels
768768
//(e.g. clock routing)
769769
if (sample_nodes.empty()) {
770-
//Try an exhaustive search to find a suitable sample point
770+
// Try an exhaustive search to find a suitable sample point
771771
for (RRNodeId rr_node : rr_graph.nodes()) {
772-
auto rr_type = rr_graph.node_type(rr_node);
772+
e_rr_type rr_type = rr_graph.node_type(rr_node);
773773
if (rr_type != chan_type) continue;
774-
if (rr_graph.node_layer(rr_node) != from_layer_num) continue;
774+
if (rr_graph.node_layer(rr_node) != (int)from_layer_num) continue;
775775

776-
auto cost_index = rr_graph.node_cost_index(rr_node);
776+
RRIndexedDataId cost_index = rr_graph.node_cost_index(rr_node);
777777
VTR_ASSERT(cost_index != RRIndexedDataId(UNDEFINED));
778778

779779
int seg_index = device_ctx.rr_indexed_data[cost_index].seg_index;

vpr/src/route/rr_graph_generation/build_switchblocks.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ t_sb_connection_map* alloc_and_load_switchblock_permutations(const t_chan_detail
453453
}
454454

455455
// Iterate over the x,y, layer coordinates spanning the FPGA, filling in all the switch blocks that exist
456-
for (int layer_coord = 0; layer_coord < grid.get_num_layers(); layer_coord++) {
456+
for (size_t layer_coord = 0; layer_coord < grid.get_num_layers(); layer_coord++) {
457457
for (size_t x_coord = 0; x_coord < grid.width(); x_coord++) {
458458
for (size_t y_coord = 0; y_coord <= grid.height(); y_coord++) {
459459
if (sb_not_here(grid, inter_cluster_rr, x_coord, y_coord, layer_coord, sb)) {
@@ -571,7 +571,7 @@ static bool is_core_sb(const DeviceGrid& grid, const std::vector<bool>& inter_cl
571571
static bool is_prog_routing_avail(const DeviceGrid& grid, const std::vector<bool>& inter_cluster_rr, int layer) {
572572
bool is_prog_avail = true;
573573
//make sure layer number is legal
574-
VTR_ASSERT(layer >= 0 && layer < grid.get_num_layers());
574+
VTR_ASSERT(layer >= 0 && layer < (int)grid.get_num_layers());
575575
//check if the current layer has programmable routing resources before trying to build a custom switch blocks
576576
if (!inter_cluster_rr.at(layer)) {
577577
is_prog_avail = false;
@@ -1106,7 +1106,7 @@ static bool coords_out_of_bounds(const DeviceGrid& grid, int x_coord, int y_coor
11061106
bool result = true;
11071107

11081108
/* the layer that channel is located at must be legal regardless of chan_type*/
1109-
if (layer_coord < 0 || layer_coord > grid.get_num_layers()) {
1109+
if (layer_coord < 0 || layer_coord > (int)grid.get_num_layers()) {
11101110
return result;
11111111
}
11121112

vpr/src/route/rr_graph_generation/rr_graph.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,7 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
20292029
num_edges = 0;
20302030
// Build opins
20312031
int rr_edges_before_directs = 0;
2032-
for (int layer = 0; layer < grid.get_num_layers(); layer++) {
2032+
for (size_t layer = 0; layer < grid.get_num_layers(); layer++) {
20332033
for (size_t i = 0; i < grid.width(); ++i) {
20342034
for (size_t j = 0; j < grid.height(); ++j) {
20352035
for (e_side side : TOTAL_2D_SIDES) {
@@ -3345,7 +3345,7 @@ static vtr::NdMatrix<int, 6> alloc_and_load_pin_to_seg_type(const e_pin_type pin
33453345

33463346
// Total the number of physical pins
33473347
std::vector<int> num_phys_pins_per_layer;
3348-
for (int layer = 0; layer < grid.get_num_layers(); layer++) {
3348+
for (int layer = 0; layer < (int)grid.get_num_layers(); layer++) {
33493349
int num_phys_pins = 0;
33503350
for (int width = 0; width < tile_type->width; ++width) {
33513351
for (int height = 0; height < tile_type->height; ++height) {
@@ -3364,7 +3364,7 @@ static vtr::NdMatrix<int, 6> alloc_and_load_pin_to_seg_type(const e_pin_type pin
33643364
// (potentially in other C blocks) connect to the remaining tracks first. Doesn't matter for large Fc,
33653365
// but should make a fairly good low Fc block that leverages the fact that usually lots of pins are logically equivalent.
33663366

3367-
for (int layer_index = 0; layer_index < grid.get_num_layers(); layer_index++) {
3367+
for (int layer_index = 0; layer_index < (int)grid.get_num_layers(); layer_index++) {
33683368
const e_side init_side = LEFT;
33693369
const int init_width = 0;
33703370
const int init_height = 0;

vpr/src/route/rr_graph_generation/rr_graph2.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static int get_track_to_chan_seg(RRGraphBuilder& rr_graph_builder,
140140
*
141141
* @return true if the connection going to another layer, false otherwise.
142142
*/
143-
static bool is_sb_conn_layer_crossing(enum e_side src_side, enum e_side dest_side);
143+
static bool is_sb_conn_layer_crossing(e_side src_side, e_side dest_side);
144144

145145
/**
146146
* @brief finds corresponding RR nodes for a 3D SB edge and fill 3D custom switch block information (offset to correct extra CHANX nodes, source tracks, ..)
@@ -1015,12 +1015,12 @@ void dump_track_to_pin_map(t_track_to_pin_lookup& track_to_pin_map,
10151015
auto& device_ctx = g_vpr_ctx.device();
10161016
for (unsigned int i = 0; i < types.size(); i++) {
10171017
if (!track_to_pin_map[i].empty()) {
1018-
for (int layer = 0; layer < device_ctx.grid.get_num_layers(); layer++) {
1018+
for (size_t layer = 0; layer < device_ctx.grid.get_num_layers(); layer++) {
10191019
for (int track = 0; track < max_chan_width; ++track) {
10201020
for (int width = 0; width < types[i].width; ++width) {
10211021
for (int height = 0; height < types[i].height; ++height) {
10221022
for (int side = 0; side < 4; ++side) {
1023-
fprintf(fp, "\nTYPE:%s width:%d height:%d layer:%d\n", types[i].name.c_str(), width, height, layer);
1023+
fprintf(fp, "\nTYPE:%s width:%d height:%d layer:%lu\n", types[i].name.c_str(), width, height, layer);
10241024
fprintf(fp, "\nSIDE:%d TRACK:%d \n", side, track);
10251025
for (size_t con = 0; con < track_to_pin_map[i][track][width][height][layer][side].size(); con++) {
10261026
fprintf(fp, "%d ", track_to_pin_map[i][track][width][height][layer][side][con]);
@@ -1036,7 +1036,7 @@ void dump_track_to_pin_map(t_track_to_pin_lookup& track_to_pin_map,
10361036
}
10371037
}
10381038

1039-
static bool is_sb_conn_layer_crossing(enum e_side src_side, enum e_side dest_side) {
1039+
static bool is_sb_conn_layer_crossing(e_side src_side, e_side dest_side) {
10401040
if (src_side < NUM_2D_SIDES && dest_side < NUM_2D_SIDES) {
10411041
return false;
10421042
}
@@ -1075,7 +1075,7 @@ vtr::NdMatrix<int, 2> get_number_track_to_track_inter_die_conn(t_sb_connection_m
10751075

10761076
for (size_t y = 0; y < grid_ctx.height(); y++) {
10771077
for (size_t x = 0; x < grid_ctx.width(); x++) {
1078-
for (int layer = 0; layer < grid_ctx.get_num_layers(); layer++) {
1078+
for (int layer = 0; layer < (int)grid_ctx.get_num_layers(); layer++) {
10791079

10801080
int num_of_3d_conn = 0;
10811081
for (e_side from_side : TOTAL_3D_SIDES) {
@@ -1158,9 +1158,9 @@ int get_track_to_pins(RRGraphBuilder& rr_graph_builder,
11581158
side = (0 == pass ? RIGHT : LEFT);
11591159
}
11601160

1161-
for (int layer_index = 0; layer_index < device_ctx.grid.get_num_layers(); layer_index++) {
1161+
for (int layer_index = 0; layer_index < (int)device_ctx.grid.get_num_layers(); layer_index++) {
11621162
/* PAJ - if the pointed to is an EMPTY then shouldn't look for ipins */
1163-
auto type = device_ctx.grid.get_physical_type({x, y, layer_index});
1163+
t_physical_tile_type_ptr type = device_ctx.grid.get_physical_type({x, y, layer_index});
11641164
if (type == device_ctx.EMPTY_PHYSICAL_TILE_TYPE)
11651165
continue;
11661166

@@ -1570,8 +1570,8 @@ static void get_switchblocks_edges(RRGraphBuilder& rr_graph_builder,
15701570
VTR_ASSERT(to_layer != layer);
15711571
// Check if current connection is valid, since switch block pattern is very general,
15721572
// we might see invalid layer in connection, so we just skip those
1573-
if ((layer < 0 || layer >= device_ctx.grid.get_num_layers())
1574-
|| (to_layer < 0 || to_layer >= device_ctx.grid.get_num_layers())) {
1573+
if ((layer < 0 || layer >= (int)device_ctx.grid.get_num_layers())
1574+
|| (to_layer < 0 || to_layer >= (int)device_ctx.grid.get_num_layers())) {
15751575
continue;
15761576
}
15771577

vpr/src/route/rr_graph_generation/rr_node_indices.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static void load_chan_rr_indices(const int max_chan_width,
172172
int* index) {
173173
const auto& device_ctx = g_vpr_ctx.device();
174174

175-
for (int layer = 0; layer < grid.get_num_layers(); layer++) {
175+
for (size_t layer = 0; layer < grid.get_num_layers(); layer++) {
176176
// Skip the current die if architecture file specifies that it doesn't require global resource routing
177177
if (!device_ctx.inter_cluster_prog_routing_resources.at(layer)) {
178178
continue;
@@ -335,7 +335,7 @@ void alloc_and_load_inter_die_rr_node_indices(RRGraphBuilder& rr_graph_builder,
335335
// 4) direction = NONE
336336
const auto& device_ctx = g_vpr_ctx.device();
337337

338-
for (int layer = 0; layer < grid.get_num_layers(); layer++) {
338+
for (size_t layer = 0; layer < grid.get_num_layers(); layer++) {
339339
// Skip the current die if architecture file specifies that it doesn't have global resource routing
340340
if (!device_ctx.inter_cluster_prog_routing_resources.at(layer)) {
341341
continue;

vpr/src/route/serial_connection_router.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void SerialConnectionRouter<Heap>::timing_driven_expand_neighbour(const RTExplor
241241
const t_bb& bounding_box,
242242
RRNodeId target_node,
243243
const t_bb& target_bb) {
244-
VTR_ASSERT(bounding_box.layer_max < g_vpr_ctx.device().grid.get_num_layers());
244+
VTR_ASSERT(bounding_box.layer_max < (int)g_vpr_ctx.device().grid.get_num_layers());
245245

246246
const RRNodeId& from_node = current.index;
247247

0 commit comments

Comments
 (0)