forsyde-shallow-3.4.0.0: ForSyDe's Haskell-embedded Domain Specific Language.

Copyright(c) Ingo Sander KTH/ICT/ES ForSyDe-Group
LicenseBSD-style (see the file LICENSE)
Maintainerforsyde-dev@ict.kth.se
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

ForSyDe.Shallow.MoC.SDF

Contents

Description

SDFLib.hs, yet to be completed.

Synopsis

Sequential Process Constructors

Sequential process constructors are used for processes that have a state. One of the input parameters is the initial state.

delaySDF :: [a] -> Signal a -> Signal a Source #

The process constructor delaySDF delays the signal one event cycle by introducing a set of initial values at the beginning of the output signal. Note, that this implies that there is a prefix at the output signal (the first n events) that has no corresponding event at the input signal. This is necessary to initialize feedback loops.

>>> delaySDF [0,0,0] $ signal [1,2,3,4]
{0,0,0,1,2,3,4}

Actors

Based on the process constructors in the SDF-MoC, the SDF-library provides SDF-actors with single or multiple inputs

actor11SDF :: Int -> Int -> ([a] -> [b]) -> Signal a -> Signal b Source #

The process constructor actor11SDF constructs an SDF actor with one input and one output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

>>> let f [a,b] = [a+b,a-b,a*b]
>>> actor11SDF 2 3 f $ signal [1,2,3,4,5]
{3,-1,2,7,-1,12}

actor12SDF :: Int -> (Int, Int) -> ([a] -> ([b], [c])) -> Signal a -> (Signal b, Signal c) Source #

The process constructor actor12SDF constructs an SDF actor with one input and two output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor13SDF :: Int -> (Int, Int, Int) -> ([a] -> ([b], [c], [d])) -> Signal a -> (Signal b, Signal c, Signal d) Source #

The process constructor actor13SDF constructs an SDF actor with one input and three output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor14SDF :: Int -> (Int, Int, Int, Int) -> ([a] -> ([b], [c], [d], [e])) -> Signal a -> (Signal b, Signal c, Signal d, Signal e) Source #

The process constructor actor14SDF constructs an SDF actor with one input and four output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor21SDF :: (Int, Int) -> Int -> ([a] -> [b] -> [c]) -> Signal a -> Signal b -> Signal c Source #

The process constructor actor21SDF constructs an SDF actor with two input and one output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

>>> let f [a,b] [c] = [a+b+c,b-c]
>>> let s1 = signal [1..6]
>>> let s2 = signal [1..]
>>> actor21SDF (2,1) 2 f s1 s2
{4,1,9,2,14,3}

actor22SDF :: (Int, Int) -> (Int, Int) -> ([a] -> [b] -> ([c], [d])) -> Signal a -> Signal b -> (Signal c, Signal d) Source #

The process constructor actor22SDF constructs an SDF actor with two input and two output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor23SDF :: (Int, Int) -> (Int, Int, Int) -> ([a] -> [b] -> ([c], [d], [e])) -> Signal a -> Signal b -> (Signal c, Signal d, Signal e) Source #

The process constructor actor23SDF constructs an SDF actor with two input and three output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor24SDF :: (Int, Int) -> (Int, Int, Int, Int) -> ([a] -> [b] -> ([c], [d], [e], [f])) -> Signal a -> Signal b -> (Signal c, Signal d, Signal e, Signal f) Source #

The process constructor actor24SDF constructs an SDF actor with two input and four output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor31SDF :: (Int, Int, Int) -> Int -> ([a] -> [b] -> [c] -> [d]) -> Signal a -> Signal b -> Signal c -> Signal d Source #

The process constructor actor31SDF constructs an SDF actor with three input and one output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor32SDF :: (Int, Int, Int) -> (Int, Int) -> ([a] -> [b] -> [c] -> ([d], [e])) -> Signal a -> Signal b -> Signal c -> (Signal d, Signal e) Source #

The process constructor actor32SDF constructs an SDF actor with three input and two output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor33SDF :: (Int, Int, Int) -> (Int, Int, Int) -> ([a] -> [b] -> [c] -> ([d], [e], [f])) -> Signal a -> Signal b -> Signal c -> (Signal d, Signal e, Signal f) Source #

The process constructor actor33SDF constructs an SDF actor with three input and three output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor34SDF :: (Int, Int, Int) -> (Int, Int, Int, Int) -> ([a] -> [b] -> [c] -> ([d], [e], [f], [g])) -> Signal a -> Signal b -> Signal c -> (Signal d, Signal e, Signal f, Signal g) Source #

The process constructor actor34SDF constructs an SDF actor with three input and four output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor41SDF :: (Int, Int, Int, Int) -> Int -> ([a] -> [b] -> [c] -> [d] -> [e]) -> Signal a -> Signal b -> Signal c -> Signal d -> Signal e Source #

The process constructor actor41SDF constructs an SDF actor with four input and one output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor42SDF :: (Int, Int, Int, Int) -> (Int, Int) -> ([a] -> [b] -> [c] -> [d] -> ([e], [f])) -> Signal a -> Signal b -> Signal c -> Signal d -> (Signal e, Signal f) Source #

The process constructor actor42SDF constructs an SDF actor with four input and two output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor43SDF :: (Int, Int, Int, Int) -> (Int, Int, Int) -> ([a] -> [b] -> [c] -> [d] -> ([e], [f], [g])) -> Signal a -> Signal b -> Signal c -> Signal d -> (Signal e, Signal f, Signal g) Source #

The process constructor actor43SDF constructs an SDF actor with four input and three output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.

actor44SDF :: (Int, Int, Int, Int) -> (Int, Int, Int, Int) -> ([a] -> [b] -> [c] -> [d] -> ([e], [f], [g], [h])) -> Signal a -> Signal b -> Signal c -> Signal d -> (Signal e, Signal f, Signal g, Signal h) Source #

The process constructor actor14SDF constructs an SDF actor with four input and four output signals. For each input or output signal, the process constructor takes the number of consumed and produced tokens and the function of the actor as arguments.