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

[dv, aon_timer] Split intr_state prediction on intr_test write #26325

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

antmarzam
Copy link
Contributor

To avoid wrongly updating an intr_state bit on intr_test write the TB predicts each field separetely depending on which bits were set on the intr_test write.

This avoids the mismatch that could happen if the TB was going to predict an intr_state field due to count > threshold and has set intr_status_exp but not yet predicted the value by the time an intr_test occurs.

To avoid wrongly updating an intr_state bit on intr_test write the TB
predicts each field separetely depending on which bits were set on the intr_test
write.

This avoids the mismatch that could happen if the TB was going to predict an
intr_state field due to count > threshold and has set intr_status_exp but not
yet predicted the value by the time an intr_test occurs.

Signed-off-by: Antonio Martinez Zambrana <[email protected]>
@antmarzam antmarzam requested a review from a team as a code owner February 17, 2025 11:28
@antmarzam antmarzam requested review from hcallahan-lowrisc and rswarbrick and removed request for a team February 17, 2025 11:28
Copy link
Contributor

@rswarbrick rswarbrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about this. I don't think any simulation time elapses between these lines, so how can something happen in the middle?

@antmarzam
Copy link
Contributor Author

I'm a bit confused about this. I don't think any simulation time elapses between these lines, so how can something happen in the middle?

The issue is not within these lines, it's more related to how a TL-access (intr_test write) may predict the wrong intr_state if one of the bits in intr_status_exp was set to 1 (in another thread, like the count thread), but not yet predicted.
These lines just ensure that we only predict the bit that was set for the intr_test write.

This was reflected in a test in which the TB had the WDOG (bark) counting and it reached a point in which count > threshold, which set intr_status_exp[WDOG] = 1.
However, the TB takes some time from count > threshold until the prediction happens due to CDC and some flops in between.
So when the write to intr_test occurred, the predict method updated the wrong bit even though that bit wasn't even set in the data bus.

Copy link
Contributor

@rswarbrick rswarbrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for the explanation. Looks sensible to me!

@rswarbrick rswarbrick merged commit 46e6740 into lowRISC:master Feb 17, 2025
42 checks passed
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.

2 participants