udb 0.1.15 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.data/cfgs/example_rv64_with_overlay.yaml +1 -0
  3. data/.data/cfgs/mc100-32-full-example.yaml +1 -0
  4. data/.data/cfgs/profile/RVA20S64.yaml +2 -0
  5. data/.data/cfgs/profile/RVA20U64.yaml +2 -0
  6. data/.data/cfgs/profile/RVA22S64.yaml +2 -0
  7. data/.data/cfgs/profile/RVA22U64.yaml +2 -0
  8. data/.data/cfgs/profile/RVA23S64.yaml +2 -0
  9. data/.data/cfgs/profile/RVA23U64.yaml +2 -0
  10. data/.data/cfgs/profile/RVB23S64.yaml +2 -0
  11. data/.data/cfgs/profile/RVB23U64.yaml +2 -0
  12. data/.data/cfgs/qc_iu.yaml +1 -0
  13. data/.data/cfgs/rv32-riscv-tests.yaml +1 -0
  14. data/.data/cfgs/rv32-vector.yaml +1 -0
  15. data/.data/cfgs/rv64-riscv-tests.yaml +1 -0
  16. data/.data/cfgs/rv64-vector.yaml +1 -0
  17. data/.data/spec/std/isa/csr/H/henvcfg.yaml +1 -1
  18. data/.data/spec/std/isa/csr/H/htimedeltah.yaml +1 -1
  19. data/.data/spec/std/isa/csr/Smctr/vsctrctl.yaml +1 -1
  20. data/.data/spec/std/isa/csr/hstateen0h.yaml +1 -1
  21. data/.data/spec/std/isa/csr/hstateen1h.yaml +1 -1
  22. data/.data/spec/std/isa/csr/hstateen2h.yaml +1 -1
  23. data/.data/spec/std/isa/csr/hstateen3h.yaml +1 -1
  24. data/.data/spec/std/isa/csr/instreth.yaml +1 -3
  25. data/.data/spec/std/isa/csr/minstreth.yaml +1 -1
  26. data/.data/spec/std/isa/csr/mstatus.yaml +1 -1
  27. data/.data/spec/std/isa/csr/mstatush.yaml +1 -1
  28. data/.data/spec/std/isa/csr/senvcfg.yaml +1 -1
  29. data/.data/spec/std/isa/csr/sepc.yaml +4 -3
  30. data/.data/spec/std/isa/csr/sip.yaml +1 -1
  31. data/.data/spec/std/isa/csr/sscratch.yaml +3 -2
  32. data/.data/spec/std/isa/csr/stval.yaml +3 -2
  33. data/.data/spec/std/isa/csr/stvec.yaml +5 -4
  34. data/.data/spec/std/isa/csr/time.yaml +1 -1
  35. data/.data/spec/std/isa/csr/timeh.yaml +1 -1
  36. data/.data/spec/std/isa/csr/vsepc.yaml +6 -5
  37. data/.data/spec/std/isa/csr/vstvec.yaml +5 -4
  38. data/.data/spec/std/isa/ext/M.yaml +4 -0
  39. data/.data/spec/std/isa/ext/Shgatpa.yaml +1 -0
  40. data/.data/spec/std/isa/ext/Zibi.yaml +29 -0
  41. data/.data/spec/std/isa/inst/B/roriw.yaml +1 -1
  42. data/.data/spec/std/isa/inst/B/rorw.yaml +1 -1
  43. data/.data/spec/std/isa/inst/F/fmv.w.x.yaml +3 -0
  44. data/.data/spec/std/isa/inst/F/fmv.x.w.yaml +3 -0
  45. data/.data/spec/std/isa/inst/M/mul.yaml +1 -3
  46. data/.data/spec/std/isa/inst/M/mulh.yaml +1 -3
  47. data/.data/spec/std/isa/inst/M/mulhsu.yaml +1 -3
  48. data/.data/spec/std/isa/inst/M/mulhu.yaml +1 -3
  49. data/.data/spec/std/isa/inst/M/mulw.yaml +1 -3
  50. data/.data/spec/std/isa/inst/Zbb/ctzw.yaml +6 -1
  51. data/.data/spec/std/isa/inst/{Q → Zfa}/fltq.q.yaml +2 -2
  52. data/.data/spec/std/isa/inst/Zibi/beqi.yaml +45 -0
  53. data/.data/spec/std/isa/inst/Zibi/bnei.yaml +45 -0
  54. data/.data/spec/std/isa/inst/Zicbom/cbo.inval.yaml +1 -1
  55. data/.data/spec/std/isa/inst/Zicfiss/ssamoswap.d.yaml +1 -1
  56. data/.data/spec/std/isa/inst/Zicfiss/ssamoswap.w.yaml +1 -1
  57. data/.data/spec/std/isa/inst/Zicfiss/sspopchk.yaml +63 -0
  58. data/.data/spec/std/isa/inst/Zicfiss/sspush.yaml +63 -0
  59. data/.data/spec/std/isa/inst/Zimop/mop.r.28.yaml +1 -2
  60. data/.data/spec/std/isa/inst/Zimop/mop.r.N.layout +1 -2
  61. data/.data/spec/std/isa/inst/Zimop/mop.rr.7.yaml +1 -2
  62. data/.data/spec/std/isa/inst/Zimop/mop.rr.N.layout +1 -2
  63. data/.data/spec/std/isa/inst/{Zvbb → Zvkb}/vandn.vv.yaml +1 -1
  64. data/.data/spec/std/isa/inst/{Zvbb → Zvkb}/vandn.vx.yaml +1 -1
  65. data/.data/spec/std/isa/inst/{Zvbb → Zvkb}/vbrev8.v.yaml +1 -1
  66. data/.data/spec/std/isa/inst/{Zvbb → Zvkb}/vrev8.v.yaml +1 -1
  67. data/.data/spec/std/isa/inst/{Zvbb → Zvkb}/vrol.vv.yaml +1 -1
  68. data/.data/spec/std/isa/inst/{Zvbb → Zvkb}/vrol.vx.yaml +1 -1
  69. data/.data/spec/std/isa/inst/{Zvbb → Zvkb}/vror.vi.yaml +1 -1
  70. data/.data/spec/std/isa/inst/{Zvbb → Zvkb}/vror.vv.yaml +1 -1
  71. data/.data/spec/std/isa/inst/{Zvbb → Zvkb}/vror.vx.yaml +1 -1
  72. data/.data/spec/std/isa/isa/globals.isa +1 -1
  73. data/.data/spec/std/isa/isa/util.idl +3 -3
  74. data/.data/spec/std/isa/param/COUNTINHIBIT_EN.yaml +9 -0
  75. data/.data/spec/std/isa/param/HCONTEXT_AVAILABLE.yaml +1 -1
  76. data/.data/spec/std/isa/param/MUTABLE_MISA_H.yaml +1 -1
  77. data/.data/spec/std/isa/param/MUTABLE_MISA_S.yaml +1 -1
  78. data/lib/udb/config.rb +1 -1
  79. data/lib/udb/version.rb +1 -1
  80. metadata +47 -46
  81. data/.data/spec/std/isa/inst/Zicfiss/sspopchk.x1.yaml +0 -25
  82. data/.data/spec/std/isa/inst/Zicfiss/sspopchk.x5.yaml +0 -25
  83. data/.data/spec/std/isa/inst/Zicfiss/sspush.x1.yaml +0 -25
  84. data/.data/spec/std/isa/inst/Zicfiss/sspush.x5.yaml +0 -25
  85. /data/.data/spec/std/isa/inst/{Smdbltrp → Smctr}/sctrclr.yaml +0 -0
  86. /data/.data/spec/std/isa/inst/{D → Zfa}/fcvtmod.w.d.yaml +0 -0
  87. /data/.data/spec/std/isa/inst/{D → Zfa}/fleq.d.yaml +0 -0
  88. /data/.data/spec/std/isa/inst/{Zfh → Zfa}/fleq.h.yaml +0 -0
  89. /data/.data/spec/std/isa/inst/{Q → Zfa}/fleq.q.yaml +0 -0
  90. /data/.data/spec/std/isa/inst/{F → Zfa}/fleq.s.yaml +0 -0
  91. /data/.data/spec/std/isa/inst/{D → Zfa}/fli.d.yaml +0 -0
  92. /data/.data/spec/std/isa/inst/{Zfh → Zfa}/fli.h.yaml +0 -0
  93. /data/.data/spec/std/isa/inst/{Q → Zfa}/fli.q.yaml +0 -0
  94. /data/.data/spec/std/isa/inst/{D → Zfa}/fltq.d.yaml +0 -0
  95. /data/.data/spec/std/isa/inst/{Zfh → Zfa}/fltq.h.yaml +0 -0
  96. /data/.data/spec/std/isa/inst/{F → Zfa}/fltq.s.yaml +0 -0
  97. /data/.data/spec/std/isa/inst/{D → Zfa}/fmaxm.d.yaml +0 -0
  98. /data/.data/spec/std/isa/inst/{Zfh → Zfa}/fmaxm.h.yaml +0 -0
  99. /data/.data/spec/std/isa/inst/{Q → Zfa}/fmaxm.q.yaml +0 -0
  100. /data/.data/spec/std/isa/inst/{D → Zfa}/fminm.d.yaml +0 -0
  101. /data/.data/spec/std/isa/inst/{Zfh → Zfa}/fminm.h.yaml +0 -0
  102. /data/.data/spec/std/isa/inst/{Q → Zfa}/fminm.q.yaml +0 -0
  103. /data/.data/spec/std/isa/inst/{D → Zfa}/fmvh.x.d.yaml +0 -0
  104. /data/.data/spec/std/isa/inst/{Q → Zfa}/fmvh.x.q.yaml +0 -0
  105. /data/.data/spec/std/isa/inst/{D → Zfa}/fmvp.d.x.yaml +0 -0
  106. /data/.data/spec/std/isa/inst/{Q → Zfa}/fmvp.q.x.yaml +0 -0
  107. /data/.data/spec/std/isa/inst/{D → Zfa}/fround.d.yaml +0 -0
  108. /data/.data/spec/std/isa/inst/{Zfh → Zfa}/fround.h.yaml +0 -0
  109. /data/.data/spec/std/isa/inst/{Q → Zfa}/fround.q.yaml +0 -0
  110. /data/.data/spec/std/isa/inst/{D → Zfa}/froundnx.d.yaml +0 -0
  111. /data/.data/spec/std/isa/inst/{Zfh → Zfa}/froundnx.h.yaml +0 -0
  112. /data/.data/spec/std/isa/inst/{Q → Zfa}/froundnx.q.yaml +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c4e7059a447d2f815adfb15bfe6152a60e2a238167245bc3fbaf26de73859c3
4
- data.tar.gz: fd573fc43f859b0fd40cb3a283015af2aa4a7f33fe1c2c2b1285f6e5fde2a3a9
3
+ metadata.gz: 642af8189712e586458dbc95aecdec921fff4d765b5914f00c59adf422ee60a0
4
+ data.tar.gz: 8e914af25855fd5335cee61d48b29b224886c39cb5b63b00530fc0fe0cc83747
5
5
  SHA512:
6
- metadata.gz: cf76d15fcf97eba3aa58b29fbb4f6a45d486541f1bcba5ca35b3d7b15a67e957e9d60eaf9b7a1e2b7e53eeb4ddf0b6d9f0b1fbbdc6ba89befcfbbb5b1b8804be
7
- data.tar.gz: a3051975397d7412e1cd39c2a4e352f2d42763c0d2663fb553198ca9c175725dbf47694f48a56c8615219b5d457a1aed20cb89b1094d75382279dfe23c619d63
6
+ metadata.gz: 23f4835af0d1fd845ef8c48ddd7dfce7354aa6656ad993ed189234fbe2f43eb01700ec24972336bcc3ddb6e0c41ee609eac4a8f88f6021e388a09e69e2a59834
7
+ data.tar.gz: 2eb190eecd92203f877366434e3400b58d50007da7dfbdf5745bed97443a4c39d6120624cac2eebcba697ad77ae81bc1eaaca91c60b71dd02daee44768a4e26f
@@ -22,6 +22,7 @@ implemented_extensions:
22
22
  - [I, "2.1.0"]
