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
Layoutto support the program counter. -
For the new
impl<E: Elem, M: Manager> Cell<E, M>:
SinceAllocatedOf<E, M>is used as an argument innew_inon theHartStateside, the trait boundM: Managerneeds to be signed, hence a differentimplblock withManagerbegin 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.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Felix Puscasu