Currently, we're running riscv tests from this test vectors: https://github.com/riscv-software-src/riscv-tests.
There's also benchmark test vectors for the vm https://github.com/riscv-software-src/riscv-tests/tree/master/benchmarks, which are commented out in our tests.
|
//runTestCategory("benchmarks") TODO benchmarks (fix ELF bench data loading and wrap in Go benchmark?) |
In order to run these benchmark tests, we need to fix the elf of asterisc to correctly handle the different Prog.Type in benchmark elf files.
|
if prog.Filesz != prog.Memsz { |
|
if prog.Type == elf.PT_LOAD { |
|
if prog.Filesz < prog.Memsz { |
|
r = io.MultiReader(r, bytes.NewReader(make([]byte, prog.Memsz-prog.Filesz))) |
|
} else { |
|
return nil, fmt.Errorf("invalid PT_LOAD program segment %d, file size (%d) > mem size (%d)", i, prog.Filesz, prog.Memsz) |
|
} |
|
} else { |
|
return nil, fmt.Errorf("program segment %d has different file size (%d) than mem size (%d): filling for non PT_LOAD segments is not supported", i, prog.Filesz, prog.Memsz) |
|
} |
|
} |
After fixing the ELF loading, wrap these benchmark tests in go benchmark test suite, so we can actually view the benchmarks.
Currently, we're running riscv tests from this test vectors: https://github.com/riscv-software-src/riscv-tests.
There's also benchmark test vectors for the vm https://github.com/riscv-software-src/riscv-tests/tree/master/benchmarks, which are commented out in our tests.
asterisc/rvgo/test/vm_test.go
Line 161 in e1a5b01
In order to run these benchmark tests, we need to fix the elf of asterisc to correctly handle the different Prog.Type in benchmark elf files.
asterisc/rvgo/fast/elf.go
Lines 40 to 50 in e1a5b01
After fixing the ELF loading, wrap these benchmark tests in go benchmark test suite, so we can actually view the benchmarks.