ethereum-optimism / asterisc

RISC-V interactive fraud-proof tech
MIT License
98 stars 15 forks source link

Is riscv64imac fully supported? #76

Closed raindust closed 3 months ago

raindust commented 3 months ago

I write a piece of rust code and just do the same thing with https://github.com/ethereum-optimism/asterisc/blob/48f53131a83817c26b0bc89849e9fbcc90482961/tests/go-tests/minimal/main.go . Then I compiled with the target riscv64imac-unknown-none-elf.

Finally, I run the compiled file with https://github.com/ethereum-optimism/asterisc/blob/48f53131a83817c26b0bc89849e9fbcc90482961/rvgo/test/vm_go_test.go#L212-L259 and it gives me the following error:

=== RUN   TestMinimal/fast
i:    0  pc: 0x11d76  instr: 002c4502  symbol name: _start size: 24
    /home/raindust_x/github/soon/asterisc/rvgo/test/vm_go_test.go:103:
                Error Trace:    /home/raindust_x/github/soon/asterisc/rvgo/test/vm_go_test.go:103
                                                        /home/raindust_x/github/soon/asterisc/rvgo/test/vm_go_test.go:237
                Error:          Received unexpected error:
                                revert f001c0de: revert: unknown instruction opcode: 2
                Test:           TestMinimal/fast
                Messages:       fast VM must run step
--- FAIL: TestMinimal/fast (0.00s)
...

From the README here I think the riscv64imac is fully supported, am I missing something?

protolambda commented 3 months ago

The c risc-v extension is currently not supported. See https://github.com/ethereum-optimism/asterisc/pull/6 for a draft of that.

Without c extension some No-std rust programs can be proven by modifying the compiler settings I believe. See the Kona project as example.

raindust commented 3 months ago

Thanks for your information @protolambda , I will have a try.