Skip to content

Commit 9c0e910

Browse files
authored
Merge pull request #2468 from verilog-to-routing/net_max_fanout_issue
Net max fanout issue in Net Settings graphics
2 parents c8bd8b1 + a72a5f4 commit 9c0e910

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

vpr/src/draw/draw.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static void set_block_outline(GtkWidget* widget, gint /*response_id*/, gpointer
129129
static void set_block_text(GtkWidget* widget, gint /*response_id*/, gpointer /*data*/);
130130
static void set_draw_partitions(GtkWidget* widget, gint /*response_id*/, gpointer /*data*/);
131131
static void clip_routing_util(GtkWidget* widget, gint /*response_id*/, gpointer /*data*/);
132-
static void run_graphics_commands(std::string commands);
132+
static void run_graphics_commands(const std::string& commands);
133133

134134
/************************** File Scope Variables ****************************/
135135

@@ -1245,7 +1245,7 @@ static void set_force_pause(GtkWidget* /*widget*/, gint /*response_id*/, gpointe
12451245
draw_state->forced_pause = true;
12461246
}
12471247

1248-
static void run_graphics_commands(std::string commands) {
1248+
static void run_graphics_commands(const std::string& commands) {
12491249
//A very simmple command interpreter for scripting graphics
12501250
t_draw_state* draw_state = get_draw_state_vars();
12511251

vpr/src/draw/draw_basic.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,21 @@ void drawnets(ezgl::renderer* g) {
245245
* blocks (or sub blocks in the case of IOs). */
246246

247247
for (auto net_id : cluster_ctx.clb_nlist.nets()) {
248-
if (cluster_ctx.clb_nlist.net_is_ignored(net_id))
248+
if (cluster_ctx.clb_nlist.net_is_ignored(net_id)) {
249249
continue; /* Don't draw */
250+
}
251+
252+
if ((int)cluster_ctx.clb_nlist.net_pins(net_id).size() - 1 > draw_state->draw_net_max_fanout) {
253+
continue;
254+
}
250255

251256
b1 = cluster_ctx.clb_nlist.net_driver_block(net_id);
252257

253258
//The layer of the net driver block
254259
driver_block_layer_num = place_ctx.block_locs[b1].loc.layer;
255260

256261
//To only show nets that are connected to currently active layers on the screen
257-
if (draw_state->draw_layer_display[driver_block_layer_num].visible == false) {
262+
if (!draw_state->draw_layer_display[driver_block_layer_num].visible) {
258263
continue; /* Don't draw */
259264
}
260265

vpr/src/draw/intra_logic_block.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ void draw_logical_connections(ezgl::renderer* g) {
570570

571571
// iterate over all the atom nets
572572
for (auto net_id : atom_ctx.nlist.nets()) {
573-
if ((int)atom_ctx.nlist.net_pins(net_id).size() > draw_state->draw_net_max_fanout) {
573+
if ((int)atom_ctx.nlist.net_pins(net_id).size() - 1 > draw_state->draw_net_max_fanout) {
574574
continue;
575575
}
576576

@@ -919,7 +919,7 @@ bool t_selected_sub_block_info::gnode_clb_pair::operator==(const gnode_clb_pair&
919919
* @param pb current node to be examined
920920
* @return t_pb* t_pb ptr of block w. name "name". Returns nullptr if nothing found
921921
*/
922-
t_pb* find_atom_block_in_pb(std::string name, t_pb* pb) {
922+
t_pb* find_atom_block_in_pb(const std::string& name, t_pb* pb) {
923923
//Checking if block is one being searched for
924924
std::string pbName(pb->name);
925925
if (pbName == name)

vpr/src/draw/intra_logic_block.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void draw_logical_connections(ezgl::renderer* g);
138138
void find_pin_index_at_model_scope(const AtomPinId the_pin, const AtomBlockId lblk, int* pin_index, int* total_pins);
139139

140140
//Returns pb ptr of given atom block name, given the pb of its containing block. Returns null if nothing found
141-
t_pb* find_atom_block_in_pb(std::string name, t_pb* pb);
141+
t_pb* find_atom_block_in_pb(const std::string& name, t_pb* pb);
142142

143143
#endif /* NO_GRAPHICS */
144144

0 commit comments

Comments
 (0)