CSR Bit Fields

RISC-V mtopei CSR Register

Address 0x35CPrivilege MachineAccess MRW / MXLENMachine AIA, timer, and indirect interrupt CSRs

AIA machine top external interrupt CSR; exists only when an IMSIC is implemented.

Bit Overview
bit 3 = only bit 3; bits 12..11 = bits 12 down to 11
MSBLSB
Field Map

Understand mtopei By Bit Fields

4 key fields
MXLEN-1:27

Reserved

RO0

AIA specifies that all other bits in a *topei return value are zeros.

Reserved (bits MXLEN-1:27) — AIA specifies that all other bits in a *topei return value are zeros.

What This Field Controls

  • - AIA specifies that all other bits in a *topei return value are zeros.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

26:16

Interrupt identity

MRW

On read, reports the minor identity of the current highest-priority pending-and-enabled external interrupt in the IMSIC machine-level interrupt file; on write, the current readable identity is used to clear the corresponding pending bit.

Interrupt identity (bits 26:16) — On read, reports the minor identity of the current highest-priority pending-and-enabled external interrupt in the IMSIC machine-level interrupt file; on write, the current readable identity is used to clear the corresponding pending bit.

What This Field Controls

  • - On read, reports the minor identity of the current highest-priority pending-and-enabled external interrupt in the IMSIC machine-level interrupt file; on write, the current readable identity is used to clear the corresponding pending bit.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

15:11

Reserved

RO0

AIA specifies that all other bits in a *topei return value are zeros.

Reserved (bits 15:11) — AIA specifies that all other bits in a *topei return value are zeros.

What This Field Controls

  • - AIA specifies that all other bits in a *topei return value are zeros.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

10:0

Interrupt priority

MRW

On read, returns the external-interrupt priority encoding, the same as the interrupt identity; a zero return means no interrupt is currently reportable through mtopei.

Interrupt priority (bits 10:0) — On read, returns the external-interrupt priority encoding, the same as the interrupt identity; a zero return means no interrupt is currently reportable through mtopei.

What This Field Controls

  • - On read, returns the external-interrupt priority encoding, the same as the interrupt identity; a zero return means no interrupt is currently reportable through mtopei.

Common Values

mtopei report value
0No reportable external interrupt

A read of mtopei returning 0 means either no external interrupt is pending and enabled, or eithreshold is nonzero and no pending-and-enabled external interrupt has an identity below the threshold; writing while the value is zero has no effect.

Official Basis & Search Notes

AIA machine top external interrupt CSR; exists only when an IMSIC is implemented.

The official AIA table lists mtopei at 0x35C, with MRW access and MXLEN width.
mtopei exists only when an IMSIC is implemented.
This page avoids older generic trap/debug wording.

What To Check First When Reading This CSR

  • - Check mtopei address, access class, and width against the official AIA CSR table.
  • - mtopei exists only when an IMSIC is implemented; access cannot be assumed otherwise.

Risk Checks Before Writing

  • - On a write to mtopei, the written value is ignored; the interrupt identity in the current readable value determines which pending bit is cleared.
  • - Use a single CSR instruction that reads and writes mtopei when practical, so software knows which interrupt was claimed.

Put It Back Into A Real Flow

1

Confirm that the hart implements AIA and an IMSIC machine-level interrupt file.

2

Read mtopei and interpret it according to the AIA definition for top external interrupt.

3

Claim the currently reported external interrupt with a CSR instruction that reads and writes the CSR together; a write has no effect when mtopei is zero.

FAQ

Is mtopei a standard AIA CSR?

Yes. This page follows the address, access class, and width in the official AIA CSR table.

Can unlisted mtopei bits be written freely?

No. AIA specifies that the written value is ignored; the current readable interrupt identity determines the claim, and the other return bits are zeros.