Skip to content

Commit b2e9698

Browse files
committed
[fix] update graphic structure call moved
Now a full legalize method is created to update drawing cluster data structure. It is called at the end of each legalize implementation.
1 parent cfb7770 commit b2e9698

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

vpr/src/analytical_place/full_legalizer.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959

6060
#include "setup_grid.h"
6161
#include "stats.h"
62+
#ifndef NO_GRAPHICS
63+
#include "draw_global.h"
64+
#endif
6265

6366
std::unique_ptr<FullLegalizer> make_full_legalizer(e_ap_full_legalizer full_legalizer_type,
6467
const APNetlist& ap_netlist,
@@ -1003,6 +1006,7 @@ void FlatRecon::legalize(const PartialPlacement& p_placement) {
10031006

10041007
// Perform the initial placement on created clusters.
10051008
place_clusters(p_placement);
1009+
update_drawing_data_structures();
10061010
}
10071011

10081012
void NaiveFullLegalizer::create_clusters(const PartialPlacement& p_placement) {
@@ -1219,6 +1223,7 @@ void NaiveFullLegalizer::legalize(const PartialPlacement& p_placement) {
12191223
// made part of the placement and verify placement should check for
12201224
// it.
12211225
post_place_sync();
1226+
update_drawing_data_structures();
12221227
}
12231228

12241229
void APPack::legalize(const PartialPlacement& p_placement) {
@@ -1304,4 +1309,14 @@ void APPack::legalize(const PartialPlacement& p_placement) {
13041309

13051310
// Synchronize the pins in the clusters after placement.
13061311
post_place_sync();
1312+
update_drawing_data_structures();
13071313
}
1314+
1315+
void FullLegalizer::update_drawing_data_structures() {
1316+
#ifndef NO_GRAPHICS
1317+
// update graphic resources incase of clustering changes
1318+
if (get_draw_state_vars()) {
1319+
get_draw_state_vars()->refresh_graphic_resources_after_cluster_change();
1320+
}
1321+
#endif
1322+
}

vpr/src/analytical_place/full_legalizer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class FullLegalizer {
5959
* device grid and fixed blocks are observed.
6060
*/
6161
virtual void legalize(const PartialPlacement& p_placement) = 0;
62+
63+
/// @brief Update drawing data structure for current placement
64+
void update_drawing_data_structures();
6265

6366
protected:
6467
/// @brief The AP Netlist to fully legalize the flat placement of.

vpr/src/base/place_and_route.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
#include "route.h"
2121
#include "route_export.h"
2222
#include "draw.h"
23-
#ifndef NO_GRAPHICS
24-
#include "draw_global.h"
25-
#endif
2623
#include "rr_graph.h"
2724
#include "read_xml_arch_file.h"
2825
#include "route_common.h"
@@ -607,11 +604,4 @@ void post_place_sync() {
607604
for (const ClusterBlockId block_id : cluster_ctx.clb_nlist.blocks()) {
608605
blk_loc_registry.place_sync_external_block_connections(block_id);
609606
}
610-
611-
#ifndef NO_GRAPHICS
612-
// update graphic resources incase of clustering changes
613-
if (get_draw_state_vars()) {
614-
get_draw_state_vars()->refresh_graphic_resources_after_cluster_change();
615-
}
616-
#endif
617607
}

0 commit comments

Comments
 (0)