Skip to content

Commit 82d1cf8

Browse files
feat(csr): add YAML file for Ssqosid:srmcfg
1 parent 47267ea commit 82d1cf8

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

arch/csr/Ssqosid/srmcfg.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ description:
9090
During context switches, the supervisor may choose to execute with the `srmcfg` of the outgoing context to attribute the execution to it.
9191
Prior to restoring the new context, it switches to the new VM’s `srmcfg`.
9292
The supervisor can also use a separate configuration for execution not to be attributed to either context.
93-
9493
fields:
9594
RCID:
9695
location: 11-0
@@ -113,8 +112,7 @@ fields:
113112
raise(ExceptionCode::VirtualInstruction, mode(), $encoding);
114113
}
115114
}
116-
rcid_mask = (1u << RCID_WIDTH) - 1;
117-
return csr_value.RCID & rcid_mask;
115+
return csr_value.RCID & ((1 `<< RCID_WIDTH) - 1);
118116
119117
MCID:
120118
location: 27-16
@@ -136,8 +134,7 @@ fields:
136134
raise(ExceptionCode::VirtualInstruction, mode(), $encoding);
137135
}
138136
}
139-
mcid_mask = (1u << MCID_WIDTH) - 1;
140-
return csr_value.MCID & mcid_mask;
137+
return csr_value.MCID & ((1 `<< MCID_WIDTH) - 1);
141138
142139
sw_read(): |
143140
if (implemented?(ExtensionName::Smstateen)) {

arch/csr/mstateen0.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fields:
129129
SRMCFG:
130130
long_name: srmcfg access control
131131
location: 55
132-
#definedBy: Ssqosid
132+
definedBy: Ssqosid
133133
description: |
134134
The SRMCFG bit in `mstateen0` controls access to the `srmcfg`` CSR introduced by the Ssqosid Chapter 18
135135
extension.

arch/csr/mstateen0h.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fields:
111111
SRMCFG:
112112
long_name: srmcfg access control
113113
location: 23
114-
#definedBy: Ssqosid
114+
definedBy: Ssqosid
115115
alias: mstateen0.SRMCFG
116116
sw_write(csr_value): |
117117
CSR[mstateen0].SRMCFG = csr_value.SRMCFG;

arch/ext/Ssqosid.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,25 @@ description: |
2828
which provides methods for setting resource usage limits and monitoring resource consumption.
2929
The RCID controls resource allocations, while the MCID is used for tracking resource usage.
3030
31+
params:
32+
RCID_WIDTH:
33+
description: |
34+
Number of bits used for the Resource Control ID field (RCID).
35+
Default is 12.
36+
schema:
37+
type: integer
38+
minimum: 1
39+
maximum: 16
40+
41+
MCID_WIDTH:
42+
description: |
43+
Number of bits used for the Monitoring Counter ID field (MCID).
44+
Default is 12.
45+
schema:
46+
type: integer
47+
minimum: 1
48+
maximum: 16
49+
3150
versions:
3251
- version: "1.0.0"
3352
state: ratified

0 commit comments

Comments
 (0)