-
Notifications
You must be signed in to change notification settings - Fork 327
Expand file tree
/
Copy pathsail.json
More file actions
771 lines (771 loc) · 24 KB
/
Copy pathsail.json
File metadata and controls
771 lines (771 loc) · 24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
{
"$schema": "/opt/riscv/share/sail-riscv/sail_riscv_config_schema.json",
"base": {
"xlen": 64,
// Whether the base ISA is E, in which case accessing
// x16-31 is reserved and in this implementation will
// raise an illegal instruction exception.
"E": false,
"writable_misa": false,
"writable_fiom": true,
// The top 29 bits in this value control whether the corresponding
// HPM counters (hpmcounter31 .. hpmcounter3) are supported
// (i.e. are not read-only zero). A set bit specifies that the
// corresponding counter is supported. The lowest 3 bits
// (writable_hpm_counters[2 .. 0]) are ignored.
"writable_hpm_counters": {
"len": 32,
"value": "0xFFFF_FFFF"
},
// The bits in this value control whether the corresponding bits
// of the `scounteren` CSR that control access to HPM counters,
// and `cycle`, `time` and `instret` registers, are read-only
// zero. A set bit specifies that the corresponding bit of
// `scounteren` is writable, otherwise the bit is read-only zero.
// If Sscounterenw is supported the top 29 bits must be a superset of
// the top 29 bits of `writable_hpm_counters`.
"scounteren_writable_bits": {
"len": 32,
"value": "0xFFFF_FFFF"
},
// The bits in this value control whether the corresponding bits
// of the `mcounteren` CSR that control access to HPM counters,
// and `cycle`, `time` and `instret` registers at lower privilege
// modes, are read-only zero. A set bit specifies that the
// corresponding bit of `mcounteren` is writable, otherwise the
// bit is read-only zero.
"mcounteren_writable_bits": {
"len": 32,
"value": "0xFFFF_FFFF"
},
// `mtvec.{direct,vectored}.supported` indicates whether the
// corresponding mode is supported for `mtvec`. At least one mode
// should be supported. If both modes are supported, the mode on
// reset is unspecified.
// The `mtvec.{direct,vectored}.base_alignment` parameters control the alignment
// of the trap vector base for each mode. The alignment is
// specified as the power of 2 of the desired byte alignment, and
// can range from a minimum of 2 upto a maximum of 24. If
// unaligned values are written to these CSRs, the lowest bits
// will be zeroed to respect the specified alignment.
"mtvec": {
"direct": {
"supported": true,
"base_alignment": 2
},
"vectored": {
"supported": true,
"base_alignment": 6
}
},
// Similar to `mtvec` above. If `S` mode is not supported, these
// values need to be present and legal but are ignored.
"stvec": {
// The spec requires `base_alignment` for `stvec.direct` to be 2
// (i.e. 4-byte alignment), hence there is no configuration
// parameter for it.
"direct": {
"supported": true
},
"vectored": {
"supported": true,
"base_alignment": 2
}
},
// These settings control whether the specified exceptions
// cause information to be written into the appropriate
// `xtval` registers.
"xtval_nonzero": {
"illegal_instruction": true,
"software_breakpoint": true,
"hardware_breakpoint": true,
"load_address_misaligned": true,
"load_access_fault": true,
"load_page_fault": true,
"samo_address_misaligned": true,
"samo_access_fault": true,
"samo_page_fault": true,
"fetch_address_misaligned": true,
"fetch_access_fault": true,
"fetch_page_fault": true,
"software_check": true,
"reserved_exceptions": false
},
"reserved_behavior": {
// The configuration option determines how to handle the reserved behavior `amocas_odd_registers`.
// "AMOCAS_Fatal" – raise a Sail exception, stopping execution.
// "AMOCAS_Illegal" – treat it as an illegal instruction.
"amocas_odd_register": "AMOCAS_Illegal",
// The configuration option determines how to handle execution of a floating-point
// instruction with DYN (dynamic) rounding mode when `fcsr.FRM` contains a
// reserved value (0b101, 0b110, 0b111).
// This does not affect the execution of floating-point instructions that have a
// reserved rounding mode statically encoded in the instruction.
// "Fcsr_RM_Fatal" – raise a Sail exception, stopping execution.
// "Fcsr_RM_Illegal" – treat it as an illegal instruction.
"fcsr_rm": "Fcsr_RM_Illegal",
// The configuration option determines how to handle the reserved behavior `pmpcfg_with_R0W1`.
// "PMP_Fatal" – raise a Sail exception, stopping execution.
// "PMP_ClearPermissions" – convert a PMP entry with R=0, W=1 to R=0, W=0, X=0.
"pmpcfg_write_only": "PMP_ClearPermissions",
// The configuration option determines how to handle the reserved behavior `xenvcfg.CBIE` with 0b10.
// "Xenvcfg_Fatal" – raise a Sail exception, stopping execution.
// "Xenvcfg_ClearPermissions" – convert CBIE with 0b10 to 0b00.
"xenvcfg_cbie": "Xenvcfg_ClearPermissions",
// The configuration option determines how to handle the reserved behavior `xtvec[Mode] >= 2`.
// "Xtvec_Fatal" – raise a Sail exception, stopping execution.
// "Xtvec_Ignore" – use old Mode of xtvec.
"xtvec_mode": "Xtvec_Ignore",
// The configuration option determines how to handle the reserved behavior: Odd-numbered registers for RV32Zdinx.
// "Zdinx_Fatal" – raise a Sail exception, stopping execution.
// "Zdinx_Illegal" – treat it as an illegal instruction.
"rv32zdinx_odd_register": "Zdinx_Illegal"
},
"mstatus": {
// The legal values for the FS and VS fields in this CSR are
// specified by the two fields below. Their values can be one
// of:
// - "ExtContext_FourState" allows all values {Off, Initial, Clean, Dirty}.
// - "ExtContext_TwoState" allows {Off, Dirty}, and writes of Initial and Clean get written as Dirty.
// - "ExtContext_Off" allows only {Off}. This makes the field read-only zero.
"fs_legal_states": "ExtContext_FourState",
"vs_legal_states": "ExtContext_Off"
}
},
"memory": {
"pmp": {
"grain": 4,
// This specifies the number of PMP entries present.
// The value must be one of 0, 16, or 64.
"count": 16,
// This specifies the number of usable PMP entries.
// Entries higher than this are read-only-zero.
// The value must be less than or equal to `count`.
"usable_count": 16,
"tor_supported": true,
"na4_supported": false,
"napot_supported": true
},
// These settings control global support for misaligned access so they are
// checked before address translation. `misaligned_fault` in
// `regions` is checked after address translation.
"misaligned": {
// `exceptions` specifies the treatment of misaligned accesses
// before address translation. If a fault is specified for an access,
// it will have a higher priority than memory-protection faults arising from
// that access if it were allowed to proceed.
"exceptions": {
// A misaligned scalar or vector load/store can either proceed
// without a fault (use `{"None" : null}`), or raise an access fault
// (use `{"Some": "AccessFault"}`) or a misaligned exception
// (use `{"Some": "AlignmentException"}`).
// This option controls scalar loads/stores.
"load_store": {
"None": null
},
// A misaligned vector load/store can be configured
// independently of the scalar case above, but uses the same
// option values.
"vector": {
"None": null
},
// A misaligned LR/SC currently always faults, and this field can specify
// whether it generates an access fault (use `"AccessFault"`)
// or a misaligned exception (use `"AlignmentException"`).
"lrsc": "AccessFault",
// Similarly, a misaligned AMO currently always faults, and this field
// can specify either `"AccessFault"` or `"AlignmentException"`.
"amo": "AccessFault"
},
// If a misaligned access was specified to have no fault in `exceptions` above, the
// fields below specify how it is handled.
//
// Memory accesses that span multiple naturally aligned
// 2^allowed_within_exp sized regions will be split into multiple
// memory operations. 0 means all misaligned accesses will be split.
// The maximum value is 12 (one page).
"allowed_within_exp": 0,
// If the access gets split due to `allowed_within_exp` then the size
// of the operations will be one byte if `byte_by_byte` is set, otherwise
// they will be the maximum size possible based on the alignment. For
// example a 4-byte access to address 0x2 will use two 2-byte operations.
"byte_by_byte": false,
// If multiple memory operations are needed, this controls whether they
// are done in increasing or decreasing address order. This is architecturally
// observable because some store operations may succeed, and even for
// loads the resulting `xtval` may depend on this setting.
"order_decreasing": false
},
// Address to write DTB to (if provided). This must be in a suitable memory
// region (see `memory.regions`).
"dtb_address": {
"len": 64,
"value": "0x1000"
},
// The locations and sizes of memory regions and their PMAs. These regions
// are required to be aligned to 4K (page) boundaries. To specify
// the `misaligned` PMA attribute for a region, see the comments for
// `memory.misaligned.exceptions` above.
"regions": [
// ROM
{
"base": {
"len": 64,
"value": "0x1000"
},
"size": {
"len": 64,
"value": "0x1000"
},
"attributes": {
"mem_type": "IOMemory",
"cacheable": true,
"coherent": false,
"executable": false,
"readable": true,
"writable": false,
"read_idempotent": true,
"write_idempotent": true,
"misaligned_exceptions": {
"load_store": {
"None": null
},
"vector": {
"None": null
},
"amo": "AccessFault"
},
"atomic_support": "AMONone",
"reservability": "RsrvNone",
"supports_cbo_zero": false,
"supports_pte_read": false,
"supports_pte_write": false
},
"include_in_device_tree": false
},
// MMIO
{
"base": {
"len": 64,
"value": "0x2000000"
},
"size": {
"len": 64,
"value": "0x10000000"
},
"attributes": {
"mem_type": "IOMemory",
"cacheable": false,
"coherent": true,
"executable": false,
"readable": true,
"writable": true,
"read_idempotent": false,
"write_idempotent": false,
"misaligned_exceptions": {
"load_store": {
"Some": "AlignmentException"
},
"vector": {
"Some": "AlignmentException"
},
"amo": "AccessFault"
},
"atomic_support": "AMONone",
"reservability": "RsrvNone",
"supports_cbo_zero": false,
"supports_pte_read": false,
"supports_pte_write": false
},
"include_in_device_tree": false
},
// RAM
{
"base": {
"len": 64,
"value": "0x80000000"
},
"size": {
"len": 64,
"value": "0x80000000"
},
"attributes": {
"mem_type": "MainMemory",
"cacheable": true,
"coherent": true,
"executable": true,
"readable": true,
"writable": true,
"read_idempotent": true,
"write_idempotent": true,
"misaligned_exceptions": {
"load_store": {
"None": null
},
"vector": {
"None": null
},
"amo": "AccessFault"
},
"atomic_support": "AMOArithmetic",
"reservability": "RsrvEventual",
"supports_cbo_zero": true,
"supports_pte_read": true,
"supports_pte_write": true
},
"include_in_device_tree": true
}
]
},
"platform": {
"vendorid": 1538,
"archid": 36,
"impid": 256,
"hartid": 0,
// Cache block size, specified as a power of 2.
"cache_block_size_exp": 6,
"reservation": {
// This specifies both the size and alignment of the reservation set, specified as a power of 2.
// It must be at least 2 on RV32 and 3 on RV64 to support Zalrsc. It must not be more than
// 6 for Za64rs and 7 for Za128rs. In all cases, it must be less than or equal to 12.
"reservation_set_size_exp": 3,
// Some implementations (e.g. Spike) require the Store-Conditional to provide the same
// address as the matching Load-Reserve in order to succeed, regardless of the
// configured reservation set size. This controls whether such an exact address
// match is required for a Store-Conditional to succeed.
"require_exact_reservation_addr": false,
// Some implementations (e.g. SiFive U74) also invalidate the
// reservation on stores from the same hart. If this is set to `true`, the
// model invalidates the reservation if a store from the same hart lies within
// the reservation set.
"invalidate_on_same_hart_store": false
},
"clint": {
// Whether the platform contains a CLINT.
"supported": true,
// If supported, this must be in a suitable IO memory region (see `memory.regions`).
// Otherwise, these values can be left as 0.
"base": 33554432,
"size": 786432
},
// Very simple MMIO device to generate interrupts for testing
// purposes. See docs/SimpleInterruptGenerator.md for details.
"simple_interrupt_generator": {
// Whether the platform contains this device.
"supported": true,
// If supported, this must be in a suitable IO memory region (see `memory.regions`)
// and 4-byte aligned. The size is always 0x20. If not supported, this can be left
// as 0.
"base": 201326592
},
"clock_frequency": 1000000000,
"instructions_per_tick": 2,
"wfi_is_nop": false,
// WFI is optionally available to User mode. Note that even if
// `wfi_is_nop` is set to `true` above, it will still not be
// available to User mode unless `wfi_available_to_user_mode` is
// also `true`.
"wfi_available_to_user_mode": true,
// The maximum increment in the time CSR before a wait instruction
// (e.g. WFI, WRS.NTO, WRS.STO) that is not a NOP expires its
// wait. It is not possible to wait indefinitely.
//
// If WFI or WRS.STO (Short TimeOut) exceed this limit in
// non-machine privilege with mstatus[TW] set, an illegal
// instruction is raised. Otherwise they retire successfully.
//
// Note: it is also legal for these instructions to spuriously
// retire successfully at any point, but there is currently no
// configuration option for this behaviour.
"max_time_to_wait": 200
},
"extensions": {
"M": {
"supported": true
},
"A": {
"supported": true
},
"F": {
"supported": true
},
"D": {
"supported": true
},
"V": {
// `support_level` must be one of the below strings:
// . "Disabled" for no vector extension support
// . "Integer" for Zve*x support
// . "Float_single" for Zve*f support
// . "Float_double" for Zve*d support
// . "Full" for the full V extension
// Note that `support_level` requires compatible
// values for `vlen_exp` and `elen_exp` below.
// For e.g. Zve32x and Zve32f require `elen_exp` >= 5,
// Zve64x, Zve64f, and Zve64d require `elen_exp` >= 6,
// and V requires `elen_exp` >= 6 and `vlen_exp` >= 7.
"support_level": "Disabled",
// `vlen_exp` and `elen_exp` should be between 3 and 16,
// inclusive. If `support_level` is `"Disabled"`, then these
// should be left as 3 (or any other legal value).
"vlen_exp": 8,
"elen_exp": 6,
"reserved_behavior": {
// This determines how to handle attempts by vsetvli, vsetivli,
// and vsetvl to set an unsupported or reserved vtype.
// "IllegalVtype_SetVill" - set vtype.vill, set vl to zero, clear vstart, and write rd.
// "IllegalVtype_Illegal" - treat it as an illegal instruction.
// "IllegalVtype_Fatal" - raise a Sail exception, stopping execution.
"illegal_vtype": "IllegalVtype_SetVill",
// This determines how to handle an out-of-bounds vstart (vstart >= VLMAX), which the
// vector spec marks reserved and recommends, but does not require, trapping.
// "Vstart_Illegal" - raise an illegal instruction exception.
// "Vstart_Ignore" - treat as a no-op, the instruction writes nothing.
"vstart_out_of_bounds": "Vstart_Illegal"
},
"vl_use_ceil": false,
// The maximum index EEW for indexed vector addressing mode, as
// a power of 2. This must be at least 3 but must not exceed
// the supported ELEN.
"max_index_eew_exp": 6,
"vstart": {
// The vector specification permits implementations to raise an
// illegal instruction exception when `vstart` is non-zero for
// instructions that cannot produce such a `vstart` value through
// normal execution.
"zero_required": {
// Whether vector arithmetic instructions raise an illegal instruction
// exception when `vstart` is non-zero. This also governs instructions
// from the Zvbb, Zvbc, Zvabd, Zvfbfmin, and Zvfbfwma extensions.
"arith": true,
// Whether the vector scalar move instructions (vmv.x.s, vmv.s.x,
// vfmv.f.s and vfmv.s.f) raise an illegal instruction exception when
// `vstart` is non-zero.
"scalar_move": true
}
}
},
"B": {
"supported": true
},
"S": {
"supported": true
},
"U": {
"supported": true
},
"Zibi": {
"supported": false
},
// This extension just asserts that the cache block size is 64 bytes.
// If you enable this you also need to ensure `platform.cache_block_size_exp`
// is 6, otherwise you will get a config validation error.
"Zic64b": {
"supported": true
},
"Zicbom": {
"supported": true
},
"Zicbop": {
"supported": true
},
"Zicboz": {
"supported": true
},
"Ziccamoa": {
"supported": true
},
"Ziccamoc": {
"supported": false
},
"Ziccif": {
"supported": true
},
"Zicclsm": {
"supported": true
},
"Ziccrse": {
"supported": true
},
"Zicfilp": {
"supported": false
},
"Zicfiss": {
"supported": false
},
"Zicond": {
"supported": true
},
"Zicntr": {
"supported": true
},
"Zicsr": {
"supported": true
},
"Zifencei": {
"supported": true
},
"Zihintntl": {
"supported": true
},
"Zihintpause": {
"supported": true
},
"Zihpm": {
"supported": true
},
"Zimop": {
"supported": false
},
"Zmmul": {
"supported": true
},
"Zaamo": {
"supported": true
},
"Zabha": {
"supported": false
},
"Zacas": {
"supported": false
},
"Zalrsc": {
"supported": true
},
"Zawrs": {
"supported": false,
// Whether `WRS.NTO` and `WRS.STO` behave as NOPS. If they do
// not, see above note for `platform.max_time_to_wait`. If
// Zawrs is not supported, these `is_nop` fields need to be
// present but their boolean values are ignored.
"nto": {
"is_nop": false
},
"sto": {
"is_nop": false
}
},
"Zfa": {
"supported": true
},
"Zfbfmin": {
"supported": false
},
"Zfh": {
"supported": true
},
"Zfhmin": {
"supported": true
},
"Zfinx": {
"supported": false
},
"Zdinx": {
"supported": false
},
"Zca": {
"supported": true
},
"Zcf": {
"supported": false
},
"Zcd": {
"supported": true
},
"Zcb": {
"supported": true
},
"Zcmop": {
"supported": false
},
"Zba": {
"supported": true
},
"Zbb": {
"supported": true
},
"Zbs": {
"supported": true
},
"Zbc": {
"supported": true
},
"Zbkb": {
"supported": true
},
"Zbkc": {
"supported": true
},
"Zbkx": {
"supported": true
},
"Zknd": {
"supported": true
},
"Zkne": {
"supported": true
},
"Zknh": {
"supported": true
},
"Zkr": {
"supported": false,
// If Zkr is not supported, these fields need to be present but
// their boolean values are ignored.
"sseed_reset_value": false,
"useed_reset_value": false,
"sseed_read_only_zero": false,
"useed_read_only_zero": false
},
"Zksed": {
"supported": false
},
"Zksh": {
"supported": false
},
"Zkt": {
"supported": true
},
"Zhinx": {
"supported": false
},
"Zhinxmin": {
"supported": false
},
"Zvabd": {
"supported": false
},
"Zvfbfmin": {
"supported": false
},
"Zvfbfwma": {
"supported": false
},
"Zvfh": {
"supported": false
},
"Zvfhmin": {
"supported": false
},
"Zvbb": {
"supported": false
},
"Zvbc": {
"supported": false
},
"Zvkb": {
"supported": false
},
"Zvkg": {
"supported": false
},
"Zvkned": {
"supported": false
},
"Zvknha": {
"supported": false
},
"Zvknhb": {
"supported": false
},
"Zvksed": {
"supported": false
},
"Zvksh": {
"supported": false
},
"Zvkt": {
"supported": false
},
"Ssccptr": {
"supported": true
},
"Sscofpmf": {
"supported": false
},
"Sscounterenw": {
"supported": true
},
"Sstc": {
"supported": true
},
// Enabling Sstvala requires that the exceptions specified in the extension
// have their appropriate settings under `base.xtval_nonzero`.
"Sstvala": {
"supported": true
},
"Svade": {
"supported": true
},
"Svadu": {
"supported": true
},
"Svinval": {
"supported": true
},
"Svrsw60t59b": {
"supported": false
},
"Svnapot": {
"supported": true
},
"Ssnpm": {
"supported": false,
"supported_pmlen_7": true,
"supported_pmlen_16": true
},
"Smnpm": {
"supported": false,
"supported_pmlen_7": true,
"supported_pmlen_16": true
},
"Smmpm": {
"supported": false,
"supported_pmlen_7": true,
"supported_pmlen_16": true
},
"Smcntrpmf": {
"supported": false
},
"Svbare": {
"supported": true,
"sfence_vma_illegal_if_svbare_only": true
},
"Sv32": {
"supported": false
},
"Sv39": {
"supported": true
},
"Sv48": {
"supported": true
},
"Sv57": {
"supported": true
},
"Stateen": {
"Smstateen": {
"supported": false
},
"Ssstateen": {
"supported": false
},
"C_readonly_zero": true,
"SE0_readonly_zero": false
},
"Ssqosid": {
"supported": false,
// These lengths should be between 1 and 12, inclusive.
// If Ssqosid is not supported, this should be left as 1
// (or any other legal value).
"rcid_length": 12,
"mcid_length": 12
},
"Svpbmt": {
"supported": true
},
"Svvptc": {
"supported": true
}
}
}