Question about MEPC and MBADADDR on JAL/JALR to misaligned addr.

51 views
Skip to first unread message

Rishiyur Nikhil

unread,
Feb 27, 2017, 11:42:39 AM2/27/17
to isa...@groups.riscv.org
The spec "User-Level ISA, Version 2.1" says (top of p.16):

    The JAL and JALR instructions can generate a misaligned
    instruction fetch exception if the target address is not aligned
    to a four-byte boundary.

Question: what should be in MEPC and MBADADDR after this?

I'd guess that MEPC is the PC of the JAL/JALR instr
   (unlike an actual misaligned fetch where MEPC = misaligned fetch address)
and MBADADDR is the misaligned target address?

Nikhil

Samuel Falvo II

unread,
Feb 27, 2017, 1:04:45 PM2/27/17
to Rishiyur Nikhil, RISC-V ISA Dev
On Mon, Feb 27, 2017 at 8:42 AM, Rishiyur Nikhil <nik...@bluespec.com> wrote:
> Question: what should be in MEPC and MBADADDR after this?

MEPC will be the address of the JAL(R) instruction. MBADADDR will be
the erroneous effective address.

--
Samuel A. Falvo II
Reply all
Reply to author
Forward
0 new messages