-
Notifications
You must be signed in to change notification settings - Fork 188
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 first-party tests #740
Comments
Unusual, but I think actually quite compelling for this use case with the out of the box cross-compilation. I suppose C would be a more standard choice. The only thing I'm worried about is adding to our reputation for using 'esoteric' languages, I've had comments on Sail's use of OCaml as an implementation language, even though it's A) very well suited to the task and B) really not that unusual within the compiler/programming language space. |
Clang allows cross-compilation out-of-the-box as well and using C (or my preference C++) would be a bit less surprising to newcomers? |
Yeah can we not use weirdo languages like Zig? I know it has its following but it's far from mainstream. Yes, that's true for Sail too, but that's because ISA modelling is inherently niche; writing boilerplate tests is not. |
Clang is way harder to install though. One option is just to use Zig as a cross-compiler and build system, and write the tests in C. I'll push a PR with examples of both. |
It won't be needed for people to use the sail model, only people writing new tests (or running the existing ones).
|
Note that there are ACT tests that tests a lot of the above kinds of
examples.
I'm not sure we specifically tests for accesses to the top by of memory,
but we do have PMP and MMU crossproducts.
…On Fri, Feb 14, 2025 at 1:28 PM Alexander Richardson < ***@***.***> wrote:
Clang is way harder to install though.
It won't be needed for people to use the sail model, only people writing
new tests (or running the existing ones).
I think we should be able to either use the system package manager or
download
https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-Linux-X64.tar.xz
One option is just to use Zig as a cross-compiler and build system, and
write the tests in C. I'll push a PR with examples of both.
—
Reply to this email directly, view it on GitHub
<#740 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJTKLTPUI47SNSMFS4D2PZNXZAVCNFSM6AAAAABXE4HOUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRQGMYDENRWGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
[image: arichardson]*arichardson* left a comment (riscv/sail-riscv#740)
<#740 (comment)>
Clang is way harder to install though.
It won't be needed for people to use the sail model, only people writing
new tests (or running the existing ones).
I think we should be able to either use the system package manager or
download
https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-Linux-X64.tar.xz
One option is just to use Zig as a cross-compiler and build system, and
write the tests in C. I'll push a PR with examples of both.
—
Reply to this email directly, view it on GitHub
<#740 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJTKLTPUI47SNSMFS4D2PZNXZAVCNFSM6AAAAABXE4HOUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRQGMYDENRWGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I think we should have a place for first-party
riscv-tests
style tests so we can write tests for PRs and bug fixes. These wouldn't be exhaustive tests or verification, but specific to the Sail model (though we should try and write them so they can run on any RISC-V CPU).Some examples of tests that I've wanted recently:
pmpaddr
to 0xFFFFFFFF (Incorrect behaviour with INT_MAX pmpaddr #739)mstatus[FS]
is read-only without S or F implemented (mstatus[FS] must be read-only zero in some cases #661)I have a prototype using Zig that I will make a draft PR. Zig is an unusual choice, but I think it has a number of very significant advantages:
The big downside is that it's far from a 1.0 release and relatively unstable, so we'd probably need to pin the compiler version, and do some work when 1.0 is released. Also the documentation is sparse, but ChatGPT helps a lot.
Here's an example test for #739
The text was updated successfully, but these errors were encountered: