This repository has been archived on 2025-06-25. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
riscv-bluespec-classic/old_src/State.bs
Yehowshua Immanuel b1c14f5aba first commit
2023-09-23 02:08:37 -04:00

20 lines
No EOL
396 B
Haskell

package State(
State(..),
ftdiState') where
data State = IDLE
| START
| DATA (UInt (TLog 8))
| PARITY
| STOP
deriving (Bits, Eq, FShow)
ftdiState' :: State -> State
ftdiState' state =
case state of
IDLE -> START
START -> DATA(0)
DATA(7) -> PARITY
DATA(n) -> DATA(n+1)
PARITY -> STOP
STOP -> IDLE