Skip to content
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

sail-to-lean: Add support to memory #959

Open
ineol opened this issue Feb 4, 2025 · 5 comments · May be fixed by #965
Open

sail-to-lean: Add support to memory #959

ineol opened this issue Feb 4, 2025 · 5 comments · May be fixed by #965
Labels
Lean Issues with Sail to Lean translation

Comments

@ineol
Copy link
Collaborator

ineol commented Feb 4, 2025

This is a prerequisite for properly fixing #939.

A good candidate would be to have the SequentialState.mem field be a Std.HashMap Nat UInt8

@ineol ineol added the Lean Issues with Sail to Lean translation label Feb 4, 2025
@javra
Copy link
Collaborator

javra commented Feb 6, 2025

Is Nat the right semantics or do we have to restrict the "address space"?

@bacam
Copy link
Contributor

bacam commented Feb 6, 2025

The memory interface in Sail uses bitvectors for physical addresses, FWIW.

@tobiasgrosser
Copy link
Collaborator

LNSym did the same, AFAIU.

@ineol
Copy link
Collaborator Author

ineol commented Feb 9, 2025

The memory interface in Sail uses bitvectors for physical addresses, FWIW.

But it's Nat's in the Coq (sequential) state, right?

In State_monad.v:

Module NMap := FMapAVL.Make(OrderedTypeEx.N_as_OT).
Definition Memstate : Type := NMap.t memory_byte.

@bacam
Copy link
Contributor

bacam commented Feb 9, 2025

But it's Nat's in the Coq (sequential) state, right?

Yes, it is there. With the new concurrency interface the model's type is passed down (and I think Thibaut's sequential interpretation uses that directly, even though the Sail interface requires a function to embed it in a bitvector). It probably doesn't make much difference for us at the moment.

bacam pushed a commit that referenced this issue Feb 10, 2025
Removes the previous hack of just using StateM Unit in this case. This will be necessary to proceed with #959 on examples that use memory but no registers.
@lfrenot lfrenot linked a pull request Feb 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lean Issues with Sail to Lean translation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants