Skip to content

Commit 0be7746

Browse files
committed
format
1 parent e51cf20 commit 0be7746

File tree

8 files changed

+34
-39
lines changed

8 files changed

+34
-39
lines changed

vpr/src/draw/draw_basic.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ void draw_partial_route(const std::vector<RRNodeId>& rr_nodes_to_draw, ezgl::ren
627627
}
628628

629629
// Skip drawing sources and sinks
630-
if (rr_type == e_rr_type::SINK || rr_type == e_rr_type::SOURCE){
630+
if (rr_type == e_rr_type::SINK || rr_type == e_rr_type::SOURCE) {
631631
continue;
632632
}
633633

@@ -716,8 +716,8 @@ void draw_partial_route(const std::vector<RRNodeId>& rr_nodes_to_draw, ezgl::ren
716716
}
717717
default: {
718718
VPR_ERROR(VPR_ERROR_OTHER,
719-
"Unexpected connection from an rr_node of type %d to one of type %d.\n",
720-
prev_type, rr_type);
719+
"Unexpected connection from an rr_node of type %d to one of type %d.\n",
720+
prev_type, rr_type);
721721
}
722722
}
723723
break;
@@ -726,12 +726,12 @@ void draw_partial_route(const std::vector<RRNodeId>& rr_nodes_to_draw, ezgl::ren
726726
switch (prev_type) {
727727
case e_rr_type::CHANX: {
728728
draw_chanx_to_chany_edge(prev_node, inode,
729-
FROM_X_TO_Y, switch_type, g);
729+
FROM_X_TO_Y, switch_type, g);
730730
break;
731731
}
732732
case e_rr_type::CHANY: {
733733
draw_chany_to_chany_edge(RRNodeId(prev_node), RRNodeId(inode),
734-
switch_type, g);
734+
switch_type, g);
735735
break;
736736
}
737737
case e_rr_type::OPIN: {
@@ -741,8 +741,8 @@ void draw_partial_route(const std::vector<RRNodeId>& rr_nodes_to_draw, ezgl::ren
741741
}
742742
default: {
743743
VPR_ERROR(VPR_ERROR_OTHER,
744-
"Unexpected connection from an rr_node of type %d to one of type %d.\n",
745-
prev_type, rr_type);
744+
"Unexpected connection from an rr_node of type %d to one of type %d.\n",
745+
prev_type, rr_type);
746746
}
747747
}
748748
break;

vpr/src/draw/draw_rr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ void draw_rr_intrapin(RRNodeId inode, const ezgl::color& color, ezgl::renderer*
517517
t_draw_state* draw_state = get_draw_state_vars();
518518
t_draw_coords* draw_coords = get_draw_coords_vars();
519519

520-
if(!draw_state->is_flat){
520+
if (!draw_state->is_flat) {
521521
return;
522522
}
523523

@@ -713,7 +713,7 @@ RRNodeId draw_check_rr_node_hit(float click_x, float click_y) {
713713
// Check for intra cluster nodes
714714
if (!is_inter_cluster_node(rr_graph, inode)) {
715715

716-
if(!draw_state->is_flat){
716+
if (!draw_state->is_flat) {
717717
continue;
718718
}
719719

vpr/src/draw/draw_rr_edges.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void draw_intrapin_to_intrapin(RRNodeId inode, RRNodeId prev_node, ezgl::rendere
283283
t_draw_state* draw_state = get_draw_state_vars();
284284
t_draw_coords* draw_coords = get_draw_coords_vars();
285285

286-
if(!draw_state->is_flat){
286+
if (!draw_state->is_flat) {
287287
return;
288288
}
289289

@@ -304,7 +304,7 @@ void draw_intrapin_to_pin(RRNodeId inode, RRNodeId prev_node, ezgl::renderer* g)
304304
t_draw_state* draw_state = get_draw_state_vars();
305305
t_draw_coords* draw_coords = get_draw_coords_vars();
306306

307-
if(!draw_state->is_flat){
307+
if (!draw_state->is_flat) {
308308
return;
309309
}
310310
const auto& rr_graph = g_vpr_ctx.device().rr_graph;
@@ -319,7 +319,6 @@ void draw_intrapin_to_pin(RRNodeId inode, RRNodeId prev_node, ezgl::renderer* g)
319319
auto blk_id_pin_id = get_rr_node_cluster_blk_id_pb_graph_pin(prev_node);
320320
float x1, y1;
321321
ezgl::point2d p2 = draw_coords->get_absolute_pin_location(blk_id_pin_id.first, blk_id_pin_id.second);
322-
323322

324323
for (const e_side& pin_side : TOTAL_2D_SIDES) {
325324
if (!rr_graph.is_node_on_specific_side(RRNodeId(inode), pin_side)) {
@@ -337,7 +336,6 @@ void draw_intrapin_to_pin(RRNodeId inode, RRNodeId prev_node, ezgl::renderer* g)
337336
float yend = p2.y + (p1.y - p2.y) / 10.;
338337
draw_triangle_along_line(g, xend, yend, p1.x, p2.x, p1.y, p2.y);
339338
}
340-
341339
}
342340

343341
void draw_pin_to_pin(RRNodeId opin_node, RRNodeId ipin_node, ezgl::renderer* g) {

vpr/src/draw/draw_searchbar.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,22 +140,21 @@ void highlight_net(char* message, RRNodeId hit_node) {
140140
if (route_ctx.route_trees.empty())
141141
return;
142142

143-
if (route_ctx.is_flat){
144-
for (auto net_id : atom_ctx.netlist().nets()){
143+
if (route_ctx.is_flat) {
144+
for (auto net_id : atom_ctx.netlist().nets()) {
145145
check_node_highlight_net(message, net_id, hit_node);
146-
}
146+
}
147147

148-
} else{
148+
} else {
149149
for (auto net_id : cluster_ctx.clb_nlist.nets()) {
150150
check_node_highlight_net(message, net_id, hit_node);
151151
}
152152
}
153-
153+
154154
application.update_message(message);
155155
}
156156

157-
void check_node_highlight_net(char* message, ParentNetId parent_id,
158-
RRNodeId hit_node) {
157+
void check_node_highlight_net(char* message, ParentNetId parent_id, RRNodeId hit_node) {
159158
auto& route_ctx = g_vpr_ctx.routing();
160159
t_draw_state* draw_state = get_draw_state_vars();
161160

@@ -168,8 +167,8 @@ void check_node_highlight_net(char* message, ParentNetId parent_id,
168167
draw_state->net_color[parent_id] = draw_state->draw_rr_node[inode].color;
169168
if (inode == hit_node) {
170169
std::string orig_msg(message);
171-
std::string net_name;
172-
if(!route_ctx.is_flat){
170+
std::string net_name;
171+
if (!route_ctx.is_flat) {
173172
net_name = g_vpr_ctx.clustering().clb_nlist.net_name(convert_to_cluster_net_id(parent_id));
174173
} else {
175174
net_name = g_vpr_ctx.atom().netlist().net_name(convert_to_atom_net_id(parent_id));
@@ -179,7 +178,7 @@ void check_node_highlight_net(char* message, ParentNetId parent_id,
179178
net_name.c_str());
180179
}
181180
} else if (draw_state->draw_rr_node[inode].color
182-
== ezgl::WHITE) {
181+
== ezgl::WHITE) {
183182
// If node is de-selected.
184183
draw_state->net_color[parent_id] = ezgl::BLACK;
185184
break;

vpr/src/draw/draw_searchbar.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ void draw_highlight_blocks_color(t_logical_block_type_ptr type, ClusterBlockId b
3131
void highlight_net(char* message, RRNodeId hit_node);
3232

3333
/* Checks if a node is part of a net, and highlights the net if it is. */
34-
void check_node_highlight_net(char* message, ParentNetId parent_id,
35-
RRNodeId hit_node);
34+
void check_node_highlight_net(char* message, ParentNetId parent_id, RRNodeId hit_node);
3635

3736
/* If an rr_node has been clicked on, it will be either highlighted in MAGENTA,
3837
* or de-highlighted in WHITE. If highlighted, and toggle_rr is selected, highlight

vpr/src/draw/draw_types.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,20 @@ ezgl::rectangle t_draw_coords::get_absolute_pb_bbox(const ClusterBlockId clb_ind
151151
return result;
152152
}
153153

154-
ezgl::point2d t_draw_coords::get_absolute_pin_location( const ClusterBlockId clb_index,const t_pb_graph_pin* pb_graph_pin) {
154+
ezgl::point2d t_draw_coords::get_absolute_pin_location(const ClusterBlockId clb_index, const t_pb_graph_pin* pb_graph_pin) {
155155

156156
t_pb_graph_node* pb_gnode = pb_graph_pin->parent_node;
157157
ezgl::rectangle pb_bbox = this->get_absolute_pb_bbox(clb_index, pb_gnode);
158158
int num_pins = pb_gnode->num_pins();
159159

160160
int num_pin = pb_graph_pin->pin_number;
161-
for(int i=0;i<pb_graph_pin->port->index; ++i){
161+
for (int i = 0; i < pb_graph_pin->port->index; ++i) {
162162
num_pin += pb_gnode->pb_type->ports[i].num_pins;
163163
}
164164

165165
float interval = pb_bbox.width() / (num_pins + 1);
166166

167-
return ezgl::point2d(interval * (num_pin + 1), -0.01 *this->tile_width) + pb_bbox.top_left();
167+
return ezgl::point2d(interval * (num_pin + 1), -0.01 * this->tile_width) + pb_bbox.top_left();
168168
}
169169

170170
ezgl::rectangle t_draw_coords::get_absolute_clb_bbox(const ClusterBlockId clb_index, const t_logical_block_type_ptr block_type) {

vpr/src/draw/intra_logic_block.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,15 @@ static void draw_internal_load_coords(int type_descrip_index, t_pb_graph_node* p
241241

242242
// determine an optimal number of columns
243243
int num_columns = 1;
244-
for(int k = 1; k * k <= num_blocks; ++k) {
245-
if(num_blocks % k == 0) {
244+
for (int k = 1; k * k <= num_blocks; ++k) {
245+
if (num_blocks % k == 0) {
246246
num_columns = k;
247247
}
248248
}
249249
int num_rows = num_blocks / num_columns;
250250

251251
const int MAX_WIDTH_HEIGHT_RATIO = 2;
252-
if(parent_width > parent_height * MAX_WIDTH_HEIGHT_RATIO){
252+
if (parent_width > parent_height * MAX_WIDTH_HEIGHT_RATIO) {
253253
std::swap(num_columns, num_rows);
254254
}
255255

@@ -287,23 +287,23 @@ draw_internal_calc_coords(int type_descrip_index, t_pb_graph_node* pb_graph_node
287287
const float FRACTION_PARENT_PADDING = 0.005;
288288
const float FRACTION_CHILD_MARGIN = 0.003;
289289
const float FRACTION_TEXT_PADDING = 0.01;
290-
const int MIN_WIDTH_HEIGHT_RATIO = 2;
290+
const int MIN_WIDTH_HEIGHT_RATIO = 2;
291291

292292
float abs_parent_padding = tile_width * FRACTION_PARENT_PADDING;
293293
float abs_text_padding = tile_width * FRACTION_TEXT_PADDING;
294294
float abs_child_margin = tile_width * FRACTION_CHILD_MARGIN;
295295

296296
// add safety check to ensure that the dimensions will never be below zero
297-
if (parent_width <= 2* abs_parent_padding || parent_height <= 2 * abs_parent_padding - abs_text_padding) {
297+
if (parent_width <= 2 * abs_parent_padding || parent_height <= 2 * abs_parent_padding - abs_text_padding) {
298298
abs_parent_padding = 0;
299299
abs_text_padding = 0;
300300
}
301301

302302
/* Draw all child-level blocks in just most of the space inside their parent block. */
303-
float parent_drawing_width = parent_width - 2* abs_parent_padding;
303+
float parent_drawing_width = parent_width - 2 * abs_parent_padding;
304304
float parent_drawing_height = parent_height - 2 * abs_parent_padding - abs_text_padding;
305305

306-
if(parent_drawing_height > MIN_WIDTH_HEIGHT_RATIO * parent_drawing_width) {
306+
if (parent_drawing_height > MIN_WIDTH_HEIGHT_RATIO * parent_drawing_width) {
307307
parent_drawing_height /= 2;
308308
}
309309

@@ -314,15 +314,14 @@ draw_internal_calc_coords(int type_descrip_index, t_pb_graph_node* pb_graph_node
314314
float child_height = parent_drawing_height / num_rows;
315315

316316
// add safety check to ensure that the dimensions will never be below zero
317-
if(child_width <= abs_child_margin * 2 || child_height <= abs_child_margin * 2) {
317+
if (child_width <= abs_child_margin * 2 || child_height <= abs_child_margin * 2) {
318318
abs_child_margin = 0;
319319
}
320320

321321
/* The starting point to draw the physical block. */
322322
double left = child_width * x_index + abs_parent_padding + abs_child_margin;
323323
double bot = child_height * y_index + abs_parent_padding + abs_child_margin;
324324

325-
326325
child_width -= abs_child_margin * 2;
327326
child_height -= abs_child_margin * 2;
328327

vpr/src/util/vpr_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ AtomPinId find_atom_pin(ClusterBlockId blk_id, const t_pb_graph_pin* pb_gpin) {
879879
atom_pin = pin;
880880
}
881881
}
882-
882+
883883
VTR_ASSERT(atom_pin);
884884

885885
return atom_pin;
@@ -1774,7 +1774,7 @@ std::pair<ClusterBlockId, t_pb_graph_pin*> get_rr_node_cluster_blk_id_pb_graph_p
17741774
ClusterBlockId blk_id = place_ctx.grid_blocks().block_at_location({x, y, sub_tile_num, layer});
17751775
VTR_ASSERT(blk_id != ClusterBlockId::INVALID());
17761776

1777-
t_pb_graph_pin* pb_graph_pin = physical_tile->pin_num_to_pb_pin.at(pin_physical_num);
1777+
t_pb_graph_pin* pb_graph_pin = physical_tile->pin_num_to_pb_pin.at(pin_physical_num);
17781778

17791779
VTR_ASSERT(pb_graph_pin);
17801780

0 commit comments

Comments
 (0)