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.
@@ -782,89 +782,45 @@ and the conditions for a virtual instruction exception apply,
782
782
in which case a virtual instruction exception is raised
783
783
when in VS or VU mode instead of an illegal instruction exception.
784
784
785
-
== Support for interrupt vector table (Smivt, Ssivt)
786
-
787
-
These extensions adds a new mode for taking interrupts via a dedicated interrupt vector table.
788
-
789
-
This increases the range of reachable addresses to the entire address space.
790
-
This is useful when handlers are more than 2 MiB away from the vector table entry.
785
+
== Smaclic / Ssaclic Changes to {xtvec} CSR Mode
791
786
792
-
In this new mode, when an interrupt is taken, the hart hardware loads the vector
793
-
table entry for the associated interrupt (table pointed to new {xivt} or {xeivt} CSR),
794
-
masks off the least-significant bit (for IALIGN=16) or masks of the 2 least-significant bits (for IALIGN=32),
795
-
and then jumps to the masked address.
796
-
797
-
=== Changed and new CSRs
787
+
=== Changed CSRs
798
788
799
789
[source]
800
790
----
801
791
Number Name Description
802
792
0x305 mtvec M-mode Trap-handler base address / interrupt mode
803
-
(NEW) 0x307 mivt M-mode Interrupt-handler vector table base address
804
-
(NEW) 0x308 meivt M-mode External Interrupt-handler vector table base address
805
793
0x105 stvec S-mode Trap-handler base address / interrupt mode
806
-
(NEW) 0x107 sivt S-mode Interrupt-handler vector table base address
807
-
(NEW) 0x108 seivt S-mode External Interrupt-handler vector table base address
808
794
----
809
795
810
-
==== New {xivt} and {xeivt} CSR
811
-
812
-
Two new base addresses for vector tables are introduced.
813
-
One for internal interrupt (major and local interrupts),
814
-
and one for external interrupts.
815
-
816
-
Both {xivt} and {xeivt} are WARL XLEN-bit CSRs,
817
-
which hold the base address of the interrupt vector table.
818
-
The address held in {xeivt} is aligned on a 64-byte or greater power-of-two boundary.
819
-
Values other than 0 in the low 6 bits are reserved of {xeivt} are reserved.
820
-
821
-
NOTE: The actual alignment can be determined
822
-
by writing ones to the low-order bits
823
-
then reading them back.
824
-
825
-
NOTE: The resulting vector tables, especially for external interrupts,
826
-
can consume non-negligible memory space.
827
-
To limit the overall memory footprint,
828
-
{xivt} or {xeivt} values at different privilege levels may be configured to the same values, respectively.
829
-
830
-
==== New {xtvec} CSR Mode
831
-
832
-
Interrupt vector table mode is encoded as a new state in the
833
-
existing {xtvec} WARL register, where {xtvec}.`mode` (the two
vtoffset = Minor Interrupt Identity # Corresponds to ACLIC topi[25:16]
852
811
853
812
OBASE = xtvec[XLEN-1:2]<<2 # Vector base is at least 4-byte aligned
854
-
if external interrupt:
855
-
VTBASE = xeivt[XLEN-1:6]<<6 # External Interrupt Vector Table base is at least 64-byte aligned
856
-
vtoffset = Minor Interrupt Identity
857
-
# Corresponds to xtopei[26:16] with interrupt delivery from interrupt file or ACLIC
813
+
if APLIC mode:
814
+
VECT = M[OBASE+XLEN/8*vtoffset] & VTMASK
858
815
else
859
-
VTBASE = xivt[XLEN-1:2]<<2 # Interrupt Vector Table base is at least 4-byte aligned
860
-
vtoffset = Major Interrupt Identity
816
+
VECT = OBASE+4*exccode
861
817
----
862
818
863
-
In interrupt vector table mode, when interrupts are taken, the interrupt behavior is modified as follows:
819
+
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:
864
820
After executing the required side-effects as required with the existing behavior,
865
821
the hart then fetches an XLEN-bit handler address with permissions corresponding to the handler's mode
866
-
from the in-memory table whose base address (VTBASE).
867
-
The trap handler function address is fetched from `VTBASE+XLEN/8*exccode`.
822
+
from the in-memory table whose base address (OBASE).
823
+
The trap handler function address is fetched from `OBASE+XLEN/8*exccode`.
868
824
If the fetch is successful, the hart clears the low bit(s) (depending on IALIGN) of the handler address,
869
825
and sets the PC to this handler address.
870
826
The masked vector table entry bit(s) are reserved and should be zero.
@@ -883,7 +839,7 @@ Memory writes to the vector table require an instruction barrier (_fence.i_) to
883
839
884
840
It is recommended that the second fetch be ignored for hardware triggers and breakpoints.
885
841
886
-
==== Vector table fault handling
842
+
=== Vector table fault handling
887
843
888
844
Faults that occur during the fetch of interrupt vector table entries are only recoverable,
889
845
if the double trap extension(s) are implemented.
@@ -910,7 +866,7 @@ side-affects of the trap may only be executed if they allow resuming of operatio
910
866
911
867
NOTE: Resuming after a fault on a vector table fetch is currently only seen as useful for instruction page faults.
912
868
913
-
==== State Enable
869
+
=== State Enable
914
870
915
871
If the Smstateen extension is implemented,
916
872
then the bit 53 (ACLIC) in mstateen0 is implemented.
@@ -924,6 +880,8 @@ when in VS or VU mode instead of an illegal instruction exception.
0 commit comments