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

Add support for smstateen 1.0.0 #1035

Merged
merged 8 commits into from
Jul 11, 2022

Conversation

liweiwei90
Copy link
Contributor

Add support for smstateen 1.0.0:

  • remove multi blink lines in riscv/
  • add support for smstateen related CSRs
  • add smstateen check for fcsr, s/henvcfg

@scottj97
Copy link
Contributor

scottj97 commented Jul 5, 2022

encoding.h is generated by riscv-opcodes package; it should not be hand-edited.

If this was indeed generated from riscv-opcodes please record which commit hash in the commit message here.

riscv/csrs.cc Outdated Show resolved Hide resolved
riscv/csrs.cc Outdated Show resolved Hide resolved
riscv/csrs.cc Show resolved Hide resolved
riscv/csrs.cc Outdated Show resolved Hide resolved
riscv/csrs.cc Outdated Show resolved Hide resolved
riscv/processor.cc Outdated Show resolved Hide resolved
riscv/processor.cc Outdated Show resolved Hide resolved
riscv/processor.cc Outdated Show resolved Hide resolved
riscv/csrs.cc Show resolved Hide resolved
riscv/processor.cc Outdated Show resolved Hide resolved
@liweiwei90
Copy link
Contributor Author

encoding.h is generated by riscv-opcodes package; it should not be hand-edited.

If this was indeed generated from riscv-opcodes please record which commit hash in the commit message here.

OK, I have sent a PR(riscv/riscv-opcodes#134) to riscv-opcodes to support this.

@liweiwei90 liweiwei90 force-pushed the plct-smstateen-dev branch 2 times, most recently from 7dbfdb8 to 08c4d29 Compare July 6, 2022 03:12
@scottj97
Copy link
Contributor

scottj97 commented Jul 6, 2022

In the first commit, s/blink/blank/

Copy link
Contributor

@scottj97 scottj97 left a comment

Choose a reason for hiding this comment

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

It would be best to get that riscv-opcodes change merged first, just in case it needs rebasing and the commit hash changes (in which case the hash here in encoding.h would be stale).

riscv/csrs.cc Outdated Show resolved Hide resolved
riscv/processor.cc Outdated Show resolved Hide resolved
riscv/processor.cc Outdated Show resolved Hide resolved
riscv/csrs.cc Show resolved Hide resolved
@aswaterman
Copy link
Collaborator

I've merged the corresponding riscv-opcodes PR.

@liweiwei90
Copy link
Contributor Author

I've merged the corresponding riscv-opcodes PR.

Ok. Thanks a lot, I'll update the encoding.h.

@liweiwei90 liweiwei90 force-pushed the plct-smstateen-dev branch from 08c4d29 to 1e76223 Compare July 7, 2022 01:09
Copy link
Contributor

@scottj97 scottj97 left a comment

Choose a reason for hiding this comment

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

I have tested this only so far as to see that it doesn't break any other features. I have not tested the Smstateen functionality.

@liweiwei90 can you tell us how you have tested this code?

riscv/csrs.cc Outdated Show resolved Hide resolved
riscv/processor.cc Outdated Show resolved Hide resolved
riscv/processor.cc Outdated Show resolved Hide resolved
riscv/csrs.cc Outdated Show resolved Hide resolved
riscv/processor.cc Outdated Show resolved Hide resolved
riscv/processor.cc Outdated Show resolved Hide resolved
riscv/processor.cc Outdated Show resolved Hide resolved
@liweiwei90
Copy link
Contributor Author

liweiwei90 commented Jul 8, 2022

I have tested this only so far as to see that it doesn't break any other features. I have not tested the Smstateen functionality.

@liweiwei90 can you tell us how you have tested this code?

Sorry. I didn't test the code systematically. Partial of the code was tested in an ugly way, such as for the check for fcsr, I set the bit in mstateen/sstateen to different values in reset to test the access from U mode. All of the functions are privilege-related. I didn't know a good way to test them. Any suggestions?

@liweiwei90 liweiwei90 force-pushed the plct-smstateen-dev branch from 1e76223 to fdb01a5 Compare July 8, 2022 01:46
@scottj97
Copy link
Contributor

scottj97 commented Jul 8, 2022

Sorry. I didn't test the code systematically. Partial of the code was tested in an ugly way, such as for the check for fcsr, I set the bit in mstateen/sstateen to different values in reset to test the access from U mode. All of the functions are privilege-related. I didn't know a good way to test them. Any suggestions?

All of these features need architectural tests, which are out of scope for Spike contributors, but such tests are sorely lacking in the open-source world. :(

riscv/csrs.cc Outdated Show resolved Hide resolved
@liweiwei90 liweiwei90 force-pushed the plct-smstateen-dev branch from bc70815 to 8fbeaab Compare July 9, 2022 00:59
Copy link
Contributor

@scottj97 scottj97 left a comment

Choose a reason for hiding this comment

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

All good now. Thank you for the contribution and for your patience with the review process.

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

🎉

@aswaterman aswaterman merged commit 0ad0d97 into riscv-software-src:master Jul 11, 2022
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.

3 participants