Skip to content

Commit 4342c22

Browse files
authored
Merge branch 'master' into xt_tileable_direct_fixup
2 parents ca805c5 + 74d6c84 commit 4342c22

File tree

132 files changed

+956
-7139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+956
-7139
lines changed

doc/src/Images/Overall_view.png

-125 KB
Loading

doc/src/vpr/graphics.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ Manual Moves
308308

309309
The manual moves feature allows the user to specify the next move in placement. If the move is legal, blocks are swapped and the new move is shown on the architecture.
310310

311+
.. _fig-misc-tab:
311312
.. figure:: ../Images/manual_move.png
312313
:align: center
313314
:width: 25%
@@ -335,3 +336,15 @@ If the manual move is legal, the cost summary window will display the delta cost
335336

336337
The user can Accept or Reject the manual move based on the values provided. If accepted the block's new location is shown.
337338

339+
Pause Button
340+
------------
341+
342+
The pause button allows the user to temporarily stop the program during placement or routing.
343+
When clicked during the placement stage, the program will pause at the next temperature update.
344+
When clicked during the routing stage, it will pause at the next router iteration.
345+
346+
The button can be pressed at any time while the program is running. To enable the feature, click the **Pause** button under the **Misc.** tab (see :ref:`fig-misc-tab`).
347+
Once the program reaches the next temperature update or router iteration after the button is pressed, it will automatically pause.
348+
349+
After the program has paused, clicking **Next Step** allows the user to resume execution from the point where the program was paused.
350+
This can be continuing from the current temperature in placement or from the current router iteration in routing.

doc/src/vtr/get_vtr.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ How to Cite
99
Citations are important in academia, as they ensure contributors receive credit for their efforts.
1010
Therefore please use the following paper as a general citation whenever you use VTR:
1111

12-
M. A. Elgammal, A. Mohaghegh, S. G. Shahrouz, F. Mahmoudi, F. Koşar, K. Talaei, J. Fife, D. Khadivi, K. E. Murray, A. Boutros, K.B. Kent, J. Goeders, V. Betz "VTR 9: Open-Source CAD for Fabric and Beyond FPGA Architecture Exploration" ACM TRETS, 2025
12+
M. A. Elgammal, A. Mohaghegh, S. G. Shahrouz, F. Mahmoudi, F. Koşar, K. Talaei, J. Fife, D. Khadivi, K. E. Murray, A. Boutros, K.B. Kent, J. Goeders, V. Betz "VTR 9: Open-Source CAD for Fabric and Beyond FPGA Architecture Exploration" ACM TRETS, Vol. 13, No. 3, Sept. 2025, pp. 1 - 53.
1313

1414
Bibtex:
1515

@@ -19,6 +19,10 @@ Bibtex:
1919
title={VTR 9: Open-Source CAD for Fabric and Beyond FPGA Architecture Exploration},
2020
author={Elgammal, Mohamed A. and Mohaghegh, Amin and Shahrouz, Soheil G. and Mahmoudi, Fatemehsadat and Kosar, Fahrican and Talaei, Kimia and Fife, Joshua and Khadivi, Daniel and Murray, Kevin and Boutros, Andrew and Kent, Kenneth B. and Goeders, Jeff and Betz, Vaughn},
2121
journal={ACM Trans. Reconfigurable Technol. Syst.},
22+
issue_date = {September 2025},
23+
volume = {18},
24+
number = {3},
25+
numpages = {53},
2226
year={2025}
2327
}
2428
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* @file
3+
* @author Yulang (Robert) Luo
4+
* @date October 2025
5+
* @brief The definitions of the AP Draw Manager class which is used
6+
* to handle graphics updates during analytical placement.
7+
*/
8+
9+
#include "ap_draw_manager.h"
10+
#include "vpr_types.h"
11+
12+
#ifndef NO_GRAPHICS
13+
#include "draw.h"
14+
#include "draw_global.h"
15+
#include "partial_placement.h"
16+
#endif
17+
18+
APDrawManager::APDrawManager(const PartialPlacement& p_placement) {
19+
#ifndef NO_GRAPHICS
20+
// Set the analytical placement reference in draw state
21+
get_draw_state_vars()->set_ap_partial_placement_ref(p_placement);
22+
#else
23+
(void)p_placement;
24+
#endif
25+
}
26+
27+
APDrawManager::~APDrawManager() {
28+
#ifndef NO_GRAPHICS
29+
// Clear the analytical placement reference in draw state
30+
get_draw_state_vars()->clear_ap_partial_placement_ref();
31+
#endif
32+
}
33+
34+
void APDrawManager::update_graphics(unsigned int iteration, enum APDrawType draw_type) {
35+
#ifndef NO_GRAPHICS
36+
std::string msg;
37+
if (draw_type == APDrawType::Solver) {
38+
msg = "Analytical Placement Solver - Iteration: " + std::to_string(iteration);
39+
} else if (draw_type == APDrawType::Legalizer) {
40+
msg = "Analytical Placement Legalizer - Iteration: " + std::to_string(iteration);
41+
} else {
42+
msg = "Analytical Placement";
43+
}
44+
update_screen(ScreenUpdatePriority::MAJOR, msg.c_str(), e_pic_type::ANALYTICAL_PLACEMENT, nullptr);
45+
#else
46+
(void)iteration;
47+
(void)draw_type;
48+
#endif
49+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#pragma once
2+
/**
3+
* @file
4+
* @author Yulang (Robert) Luo
5+
* @date October 2025
6+
* @brief The decalarations of the AP Draw Manager class which is used
7+
* to handle graphics updates during analytical placement.
8+
*/
9+
10+
#include <string>
11+
12+
// Forward declarations
13+
class PartialPlacement;
14+
15+
// Types to indicate the type of drawing operation
16+
enum class APDrawType {
17+
Solver,
18+
Legalizer
19+
};
20+
21+
/**
22+
* @class APDrawManager
23+
* @brief Manages graphics updates during analytical placement operations.
24+
*
25+
* This class provides a clean interface for updating the screen during
26+
* analytical placement without requiring the placement code to be littered
27+
* with NO_GRAPHICS conditional compilation directives.
28+
*/
29+
class APDrawManager {
30+
public:
31+
/**
32+
* @brief Constructor initializes the draw manager with a reference to the
33+
* current partial placement.
34+
*/
35+
explicit APDrawManager(const PartialPlacement& p_placement);
36+
37+
/**
38+
* @brief Destructor cleans up the reference in the draw state.
39+
*/
40+
~APDrawManager();
41+
42+
/**
43+
* @brief Update screen with current analytical placement state
44+
* @param msg A message to display with the update
45+
*/
46+
void update_graphics(unsigned int iteration, enum APDrawType draw_type);
47+
};

vpr/src/analytical_place/detailed_placer.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,6 @@ AnnealerDetailedPlacer::AnnealerDetailedPlacer(const BlkLocRegistry& curr_cluste
7575
}
7676
}
7777

