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

Fix for MISA CSR spec for CV32A6 #1049

Closed
wants to merge 1 commit into from

Conversation

MikeOpenHWGroup
Copy link
Member

@MikeOpenHWGroup MikeOpenHWGroup commented Feb 8, 2023

This PR addresses issue #1048.

Note: I am not sure whether to merge this into master or cv32a6_v5.0.0. My suggestion is the master branch since this PR updates the CV32E6 User Manual only and the master branch is used to by ReadTheDocs to publish CVA6 documentation.

@MikeOpenHWGroup MikeOpenHWGroup requested review from ASintzoff, spidugu444 and JeanRochCoulon and removed request for zarubaf February 8, 2023 00:02
@MikeOpenHWGroup MikeOpenHWGroup added Component:Doc For issues in the Documentation (e.g. for README.md files) Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system Status:New Newly created issue, nobody has looked at it yet. labels Feb 8, 2023
@JeanRochCoulon
Copy link
Contributor

LGTM. @ASintzoff Can you tell me if PR is OK to you ?

@ASintzoff
Copy link
Contributor

LGTM. @ASintzoff Can you tell me if PR is OK to you ?

I'm wondering if RO wording is the appropriate one.
There is a difference between RO (read-only) CSR and WARL (write any values, read legal values). Write access to RO CSR raises an illegal instruction exceptions but write access to WARL does not.
As the behaviour is different, it could be useful to highlight the difference.

BTW, was the file generated by Register Manager? Does it mean the generation is only for the first version?

@MikeOpenHWGroup
Copy link
Member Author

Good points @ASintzoff!

I'm wondering if RO wording is the appropriate one. There is a difference between RO (read-only) CSR and WARL (write any values, read legal values).

The access mode behaviours in the Privileged Specification define what software does, not hardware.

Write access to RO CSR raises an illegal instruction exceptions but write access to WARL does not. As the behaviour is different, it could be useful to highlight the difference.

The Privilege Spec says the hardware may raise an illegal exception, but I do not believe CVA6 does this. If I am right, then for the MISA an RO CSR is a legal way to implement a WARL CSR. See #1053.

BTW, was the file generated by Register Manager? Does it mean the generation is only for the first version?

We have a choice. We can either manually update the RST files (see #1049), or we can update the source input to Register Manager and regenerate the RST.

@ASintzoff
Copy link
Contributor

Good points @ASintzoff!

I'm wondering if RO wording is the appropriate one. There is a difference between RO (read-only) CSR and WARL (write any values, read legal values).

The access mode behaviours in the Privileged Specification define what software does, not hardware.

Write access to RO CSR raises an illegal instruction exceptions but write access to WARL does not. As the behaviour is different, it could be useful to highlight the difference.

The Privilege Spec says the hardware may raise an illegal exception, but I do not believe CVA6 does this. If I am right, then for the MISA an RO CSR is a legal way to implement a WARL CSR. See #1053.

I agree that writing to misa does not raise any exception as it is a WARL register. From Privilege Spec: Implementations will not raise an exception on writes of unsupported values to a WARL field.

Nevertheless, do we need to distinguish the following behaviours:

  • exception raised when write to read-only (as in RISC-V privilege spec) register. Attempts to access a CSR without appropriate privilege level or to write a read-only register also raise illegal instruction exceptions.
  • silent execution when write to WARL register

BTW, was the file generated by Register Manager? Does it mean the generation is only for the first version?

We have a choice. We can either manually update the RST files (see #1049), or we can update the source input to Register Manager and regenerate the RST.

Manually updating the RST file is fine for me.

@JeanRochCoulon
Copy link
Contributor

Yes, very good point! It will help verification to specify whether exception is generated (or not). But in that case, all registers are concerned by this modification, not only MISA CSR. The CSR spec is to be aligned on RISC-V specification and need to contain an explanation about the RO and WARL meanings.
Agree to modify the rst file.

@JeanRochCoulon
Copy link
Contributor

@MikeOpenHWGroup As the current agreed stragtegy is to modify the IP-XACT version to generate the specification (rst file), this PR should be updated. @yanicasa what do you suggest as methodology to modify the IP-XACT file ?

@JeanRochCoulon JeanRochCoulon added Status:Do-not-merge Pull request that should not be merged (yet) and removed Status:New Newly created issue, nobody has looked at it yet. labels Mar 16, 2023
@JeanRochCoulon
Copy link
Contributor

@frikhaAziz This PR would like to modify the CSR specification. As this need to be done in IP-XACT, could you propose an PR to fix the spec.

@JeanRochCoulon
Copy link
Contributor

Hello @mike, #1330 should have superseeded this PR. If you agree, can you close it ?

@MikeOpenHWGroup
Copy link
Member Author

Closing as #1330 does indeed supersede this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:Doc For issues in the Documentation (e.g. for README.md files) Status:Do-not-merge Pull request that should not be merged (yet) Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants