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

XCASUE with CLIC option #194

Closed
panda1628 opened this issue Jul 1, 2021 · 7 comments
Closed

XCASUE with CLIC option #194

panda1628 opened this issue Jul 1, 2021 · 7 comments

Comments

@panda1628
Copy link

In RISC-V Core-Local Interrupt Controller
(CLIC) Version 0.9-draft-20210406,

4.7. Changes to xcause CSRs

In both original basic and CLIC modes, the xcause CSR is written at the time an
interrupt or synchronous trap is taken, recording the reason for the interrupt or trap.
For CLIC mode, xcause is also extended to record more information about the
interrupted context, which is used to reduce the overhead to save and restore that
context for an xret instruction. CLIC mode xcause also adds state to record
progress through the trap handling process.

Screenshot 2021-06-30 223611

Is there any option for CLIC in the compliance test?
MCAUSE bit 29:27 will not be the same withOUT it

Thanks in advance for any information

@allenjbaum
Copy link
Collaborator

allenjbaum commented Jul 2, 2021 via email

@panda1628
Copy link
Author

MCAUSE bits 29-28, 27, 23-16
CLINT defines those bits as zero and CLIC defines them as mpp, mpie and mpil

The current compliance test expects them as zero.
If a DUT has implemented CLIC, then MCAUSE will not match.

@allenjbaum
Copy link
Collaborator

allenjbaum commented Jul 2, 2021 via email

@panda1628
Copy link
Author

In riscv-arch-test/riscv-test-env/p/riscv_test.h

trap_vector:
/* test whether the test came from pass/fail */
addi t0, zero, 13;
csrr t5, mcause;
li t6, CAUSE_USER_ECALL;
beq t5, t6, write_tohost;
li t6, CAUSE_SUPERVISOR_ECALL;
beq t5, t6, write_tohost;
li t6, CAUSE_MACHINE_ECALL;
beq t5, t6, write_tohost; \

The upper bits will not match.
Can we mask off bits 29-28, 27, 23-16 for the comparison? (beq)

@allenjbaum
Copy link
Collaborator

allenjbaum commented Jul 2, 2021 via email

@panda1628
Copy link
Author

Even though I can add code to mask off those bits before comparison to avoid the mismatch, I try to avoid changing the compliance tests. It looks like I need to do it until the riscof shows up .

Allen, thanks for your responses.

@allenjbaum
Copy link
Collaborator

allenjbaum commented Jul 5, 2021 via email

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

No branches or pull requests

2 participants