-
Notifications
You must be signed in to change notification settings - Fork 428
Feature ap draw #3285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
robluo
wants to merge
8
commits into
verilog-to-routing:master
Choose a base branch
from
robluo:feature-ap-draw
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature ap draw #3285
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6004c64
[draw ap] Now able to draw arbitrary things at AP stage
robluo f28bd12
[draw ap] ap draw working with the rest of the draw
robluo d94e61c
[ap draw] fix segfault when disp is off
robluo 095703f
[draw ap] fixed no graphic macro range
robluo 90feae9
[ap draw] drawing manager
robluo 6ca7887
[ap draw] renamed analytical draw to AP draw
robluo f2613df
[ap draw] fixed ifdef NOGRAPHICS (void) build problem
robluo 84622b8
[ap draw] post rebase changes
robluo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* @file | ||
* @author Yulang (Robert) Luo | ||
* @date October 2025 | ||
* @brief The definitions of the AP Draw Manager class which is used | ||
* to handle graphics updates during analytical placement. | ||
*/ | ||
|
||
#include "ap_draw_manager.h" | ||
#include "vpr_types.h" | ||
|
||
#ifndef NO_GRAPHICS | ||
#include "draw.h" | ||
#include "draw_global.h" | ||
#include "partial_placement.h" | ||
#endif | ||
|
||
APDrawManager::APDrawManager(const PartialPlacement& p_placement) { | ||
#ifndef NO_GRAPHICS | ||
// Set the analytical placement reference in draw state | ||
get_draw_state_vars()->set_ap_partial_placement_ref(p_placement); | ||
#else | ||
(void)p_placement; | ||
#endif | ||
} | ||
|
||
APDrawManager::~APDrawManager() { | ||
#ifndef NO_GRAPHICS | ||
// Clear the analytical placement reference in draw state | ||
get_draw_state_vars()->clear_ap_partial_placement_ref(); | ||
#endif | ||
} | ||
|
||
void APDrawManager::update_graphics(unsigned int iteration, enum APDrawType draw_type) { | ||
#ifndef NO_GRAPHICS | ||
std::string msg; | ||
if (draw_type == APDrawType::Solver) { | ||
msg = "Analytical Placement Solver - Iteration: " + std::to_string(iteration); | ||
} else if (draw_type == APDrawType::Legalizer) { | ||
msg = "Analytical Placement Legalizer - Iteration: " + std::to_string(iteration); | ||
} else { | ||
msg = "Analytical Placement"; | ||
} | ||
update_screen(ScreenUpdatePriority::MAJOR, msg.c_str(), e_pic_type::ANALYTICAL_PLACEMENT, nullptr); | ||
#else | ||
(void)iteration; | ||
(void)draw_type; | ||
#endif | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#pragma once | ||
/** | ||
* @file | ||
* @author Yulang (Robert) Luo | ||
* @date October 2025 | ||
* @brief The decalarations of the AP Draw Manager class which is used | ||
* to handle graphics updates during analytical placement. | ||
*/ | ||
|
||
#include <string> | ||
|
||
// Forward declarations | ||
class PartialPlacement; | ||
|
||
// Types to indicate the type of drawing operation | ||
enum class APDrawType { | ||
Solver, | ||
Legalizer | ||
}; | ||
|
||
/** | ||
* @class APDrawManager | ||
* @brief Manages graphics updates during analytical placement operations. | ||
* | ||
* This class provides a clean interface for updating the screen during | ||
* analytical placement without requiring the placement code to be littered | ||
* with NO_GRAPHICS conditional compilation directives. | ||
*/ | ||
class APDrawManager { | ||
public: | ||
/** | ||
* @brief Constructor initializes the draw manager with a reference to the | ||
* current partial placement. | ||
*/ | ||
explicit APDrawManager(const PartialPlacement& p_placement); | ||
|
||
/** | ||
* @brief Destructor cleans up the reference in the draw state. | ||
*/ | ||
~APDrawManager(); | ||
|
||
/** | ||
* @brief Update screen with current analytical placement state | ||
* @param msg A message to display with the update | ||
*/ | ||
void update_graphics(unsigned int iteration, enum APDrawType draw_type); | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.