Skip to content

Commit 879a548

Browse files
committed
adress dhower's feedback
1 parent 7fe516b commit 879a548

File tree

10 files changed

+44
-19
lines changed

10 files changed

+44
-19
lines changed

spec/std/isa/csr/V/vcsr.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ fields:
1818
location: 2-1
1919
description: See vxrm.
2020
type: RW-RH
21+
alias: vxrm.VALUE[1:0]
2122
sw_write(csr_value): |
23+
CSR[vxrm].VALUE = csr_value.VXRM;
2224
return csr_value.VXRM;
2325
reset_value: UNDEFINED_LEGAL
2426
VXSAT:
2527
location: 0
2628
description: See vxsat.
2729
type: RW-RH
30+
alias: vxsat.VALUE[0]
2831
sw_write(csr_value): |
32+
CSR[vxsat].VALUE = csr_value.VXSAT;
2933
return csr_value.VXSAT;
3034
reset_value: UNDEFINED_LEGAL

spec/std/isa/csr/V/vl.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ fields:
2727
and supporting SEW=8 would need at least six bits in vl to hold the values 0-32
2828
(VLEN=32, with LMUL=8 and SEW=8, yields VLMAX=32).
2929
type: RO-H
30-
reset_value: 0
30+
reset_value(): |
31+
return (FOLLOW_VTYPE_RESET_RECOMMENDATION)? 0 : UNDEFINED_LEGAL;

spec/std/isa/csr/V/vstart.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ fields:
6969
supported vstart element position. Alternatively, migration events can be constrained to
7070
only occur at mutually supported vstart locations.
7171
sw_write(csr_value): |
72-
return csr_value.VALUE & (VLEN - 1);
72+
XReg newval = csr_value.VALUE & (VLEN - 1);
73+
if (newval != csr_value.VALUE) {
74+
return UNDEFINED_LEGAL;
75+
} else {
76+
return newval;
77+
}
7378
type: RW-RH
7479
reset_value: UNDEFINED_LEGAL

spec/std/isa/csr/V/vtype.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ fields:
3232
3333
It is recommended that at reset, vill is set.
3434
type: RO-H
35-
reset_value: 1
35+
reset_value(): |
36+
return (FOLLOW_VTYPE_RESET_RECOMMENDATION)? 1 : UNDEFINED_LEGAL;
3637
VMA:
3738
location: 7
3839
description: |
@@ -50,7 +51,8 @@ fields:
5051
5152
It is recommended that at reset, vill is set, and the remaining bits in vtype are zero.
5253
type: RO-H
53-
reset_value: 0
54+
reset_value(): |
55+
return (FOLLOW_VTYPE_RESET_RECOMMENDATION)? 0 : UNDEFINED_LEGAL;
5456
VTA:
5557
location: 6
5658
description: |
@@ -68,7 +70,8 @@ fields:
6870
6971
It is recommended that at reset, vill is set, and the remaining bits in vtype are zero.
7072
type: RO-H
71-
reset_value: 0
73+
reset_value(): |
74+
return (FOLLOW_VTYPE_RESET_RECOMMENDATION)? 0 : UNDEFINED_LEGAL;
7275
VSEW:
7376
location: 5-3
7477
description: |
@@ -86,7 +89,8 @@ fields:
8689
8790
It is recommended that at reset, vill is set, and the remaining bits in vtype are zero.
8891
type: RO-H
89-
reset_value: 0
92+
reset_value(): |
93+
return (FOLLOW_VTYPE_RESET_RECOMMENDATION)? 0 : UNDEFINED_LEGAL;
9094
VLMUL:
9195
location: 2-0
9296
description: |
@@ -115,4 +119,5 @@ fields:
115119
116120
It is recommended that at reset, vill is set, and the remaining bits in vtype are zero.
117121
type: RO-H
118-
reset_value: 0
122+
reset_value(): |
123+
return (FOLLOW_VTYPE_RESET_RECOMMENDATION)? 0 : UNDEFINED_LEGAL;

spec/std/isa/csr/V/vxrm.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ sw_read(): |
1717
return CSR[vcsr].VXRM;
1818
fields:
1919
VALUE:
20-
alias: vcsr.VXRM
2120
location_rv32: 31-0
2221
location_rv64: 63-0
2322
description: |

spec/std/isa/ext/V.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,27 @@ params:
5656
schema:
5757
type: string
5858
enum: ["ceil(AVL/2)", "VLMAX", "custom"]
59+
FOLLOW_VTYPE_RESET_RECOMMENDATION:
60+
description: |
61+
The spec recommends - but does not require - that on reset, vill is set, and remaining bits in vtype and vl are set to 0.
62+
If this parameter is set to true, the CSR resets will follow this recommandation. If it is false, the resets will be "UNDEFINED_LEGAL".
63+
schema:
64+
type: boolean
5965
VLEN:
6066
description: |
61-
The number of bits in a single vector register. VLEN >= ELEN, which must be a power of 2, and must be no greater than 2^16.
67+
The number of bits in a single vector register.
6268
schema:
6369
type: integer
70+
# requirements:
71+
# idl(): |
72+
# -> (VLEN >= ELEN) && (VLEN <='h10000) && (popcount(VLEN) == 1);
73+
# reason: VLEN >= ELEN, which must be a power of 2, and must be no greater than 2^16.
6474
ELEN:
6575
description: |
66-
The maximum size in bits of a vector element that any operation can produce or consume, ELEN >= 8, which must be a power of 2.
76+
The maximum size in bits of a vector element that any operation can produce or consume.
6777
schema:
6878
type: integer
79+
# requirements:
80+
# idl(): |
81+
# -> (ELEN >='h8) && (popcount(ELEN) == 1);
82+
# reason: ELEN >= 8, which must be a power of 2.

spec/std/isa/inst/V/vsetivli.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ data_independent_timing: false
2828
operation(): |
2929
VectorState state = vector_state();
3030
XReg vlen = VLEN;
31-
XReg vlmax = (vlen << state.log2_multiplier) >> (3 + state.vsew);
31+
XReg vlmax = (vlen << state.log2_multiplier) >> (3 + state.sew);
3232
XReg AVL = uimm;
3333
XReg CEIL_AVL_OVER_TWO = (AVL + 1) / 2;
3434

spec/std/isa/inst/V/vsetvl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ data_independent_timing: false
2828
operation(): |
2929
VectorState state = vector_state();
3030
XReg vlen = VLEN;
31-
XReg vlmax = (vlen << state.log2_multiplier) >> (3 + state.vsew);
31+
XReg vlmax = (vlen << state.log2_multiplier) >> (3 + state.sew);
3232
XReg AVL = xs1;
3333
XReg CEIL_AVL_OVER_TWO = (AVL + 1) / 2;
3434

spec/std/isa/inst/V/vsetvli.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ data_independent_timing: false
2828
operation(): |
2929
VectorState state = vector_state();
3030
XReg vlen = VLEN;
31-
XReg vlmax = (vlen << state.log2_multiplier) >> (3 + state.vsew);
31+
XReg vlmax = (vlen << state.log2_multiplier) >> (3 + state.sew);
3232
XReg AVL = xs1;
3333
XReg CEIL_AVL_OVER_TWO = (AVL + 1) / 2;
3434

spec/std/isa/isa/vec.idl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@
1212
# - integer widening arith ()
1313

1414
# the vector register file
15-
Bits<VLEN> v[32] = [0, 0, 0, 0, 0, 0, 0, 0,
16-
0, 0, 0, 0, 0, 0, 0, 0,
17-
0, 0, 0, 0, 0, 0, 0, 0,
18-
0, 0, 0, 0, 0, 0, 0, 0];
15+
Bits<VLEN> v[32];
1916

2017
enum VectorLmulType {
2118
Divide
2219
Multiply
2320
}
2421

2522
struct VectorState {
26-
Bits<7> vsew;
23+
Bits<7> sew;
2724
VectorLmulType lmul_type;
2825
Bits<2> log2_multiplier;
2926
}
@@ -36,7 +33,7 @@ function vector_state {
3633
body {
3734
VectorState state;
3835

39-
state.vsew = 7'b1 << (3 + CSR[vtype].VSEW);
36+
state.sew = 7'b1 << (3 + CSR[vtype].VSEW);
4037
Bits<3> vlmul = CSR[vtype].VLMUL;
4138
state.lmul_type = CSR[vtype].VLMUL[2] == 1'b1 ? VectorLmulType::Divide : VectorLmulType::Multiply;
4239
state.log2_multiplier = CSR[vtype].VLMUL[1:0];

0 commit comments

Comments
 (0)