RISC-V: I-ext: JAL / JALR

What

Adds the JAL and JALR instructions to the interpreter. Although the whole purpose of the functions is to move the program counter, they return the target address. (The next instruction to be ran)

Convention for naming addresses:

  • Jump to / destination = target
  • Source / from / pc of jal / jalr / … = source
  • Source + instruction width = return / link

As such, instructions that update the program counter now return the target address.

Why

Support running RISC-V executables with an in-house interpreter for better PVM support.

How

Had to modify a bit auxiliary layout related structures.

  • Added 5-tuple option for Layout to support the program counter.

  • For the new impl<E: Elem, M: Manager> Cell<E, M>:
    Since AllocatedOf<E, M> is used as an argument in new_in on the HartState side, the trait bound M: Manager needs to be signed, hence a different impl block with Manager begin sized.

Manually testing the MR

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Felix Puscasu

Merge request reports

Loading