Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c510f7f
updated main.ui
SamuelHo10 Jul 15, 2025
f9beb22
fixed up draw nets
SamuelHo10 Jul 16, 2025
846fdda
modified gui
SamuelHo10 Jul 17, 2025
4815266
Merge branch 'gui_update' of https://github.com/verilog-to-routing/vt…
SamuelHo10 Jul 17, 2025
ae1f04a
created button to turn nets on and off
SamuelHo10 Jul 17, 2025
5044ce1
modified switches
SamuelHo10 Jul 21, 2025
af01423
Merge remote-tracking branch 'origin' into gui_update
SamuelHo10 Aug 7, 2025
22fd264
cleaned up node drawing color code
SamuelHo10 Aug 7, 2025
2b17917
updated main.ui
SamuelHo10 Aug 7, 2025
590d581
connected rr switch
SamuelHo10 Aug 7, 2025
1c72dd5
made general checkbox callback function
SamuelHo10 Aug 8, 2025
c5c1a4d
modified ui
SamuelHo10 Aug 8, 2025
8aa3078
hooked up checkboxes
SamuelHo10 Aug 8, 2025
33597ae
modified ui
SamuelHo10 Aug 8, 2025
49b1785
hooked up booleans to rr_drawing logic
SamuelHo10 Aug 8, 2025
02d17b8
quick fix inter_cluster_edge
SamuelHo10 Aug 8, 2025
3bedb16
updated rrnode highlighting
SamuelHo10 Aug 12, 2025
9381ec3
fixed transparency issue
SamuelHo10 Aug 12, 2025
b93f3e6
updated net alpha, removed unused functions, ensured node highlightin…
SamuelHo10 Aug 13, 2025
a28facd
removed unused images
SamuelHo10 Aug 13, 2025
dfb3cd0
renamed UI
SamuelHo10 Aug 13, 2025
fb4da12
hooked up intracluster and intercluster net buttons
SamuelHo10 Aug 13, 2025
042545a
hooked up highlight fanin fanout
SamuelHo10 Aug 13, 2025
9be453d
moved draw_route function out of draw_rr
SamuelHo10 Aug 13, 2025
7103065
format
SamuelHo10 Aug 13, 2025
b7ec3ea
Merge remote-tracking branch 'origin' into gui_update
SamuelHo10 Aug 13, 2025
c2bfb20
Merge branch 'master' into gui_update
SamuelHo10 Aug 13, 2025
91e8e14
build fix
SamuelHo10 Aug 13, 2025
4cc1f33
Merge branch 'gui_update' of https://github.com/verilog-to-routing/vt…
SamuelHo10 Aug 13, 2025
7c19407
updated submodules
SamuelHo10 Aug 14, 2025
191bdaa
aligned submodules with master
SamuelHo10 Aug 14, 2025
ea6bbc1
replaced auto keyword for context types
SamuelHo10 Aug 15, 2025
3ee7e6e
coding style changes
SamuelHo10 Aug 15, 2025
c0fcfca
format
SamuelHo10 Aug 15, 2025
4700120
fixed node highlighting issues for draw net and draw rr
SamuelHo10 Aug 19, 2025
7fd087f
fixed flylines
SamuelHo10 Aug 19, 2025
d606a5d
format
SamuelHo10 Aug 19, 2025
44a2f9a
changed hit nodes to set
SamuelHo10 Aug 21, 2025
054884c
reworked stage change ui setup functions and enabled show routing opt…
SamuelHo10 Aug 21, 2025
cba0c3c
disabled extra flyline drawing function. drawing nets over rrgraph.
SamuelHo10 Aug 21, 2025
5570e39
updated comments
SamuelHo10 Aug 21, 2025
e164548
format
SamuelHo10 Aug 21, 2025
7c635ba
Merge branch 'master' into gui_update
SamuelHo10 Aug 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
652 changes: 401 additions & 251 deletions vpr/main.ui

Large diffs are not rendered by default.

Binary file removed vpr/src/draw/b.png
Binary file not shown.
58 changes: 26 additions & 32 deletions vpr/src/draw/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,28 +189,21 @@ static void draw_main_canvas(ezgl::renderer* g) {
draw_internal_draw_subblk(g);

if (draw_state->pic_on_screen == PLACEMENT) {
switch (draw_state->show_nets) {
case DRAW_CLUSTER_NETS:
drawnets(g);
break;
case DRAW_PRIMITIVE_NETS:
break;
default:
break;
if (draw_state->draw_nets == DRAW_FLYLINES && draw_state->show_nets) {
drawnets(g);
Comment thread
SamuelHo10 marked this conversation as resolved.
Outdated
}
} else { /* ROUTING on screen */

switch (draw_state->show_nets) {
case DRAW_CLUSTER_NETS:
drawroute(ALL_NETS, g);
break;
case DRAW_PRIMITIVE_NETS:
// fall through
default:
draw_rr(g);
break;
if (draw_state->show_nets && draw_state->draw_nets == DRAW_ROUTED_NETS) {
draw_route(ALL_NETS, g);

if (draw_state->highlight_fan_in_fan_out) {
draw_route(HIGHLIGHTED, g);
}
}

draw_rr(g);

draw_congestion(g);

draw_routing_costs(g);
Expand Down Expand Up @@ -774,22 +767,23 @@ void act_on_mouse_move(ezgl::application* app, GdkEventButton* /* event */, doub
// user has not clicked the window button, in regular mode
t_draw_state* draw_state = get_draw_state_vars();

if (draw_state->draw_rr_toggle != DRAW_NO_RR) {
RRNodeId hit_node = draw_check_rr_node_hit(x, y);
if (!draw_state->show_rr) {
return;
}

if (hit_node) {
//Update message
RRNodeId hit_node = draw_check_rr_node_hit(x, y);

const auto& device_ctx = g_vpr_ctx.device();
std::string info = describe_rr_node(device_ctx.rr_graph, device_ctx.grid, device_ctx.rr_indexed_data, hit_node, draw_state->is_flat);
std::string msg = vtr::string_fmt("Moused over %s", info.c_str());
app->update_message(msg.c_str());
if (hit_node) {
//Update message
const auto& device_ctx = g_vpr_ctx.device();
std::string info = describe_rr_node(device_ctx.rr_graph, device_ctx.grid, device_ctx.rr_indexed_data, hit_node, draw_state->is_flat);
std::string msg = vtr::string_fmt("Moused over %s", info.c_str());
app->update_message(msg.c_str());
} else {
if (!rr_highlight_message.empty()) {
app->update_message(rr_highlight_message.c_str());
} else {
if (!rr_highlight_message.empty()) {
app->update_message(rr_highlight_message.c_str());
} else {
app->update_message(draw_state->default_message);
}
app->update_message(draw_state->default_message);
}
}
}
Expand Down Expand Up @@ -1260,8 +1254,8 @@ static void run_graphics_commands(const std::string& commands) {
} else if (cmd[0] == "set_nets") {
VTR_ASSERT_MSG(cmd.size() == 2,
"Expect net draw state after 'set_nets'");
draw_state->show_nets = (e_draw_nets)vtr::atoi(cmd[1]);
VTR_LOG("%d\n", (int)draw_state->show_nets);
draw_state->draw_nets = (e_draw_nets)vtr::atoi(cmd[1]);
VTR_LOG("%d\n", (int)draw_state->draw_nets);
} else if (cmd[0] == "set_cpd") {
VTR_ASSERT_MSG(cmd.size() == 2,
"Expect cpd draw state after 'set_cpd'");
Expand Down
38 changes: 28 additions & 10 deletions vpr/src/draw/draw_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ void drawnets(ezgl::renderer* g) {
const auto& cluster_ctx = g_vpr_ctx.clustering();
const auto& block_locs = draw_state->get_graphics_blk_loc_registry_ref().block_locs();

float NET_ALPHA = draw_state->net_alpha;

g->set_line_dash(ezgl::line_dash::none);
g->set_line_width(0);

Expand Down Expand Up @@ -244,11 +242,12 @@ void drawnets(ezgl::renderer* g) {
if (!element_visibility.visible) {
continue; /* Don't Draw */
}
float transparency_factor = element_visibility.alpha;

//Take the highest of the 2 transparency values that the user can select from the UI
// Take the highest of the 2 transparency values that the user can select from the UI
// Compare the current cross layer transparency to the overall Net transparency set by the user.
g->set_color(draw_state->net_color[net_id], fmin(transparency_factor, draw_state->net_color[net_id].alpha * NET_ALPHA));
int transparency = std::min(element_visibility.alpha, draw_state->net_color[net_id].alpha * draw_state->net_alpha / 255);

g->set_color(draw_state->net_color[net_id], transparency);

ezgl::point2d sink_center = draw_coords->get_absolute_clb_bbox(b2, cluster_ctx.clb_nlist.block_type(b2)).center();
g->draw_line(driver_center, sink_center);
Expand Down Expand Up @@ -320,7 +319,7 @@ void draw_congestion(ezgl::renderer* g) {
}
}
g->set_line_width(0);
drawroute(HIGHLIGHTED, g);
draw_route(HIGHLIGHTED, g);

//Reset colors
for (RRNodeId inode : congested_rr_nodes) {
Expand Down Expand Up @@ -534,18 +533,16 @@ void draw_x(float x, float y, float size, ezgl::renderer* g) {
/* Draws the nets in the positions fixed by the router. If draw_net_type is *
* ALL_NETS, draw all the nets. If it is HIGHLIGHTED, draw only the nets *
* that are not coloured black (useful for drawing over the rr_graph). */
void drawroute(enum e_draw_net_type draw_net_type, ezgl::renderer* g) {
void draw_route(enum e_draw_net_type draw_net_type, ezgl::renderer* g) {
/* Next free track in each channel segment if routing is GLOBAL */

auto& cluster_ctx = g_vpr_ctx.clustering();
const AtomContext& atom_ctx = g_vpr_ctx.atom();

t_draw_state* draw_state = get_draw_state_vars();

float NET_ALPHA = draw_state->net_alpha;

g->set_line_dash(ezgl::line_dash::none);
g->set_color(ezgl::BLACK, ezgl::BLACK.alpha * NET_ALPHA);
g->set_color(ezgl::BLACK, draw_state->net_alpha);

/* Now draw each net, one by one. */
if (draw_state->is_flat) {
Expand Down Expand Up @@ -609,19 +606,40 @@ void draw_routed_net(ParentNetId net_id, ezgl::renderer* g) {
//Draws the set of rr_nodes specified, using the colors set in draw_state
void draw_partial_route(const std::vector<RRNodeId>& rr_nodes_to_draw, ezgl::renderer* g) {
t_draw_state* draw_state = get_draw_state_vars();
auto& rr_graph = g_vpr_ctx.device().rr_graph;
Comment thread
SamuelHo10 marked this conversation as resolved.
Outdated

// Draw RR Nodes
for (size_t i = 1; i < rr_nodes_to_draw.size(); ++i) {
RRNodeId inode = rr_nodes_to_draw[i];
ezgl::color color = draw_state->draw_rr_node[inode].color;

bool inter_cluster_node = is_inter_cluster_node(rr_graph, inode);

if (inter_cluster_node && !draw_state->draw_inter_cluster_nets) {
continue;
}

if (!inter_cluster_node && !draw_state->draw_intra_cluster_nets) {
Comment thread
SamuelHo10 marked this conversation as resolved.
Outdated
continue;
}

draw_rr_node(inode, color, g);
}

// Draw Edges
for (size_t i = 1; i < rr_nodes_to_draw.size(); ++i) {
RRNodeId inode = rr_nodes_to_draw[i];
RRNodeId prev_node = rr_nodes_to_draw[i - 1];
bool inter_cluster_node = is_inter_cluster_node(rr_graph, inode);
bool prev_inter_cluster_node = is_inter_cluster_node(rr_graph, prev_node);

if ((inter_cluster_node && prev_inter_cluster_node) && !draw_state->draw_inter_cluster_nets) {
continue;
}

if ((!inter_cluster_node || !prev_inter_cluster_node) && !draw_state->draw_intra_cluster_nets) {
Comment thread
SamuelHo10 marked this conversation as resolved.
Outdated
continue;
}

draw_rr_edge(inode, prev_node, draw_state->draw_rr_node[inode].color, g);
}
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/draw/draw_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void draw_x(float x, float y, float size, ezgl::renderer* g);
/* Draws the nets in the positions fixed by the router. If draw_net_type is *
* ALL_NETS, draw all the nets. If it is HIGHLIGHTED, draw only the nets *
* that are not coloured black (useful for drawing over the rr_graph). */
void drawroute(enum e_draw_net_type draw_net_type, ezgl::renderer* g);
void draw_route(enum e_draw_net_type draw_net_type, ezgl::renderer* g);

void draw_routed_net(ParentNetId net, ezgl::renderer* g);

Expand Down
Loading