Safe Haskell | None |
---|---|
Language | Haskell2010 |
The RTL module provides a small DSL that's useful for control-oriented -- stateful -- computations.
- data RTL s c a where
- data Reg s c a
- data Cond s c
- runRTL :: forall c a. Clock c => (forall s. RTL s c a) -> a
- reg :: Reg s c a -> Signal c a
- var :: Reg s c a -> Signal c a
- newReg :: forall a c s. (Clock c, Rep a) => a -> RTL s c (Reg s c a)
- newArr :: forall a c ix s. (Size ix, Clock c, Rep a, Num ix, Rep ix) => Witness ix -> RTL s c (Signal c ix -> Reg s c a)
- match :: Rep a => Signal c (Enabled a) -> (Signal c a -> RTL s c ()) -> Cond s c
Documentation
RTL Monad; s == the runST state; c is governing clock, and a is the result
A conditional statement.
reg :: Reg s c a -> Signal c a Source #
reg is the value of a register, as set by the start of the cycle.
var :: Reg s c a -> Signal c a Source #
var is the value of a register, as will be set in the next cycle, so intra-cycle changes are observed. The is simular to a *variable* in VHDL.
newReg :: forall a c s. (Clock c, Rep a) => a -> RTL s c (Reg s c a) Source #
Declare a new register.