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

[rv_timer]: issues found by running CSR test suite #48

Closed
sriyerg opened this issue May 31, 2019 · 7 comments
Closed

[rv_timer]: issues found by running CSR test suite #48

sriyerg opened this issue May 31, 2019 · 7 comments
Assignees
Labels

Comments

@sriyerg
Copy link
Contributor

sriyerg commented May 31, 2019

1: intr_state0 timer status is set right out of reset

In timer_core, the intr_state0 is set right out of reset without any timer configuration. In the timer reg hjson file, intr_state0 reset value is indicated as 0 - but the rtl is reading back 1, causing the test to fail.

On further inspection, looks like timer_core generates interrupt signal when mtime >= mtimecomp, both of which are 0 right out of reset. This results in intr_state0 to be set.

Is this an expected behavior? If yes, then please advise how to proceed - either exclude this register from reset value check, or fix the reg hjson to indicate the reset value of 1.

@sriyerg
Copy link
Contributor Author

sriyerg commented Jun 1, 2019

  1. intr_test0 is marked as "RW" but but reads all 0s

image

@sriyerg sriyerg changed the title [rv_timer] intr_state0 timer status is set right out of reset [rv_timer]: issues found by running CSR test suite Jun 1, 2019
@mdhayter
Copy link
Contributor

mdhayter commented Jun 1, 2019

Should mtimecmp reset to all ones? This would be consistent with all the code examples being careful to only have intermediate states in the future compared to the time being set for interrupt?

@eunchan
Copy link
Contributor

eunchan commented Jun 4, 2019 via email

@imphil
Copy link
Contributor

imphil commented Aug 27, 2019

I remember we had a discussion that mtimecmp shouldn't be reset by the main reset (but only with POR?) I cannot find the thread. Does anyone remember?

I don't remember this discussion, but maybe @tjaychen can help out, he has looked at resets recently.

@eunchan Do you think you can you get this done by the end of the week? (I see you already have a patch in your tree?) No worries otherwise, it's not critical.

(Motivation: We have a TODO with this issue number in ./hw/ip/rv_timer/dv/env/seq_lib/rv_timer_csr_vseq.sv, we need to either rewrite it or remove it before the repo move.)

@sjgitty
Copy link
Contributor

sjgitty commented Oct 25, 2019

@eunchan is this done at this time? @shakushw

@shakushw
Copy link
Contributor

@eunchan is this done at this time? @shakushw

Issues reported are resolved with the current rv_timer rtl.
@eunchan please let me know if i close this issue.

@eunchan
Copy link
Contributor

eunchan commented Oct 25, 2019

I will close. Thanks

@eunchan eunchan closed this as completed Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants