@@ -1653,9 +1653,13 @@ static e_move_result try_swap(float t,
1653
1653
std::vector<ClusterPinId> sink_pins_affected;
1654
1654
find_affected_sink_pins (blocks_affected, sink_pins_affected);
1655
1655
1656
+ // For setup slack analysis, we first do a timing analysis to get the newest slack values
1657
+ // resulted from the proposed block moves. If the move turns out to be accepted, we keep
1658
+ // the updated slack values and commit the block moves. If rejected, we reject the proposed
1659
+ // block moves and revert this timing analysis.
1656
1660
if (place_algorithm == SLACK_TIMING_PLACE) {
1657
- // Invalidates timing of modified connections for incremental timing updates
1658
- // This routine relies on comparing proposed_connection_delay and connection_delay
1661
+ // Gather all the connections with modified delays for incremental timing updates.
1662
+ // This routine relies on comparing proposed_connection_delay and connection_delay.
1659
1663
invalidate_affected_connection_delays (sink_pins_affected,
1660
1664
pin_timing_invalidator,
1661
1665
timing_info);
@@ -1749,7 +1753,9 @@ static e_move_result try_swap(float t,
1749
1753
comp_td_connection_delays (delay_model);
1750
1754
comp_td_costs (delay_model, *criticalities, &costs->timing_cost );
1751
1755
1752
- // Re-invalidate the affected sink pins
1756
+ // Re-invalidate the affected sink pins since the proposed move is
1757
+ // rejected, and the same blocks are reverted to their original
1758
+ // positions. The affected sink pins should stay the same.
1753
1759
invalidate_affected_connection_delays (sink_pins_affected,
1754
1760
pin_timing_invalidator,
1755
1761
timing_info);
@@ -1946,19 +1952,23 @@ static void update_td_delta_costs(const PlaceDelayModel* delay_model,
1946
1952
}
1947
1953
}
1948
1954
1955
+ /* *
1956
+ * @brief Find all the sink pins with changed connection delays from the affected blocks.
1957
+ *
1958
+ * These sink pins will be passed into the pin_timing_invalidator for timing update.
1959
+ * They will also be added to the pin invalidator when we wish to revert a timing update.
1960
+ *
1961
+ * It is possible that some connections may not have changed delay. For instance, if
1962
+ * using a dx/dy delay model, this could occur if a sink moved to a new position with
1963
+ * the same dx/dy from it's driver. To minimize work during the incremental STA update
1964
+ * we do not invalidate such unchanged connections.
1965
+ */
1949
1966
static void find_affected_sink_pins (const t_pl_blocks_to_be_moved& blocks_affected,
1950
1967
std::vector<ClusterPinId>& sink_pins_affected) {
1951
1968
auto & cluster_ctx = g_vpr_ctx.clustering ();
1952
1969
auto & clb_nlist = cluster_ctx.clb_nlist ;
1953
1970
1954
1971
for (ClusterPinId clb_pin : blocks_affected.affected_pins ) {
1955
- // It is possible that some connections may not have changed delay.(e.g.
1956
- // For instance, if using a dx/dy delay model, this could occur if a sink
1957
- // moved to a new position with the same dx/dy from it's driver.
1958
- //
1959
- // To minimize work during the incremental STA update we do not invalidate
1960
- // such unchanged connections.
1961
-
1962
1972
ClusterNetId net = clb_nlist.pin_net (clb_pin);
1963
1973
int ipin = clb_nlist.pin_net_index (clb_pin);
1964
1974
@@ -2178,8 +2188,13 @@ static bool verify_connection_setup_slacks(const PlacerSetupSlacks* setup_slacks
2178
2188
return true ;
2179
2189
}
2180
2190
2181
- /* Update the connection_timing_cost values from the temporary *
2182
- * values for all connections that have changed. */
2191
+ /* *
2192
+ * @brief Update the connection_timing_cost values from the temporary
2193
+ * values for all connections that have/haven't changed.
2194
+ *
2195
+ * All the connections have already been gathered by blocks_affected.affected_pins
2196
+ * after running the routine find_affected_nets_and_update_costs() in try_swap().
2197
+ */
2183
2198
static void commit_td_cost (const t_pl_blocks_to_be_moved& blocks_affected) {
2184
2199
auto & cluster_ctx = g_vpr_ctx.clustering ();
2185
2200
auto & clb_nlist = cluster_ctx.clb_nlist ;
@@ -2217,10 +2232,15 @@ static void revert_td_cost(const t_pl_blocks_to_be_moved& blocks_affected) {
2217
2232
#endif
2218
2233
}
2219
2234
2220
- // Invalidates the delays of connections effected by the specified move
2221
- //
2222
- // Relies on proposed_connection_delay and connection_delay to detect
2223
- // which connections have actually had their delay changed.
2235
+ /* *
2236
+ * @brief Invalidates the delays of connections effected by the specified move.
2237
+ *
2238
+ * Relies on find_affected_sink_pins() to find all the connections with different
2239
+ * `proposed_connection_delay` and `connection_delay`.
2240
+ *
2241
+ * Invalidate all the timing graph edges associated with these sink pins via the
2242
+ * ClusteredPinTimingInvalidator class.
2243
+ */
2224
2244
static void invalidate_affected_connection_delays (const std::vector<ClusterPinId>& sink_pins_affected,
2225
2245
ClusteredPinTimingInvalidator* pin_tedges_invalidator,
2226
2246
TimingInfo* timing_info) {
@@ -2229,12 +2249,6 @@ static void invalidate_affected_connection_delays(const std::vector<ClusterPinId
2229
2249
2230
2250
// Invalidate timing graph edges affected by the move
2231
2251
for (ClusterPinId clb_pin : sink_pins_affected) {
2232
- // It is possible that some connections may not have changed delay.
2233
- // For instance, if using a dx/dy delay model, this could occur if a sink
2234
- // moved to a new position with the same dx/dy from it's driver.
2235
- //
2236
- // To minimize work during the incremental STA update we do not invalidate
2237
- // such unchanged connections.
2238
2252
pin_tedges_invalidator->invalidate_connection (clb_pin, timing_info);
2239
2253
}
2240
2254
}
0 commit comments