-
Notifications
You must be signed in to change notification settings - Fork 792
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
[pwm,dv] Remove lots of dead code from the environment and do some tidying #24934
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rswarbrick
force-pushed
the
pwm-remove-cruft
branch
2 times, most recently
from
November 8, 2024 12:21
e48098c
to
c9ffa9c
Compare
hcallahan-lowrisc
approved these changes
Nov 11, 2024
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.
This is a nice cleanup, thanks @rswarbrick !
No functional change, but this allows us to attach proper documentation comments to the functions/tasks and hopefully make the class a bit easier to understand at a glance. This commit also gets rid of get_reg_index, which was replaced by get_multireg_idx from pwm_env_pkg with 92c5733 in 2021. Signed-off-by: Rupert Swarbrick <[email protected]>
Since we were touching the code anyway, I've also changed the way that we randomise the core frequency (divided down from the bus frequency). The code looked like the scaling was configurable, but it is always enabled. It also re-randomised on every call of what looks like a getter (after the rest of the class had been randomised). This commit changes things so we randomise the scaling ratio (picking a value between 1/4 and 1) and then apply it with the call to get_clk_core_freq. This two-stage process is needed because we randomise the cfg object before connecting up the vif that determines the bus frequency. Signed-off-by: Rupert Swarbrick <[email protected]> [pwm,dv] Remove unused en_random argument from get_clk_core_freq This is never supplied at the call sites (and I don't think it ever has been since it was defined in 2021!). Signed-off-by: Rupert Swarbrick <[email protected]>
The function and enum weren't actually used anywhere (and were actually inconsistent!). Drop them. Signed-off-by: Rupert Swarbrick <[email protected]>
This is constrained to equal NUM_CYCLES in every sequence except for pwm_stress_all_vseq. But the stress all sequence doesn't actually use the value (because its child sequences have their own values, all set to NUM_CYCLES). Chop it out. Signed-off-by: Rupert Swarbrick <[email protected]>
This task was supposed to work by setting the REGWEN to update the state. This is a bit odd, since you can only ever clear REGWEN. What's worse, the DV code was written when the register was rw1c (so it cleared the register by writing 1). The register become rw0c in 2021 with commit 25e147d, so this code has done nothing since then. Signed-off-by: Rupert Swarbrick <[email protected]>
Signed-off-by: Rupert Swarbrick <[email protected]>
rswarbrick
force-pushed
the
pwm-remove-cruft
branch
from
November 11, 2024 13:54
c9ffa9c
to
d0dd21a
Compare
Thanks for the review, @hcallahan-lowrisc. I've just force-pushed with your proposed comment change and a final commit that re-indents the scoreboard task that was a bit of a mess! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This builds on #24929, which should be merged first. Only the last 5 commits are unique to this PR: