Skip to content

Commit 9b16536

Browse files
Revert "Feature ap draw"
1 parent 6a9ea2d commit 9b16536

File tree

9 files changed

+45
-284
lines changed

9 files changed

+45
-284
lines changed

vpr/src/analytical_place/ap_draw_manager.cpp

Lines changed: 0 additions & 49 deletions
This file was deleted.

vpr/src/analytical_place/ap_draw_manager.h

Lines changed: 0 additions & 47 deletions
This file was deleted.

vpr/src/analytical_place/global_placer.cpp

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

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

373365
// Run the legalizer.
374366
float legalizer_start_time = runtime_timer.elapsed_sec();
375367
partial_legalizer_->legalize(p_placement);
376368
float legalizer_end_time = runtime_timer.elapsed_sec();
377369
double ub_hpwl = p_placement.get_hpwl(ap_netlist_);
378-
379-
// Update graphics after legalizer
380-
draw_manager.update_graphics(i, APDrawType::Legalizer);
381370

382371
// Perform a timing update
383372
float timing_update_start_time = runtime_timer.elapsed_sec();

vpr/src/base/vpr_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ enum class e_sched_type {
387387
enum class e_pic_type {
388388
NO_PICTURE,
389389
PLACEMENT,
390-
ANALYTICAL_PLACEMENT,
391390
ROUTING
392391
};
393392

vpr/src/draw/draw.cpp

Lines changed: 43 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818
#include "draw.h"
1919

2020
#include "draw_interposer.h"
21-
#include "draw_types.h"
2221
#include "timing_info.h"
2322
#include "physical_types.h"
2423

2524
#include "move_utils.h"
26-
#include "vpr_types.h"
2725

2826
#ifndef NO_GRAPHICS
2927

@@ -178,71 +176,65 @@ static void draw_main_canvas(ezgl::renderer* g) {
178176
t_draw_state* draw_state = get_draw_state_vars();
179177

180178
g->set_font_size(14);
181-
if (draw_state->pic_on_screen != e_pic_type::ANALYTICAL_PLACEMENT) {
182-
draw_block_pin_util();
183-
drawplace(g);
184-
draw_internal_draw_subblk(g);
185179

186-
draw_interposer_cuts(g);
180+
draw_interposer_cuts(g);
187181

188-
draw_block_pin_util();
189-
drawplace(g);
190-
draw_internal_draw_subblk(g);
182+
draw_block_pin_util();
183+
drawplace(g);
184+
draw_internal_draw_subblk(g);
191185

192-
if (draw_state->pic_on_screen == e_pic_type::ROUTING) { // ROUTING on screen
186+
if (draw_state->pic_on_screen == e_pic_type::ROUTING) { // ROUTING on screen
193187

194-
draw_rr(g);
188+
draw_rr(g);
195189

196-
if (draw_state->show_nets && draw_state->draw_nets == DRAW_ROUTED_NETS) {
197-
draw_route(ALL_NETS, g);
190+
if (draw_state->show_nets && draw_state->draw_nets == DRAW_ROUTED_NETS) {
191+
draw_route(ALL_NETS, g);
198192

199-
if (draw_state->highlight_fan_in_fan_out) {
200-
draw_route(HIGHLIGHTED, g);
201-
}
193+
if (draw_state->highlight_fan_in_fan_out) {
194+
draw_route(HIGHLIGHTED, g);
202195
}
196+
}
203197

204-
draw_congestion(g);
198+
draw_congestion(g);
205199

206-
draw_routing_costs(g);
200+
draw_routing_costs(g);
207201

208-
draw_router_expansion_costs(g);
202+
draw_router_expansion_costs(g);
209203

210-
draw_routing_util(g);
204+
draw_routing_util(g);
211205

212-
draw_routing_bb(g);
213-
}
206+
draw_routing_bb(g);
207+
}
214208

215-
draw_placement_macros(g);
209+
draw_placement_macros(g);
216210

217211
#ifndef NO_SERVER
218-
if (g_vpr_ctx.server().gate_io.is_running()) {
219-
const ServerContext& server_ctx = g_vpr_ctx.server(); // shortcut
220-
draw_crit_path_elements(server_ctx.crit_paths, server_ctx.crit_path_element_indexes, server_ctx.draw_crit_path_contour, g);
221-
} else {
222-
draw_crit_path(g);
223-
}
224-
#else
212+
if (g_vpr_ctx.server().gate_io.is_running()) {
213+
const ServerContext& server_ctx = g_vpr_ctx.server(); // shortcut
214+
draw_crit_path_elements(server_ctx.crit_paths, server_ctx.crit_path_element_indexes, server_ctx.draw_crit_path_contour, g);
215+
} else {
225216
draw_crit_path(g);
217+
}
218+
#else
219+
draw_crit_path(g);
226220
#endif /* NO_SERVER */
227221

228-
draw_logical_connections(g);
222+
draw_logical_connections(g);
229223

230-
draw_selected_pb_flylines(g);
224+
draw_selected_pb_flylines(g);
231225

232-
draw_noc(g);
226+
draw_noc(g);
233227

234-
if (draw_state->draw_partitions) {
235-
highlight_all_regions(g);
236-
draw_constrained_atoms(g);
237-
}
228+
if (draw_state->draw_partitions) {
229+
highlight_all_regions(g);
230+
draw_constrained_atoms(g);
231+
}
238232

239-
if (draw_state->color_map) {
240-
draw_color_map_legend(*draw_state->color_map, g);
241-
draw_state->color_map.reset(); //Free color map in preparation for next redraw
242-
}
243-
} else {
244-
draw_analytical_place(g);
233+
if (draw_state->color_map) {
234+
draw_color_map_legend(*draw_state->color_map, g);
235+
draw_state->color_map.reset(); //Free color map in preparation for next redraw
245236
}
237+
246238
if (draw_state->auto_proceed) {
247239
//Automatically exit the event loop, so user's don't need to manually click proceed
248240

@@ -298,7 +290,7 @@ void update_screen(ScreenUpdatePriority priority,
298290
* value controls whether or not the Proceed button must be clicked to *
299291
* continue. Saves the pic_on_screen_val to allow pan and zoom redraws. */
300292
t_draw_state* draw_state = get_draw_state_vars();
301-
293+
302294
strcpy(draw_state->default_message, msg);
303295

304296
if (!draw_state->show_graphics)
@@ -314,23 +306,9 @@ void update_screen(ScreenUpdatePriority priority,
314306

315307
state_change = true;
316308

317-
if (draw_state->show_graphics) {
318-
if (pic_on_screen_val == e_pic_type::ANALYTICAL_PLACEMENT) {
319-
set_initial_world_ap();
320-
} else {
321-
set_initial_world();
322-
}
323-
}
324-
325309
if (draw_state->pic_on_screen == e_pic_type::NO_PICTURE) {
326310
// Only add the canvas the first time we open graphics
327311
application.add_canvas("MainCanvas", draw_main_canvas, initial_world);
328-
} else {
329-
// TODO: will this ever be null?
330-
auto canvas = application.get_canvas(application.get_main_canvas_id());
331-
if (canvas != nullptr) {
332-
canvas->get_camera().set_world(initial_world);
333-
}
334312
}
335313

336314
draw_state->setup_timing_info = setup_timing_info;
@@ -510,43 +488,22 @@ void init_draw_coords(float clb_width, const BlkLocRegistry& blk_loc_registry) {
510488
//Margin beyond edge of the drawn device to extend the visible world
511489
//Setting this to > 0.0 means 'Zoom Fit' leave some fraction of white
512490
//space around the device edges
513-
#else
514-
(void)clb_width;
515-
(void)blk_loc_registry;
516-
#endif /* NO_GRAPHICS */
517-
}
518-
519-
#ifndef NO_GRAPHICS
520-
521-
void set_initial_world() {
522491
constexpr float VISIBLE_MARGIN = 0.01;
523-
t_draw_coords* draw_coords = get_draw_coords_vars();
524-
const DeviceContext& device_ctx = g_vpr_ctx.device();
525492

526493
float draw_width = draw_coords->tile_x[grid.width() - 1] + draw_coords->get_tile_width();
527494
float draw_height = draw_coords->tile_y[grid.height() - 1] + draw_coords->get_tile_width();
528495

529496
initial_world = ezgl::rectangle(
530497
{-VISIBLE_MARGIN * draw_width, -VISIBLE_MARGIN * draw_height},
531498
{(1. + VISIBLE_MARGIN) * draw_width, (1. + VISIBLE_MARGIN)
532-
* draw_height});
499+
* draw_height});
500+
#else
501+
(void)clb_width;
502+
(void)blk_loc_registry;
503+
#endif /* NO_GRAPHICS */
533504
}
534505

535-
void set_initial_world_ap() {
536-
constexpr float VISIBLE_MARGIN = 0.01f;
537-
const DeviceContext& device_ctx = g_vpr_ctx.device();
538-
539-
const size_t grid_w = device_ctx.grid.width();
540-
const size_t grid_h = device_ctx.grid.height();
541-
542-
543-
float draw_width = static_cast<float>(grid_w);
544-
float draw_height = static_cast<float>(grid_h);
545-
546-
initial_world = ezgl::rectangle(
547-
{-VISIBLE_MARGIN * draw_width, -VISIBLE_MARGIN * draw_height},
548-
{(1.f + VISIBLE_MARGIN) * draw_width, (1.f + VISIBLE_MARGIN) * draw_height});
549-
}
506+
#ifndef NO_GRAPHICS
550507

551508
int get_track_num(int inode, const vtr::OffsetMatrix<int>& chanx_track, const vtr::OffsetMatrix<int>& chany_track) {
552509
/* Returns the track number of this routing resource node. */
@@ -672,11 +629,6 @@ void act_on_mouse_press(ezgl::application* app, GdkEventButton* event, double x,
672629
* fanins and fanouts are highlighted when you click on a block *
673630
* attached to them. */
674631

675-
if (get_draw_state_vars()->pic_on_screen == e_pic_type::ANALYTICAL_PLACEMENT) {
676-
// No selection in analytical placement mode yet
677-
return;
678-
}
679-
680632
/* Control + mouse click to select multiple nets. */
681633
if (!(event->state & GDK_CONTROL_MASK))
682634
deselect_all();

vpr/src/draw/draw.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,6 @@ void update_screen(ScreenUpdatePriority priority,
5555
*/
5656
void init_draw_coords(float clb_width, const BlkLocRegistry& blk_loc_registry);
5757

58-
/**
59-
* @brief Set the intial_world ezgl::rectangle for analytical placement
60-
*
61-
* This function sets graphic initial dimensions so there are no gaps between blocks
62-
*/
63-
void set_initial_world_ap();
64-
65-
/**
66-
* @brief Set the intial_world ezgl::rectangle for default
67-
*
68-
* This function sets graphic initial dimensions so there are gaps between blocks
69-
*/
70-
void set_initial_world();
71-
7258
/* Sets the static show_graphics and gr_automode variables to the *
7359
* desired values. They control if graphics are enabled and, if so, *
7460
* how often the user is prompted for input. */

0 commit comments

Comments
 (0)