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: prepPatternInstHelper and some refactors #6778

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bnmfw
Copy link
Contributor

@bnmfw bnmfw commented Feb 26, 2025

Supports #5867.

This PR is ISPD and Secure CI safe.

This PR has some refactoring of the access pattern code to support incremental PA.

prepPatternInstHelper

Currently, there is no single function that actually supports the passing of an unique inst to solve its access patterns, although prepPatternInst is almost it. The aforementioned function was renamed to prepPatternInstHelper and a new function that now has the name prepPatternInst was created in its place to simply receive the unique inst and solve its access pattern.

curr_unique_inst_idx plumbing elimination.

Something very weird happens in the access pattern code as mentioned in the discussion of #6731. Many functions of the access patterns code expect both a pointer to an unique inst (frInst* inst) as well as the index this unique inst exists in the unique_ vector (int curr_unique_inst_idx). This is redundant and very error prone, so the passing of the index was eliminated, and any function that required it now gets the pointer to the instance itself. Some functions that used to get both now just get the instance.

The appropriate refactoring was done to accommodate for this change. In some cases, deep into functions calls the inst was actually retrieved through some other way, such as getting the instance from the pin analyzed. Now that those functions get the instance, those methods are not needed.

Other smaller refactors

The now prepPatternInstHelper had a weird parameter (x_weight) that acted as a boolean, but was a int that assumed wither 1 or 0 value and was used inside an equation. The parameter (now use_x) now actually acts as a boolean.

genPatternsCommit also had some slight refactoring at its end, two variable name changes (I don't know how those were not caught on the PA general refactor), and a slight owner refactor (that code repetition bothered me).

Copy link
Contributor

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

@bnmfw bnmfw requested a review from osamahammad21 February 26, 2025 18:43
@bnmfw bnmfw marked this pull request as ready for review February 27, 2025 14:55
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