Copyright  (C) 20132015, University of Twente 

License  BSD2 (see the file LICENSE) 
Maintainer  Christiaan Baaij <christiaan.baaij@gmail.com> 
Safe Haskell  None 
Language  Haskell2010 
Extensions 

 data DSignal delay a
 delay :: forall a n m. KnownNat m => Vec m a > DSignal (n  m) a > DSignal n a
 delayI :: (Default a, KnownNat m) => DSignal (n  m) a > DSignal n a
 feedback :: (DSignal ((n  m)  1) a > (DSignal ((n  m)  1) a, DSignal n a)) > DSignal ((n  m)  1) a
 fromSignal :: Signal a > DSignal 0 a
 toSignal :: DSignal delay a > Signal a
 dfromList :: [a] > DSignal 0 a
 unsafeFromSignal :: Signal a > DSignal n a
 antiDelay :: SNat d > DSignal n a > DSignal (n  d) a
Delayannotated synchronous signals
A synchronized signal with samples of type a
, synchronized to "system"
clock (period 1000), that has accumulated delay
amount of samples delay
along its path.
Functor (DSignal delay) Source  
Applicative (DSignal delay) Source  
Foldable (DSignal delay) Source  
Traversable (DSignal delay) Source  
Bounded a => Bounded (DSignal delay a) Source  
Enum a => Enum (DSignal delay a) Source  
Eq (DSignal delay a) Source  
Fractional a => Fractional (DSignal delay a) Source  
Integral a => Integral (DSignal delay a) Source  
Num a => Num (DSignal delay a) Source  
Ord a => Ord (DSignal delay a) Source  
(Num a, Ord a) => Real (DSignal delay a) Source  
Show a => Show (DSignal delay a) Source  
Bits a => Bits (DSignal delay a) Source  
FiniteBits a => FiniteBits (DSignal delay a) Source  
Default a => Default (DSignal delay a) Source  
Lift a => Lift (DSignal delay a) Source  
SaturatingNum a => SaturatingNum (DSignal delay a) Source  
ExtendingNum a b => ExtendingNum (DSignal n a) (DSignal n b) Source  
type AResult (DSignal n a) (DSignal n b) = DSignal n (AResult a b) Source  
type MResult (DSignal n a) (DSignal n b) = DSignal n (MResult a b) Source 
feedback :: (DSignal ((n  m)  1) a > (DSignal ((n  m)  1) a, DSignal n a)) > DSignal ((n  m)  1) a Source
Feed the delayed result of a function back to its input:
mac ::DSignal
0 Int >DSignal
0 Int >DSignal
0 Int mac x y =feedback
(mac' x y) where mac' ::DSignal
0 Int >DSignal
0 Int >DSignal
0 Int > (DSignal
0 Int,DSignal
1 Int) mac' a b acc = let acc' = a * b + acc in (acc,delay
(singleton
0) acc')
>>>
sampleN 6 (mac (dfromList [1..]) (dfromList [1..]))
[0,1,5,14,30,55]
Signal <> DSignal conversion
fromSignal :: Signal a > DSignal 0 a Source
Signal
s are not delayed
sample s == dsample (fromSignal s)
List <> DSignal conversion (not synthesisable)
dfromList :: [a] > DSignal 0 a Source
Create a DSignal
from a list
Every element in the list will correspond to a value of the signal for one clock cycle.
>>>
sampleN 2 (dfromList [1,2,3,4,5])
[1,2]
NB: This function is not synthesisable
Experimental
unsafeFromSignal :: Signal a > DSignal n a Source