Skip to content

Commit

Permalink
allow coexistence of Ztso and Ssdtso
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomsich committed Dec 27, 2023
1 parent 96f16ac commit 93125dc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions changes.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
== Revision history

Changes from v1.0-draft2 to v1.0-draft3:

* Allow co-existence of Ssdtso and Ztso
Changes from v1.0-draft1 to v1.0-draft2:

* Changed controlling CSR to `menvcfg`, `henvcfg`, and `senvcfg`.
Expand Down
2 changes: 1 addition & 1 deletion header.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Authors: Dr. Philipp Tomsich (VRULL), Dr. Zhao Siqi (T-Head)
:docgroup: RISC-V Fast Track
:description: RISC-V Dynamic Switching of TSO-mode (Ssdtso) extension
:company: RISC-V.org
:revdate: 10/2023
:revdate: 12/2023
:revnumber: 1.0
:revremark: This document is under development. Expect potential changes. Visit http://riscv.org/spec-state for further details.
:revinfo:
Expand Down
16 changes: 8 additions & 8 deletions ssdtso.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ The intended use-cases for Ssdtso are

=== Dependencies and Incompatibilities

The Ssdto extension conflicts with Ztso.
For its intended use case (i.e., to provide an provide an on-demand RVTSO execution capability for processors otherwise operating in RVWMO), Ssdtso will be used on cores that do not implement Ztso.

[NOTE]
====
Ztso provides RVTSO semantics across all privilege levels and harts of an implementation.
In contrast to this, Ssdtso assumes that RVWMO is the default (at boot) mode of operation, that individual harts can be switched to RVTSO, and that the M-mode execution environment can not switched to RVTSO.
====
However, the Ssdto extension does not conflict with Ztso (i.e., a core that operates in RVTSO mode at all times) and can be implemented on such a core for compatibility:
* the RVTSO mode is always-on on Ztso implementations, and
* the DTSO bit in `menvcfg`, `senvcfg` and `henvcfg` will accurately reflect whether the core currently operates in RVTSO mode.

[NOTE]
====
Expand All @@ -37,8 +35,10 @@ To allow the free composition of extensions for unforeseen use-cases, no formal

=== State controlling whether dynamic TSO is enabled

The dynamic-RVTSO behaviour is controlled by bit 8 (`DTSO`) of `menvcfg, senvcfg, henvcfg` for all lower privilege levels.
Implementations providing Ssdtso are required to default to RVWMO semantics: the bits controlling dynamic-RVTSO behaviour are initialized to 0 on reset.
The dynamic-RVTSO behaviour is controlled by bit 8 (`DTSO`) of `menvcfg`, `senvcfg`, and `henvcfg` for all lower privilege levels.
Implementations providing Ssdtso initialize the `DTSO`-bit according to their default memory mode:
* implementations that implement only Ssdtso, and not Ztso, default to use RVWMO semantics natively: the bits controlling dynamic-RVTSO behaviour are initialized to 0 on reset
* implementations that implement both Ssdtso and Ztso, default to use RVTSO semantics natively: the bits controlling dynamic-RVTSO behaviour are initialized to 1 on reset

If the DTSO control bit in the respective envcfg is set, all lower-privilege modes will operate in dynamic-RVTSO mode:
[cols="^3,^2,^1,^1,^1,^1,^1",stripes=even,options="header"]
Expand Down

0 comments on commit 93125dc

Please sign in to comment.