Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updating code.
  • Loading branch information
behzadmehmood committed Jul 31, 2024
commit 73f9a7965794c5ac32228286697a60bb2db88ad3
11 changes: 5 additions & 6 deletions vpr/src/place/net_cost_handler.cpp
Original file line number Diff line number Diff line change
@@ -54,6 +54,9 @@ enum class NetUpdateState {

const int MAX_FANOUT_CROSSING_COUNT = 50;

double cong_matrix[400][400];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs comments on what these are, what the overall congestion modeling approach is.
The approach seems to be very similar to a placement cost function that I wrote in my PhD and called NON_LINEAR_CONGESTION. At the time I measured that code it had little gain in routability for architectures with all channels the same width (in various chip regions) and the CPU time was high. Not sure if the trade-off is different with this code, but adding QoR data on some larger circuits would be important to check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, hard-coding 400 is not good.

double cong_matrix_new[400][400];

/**
* @brief Crossing counts for nets with different #'s of pins. From
* ICCAD 94 pp. 690 - 695 (with linear interpolation applied by me).
@@ -458,10 +461,6 @@ static double get_net_cost(ClusterNetId net_id, const t_bb& bb);
*/
static double get_net_wirelength_estimate(ClusterNetId net_id, const t_bb& bb);

static void get_cong_matrix(ClusterNetId net_id, const t_bb& bb);

static double get_cong_cost(double chan_width)

/**
* @brief To mitigate round-off errors, every once in a while, the costs of nets are summed up from scratch.
* This functions is called to do that for bb cost. It doesn't calculate the BBs from scratch, it would only add the costs again.
@@ -1846,7 +1845,7 @@ static double get_net_wirelength_estimate(ClusterNetId net_id, const t_bb& bb) {
return (ncost);
}

static void get_cong_matrix(ClusterNetId net_id, const t_bb& bb) {
void get_cong_matrix(ClusterNetId net_id, const t_bb& bb) {
/* Finds the cost due to one net by looking at its coordinate bounding *
* box. */
// auto& cluster_ctx = g_vpr_ctx.clustering();
@@ -1865,7 +1864,7 @@ static void get_cong_matrix(ClusterNetId net_id, const t_bb& bb) {
}


static double get_cong_cost(double chan_width) {
double get_cong_cost(double chan_width) {
auto& device_ctx = g_vpr_ctx.device();
double max = 0.0;
double avg = 1e-4,var=0.0;
4 changes: 4 additions & 0 deletions vpr/src/place/net_cost_handler.h
Original file line number Diff line number Diff line change
@@ -147,3 +147,7 @@ void init_try_swap_net_cost_structs(size_t num_nets, bool cube_bb);
* @brief Free (layer_)ts_bb_edge_new, (layer_)ts_bb_coord_new, ts_layer_sink_pin_count, and ts_nets_to_update data structures.
*/
void free_try_swap_net_cost_structs();

void get_cong_matrix(ClusterNetId net_id, const t_bb& bb);

double get_cong_cost(double chan_width);
3 changes: 0 additions & 3 deletions vpr/src/place/place.cpp
Original file line number Diff line number Diff line change
@@ -111,9 +111,6 @@ static int num_swap_accepted = 0;
static int num_swap_aborted = 0;
static int num_ts_called = 0;

double cong_matrix[400][400];
double cong_matrix_new[400][400];

float congestion_tradeoff = 1.0;

std::unique_ptr<FILE, decltype(&vtr::fclose)> f_move_stats_file(nullptr,