Skip to content

how to write configs of custom tests for a new insn #70

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

Open
wanghuibin0 opened this issue May 2, 2025 · 1 comment
Open

how to write configs of custom tests for a new insn #70

wanghuibin0 opened this issue May 2, 2025 · 1 comment

Comments

@wanghuibin0
Copy link

I'm not very familiar with Go. Right now, I have a custom instruction and I want to use this project to automatically generate test cases for it.
I know I need to create a config file like configs/xxx.toml for my new instruction, but I'm not exactly sure how to write it.

I looked at an example:

name = "vwadd.vv"
format = "vd,vs2,vs1,vm"

[tests]
base = [
    [0x0, 0x0],
    [0x1, 0x2],
    [0x3, 0xf]
]
sew8 = [
    [0xf8, 0x00],
    [0xf8, 0x08],
    [0x7f, 0x00],
    [0x7f, 0x07],
    [0x7f, 0x01],
    [0xff, 0x00],
    [0xff, 0xff]
]

The part I don't really get is what the numbers under the [tests] section mean.
How are they used when generating the actual test cases?
Could you help me understand that?

@ksco
Copy link
Collaborator

ksco commented May 6, 2025

The numbers are used as an array of operands.

It's a lot of work to add a new custom instruction because this project relies on Spike and the compiler to support the instruction you have in mind.

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

No branches or pull requests

2 participants