23
23
  - [H, "1.0.0"]
24
24
  - [M, "2.0.0"]
25
+ - [Zmmul, "1.0.0"]
25
26
  - [S, "1.12.0"]
26
27
  - [Sm, "1.12.0"]
27
28
  - [U, "1.0.0"]
@@ -11,6 +11,7 @@ implemented_extensions:
11
11
  - [C, "2.0"]
12
12
  - [Zca, "1.0"]
13
13
  - [M, "2.0"]
14
+ - [Zmmul, "1.0"]
14
15
  - [Zicsr, "2.0"]
15
16
  - [Zicntr, "2.0"]
16
17
  - [Smrnmi, "1.0"]
@@ -66,6 +66,8 @@ mandatory_extensions:
66
66
  version: "~> 2.0"
67
67
  - name: Zifencei
68
68
  version: "~> 2.0"
69
+ - name: Zmmul
70
+ version: "~> 1.0.0"
69
71
  non_mandatory_extensions:
70
72
  - name: Ssu64xl
71
73
  version: "~> 1.0"
@@ -48,6 +48,8 @@ mandatory_extensions:
48
48
  version: "~> 2.0"
49
49
  - name: Zicsr
50
50
  version: "~> 2.0"
51
+ - name: Zmmul
52
+ version: "~> 1.0.0"
51
53
  non_mandatory_extensions:
52
54
  - name: Zca
53
55
  version: "~> 1.0"
@@ -98,6 +98,8 @@ mandatory_extensions:
98
98
  version: "~> 2.0"
99
99
  - name: Zkt
100
100
  version: "~> 1.0"
101
+ - name: Zmmul
102
+ version: "~> 1.0.0"
101
103
  non_mandatory_extensions:
102
104
  - name: Sha
103
105
  version: "~> 1.0"
@@ -74,6 +74,8 @@ mandatory_extensions:
74
74
  version: "~> 2.0"
75
75
  - name: Zkt
76
76
  version: "~> 1.0"
77
+ - name: Zmmul
78
+ version: "~> 1.0.0"
77
79
  non_mandatory_extensions:
78
80
  - name: V
79
81
  version: "~> 1.0"
@@ -144,6 +144,8 @@ mandatory_extensions:
144
144
  version: "~> 1.0"
145
145
  - name: Zkt
146
146
  version: "~> 1.0"
147
+ - name: Zmmul
148
+ version: "~> 1.0.0"
147
149
  - name: Zvbb
148
150
  version: "~> 1.0"
149
151
  - name: Zve32f
@@ -92,6 +92,8 @@ mandatory_extensions:
92
92
  version: "~> 1.0"
93
93
  - name: Zkt
94
94
  version: "~> 1.0"
95
+ - name: Zmmul
96
+ version: "~> 1.0.0"
95
97
  - name: Zvbb
96
98
  version: "~> 1.0"
97
99
  - name: Zve32f
@@ -118,6 +118,8 @@ mandatory_extensions:
118
118
  version: "~> 1.0"
119
119
  - name: Zkt
120
120
  version: "~> 1.0"
121
+ - name: Zmmul
122
+ version: "~> 1.0.0"
121
123
  non_mandatory_extensions:
122
124
  - name: Sdtrig
123
125
  version: "~> 1.0"
@@ -86,6 +86,8 @@ mandatory_extensions:
86
86
  version: "~> 1.0"
87
87
  - name: Zkt
88
88
  version: "~> 1.0"
89
+ - name: Zmmul
90
+ version: "~> 1.0.0"
89
91
  non_mandatory_extensions:
90
92
  - name: Supm
91
93
  version: "~> 1.0"
@@ -12,6 +12,7 @@ implemented_extensions:
12
12
  - { name: Smdbltrp, version: "= 1.0" }
13
13
  - { name: I, version: "= 2.1" }
14
14
  - { name: M, version: "= 2.0" }
15
+ - { name: Zmmul, version: "= 1.0" }
15
16
  - { name: B, version: "= 1.0" }
16
17
  - { name: Zbs, version: "= 1.0" }
17
18
  - { name: Zbb, version: "= 1.0" }
@@ -12,6 +12,7 @@ implemented_extensions:
12
12
  - [C, "2.0"]
13
13
  - [Zca, "1.0.0"]
14
14
  - [M, "2.0"]
15
+ - [Zmmul, "1.0"]
15
16
  - [Zicsr, "2.0"]
16
17
  - [Zicntr, "2.0"]
17
18
  - [Smrnmi, "1.0"]
@@ -16,6 +16,7 @@ implemented_extensions:
16
16
  - [D, "2.2.0"]
17
17
  - [F, "2.2.0"]
18
18
  - [M, "2.0"]
19
+ - [Zmmul, "1.0"]
19
20
  - [Zicsr, "2.0"]
20
21
  - [Zicntr, "2.0"]
21
22
  - [Smrnmi, "1.0"]
@@ -11,6 +11,7 @@ implemented_extensions:
11
11
  - [I, "2.1"]
12
12
  - [C, "2.0"]
13
13
  - [M, "2.0"]
14
+ - [Zmmul, "1.0"]
14
15
  - [Zicsr, "2.0"]
15
16
  - [Zicntr, "2.0"]
16
17
  - [Smrnmi, "1.0"]
@@ -13,6 +13,7 @@ implemented_extensions:
13
13
  - [Zca, "1.0.0"]
14
14
  - [Zcd, "1.0.0"]
15
15
  - [M, "2.0"]
16
+ - [Zmmul, "1.0"]
16
17
  - [Zicsr, "2.0"]
17
18
  - [Zicntr, "2.0"]
18
19
  - [Smrnmi, "1.0"]
@@ -258,7 +258,7 @@ fields:
258
258
  if (csr_value.CBIE == 0 || csr_value.CBIE == 1 || csr_value.CBIE == 3) {
259
259
  return csr_value.CBIE;
260
260
  } else {
261
- return CSR[menvcfg].CBIE;
261
+ return CSR[henvcfg].CBIE;
262
262
  }
263
263
  reset_value: UNDEFINED_LEGAL
264
264
  SSE:
@@ -29,4 +29,4 @@ fields:
29
29
  CSR[htimedelta].DELTA = {csr_value.DELTA, CSR[htimedelta].DELTA[31:0]};
30
30
  return csr_value.DELTA;
31
31
  sw_read(): |
32
- return CSR[htimedelta].DELTA[31:0];
32
+ return CSR[htimedelta].DELTA[63:32];
@@ -225,4 +225,4 @@ sw_read(): |
225
225
  if (MCTRCTL_CUSTOM_IMPLEMENTED) {
226
226
  mask = mask | (4'b1111 `<< 60);
227
227
  }
228
- return ($bits(CSR[mctrctl]) & mask);
228
+ return ($bits(CSR[vsctrctl]) & mask);
@@ -156,4 +156,4 @@ fields:
156
156
  `mstateen0.CTR=0`.
157
157
  type: RW
158
158
  reset_value: 0
159
- sw_read(): return $bits(CSR[hstateen0])[63:32];
159
+ sw_read(): return CSR[hstateen0].sw_read()[63:32];
@@ -44,4 +44,4 @@ fields:
44
44
  The SE0 bit in `hstateen1h` controls access to the `sstateen1` CSR.
45
45
  type: RW
46
46
  reset_value: UNDEFINED_LEGAL
47
- sw_read(): return $bits(CSR[hstateen1])[63:32];
47
+ sw_read(): return CSR[hstateen1].sw_read()[63:32];
@@ -44,4 +44,4 @@ fields:
44
44
  The SE0 bit in `hstateen2h` controls access to the `sstateen2` CSR.
45
45
  type: RW
46
46
  reset_value: UNDEFINED_LEGAL
47
- sw_read(): return $bits(CSR[hstateen2])[63:32];
47
+ sw_read(): return CSR[hstateen2].sw_read()[63:32];
@@ -44,4 +44,4 @@ fields:
44
44
  The SE0 bit in `hstateen3h` controls access to the `sstateen3` CSR.
45
45
  type: RW
46
46
  reset_value: UNDEFINED_LEGAL
47
- sw_read(): return $bits(CSR[hstateen3])[63:32];
47
+ sw_read(): return CSR[hstateen3].sw_read()[63:32];
@@ -76,6 +76,4 @@ sw_read(): |
76
76
  }
77
77
  }
78
78
 
79
- # since the counter may be shared among harts, reads must be handled
80
- # as a builtin function
81
- return read_mcycle();
79
+ return CSR[minstret].COUNT[63:32];
@@ -34,6 +34,6 @@ definedBy:
34
34
  allOf:
35
35
  - xlen: 32
36
36
  - extension:
37
- name: Zicntr
37
+ name: Sm
38
38
  sw_read(): |
39
39
  return CSR[minstret].COUNT[63:32];
@@ -71,7 +71,7 @@ fields:
71
71
  - extension:
72
72
  name: Smdbltrp
73
73
  type: RW-H
74
- reset_value: UNDEFINED_LEGAL
74
+ reset_value: 1
75
75
  MPELP:
76
76
  location: 41
77
77
  long_name: M-mode Previous Expected Landing Pad state
@@ -26,7 +26,7 @@ fields:
26
26
  description: |
27
27
  see `mstatus.MDT`
28
28
  type: RW-H
29
- reset_value: UNDEFINED_LEGAL
29
+ reset_value: 1
30
30
  alias: mstatus.MDT
31
31
  definedBy:
32
32
  extension:
@@ -12,7 +12,7 @@ long_name: Supervisor Environment Configuration
12
12
  description: |
13
13
  Contains fields that control certain characteristics of the U-mode execution environment.
14
14
  priv_mode: S
15
- length: 64
15
+ length: SXLEN
16
16
  definedBy:
17
17
  extension:
18
18
  allOf:
@@ -10,7 +10,7 @@ long_name: Supervisor Exception Program Counter
10
10
  address: 0x141
11
11
  writable: true
12
12
  priv_mode: S
13
- length: 64
13
+ length: SXLEN
14
14
  description: |
15
15
  Written with the PC of an instruction on an exception or interrupt taken in (H)S-mode.
16
16
 
@@ -20,7 +20,8 @@ definedBy:
20
20
  name: S
21
21
  fields:
22
22
  PC:
23
- location: 63-0
23
+ location_rv32: 31-0
24
+ location_rv64: 63-0
24
25
  description: |
25
26
  When a trap is taken into S-mode, `sepc.PC` is written with the virtual address of the
26
27
  instruction that was interrupted or that encountered the exception.
@@ -38,7 +39,7 @@ fields:
38
39
  When `misa.C` is clear, bit 1 is masked to zero. Writes to bit 1 are still captured, and
39
40
  may be visible on the next read with `misa.C` is set.
40
41
 
41
- Holds bits 63:<%= ext?(:C) ? 2 : 1 %> of the virtual address associated with an exception.
42
+ Holds bits [SXLEN-1:<%= ext?(:C) ? 2 : 1 %>] of the virtual address associated with an exception.
42
43
  type: RW-RH
43
44
  sw_write(csr_value): |
44
45
  return csr_value.PC & ~64'b1;
@@ -15,7 +15,7 @@ description: |
15
15
 
