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

Why Formal #34

Open
ThePerfectComputer opened this issue Jun 2, 2023 · 4 comments
Open

Why Formal #34

ThePerfectComputer opened this issue Jun 2, 2023 · 4 comments

Comments

@ThePerfectComputer
Copy link

What makes this codebase a formal model? I ask because I'm currently writing a model for a CPU I'm designing in Haskell, and I want to know what a model has to have to be called "formal".

@samuelgruetter
Copy link
Contributor

It's formal in the sense that it enables its users to apply formal methods, ie to reason with mathematical proofs about the behavior of their hardware and/or software. You can read more about how we did that in this preprint paper.

@ThePerfectComputer
Copy link
Author

Oh wow! That paper is really cool. Incidentally, I have been using Clash for some other projects.

@ThePerfectComputer
Copy link
Author

Lines like these seem a bit verbose and redundant...
https://github.com/mit-plv/riscv-semantics/blob/master/src/Spec/Decode.hs#L17-L21

I could conceive of perhaps:

data LoadType = LoadType  { rd :: Register, rs1 :: Register, oimm12 :: MachineInt }

data InstructionI =
  Lb LoadType |
  Lh LoadType |
  Lw LoadType |
  Lbu LoadType |
  Lb LoadType |
  Lhu LoadType

Why such a verbose approach?

@ThePerfectComputer
Copy link
Author

Also - perhaps this isn't the appropriate place for this conversation. I'm genuinely intrigued by this codebase at a basic level - and I suppose I have a number of questions...

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