ethereum-optimism / ethereum-optimism/asterisc
Update riscv-test test vectors
- Dominant language
- Go
- Stars
- 109
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
Asterisc has [riscv-test](https://github.com/ethereum-optimism/asterisc/tree/master/tests/riscv-tests) which are test vectors provided by the [official riscv organization](https://github.com/riscv-software-src/riscv-tests).
Kona was recently updated to use [rv64ima](https://github.com/op-rs/kona/pull/868) architecture which doesn't contain instruction sets like `zicsr`.
However, the tests in riscv-test contain test macros that rely on the usage of such csr instructions. As such, test vectors in the riscv-test cannot be built for `rv64ima` and will fail upon building with custom riscv toolchain built for `rv64ima`. See this open issue: https://github.com/riscv-software-src/riscv-tests/issues/368.
This means that we should keep the CSR instructions or at least NOOP them (since they aren't used in actual kona binary) in the vm to support riscv-test. See this [PR](https://github.com/ethereum-optimism/asterisc/pull/123) to properly handle CSR instruction by encoding.
If we would like to remove these CSR instructions, since we would still want to test asterisc implementation against the official test vectors, we should consider either:
- keeping this specific instruction set `zicsr` for testing purposes even though it isn't used in kona's binary
- contribute to upstream riscv-test repository to support building with rv64ima
- remove the test suites
Contributor guide
Assessment
This issue has not been assessed yet.