CHAPTER 02
2. PLIC gateway와 source pending을 pin에서 확인한다
각 global source의 gateway가 request를 한 번 전달하고 completion까지 새 request를 제한하는 모델을 level/edge 장치 동작과 연결합니다.
gateway
source signal을 PLIC core request로 바꾸며 한 source당 outstanding request를 제한합니다.
pending
global pending bit는 어느 target context가 처리할지 결정되기 전 source request를 나타냅니다.
level source
장치 원인이 남으면 complete 뒤 gateway가 다시 request를 만들 수 있습니다.
source 0
ID 0은 interrupt 없음으로 예약되며 유효 source로 쓰지 않습니다.
레지스터·번호·소유권 대조
| 항목 | 소유자 | 값의 의미 | 정상 증거 | 오류 해석 |
|---|---|---|---|---|
| pending word | PLIC core | source pending bitmap | 장치 사건 bit set | wire/gateway 경계 |
| priority[source] | PLIC core | 0이면 never interrupt | 운영 source >0 | pending이나 전달 차단 |
| device status | peripheral | raw source 원인 | PLIC bit와 동시 | 잘못된 source ID |
| DT interrupt spec | firmware | PLIC source ID | 회로/RTL map과 일치 | off-by-one |
| gateway state | implementation/debug | outstanding request | complete 뒤 재수락 | completion 누락 |
실패 경계 판정
| 증상 | 직전 통과 | 우선 확인 | 반증 시험 | 판정 |
|---|---|---|---|---|
| device status 1, PLIC pending 0 | 장치 원인 | wire/source ID/gateway | software 가능한 source와 비교 | 입력 경계 |
| pending 계속 1 | source 수신 | claim/complete와 level clear | 장치 mask 후 complete | 원인 유지 또는 completion |
| 한 edge만 수신 | 첫 event 성공 | gateway outstanding | complete 여부 확인 | claim/complete 누락 |
| source ID가 문서와 다름 | handler는 다른 ID | DT/RTL map | pending bitmap과 pin 자극 대조 | firmware 기술 |
| priority 0인데 기대 | pending 생성 | priority programming | priority 1로 시험 | 정책 설정 |
실제 검증 절차
| 순서 | 실행 | 남길 증거 | 판정 목적 |
|---|---|---|---|
| 1 | source를 하나씩 자극해 device status와 pending bit를 매핑합니다. | source map | RTL/DT 검증 |
| 2 | level source를 clear 전/후 complete해 재발생 차이를 봅니다. | 순서별 count | gateway 모델 확인 |
| 3 | priority 0/1로 전달 차단을 확인합니다. | pending 유지와 trap 차이 | priority 경계 |
| 4 | source 1부터 최대 구현 source까지 address 범위를 검증합니다. | 상한/예약 ID | capability 확인 |
주의PLIC은 edge/level polarity를 표준 register로 설정하지 않습니다. source conditioning은 peripheral 또는 SoC integration 책임일 수 있습니다.
공개적으로 다시 확인할 수 있는 자료
공개되지 않은 vendor register나 integration별 offset을 추측해서 채우지 않았습니다. 아래 제조사 자료, architecture 문서와 Linux v6.18.37 원본에서 다시 확인할 수 있는 범위만 사용했습니다.
RISC-V PLIC specification
gateway, priority, target context와 claim/complete
RISC-V AIA specification
APLIC, IMSIC, interrupt files와 virtualization
Linux SiFive PLIC driver
PLIC domain, enable, claim/complete와 chained handler
Linux RISC-V INTC
local interrupt cause와 root domain