Skip to content

Modify Smaia extension and add Machine-Level AIA CSRs (Phase 1 of Issue #566) #851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

syedowaisalishah
Copy link
Contributor

This PR introduces initial support for the Smaia (Machine-Level Advanced Interrupt Architecture) extension, addressing Issue #566.

New Machine-Level CSRs Added:

  • mvien
  • mvienh
  • mviph
  • miph
  • mieh
  • midelegh
  • mtopoi
  • mtopei
  • mvip

These CSRs represent Phase 1 of the implementation, covering machine-level functionality. Supervisor- and VS-level CSRs will be added in a follow-up phase.

Copy link
Collaborator

@dhower-qc dhower-qc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few comments to get started. This one is tricky, and is probably going to need some schema adjustments to represent conditional aliasing.

Comment on lines +61 to +66
RESERVED:
location: 31-28
base: 32
type: RO
reset_value: 0
description: Reserved. Always reads as 0.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove this; unspecified bits are reserved

Bits corresponding to unsupported or unimplemented interrupts must be read-only zero.

fields:
midelegh:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

field names need to be UPPERCASE

Comment on lines +29 to +37
location: 31-0
type: RW-R
sw_write(csr_value): |

description: |
Interrupt delegation bits 32-63. Each bit, when set, delegates the corresponding
interrupt to HS/S-mode. Bits corresponding to unimplemented or non-delegatable interrupts
are read-only zero.
reset_value: 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike the spec, UDB treats the individual bits of m[i|e]deleg as separate fields. In this case, I think there aren't any standard interrupts > 31, so this CSR has an empty fields right now:

fields: []

Comment on lines +23 to +30
mieh:
location: 31-0
type: RW-R
sw_write(csr_value): |
description: |
Interrupt enable bits 32-63. Each bit enables the corresponding interrupt
if supported. Unsupported bits are read-only zero.
reset_value: 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, empty fields

Comment on lines +34 to +40
location: 31-0
type: RW
description: |
Interrupt-pending bits 32 through 63. Each bit corresponds to an interrupt
source above bit 31 in the full `mip` register. These bits reflect interrupt
pending status and are writable in M-mode.
reset_value: 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

IPRIO:
location: 7-0
base: 32
type: RO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be RO-H (read only with hardware update)

IID:
location: 27-16
base: 32
type: RO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RO-H

Comment on lines +34 to +36
description: |
Supervisor software interrupt enable. May be writable or read-only zero depending on platform.
When 1, allows delegation of SSIP via `mvip` even if not delegated via `mideleg`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need a parameter for this. it will affect type(), and probably reset_value()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is complicated. We have to represent this:

image

Which means that we have to change sip and sie defintions.

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.

2 participants