This public release also starts the Foundation's 45-day ratification
clock. The ratification process is described at the following link:
https://workspace.riscv.org/higherlogic/ws/public/workgroup?wg_abbrev=tech
We welcome any feedback you might have, from small typo corrections to
major issues. Feedback or questions can be sent as a reply to this
message on isa-dev, to me directly, or as a pull request or issue on
the riscv-isa-manual GitHub repo.
Hi,On Thu, May 3, 2018 at 3:58 AM, Daniel Lustig <dlu...@nvidia.com> wrote:This public release also starts the Foundation's 45-day ratification
clock. The ratification process is described at the following link:
https://workspace.riscv.org/higherlogic/ws/public/workgroup?wg_abbrev=tech
We welcome any feedback you might have, from small typo corrections to
major issues. Feedback or questions can be sent as a reply to this
message on isa-dev, to me directly, or as a pull request or issue on
the riscv-isa-manual GitHub repo.This new version of the document changes the behavior of C.LWSP (and some related compressed opcodes) so that now rd=0 is not reserved anymore. Is this also part of the 45-day ratification period?This is a backwards incompatible change with v2.2 of the ISA spec (which includes v2.0 of the compressed spec).Spike was also changed now to match the new behavior.Rocket always implemented the previously incorrect, now correct, behavior.When I joined RISC-V there used to be two promises:1. No backwards incompatible changes after the 2.0 release of a spec, and2. Spike is the executable golden reference.
But now it looks like the spec and spike are changed at will to match whatever Rocket does. I find this a *very* concerning trend.Here is the change in spike:Here is the change in the spec:(This also effects C.LQSP and C.LDSP but I personally care more about C.LWSP because I have a processor out there, in silicon, that matches the previous behavior of spike and will now be throwing an illegal instruction exception for something that is now suddenly deemed a valid instruction.)Is Spike still the "executable golden reference", or is it in fact Rocket and everything else may be changed at any time to match whatever Rocket happens to implement?(This change also throws away 64 reserved code points in c.lwsp for nothing. I hope nobody ever tells me again that there is not enough compressed encoding space left for the 24 code points that XBitmanip is asking for.)
I am deeply concerned about the direction the RISC-V process seems to be going here. Are we going to build RISC-V processors, or are we building Rocket-compatible processors?The commit messages claim that this is not a spec change but in fact just clearing up an "ambiguity" in the spec. This is incorrect because spike presumably is the golden reference and the behavior of spike was changed. The whole point of having an executable spec like spike is that it can be used to resolve ambiguities. If clearing up an ambiguity was the goal here, then spike should have change unmodified and the English language spec should have been changed to match spikes behavior. But instead the spec and spike was changed to match Rockets behavior.
--regards,- Clifford
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAG5EYeU0xvNX-uRXO%2Bp8%3D_PBEBaSasF6xZ5pOB%2BC%3Dixp5XuVQg%40mail.gmail.com.
Rocket is not a reference implementation. It is coincidental that Rocket had the behavior that is now specified to be "correct."Spike is intended to be the reference, until a formal model is formally adopted. This does not imply that Spike is correct implementation; Spike has bugs sometimes.When a formal model is formally adopted, it will probably have bugs, too, and those shouldn't imply things about the spec.
The spec *was* ambiguous! When we wrote the spec, our intent was that the English was the spec, and the annotations next to the encoding table were shorthand that *helped* express the spec.
For example, C.LUI's description says "C.LUI is only valid when rd !=0 and rd != 2." There was no analogous text for "C.LWSP is only valid when rd != 0." My intent in writing the spec was that C.LWSP was valid when rd = 0.

You might say my intent doesn't matter, and that would be a fair criticism.
I assume this discrepancy between the text and the table arose because Krste wrote one and I wrote the other.
I screwed up. Sorry.
Hi,
<image.png>
You might say my intent doesn't matter, and that would be a fair criticism.This is not about blame. I don't want to criticize you. (But I understand that you feel criticized. I am being harsh and emotional and I'm sorry for not being more relaxed, but to me this is not just a small issue. My basic (no-system, no-fence) RV32IC model has been stable and formally verified against spike for quite a while now and people are formally verifying their cores against it. This spec change wrecks all those proofs.)For me this is about ensuring consistency of a frozen spec. And if you want to clear up an ambiguity in the spec, then the only thing that should matter is how people would likely have understood the spec up until this point. And if you intended one thing, but most people would have understood it differently, then the ambiguity should be resolved to (A) match what people likely would have understood when reading the ambiguous spec and (B) still guarantee backward compatibility either way.Making a legal opcode illegal would be backward compatible. In that case older processors would simply implement an opcode that newer code generators would never output. That is okay. It might as well be a custom extension.On the other hand, making an illegal opcode legal is not a backward compatible change. Older processors would throw an illegal instruction exception for an instruction that they are suddenly supposed to support.I assume this discrepancy between the text and the table arose because Krste wrote one and I wrote the other.Please understand that no matter what the original intent was, this is a SPEC CHANGE. It is not simply a clarification. The spec used to be that rd=0 is invalid and now it is that rd=0 is valid. Even if the spec text itself might have been ambiguous, the implementation in spike was not, and is not, and is different now from what it used to be before. (But as I argued above I think it is pretty clear that even if the spec was ambiguous, it was clearly leaning towards rd=0 being invalid.)And now we have processors out there that have correctly implemented the old spec, even formally verified against it, but suddenly are not correct RISC-V implementations anymore!?Will silicon that raises an illegal instruction exception for C.LWSP with rd=0 pass the compliance test?Need people who want to be able to claim that their chip is RISC-V compatible re-spin their chips now?I screwed up. Sorry.This is not about assigning blame. Not for me at least. And I think the real screw-up did not happen yet. Because in my opinion the real screw-up would be the non-backward-compatible spec change that you are planning on including in v2.3. Please don't do that.regards,- Clifford
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAG5EYeXJgB35PKbhBO07Ucy44_b4MB%2B5B7kjPj2PjLXoAwibsw%40mail.gmail.com.
Besides the points Clifford raised (which I largely agree with), what is the rationale for making this legal?We either have to tone down the public boasting that the "spec is frozen" or actually live up to this.FWIW, IMO, the standard is be defined by the spec, the *tests*, and Spike, in that order and they shouldof course be consistent.Spike has a lot of issues as a spec; it's very hard to extract the intended semantics from it (try to figure outfloat 32-bit behavior from it, I dare you). Besides the bugs and Spike lagging behind the spec (that has happenedat least once), you can't easily tell what's intentional semantics or just accidental; there are lots of optionalbehavior for which Spike implements just one option. Did I mention how awful Spike is to read?
On May 4, 2018, at 10:22 , Andrew Waterman <wate...@eecs.berkeley.edu> wrote:Spike has a lot of issues as a spec; it's very hard to extract the intended semantics from it (try to figure outfloat 32-bit behavior from it, I dare you). Besides the bugs and Spike lagging behind the spec (that has happenedat least once), you can't easily tell what's intentional semantics or just accidental; there are lots of optionalbehavior for which Spike implements just one option. Did I mention how awful Spike is to read?The goal, as you are well aware, is to have a formal model replace Spike.
That’s a valid point. I will revert the change.But you really don’t need to be so confrontational. You can’t hide behind being emotional as an excuse: being emotional is precisely the problem.
On the other hand, making an illegal opcode legal is not a backward compatible change. Older processors would throw an illegal instruction exception for an instruction that they are suddenly supposed to support.That’s a valid point. I will revert the change.
But you really don’t need to be so confrontational. You can’t hide behind being emotional as an excuse: being emotional is precisely the problem.
Michael Clark wrote:
>> On Fri, May 4, 2018 at 7:21 PM, Andrew Waterman <wate...@eecs.berkeley.edu> wrote:
>> On the other hand, making an illegal opcode legal is not a backward compatible change. Older processors would throw an illegal instruction exception for an instruction that they are suddenly supposed to support.
>>
>
> I also shared Clifford’s interpretation from the compressed opcode table “Table 12.6: Instruction listing for RVC, Quadrant 2.” which has rd≠0 for C.LWSP
>
> - https://github.com/michaeljclark/riscv-meta/blob/master/compression#L36
> - https://github.com/michaeljclark/riscv-meta/blob/master/constraints
>
> This LaTeX is generated from the constraints associated with the instructions for constraints that have annotations in the constraint table which is used to generate a decoder/encoder:
>
> - https://github.com/michaeljclark/rv8/blob/master/doc/pdf/riscv-instructions.pdf
>
Loading a word to x0 is nonsensical, since x0 is hardwired zero and we
already have C.NOP. This creates an interesting issue with C.LDSP and
C.LQSP, which become C.FLWSP and C.FLDSP on processors with narrower
XLEN than they require. For RVF, register zero *is* a valid destination
for a compressed load. Avoiding the situation where rd==0 is reserved
depending on XLEN would be nice, since this complicates decoding on
multi-width implementations.
This is a backwards incompatible change with v2.2 of the ISA spec (which includes v2.0 of the compressed spec).
Spike was also changed now to match the new behavior.
When I joined RISC-V there used to be two promises:
1. No backwards incompatible changes after the 2.0 release of a spec, and
2. Spike is the executable golden reference.
These promises were/are reiterated at the RISC-V workshop. Just as Clifford, we too have CPUs in the field that would now be considered ‘broken’ and (I assume just like Cliffort) I got a slight panic attack.
Even if the spec was wrong, you can’t just change it as that will break all CPUs in the field. Once the spec is frozen, that’s it. Any changes to the ‘frozen’ ISA would need to go through some rigorous user review and approval before they can be made. You definitely can’t ‘just’ update the spec. That will be a major dip in trust of the RISC-V foundation (promises) and ultimately will lead to fragmentation/forking of RISC-V, something we all try to prevent.
I know Andrew reverted the change and I welcome that. I tried to come up with easy ways to prevent/report this. But seeing the enormous amount of emails already generated and the limited amount of time to read them all (I can’t keep up!!), I can only consider ‘not touching the frozen spec’ as the simplest/cleanest solution.
We’re all over worked and are all trying to do what’s best. I thank you all and keep up the good work!!
Cheers,
Richard
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/EA5C3B2D-B01F-4F13-BF88-DAAF457D62A5%40roalogic.com.
A weaker standard would be no backwards incompatible changes, rather than no changes.
-Allen
--<snippets>
… the document changes the behavior of C.LWSP (and some related compressed opcodes) so that now rd=0 is not reserved anymore.
This is a backwards incompatible change with v2.2 of the ISA spec (which includes v2.0 of the compressed spec).
Spike was also changed now to match the new behavior.
When I joined RISC-V there used to be two promises:
1. No backwards incompatible changes after the 2.0 release of a spec, and
2. Spike is the executable golden reference.
These promises were/are reiterated at the RISC-V workshop. Just as Clifford, we too have CPUs in the field that would now be considered ‘broken’ and (I assume just like Cliffort) I got a slight panic attack.
Even if the spec was wrong, you can’t just change it as that will break all CPUs in the field. Once the spec is frozen, that’s it. Any changes to the ‘frozen’ ISA would need to go through some rigorous user review and approval before they can be made. You definitely can’t ‘just’ update the spec. That will be a major dip in trust of the RISC-V foundation (promises) and ultimately will lead to fragmentation/forking of RISC-V, something we all try to prevent.
I know Andrew reverted the change and I welcome that. I tried to come up with easy ways to prevent/report this. But seeing the enormous amount of emails already generated and the limited amount of time to read them all (I can’t keep up!!), I can only consider ‘not touching the frozen spec’ as the simplest/cleanest solution.
We’re all over worked and are all trying to do what’s best. I thank you all and keep up the good work!!
Cheers,
Richard
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/EA5C3B2D-B01F-4F13-BF88-DAAF457D62A5%40roalogic.com.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/08EAA410-6862-4EF2-B91C-27715B11E8D8%40esperantotech.com.
. I think it's equally tenable for someone
to claim there's a strong implication that reserved encodings _must_ be
trapped as illegal. Certainly the documents do mention that certain
instructions cause illegal instruction traps when not implemented, often
enough that I feel one could be forgiven for inferring this to be a
general rule. In fact, I suspect many subscribers to this list assumed
it was true, and will be surprised to hear it isn't.
At the very least, because some other processors are nominally specified
to trap on all non-defined encodings, people familiar with those
processors will be at risk to assume this is implied for RISC-V as well,
without an explicit statement to the contrary in the documents.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CA%2BwH296Up477Q9Gg36KbXRSuZnrFPUKi0cWUst3bM5H39Si-6A%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CA%2BwH296Up477Q9Gg36KbXRSuZnrFPUKi0cWUst3bM5H39Si-6A%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAF4tt%3DAsAxdB25UAQ97Y580nDAYN%3DFmDYeFpq-fEwXdOrED0Aw%40mail.gmail.com.
Not only that, but it's also been mentioned here that it's perfectly
acceptable for different privileged ISA extensions to exist as well.
So, for example, if I wanted to (not that I'm motivated to do this), I
could theoretically make a processor that implements RV32/64IM at the
non-privileged level, and implement a privileged mode which supports
Burroughs-like segmentation, or maybe even implement a completely
different ISA all-together (e.g., in this case, the RV32/64IM
environment would relate to the core ISA as ARM Thumb relates to the
full-width ARM ISA).
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAEz%3DsokuyXT-jgM3zQ8BXaoX4%3Duo5NqF4saJ7R2raPnG66r4CQ%40mail.gmail.com.
Regards,
Liviu
I would propose that ISA compliance tests only test the encodings
standardized in that ISA module.
For the base instruction set, we have proposed 16 0s and 32 1s are
required to raise illegal instruction exceptions, and only these
should be checked in base ISA compliance suite.
The compliance tests can define a region of the test signature in
which detected exceptions are reported, and the test execution
environment for the platform should cause an exception to write its
platform-independent details there (e.g., for ISA-only compliance,
this might just report the PC offset of instructions that caused
illegal instruction traps).
I think an argument could be made that no exception checks should be
made in ISA-only compliance tests, as this implies a given platform
exception model.
But there is at least one reason to have a defined illegal instruction
pattern, in that compilers want something to put on "should never be
executed" bad code paths. This could be EBREAK, but this causes
overloading of EBREAK between "stop here" and "error here".
| Other cores might just hang on any
| kind of exception and then all an implementer would need to do is check that
| all the tests that are expected to trigger an exception actually do hang the
| core, and that the remaining tests do not hang the core.
| However, this is not a very satisfying solution imo because it violates the
| doctrine that compliance tests should not be self-checking but always output a
| "signature" that can be checked externally.
Right. Having cores hang on exceptions does not ever sound like a good
idea. It also makes building an automated compliance suite very
difficult. If you can detect the exception, you should try to do
something better with your hardware.
The whole point of compliance is to ensure cores meet some minimum
standard, and while it's fine for folks to develop cores below that
minimum, there's no reason for them to expect to get a compliance gold
star.
| PS: 32 1s is illegal? Wasn't there the proposal that 16 1s should already be an
| illegal prefix?
Instruction decoders will see all 1s as an instruction of ILEN, which
is at least 32 so will gather all >=32 bits before reporting an
exception. So there's no implementation benefit to requiring just 16
1s to be illegal, but there would be a negative of impinging on very
long instruction encoding space.
(1) Read IALIGN length instruction prefix
(2) If that IALIGN-length prefix encodes for an unsupported instructionlength then raise an illegal instruction exception
(3) Read entire rest of the instruction *without* early-exit if the instruction can
already be determined to be illegal.
(4) If any part of the instruction triggers a page fault then raise an
instruction page fault exception.
(5) Otherwise, if the instruction encodes for an illegal instruction then
raise an illegal instruction exception.
(1) Read IALIGN length instruction prefix
(1a) If IALIGN=16 and the two LSB bits of the instruction are 11, then read two
more bytes, triggering instruction page fault exception if necessary.
(2) If that 16-bit or 32-bit prefix encodes for an unsupported instruction length thenraise an illegal instruction exception
(3) Read entire rest of the instruction *without* early-exit if the instruction can
already be determined to be illegal.
(4) If any part of the instruction triggers a page fault then raise an
instruction page fault exception.
(5) Otherwise, if the instruction encodes for an illegal instruction then
raise an illegal instruction exception.
| Also: What is with implementations that do not claim "C"? Are
| they required to treat everything as illegal instruction that starts with a
| prefix of 16 0s? Or can they use this prefix in custom 32 bit
| instructions?
Terminology nit: Custom means "not standard and not reserved", so it
was never possible to use for custom instructions.
I guess we could separate IALIGN=32 implementations to only check 32 all
0s as illegal to allow non-standard 32-bit encodings with high bits 0.
Hi,
(There is the issue of cores with ridiculously small address spaces. I think the extrarequirement of for example at least 4 kB code ROM and at least 256 bytes RAMwould make sense.
I think we should apply common sense, rather than language lawyer a “possible reading” that is essentially untestable. I think the “expectation” is that compliance can be tested.
Clifford, do you think an undistinguishable behaviour like a processor hang would comply with the specification when a distinct exception is documented to be signaled?
"The instruction descriptions in following chapters describe conditions that raise an exception during execution. Whether and
how these are converted into traps is dependent on the execution environment .."
"We use the term trap to refer to the synchronous transfer of control to a trap handler caused by an exceptional condition occurring within a RISC-V thread."