drt: prepPatternInstHelper and some refactors #6778
+61
−67
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.
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 toprepPatternInstHelper
and a new function that now has the nameprepPatternInst
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 (nowuse_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).