-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,3 +1,53 @@ | ||
# OpenAIA.scala | ||
|
||
<!-- vim-markdown-toc GFM --> | ||
|
||
* [Overview](#overview) | ||
* [Interrupt Paths](#interrupt-paths) | ||
* [Configuration Paths](#configuration-paths) | ||
|
||
<!-- vim-markdown-toc --> | ||
|
||
The implementation of OpenAIA.scala adheres to the [RISC-V Advanced Interrupt Architecture (AIA) Specification](https://github.com/riscv/riscv-aia). | ||
Any discrepancies between the implementation and specification should be treated as implementation bugs. | ||
|
||
## Overview | ||
|
||
AIA is designed to efficiently route external interrupts to the appropriate harts and privilege levels. | ||
This routing is accomplished by two interrupt controllers: | ||
|
||
* Incoming Message-Signaled Interrupt Controller (**IMSIC**) | ||
* Advanced Platform-Level Interrupt Controller (**APLIC**) | ||
|
||
Why two types of controllers? | ||
There are two types of external devices: | ||
|
||
1. **Wired devices**: | ||
Interrupts are transmitted via dedicated electronic signals (edge or level), | ||
which is simple to implement but faces scalability challenges, | ||
as each interrupt requires an physical wire connected to the hart. | ||
2. **Message-signaled-interrupt (MSI) devices**: | ||
Interrupts are encoded as messages and transmitted over bus/network, | ||
which offers better scalability compared to wired interrupts, | ||
as no dedicated physical wires needed for each interrupt. | ||
|
||
In RISC-V AIA: | ||
|
||
* **APLIC** handles wired external interrupts | ||
* **IMSIC** handles message-signaled external interrupts | ||
|
||
<!-- The external interrupts are mainly generated by external devices, --> | ||
<!-- however, for some advanced usage, the internal devices and hart can also generate, --> | ||
<!-- e.g. supervisor level injects external interrupts into virtualized supervisor level. --> | ||
<!-- In this document, we focus on the situation where external devices generate interrupts routed by interrupt controllers to harts. --> | ||
|
||
The interaction between devices, interrupt controllers, and harts involves two main types of data paths: | ||
**interrupt paths** and **configuration paths**, shown as the following two figures. | ||
|
||
### Interrupt Paths | ||
|
||
![](./images/arch_interrupt_py.svg) | ||
|
||
### Configuration Paths | ||
|
||
![](./images/arch_configure_py.svg) |