-
Notifications
You must be signed in to change notification settings - Fork 218
Change XLEN and FLEN to be configure-time options #870
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
Conversation
This is awesome! It looks like the upstream issues are fixed. Are there any other issues preventing this coming out of draft? |
11d975a
to
336ba9f
Compare
Getting closer but I hit another issue: rems-project/sail#1251 |
Also I need to:
And we'll need to wait for a new Sail compiler release after it's working. |
Ok I got the RV64 first party test passing! Still need to do all the todos I mentioned. |
I did have a crazy idea - what if we just take the xlen setting from the ELF file? :-D On balance, probably a bad idea. Explicitness is good. Just thought I'd mention it! |
Something to think about down the road maybe. I think we can technically even find out which extensions an elf was compiled with if we really wanted to. Might be nice to be able to just run an elf without thinking about the config. For verification purposes though (which I think is one of the primary uses of the Sail model), you want the model to exactly match an implementation no matter what the elf file being passed in is. Maybe there could be two different modes in the future: use the values from a config file if one is given and parse the elf if not. |
This basically works now. All the tests pass. Remaining todos:
|
e3e76fa
to
551e8f8
Compare
551e8f8
to
97142a0
Compare
This also needs changes to the types of the callback interface now ( |
@Timmmm I updated the types for the callbacks to get this building again and then removed I also realized that we need to maintain separate targets for the theorem provers since they take a compile time config file, so I added those back in. |
52c51d2
to
5dd40e2
Compare
Not sure why the SMT target is failing to populate the config values from the config file, but other than that, this seems to be working now (barring the new Sail release). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM - just a few minor nits.
293ebf5
to
b85125c
Compare
Other than waiting on the new sail release, I still need to sort out why all of the theorem provers (including the SMT target) are giving the following error:
|
aac864e
to
3626360
Compare
These should be quite easy to handle with a simple CMake substition:
|
I'm still slightly partial to just copy & pasting. It's only two files and I think it's unlikely to grow... and I think there's a lot of value in having the file in the source tree that people can easily copy & paste and modify without having to dig it out from the build directory. Would you be ok with merging this as-is and using |
I do think we could delete |
Yes if there are only two files I'd be happy with this. |
3626360
to
a827356
Compare
a827356
to
fa1531d
Compare
Ok I think this is ready to go. I finally got around to benchmarking it. First 3 million instructions of booting Linux (this is not very many - it actually doesn't get through OpenSBI). With a recent
Considering with the 0.19.1 compiler it's like 9 kIPS and nobody noticed, I think that's fine. It would be nice to work back up to ~500 kIPS which is what Sail was capable of a while ago, but we'll have to do some work for that. I have some ideas. |
fa1531d
to
52f8c43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! We should merge this soon to avoid more painful rebasing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great!
52f8c43
to
b72811b
Compare
Rebased again. Would definitely be nice to get merged soon since just about any change to the CMake or config files forces this be rebased. |
b72811b
to
a148093
Compare
This means you only need to compile the emulator once in order to support RV32F, RV32D, RV64F and RV64D. Co-authored-by: Jordan Carlin <[email protected]> Remove `default.json` and use RV64D by default directly
a148093
to
7b8122f
Compare
Didn't notice your rebase so I also rebased, and we both made slightly different rebase mistakes which I have fixed. :-D I will merge this today if nobody objects! |
This means you only need to compile the emulator once in order to support RV32F, RV32D, RV64F and RV64D. The emulator binary has been renamed to
sail_riscv_sim
.XLEN is controlled by the
base.xlen
config value. FLEN is controlled byextensions.{F,D}.supported
.Some backends (Lean etc.) still need a compile-time config so for those we still support building multiple configs.