I got a piece of code from a kansas-lava paper, that works.
counter :: Signal CLK Bool -> Signal CLK Bool -> Signal CLK Int
counter restart inc = loop
where
reg = register 0 loop
reg' = mux restart (0, reg)
loop = mux inc (reg' + 1, reg')
Now I tried to do the same in another function, with another functionality, this doesn't work.
shiftReg_d2f :: Signal CLK Bool -> Signal CLK Bool -> [Signal CLK Bool] -> [Signal CLK Bool] -> [Signal CLK Bool]
shiftReg_d2f load shift wordIn fieldIn = fieldOut
where
fieldOut = register 0 fieldOut''
shiftField = drop (length wordIn) fieldOut ++ wordIn
fieldOut' = muxl shift fieldOut shiftField
fieldOut'' = muxl load fieldOut' fieldIn
Now I'm getting the following errors:
- Couldn't match expected type
[Signal i0 Bool]with actual typeSignal clk0 a0(3x) - Couldn't match expected type
Signal i0 Boolwith actual type[Signal i0 Bool] - Couldn't match expected type
Signal i Bool -> Signal i Bool -> Signal i Boolwith actual typeSignal i Bool
What do I do wrong?
Thanks for the help