Skip to content

Conversation

robluo
Copy link
Contributor

@robluo robluo commented Sep 12, 2025

Analytical placement update clustering global context later compared to original placement, but the graphic resources are initialized earlier in vpr flow. This causes a segmentation fault when enabling both display on and analytical place.
This PR fixes the issue.

Description

Resized graphic resources (block_color and net_color) in post_place_sync().

Related Issue

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

updated the size of some graphics resources after ap
@github-actions github-actions bot added VPR VPR FPGA Placement & Routing Tool lang-cpp C/C++ code labels Sep 12, 2025
#ifndef NO_GRAPHICS
// update graphic resources incase of clustering changes
if (get_draw_state_vars()) {
get_draw_state_vars()->refresh_graphic_resources_after_cluster_change();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this bit of code belongs in this function. I recommend moving it somewhere else. Perhaps even into its own function. Post-place sync is not doing things related to drawing directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this to a full legalizer member function and it is called at the end of all versions of legalize().

Now a full legalize method is created to update drawing cluster
data structure. It is called at the end of each legalize implementation.
Copy link
Contributor

@AlexandreSinger AlexandreSinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlexandreSinger AlexandreSinger merged commit 112d358 into verilog-to-routing:master Sep 15, 2025
30 checks passed
@vaughnbetz
Copy link
Contributor

@robluo : one remaining thing to investigate, to see if we can have a simpler solution: Do we need a refresh function like this, or could we just move where the drawing state is initialized? It seems like we usually initialize it after clustering, but with analytical placement enabled somehow it gets initialized before we've completed clustering. Could we just move it so it is called after clustering, whether analytical placement is enabled or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang-cpp C/C++ code VPR VPR FPGA Placement & Routing Tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants