Skip to content

Commit bcc45db

Browse files
authored
Merge pull request #2485 from verilog-to-routing/noc_cost_norm
Noc cost normalization
2 parents b5b6e59 + 581c3a4 commit bcc45db

33 files changed

+1490
-596
lines changed

libs/libarchfpga/src/physical_types_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ std::vector<std::string> block_type_class_index_to_pin_names(t_physical_tile_typ
171171
bool is_flat);
172172

173173
///@brief Returns the physical tile type matching a given physical tile type name, or nullptr (if not found)
174-
t_physical_tile_type_ptr find_tile_type_by_name(std::string name, const std::vector<t_physical_tile_type>& types);
174+
t_physical_tile_type_ptr find_tile_type_by_name(const std::string& name, const std::vector<t_physical_tile_type>& types);
175175

176176
int find_pin_class(t_physical_tile_type_ptr type, std::string port_name, int pin_index_in_port, e_pin_type pin_type);
177177

vpr/src/base/SetupVPR.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ static void SetupNocOpts(const t_options& Options, t_noc_opts* NocOpts) {
737737
NocOpts->noc_placement_weighting = Options.noc_placement_weighting;
738738
NocOpts->noc_latency_constraints_weighting = Options.noc_latency_constraints_weighting;
739739
NocOpts->noc_latency_weighting = Options.noc_latency_weighting;
740+
NocOpts->noc_congestion_weighting = Options.noc_congestion_weighting;
740741
NocOpts->noc_swap_percentage = Options.noc_swap_percentage;
741742
NocOpts->noc_placement_file_name = Options.noc_placement_file_name;
742743

vpr/src/base/ShowSetup.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,7 @@ static void ShowNocOpts(const t_noc_opts& NocOpts) {
797797
VTR_LOG("NocOpts.noc_placement_weighting: %f\n", NocOpts.noc_placement_weighting);
798798
VTR_LOG("NocOpts.noc_latency_constraints_weighting: %f\n", NocOpts.noc_latency_constraints_weighting);
799799
VTR_LOG("NocOpts.noc_latency_weighting: %f\n", NocOpts.noc_latency_weighting);
800+
VTR_LOG("NocOpts.noc_congestion_weighting: %f\n", NocOpts.noc_congestion_weighting);
800801
VTR_LOG("NocOpts.noc_swap_percentage: %d%%\n", NocOpts.noc_swap_percentage);
801802
VTR_LOG("NocOpts.noc_routing_algorithm: %s\n", NocOpts.noc_placement_file_name.c_str());
802803
VTR_LOG("\n");

vpr/src/base/place_and_route.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <climits>
66
#include <cstdlib>
77
#include <cmath>
8+
#include <algorithm>
89

910
#include "vtr_util.h"
1011
#include "vtr_memory.h"
@@ -425,7 +426,7 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,
425426
* is used to determine if the channel width should be rounded to an
426427
* even number.
427428
*/
428-
t_chan_width init_chan(int cfactor, t_chan_width_dist chan_width_dist, t_graph_type graph_directionality) {
429+
t_chan_width init_chan(int cfactor, const t_chan_width_dist& chan_width_dist, t_graph_type graph_directionality) {
429430
auto& device_ctx = g_vpr_ctx.mutable_device();
430431
auto& grid = device_ctx.grid;
431432

@@ -460,19 +461,15 @@ t_chan_width init_chan(int cfactor, t_chan_width_dist chan_width_dist, t_graph_t
460461
}
461462
}
462463

463-
chan_width.max = 0;
464-
chan_width.x_max = chan_width.y_max = INT_MIN;
465-
chan_width.x_min = chan_width.y_min = INT_MAX;
466-
for (size_t i = 0; i < grid.height(); ++i) {
467-
chan_width.x_max = std::max(chan_width.x_max, chan_width.x_list[i]);
468-
chan_width.x_min = std::min(chan_width.x_min, chan_width.x_list[i]);
469-
}
470-
chan_width.max = std::max(chan_width.max, chan_width.x_max);
471-
for (size_t i = 0; i < grid.width(); ++i) {
472-
chan_width.y_max = std::max(chan_width.y_max, chan_width.y_list[i]);
473-
chan_width.y_min = std::min(chan_width.y_min, chan_width.y_list[i]);
474-
}
475-
chan_width.max = std::max(chan_width.max, chan_width.y_max);
464+
auto minmax = std::minmax_element(chan_width.x_list.begin(), chan_width.x_list.end());
465+
chan_width.x_min = *minmax.first;
466+
chan_width.x_max = *minmax.second;
467+
468+
minmax = std::minmax_element(chan_width.y_list.begin(), chan_width.y_list.end());
469+
chan_width.y_min = *minmax.first;
470+
chan_width.y_max = *minmax.second;
471+
472+
chan_width.max = std::max(chan_width.x_max, chan_width.y_max);
476473

477474
#ifdef VERBOSE
478475
VTR_LOG("\n");

vpr/src/base/place_and_route.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,
4040
std::shared_ptr<RoutingDelayCalculator> delay_calc,
4141
bool is_flat);
4242

43-
t_chan_width init_chan(int cfactor, t_chan_width_dist chan_width_dist, t_graph_type graph_directionality);
43+
t_chan_width init_chan(int cfactor,
44+
const t_chan_width_dist& chan_width_dist,
45+
t_graph_type graph_directionality);
4446

4547
void post_place_sync();
4648

0 commit comments

Comments
 (0)