-
Notifications
You must be signed in to change notification settings - Fork 77
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
transformations: (convert-snrt-to-riscv) Add lowerings for even more info ops #2428
Conversation
The |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2428 +/- ##
==========================================
- Coverage 89.77% 89.65% -0.13%
==========================================
Files 354 357 +3
Lines 44705 45156 +451
Branches 6704 6788 +84
==========================================
+ Hits 40136 40486 +350
- Misses 3592 3651 +59
- Partials 977 1019 +42 ☔ View full report in Codecov by Sentry. |
This also adds some stuff that uses compile time constants in the snitch repo in the |
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.
Looks good, but it seems a bit arbitrary to only give the cluster number as a parameter to this pass?
Can you also add some more documentation to the pass arguments?
""" | ||
|
||
SNRT_CLUSTER_NUM: int | ||
SNRT_CLUSTER_CORE_NUM: int = 9 # TODO: is this correct? |
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.
That is defined here:
https://github.com/pulp-platform/snitch_cluster/blob/883a0ab3ed67f1a16ec920d5e985ae2a0eba5003/target/snitch_cluster/sw/runtime/common/snitch_cluster_cfg.h.tpl
And is based on the config used (default):
https://github.com/pulp-platform/snitch_cluster/blob/883a0ab3ed67f1a16ec920d5e985ae2a0eba5003/target/snitch_cluster/cfg/default.hjson
): | ||
rewriter.replace_matched_op( | ||
[ | ||
nfo := riscv.LiOp(self.constants.SNRT_BASE_HARTID), |
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.
Should this be info
?
class ConvertSnrtToRISCV(ModulePass): | ||
name = "convert-snrt-to-riscv" | ||
|
||
cluster_num: int |
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.
docstring!
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.
Added!
Is there any way you could split this up? |
I felt at the time that the cluster number is the only "real" variable part, but thinking about it more, snax has different counts for dm and compute cores... |
To me it seems more logical if you keep all of these being defined as constants for the time being instead of any particular one being targettable. |
8bba923
to
0e31ef2
Compare
(hopefully) smaller version of #2428 stripped of all the more complex lowerings introduced in that PR
Missing ops: - snrt.global_compute_core_idx - snrt.global_compute_core_num - snrt.global_dm_core_num - snrt.cluster_compute_core_idx - snrt.cluster_dm_core_idx These seem to be relatively unused in practice and are skipped for now
0e31ef2
to
930d009
Compare
After merging #2559, this PR should be reviewable now @superlopuh |
This PR now adds these 5 operations, each to a bit more complex set of operations:
|
@@ -536,6 +675,8 @@ class ConvertSnrtToRISCV(SnrtConstants, ModulePass): | |||
|
|||
name = "convert-snrt-to-riscv" | |||
|
|||
cluster_num: int |
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.
cluster_num: int |
Missing ops:
snrt.global_compute_core_idx
snrt.global_compute_core_num
snrt.global_dm_core_num
snrt.cluster_compute_core_idx
snrt.cluster_dm_core_idx
These seem to be relatively unused in practice and are skipped for now.