Skip to content

Conversation

@Timmmm
Copy link
Contributor

@Timmmm Timmmm commented Oct 14, 2025

I noticed a weird issue with the C++ backend (RISC-V PR). Basically where we have something like this:

val get_config_print_instr = pure {cpp:"get_config_print_instr"} : unit -> bool
function get_config_print_instr () = false

It was no longer using the external cpp version and instead always falling back to the Sail = false implementation. If I comment out the function get_config_print_instr () = false then it works fine.

This PR fixes that.

@github-actions
Copy link

github-actions bot commented Oct 14, 2025

Test Results

   16 files     35 suites   0s ⏱️
  989 tests   986 ✅  3 💤 0 ❌
4 785 runs  4 743 ✅ 42 💤 0 ❌

Results for commit c593f2a.

♻️ This comment has been updated with latest results.

@Alasdair
Copy link
Collaborator

Alasdair commented Oct 14, 2025

If I check out your RISC-V PR and built it with this commit, then zsp_reg_name_forwards is not present for me in the generated code, however I also don't get an error about it being missing. Not sure why?

Set the target name in the rewrites to 'cpp' for the C++ backend.
@Timmmm Timmmm force-pushed the user/timh/cpp_rewrites branch 2 times, most recently from d0d5864 to 4ad7655 Compare October 15, 2025 08:47
@Timmmm Timmmm changed the title Fix rewrites for the cpp backend (wip) Fix rewrites for the cpp backend Oct 15, 2025
@Timmmm
Copy link
Contributor Author

Timmmm commented Oct 15, 2025

Ah I think probably it was getting confused with the missing . in the output filename and using old files or something. I fixed that issue, and tried a clean build and it seems to work now.

@Timmmm Timmmm marked this pull request as ready for review October 15, 2025 08:49
@Timmmm
Copy link
Contributor Author

Timmmm commented Oct 15, 2025

Hmm not sure why the tests are still failing though...

@Alasdair
Copy link
Collaborator

I think they just needed a cpp added in addition to c, I've pushed a commit that should fix them.

@Alasdair Alasdair merged commit 1bc80ac into rems-project:sail2 Oct 15, 2025
9 checks passed
@Timmmm Timmmm deleted the user/timh/cpp_rewrites branch October 15, 2025 19:36
jn80842 pushed a commit to GaloisInc/sail that referenced this pull request Dec 11, 2025
* Fix rewrites for the cpp backend

Set the target name in the rewrites to 'cpp' for the C++ backend.

* Adjust failing C++ tests
Alasdair added a commit to Alasdair/opam-repository that referenced this pull request Dec 22, 2025
CHANGES:

This is bugfix release for Sail 0.20. It includes fixes for the
following issues, among others:

* rems-project/sail#1532
* rems-project/sail#1529
* rems-project/sail#1512
* rems-project/sail#1509
* rems-project/sail#1554

It also includes various improvements to the Sail formatter, and some
improvements to the loop syntax that should make while and foreach
loops slightly more consistent.

This point release also includes the change that unifies the `bit`
type with the `bits(1)` type. In principle, this means that strictly
more programs should be permitted than before, so we have decided to
forgo a major version increment for this. The change may be noticable
to those using Sail generated theorem prover definitions.
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

Successfully merging this pull request may close these issues.

2 participants