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

JALR for misaligned addresses doesn't raise trap #19

Open
darbaria opened this issue May 24, 2021 · 0 comments
Open

JALR for misaligned addresses doesn't raise trap #19

darbaria opened this issue May 24, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@darbaria
Copy link
Owner

Page 21 of the RISCV-ISA 2019 version states that "The JAL and JALR instructions will generate an instruction-address-misaligned exception if the target address is not aligned to a four-byte boundary."

This is not implemented correctly in the design. The trap should be raised if the lower two bits are non-zero for the target address that is obtained by summing up the PC and the sign-extended offset.

  //-- This is what the design is doing

as_ISA_JALR_design_raises_TRAP_but_incorrectly:
`ap (`CORE.FETCH_Instr_indirect_jump_a5 && `CORE.FETCH_Instr_indirect_jump_full_target_a5[1] |-> `CORE.FETCH_Instr_non_aborting_isa_trap_a5);

@darbaria darbaria added the bug Something isn't working label May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants