Skip to content

Commit

Permalink
Merge pull request #2865 from verilog-to-routing/routing_graphics_tog…
Browse files Browse the repository at this point in the history
…gle_segfault

Fixed segfault in draw_routing_costs
  • Loading branch information
vaughnbetz authored Jan 17, 2025
2 parents 3f60382 + 38a4f11 commit b8c1ef1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vpr/src/draw/draw_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,14 @@ void draw_routing_costs(ezgl::renderer* g) {
auto& device_ctx = g_vpr_ctx.device();
auto& route_ctx = g_vpr_ctx.routing();
g->set_line_width(0);

VTR_ASSERT(!route_ctx.rr_node_route_inf.empty());

float min_cost = std::numeric_limits<float>::infinity();
float max_cost = -min_cost;
vtr::vector<RRNodeId, float> rr_node_costs(0.);

size_t node_count = device_ctx.rr_graph.nodes().size();
vtr::vector<RRNodeId, float> rr_node_costs(node_count, 0.);

for (const RRNodeId inode : device_ctx.rr_graph.nodes()) {
float cost = 0.;
Expand Down

0 comments on commit b8c1ef1

Please sign in to comment.