-
Notifications
You must be signed in to change notification settings - Fork 167
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 a consistent mechanism for identifying instruction's containing extension #506
Add a consistent mechanism for identifying instruction's containing extension #506
Conversation
Per #495 (comment), please use an enum and scatter both the enum and function(s). |
I was thinking about this a bit recently, and I'm not sure an enum is the way to go. The problem with an enum is it adds all the names to the global identifier namespace, which for RISC-V extensions means you end up single character identifiers like I fairly recently added some (experimental) support for a |
Other than the question of whether extension names should be string literals or elements of an enum, this is 100% what we should be doing though. |
Strings have the ability to be mis-typed and go undetected at compile time as a result though, and require a wildcard |
Yes, that is definitely a major point in favour of using an enumeration. |
Yeah I think a scattered enum with a prefix is the best option. I would really like if all Sail enums were namespaced tbh ( Also I think just calling the function
|
@jrtc27 , @Alasdair , @Timmmm : how does this look as a prototype (passes
|
Supported is ambiguous, could be either "can be enabled" or "is enabled", and I'd abbreviate to something like Ext_ to make it less clumsy, but otherwise that looks like what I was imagining. |
I agree with Jessica - see here. Let's stick with "enabled" for "it's implemented and its use is allowed by |
802b759
to
424e100
Compare
I've changed everything to:
Let me know if you have any further comments. |
Thanks for this PR, it is a great improvement! I agree that we could do with ways to distinguish implemented, enabled, enabled / disabled on reset and 'hardwired to on' as these affect |
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.
I agree this is a great improvement. LGTM except some very minor nits.
424e100
to
7ce17eb
Compare
7ce17eb
to
d8ea69e
Compare
rebased to address conflicts with recent commit 4817b64 |
@billmcspadden-riscv Anything else needed here before merging? Thanks! |
…n content Extensions: D, F, Zbc, Zbkb, Zbkc, Zbkx, Zbs, Zfa, Zfh, Zicond, Zknd, Zkne, Zknh, Zkr, Zksed, Zksh.
Using the `extensionEnabled()` function in `mapping clause encdec` expressions for extensions allows a parser to clearly know when a function is part of an extension (or set of extensions).
* Utilize extensionEnabled() instead of `haveZmmul()`, `haveUsrMode()`, `haveSupMode()`, `haveNExt()`, etc.. * Delete all unused `have*` definitions of various extensions
d8ea69e
to
3d5e476
Compare
Hang on, nobody approved the version you merged, and the issue I pointed out wasn't properly resolved. The line that was wrong got deleted, not changed to use the right scattered definition name. |
Sorry, the one-word review "Stale" left too much to my imagination, and I mistakenly thought I'd left an old reference in the code, not that I'd failed to rename it. I can submit a new PR with that renamed |
I think that’s the only thing that needs fixing. It’s not like it’s a big deal, but it’s an instance of how this repository continues to be poorly managed, with a lack of diligence by those responsible, and it concerns me that we’re still having conversations about how to properly maintain an open source project. |
I mean, it's customary to check that the people who left review comments are happy before merging... Plus, the fact that you discussed it at the golden model meeting does not notify anyone following GitHub, nor does it give an obvious trail for people to follow on GitHub for who actually reviewed and approved the changes, and which exact version they reviewed/approved. |
Your review comments arrived after the approvals that occurred at the meeting, but yes, a glance at the actual PR would've obviously shown the new unaddressed comments before the merge.
Agree that this process could be approved. For PRs (and issues) that are discussed in the meeting, some relevant notes should be relayed into the PR/issue. @billmcspadden-riscv , thoughts? |
Definitely my fault. No excuses. I did not read the PR thoroughly and
based
the promotion on the conversation we had at the tgmm.
I will be more thorough.
FYI: My general rules when promoting a PR:
1. Have at least 2 reviews of the PR, one of which is from an SME.
2. Ensure that all github conversations in the code review are closed and
are closed by the initiator of the conversation.
3. Ensure that there are no merge conflicts.
Bill Mc.
…On Mon, Jul 22, 2024 at 7:21 PM Paul Clarke ***@***.***> wrote:
I mean, it's customary to check that the people who left review comments
are happy before merging...
Your review comments arrived after the approvals that occurred at the
meeting, but yes, a glance at the actual PR would've obviously shown the
new unaddressed comments before the merge.
Plus, the fact that you discussed it at the golden model meeting does not
notify anyone following GitHub, nor does it give an obvious trail for
people to follow on GitHub for *who* actually reviewed and approved the
changes, and which exact version they reviewed/approved.
Agree that this process could be approved. For PRs (and issues) that are
discussed in the meeting, some relevant notes should be relayed into the
PR/issue. @billmcspadden-riscv <https://github.com/billmcspadden-riscv> ,
thoughts?
—
Reply to this email directly, view it on GitHub
<#506 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXROLOERJW2FYZ6CJERZIOLZNWOW3AVCNFSM6AAAAABKJQSTL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBUGAZDQOJUGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Bill McSpadden
Formal Verification Engineer
RISC-V International
mobile: 503-807-9309
Join me at RISC-V Summit North America <http://www.riscvsummit.com/> in
October!
|
debug: Fix interrupt_all() to restore state.
A new mechanism is introduced to more consistently identify which instruction content is contained within which RISC-V ISA extensions.
The current implementations use somewhat arbitrary functions with names of the form "have*", which are not consistently named, and not always obviously associated with a specific RISC-V extension, examples:
haveFExt
: "F" extensionhaveZfinx
: "Zfinx" extensionhaveRVC
: "C" extensionhaveSupMode
: "S" extensionThe new mechanism uses a new function,
extension
, which takes an extension identifier string, uses the content of the existing "have*" functions for the specific extension of the given name, and produces a boolean result -- one-stop-shopping to determine the status of extension support. The above "have*" function examples are replaced by:extension("F")
extension("Zfinx")
extension("C")
extension("S")
In addition, there are some instructions with content that is not tagged. Those missing tags have been added.
A not insignificant benefit is that this important content of the Sail code becomes more consistently parsable/actionable by Sail parser backend code.