-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
Describe the bug
When running the same RISC-V program on CKB-VM, the error results differ between asm64 mode and interpreter64 mode.
To Reproduce
.text
.globl _start
_start:
li x15, -300
li x16, 600
xori x17, x15, -750
andi x18, x16, 31
sra x19, x17, 4
bgeu x19, x18, path1
beq x15, x16, path2
or x20, x17, x18
j exit
path1:
li x21, 7
j exit
path2:
li x22, 8
exit:
li x23, 0
jalr x0, x23, 0
- compiler
riscv64-unknown-elf-gcc -nostdlib -march=rv64imc -mabi=lp64 -o test.elf test.s
- run with asm mode
ckb-vm/target/debug/examples/ckb_vm_runner --mode asm64 test.elf
exit=Err(MemWriteOnExecutablePage(0))
cycles=16
r[a1]=0
registers=[0, 0, 4194288, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18446744073709551316, 600, 966, 24, 60, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- run with interpreter mode
ckb-vm/target/debug/examples/ckb_vm_runner --mode interpreter64 test.elf
exit=Err(InvalidInstruction { pc: 0, instruction: 0 })
cycles=16
r[a1]=0
registers=[0, 0, 4194288, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18446744073709551316, 600, 966, 24, 60, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
🏗 In progress