Verilog to Routing - VPR
stats.h
Go to the documentation of this file.
1 #pragma once
2 #include <vector>
3 #include <limits>
4 #include <algorithm>
5 #include "vpr_types.h"
6 
7 void routing_stats(bool full_stats, enum e_route_type route_type, std::vector<t_segment_inf>& segment_inf, float R_minW_nmos, float R_minW_pmos, float grid_logic_tile_area, enum e_directionality directionality, int wire_to_ipin_switch);
8 
10 
11 void print_lambda();
12 
13 void get_num_bends_and_length(ClusterNetId inet, int* bends, int* length, int* segments);
14 
16 
21 template<typename T>
22 double linear_regression_vector(const std::vector<T>& vals, size_t start_x = 0) {
23  // returns slope; index is x, val is y
24  size_t n{vals.size() - start_x};
25 
26  double x_avg{0}, y_avg{0};
27  for (size_t x = start_x; x < vals.size(); ++x) {
28  x_avg += x;
29  y_avg += vals[x];
30  }
31  x_avg /= (double)n;
32  y_avg /= (double)n;
33 
34  double numerator = 0, denominator = 0;
35  for (size_t x = start_x; x < vals.size(); ++x) {
36  numerator += (x - x_avg) * (vals[x] - y_avg);
37  denominator += (x - x_avg) * (x - x_avg);
38  }
39 
40  if (denominator == 0) return std::numeric_limits<double>::max();
41  return numerator / denominator;
42 }
double linear_regression_vector(const std::vector< T > &vals, size_t start_x=0)
template functions must be defined in header, or explicitely instantiated in definition file (defeats...
Definition: stats.h:22
This is a core file that defines the major data types used by VPR.
void print_wirelen_prob_dist()
Prints out the probability distribution of the wirelength / number input pins on a net – i...
Definition: stats.cpp:332
void routing_stats(bool full_stats, enum e_route_type route_type, std::vector< t_segment_inf > &segment_inf, float R_minW_nmos, float R_minW_pmos, float grid_logic_tile_area, enum e_directionality directionality, int wire_to_ipin_switch)
Prints out various statistics about the current routing.
Definition: stats.cpp:45
int count_netlist_clocks()
Count how many clocks are in the netlist.
Definition: stats.cpp:446
vtr::StrongId< cluster_net_id_tag > ClusterNetId
A unique identifier for a net in the atom netlist.
Definition: clustered_netlist_fwd.h:23
e_route_type
Definition: vpr_types.h:962
void print_lambda()
Finds the average number of input pins used per clb.
Definition: stats.cpp:418
void get_num_bends_and_length(ClusterNetId inet, int *bends, int *length, int *segments)
Counts and returns the number of bends, wirelength, and number of routing resource segments in net in...
Definition: stats.cpp:274