Skip to content

Commit 591c477

Browse files
author
Paula
committed
Checking if the move genrator handles DSP and RAM block movements
1 parent 3bbbfe3 commit 591c477

File tree

6 files changed

+22
-93
lines changed

6 files changed

+22
-93
lines changed

vpr/main.ui

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -230,26 +230,6 @@
230230
<property name="height">1</property>
231231
</packing>
232232
</child>
233-
<!--new code added for manual move starts here-->
234-
<child>
235-
<object class="GtkCheckButton" id="manualMove">
236-
<property name="label" translatable="yes">Manual Move</property> <property name="visible">True</property>
237-
<property name="can focus">True</property>
238-
<property name="receives default">False</property>
239-
<property name="xalign">0</property>
240-
<property name="active">False</property>
241-
<property name="draw_indicator">True</property>
242-
</object>
243-
<packing>
244-
<property name="left_attach">0</property>
245-
<property name="top_attach">3</property>
246-
<property name="width">1</property>
247-
<property name="height">1</property>
248-
</packing>
249-
</child>
250-
251-
252-
253233
<child>
254234
<object class="GtkCheckButton" id="clipRoutingUtil">
255235
<property name="label" translatable="yes">Clip Routing Util</property>

vpr/src/draw/draw.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -197,32 +197,16 @@ static void set_block_text(GtkWidget *widget, gint /*response_id*/,
197197
gpointer /*data*/);
198198
static void clip_routing_util(GtkWidget *widget, gint /*response_id*/,
199199
gpointer /*data*/);
200-
static void manual_moves_callback(GtkWidget *widget, gint /*response_id*/,
201-
gpointer /*data*/, ezgl::application *app);
202200
static void run_graphics_commands(std::string commands);
203201

204-
<<<<<<< HEAD
205-
=======
206-
//Manual moves generator functions
207-
void manual_move_generator_window();
208-
void move_generator_button_callback(GtkWidget* /*widget*/, GtkWidget* grid);
209202

210-
>>>>>>> 69d872953e314b4bc008b304a5aa8f7e510b6a86
211203
/************************** File Scope Variables ****************************/
212204

213205
//The arrow head position for turning/straight-thru connections in a switch box
214206
constexpr float SB_EDGE_TURN_ARROW_POSITION = 0.2;
215207
constexpr float SB_EDGE_STRAIGHT_ARROW_POSITION = 0.95;
216208
constexpr float EMPTY_BLOCK_LIGHTEN_FACTOR = 0.20;
217209

218-
//struct that contains information about manual moves for drawing
219-
struct ManualMovesGlobal {
220-
manual_move_info draw_manual_move_info;
221-
GtkWidget* manual_move_window;
222-
//Considering adding more informtion if needed*****
223-
};
224-
225-
226210

227211
//Kelly's maximum contrast colors are selected to be easily distinguishable as described in:
228212
// Kenneth Kelly, "Twenty-Two Colors of Maximum Contrast", Color Eng. 3(6), 1943
@@ -4570,16 +4554,6 @@ static void setup_default_ezgl_callbacks(ezgl::application *app) {
45704554
GObject *debugger = app->get_object("debugButton");
45714555
g_signal_connect(debugger, "clicked", G_CALLBACK(draw_debug_window), NULL);
45724556

4573-
<<<<<<< HEAD
4574-
=======
4575-
// Connect Debug Button
4576-
GObject* debugger = app->get_object("debugButton");
4577-
g_signal_connect(debugger, "clicked", G_CALLBACK(draw_debug_window), NULL);
4578-
4579-
//Manual Moves Button
4580-
GObject* manual_moves = app->get_object("manualMove");
4581-
g_signal_connect(manual_moves, "toggled", G_CALLBACK(move_generator_button_callback), app);
4582-
>>>>>>> 69d872953e314b4bc008b304a5aa8f7e510b6a86
45834557
}
45844558

45854559
// Callback function for Block Outline checkbox
@@ -4647,11 +4621,6 @@ void net_max_fanout(GtkWidget* /*widget*/, gint /*response_id*/,
46474621
application.refresh_drawing();
46484622
}
46494623

