Skip to content

Commit

Permalink
Merge pull request #2485 from verilog-to-routing/noc_cost_norm
Browse files Browse the repository at this point in the history
Noc cost normalization
  • Loading branch information
vaughnbetz committed Feb 14, 2024
2 parents b5b6e59 + 581c3a4 commit bcc45db
Show file tree
Hide file tree
Showing 33 changed files with 1,490 additions and 596 deletions.
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/physical_types_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ std::vector<std::string> block_type_class_index_to_pin_names(t_physical_tile_typ
bool is_flat);

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

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

Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ static void SetupNocOpts(const t_options& Options, t_noc_opts* NocOpts) {
NocOpts->noc_placement_weighting = Options.noc_placement_weighting;
NocOpts->noc_latency_constraints_weighting = Options.noc_latency_constraints_weighting;
NocOpts->noc_latency_weighting = Options.noc_latency_weighting;
NocOpts->noc_congestion_weighting = Options.noc_congestion_weighting;
NocOpts->noc_swap_percentage = Options.noc_swap_percentage;
NocOpts->noc_placement_file_name = Options.noc_placement_file_name;

Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/ShowSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@ static void ShowNocOpts(const t_noc_opts& NocOpts) {
VTR_LOG("NocOpts.noc_placement_weighting: %f\n", NocOpts.noc_placement_weighting);
VTR_LOG("NocOpts.noc_latency_constraints_weighting: %f\n", NocOpts.noc_latency_constraints_weighting);
VTR_LOG("NocOpts.noc_latency_weighting: %f\n", NocOpts.noc_latency_weighting);
VTR_LOG("NocOpts.noc_congestion_weighting: %f\n", NocOpts.noc_congestion_weighting);
VTR_LOG("NocOpts.noc_swap_percentage: %d%%\n", NocOpts.noc_swap_percentage);
VTR_LOG("NocOpts.noc_routing_algorithm: %s\n", NocOpts.noc_placement_file_name.c_str());
VTR_LOG("\n");
Expand Down
25 changes: 11 additions & 14 deletions vpr/src/base/place_and_route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <climits>
#include <cstdlib>
#include <cmath>
#include <algorithm>

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

Expand Down Expand Up @@ -460,19 +461,15 @@ t_chan_width init_chan(int cfactor, t_chan_width_dist chan_width_dist, t_graph_t
}
}

chan_width.max = 0;
chan_width.x_max = chan_width.y_max = INT_MIN;
chan_width.x_min = chan_width.y_min = INT_MAX;
for (size_t i = 0; i < grid.height(); ++i) {
chan_width.x_max = std::max(chan_width.x_max, chan_width.x_list[i]);
chan_width.x_min = std::min(chan_width.x_min, chan_width.x_list[i]);
}
chan_width.max = std::max(chan_width.max, chan_width.x_max);
for (size_t i = 0; i < grid.width(); ++i) {
chan_width.y_max = std::max(chan_width.y_max, chan_width.y_list[i]);
chan_width.y_min = std::min(chan_width.y_min, chan_width.y_list[i]);
}
chan_width.max = std::max(chan_width.max, chan_width.y_max);
auto minmax = std::minmax_element(chan_width.x_list.begin(), chan_width.x_list.end());
chan_width.x_min = *minmax.first;
chan_width.x_max = *minmax.second;

minmax = std::minmax_element(chan_width.y_list.begin(), chan_width.y_list.end());
chan_width.y_min = *minmax.first;
chan_width.y_max = *minmax.second;

chan_width.max = std::max(chan_width.x_max, chan_width.y_max);

#ifdef VERBOSE
VTR_LOG("\n");
Expand Down
4 changes: 3 additions & 1 deletion vpr/src/base/place_and_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,
std::shared_ptr<RoutingDelayCalculator> delay_calc,
bool is_flat);

t_chan_width init_chan(int cfactor, t_chan_width_dist chan_width_dist, t_graph_type graph_directionality);
t_chan_width init_chan(int cfactor,
const t_chan_width_dist& chan_width_dist,
t_graph_type graph_directionality);

void post_place_sync();

Expand Down

0 comments on commit bcc45db

Please sign in to comment.