ethereum-optimism / ethereum-optimism/asterisc

Update riscv-test test vectors

Open
#130 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.