-
Notifications
You must be signed in to change notification settings - Fork 25
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
Extension A doesn't define any instructions (anymore) #435
base: main
Are you sure you want to change the base?
Extension A doesn't define any instructions (anymore) #435
Conversation
Some instructions claim to be defined by the "A" extension or another extension. Extension A was split into two "sub-extensions", "Zaamo" and "Zalrsc", then defined to simply encompass both sub-extensions. Since these instructions are actually now defined by the sub-extensions, the instructions should only claim to be defined by them. Also, move the instruction YAML files from `arch/inst/A` to their new respective directories `arch/inst/{Zaamo,Zalrsc}`.
If this patch seems OK, I'll stack more similar commits on top. There are quite extensions like this: B, Zce, Zkn, Zks, Zk, Zvkn, Zvknc, Zvkng, Zvks, Zvksc, Zvksg. |
I'm OK with this. We'll need to update some of the generation, since this will currently cause us to lose documentation that, e.g., |
Anything you want/need me to do? (Probably a bit outside my area of expertise, but I can learn.) |
Question on this, will this still be compiled on 20240411 manual? Since ratification of those extensions is actually after that. Moreover, wouldn't this change be a great point towards introducing versions in this schema? I think it would be a great selling point to once again beat riscv-opcodes. This change will make riscv-opcodes remove any connection of this instructions with extension A but perhaps we can still describe A extension like this:
|
@AFOliveira, great point. I'm not sure how to accurately represent this one, though. The Assuming we get that fixed (file a riscv-isa-manual issue?), then UDB is already set up to track such things. It looks like this: definedBy:
anyOf:
- Zaamo
- { name: A, version: "<= 2.1" } # assuming 2.1 is the version before the bump |
Great, I didn't know that versioning there was already possible! On the A extension, I was back to reading the ISA and I'm not sure that A extension does not add anything.
Doesn't this mean that A actually still adds all instructions from both extensions? Can't we just say that a certain processor implements A, without specifying that A is equal to Zaamo and Zalrsc? If not, I think we have exactly the same problem in B extension |
It's probably best to wait on #403, since that has a lot of changes to the Ruby interface that will be needed. TLDR; Roughly, each riscv-unified-db/lib/arch_obj_models/obj.rb Lines 393 to 412 in 95b376f
|
I see the dates are offset (ISA = 20240411; Zaamo/Zalrsc = 20240425), but there is no context presented in the ISA that those extensions are unratified. They are certainly presented as ratified extensions.
Would the version of extension "A" need to be incremented in this case? From a support standpoint, the content of the extension didn't change.
I read "comprises" as "is fully defined by". If anything other than that, I'd expect to see "includes" or "comprises ... Zaamo and Zalrsc AND [the following instructions]". In other words extension "A" is exactly the combination of "Zaamo" and "Zalrsc".
This is a neat idea, and we'll probably find uses for it, but I don't think it applies here. There is only one extension "A". Before roughly April 2024, extension "A" defined a set of instructions. Afterwards, "A" comprised extensions "Zaamo" and "Zalrsc", together comprising the exact same set of instructions. If we need a way to support the state over all time, we probably need to keep the original list "definedBy: anyOf: [A, Zaamo]". |
I understand the individual changes are ratified and should be in UDB. My question was more towards Derek and about UDB "infrastructure": When we generate the 20240411 manual, will these changes be included? And how can we ensure that does not happen?
Agree. Again, I think I misexplained my point. Since A = Zaamo + Zalrsc, should we not let the UDB know this? Because even though the smaller extensions are the ones that define the instructions, A extension still includes them all (even if only by including the other sub-extensions). I don't think the UDB has any way to specify relations between extensions, and therefore, if that description is removed, how will we be able to generate "A" extension documents? It will be only text without proper connection to "Zaamo" and "Zalrsc".
There are however two ratified versions of A. And if version 2.1 is what removes the instructions from being described by A, we should state that, although I'm not sure this is the case due to the previous content of my answer/ |
I confess I don't understand this concern as expressed. What should not appear in the 20240411 manual?
Is
Are there two versions? It's certainly challenging to figure historical things out, but I see the the "A" extension moving from unratified in ISA 20190608 to ratified at version 2.1 in ISA 20191213, but there is no Zaamo/Zalrsc, of course, until April 2024. Has the version of "A" been bumped past 2.1? |
Ratification of "Zaamo" and Zalrsc happened after that date, so they should not be in that version of rafied manual, or am I wrong? I'm not sure this is how it happens, but seems most logical.
Sure, can the UDB handle this? If so, forget what I was saying, I just thought it was not possible.
I made an assumption that 2.1 implied 1.x ratification. Also, since Zaamo and Zalrsc made changes to A extension I made another assumption that A had to have changes. Turns out I may be completely wrong. I'll try to figure this out better, sorry for the confusion. It's clear I'm missing some things with the naming schema. |
You're not wrong on the dates, for sure. I can't explain the existence of the date lag and the appearance of full ratification in the ISA 2 weeks earlier. Maybe "the paperwork" took a few extra weeks? It's a little odd.
Thinking more about this, I think "implies" is insufficient, because it is used to say "this extension depends on these other extensions" as well as "this extension comprises/includes these other extensions". We probably need a "comprises" field.
Good luck. ;-) |
Some instructions claim to be defined by the "B" extension. Extension B was split into four "sub-extensions": "Zba", "Zbb", and "Zbs", then defined to simply encompass these sub-extensions. Additionally, ratified extensions "Zbc", "Zbkb", "Zbkc", and "Zbkx" are under the "B" umbrella (at least in the ISA 20240411, these are all in Chapter 28 "B" Extension for Bit Manipulation, Version 1.0.0", but these 3 extensions are shown only as "frozen"). Since these instructions are actually now defined by the sub-extensions, the instructions should only claim to be defined by them. Also, move the instruction YAML files from `arch/inst/B` to their new respective directories `arch/inst/{Zba,Zbb,Zbc,Zbs,Zbkb,Zbkc,Zbkx}`, when there is only one defining extension. Some instructions are defined by multiple extensions. These are left in the `arch/inst/B` directory, for lack of an unambiguously better location.
Some instructions claim to be defined by the "A" extension or another extension. Extension A was split into two "sub-extensions", "Zaamo" and "Zalrsc", then defined to simply encompass both sub-extensions.
Since these instructions are actually now defined by the sub-extensions, the instructions should only claim to be defined by them.
Also, move the instruction YAML files from
arch/inst/A
to their new respective directoriesarch/inst/{Zaamo,Zalrsc}
.