File tree Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 59
59
60
60
#include " setup_grid.h"
61
61
#include " stats.h"
62
+ #ifndef NO_GRAPHICS
63
+ #include " draw_global.h"
64
+ #endif
62
65
63
66
std::unique_ptr<FullLegalizer> make_full_legalizer (e_ap_full_legalizer full_legalizer_type,
64
67
const APNetlist& ap_netlist,
@@ -1003,6 +1006,7 @@ void FlatRecon::legalize(const PartialPlacement& p_placement) {
1003
1006
1004
1007
// Perform the initial placement on created clusters.
1005
1008
place_clusters (p_placement);
1009
+ update_drawing_data_structures ();
1006
1010
}
1007
1011
1008
1012
void NaiveFullLegalizer::create_clusters (const PartialPlacement& p_placement) {
@@ -1219,6 +1223,7 @@ void NaiveFullLegalizer::legalize(const PartialPlacement& p_placement) {
1219
1223
// made part of the placement and verify placement should check for
1220
1224
// it.
1221
1225
post_place_sync ();
1226
+ update_drawing_data_structures ();
1222
1227
}
1223
1228
1224
1229
void APPack::legalize (const PartialPlacement& p_placement) {
@@ -1304,4 +1309,14 @@ void APPack::legalize(const PartialPlacement& p_placement) {
1304
1309
1305
1310
// Synchronize the pins in the clusters after placement.
1306
1311
post_place_sync ();
1312
+ update_drawing_data_structures ();
1307
1313
}
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
+ }
Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ class FullLegalizer {
59
59
* device grid and fixed blocks are observed.
60
60
*/
61
61
virtual void legalize (const PartialPlacement& p_placement) = 0;
62
+
63
+ // / @brief Update drawing data structure for current placement
64
+ void update_drawing_data_structures ();
62
65
63
66
protected:
64
67
// / @brief The AP Netlist to fully legalize the flat placement of.
Original file line number Diff line number Diff line change @@ -43,6 +43,24 @@ void t_draw_state::reset_block_colors() {
43
43
true );
44
44
}
45
45
46
+ void t_draw_state::refresh_graphic_resources_after_cluster_change () {
47
+ const ClusteringContext& cluster_ctx = g_vpr_ctx.clustering ();
48
+ const AtomContext& atom_ctx = g_vpr_ctx.atom ();
49
+
50
+ // Resize block color vectors to match the possibly new clustered size
51
+ block_color_.resize (cluster_ctx.clb_nlist .blocks ().size ());
52
+ use_default_block_color_.resize (cluster_ctx.clb_nlist .blocks ().size ());
53
+ reset_block_colors ();
54
+
55
+ // Resize net color as well since they might be rebuild in analytical placement
56
+ if (is_flat) {
57
+ net_color.resize (atom_ctx.netlist ().nets ().size ());
58
+ } else {
59
+ net_color.resize (cluster_ctx.clb_nlist .nets ().size ());
60
+ }
61
+ std::fill (net_color.begin (), net_color.end (), ezgl::BLACK);
62
+ }
63
+
46
64
/* *************************************************
47
65
* begin t_draw_pb_type_info function definitions *
48
66
**************************************************/
Original file line number Diff line number Diff line change @@ -333,6 +333,9 @@ struct t_draw_state {
333
333
void reset_block_color (ClusterBlockId blk);
334
334
void reset_block_colors ();
335
335
336
+ // /@brief Refresh graphics resources' size after update to cluster blocks size
337
+ void refresh_graphic_resources_after_cluster_change ();
338
+
336
339
std::vector<std::pair<t_pl_loc, ezgl::color>> colored_locations;
337
340
338
341
// / @brief Stores UI checkbox struct for passing into the callback functions
You can’t perform that action at this time.
0 commit comments