Skip to content

Add riscv test benchmarks #89

@mininny

Description

@mininny

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions