add link to recent isamux discussino
[libreriscv.git] / isa_conflict_resolution.mdwn
1 # Resolving ISA conflicts and providing a pain-free RISC-V Standards Upgrade Path
2
3 **Note: out-of-date as of review 31apr2018, requires updating to reflect
4 "mvendorid-marchid-isamux" concept.** Recent discussion 10jun2019
5 <https://groups.google.com/a/groups.riscv.org/d/msg/isa-dev/x-uFZDXiOxY/_ISBs1enCgAJ>
6
7 ## Executive Summary
8
9 A non-invasive backwards-compatible change to make mvendorid and marchid
10 being read-only to be a formal declaration of an architecture having no
11 Custom Extensions, and being permitted to be WARL in order to support
12 multiple simultaneous architectures on the same processor (or per hart
13 or harts) permits not only backwards and forwards compatibility with
14 existing implementations of the RISC-V Standard, not only permits seamless
15 transitions to future versions of the RISC-V Standard (something that is
16 not possible at the moment), but fixes the problem of clashes in Custom
17 Extension opcodes on a global worldwide permanent and ongoing basis.
18
19 Summary of impact and benefits:
20
21 * Implementation impact for existing implementations (even though
22 the Standard is not finalised) is zero.
23 * Impact for future implementations compliant with (only one) version of the
24 RISC-V Standard is zero.
25 * Benefits for implementations complying with (one or more) versions
26 of the RISC-V Standard is: increased customer acceptance due to
27 a smooth upgrade path at the customer's pace and initiative vis-a-vis
28 legacy proprietary software.
29 * Benefits for implementations deploying multiple Custom Extensions
30 are a massive reduction in NREs and the hugely reduced ongoing software
31 toolchain maintenance costs plus the benefit of having security updates
32 from upstream software sources due to
33 *globally unique identifying information* resulting in zero binary
34 encoding conflicts in the toolchains and resultant binaries
35 *even for Custom Extensions*.
36
37 ## Introduction
38
39 In a lengthy thread that ironically was full of conflict indicative
40 of the future direction in which RISC-V will go if left unresolved,
41 multiple Custom Extensions were noted to be permitted free rein to
42 introduce global binary-encoding conflict with no means of resolution
43 described or endorsed by the RISC-V Standard: a practice that has known
44 disastrous and irreversible consequences for any architecture that
45 permits such practices (1).
46
47 Much later on in the discussion it was realised that there is also no way
48 within the current RISC-V Specification to transition to improved versions
49 of the standard, regardless of whether the fixes are absolutely critical
50 show-stoppers or whether they are just keeping the standard up-to-date (2).
51
52 With no transition path there is guaranteed to be tension and conflict
53 within the RISC-V Community over whether revisions should be made:
54 should existing legacy designs be prioritised, mutually-exclusively over
55 future designs (and what happens during the transition period is absolute
56 chaos, with the compiler toolchain, software ecosystem and ultimately
57 the end-users bearing the full brunt of the impact). If several
58 overlapping revisions are required that have not yet transitioned out
59 of use (which could take well over two decades to occur) the situation
60 becomes disastrous for the credibility of the entire RISC-V ecosystem.
61
62 It was also pointed out that Compliance is an extremely important factor
63 to take into consideration, and that Custom Extensions (as being optional)
64 effectively and quite reasonably fall entirely outside of the scope of
65 Compliance Testing. At this point in the discussion however it was not
66 yet noted the stark problem that the *mandatory* RISC-V Specification
67 also faces, by virtue of there being no transitional way to bring in
68 show-stopping critical alterations.
69
70 To put this into perspective, just taking into account hardware costs
71 alone: with production mask charges for 28nm being around USD $1.5m,
72 engineering development costs and licensing of RTLs for peripherals
73 being of a similar magnitude, no manufacturer is going to back away
74 from selling a "flawed" or "legacy" product (whether it complies with
75 the RISC-V Specification or not) without a bitter fight.
76
77 It was also pointed out that there will be significant software tool
78 maintenance costs for manufacturers, meaning that the probability will
79 be extremely high that they will refuse to shoulder such costs, and
80 will publish and continue to publish (and use) hopelessly out-of-date
81 unpatched tools. This practice is well-known to result in security
82 flaws going unpatched, with one of many immediate undesirable consequences
83 being that product in extremely large volume gets discarded into landfill.
84
85 **All and any of the issues that were discussed, and all of those that
86 were not, can be avoided by providing a hardware-level runtime-enabled
87 forwards and backwards compatible transition path between *all* parts
88 (mandatory or not) of current and future revisions of the RISC-V ISA
89 Standard.**
90
91 The rest of the discussion - indicative as it was of the stark mutually
92 exclusive gap being faced by the RISC-V ISA Standard given that it does
93 not cope with the problem - was an effort by two groups in two clear
94 camps: one that wanted things to remain as they are, and another that
95 made efforts to point out that the consequences of not taking action
96 are clearly extreme and irreversible (which, unfortunately, given the
97 severity, some of the first group were unable to believe, despite there
98 being clear historical precedent for the exact same mistake being made in
99 other architectures, and the consequences on the same being absolutely
100 clear).
101
102 However after a significant amount of time, certain clear requirements came
103 out of the discussion:
104
105 * Any proposal must be a minimal change with minimal (or zero) impact
106 * Any proposal should place no restriction on existing or future
107 ISA encoding space
108 * Any proposal should take into account that there are existing implementors
109 of the (yet to be finalised but still "partly frozen") Standard who may
110 resist, for financial investment reasons, efforts to make any change
111 (at all) that could cost them immediate short-term profits.
112
113 Several proposals were put forward (and some are still under discussion)
114
115 * "Do nothing": problem is not severe: no action needed.
116 * "Do nothing": problem is out-of-scope for RISC-V Foundation.
117 * "Do nothing": problem complicates Compliance Testing (and is out of scope)
118 * "MISA": the MISA CSR enables and disables extensions already: use that
119 * "MISA-like": a new CSR which switches in and out new encodings
120 (without destroying state)
121 * "mvendorid/marchid WARL": switching the entire "identity" of a machine
122 * "ioctl-like": a OO proposal based around the linux kernel "ioctl" system.
123
124 Each of these will be discussed below in their own sections.
125
126 # Do nothing (no problem exists)
127
128 (Summary: not an option)
129
130 There were several solutions offered that fell into this category.
131 A few of them are listed in the introduction; more are listed below,
132 and it was exhaustively (and exhaustingly) established that none of
133 them are workable.
134
135 Initially it was pointed out that Fabless Semiconductor companies could
136 simply license multiple Custom Extensions and a suitable RISC-V core, and
137 modify them accordingly. The Fabless Semi Company would be responsible
138 for paying the NREs on re-developing the test vectors (as the extension
139 licensers would be extremely unlikely to do that without payment), and
140 given that said Companies have an "integration" job to do, it would
141 be reasonable to expect them to have such additional costs as well.
142
143 The costs of this approach were outlined and discussed as being
144 disproportionate and extreme compared to the actual likely cost of
145 licensing the Custom Extensions in the first place. Additionally it
146 was pointed out that not only hardware NREs would be involved but
147 custom software tools (compilers and more) would also be required
148 (and maintained separately, on the basis that upstream would not
149 accept them except under extreme pressure, and then only with
150 prejudice).
151
152 All similar schemes involving customisation of the custom extensions
153 were likewise rejected, but not before the customisation process was
154 mistakenly conflated with tne *normal* integration process of developing
155 a custom processor (Bus Architectures, Cache layouts, peripheral layouts).
156
157 The most compelling hardware-related reason (excluding the severe impact on
158 the software ecosystem) for rejecting the customisation-of-customisation
159 approach was the case where Extensions were using an instruction encoding
160 space (48-bit, 64-bit) *greater* than that which the chosen core could
161 cope with (32-bit, 48-bit).
162
163 Overall, none of the options presented were feasible, and, in addition,
164 with no clear leadership from the RISC-V Foundation on how to avoid
165 global world-wide encoding conflict, even if they were followed through,
166 still would result in the failure of the RISC-V ecosystem due to
167 irreversible global conflicting ISA binary-encoding meanings (POWERPC's
168 Altivec / SPE nightmare).
169
170 This in addition to the case where the RISC-V Foundation wishes to
171 fix a critical show-stopping update to the Standard, post-release,
172 where billions of dollars have been spent on deploying RISC-V in the
173 field.
174
175 # Do nothing (out of scope)
176
177 (Summary: may not be RV Foundation's "scope", still results in
178 problem, so not an option)
179
180 This was one of the first arguments presented: The RISC-V Foundation
181 considers Custom Extensions to be "out of scope"; that "it's not their
182 problem, therefore there isn't a problem".
183
184 The logical errors in this argument were quickly enumerated: namely that
185 the RISC-V Foundation is not in control of the uses to which RISC-V is
186 put, such that public global conflicts in binary-encoding are a hundred
187 percent guaranteed to occur (*outside* of the control and remit of the
188 RISC-V Foundation), and a hundred percent guaranteed to occur in
189 *commodity* hardware where Debian, Fedora, SUSE and other distros will
190 be hardest hit by the resultant chaos, and that will just be the more
191 "visible" aspect of the underlying problem.
192
193 # Do nothing (Compliance too complex, therefore out of scope)
194
195 (Summary: may not be RV Foundation's "scope", still results in
196 problem, so not an option)
197
198 The summary here was that Compliance testing of Custom Extensions is
199 not just out-of-scope, but even if it was taken into account that
200 binary-encoding meanings could change, it would still be out-of-scope.
201
202 However at the time that this argument was made, it had not yet been
203 appreciated fully the impact that revisions to the Standard would have,
204 when billions of dollars worth of (older, legacy) RISC-V hardware had
205 already been deployed.
206
207 Two interestingly diametrically-opposed equally valid arguments exist here:
208
209 * Whilst Compliance testing of Custom Extensions is definitely legitimately
210 out of scope, Compliance testing of simultaneous legacy (old revisions of
211 ISA Standards) and current (new revisions of ISA Standard) definitely
212 is not. Efforts to reduce *Compliance Testing* complexity is therefore
213 "Compliance Tail Wagging Standard Dog".
214 * Beyond a certain threshold, complexity of Compliance Testing is so
215 burdensome that it risks outright rejection of the entire Standard.
216
217 Meeting these two diametrically-opposed perspectives requires that the
218 solution be very, very simple.
219
220 # MISA
221
222 (Summary: MISA not suitable, leads to better idea)
223
224 MISA permits extensions to be disabled by masking out the relevant bit.
225 Hypothetically it could be used to disable one extension, then enable
226 another that happens to use the same binary encoding.
227
228 *However*:
229
230 * MISA Extension disabling is permitted (optionally) to **destroy**
231 the state information. Thus it is totally unsuitable for cases
232 where instructions from different Custom extensions are needed in
233 quick succession.
234 * MISA was only designed to cover Standard Extensions.
235 * There is nothing to prevent multiple Extensions being enabled
236 that wish to simultaneously interpret the same binary encoding.
237 * There is nothing in the MISA specification which permits
238 *future* versions (bug-fixes) of the RISC-V ISA to be "switched in".
239
240 Overall, whilst the MISA concept is a step in the right direction it's
241 a hundred percent unsuitable for solving the problem.
242
243 # MISA-like
244
245 (Summary: basically same as mvend/march WARL except needs an extra CSR where
246 mv/ma doesn't. Along right lines, doesn't meet full requirements)
247
248 Out of the MISA discussion came a "MISA-like" proposal, which would
249 take into account the flaws pointed out by trying to use "MISA":
250
251 * The MISA-like CSR's meaning would be identified by compilers using the
252 mvendor-id/march-id tuple as a compiler target
253 * Each custom-defined bit of the MISA-like CSR would (mutually-exclusively)
254 redirect binary encoding(s) to specific encodings
255 * No Extension would *actually* be disabled: its internal state would
256 be left on (permanently) so that switching of ISA decoding
257 could be done inside inner loops without adverse impact on
258 performance.
259
260 Whilst it was the first "workable" solution it was also noted that the
261 scheme is invasive: it requires an entirely new CSR to be added
262 to the privileged spec (thus making existing implementations redundant).
263 This does not fulfil the "minimum impact" requirement.
264
265 Also interesting around the same time an additional discussion was
266 raised that covered the *compiler* side of the same equation. This
267 revolved around using mvendorid-marchid tuples at the compiler level,
268 to be put into assembly output (by gcc), preserving the required
269 *globally* unique identifying information for binutils to successfully
270 turn the custom instruction into an actual binary-encoding (plus
271 binary-encoding of the context-switching information). (**TBD, Jacob,
272 separate page? review this para?**)
273
274 # mvendorid/marchid WARL <a name="mvendor_marchid_warl"></a>
275
276 (Summary: the only idea that meets the full requirements. Needs
277 toolchain backup, but only when the first chip is released)
278
279 This proposal has full details at the following page:
280 [[mvendor_march_warl]]
281
282 Coming out of the software-related proposal by Jacob Bachmeyer, which
283 hinged on the idea of a globally-maintained gcc / binutils database
284 that kept and coordinated architectural encodings (curated by the Free
285 Software Foundation), was to quite simply make the mvendorid and marchid
286 CSRs have WARL (writeable) characteristics. Read-only is taken to
287 mean a declaration of "Having no Custom Extensions" (a zero-impact
288 change).
289
290 By making mvendorid-marchid tuples WARL the instruction decode phase
291 may re-route mutually-exclusively to different engines, thus providing
292 a controlled means and method of supporting multiple (future, past and
293 present) versions of the **Base** ISA, Custom Extensions and even
294 completely foreign ISAs in the same processor.
295
296 This incredibly simple non-invasive idea has some unique and distinct
297 advantages over other proposals:
298
299 * Existing designs - even though the specification is not finalised
300 (but has "frozen" aspects) - would be completely unaffected: the
301 change is to the "wording" of the specification to "retrospectively"
302 fit reality.
303 * Unlike with the MISA idea this is *purely* at the "decode" phase:
304 no internal Extension state information is permitted to be disabled,
305 altered or destroyed as a direct result of writing to the
306 mvendor/march-id CSRs.
307 * Compliance Testing may be carried out with a different vendorid/marchid
308 tuple set prior to a test, allowing a vendor to claim *Certified*
309 compatibility with *both* one (or more) legacy variants of the RISC-V
310 Specification *and* with a present one.
311 * With sufficient care taken in the implementation an implementor
312 may have multiple interpretations of the same binary encoding within
313 an inner loop, with a single instruction (to the WARL register)
314 changing the meaning.
315
316 **This is the only one of the proposals that meet the full requirements**
317
318 # Overloadable opcodes <a name="overloadable opcodes"></a>
319
320 See [[overloadable opcodes]] for full details, including a description in terms of C functions.
321
322 NOTE: under discussion.
323
324 ==RB 2018-5-1 dropped IOCTL proposal for the much simpler overloadable opcodes proposal==
325
326 The overloadable opcode (or xext) proposal allows a non standard extension to use a documented 20 + 3 bit (or 52 + 3 bit on RV64) UUID identifier for an instruction for _software_ to use. At runtime, a cpu translates the UUID to a small implementation defined 12 + 3 bit bit identifier for _hardware_ to use. It also defines a fallback mechanism for the UUID's of instructions the cpu does not recognise.
327
328 The overloadable opcodes proposal defines 8 standardised R-type instructions xcmd0, xcmd1, ...xcmd7 preferably in the brownfield opcode space.
329 Each xcmd takes in rs1 a 12 bit "logical unit" (lun) identifying a device on the cpu that implements some "extension interface" (xintf) together with some additional data. An xintf is a set of up to 8 commands with 2 input and 1 output port (i.e. like an R-type instruction), together with a description of the semantics of the commands. Calling e.g. xcmd3 routes its two inputs and one output ports to command 3 on the device determined by the lun bits in rs1. Thus, the 8 standard xcmd instructions are standard-designated overloadable opcodes, with the non standard semantics of the opcode determined by the lun.
330
331 Portable software, does not use luns directly. Instead, it goes through a level of indirection using a further instruction xext that translates a 20 bit globally unique identifier UUID of an xintf, to the lun of a device on the cpu that implements that xintf. The cpu can do this, because it knows (at manufacturing or boot time) which devices it has, and which xintfs they provide. This includes devices that would be described as non standard extension of the cpu if the designers had used custom opcodes instead of xintf as an interface. If the UUID of the xintf is not recognised at the current privilege level, the xext instruction returns the special lun = 0, causing any xcmd to trap. Minor variations of this scheme (requiring two more instructions) cause xcmd instructions to fallback to always return 0 or -1 instead of trapping.
332
333 The 20 bit provided by the UUID of the xintf is much more room than provided by the 2 custom 32 bit, or even 4 custom 64/48 bit opcode spaces. Thus the overloadable opcodes proposal avoids most of the need to put a claim on opcode space and the associated collisions when combining independent extensions. In this respect it is similar to POSIX ioctls, which obviate the need for defining new syscalls to control new and nonstandard hardware.
334
335 Remark1: the main difference with a previous "ioctl like proposal" is that UUID translation is stateless and does not use resources. The xext instruction _neither_ initialises a device _nor_ builds global state identified by a cookie. If a device needs initialisation it can do this using xcmds as init and deinit instructions. Likewise, it can hand out cookies (which can include the lun) as a return value .
336
337 Remark2: Implementing devices can respond to an (essentially) arbitrary number of xintfs. Hence an implementing device can respond to an arbitrary number of commands. Organising related commands in xintfs, helps avoid UUID space pollution, and allows to amortise the (small) cost of UUID to lun translation if related commands are used in combination.
338
339 ==RB not sure if this is still correct and relevant==
340
341 The proposal is functionally similar to that of the mvendor/march-id
342 except the non standard extension is explicit and restricted to a small set of well defined individual opcodes.
343 Hence several extensions can be mixed and there is no state to be tracked over context switches.
344 As such it could hypothetically be proposed as an independent Standard Extension.
345
346 Despite the proposal (which is still undergoing clarification)
347 being worthwhile in its own right, and standing on its own merits and
348 thus definitely worthwhile pursuing, it is non-trivial and more
349 invasive than the mvendor/march-id WARL concept.
350
351 ==RB==
352
353 # Comments, Discussion and analysis
354
355 TBD: placeholder as of 26apr2018
356
357 ## new (old) m-a-i tuple idea
358
359 > actually that's a good point: where the user decides that they want
360 > to boot one and only one tuple (for the entire OS), forcing a HARDWARE
361 > level default m-a-i tuple at them actually prevents and prohibits them
362 > from doing that, Jacob.
363 >
364 > so we have apps on one RV-Base ISA and apps on an INCOMPATIBLE (future)
365 > variant of RV-Base ISA.  with the approach that i was advocating (S-mode
366 > does NOT switch automatically), there are totally separate mtvec /
367 > stvec / bstvec traps.
368 >
369 > would it be reasonable to assume the following:
370 >
371 > (a) RV-Base ISA, particularly code-execution in the critical S-mode
372 > trap-handling, is *EXTREMELY* unlikely to ever be changed, even thinking
373 > 30 years into the future ?
374 >
375 > (b) if the current M-mode (user app level) context is "RV Base ISA 1"
376 > then i would hazard a guess that S-mode is prettty much going to drop
377 > down into *exactly* the same mode / context, the majority of the time
378 >
379 > thus the hypothesis is that not only is it the common code-path to *not*
380 > switch the ISA in the S-mode trap but that the instructions used are
381 > extremely unlikely to be changed between "RV Base Revisions".
382 >
383 > foreign isa hardware-level execution
384 > ------------------------
385 >
386 > this is the one i've not really thought through so much, other than it
387 > would clearly be disadvantageous for S-mode to be arbitrarily restricted
388 > to running RV-Base code (of any variant).  a case could be made that by the
389 > time the m-a-i tuple is switched to the foreign isa it's "all bets off",
390 > foreign arch is "on its own", including having to devise a means and
391 > method to switch back (equivalent in its ISA of m-a-i switching).
392 >
393 > conclusion / idea
394 > --------------------
395 >
396 > the multi-base "user wants to run one and only one tuple" is the key
397 > case, here, that is a show-stopper to the idea of hard-wiring the default
398 > S-mode m-a-i.
399 >
400 > now, if instead we were to say, "ok so there should be a default S-mode
401 > m-a-i tuple" and it was permitted to SET (choose) that tuple, *that*
402 > would solve that problem.  it could even be set to the foreign isa. 
403 > which would be hilarious.
404
405 jacob's idea: one hart, one configuration:
406
407 >>>  (a) RV-Base ISA, particularly code-execution in the critical S-mode
408 >>> trap-handling, is *EXTREMELY* unlikely to ever be changed, even
409 >>> thinking 30 years into the future ?
410 >>
411 >> Oddly enough, due to the minimalism of RISC-V, I believe that this is
412 >> actually quite likely.  :-)
413 >>
414 >>>  thus the hypothesis is that not only is it the common code-path to
415 >>> *not* switch the ISA in the S-mode trap but that the instructions used
416 >>> are extremely unlikely to be changed between "RV Base Revisions".
417 >>>
418 >> Correct.  I argue that S-mode should *not* be able to switch the selected
419 >> ISA on multi-arch processors. 
420 >
421 > that would produce an artificial limitation which would prevent
422 > and prohibit implementors from making a single-core (single-hart)
423 > multi-configuration processor.
424
425
426
427 # Summary and Conclusion
428
429 In the early sections (those in the category "no action") it was established
430 in each case that the problem is not solved. Avoidance of responsibility,
431 or conflation of "not our problem" with "no problem" does not make "problem"
432 go away. Even "making it the Fabless Semiconductor's design problem" resulted
433 in a chip being *more costly to engineer as hardware **and** more costly
434 from a software-support perspective to maintain*... without actually
435 fixing the problem.
436
437 The first idea considered which could fix the problem was to just use
438 the pre-existing MISA CSR, however this was determined not to have
439 the right coverage (Standard Extensions only), and also crucially it
440 destroyed state. Whilst unworkable it did lead to the first "workable"
441 solution, "MISA-like".
442
443 The "MISA-like" proposal, whilst meeting most of the requirements, led to
444 a better idea: "mvendor/march-id WARL", which, in combination with an offshoot
445 idea related to gcc and binutils, is the only proposal that fully meets the
446 requirements.
447
448 The "ioctl-like" idea *also* solves the problem, but, unlike the WARL idea
449 does not meet the full requirements to be "non-invasive" and "backwards
450 compatible" with pre-existing (pre-Standards-finalised) implementations.
451 It does however stand on its own merit as a way to extend the extremely
452 small Custom Extension opcode space, even if it itself implemented *as*
453 a Custom Extension into which *other* Custom Extensions are subsequently
454 shoe-horned. This approach has the advantage that it requires no "approval"
455 from the RISC-V Foundation... but without the RISC-V Standard "approval"
456 guaranteeing no binary-encoding conflicts, still does not actually solve the
457 problem (if deployed as a Custom Extension for extending Custom Extensions).
458
459 Overall the mvendor/march-id WARL idea meets the three requirements,
460 and is the only idea that meets the three requirements:
461
462 * **Any proposal must be a minimal change with minimal (or zero) impact**
463 (met through being purely a single backwards-compatible change to the
464 wording of the specification: mvendor/march-id changes from read-only
465 to WARL)
466 * **Any proposal should place no restriction on existing or future
467 ISA encoding space**
468 (met because it is just a change to one pre-existing CSR, as opposed
469 to requiring additional CSRs or requiring extra opcodes or changes
470 to existing opcodes)
471 * **Any proposal should take into account that there are existing implementors
472 of the (yet to be finalised but still "partly frozen") Standard who may
473 resist, for financial investment reasons, efforts to make any change
474 (at all) that could cost them immediate short-term profits.**
475 (met because existing implementations, with the exception of those
476 that have Custom Extensions, come under the "vendor/arch-id read only
477 is a formal declaration of an implementation having no Custom Extensions"
478 fall-back category)
479
480 So to summarise:
481
482 * The consequences of not tackling this are severe: the RISC-V Foundation
483 cannot take a back seat. If it does, clear historical precedent shows
484 100% what the outcome will be (1).
485 * Making the mvendorid and marchid CSRs WARL solves the problem in a
486 minimal to zero-disruptive backwards-compatible fashion that provides
487 indefinite transparent *forwards*-compatibility.
488 * The retro-fitting cost onto existing implementations (even though the
489 specification has not been finalised) is zero to negligeable
490 (only changes to words in the specification required at this time:
491 no vendor need discard existing designs, either being designed,
492 taped out, or actually in production).
493 * The benefits are clear (pain-free transition path for vendors to safely
494 upgrade over time; no fights over Custom opcode space; no hassle for
495 software toolchain; no hassle for GNU/Linux Distros)
496 * The implementation details are clear (and problem-free except for
497 vendors who insist on deploying dozens of conflicting Custom Extensions:
498 an extreme unlikely outlier).
499 * Compliance Testing is straightforward and allows vendors to seek and
500 obtain *multiple* Compliance Certificates with past, present and future
501 variants of the RISC-V Standard (in the exact same processor,
502 simultaneously), in order to support end-customer legacy scenarios and
503 provide the same with a way to avoid "impossible-to-make" decisions that
504 throw out ultra-costly multi-decade-investment in proprietary legacy
505 software at the same as the (legacy) hardware.
506
507 -------
508
509 # Conversation Exerpts
510
511 The following conversation exerpts are taken from the ISA-dev discussion
512
513 ## (1) Albert Calahan on SPE / Altiven conflict in POWERPC
514
515 > Yes. Well, it should be blocked via legal means. Incompatibility is
516 > a disaster for an architecture.
517 >
518 > The viability of PowerPC was badly damaged when SPE was
519 > introduced. This was a vector instruction set that was incompatible
520 > with the AltiVec instruction set. Software vendors had to choose,
521 > and typically the choice was "neither". Nobody wants to put in the
522 > effort when there is uncertainty and a market fragmented into
523 > small bits.
524 >
525 > Note how Intel did not screw up. When SSE was added, MMX remained.
526 > Software vendors could trust that instructions would be supported.
527 > Both MMX and SSE remain today, in all shipping processors. With very
528 > few exceptions, Intel does not ship chips with missing functionality.
529 > There is a unified software ecosystem.
530 >
531 > This goes beyond the instruction set. MMU functionality also matters.
532 > You can add stuff, but then it must be implemented in every future CPU.
533 > You can not take stuff away without harming the architecture.
534
535 ## (2) Luke Kenneth Casson Leighton on Standards backwards-compatibility
536
537 > For the case where "legacy" variants of the RISC-V Standard are
538 > backwards-forwards-compatibly supported over a 10-20 year period in
539 > Industrial and Military/Goverment-procurement scenarios (so that the
540 > impossible-to-achieve pressure is off to get the spec ABSOLUTELY
541 > correct, RIGHT now), nobody would expect a seriously heavy-duty amount
542 > of instruction-by-instruction switching: it'd be used pretty much once
543 > and only once at boot-up (or once in a Hypervisor Virtual Machine
544 > client) and that's it.
545
546 ## (3) Allen Baum on Standards Compliance
547
548 > Putting my compliance chair hat on: One point that was made quite
549 > clear to me is that compliance will only test that an implementation
550 > correctly implements the portions of the spec that are mandatory, and
551 > the portions of the spec that are optional and the implementor claims
552 > it is implementing. It will test nothing in the custom extension space,
553 > and doesn't monitor or care what is in that space.
554
555 ## (4) Jacob Bachmeyer on explaining disambiguation of opcode space
556
557 > ...have different harts with different sets of encodings.)  Adding a "select"
558 > CSR as has been proposed does not escape this fundamental truth that
559 > instruction decode must be unambiguous, it merely expands every opcode with
560 > extra bits from a "select" CSR.
561
562 ## (5) Krste Asanovic on clarification of use of opcode space
563
564 > A CPU is even free to reuse some standard extension encoding space for
565 > non-standard extensions provided it does not claim to implement that
566 > standard extension.
567
568 ## (6) Clarification of difference between assembler and encodings
569
570 > > The extensible assembler database I proposed assumes that each processor
571 > > will have *one* and *only* one set of recognized instructions.  (The "hidden
572 > > prefix" is the immutable vendor/arch/impl tuple in my proposals.) 
573 >
574 >  ah this is an extremely important thing to clarify, the difference
575 > between the recognised instruction assembly mnemonic (which must be
576 > globally world-wide accepted as canonical) and the binary-level encodings
577 > of that mnemonic used different vendor implementations which will most
578 > definitely *not* be unique but require "registration" in the form of
579 > atomic acceptance as a patch by the FSF to gcc and binutils [and other
580 > compiler tools].
581
582
583 # References
584
585 * <https://groups.google.com/a/groups.riscv.org/forum/#!topic/isa-dev/7bbwSIW5aqM>
586 * <https://groups.google.com/a/groups.riscv.org/forum/#!topic/isa-dev/InzQ1wr_3Ak%5B1-25%5D>
587 * Review mvendorid-marchid WARL <https://groups.google.com/a/groups.riscv.org/forum/#!topic/isa-dev/Uvy9paXN1xA>