forsyde-atom-0.3.0.0: Shallow-embedded DSL for modeling cyber-physical systems
Copyright(c) George Ungureanu KTH/EECS/ESY 2018-2020
LicenseBSD-style (see the file LICENSE)
Maintainerugeorge@kth.se
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

ForSyDe.Atom.MoC.SDF.CSDF

Description

The CSDF library implements a DSL of atoms operating according to the cyclo-static dataflow model of computation, in terms of the atoms of ForSyDe.Atom.MoC.SDF. As such SADF patterns are operating on SDF signals, i.e. they have the exact same time semantics, hence there is no need for MoC interfaces between these two MoCs.

CSDF is another attempt to increase SDF's expresivity in a controlled manner by allowing dynamic firing rates in a static sequence which repeat cyclically. To implement this library we reused everything: the CSDF actors are implemented as specific ForSyDe.Atom.MoC.SDF.SADF patterns, and everything else is re-exported from ForSyDe.Atom.MoC.SDF.

Useful pointers:

Synopsis

Re-Exported from SDF

These constructors and utilities are re-exported from ForSyDe.Atom.MoC.SDF for convenience.

type Signal a = Stream (SDF a) Source #

Type synonym for a SY signal, i.e. "a signal of SY events"

type Prod = Int Source #

Type synonym for consumption rate

type Cons = Int Source #

Type synonym for production rate

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

Transforms a list of values into a SDF signal with only one partition, i.e. all events share the same (initial) tag.

delay Source #

Arguments

:: [a]

list of initial values

-> Signal a

input signal

-> Signal a

output signal

The delay process "delays" a signal with initial events built from a list. It is an instantiation of the delay constructor.

>>> let s = signal [1,2,3,4,5]
>>> delay [0,0,0] s
{0,0,0,1,2,3,4,5}

CSDF actors

actor22 Source #

Arguments

:: [((Cons, Cons), (Prod, Prod), [a1] -> [a2] -> ([b1], [b2]))]

control signal

-> Signal a1

data signal

-> Signal a2

data signal

-> (Signal b1, Signal b2)

output data signals

A CSDF actor is very similar to a SDF actor, but instead of only one set of execution parameter (production rate, consumption rate, function), it takes a finite list of such parameters, and cycles through them with each firing.

Constructors: actor[1-4][1-4].

>>> let s1 = signal [1..10]
>>> let f a = [sum a]
>>> actor11 [(3,1,f),(2,1,f)] s1
{6,9,21,19}