Skip to content

Commit

Permalink
Fix interpretation of msdcfg.SSM in pseudocode
Browse files Browse the repository at this point in the history
The pseudocode was inverted compared to the earlier description in the
text and the following example.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
  • Loading branch information
SiFiveHolland committed Sep 17, 2024
1 parent e2c2a04 commit 288fe9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chapter9.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ for the `RCID` and `MCID` fields of the register is computed as follows:
[listing]
----
SRL_MASK = (1 << SRL) - 1
if SSM == 1
if SSM == 0
RCID-value = srmcfg.RCID & SRL_MASK
else
RCID-value = srmcfg.RCID
endif
SML_MASK = (1 << SML) - 1
if SSM == 1
if SSM == 0
MCID-value = srmcfg.MCID & SML_MASK
else
MCID-value = srmcfg.MCID
Expand All @@ -200,7 +200,7 @@ follows:
[listing]
----
SRL_MASK = (1 << SRL) - 1
if SSM == 1
if SSM == 0
srmcfg.RCID = (srmcfg.RCID & ~SRL_MASK) | (RCID-value & SRL_MASK)
else
if ((RCID-value & ~SRL_MASK) | SRL_MASK) != ((1 << RCIDLEN) - 1)
Expand All @@ -209,7 +209,7 @@ else
endif
SML_MASK = (1 << SML) - 1
if SSM == 1
if SSM == 0
srmcfg.MCID = (srmcfg.MCID & ~SML_MASK) | (MCID-value & SML_MASK)
else
if ((MCID-value & ~SML_MASK) | SML_MASK) != ((1 << MCIDLEN) - 1)
Expand Down

0 comments on commit 288fe9d

Please sign in to comment.