Skip to content

Commit 9eef430

Browse files
[AP][Timing] Updated Comments for Timing
1 parent 41bf926 commit 9eef430

File tree

5 files changed

+28
-19
lines changed

5 files changed

+28
-19
lines changed

vpr/src/analytical_place/analytical_placement_flow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static void print_ap_netlist_stats(const APNetlist& netlist) {
4949
float average_fanout = 0.f;
5050
unsigned net_count = 0;
5151
for (APNetId net_id : netlist.nets()) {
52-
if (netlist.net_is_global(net_id) || netlist.net_is_ignored(net_id))
52+
if (netlist.net_is_ignored(net_id))
5353
continue;
5454
size_t net_fanout = netlist.net_pins(net_id).size();
5555
if (net_fanout > highest_fanout)

vpr/src/analytical_place/analytical_solver.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,21 @@ void AnalyticalSolver::update_net_weights(const PreClusterTimingManager& pre_clu
152152
// Note: To save time, we do not compute the weights of nets that we
153153
// do not care about for AP. This leaves their weights at 1.0 just
154154
// in case they are accidentally used.
155-
if (netlist_.net_is_global(net_id) || netlist_.net_is_ignored(net_id))
155+
if (netlist_.net_is_ignored(net_id))
156156
continue;
157157

158158
AtomNetId atom_net_id = netlist_.net_atom_net(net_id);
159159
VTR_ASSERT_SAFE(atom_net_id.is_valid());
160160

161161
float crit = pre_cluster_timing_manager.calc_net_setup_criticality(atom_net_id, atom_netlist_);
162162

163+
// When optimizing for WL, the net weights are just set to 1 (meaning
164+
// that we want to minimize the WL of nets).
165+
// When optimizing for timing, the net weights are set to the cirticality.
166+
// The intuition is that we care more about shrinking the wirelength of
167+
// more critical connections than less critical ones.
168+
// Use the AP timing trade-off term to linearly interpolate between these
169+
// weighting terms.
163170
net_weights_[net_id] = ap_timing_tradeoff_ * crit + (1.0f - ap_timing_tradeoff_);
164171
}
165172
}
@@ -239,7 +246,7 @@ void QPHybridSolver::init_linear_system() {
239246
size_t num_star_nodes = 0;
240247
unsigned num_nets = 0;
241248
for (APNetId net_id : netlist_.nets()) {
242-
if (netlist_.net_is_global(net_id) || netlist_.net_is_ignored(net_id))
249+
if (netlist_.net_is_ignored(net_id))
243250
continue;
244251
num_nets++;
245252
if (netlist_.net_pins(net_id).size() > star_num_pins_threshold)
@@ -270,7 +277,7 @@ void QPHybridSolver::init_linear_system() {
270277
// clique connnection models.
271278
size_t star_node_offset = 0;
272279
for (APNetId net_id : netlist_.nets()) {
273-
if (netlist_.net_is_global(net_id) || netlist_.net_is_ignored(net_id))
280+
if (netlist_.net_is_ignored(net_id))
274281
continue;
275282
size_t num_pins = netlist_.net_pins(net_id).size();
276283
VTR_ASSERT_DEBUG(num_pins > 1);
@@ -789,7 +796,7 @@ void B2BSolver::init_linear_system(PartialPlacement& p_placement) {
789796
triplet_list_y.reserve(num_nets);
790797

791798
for (APNetId net_id : netlist_.nets()) {
792-
if (netlist_.net_is_global(net_id) || netlist_.net_is_ignored(net_id))
799+
if (netlist_.net_is_ignored(net_id))
793800
continue;
794801
size_t num_pins = netlist_.net_pins(net_id).size();
795802
VTR_ASSERT_SAFE_MSG(num_pins > 1, "net must have at least 2 pins");

vpr/src/analytical_place/gen_ap_netlist_from_atoms.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,11 @@ APNetlist gen_ap_netlist_from_atoms(const AtomNetlist& atom_netlist,
124124
ap_netlist.set_net_is_ignored(ap_net_id, true);
125125
continue;
126126
}
127-
// Is the net global, if so mark as global for AP
127+
// Is the net global, if so mark as global for AP (also ignored)
128128
if (atom_netlist.net_is_global(atom_net_id)) {
129129
ap_netlist.set_net_is_global(ap_net_id, true);
130+
// Global nets are also ignored by the AP flow.
131+
ap_netlist.set_net_is_ignored(ap_net_id, true);
130132
continue;
131133
}
132134
// Get the unique blocks connectioned to this net

vpr/src/analytical_place/global_placer.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ static void print_SimPL_status(size_t iteration,
246246
* @param ap_netlist
247247
* The AP netlist the p_placement uses.
248248
*/
249-
static void update_timing_info_with_placement(PreClusterTimingManager& pre_cluster_timing_manager,
250-
const PlaceDelayModel& place_delay_model,
251-
const PartialPlacement& p_placement,
252-
const APNetlist& ap_netlist) {
249+
static void update_timing_info_with_gp_placement(PreClusterTimingManager& pre_cluster_timing_manager,
250+
const PlaceDelayModel& place_delay_model,
251+
const PartialPlacement& p_placement,
252+
const APNetlist& ap_netlist) {
253253
// If the timing manager is invalid (i.e. timing analysis is off), do not
254254
// update.
255255
if (!pre_cluster_timing_manager.is_valid())
@@ -346,10 +346,10 @@ PartialPlacement SimPLGlobalPlacer::place() {
346346

347347
// Perform a timing update
348348
float timing_update_start_time = runtime_timer.elapsed_sec();
349-
update_timing_info_with_placement(pre_cluster_timing_manager_,
350-
*place_delay_model_.get(),
351-
p_placement,
352-
ap_netlist_);
349+
update_timing_info_with_gp_placement(pre_cluster_timing_manager_,
350+
*place_delay_model_.get(),
351+
p_placement,
352+
ap_netlist_);
353353
solver_->update_net_weights(pre_cluster_timing_manager_);
354354
float timing_update_end_time = runtime_timer.elapsed_sec();
355355

@@ -395,10 +395,10 @@ PartialPlacement SimPLGlobalPlacer::place() {
395395
// Update the setup slacks. This is performed down here (as well as being
396396
// inside the GP loop) since the best_p_placement may not be the p_placement
397397
// from the last iteration of GP.
398-
update_timing_info_with_placement(pre_cluster_timing_manager_,
399-
*place_delay_model_.get(),
400-
best_p_placement,
401-
ap_netlist_);
398+
update_timing_info_with_gp_placement(pre_cluster_timing_manager_,
399+
*place_delay_model_.get(),
400+
best_p_placement,
401+
ap_netlist_);
402402

403403
// Print statistics on the solver used.
404404
solver_->print_statistics();

vpr/src/analytical_place/partial_placement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
double PartialPlacement::get_hpwl(const APNetlist& netlist) const {
1515
double hpwl = 0.0;
1616
for (APNetId net_id : netlist.nets()) {
17-
if (netlist.net_is_global(net_id) || netlist.net_is_ignored(net_id))
17+
if (netlist.net_is_ignored(net_id))
1818
continue;
1919
double min_x = std::numeric_limits<double>::max();
2020
double max_x = std::numeric_limits<double>::lowest();

0 commit comments

Comments
 (0)