Copyright  (C) 20132016 University of Twente 2017 Google Inc. 

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

Synopsis
 data DSignal (domain :: Domain) (delay :: Nat) a
 delayed :: forall domain gated synchronous a n d. KnownNat d => Clock domain gated > Reset domain synchronous > Vec d a > DSignal domain n a > DSignal domain (n + d) a
 delayedI :: (Default a, KnownNat d) => Clock domain gated > Reset domain synchronous > DSignal domain n a > DSignal domain (n + d) a
 feedback :: (DSignal domain n a > (DSignal domain n a, DSignal domain ((n + m) + 1) a)) > DSignal domain n a
 fromSignal :: Signal domain a > DSignal domain 0 a
 toSignal :: DSignal domain delay a > Signal domain a
 dfromList :: NFData a => [a] > DSignal domain 0 a
 dfromList_lazy :: [a] > DSignal domain 0 a
 unsafeFromSignal :: Signal domain a > DSignal domain n a
 antiDelay :: SNat d > DSignal domain (n + d) a > DSignal domain n a
Delayannotated synchronous signals
data DSignal (domain :: Domain) (delay :: Nat) a Source #
A synchronized signal with samples of type a
, synchronized to clock
clk
, that has accumulated delay
amount of samples delay along its path.
Instances
Functor (DSignal domain delay) Source #  
Applicative (DSignal domain delay) Source #  
pure :: a > DSignal domain delay a # (<*>) :: DSignal domain delay (a > b) > DSignal domain delay a > DSignal domain delay b # liftA2 :: (a > b > c) > DSignal domain delay a > DSignal domain delay b > DSignal domain delay c # (*>) :: DSignal domain delay a > DSignal domain delay b > DSignal domain delay b # (<*) :: DSignal domain delay a > DSignal domain delay b > DSignal domain delay a #  
Foldable (DSignal domain delay) Source #  
fold :: Monoid m => DSignal domain delay m > m # foldMap :: Monoid m => (a > m) > DSignal domain delay a > m # foldr :: (a > b > b) > b > DSignal domain delay a > b # foldr' :: (a > b > b) > b > DSignal domain delay a > b # foldl :: (b > a > b) > b > DSignal domain delay a > b # foldl' :: (b > a > b) > b > DSignal domain delay a > b # foldr1 :: (a > a > a) > DSignal domain delay a > a # foldl1 :: (a > a > a) > DSignal domain delay a > a # toList :: DSignal domain delay a > [a] # null :: DSignal domain delay a > Bool # length :: DSignal domain delay a > Int # elem :: Eq a => a > DSignal domain delay a > Bool # maximum :: Ord a => DSignal domain delay a > a # minimum :: Ord a => DSignal domain delay a > a #  
Traversable (DSignal domain delay) Source #  
traverse :: Applicative f => (a > f b) > DSignal domain delay a > f (DSignal domain delay b) # sequenceA :: Applicative f => DSignal domain delay (f a) > f (DSignal domain delay a) # mapM :: Monad m => (a > m b) > DSignal domain delay a > m (DSignal domain delay b) # sequence :: Monad m => DSignal domain delay (m a) > m (DSignal domain delay a) #  
Fractional a => Fractional (DSignal domain delay a) Source #  
Num a => Num (DSignal domain delay a) Source #  
(+) :: DSignal domain delay a > DSignal domain delay a > DSignal domain delay a # () :: DSignal domain delay a > DSignal domain delay a > DSignal domain delay a # (*) :: DSignal domain delay a > DSignal domain delay a > DSignal domain delay a # negate :: DSignal domain delay a > DSignal domain delay a # abs :: DSignal domain delay a > DSignal domain delay a # signum :: DSignal domain delay a > DSignal domain delay a # fromInteger :: Integer > DSignal domain delay a #  
Show a => Show (DSignal domain delay a) Source #  
Lift a => Lift (DSignal domain delay a) Source #  
Arbitrary a => Arbitrary (DSignal domain delay a) Source #  
CoArbitrary a => CoArbitrary (DSignal domain delay a) Source #  
coarbitrary :: DSignal domain delay a > Gen b > Gen b #  
Default a => Default (DSignal domain delay a) Source #  
delayed :: forall domain gated synchronous a n d. KnownNat d => Clock domain gated > Reset domain synchronous > Vec d a > DSignal domain n a > DSignal domain (n + d) a Source #
delayedI :: (Default a, KnownNat d) => Clock domain gated > Reset domain synchronous > DSignal domain n a > DSignal domain (n + d) a Source #
feedback :: (DSignal domain n a > (DSignal domain n a, DSignal domain ((n + m) + 1) a)) > DSignal domain n a Source #
Feed the delayed result of a function back to its input:
mac :: Clock domain gated > Reset domain synchronous >DSignal
domain 0 Int >DSignal
domain 0 Int >DSignal
domain 0 Int mac clk rst x y =feedback
(mac' x y) where mac' ::DSignal
domain 0 Int >DSignal
domain 0 Int >DSignal
domain 0 Int > (DSignal
domain 0 Int,DSignal
domain 1 Int) mac' a b acc = let acc' = a * b + acc in (acc,delay
clk rst (singleton
0) acc')
>>>
sampleN 6 (mac systemClockGen systemResetGen (dfromList [1..]) (dfromList [1..]))
[0,1,5,14,30,55]
Signal <> DSignal conversion
fromSignal :: Signal domain a > DSignal domain 0 a Source #
Signal
s are not delayed
sample s == dsample (fromSignal s)
toSignal :: DSignal domain delay a > Signal domain a Source #
Strip a DSignal
from its delay information.
List <> DSignal conversion (not synthesisable)
dfromList :: NFData a => [a] > DSignal domain 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
lazy versions
dfromList_lazy :: [a] > DSignal domain 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 domain a > DSignal domain n a Source #