Skip to content

Fix AIA local interrupts above 31 on RV32 and add rv32imac_mp_aia - #63

Open
cphurley82 wants to merge 5 commits into
Minres:mainfrom
cphurley82:fix/aia-local-interrupts
Open

cphurley82 wants to merge 5 commits into
Minres:mainfrom
cphurley82:fix/aia-local-interrupts

Conversation

@cphurley82

Copy link
Copy Markdown
Contributor

Fixes local interrupt handling on RV32 cores with the Advanced Interrupt Architecture, and adds an rv32imac core that uses it.

  • core_complex capped CLINT inputs at XLEN, so an RV32 AIA core could not have 64 local interrupts. It also built the interrupt bit with an int shift and masked mcause to 32 causes.
  • New core type rv32imac_mp_aia: rv32imac_mp with FEAT_AIA.
  • mu_p wrote miph into the lower half of mip, and msu_vp read miph from the lower half.
  • msu_vp did not compile with any FEAT other than FEAT_NONE (this_class dropped FEAT).
  • New tests: a core_complex test that takes local interrupt 40 on the new core, and hart-level miph tests for mu_p and msu_vp.
  • Not changed: msu_vp read_ip has the same typo under case siph, and write_ie merges sie writes from mie. Neither can be reached because siph and sieh are never registered.

cphurley82 and others added 5 commits October 22, 2026 10:28
Registers rv32imac_mp_aia, the rv32imac_mp core with the Advanced
Interrupt Architecture enabled.

Co-authored-by: Mark Karlstad <mkarlsta@qti.qualcomm.com>
The testbench takes a CLINT input count and binds one signal initiator
per input, and the encoder gains the CSR instructions a trap test needs.
AIA adds mieh/miph so an RV32 hart can take 64 local interrupts, but
core_complex capped the CLINT inputs at XLEN, built the irq bit with an
int shift and masked mcause to 32 causes. A FEAT_AIA RV32 m_p hart now
accepts 64 inputs and reports their causes in full.

Co-authored-by: Mark Karlstad <mkarlsta@qti.qualcomm.com>
write_ip tested for mieh, which never reaches it, so a miph write landed
in the lower half. An RV32 mu_p hart with AIA also accepts 64 local
interrupts now, as m_p does.

Co-authored-by: Mark Karlstad <mkarlsta@qti.qualcomm.com>
read_ip tested for mieh, which never reaches it, so a miph read returned
the lower half. An RV32 msu_vp hart with AIA also accepts 64 local
interrupts now, as m_p and mu_p do.

this_class dropped FEAT, so msu_vp did not compile with any feature set
and no AIA build of it existed.

Co-authored-by: Mark Karlstad <mkarlsta@qti.qualcomm.com>
@cphurley82
cphurley82 marked this pull request as ready for review October 22, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant