You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Smcsps | Conditional stack pointer swap at Machine level
190
188
| Sscsps | Conditional stack pointer swap at Supervisor level
@@ -203,8 +201,6 @@ Each row contains the dependencies of the extension named in the first column.
203
201
[%autowidth]
204
202
|===
205
203
| Extension Name | Sm | Ss | Smcsrind | Sscsrind | Smaiae | Smnip
206
-
| Smivt | x | | | | |
207
-
| Ssivt | | x | | | |
208
204
| Smcsps | x | | | | |
209
205
| Sscsps | | x | | | |
210
206
| Smtp | (x)| (x)| | | |
@@ -413,6 +409,10 @@ Therefore, the registers setipnum, clripnum, setienum, clrienum, setipnum_be, an
413
409
The iprio portion of it can be accessed as described in the section on indirect access.
414
410
The rest is not required.
415
411
412
+
=== Major interrupt redirection to ACLIC
413
+
414
+
In ACLIC mode major interrupt sources are forwarded to ACLIC, according to their major identity numbers. In that mode CLINT is not used and ACLIC becomes the only source of interrupts for M/S-modes.
415
+
416
416
=== State Enable
417
417
418
418
Access to existing and repurposed AIA CSRs is already controlled by the state enables defined in Smaia/Ssaia.
@@ -783,89 +783,45 @@ and the conditions for a virtual instruction exception apply,
783
783
in which case a virtual instruction exception is raised
784
784
when in VS or VU mode instead of an illegal instruction exception.
785
785
786
-
== Support for interrupt vector table (Smivt, Ssivt)
787
-
788
-
These extensions adds a new mode for taking interrupts via a dedicated interrupt vector table.
789
-
790
-
This increases the range of reachable addresses to the entire address space.
791
-
This is useful when handlers are more than 2 MiB away from the vector table entry.
786
+
== Smaclic / Ssaclic Changes to {xtvec} CSR Mode
792
787
793
-
In this new mode, when an interrupt is taken, the hart hardware loads the vector
794
-
table entry for the associated interrupt (table pointed to new {xivt} or {xeivt} CSR),
795
-
masks off the least-significant bit (for IALIGN=16) or masks of the 2 least-significant bits (for IALIGN=32),
796
-
and then jumps to the masked address.
797
-
798
-
=== Changed and new CSRs
788
+
=== Changed CSRs
799
789
800
790
[source]
801
791
----
802
792
Number Name Description
803
793
0x305 mtvec M-mode Trap-handler base address / interrupt mode
804
-
(NEW) 0x307 mivt M-mode Interrupt-handler vector table base address
805
-
(NEW) 0x308 meivt M-mode External Interrupt-handler vector table base address
806
794
0x105 stvec S-mode Trap-handler base address / interrupt mode
807
-
(NEW) 0x107 sivt S-mode Interrupt-handler vector table base address
808
-
(NEW) 0x108 seivt S-mode External Interrupt-handler vector table base address
809
795
----
810
796
811
-
==== New {xivt} and {xeivt} CSR
812
-
813
-
Two new base addresses for vector tables are introduced.
814
-
One for internal interrupt (major and local interrupts),
815
-
and one for external interrupts.
816
-
817
-
Both {xivt} and {xeivt} are WARL XLEN-bit CSRs,
818
-
which hold the base address of the interrupt vector table.
819
-
The address held in {xeivt} is aligned on a 64-byte or greater power-of-two boundary.
820
-
Values other than 0 in the low 6 bits are reserved of {xeivt} are reserved.
821
-
822
-
NOTE: The actual alignment can be determined
823
-
by writing ones to the low-order bits
824
-
then reading them back.
825
-
826
-
NOTE: The resulting vector tables, especially for external interrupts,
827
-
can consume non-negligible memory space.
828
-
To limit the overall memory footprint,
829
-
{xivt} or {xeivt} values at different privilege levels may be configured to the same values, respectively.
830
-
831
-
==== New {xtvec} CSR Mode
832
-
833
-
Interrupt vector table mode is encoded as a new state in the
834
-
existing {xtvec} WARL register, where {xtvec}.`mode` (the two
vtoffset = Minor Interrupt Identity # Corresponds to ACLIC topi[25:16]
853
812
854
813
OBASE = xtvec[XLEN-1:2]<<2 # Vector base is at least 4-byte aligned
855
-
if external interrupt:
856
-
VTBASE = xeivt[XLEN-1:6]<<6 # External Interrupt Vector Table base is at least 64-byte aligned
857
-
vtoffset = Minor Interrupt Identity
858
-
# Corresponds to xtopei[26:16] with interrupt delivery from interrupt file or ACLIC
814
+
if APLIC mode:
815
+
VECT = M[OBASE+XLEN/8*vtoffset] & VTMASK
859
816
else
860
-
VTBASE = xivt[XLEN-1:2]<<2 # Interrupt Vector Table base is at least 4-byte aligned
861
-
vtoffset = Major Interrupt Identity
817
+
VECT = OBASE+4*exccode
862
818
----
863
819
864
-
In interrupt vector table mode, when interrupts are taken, the interrupt behavior is modified as follows:
820
+
If vectored mode is selected in {xtvec}, and APLIC mode is selected in {eidelivery}, when interrupts are taken, the interrupt behavior is modified as follows:
865
821
After executing the required side-effects as required with the existing behavior,
866
822
the hart then fetches an XLEN-bit handler address with permissions corresponding to the handler's mode
867
-
from the in-memory table whose base address (VTBASE).
868
-
The trap handler function address is fetched from `VTBASE+XLEN/8*exccode`.
823
+
from the in-memory table whose base address (OBASE).
824
+
The trap handler function address is fetched from `OBASE+XLEN/8*exccode`.
869
825
If the fetch is successful, the hart clears the low bit(s) (depending on IALIGN) of the handler address,
870
826
and sets the PC to this handler address.
871
827
The masked vector table entry bit(s) are reserved and should be zero.
@@ -884,7 +840,7 @@ Memory writes to the vector table require an instruction barrier (_fence.i_) to
884
840
885
841
It is recommended that the second fetch be ignored for hardware triggers and breakpoints.
886
842
887
-
==== Vector table fault handling
843
+
=== Vector table fault handling
888
844
889
845
Faults that occur during the fetch of interrupt vector table entries are only recoverable,
890
846
if the double trap extension(s) are implemented.
@@ -911,7 +867,7 @@ side-affects of the trap may only be executed if they allow resuming of operatio
911
867
912
868
NOTE: Resuming after a fault on a vector table fetch is currently only seen as useful for instruction page faults.
913
869
914
-
==== State Enable
870
+
=== State Enable
915
871
916
872
If the Smstateen extension is implemented,
917
873
then the bit 53 (ACLIC) in mstateen0 is implemented.
@@ -925,6 +881,8 @@ when in VS or VU mode instead of an illegal instruction exception.
0 commit comments