Skip to content
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

create a new PR for https://github.com/riscv/riscv-fast-interrupt/pull/395 #441

Open
jb-brelot-nxp opened this issue Jan 6, 2025 · 1 comment
Assignees
Labels
v1.0 resolve for 1.0

Comments

@jb-brelot-nxp
Copy link
Collaborator

#395

it is confusing when doing csrr (rs1 == x0) whether clic.level should be compared against mcause.mpil or whether it should be compared to 0 (rs1[23:16]). I think the intent is that csr reads are compared to mcause.mpil.

@jb-brelot-nxp jb-brelot-nxp added the v1.0 resolve for 1.0 label Jan 6, 2025
@hirooih
Copy link

hirooih commented Jan 21, 2025

@jb-brelot-nxp

Let me confirm the intent of this issue ticket.

The title of #395 is "mnxti pseudo code clarification when rs1 == x0". And as you quoted, it commented as follows;

it is confusing when doing csrr (rs1 == x0) whether clic.level should be compared against mcause.mpil or whether it should be compared to 0 (rs1[23:16]). I think the intent is that csr reads are compared to mcause.mpil.

On the other hand, the content of the PR is to delete the "mnxti pseudo code when rs1 == x0", as follows

- // Pseudo-code for csrrs rd, mnxti, rs1 in M mode.
+ // Pseudo-code for csrrs rd, mnxti, rs1, rs1 != x0 in M mode.

Is the intent of this issue ticket to define csrr rd, mnxti as follows?

Pseudo-code for csrr rd, mnxti (csrrs rd, mnxti, x0) in M mode:

 // clic.priv, clic.level, clic.id represent the highest-ranked interrupt currently present in the CLIC
   if (clic.priv==M && clic.level > mcause.mpil && clic.level > mintthresh.th) {
     // There is an available interrupt.
     rd = VTBASE + XLEN/8 * clic.id; // Return pointer to trap handler entry.
   } else {
     // No interrupt or in non-CLIC mode.
     rd = 0;
   }

This definition is consistent with the text of this specification and makes sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.0 resolve for 1.0
Projects
None yet
Development

No branches or pull requests

3 participants