Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add riscv test benchmarks #89

Open
mininny opened this issue Oct 17, 2024 · 0 comments
Open

Add riscv test benchmarks #89

mininny opened this issue Oct 17, 2024 · 0 comments

Comments

@mininny
Copy link
Collaborator

mininny commented Oct 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant