converted to bluespec haskell

This commit is contained in:
Yehowshua Immanuel 2024-05-19 22:16:33 -04:00
parent 72788b8436
commit cf68a5e683
17 changed files with 342 additions and 339 deletions

20
bs/State.bs Normal file
View file

@ -0,0 +1,20 @@
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