Skip to content

Commit 6ff2d3b

Browse files
[AP][Timing] Updated Comments for Timing
1 parent d6c30fd commit 6ff2d3b

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
@@ -241,10 +241,10 @@ static void print_SimPL_status(size_t iteration,
241241
* @param ap_netlist
242242
* The AP netlist the p_placement uses.
243243
*/
244-
static void update_timing_info_with_placement(PreClusterTimingManager& pre_cluster_timing_manager,
245-
const PlaceDelayModel& place_delay_model,
246-
const PartialPlacement& p_placement,
247-
const APNetlist& ap_netlist) {
244+
static void update_timing_info_with_gp_placement(PreClusterTimingManager& pre_cluster_timing_manager,
245+
const PlaceDelayModel& place_delay_model,
246+
const PartialPlacement& p_placement,
247+
const APNetlist& ap_netlist) {
248248
// If the timing manager is invalid (i.e. timing analysis is off), do not
249249
// update.
250250
if (!pre_cluster_timing_manager.is_valid())
@@ -341,10 +341,10 @@ PartialPlacement SimPLGlobalPlacer::place() {
341341

342342
// Perform a timing update
343343
float timing_update_start_time = runtime_timer.elapsed_sec();
344-
update_timing_info_with_placement(pre_cluster_timing_manager_,
345-
*place_delay_model_.get(),
346-
p_placement,
347-
ap_netlist_);
344+
update_timing_info_with_gp_placement(pre_cluster_timing_manager_,
345+
*place_delay_model_.get(),
346+
p_placement,
347+
ap_netlist_);
348348
solver_->update_net_weights(pre_cluster_timing_manager_);
349349
float timing_update_end_time = runtime_timer.elapsed_sec();
350350

@@ -390,10 +390,10 @@ PartialPlacement SimPLGlobalPlacer::place() {
390390
// Update the setup slacks. This is performed down here (as well as being
391391
// inside the GP loop) since the best_p_placement may not be the p_placement
392392
// from the last iteration of GP.
393-
update_timing_info_with_placement(pre_cluster_timing_manager_,
394-
*place_delay_model_.get(),
395-
best_p_placement,
396-
ap_netlist_);
393+
update_timing_info_with_gp_placement(pre_cluster_timing_manager_,
394+
*place_delay_model_.get(),
395+
best_p_placement,
396+
ap_netlist_);
397397

398398
// Print statistics on the solver used.
399399
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)