16
16
  Hypervisor-related interrupts (VS-mode interrupts and Supervisor Guest interrupts) are not reflected
17
17
  in `sip` even though those interrupts can be taken in HS-mode. Instead, they are reported through `hip`.
18
- length: 64
18
+ length: SXLEN
19
19
  definedBy:
20
20
  extension:
21
21
  name: S
@@ -10,14 +10,15 @@ long_name: Supervisor Scratch Register
10
10
  address: 0x140
11
11
  writable: true
12
12
  priv_mode: S
13
- length: 64
13
+ length: SXLEN
14
14
  description: Scratch register for software use. Bits are not interpreted by hardware.
15
15
  definedBy: # actually, defined by RV64, but must implement U-mode for this CSR to exist
16
16
  extension:
17
17
  name: S
18
18
  fields:
19
19
  SCRATCH:
20
- location: 63-0
20
+ location_rv32: 31-0
21
+ location_rv64: 63-0
21
22
  description: Scratch value
22
23
  type: RW
23
24
  reset_value: UNDEFINED_LEGAL
@@ -11,13 +11,14 @@ address: 0x143
11
11
  writable: true
12
12
  description: Holds trap-specific information
13
13
  priv_mode: S
14
- length: 64
14
+ length: SXLEN
15
15
  definedBy:
16
16
  extension:
17
17
  name: S
18
18
  fields:
19
19
  VALUE:
20
- location: 63-0
20
+ location_rv32: 31-0
21
+ location_rv64: 63-0
21
22
  description: |
22
23
  Written with trap-specific information when a trap is taken into S-mode.
23
24
 
@@ -10,19 +10,20 @@ long_name: Supervisor Trap Vector
10
10
  address: 0x105
11
11
  writable: true
12
12
  priv_mode: S
13
- length: 64
13
+ length: SXLEN
14
14
  description: Controls where traps jump.
15
15
  definedBy:
16
16
  extension:
17
17
  name: S
18
18
  fields:
19
19
  BASE:
20
- location: 63-2
20
+ location_rv32: 31-2
21
+ location_rv64: 63-2
21
22
  description: |
22
23
  <%- va_size = ext?(:Sv57) ? 57 : (ext?(:Sv48) ? 48 : 39) -%>
23
- Bits 63:2 of the virtual address of the exception vector for any trap taken into S-mode.
24
+ Bits [SXLEN-1:2] of the virtual address of the exception vector for any trap taken into S-mode.
24
25
 
25
- If the base address is written with a non-canonical address (_i.e._, bits 63:<%= va_size %> do not match bit <%= va_size-1 %>),
26
+ If the base address is written with a non-canonical address (_i.e._, bits [SXLEN-1:<%= va_size %>] do not match bit <%= va_size-1 %>),
26
27
  the write should be ignored.
27
28
 
28
29
  type: RW-R
@@ -79,7 +79,7 @@ sw_read(): |
79
79
  }
80
80
  } else if (mode() == PrivilegeMode::VU) {
81
81
  # access in VU mode
82
- if (((CSR[hcounteren].TM & CSR[scounteren].TM) == 1'b0) && (CSR[mcounteren].IR == 1'b1)) {
82
+ if (((CSR[hcounteren].TM & CSR[scounteren].TM) == 1'b0) && (CSR[mcounteren].TM == 1'b1)) {
83
83
  raise(ExceptionCode::VirtualInstruction, mode(), $encoding);
84
84
  } else if (CSR[mcounteren].TM == 1'b0) {
85
85
  raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
@@ -80,7 +80,7 @@ sw_read(): |
80
80
  }
81
81
  } else if (mode() == PrivilegeMode::VU) {
82
82
  # access in VU mode
83
- if (((CSR[hcounteren].TM & CSR[scounteren].TM) == 1'b0) && (CSR[mcounteren].IR == 1'b1)) {
83
+ if (((CSR[hcounteren].TM & CSR[scounteren].TM) == 1'b0) && (CSR[mcounteren].TM == 1'b1)) {
84
84
  raise(ExceptionCode::VirtualInstruction, mode(), $encoding);
85
85
  } else if (CSR[mcounteren].TM == 1'b0) {
86
86
  raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
@@ -11,7 +11,7 @@ address: 0x241
11
11
  writable: true
12
12
  virtual_address: 0x141
13
13
  priv_mode: VS
14
- length: 64
14
+ length: VSXLEN
15
15
  description: |
16
16
  Written with the PC of an instruction on an exception or interrupt taken in VS-mode.
17
17
 
@@ -21,7 +21,8 @@ definedBy:
21
21
  name: H
22
22
  fields:
23
23
  PC:
24
- location: 63-0
24
+ location_rv32: 31-0
25
+ location_rv64: 63-0
25
26
  description: |
26
27
  When a trap is taken into VS-mode, `vsepc.PC` is written with the virtual address of the
27
28
  instruction that was interrupted or that encountered the exception.
@@ -39,14 +40,14 @@ fields:
39
40
  When `misa.C` is clear, bit 1 is masked to zero. Writes to bit 1 are still captured, and
40
41
  may be visible on the next read with `misa.C` is set.
41
42
 
42
- Holds bits 63:<%= ext?(:C) ? 2 : 1 %> of the virtual address associated with an exception.
43
+ Holds bits [VSXLEN-1:<%= ext?(:C) ? 2 : 1 %>] of the virtual address associated with an exception.
43
44
  type: RW-RH
44
45
  sw_write(csr_value): |
45
46
  return csr_value.PC & ~64'b1;
46
47
  reset_value: UNDEFINED_LEGAL
47
48
  sw_read(): |
48
49
  if (implemented?(ExtensionName::C) && CSR[misa].C == 1'b1) {
49
- return CSR[sepc].PC & ~64'b1;
50
+ return CSR[vsepc].PC & ~64'b1;
50
51
  } else {
51
- return CSR[sepc].PC;
52
+ return CSR[vsepc].PC;
52
53
  }
@@ -11,19 +11,20 @@ address: 0x205
11
11
  writable: true
12
12
  virtual_address: 0x105
13
13
  priv_mode: VS
14
- length: 64
14
+ length: VSXLEN
15
15
  description: Controls where traps jump.
16
16
  definedBy:
17
17
  extension:
18
18
  name: H
19
19
  fields:
20
20
  BASE:
21
- location: 63-2
21
+ location_rv32: 31-2
22
+ location_rv64: 63-2
22
23
  description: |
23
24
  <%- va_size = ext?(:Sv57) ? 57 : (ext?(:Sv48) ? 48 : 39) -%>
24
- Bits 63:2 of the virtual address of the exception vector for any trap taken into VS-mode.
25
+ Bits [VSXLEN-1:2] of the virtual address of the exception vector for any trap taken into VS-mode.
25
26
 
26
- If the base address is written with a non-canonical address (_i.e._, bits 63:<%= va_size %> do not match bit <%= va_size-1 %>),
27
+ If the base address is written with a non-canonical address (_i.e._, bits [VSXLEN-1:<%= va_size %>] do not match bit <%= va_size-1 %>),
27
28
  the write should be ignored.
28
29
 
29
30
  type: RW-R
@@ -12,6 +12,10 @@ versions:
12
12
  - version: "2.0.0"
13
13
  state: ratified
14
14
  ratification_date: 2019-12
15
+ requirements:
16
+ extension:
17
+ name: Zmmul
18
+ version: "~> 1.0.0"
15
19
  description: |
16
20
  This chapter describes the standard integer multiplication and division
17
21
  instruction extension, which is named `M` and contains instructions
@@ -26,6 +26,7 @@ requirements:
26
26
  implemented?(ExtensionName::Sv39) -> SV39X4_TRANSLATION;
27
27
  implemented?(ExtensionName::Sv48) -> SV48X4_TRANSLATION;
28
28
  implemented?(ExtensionName::Sv57) -> SV57X4_TRANSLATION;
29
+ -> GSTAGE_MODE_BARE;
29
30
  reason: |
30
31
  Shgatpa mandates that or each supported virtual memory scheme SvNN supported in
31
32
  `satp`, the corresponding hgatp SvNNx4 mode must be supported.
@@ -0,0 +1,29 @@
1
+ # Copyright (c) RISC-V International
2
+ # SPDX-License-Identifier: BSD-3-Clause-Clear
3
+
4
+ # yaml-language-server: $schema=../../../schemas/ext_schema.json
5
+
6
+ $schema: "ext_schema.json#"
7
+ kind: extension
8
+ name: Zibi
9
+ long_name: Branch with Immediate
10
+ description: |
11
+ The Zibi extension adds conditional branch instructions that compare an
12
+ integer register with a small immediate constant.
13
+
14
+ Existing conditional branch instructions, such as `beq` and `bne`, compare two
15
+ integer registers. When a branch compares against a constant, software must
16
+ otherwise materialize that constant in an integer register before branching,
17
+ which can increase register pressure and potentially cause register spills and
18
+ reloads.
19
+
20
+ The `beqi` and `bnei` instructions use the B-type instruction format. The
21
+ instruction bits that would otherwise carry _rs2_ in a B-type branch carry a
22
+ 5-bit _cimm_ field. All _cimm_ encodings are valid: the _cimm_ field is not
23
+ sign-extended; it decodes to an XLEN-bit comparison constant where `cimm=0`
24
+ encodes the value -1, and `cimm` values 1 through 31 encode the corresponding
25
+ positive integer values 1 through 31.
26
+ type: unprivileged
27
+ versions:
28
+ - version: "0.7.0"
29
+ state: frozen
@@ -41,5 +41,5 @@ operation(): |
41
41
 
42
42
  XReg xs1_word = X[xs1][31:0];
43
43
 
44
- XReg unextended_result = (X[xs1] >> shamt) | (X[xs1] << (32 - shamt));
44
+ XReg unextended_result = (xs1_word >> shamt) | (xs1_word << (32 - shamt));
45
45
  X[xd] = {{32{unextended_result[31]}}, unextended_result};
@@ -42,5 +42,5 @@ operation(): |
42
42
  XReg xs1_word = X[xs1][31:0];
43
43
  XReg shamt = X[xs2][4:0];
44
44
 
45
- XReg unextended_result = (X[xs1] >> shamt) | (X[xs1] << (32 - shamt));
45
+ XReg unextended_result = (xs1_word >> shamt) | (xs1_word << (32 - shamt));
46
46
  X[xd] = {{32{unextended_result[31]}}, unextended_result};
@@ -28,6 +28,9 @@ access:
28
28
  vs: always
29
29
  vu: always
30
30
  data_independent_timing: false
31
+ pseudoinstructions:
32
+ - when: "true"
33
+ to: fmv.s.x fd, xs1
31
34
  operation(): |
32
35
  check_f_ok($encoding);
33
36
 
@@ -29,6 +29,9 @@ access:
29
29
  vs: always
30
30
  vu: always
31
31
  data_independent_timing: false
32
+ pseudoinstructions:
33
+ - when: "true"
34
+ to: fmv.x.s xd, fs1
32
35
  operation(): |
33
36
  check_f_ok($encoding);
34
37
 
@@ -22,9 +22,7 @@ description: |
22
22
 
23
23
  definedBy:
24
24
  extension:
25
- anyOf:
26
- - name: M
27
- - name: Zmmul
25
+ name: Zmmul
28
26
  assembly: xd, xs1, xs2
29
27
  encoding:
30
28
  match: 0000001----------000-----0110011
@@ -21,9 +21,7 @@ description: |
21
21
  Microarchitectures may look for that sequence and fuse the operations.
22
22
  definedBy:
23
23
  extension:
24
- anyOf:
25
- - name: M
26
- - name: Zmmul
24
+ name: Zmmul
27
25
  assembly: xd, xs1, xs2
28
26
  encoding:
29
27
  match: 0000001----------001-----0110011
@@ -21,9 +21,7 @@ description: |
21
21
  Microarchitectures may look for that sequence and fuse the operations.
22
22
  definedBy:
23
23
  extension:
24
- anyOf:
25
- - name: M
26
- - name: Zmmul
24
+ name: Zmmul
27
25
  assembly: xd, xs1, xs2
28
26
  encoding:
29
27
  match: 0000001----------010-----0110011
@@ -21,9 +21,7 @@ description: |
21
21
  Microarchitectures may look for that sequence and fuse the operations.
22
22
  definedBy:
23
23
  extension:
24
- anyOf:
25
- - name: M
26
- - name: Zmmul
24
+ name: Zmmul
27
25
  assembly: xd, xs1, xs2
28
26
  encoding:
29
27
  match: 0000001----------011-----0110011
@@ -22,9 +22,7 @@ definedBy:
22
22
  allOf:
23
23
  - xlen: 64
24
24
  - extension:
25
- anyOf:
26
- - name: M
27
- - name: Zmmul
25
+ name: Zmmul
28
26
  assembly: xd, xs1, xs2
29
27
  encoding:
30
28
  match: 0000001----------000-----0111011
@@ -36,4 +36,9 @@ operation(): |
36
36
  raise (ExceptionCode::IllegalInstruction, mode(), $encoding);
37
37
  }
38
38
 
39
- X[xd] = lowest_set_bit(X[xs1][31:0]);
39
+ # lowest_set_bit() reports xlen() (64 here) for a zero input, but ctzw must report 32
40
+ if (X[xs1][31:0] == 0) {
41
+ X[xd] = 32;
42
+ } else {
43
+ X[xd] = lowest_set_bit(X[xs1][31:0]);
44
+ }
@@ -18,7 +18,7 @@ definedBy:
18
18
  allOf:
19
19
  - name: Q
20
20
  - name: Zfa
21
- assembly: fd, fs1, fs2
21
+ assembly: xd, fs1, fs2
22
22
  encoding:
23
23
  match: 1010011----------101-----1010011
24
24
  variables:
@@ -26,7 +26,7 @@ encoding:
26
26
  location: 24-20
27
27
  - name: fs1
28
28
  location: 19-15
29
- - name: fd
29
+ - name: xd
30
30
  location: 11-7
31
31
  access:
32
32
  s: always