Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the TODOs in the Harvard Architecture PR (#711)
In the [Harvard Architecture PR](#688) we left a few TODOs. Here we make good on them. There's a few things happening in this PR: - We remove the fake instruction `EANY`. `EANY` was only ever an artifact of Risc0's incredible 'interesting' approach to decoding. We use the real instructions `ECALL` and `EBREAK` instead. - Remove `AUIPC` and `LUI`. Both of them are now implemented as pseudo-instructions, that translate to `ADDI` during decoding. - Use the same library as SP1 for RiscV decoding, instead of copy-and-pasting-and-editing Risc0's 'interesting' decoder. That simplifies our code, and comes with a lot more tests than we ever had. Both because of explicit tests in the library, and because of the usage in SP1 and other projects. This gets rid of much error prone bit manipulating code. - Use `struct Instruction` throughout the code when handling and testing instructions, instead of `u32`. That makes specifying tests a lot simpler and more readable. No more `0b_000000001010_00000_000_00001_0010011, // addi x1, x0, 10` in the code. - Remove the notion of executable vs non-executable ROM. This is only necessary for a von-Neumann architecture: everything that's in our instruction-cache is meant to be executable already. (We can re-implement this restriction later by controlling what is allowed to make it into the instruction cache when we eg decode the ELF. But it's unnecessary: we already honour the executable flag for memory sections in the ELF.)
- Loading branch information