-
Notifications
You must be signed in to change notification settings - Fork 56
Add ssqosid extension and csr yaml #653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ThinkOpenly
merged 28 commits into
riscv-software-src:main
from
syedowaisalishah:add-ssqosid-csr-yaml
Jun 18, 2025
Merged
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
6fd7f88
Add CSR YAML file for Ssqosid:srmcfg
syedowaisalishah 08084a3
Add Extension YAML file for Ssqosid
syedowaisalishah 091c477
Merge branch 'main' into add-ssqosid-csr-yaml
syedowaisalishah ffcce03
Add Extension YAML file for Ssqosid
syedowaisalishah cdadf98
Add CSR YAML file for Ssqosid:srmcfg
syedowaisalishah bed59a8
Merge branch 'riscv-software-src:main' into add-ssqosid-csr-yaml
syedowaisalishah cefa26a
docs(csr): improve srmcfg register description and field details
syedowaisalishah 10cc9f0
Merge branch 'main' into add-ssqosid-csr-yaml
syedowaisalishah 2693eec
docs(csr): improve srmcfg register description
syedowaisalishah 9af87be
Update .gitignore
syedowaisalishah b22aea6
Add CSR YAML file for Ssqosid:srmcfg
syedowaisalishah ee25208
Add Extension YAML file for Ssqosid
syedowaisalishah 084c743
Add Extension YAML file for Ssqosid
syedowaisalishah 8ff0e7e
Add CSR YAML file for Ssqosid:srmcfg
syedowaisalishah 9e9d9f2
docs(csr): improve srmcfg register description and field details
syedowaisalishah 04e166e
docs(csr): improve srmcfg register description
syedowaisalishah f47a908
Merge branch 'main' into add-ssqosid-csr-yaml
syedowaisalishah 9185363
Merge branch 'riscv-software-src:main' into add-ssqosid-csr-yaml
syedowaisalishah 9484dc9
Merge branch 'add-ssqosid-csr-yaml' of https://github.com/syedowaisal…
syedowaisalishah abcd342
feat(csr): add YAML file for Ssqosid:srmcfg
syedowaisalishah 12a4d9b
feat(csr): add YAML file for Ssqosid:srmcfg
syedowaisalishah 8d80e39
feat(csr): add YAML file for Ssqosid:srmcfg
syedowaisalishah a00a066
Merge branch 'main' into add-ssqosid-csr-yaml
syedowaisalishah 253613c
feat(csr): add YAML file for Ssqosid:srmcfg
syedowaisalishah 47267ea
Merge branch 'riscv-software-src:main' into add-ssqosid-csr-yaml
syedowaisalishah 82d1cf8
feat(csr): add YAML file for Ssqosid:srmcfg
syedowaisalishah bb27924
feat(csr): add YAML file for Ssqosid:srmcfg
syedowaisalishah 39c7365
Merge branch 'main' into add-ssqosid-csr-yaml
syedowaisalishah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# yaml-language-server: $schema=../../../schemas/csr_schema.json | ||
$schema: csr_schema.json# | ||
kind: csr | ||
name: srmcfg | ||
long_name: Supervisor Resource Management Configuration | ||
address: 0x5C0 #Until the extension is finalized and assigned an official address by the RISC-V Foundation, srmcfg will use a placeholder/custom address | ||
priv_mode: S | ||
length: SXLEN | ||
definedBy: Ssqosid | ||
description: | | ||
The srmcfg register is an SXLEN-bit read/write register used to configure a Resource Control ID (RCID) and a Monitoring Counter ID (MCID). | ||
Both RCID and MCID are WARL fields. | ||
|
||
The RCID and MCID accompany each request made by the hart to shared resource controllers. | ||
The RCID is used to determine the resource allocations (e.g., cache occupancy limits, memory bandwidth limits, etc.) to enforce. | ||
The MCID is used to identify a counter to monitor resource usage. | ||
|
||
The RCID and MCID configured in the srmcfg CSR apply to all privilege modes of software execution on that hart by default, | ||
but this behavior may be overridden by future extensions. | ||
|
||
If extension Smstateen is implemented together with Ssqosid, then Ssqosid also requires the SRMCFG bit in mstateen0 to be implemented. | ||
If mstateen0.SRMCFG is 0, attempts to access srmcfg in privilege modes less privileged than M-mode raise an illegal-instruction exception. | ||
If mstateen0.SRMCFG is 1 or if extension Smstateen is not implemented, attempts to access srmcfg when V=1 raise a virtual-instruction exception. | ||
|
||
A reset value of 0 is suggested for the RCID field matching resource controllers' default behavior of associating all capacity with RCID=0. | ||
The MCID reset value does not affect functionality and may be implementation-defined. | ||
syedowaisalishah marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
fields: | ||
RCID: | ||
syedowaisalishah marked this conversation as resolved.
Show resolved
Hide resolved
syedowaisalishah marked this conversation as resolved.
Show resolved
Hide resolved
|
||
location_rv32: 15-0 | ||
location_rv64: 15-0 | ||
syedowaisalishah marked this conversation as resolved.
Show resolved
Hide resolved
|
||
type: RW | ||
description: | | ||
The RCID is used to determine the resource allocations (e.g., cache occupancy limits, | ||
memory bandwidth limits, etc.) to enforce. | ||
reset_value: 0 | ||
syedowaisalishah marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
MCID: | ||
location_rv32: 31-16 | ||
location_rv64: 31-16 | ||
syedowaisalishah marked this conversation as resolved.
Show resolved
Hide resolved
|
||
type: RW | ||
description: | | ||
The MCID is used to identify a counter to monitor resource usage. | ||
reset_value: 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# yaml-language-server: $schema=../../schemas/ext_schema.json | ||
|
||
$schema: "ext_schema.json#" | ||
kind: extension | ||
name: Ssqosid | ||
type: privileged | ||
long_name: Quality-of-Service Identifiers | ||
description: | | ||
Quality of Service (QoS) is defined as the minimal end-to-end performance guaranteed in advance by a service level agreement (SLA) to a workload. | ||
Performance metrics might include measures such as instructions per cycle (IPC), latency of service, etc. | ||
|
||
When multiple workloads execute concurrently on modern processors—equipped with large core counts, multiple cache hierarchies, and multiple memory | ||
controllers—the performance of any given workload becomes less deterministic, or even non-deterministic, due to shared resource contention. | ||
|
||
To manage performance variability, system software needs resource allocation and monitoring capabilities. | ||
These capabilities allow for the reservation of resources like cache and bandwidth, thus meeting individual performance targets while minimizing interference. | ||
For resource management, hardware should provide monitoring features that allow system software to profile workload resource consumption and allocate resources accordingly. | ||
|
||
To facilitate this, the QoS Identifiers extension (Ssqosid) introduces the srmcfg register, | ||
which configures a hart with two identifiers: a Resource Control ID (RCID) and a Monitoring Counter ID (MCID). | ||
These identifiers accompany each request issued by the hart to shared resource controllers. | ||
|
||
Additional metadata, like the nature of the memory access and the ID of the originating supervisor domain, | ||
can accompany RCID and MCID. Resource controllers may use this metadata for differentiated service such as a different capacity allocation for code storage vs.data storage. | ||
Resource controllers can use this data for security policies such as not exposing statistics of one security domain to another. | ||
|
||
These identifiers are crucial for the RISC-V Capacity and Bandwidth Controller QoS Register Interface (CBQRI) specification, | ||
which provides methods for setting resource usage limits and monitoring resource consumption. | ||
The RCID controls resource allocations, while the MCID is used for tracking resource usage. | ||
|
||
The Ssqosid extension does not require that S-mode mode be implemented. | ||
syedowaisalishah marked this conversation as resolved.
Show resolved
Hide resolved
|
||
versions: | ||
- version: "1.0.0" | ||
state: ratified | ||
ratification_date: "2024-11" | ||
syedowaisalishah marked this conversation as resolved.
Show resolved
Hide resolved
|
||
url: "https://github.com/riscv/riscv-isa-manual/releases/tag/riscv-isa-release-5308687-2025-04-22" | ||
requires: | ||
allOf: | ||
- name: S | ||
version: ~> 1.13 | ||
syedowaisalishah marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.