An attempt at a formal reference model for the RISC-V ISA written in Clash Haskell.
This works with ghc 9.4.8
The clash compiler is basically a modified version of ghc designed to allow for first class support of haskell code as circuits.
Note that this repository is currently very much W.I.P. That being said, this is how you would currently run a simulation:
cabal run main --ghc-options="-D_RAM_DEPTH=2048" -- --firmware=./rv_tests/hello_world/hello.bin
All the context that we pick up as we execute an instruction in essence forms the context of our micro-op machinery.
Change instructions to support Nix
- fetch should invoke mem read function
- Potential functions
- BitPat -> Opcode
- Opcode -> Fields
- Fields -> Field Vals
- Field Vals -> Reg Vals
- Check that all forms get used!! Remove unused forms!!
- Some forms may be redundant(may need to remove some)
- turn off derive generics
- update commands to use flags that prevent ghc intermediate outputs from littering source tree
- enable Phoityne debug
- learn to use trace and jupyter
- draw conclusions on feasibility of debugging without VCD viewer