You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vpr/src/place/net_cost_handler.h
+55-30Lines changed: 55 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,43 @@
4
4
#include"move_transactions.h"
5
5
#include"place_util.h"
6
6
7
+
/**
8
+
* @brief The method used to calculate palcement cost
9
+
* NORMAL: Compute cost efficiently using incremental techniques.
10
+
* CHECK: Brute-force cost computation; useful to validate the more complex incremental cost update code.
11
+
*/
7
12
enume_cost_methods {
8
13
NORMAL,
9
14
CHECK
10
15
};
11
16
12
17
/**
13
-
* @brief Update the wire length and timing cost of the blocks (ts and proposed_* data structures) and set
14
-
* the delta costs in bb_delta_c and timing_delta_c. This functions is used when the moving bocks are clusters
18
+
* @brief Find all the nets and pins affected by this swap and update costs.
19
+
*
20
+
* Find all the nets affected by this swap and update the bounding box (wiring)
21
+
* costs. This cost function doesn't depend on the timing info.
22
+
*
23
+
* Find all the connections affected by this swap and update the timing cost.
24
+
* For a connection to be affected, it not only needs to be on or driven by
25
+
* a block, but it also needs to have its delay changed. Otherwise, it will
26
+
* not be added to the affected_pins structure.
27
+
*
28
+
* For more, see update_td_delta_costs().
29
+
*
30
+
* The timing costs are calculated by getting the new connection delays,
31
+
* multiplied by the connection criticalities returned by the timing
32
+
* analyzer. These timing costs are stored in the proposed_* data structures.
33
+
*
34
+
* The change in the bounding box cost is stored in `bb_delta_c`.
35
+
* The change in the timing cost is stored in `timing_delta_c`.
36
+
*
15
37
* @param place_algorithm
16
38
* @param delay_model
17
39
* @param criticalities
18
40
* @param blocks_affected
19
41
* @param bb_delta_c
20
42
* @param timing_delta_c
21
-
* @return
43
+
* @return The number of affected nets.
22
44
*/
23
45
intfind_affected_nets_and_update_costs(
24
46
constt_place_algorithm&place_algorithm,
@@ -29,37 +51,36 @@ int find_affected_nets_and_update_costs(
29
51
double&timing_delta_c);
30
52
31
53
/**
32
-
* @brief Finds the bb cost from scratch (based on 3D BB). Done only when the placement *
33
-
* has been radically changed (i.e. after initial placement). *
34
-
* Otherwise find the cost change incrementally. If method *
35
-
* check is NORMAL, we find bounding boxes that are updatable *
36
-
* for the larger nets. If method is CHECK, all bounding boxes *
37
-
* are found via the non_updateable_bb routine, to provide a *
38
-
* cost which can be used to check the correctness of the *
39
-
* other routine. *
54
+
* @brief Finds the bb cost from scratch (based on 3D BB).
55
+
* Done only when the placement has been radically changed
56
+
* (i.e. after initial placement). Otherwise find the cost
57
+
* change incrementally. If method check is NORMAL, we find
58
+
* bounding boxes that are updatable for the larger nets.
59
+
* If method is CHECK, all bounding boxes are found via the
60
+
* non_updateable_bb routine, to provide a cost which can be
61
+
* used to check the correctness of the other routine.
40
62
* @param method
41
-
* @return
63
+
* @return The bounding box cost of the placement, computed by the 3D method.
42
64
*/
43
65
doublecomp_bb_cost(e_cost_methodsmethod);
44
66
45
67
/**
46
-
* @brief Finds the bb cost from scratch (based on per-layer BB). Done only when the placement *
47
-
* has been radically changed (i.e. after initial placement). *
48
-
* Otherwise find the cost change incrementally. If method *
49
-
* check is NORMAL, we find bounding boxes that are updateable *
50
-
* for the larger nets. If method is CHECK, all bounding boxes *
51
-
* are found via the non_updateable_bb routine, to provide a *
52
-
* cost which can be used to check the correctness of the *
53
-
* other routine. *
68
+
* @brief Finds the bb cost from scratch (based on per-layer BB).
69
+
* Done only when the placement has been radically changed
70
+
* (i.e. after initial placement). Otherwise find the cost change
71
+
* incrementally. If method check is NORMAL, we find bounding boxes
72
+
* that are updateable for the larger nets. If method is CHECK, all
73
+
* bounding boxes are found via the non_updateable_bb routine, to provide
74
+
* a cost which can be used to check the correctness of the other routine.
54
75
* @param method
55
-
* @return
76
+
* @return The placement bounding box cost, computed by the per layer method.
56
77
*/
57
78
doublecomp_layer_bb_cost(e_cost_methodsmethod);
58
79
59
80
/**
60
81
* @brief update net cost data structures (in placer context and net_cost in .cpp file) and reset flags (proposed_net_cost and bb_updated_before).
61
-
* @param num_nets_affected
62
-
* @param cube_bb
82
+
* @param num_nets_affected The number of nets affected by the move. It is used to determine the index up to which elements in ts_nets_to_update are valid.
83
+
* @param cube_bb True if we should use the 3D bounding box (cube_bb), false otherwise.
* @brief re-calculates different terms of the cost function (wire-length, timing, NoC) and update "costs" accordingly. It is important to note that
75
-
* in this function bounding box and connection delays are not calculated from scratch. However, it iterated over nets and add their costs from beginning.
96
+
* in this function bounding box and connection delays are not calculated from scratch. However, it iterates over all nets and connections and updates
97
+
* their costs by a complete summation, rather than incrementally.
76
98
* @param placer_opts
77
99
* @param noc_opts
78
100
* @param delay_model
79
101
* @param criticalities
80
-
* @param costs
102
+
* @param costs passed by reference and computed by this routine (i.e. returned by reference)
0 commit comments