4650-
bool get_manual_move_flag() {
4651-
GObject *manual_moves = application.get_object("manualMove");
4652-
return gtk_toggle_button_get_active((GtkToggleButton*) manual_moves);
4653-
}
4654-
46554624
static void set_force_pause(GtkWidget* /*widget*/, gint /*response_id*/,
46564625
gpointer /*data*/) {
46574626
t_draw_state *draw_state = get_draw_state_vars();

vpr/src/draw/draw.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ void clear_colored_locations();
103103
// otherwise, the function returns false (the location isn't among the highlighted locations)
104104
bool highlight_loc_with_specific_color(int x, int y, ezgl::color& loc_color);
105105

106-
//Returns if the option for manual moves has been activated or not. Useful for place.cpp file.
107-
bool get_manual_move_flag();
108-
109106
#endif /* NO_GRAPHICS */
110107

111108
#endif /* DRAW_H */

vpr/src/draw/manual_moves.cpp

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ void draw_manual_moves_window(std::string block_id) {
4141
GtkWidget *calculate_cost_button = gtk_button_new_with_label("Calculate Costs");
4242

4343
//Add all to grid
44-
gtk_grid_attach((GtkGrid*) grid, block_label, 0, 0, 1, 1);
45-
gtk_grid_attach((GtkGrid*) grid, block_entry, 0, 1, 1, 1);
46-
gtk_grid_attach((GtkGrid*) grid, to_label, 2, 0, 1, 1);
47-
gtk_grid_attach((GtkGrid*) grid, x, 1, 1, 1, 1);
48-
gtk_grid_attach((GtkGrid*) grid, x_position_entry, 2, 1, 1, 1);
49-
gtk_grid_attach((GtkGrid*) grid, y, 1, 2, 1, 1);
50-
gtk_grid_attach((GtkGrid*) grid, y_position_entry, 2, 2, 1, 1);
51-
gtk_grid_attach((GtkGrid*) grid, subtile, 1, 3, 1, 1);
52-
gtk_grid_attach((GtkGrid*) grid, subtile_position_entry, 2, 3, 1, 1);
53-
gtk_grid_attach((GtkGrid*) grid, calculate_cost_button, 0, 4, 3, 1); //spans three columns
44+
gtk_grid_attach((GtkGrid*)grid, block_label, 0, 0, 1, 1);
45+
gtk_grid_attach((GtkGrid*)grid, block_entry, 0, 1, 1, 1);
46+
gtk_grid_attach((GtkGrid*)grid, to_label, 2, 0, 1, 1);
47+
gtk_grid_attach((GtkGrid*)grid, x, 1, 1, 1, 1);
48+
gtk_grid_attach((GtkGrid*)grid, x_position_entry, 2, 1, 1, 1);
49+
gtk_grid_attach((GtkGrid*)grid, y, 1, 2, 1, 1);
50+
gtk_grid_attach((GtkGrid*)grid, y_position_entry, 2, 2, 1, 1);
51+
gtk_grid_attach((GtkGrid*)grid, subtile, 1, 3, 1, 1);
52+
gtk_grid_attach((GtkGrid*)grid, subtile_position_entry, 2, 3, 1, 1);
53+
gtk_grid_attach((GtkGrid*)grid, calculate_cost_button, 0, 4, 3, 1); //spans three columns
5454

5555
//Set margins
5656
gtk_widget_set_margin_bottom(grid, 20);
@@ -73,7 +73,7 @@ void draw_manual_moves_window(std::string block_id) {
7373
}
7474
}
7575

76-
void calculate_cost_callback(GtkWidget* /*widget*/, GtkWidget *grid) {
76+
void calculate_cost_callback(GtkWidget* /*widget*/, GtkWidget* grid) {
7777

7878
int block_id;
7979
int x_location;
@@ -92,9 +92,7 @@ void calculate_cost_callback(GtkWidget* /*widget*/, GtkWidget *grid) {
9292
if (string_is_a_number(block_id_string)) { //for block ID
9393
block_id = std::atoi(block_id_string.c_str());
9494
} else { //for block name
95-
block_id = size_t(
96-
cluster_ctx.clb_nlist.find_block(
97-
gtk_entry_get_text((GtkEntry*) block_entry)));
95+
block_id = size_t(cluster_ctx.clb_nlist.find_block(gtk_entry_get_text((GtkEntry*) block_entry)));
9896
}
9997
//if the block is not found
10098
if ((!cluster_ctx.clb_nlist.valid_block_id(ClusterBlockId(block_id)))) {
@@ -104,8 +102,7 @@ void calculate_cost_callback(GtkWidget* /*widget*/, GtkWidget *grid) {
104102

105103
GtkWidget *x_position_entry = gtk_grid_get_child_at((GtkGrid*) grid, 2, 1);
106104
GtkWidget *y_position_entry = gtk_grid_get_child_at((GtkGrid*) grid, 2, 2);
107-
GtkWidget *subtile_position_entry = gtk_grid_get_child_at((GtkGrid*) grid,
108-
2, 3);
105+
GtkWidget *subtile_position_entry = gtk_grid_get_child_at((GtkGrid*) grid, 2, 3);
109106

110107
x_location = std::atoi(gtk_entry_get_text((GtkEntry*) x_position_entry));
111108
y_location = std::atoi(gtk_entry_get_text((GtkEntry*) y_position_entry));
@@ -119,10 +116,8 @@ void calculate_cost_callback(GtkWidget* /*widget*/, GtkWidget *grid) {
119116
//If the block requested is already in that location.
120117
ClusterBlockId current_block = ClusterBlockId(block_id);
121118
t_pl_loc current_block_loc = place_ctx.block_locs[current_block].loc;
122-
if (x_location == current_block_loc.x && y_location == current_block_loc.y
123-
&& subtile_location == current_block_loc.sub_tile) {
124-
invalid_breakpoint_entry_window(
125-
"The block is currently in this location");
119+
if (x_location == current_block_loc.x && y_location == current_block_loc.y && subtile_location == current_block_loc.sub_tile) {
120+
invalid_breakpoint_entry_window("The block is currently in this location");
126121
valid_input = false;
127122
}
128123
//Checks if all fields from the user input window are complete.
@@ -162,10 +157,16 @@ bool string_is_a_number(std::string block_id) {
162157
return true;
163158
}
164159

160+
bool get_manual_move_flag() {
161+
GObject *manual_moves = application.get_object("manualMove");
162+
return gtk_toggle_button_get_active((GtkToggleButton*) manual_moves);
163+
}
164+
165165
ManualMovesGlobals* get_manual_moves_global() {
166166
return &manual_moves_global;
167167
}
168168

169+
169170
//Manual Move Generator function
170171
e_create_move ManualMoveGenerator::propose_move(
171172
t_pl_blocks_to_be_moved &blocks_affected, float /*rlim*/) {

vpr/src/draw/manual_moves.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void draw_manual_moves_window(std::string block_id);
5454
void close_manual_moves_window();
5555
void calculate_cost_callback(GtkWidget* /*widget*/, GtkWidget* grid);
5656
bool string_is_a_number(std::string block_id);
57+
bool get_manual_move_flag();
5758
void cost_summary_dialog();
5859
ManualMovesGlobals* get_manual_moves_global();
5960
void update_manual_move_costs(double d_cost, double d_timing, double d_bounding_box, e_move_result& move_outcome);

vpr/src/place/move_utils.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -171,25 +171,6 @@ void compressed_grid_to_loc(t_logical_block_type_ptr blk_type, int cx, int cy, t
171171
*/
172172
bool find_compatible_compressed_loc_in_range(t_logical_block_type_ptr type, int min_cx, int max_cx, int min_cy, int max_cy, int delta_cx, int cx_from, int cy_from, int& cx_to, int& cy_to, bool is_median);
173173

174-
<<<<<<< HEAD
175174
std::string e_move_result_to_string(e_move_result move_outcome);
176-
=======
177-
//Manual moves struct: Contains the values needed for a manual move (e.g. block_ID, block_name, x_position, y_position, cost, timing, if input is valid, and if the move is acepted.
178-
struct manual_move_info {
179-
int block_id = -1;
180-
std::string block_name = NULL;
181-
int x_position = -1;
182-
int y_position = -1;
183-
float delta_cost = 0;
184-
float delta_timing = 0;
185-
bool valid_input = true;
186-
e_move_result user_move_outcome = ABORTED;
187-
e_move_result placer_move_outcome = ABORTED;
188-
//considering adding more attributes needed for manual moves******
189-
};
190-
191-
192-
193-
>>>>>>> 69d872953e314b4bc008b304a5aa8f7e510b6a86
194175

195176
#endif

0 commit comments

Comments
 (0)