78-
// The solution produced by the AP flow is significantly better than the
79-
// initial placement solution produced by the initial placer in the default
80-
// flow. Even though the annealer auto-selects its initial temperature based
81-
// on the quality of the placement, we found that the initial temperatute was
82-
// still too high and it was hurting quality. This scales down the initial
83-
// temperature auto-selected by the annealer to prevent this and improve
84-
// runtime.
85-
// Here we still scale by whatever the user passed in to scale the initial
86-
// temperature by, but we also scale it down further. This allows AP to scale
87-
// the initial temperature down by default, while still allowing the user
88-
// some control.
89-
float anneal_auto_init_t_scale = vpr_setup.PlacerOpts.place_auto_init_t_scale * 0.5f;
90-
9178
placer_ = std::make_unique<Placer>((const Netlist<>&)clustered_netlist,
9279
curr_clustered_placement,
9380
vpr_setup.PlacerOpts,
@@ -97,7 +84,7 @@ AnnealerDetailedPlacer::AnnealerDetailedPlacer(const BlkLocRegistry& curr_cluste
9784
netlist_pin_lookup_,
9885
FlatPlacementInfo(),
9986
place_delay_model,
100-
anneal_auto_init_t_scale,
87+
vpr_setup.PlacerOpts.place_auto_init_t_scale,
10188
g_vpr_ctx.placement().cube_bb,
10289
false /*is_flat*/,
10390
false /*quiet*/);

vpr/src/analytical_place/global_placer.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <limits>
1212
#include <memory>
1313
#include <vector>
14+
#include "ap_draw_manager.h"
1415
#include "PreClusterTimingManager.h"
1516
#include "analytical_solver.h"
1617
#include "ap_flow_enums.h"
@@ -352,6 +353,10 @@ PartialPlacement SimPLGlobalPlacer::place() {
352353
PartialPlacement best_p_placement(ap_netlist_);
353354
double best_ub_hpwl = std::numeric_limits<double>::max();
354355

356+
// Initialize graphics for analytical placement, setting the reference in
357+
// the draw state.
358+
APDrawManager draw_manager(p_placement);
359+
355360
// Run the global placer.
356361
for (size_t i = 0; i < max_num_iterations_; i++) {
357362
float iter_start_time = runtime_timer.elapsed_sec();
@@ -361,12 +366,18 @@ PartialPlacement SimPLGlobalPlacer::place() {
361366
solver_->solve(i, p_placement);
362367
float solver_end_time = runtime_timer.elapsed_sec();
363368
double lb_hpwl = p_placement.get_hpwl(ap_netlist_);
369+
370+
// Update graphics after analytical solver
371+
draw_manager.update_graphics(i, APDrawType::Solver);
364372

365373
// Run the legalizer.
366374
float legalizer_start_time = runtime_timer.elapsed_sec();
367375
partial_legalizer_->legalize(p_placement);
368376
float legalizer_end_time = runtime_timer.elapsed_sec();
369377
double ub_hpwl = p_placement.get_hpwl(ap_netlist_);
378+
379+
// Update graphics after legalizer
380+
draw_manager.update_graphics(i, APDrawType::Legalizer);
370381

371382
// Perform a timing update
372383
float timing_update_start_time = runtime_timer.elapsed_sec();

0 commit comments

Comments
 (0)