Skip to content
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

drt: genPatterns_commit refactoring #5872

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bnmfw
Copy link
Contributor

@bnmfw bnmfw commented Oct 4, 2024

This is branched from #5862 and is waiting for it to merge.

Some refactoring on genPatterns_commit is being done to improve readability and reduce code.

Access Patterns Graph Backwards Path Function and Readability

The first part of genPatterns_commit is a loop that traces a path through access points of an instance that represent a chosen access pattern.

Right now the loop is a little over complicated for what it does, so I refactored it a bit to make more obvious.

Added the variables source_node_idx and drain_node_idx to make the start and end points of the path search more clear, instead decreasing pin_cnt.

This was transformed in a function called extractAccessPatternFromNodes as it has a pretty distinct role and function.

Used Pattern Guard

The later part of the had an if statement to check is the generated pattern was unused, if true it did more checks, later it essentially had an else with return false. This as transformed into a guard.

No further changes on this function will be done in this PR as the git diff shows everything past the guard as changed due to the indentation level change. Further changes will be at a separate PR.

Copy link
Contributor

github-actions bot commented Oct 4, 2024

clang-tidy review says "All clean, LGTM! 👍"

@bnmfw bnmfw force-pushed the drt_genPatterns_commit_refactoring branch from 2ebcfdb to 91a9156 Compare October 4, 2024 15:41
Copy link
Contributor

github-actions bot commented Oct 4, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

const std::vector<FlexDPNode>& nodes,
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins,
std::set<std::pair<int, int>>& used_access_points,
const int max_access_point_size);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: parameter 'max_access_point_size' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]

Suggested change
const int max_access_point_size);
int max_access_point_size);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant