-
Notifications
You must be signed in to change notification settings - Fork 551
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: curr_idx name changes #5862
drt: curr_idx name changes #5862
Conversation
Signed-off-by: bernardo <[email protected]>
clang-tidy review says "All clean, LGTM! 👍" |
src/drt/src/pa/FlexPA_prep.cpp
Outdated
const int idx_1 = flat_idx / idx_2_dim - 1; | ||
const int idx_2 = flat_idx % idx_2_dim; | ||
return {idx_1, idx_2}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea where there is a '-1' here? It seems non-idiomatic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This function is the reciprocal to getFlatIdx
:
int FlexPA::getFlatIdx(const int idx_1, const int idx_2, const int idx_2_dim)
{
return ((idx_1 + 1) * idx_2_dim + idx_2);
}
The -1
inverts the +1
applied to idx_1
. The +1
, in turn, is there because the minimal value for idx_1
is -1
, not 0
. So the returned value will be always positive.
-1
is used as an argument for this function at genPatterns_reset
, genPatternsInit
and genInstRowPatternInit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't like how the code keeps flattening and nesting these indexes, it happens a lot and some times one right after the other. If I find a way to eliminate it and keep a single representation for these indexes I will implement it.
Just understood what |
Signed-off-by: bernardo <[email protected]>
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: bernardo <[email protected]>
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: bernardo <[email protected]>
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am running an ISPD CI and a secure CI. merging when they pass.
src/drt/src/pa/FlexPA_prep.cpp
Outdated
for (int curr_idx_1 = 0; curr_idx_1 <= (int) insts.size(); curr_idx_1++) { | ||
for (int curr_idx_2 = 0; curr_idx_2 < ACCESS_PATTERN_END_ITERATION_NUM; | ||
curr_idx_2++) { | ||
for (int curr_pin_idx = 0; curr_pin_idx <= (int) insts.size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not curr _inst_idx?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oversight. I actually have already caught that on a further PR I'm working on, but did not think to fix it here. Nice catch. I'm fixing this an re requesting review.
Signed-off-by: bernardo <[email protected]>
clang-tidy review says "All clean, LGTM! 👍" |
Did the CIs pass? |
Signed-off-by: bernardo <[email protected]>
clang-tidy review says "All clean, LGTM! 👍" |
This PR used to change how getNestedIdx inputs and outputs data, but since the function will be eliminated further down the line I reverted it. Now this PR only contains variable changes.
Also changes instances of
curr_idx_1
,curr_idx_2
to eithercurr_pin_idx
,curr_acc_point_idx
orcurr_inst_idx
,curr_acc_pattern_idx
depending on the appropriate use.
Similar changes were applied to variables with the same format that have
prev
orprev_prev
instead ofcurr
.