diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a055bdd34..ee2a65c312 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,7 +160,7 @@ else() "-Wcast-align" #Warn if a cast causes memory alignment changes "-Wshadow" #Warn if local variable shadows another variable "-Wformat=2" #Sanity checks for printf-like formatting - "-Wno-format-nonliteral" # But don't worry about non-literal formtting (i.e. run-time printf format strings) + "-Wno-format-nonliteral" # But don't worry about non-literal formatting (i.e. run-time printf format strings) "-Wlogical-op" #Checks for logical op when bit-wise expected "-Wmissing-declarations" #Warn if a global function is defined with no declaration "-Wmissing-include-dirs" #Warn if a user include directory is missing @@ -178,10 +178,10 @@ else() "-Wduplicated-cond" #Warn about identical conditions in if-else chains "-Wduplicated-branches" #Warn when different branches of an if-else chain are equivalent "-Wnull-dereference" #Warn about null pointer dereference execution paths - "-Wuninitialized" #Warn about unitialized values + "-Wuninitialized" #Warn about uninitialized values "-Winit-self" #Warn about self-initialization "-Wcatch-value=3" #Warn when catch statements don't catch by reference - "-Wextra-semi" #Warn about redudnant semicolons + "-Wextra-semi" #Warn about redundant semicolons "-Wimplicit-fallthrough=3" #Warn about case fallthroughs, but allow 'fallthrough' comments to suppress warnings #GCC-like optional #"-Wsuggest-final-types" #Suggest where 'final' would help if specified on a type methods diff --git a/vpr/src/place/grid_tile_lookup.cpp b/vpr/src/place/grid_tile_lookup.cpp index d2236fdbc8..ac5ef627ab 100644 --- a/vpr/src/place/grid_tile_lookup.cpp +++ b/vpr/src/place/grid_tile_lookup.cpp @@ -4,8 +4,12 @@ GridTileLookup::GridTileLookup() { const auto& device_ctx = g_vpr_ctx.device(); const int num_layers = device_ctx.grid.get_num_layers(); - //Will store the max number of tile locations for each logical block type - max_placement_locations.resize(device_ctx.logical_block_types.size()); + if (device_ctx.logical_block_types.empty()) { + throw std::runtime_error("Logical block types are empty."); + } else { + // Will store the max number of tile locations for each logical block type + max_placement_locations.resize(device_ctx.logical_block_types.size()); + } for (const auto& type : device_ctx.logical_block_types) { vtr::NdMatrix type_count({static_cast(num_layers), device_ctx.grid.width(), device_ctx.grid.height()}); diff --git a/vpr/src/route/route_common.cpp b/vpr/src/route/route_common.cpp index 7fd9720e45..5ec0184be4 100644 --- a/vpr/src/route/route_common.cpp +++ b/vpr/src/route/route_common.cpp @@ -601,12 +601,11 @@ static vtr::vector> load_rr_clb_sources(con static vtr::vector load_is_clock_net(const Netlist<>& net_list, bool is_flat) { - vtr::vector is_clock_net; + vtr::vector is_clock_net(net_list.nets().size()); auto& atom_ctx = g_vpr_ctx.atom(); std::set clock_nets = find_netlist_physical_clock_nets(atom_ctx.nlist); - is_clock_net.resize(net_list.nets().size()); for (auto net_id : net_list.nets()) { std::size_t net_id_num = std::size_t(net_id); if (is_flat) { diff --git a/vpr/src/route/router_lookahead_map_utils.cpp b/vpr/src/route/router_lookahead_map_utils.cpp index 0be95dd111..5a55ed8c97 100644 --- a/vpr/src/route/router_lookahead_map_utils.cpp +++ b/vpr/src/route/router_lookahead_map_utils.cpp @@ -1219,9 +1219,7 @@ static void run_intra_tile_dijkstra(const RRGraphView& rr_graph, node_expanded.resize(rr_graph.num_nodes()); std::fill(node_expanded.begin(), node_expanded.end(), false); - vtr::vector node_seen_cost; - node_seen_cost.resize(rr_graph.num_nodes()); - std::fill(node_seen_cost.begin(), node_seen_cost.end(), -1.); + vtr::vector node_seen_cost(rr_graph.num_nodes(), -1.f); struct t_pq_entry { float delay;