• No results found

Multi-rate equivalents of cyclo-static synchronous dataflow graphs

N/A
N/A
Protected

Academic year: 2021

Share "Multi-rate equivalents of cyclo-static synchronous dataflow graphs"

Copied!
10
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Multi-Rate Equivalents of Cyclo-Static Synchronous Dataflow Graphs

Robert de Groote, Philip K.F. H¨olzenspies, Jan Kuper, Gerard J.M. Smit Department of Electrical Engineering, Mathematics and Computer Science

University of Twente, P.O. Box 217, 7500 AE Enschede, The Netherlands {e.degroote, p.k.f.holzenspies, j.kuper, g.j.m.smit}@utwente.nl

Abstract—In this paper, we present a transformation that takes a cyclo-static dataflow (CSDF) graph and produces an equivalent multi-rate synchronous dataflow (MRSDF) graph. This fills a gap in existing analysis techniques for synchronous dataflow graphs; transformations into equivalent homogeneous synchronous dataflow (HSDF) graphs exist, but these suffer from an exponential increase in the graph’s size. The pre-sented transformation allows the rich set of existing analysis techniques forMRSDFgraphs to be applied toCSDFgraphs. We show the applicability of this transformation by demonstrating its effectiveness on the problem of optimising buffer sizes under a throughput constraint.

I. INTRODUCTION

Synchronous dataflow (SDF) [1] is a popular model of computation, used to conservatively model stream-processing applications. The model is attractive, because it allows for analysis of the modelled application’s tim-ing behaviour. Such analyses allow for the derivation of static schedules, computation of throughput, verification of latency constraints, and optimisation of buffer sizes under a throughput constraint. Because worst-case execution times are assumed, analyses provide guarantees with respect to performance. This makes these models particularly suitable in the domain of real-time embedded systems.

There exist many varieties of SDF such as homogeneous

SDF (HSDF) [1], multi-rateSDF(MRSDF, or simplySDF) [1]

and cyclo-staticSDF(CSDF) [2]. These models differ in their expressiveness, where (of these three) HSDF is the least, andCSDF the most expressive. In an HSDFgraph, all tasks are modelled to produce data at the same rate, whereas in MRSDF these rates may vary per task and per channel. The CSDF model is a generalisation of MRSDF, and allows for actors with periodically varying behaviour. As a result,

CSDFmodels can capture streaming applications with greater accuracy thanMRSDFgraphs can, which leads to a reduction of the resource usage of implementations following this model [3].

Efficient analysis techniques for HSDF graphs exist; a graph’s throughput and the associated static schedule may be computed in polynomial time [4]. These techniques can not be applied directly toMRSDFandCSDFgraphs, however; for these graphs, a transformation into an equivalentHSDFgraph is required. This equivalentHSDFgraph has a size that may,

in the worst case, be exponential in the size of the original graph, which makes analyses that involve the construction of these equivalentHSDFgraphs very expensive in terms of computation time and memory.

To cope with this, a rich variety of methods has been developed. For example, a common approach to throughput analysis of MRSDF graphs is to explore the state-space of a self-timed execution for its periodic regime [5], [6], or to derive compact descriptions of MRSDF graphs [7]. Furthermore, techniques that transform anMRSDFgraph into single-rate approximations exist, and these may be used to derive bounds on the performance of the MRSDF graph, in polynomial time [8].

Similar state-space exploration techniques for CSDF do exist, but these suffer from computational complexity that is increased over those for MRSDFgraphs [9]. Approximate analyses aimed at CSDF graphs suffer from decreased ac-curacy with respect to MRSDF graphs [10]. To simplify the analysis ofCSDFgraphs, a number of tools transform aCSDF

graph into a so-called lumped MRSDFgraph, to simplify the analysis at the expense of a loss in accuracy [11]–[13].

In this paper, we demonstrate how a CSDF graph may be transformed into an equivalent MRSDF graph: analysis

results such as static schedules and achievable throughput, collected for theMRSDFgraph, can consistently and trivially be translated to theCSDFgraph. Such a transformation does, to our knowledge, currently not exist, and makes existing tools and techniques for the analysis of MRSDF graphs applicable to CSDF graphs.

Because the CSDF model is more expressive than the

MRSDF model, the equivalent MRSDF graph is larger than theCSDF graph, but much smaller than an equivalentHSDF

graph: eachCSDF actor is unfolded a number of times (at most) equal to its number of phases, which is typically small. The equivalent MRSDF graph typically has a larger density than theCSDFgraph: eachCSDFchannel is transformed into a set ofMRSDF channels; the size of this set is equal to the product of the lengths of the production and consumption rate vectors associated with the channel. The details of the transformation are described in Sections IV and V.

A very useful property of the presented transformation is that the number of initial tokens on a CSDF channel may be left variable and will result in multiple MRSDF channels with initial tokens expressed symbolically in that variable.

(2)

We illustrate the usefulness of this property in approximating the buffer sizes required to attain a minimum throughput in Section VI.

II. RELATEDWORK

Literature on synchronous dataflow can be categorised into exact and approximate methods. Exact analysis of (MRSDF and) CSDF graphs exploit the fact that the (self-timed) schedule of a consistent SDF graph, after an initial transient phase, follows a repetitive pattern, which is com-posed of several so-called iterations [14]. Such an iteration may be explicitly represented by transforming the CSDF

graph into an equivalent HSDF graph, which has a single actor for each individual firing in the iteration [15]. For these

HSDFgraphs, efficient analysis techniques are available [4], [16]. However, as the length of a single iteration, in the worst case, grows exponentially in the size of the CSDF graph, approaches that rely on the construction of an equivalent

HSDF graph are often considered too costly for practical use [5], [9].

As an efficient alternative, approaches that explore the state-space of a self-timed execution for its periodic regime have become the common approach to analysingSDFgraphs. Although in the worst case, these approaches suffer from the same problem that prohibits methods based on equivalent

HSDFgraphs, experiments suggest that they run much faster, primarily because they avoid the costly MRSDF-to-HSDF

transformation [5], [9].

Rather than performing an exact analysis, an approximate model of the SDF graph may be constructed and analysed with much less effort [8], [17]. Such an approximate model gives a conservative estimation of the graph’s performance; the actual performance is never worse than the performance computed from the model. This perfectly suits the typical aim of dataflow analysis, which is to give guarantees on the properties of a real-time system. However, the error made by such an approximation may be considerable, and lead to a costly overdimensioning of the system at hand. Methods to estimate this error are only known forMRSDF, but not for

CSDF[8]. The transformation presented in this paper allows

MRSDF analysis techniques that compute both a lower and upper bound on performance, to be applied toCSDFgraphs. In [18], minimum buffer sizes for a CSDF graph, such that a minimum throughput is attained, are approximated by explicitly taking into account the different phases of an actor. This improves the accuracy of the derived buffer capacities over less detailed analyses such as [10]. The approach outlined in [18] involves capturing the schedules of actors and phases of actors into a so-called min-max linear program, which may be solved in polynomial time. Our approach may be regarded as a decomposition of their method into an exact and an approximate step: constructing the equivalentMRSDF graph is an exact step that represents each phase of an actor individually. This exact step may then

be followed by a second step, using known, approximate

MRSDFanalysis techniques, applied to the equivalentMRSDF

graph.

A straightforward transformation of aCSDFgraph into an

MRSDFgraph is described in [11], [12] and [13]. This trans-formation, however, is an approximation; it does not give an equivalent MRSDF graph. The transformation involves replacing each phase vector by the sum of its elements. The resulting MRSDF graph is referred to as a “lumped”

MRSDFrepresentation. The properties of the lumpedMRSDF

representation with respect to the originalCSDFgraph is not discussed in detail in [11] or [12], other than that it may introduce deadlock in theMRSDF graph.

A transformation of a CSDF graph into an equivalent

MRSDF graph, as presented in this paper, does, to the best of our knowledge, not exist. As we demonstrate in Section VI, it provides a bridge between the exact and approximate methods mentioned above: by performing an exact transformation into anMRSDF graph, the accuracy of the analysis is improved over when it is applied directly onto theCSDF graph.

III. CYCLO-STATICDATAFLOWGRAPHS

A cyclo-static dataflow (CSDF) graph is a directed graph, where the vertices are called actors and the edges are called channels. Actors model tasks, channels model data dependencies between tasks. Actors may fire, which models the execution of the task represented by that actor. Execution of a task requires data to be available on incoming channels, and produces data on outgoing channels. This data is mod-elled by tokens. In a synchronous dataflow graph, the number of tokens produced onto and consumed from channels is specified by rates.

In aCSDFgraph, actors have cyclically varying behaviour: each actor cycles through a fixed number of phases. The number of tokens produced onto or consumed from a channel, as well as the execution time of the actor, depends on the current phase of the actor. We use the term period to refer to the number of phases of an actor, and denote the period of actor v by ϕv. The phase of the actor can

be derived from the actor’s firing index in a straightforward way: the behaviour of the actor during its kth firing is given by its (k mod1ϕv)th phase1.

Each actor v has an associated execution time vector, which we denote by Tv = [t1, . . . , tϕv] ∈ N

ϕv. At the

start of an execution, an actor consumes data from its incoming channels. The completion of the kth execution

occurs tk mod1ϕv time units after the execution started,

and involves the production of tokens onto its outgoing channels. For the sake of brevity, we write τv(k) to denote

the execution time of the kth firing of actor v.

1We write k mod

1n as a shorthand notation for (k − 1) mod n + 1, with the mod operator defined conventionally as: a mod b = a − ba

(3)

Each channel vw has an initial, integer number of tokens, denoted δvw. Furthermore, with each channel vw, two

vec-tors are associated. These vecvec-tors are the channel’s produc-tion rate vector, denoted Pvw+ = [p

+

1, . . . , p+ϕv] ∈ N

ϕv, and

consumption rate vector, denoted Pvw− = [p−1, . . . , p−ϕw] ∈ Nϕw. The kth firing of actor v produces p+

k mod1ϕv tokens

onto the channel, whereas the kthfiring of actor w consumes

p−k mod

1ϕw tokens from the channel. We shall write ρ

+ vw(k)

and ρ−vw(k) as respective shorthand notations for p+k mod1ϕv and p−k mod

1ϕw. If the number of tokens on each of an actor’s

incoming channels is at least the channel’s consumption rate, the actor may start an execution and is said to be enabled.

We often need to refer to the total number of tokens pro-duced or consumed by an actor in one period. We therefore denote the number of tokens produced onto channel vw in one period of v by PΣ+

vw =

Pϕv

i=1ρ +

vw(i), and the number

of tokens consumed, in one period of w, from channel vw as PΣ− vw = Pϕw i=1ρ − vw(i).

A. Phases and Auto-concurrency

The original semantics of CSDF, as presented in [2], implicitly assume that each actor has a self-loop, i.e., a channel with rates set to one, and a single initial token. Such a self-loop prevents the actor to start multiple, concurrent, executions. This so-called auto-concurrency is commonly available toMRSDFandHSDFactors. The motivation for re-stricting auto-concurrency inCSDFis that successive phases of an actor should not overlap, as phases imply the presence of internal state, which, in dataflow semantics, gives a sequential execution. Assuming implicit self-loops for every actor (including those with a single “phase”) in the graph, however, unnecessarily limits the expressiveness of CSDF

graphs. We therefore relax the original CSDFrestriction, by assuming an implicit self-loop only for those actors that have more than one phase, as has been suggested by other authors [10], [11].

B. Periodicity and Throughput

The firing times of actors in a consistent CSDF graph follow a repetitive pattern [2]. The transformation that we present in this paper does not require the CSDF graph to be consistent; consistency is however a requirement when transforming a CSDFgraph into an HSDFgraph.

For a consistent CSDF graph, the repetitive pattern con-sists of multiple iterations [14]. A consistent graph has a finite throughput, which is the average number of iterations completed per time unit. When transforming a CSDF or

MRSDF graph into an equivalent HSDF graph, each actor is represented as many times as it fires in a single such iteration.

C. Multi-Rate and Homogeneous SDF

An MRSDF graph is a special case of a CSDF graph (under the assumption from III-A), where the dimensionality

of all (execution time and rate) vectors is one, such that they may be replaced by scalars. Because, for MRSDF

graphs, execution times, production and consumption rates are independent of actor firing indices, we simply omit the argument to the functions ρ+, ρ− and τ. Finally, a homogeneous SDF (HSDF) graph is again a special case of an MRSDF graph, and has ρ−= ρ+= 1, for all channels.

IV. DATAFLOW ANDDISCRETEEVENTSYSTEMS

A CSDF graph is an example of a discrete event sys-tem [19]. In such a system, the firing times of actors are interdependent; an actor can not start a firing before the actors it depends on have fired (at least) a given number of times. In synchronous dataflow, these dependencies are given by the graph’s channels, and the details of a dependency between two actors can be determined from the annotations (rates and tokens) on the channel that connects the two actors.

These dependencies may be elegantly described by a set of recurrent equations. If we write tv(k) to denote

the completion time of the kth firing of actor v, then the

earliest time at which this firing may occur depends on the completion time of connected upstream actors, in the following way:

tw(k) ≥ max

vw {tv(k − γ(k))} + τw(k). (1)

That is, w starts its kth firing as soon as each predecessor

v has completed (k − γ(k)) firings. Actor w needs an additional τw(k) time units to complete this execution. Note

that we take the maximum over all incoming channels of w in the graph, and omit the quantification of vw in the equation, for convenience. Furthermore, in performance analysis it is commonly assumed that an actor fires as soon as it can. This is called a self-timed execution. A self-timed execution is obtained by replacing the inequality sign in (1) by an equals sign. Throughout the remainder of the paper, we assume a self-timed execution.

Equation (1) is commonly named a dater equation [16], as it defines the times at which actors fire. Function γ(k) is called the shift function [19]. If γ(k) is constant, then (1) is a so-called shift-invariant system. For shift-invariant discrete event systems, many analysis techniques are available [4], [16].

Circular dependencies in (1) limit the rate at which an actor may complete firings. Discrete event systems have a throughput (or the inverse, cycle time) that gives the maximum (average) rate at which actors can fire. For a shift-invariant system, this rate can be computed from the maximum cycle ratio[16], [20].

For dataflow systems, the shift function that is associated with a channel vw captures the fact that a certain, minimal number of tokens must have been produced by a producing actor, before the consuming actor can start its next execution.

(4)

We therefore rewrite (1) into the following, slighly more convenient form:

tw(k) = max

vw {tv(πvw(k))} + τw(k), (2)

where πvw(k) is the predecessor function, which gives the

number of firings predecessor v must have completed, such that enough tokens are available to let actor w start its kth firing. Note that π

vw must be non-decreasing to obey

the semantics of a dataflow graph: dataflow channels repre-sent unbounded FIFO buffers, and to guarantee functional correctness, tokens may not “overtake” each other [21]. The predecessor function must thus be such that the order in which tokens are consumed does not violate the order in which tokens are produced. In terms of actor firing times, this means that an actor may not finish a firing before all firings that have started earlier, have finished. This is stated formally by the following principle of temporal monotonicity: tv  max i ai  = max i tv(ai). (3)

Note that (3) holds for CSDF actors, under the assumption (see Section III-A) that whenever an actor has more than one phase, it has an implicit self-loop. As we shall see in Section V, this principle is necessary for the transformation from CSDFinto MRSDF.

Consider the following function ∆vw, which gives the

number of tokens on a channel vw, as a function of the number of firings of the actors connected by that channel:

∆vw(i, j) = δvw+ i X l=1 ρ+vw(l) − j X l=1 ρ−vw(l). (4)

The general form of the predecessor function associated with a channel in a homogeneous, multi-rate or cyclo-static dataflow graph, may be expressed in terms of (4), in the following way:

πvw(k) = min {m|∆vw(m, k) ≥ 0} , (5)

which says that the minimal number of firings of actor v that must precede the kth firing of actor w is such that a minimum, non-negative number of tokens is available on channel vw.

An alternative formulation that is semantically equivalent is:

πvw(k) = max {m|∆vw(m, k) < 0} + 1, (6)

which says that the required number of firings of actor v is the first firing after its latest firing that does not enable the kth firing of actor w.

The graph of a (periodic) predecessor function of a synchronous dataflow channel is periodic and follows a staircase-like pattern. Figure 1 gives an example of the predecessor function for different kinds of dataflow chan-nels. From this figure it can be observed that CSDF graphs

a b 1 (a) HSDFchannel ab c 2 d 2 3 (b)MRSDFchannel cd e f h3, 0, 1i 1 h2, 1i (c) CSDFchannel ef 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 0 k πab(k) (d) 8 “periods” of channel ab 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 9 10 11 0 k πcd(k)

(e) 2 periods ofMRSDFchannel cd

1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 0 k πef(k) (f) 1 period ofCSDFchannel ef

Figure 1. Three kinds of dataflow channels, and the graphs of their predecessor functions.

can express more irregularity. Thus, a CSDF graph is more expressive than anMRSDFgraph; in general, the predecessor function associated with aCSDFchannel can not be captured exactly by a single MRSDF channel (see Figure 2 for an exception). However, as we demonstrate in the following section, any CSDF channel may be represented by a set of MRSDF channels, which collectively give an equivalent predecessor function.

The graph of the predecessor function is strongly related to an equivalent HSDF graph, in which every actor is represented as many times as it fires in a single iteration of

(5)

u h2, 3i d 3 v (a)CSDFchannel

u 5 2d 6 v

(b) EquivalentMRSDFchannel

Figure 2. ACSDFchannel that can be represented exactly by a single

MRSDFchannel.

the graph [14]. In an equivalentHSDFgraph, several periods of each channel’s predecessor function are represented by

HSDF channels connecting the domain and codomain of the predecessor function [8]. Figure 3 gives an illustrative example of this relationship.

V. TRANSFORMINGCSDFINTOMRSDF The approach that we take to transforming CSDF into

MRSDF is similar to the transformation from MRSDF into

HSDF, where several firings of an MRSDF actor are each represented by a single HSDF actor, as is outlined in [8]. The difference is that when transforming a CSDF graph, each CSDF actor is represented, in the equivalent MRSDF

graph, by as many MRSDF actors as it has phases. The annotations of the equivalent MRSDF graph’s channels are obtained by rewriting theCSDFpredecessor function in such a way, that we may substitute the CSDF dater equations, expressed in terms of the more general predecessor function, into a set of dater equations that are expressed in terms of a simpler,MRSDF-specific predecessor function. This set of dater equations collectively implements the dater equation of the CSDFchannel.

A. CSDF and MRSDF Predecessor Functions

In this section, we derive specialised predecessor func-tion formulafunc-tions for MRSDF and CSDF, from the general functions given by (2) and (6).

InCSDF, the number of tokens produced in a single period of actor v onto channel vw is constant, as is the number of tokens consumed by w in one period of w. This allows us to rewrite (4) into:

∆vw(i, j) = ∆vw(i mod ϕv, j mod ϕw)

+  i ϕv  PvwΣ++  j ϕw  PvwΣ−,

and the predecessor function (6) for a CSDF channel may subsequently be rewritten as:

πvw(k) = 1+ max  m  m ϕv  PvwΣ++ ∆vw(m mod ϕv, k) < 0  = max i<ϕv max  m  m ϕv  PvwΣ++ ∆vw(i, k) < 0  + 1. (7)

Similarly, we derive a (simpler) specialised formulation of (4) forMRSDF: ∆vw(i, j) = δvw+ iρ+vw+ jρ−vw. (8) u h2, 0i d h2, 1i v (a)CSDFchannel 1 2 3 4 −3 −2 −1 0 1 2 3 4 5 k πuv(k) d = 4 d = 1

(b) One period of the channel’s predecessor func-tion u1 u2 u3 u4 u5 u6 v1 v2 v3 v4

(c) EquivalentHSDFgraph for d = 1

u1 u2 u3 u4 u5 u6 v1 v2 v3 v4

(d) EquivalentHSDFgraph for d = 4

Figure 3. An example CSDFchannel, a graphical representation of its predecessor function, and equivalentHSDFgraph representations.

(6)

The MRSDF predecessor function has been formulated, by several authors, in terms of the ceiling function, dxe. We obtain such a formulation by combining (2) and (8) using the following equality for the ceiling function over fractions:

ln m m = min  k km ≥ n  . (9)

The predecessor function of anMRSDFchannel may then be written in the following way:

πvw(k) =  kρ− vw− δvw ρ+vw  , (10)

whereas for a predecessor function of a CSDF channel, this is not generally possible. This gives a characterisation of the differences between CSDF and MRSDF in terms of their predecessor functions. The following section discusses the translation of a system of CSDF predecessor functions, formulated in terms of (7), into a system of MRSDF func-tions. Besides the ceiling function, the translation uses the following relation for the floor function, bxc:

jn m k = max  k km ≤ n  , (11)

and the following relation to interchange the floor and ceiling function, where n, m ∈ Z and m is positive [22]:

jn m k = n − m + 1 m  = n + 1 m  − 1. (12) B. A Change of Variables

When transforming CSDF into MRSDF, each individual phase of an CSDF actor is represented by a single MRSDF

actor. Actors in the dataflow graph correspond to variables in the associated dater equations; transforming CSDF into

MRSDF thus involves rewriting dater equation (2): tw(k) = max

vw {tv(πvw(k))} + τw(k),

where v and w correspond to CSDFactors, into: twj(k) = max

viwj

tvi πviwj(k) + τw(j), (13)

where variables vi and wj correspond to the MRSDF actors

that respectively represent the ith and jth phases of CSDF

actors v and w.

The relationship between CSDF andMRSDF variables, v and vj, is captured by the following dater expression (note

that the clumsy subtraction of 1 is necessary to give tvj(1) =

tv(j)):

tvj(k) = tv(j + (k − 1)ϕv) , 1 ≤ j ≤ ϕv. (14)

To obtain a transformation from CSDF into MRSDF, the

CSDF variables (i.e., one variable per actor) now need to be replaced by MRSDF ones.

We rewrite (7) into a set ofMRSDF predecessor functions in two steps. First, we rewrite (7) into an expression that

involves the ceiling function, using (11) and (12). Substitut-ing m by m0ϕv+ i, with m0 = j m ϕv k and i = m mod ϕv, gives: πvw(k) = max i<ϕv  max  m0 m0PvwΣ++ ∆vw(i, k) < 0  ϕv+ i  +1 (11) = max i<ϕv  −1 − ∆vw(i, k) PvwΣ+  ϕv+ i + 1  = max 1≤i≤ϕv  −1 − ∆vw(i − 1, k) PvwΣ+  ϕv+ i  (12) = max 1≤i≤ϕv  −∆vw(i − 1, k) PvwΣ+  − 1  ϕv+ i  .

Temporal monotonicity (3) now allows us to write the

CSDF dater equation, where the max-expression is pushed out of the predecessor function, in the following way: tw(k) − τw(k) = max vw tv  max 1≤i≤ϕv  −∆vw(i − 1, k) PvwΣ+  − 1  ϕv+ i  (3) = max vw 1≤i≤ϕmaxv tv  −∆vw(i − 1, k) PvwΣ+  − 1  ϕv+ i  .

We may now, using (14), substitute the variable that represents (producing) CSDF actor v by a set of variables vi, with 1 ≤ i ≤ ϕv: tw(k) = max viw tvi  −∆vw(i − 1, k) PvwΣ+  + τw(k).

Finally, we substitute (MRSDF) variables wj for the

con-suming actor, w, obtaining a set of ϕvϕw dater equations:

twj(k) − τw(j) = max viwj tvi  −∆vw(i − 1, j + (k − 1)ϕw) PvwΣ+  = max viwj tvi & kPΣ− vw − ∆vw(i − 1, j) + PvwΣ−  PvwΣ+ '! .

This dater equation relates the completion times of the jth phase of actor w to those of individual phases of upstream actors. It is equivalent to the dater equation associated with an MRSDF channel that has a production rate of PΣ+

vw , a

consumption rate of PΣ−

vw and ∆vw(i − 1, j) + PvwΣ− initial

tokens. TheMRSDF channel viwj connects the two MRSDF

actors that respectively represent phase i of CSDF actor v, and phase j ofCSDF actor w.

AnyCSDF graph may thus be transformed into a (larger)

MRSDF graph, where each CSDF actor v is represented by ϕv MRSDF actors. The density of the resulting graph is

typically higher than the density of the CSDF graph, as a singleCSDFchannel vw is transformed into ϕvϕwchannels.

(7)

a b h2, 0i d h2, 1i h0, 3i h1, 1i (a) CSDFgraph a1 a2 b1 b2 a1 a2 2 d + 1 3 2 d 3 2 d + 3 3 2 d + 2 3 3 1 2 3 2 3 1 2 3 2 (b) EquivalentMRSDFgraph

Figure 4. ACSDFgraph and its equivalentMRSDFgraph. The equivalent

MRSDFgraph has been unrolled such that all channels point from left to right, and implicit self-loops have been omitted for the sake of clarity.

the number of channels in the equivalentMRSDFgraph may be reduced.

As an example, Figure 4 depicts a CSDF graph and its equivalentMRSDFgraph, obtained by applying the transfor-mation outlined in this section.

C. Channel Pruning

Transforming aCSDFchannel into a multi-rate equivalent results in a bipartiteMRSDFgraph. The number of channels in thisMRSDFgraph is equal to the product of the periods of the actors connected by the CSDF channel. These channels impose constraints on the firing times of theMRSDF actors. In some cases, certain constraints may be identified as non-binding. This may occur when the sums of production and consumption rates are not relatively prime, i.e., when their greatest common divisor is greater than one.

Because for positive n, with n, m ∈ Z, the following holds [22]:  m − x n  = m − bxc n  , (15)

we may write (10) as:

πvw(k) =     kρ−vw− j δvw gcd(ρ+vw,ρ−vw) k ρ+vw     . (16)

Let wj be an actor in the equivalentMRSDF graph. This

actor represents phase j of actor w in the original CSDF

graph. The firing times of actor wjdepend on several phases

of another actor, v. If the (MRSDF) channels that represent these dependencies have the same number of initial tokens, then the dependency with the later phase is always binding, as by (3), the later phase does not finish before the earlier phase does; the other dependency may thus be pruned. An example of such a situation is given in Figure 5.

u h1, 2, 3i v 2 4 (a)CSDFchannel u1 u2 u3 v1 6 2 4 6 3 4 6 5 4 (b) EquivalentMRSDFgraph u1 u2 u3 v1 3 1 2 3 1 2 3 2 2 (c) Normalised u1 u2 u3 v1 3 1 2 3 2 2 (d) Pruned

Figure 5. In some cases, channels in (parts of) the equivalent MRSDF

graph may be pruned because they can be identified as non-binding.

MP3 SRC DAC 1152 h48, 9 ∗ 48i h48, 9 ∗ 48i d1 1152 h45, 9 ∗ 44i 1 1 d2 h45, 9 ∗ 44i 1 1 1

Figure 6. A Cyclo-Static dataflow graph model of an MP3 playback application. The capacities of the buffers between the tasks are captured by (integer) variables d1 and d2.

VI. CASESTUDY

In this section, we take a simple CSDF model and trans-form it into an equivalentMRSDFgraph, after which we can apply analysis techniques designed for MRSDF graphs. We compare the results obtained from this equivalent MRSDF

graph with analysis results computed directly for the CSDF

graph using a CSDF-specific algorithm. The analysis we perform is the determination of sufficient buffer sizes in order to reach a given minimum throughput.

We use a model of an MP3 playback application, which has been used as a case study in several other studies [10], [23]. The application consists of three tasks, each of which is modelled by a single CSDF actor: the MP3 decoder (modelled by the actor labelled MP3) processes a 48 kHz variable bitrate MP3 file, and the sample rate converter (modelled by actor SRC) converts this to a 44.1 kHz stream to match the frequency of the digital-to-analog-converter, which is modelled by the actor labelled DAC. Communi-cation channels between the tasks are FIFO buffers with a finite capacity, whereas channels in a synchronous dataflow graph have unbounded capacity. A common trick to model a buffer’s capacity is to add a reversed channel to the graph, with a number of initial tokens equal to the buffer’s capacity. To leave these buffer capacities unspecified, the number of tokens on these reversed channels are captured by variables. The model is depicted in Figure 6.

(8)

The worst-case execution time of the ten different phases of the sample rate converter task are (in order): 136577, 133824, 133760, 133750, 133748, 133863, 133844, 133955, 133882, and 133862 clock cycles. The MP3 decoder task has a worst-case execution of 1603621 clock cycles, and the digital-to-analog-converter samples its input every 5000 clock cycles. The latter gives a minimal required throughput; in order not to stall the digital-to-analog-converter, data should arrive in time.

The throughput of the graph is dependent on the capcity of the two buffers between the three tasks, i.e., the variables d1 and d2. If we approximate these buffer sizes required

to reach the required throughput, using the techniques from [10], we find that d1 must be at least 1536 and d2

must be at least 90. Note that this algorithm is applied at the CSDF graph, and does not require a transformation of the graph into an equivalent MRSDF graph.

Transforming the CSDF graph into an equivalent MRSDF

graph “unfolds” the sample-rate converter into ten actors, each representing one of the ten phases of the CSDF actor. Because the other two actors in theCSDFgraph are basically

MRSDF actors, they do not need to be unfolded. The equiva-lentMRSDFgraph is not easily represented in a compact way. We have therefore unfolded the cycles of the graph, such that all channels point from left to right. Furthermore, we omitted the self-loops and the production and consumption rates of the MP3 actor (which are 1152) and the DAC actor (which produces and consumes data with a rate of one). The resulting MRSDF graph is depicted in Figure 7.

If we analyse the equivalent MRSDF graph, using the techniques described in [8], for the minimum buffer sizes (i.e., d1 and d2), the results are the following: For the size

of the buffer between the MP3 decoder and the sample rate converter, we find d1= 1440. This is an improvement over

the buffer size found by the CSDF-specific algorithm by 6.7%. For the size of the buffer between the sample rate converter and the digital-to-audio converter we find d2= 73,

which is an improvement of 18.9%.

If we transform theCSDFgraph into its “lumped”MRSDF

representation, by aggregating the 10 phases of actor SRC

into a single phase, we obtain values for d1 and d2 that

are significantly higher: we find that d1 = 2112 and d2 =

710 are sufficient buffer sizes. These values are respectively 46.7% and 873% higher than the values found from the equivalent MRSDF graph.

VII. CONCLUSIONS ANDFUTUREWORK

In this paper, we have presented a method to transform a Cyclo-Static Dataflow graph into an equivalent Multi-Rate Dataflow graph. This transformation fills a gap in the dataflow literature, where the only exact transformations currently known are from MRSDF or CSDF into HSDF. The presented transformation is comparable to the well-known transformation from MRSDF into HSDF, but the increase in

graph size is polynomial in the CSDF graph’s size, instead of exponential. The graphs are equivalent in the sense that both graphs have the same self-timed schedule.

In case initial token counts are left variable, which is the case when buffer sizes are optimised under a throughput constraint, the presented transformation places a number of initial tokens on theMRSDF channels that differs from the CSDFvariables by a constant. When approximating methods are used to estimate throughput or required buffer sizes, the equivalentMRSDF graph improves on the approximation obtained from the originalCSDF graph.

This transformation opens up a wide range of research directions into methods that combine exact transformations with approximate performance analysis. First of all, the presented transformation may be applied toMRSDF graphs, as a generalisation of the well-known transformation of

MRSDFintoHSDF. This requires modelling anMRSDFactor as a CSDF actor, which can trivially be done by repeating an actor’s rate several times in a vector of chosen length. The main advantage of using the presented transformation is that it allows for a stepwise transformation of anMRSDF

graph into anHSDFgraph. An illustrative example is given in Figure 8, where actor b fires twice in a single graph iteration. The actor is therefore replaced by a CSDF actor that has two phases, and the equivalent MRSDF graph thus distinguishes between even and odd firings of actor b.

The primary research questions in adapting the transfor-mation presented in this paper to such a stepwise analysis is to determine which (CSDF or MRSDF) actor to unfold. The answer to this question may be provided by approximate analysis techniques. We are convinced that the presented transformation provides the cornerstone for efficient, in-cremental performance analysis of synchronous dataflow graphs.

ACKNOWLEDGEMENT

This research is partly supported by EU projects SENSA

-TION (FP7-ICT-2011-8, grant agreement no. 318490) and

POLCA (FP7-ICT-2013-10, grant agreement no. 610686). REFERENCES

[1] E. Lee and D. Messerschmitt, “Synchronous data flow,” Proceedings of the IEEE, vol. 75, no. 9, pp. 1235–1245, 1987. [2] G. Bilsen, M. Engels, R. Lauwereins, and J. Peperstraete, “Cyclo-Static dataflow,” IEEE Transactions on Signal Pro-cessing, vol. 44, no. 2, pp. 397–408, 1996.

[3] A. Moonen, M. Bekooij, R. van den Berg, and J. van Meerbergen, “Practical and Accurate Throughput Analysis with the Cyclo Static Dataflow Model,” in Proceedings of the 15th International Symposium on Modeling, Analysis, and Simulation of Computer and Telecommunication Systems (MASCOTS). IEEE, Oct. 2007, pp. 238–245.

(9)

MP3 SRC1 SRC2 SRC3 SRC4 SRC5 SRC6 SRC7 SRC8 SRC9 SRC10 SRC1 SRC2 SRC3 SRC4 SRC5 SRC6 SRC7 SRC8 SRC9 SRC10 SRC1 SRC2 SRC3 SRC4 SRC5 SRC6 SRC7 SRC8 SRC9 SRC10 DAC 432 480 384 480 336 480 288 480 240 480 192 480 144 480 96 480 48 480 480 480 d1 480 d1+ 48 480 d1+ 96 480 d1+ 144 480 d1+ 192 480 d1+ 240 480 d1+ 288 480 d1+ 336 480 d1+ 384 480 d1+ 432 441 441 45 441 89 441 133 441 177 441 221 441 265 441 309 441 353 441 397 d2+ 396 441 d2+ 352 441 d2+ 308 441 d2+ 264 441 d2+ 220 441 d2+ 176 441 d2+ 132 441 d2+ 88 441 d2+ 44 441 d2 441

Figure 7. TheMRSDFgraph that is equivalent to theCSDFgraph from Figure 6. Self-loops have been omitted for clarity.

a,2 b,1 2 3 3 4 2 1 (a)MRSDFcycle a,1 b,2 h2i h3, 3i h3, 3i 4 h2i 1

(b)CSDFversion with actor b unfolded twice a1 b1 b2 a1 2 3 6 2 6 6 4 2 6 7 2 1 (c) EquivalentMRSDFgraph a1 b1 b2 a1 1 1 3 1 3 3 2 1 3 3 1 1 (d) Normalised

Figure 8. PartialMRSDF-to-HSDFtransformation, obtained by repeating production and consumption rates into vectors. The unfolded graph reveals dependencies between even and odd firings of actor b.

[4] A. Dasdan, “Experimental analysis of the fastest optimum cycle ratio and mean algorithms,” ACM Transactions on Design Automation of Electronic Systems (TODAES), vol. 9, no. 4, pp. 385–418, 2004.

[5] A. H. Ghamarian, M. C. W. Geilen, S. Stuijk, T. Basten, B. D. Theelen, M. R. Mousavi, A. J. M. Moonen, and M. J. G. Bekooij, “Throughput Analysis of Synchronous Data Flow Graphs,” in Proceedings of the 6th International Conference on Application of Concurrency to System Design (ACSD). IEEE, 2006, pp. 25–36.

[6] S. Stuijk, M. Geilen, and T. Basten, “Exploring trade-offs in buffer requirements and throughput constraints for syn-chronous dataflow graphs,” in Proceedings of the 43rd Design Automation Conference (DAC). New York, New York, USA: ACM Press, Jul. 2006, pp. 899–904.

[7] M. Geilen, “Reduction techniques for synchronous dataflow graphs,” in Proceedings of the 46th ACM/IEEE Design Au-tomation Conference (DAC). IEEE, 2009, pp. 911–916. [8] R. de Groote, P. K. F. H¨olzenspies, J. Kuper, and H. J.

Broersma, “Back to Basics: Homogeneous Representations of Multi-Rate Synchronous Dataflow Graphs,” in Proceedings of the 11th ACM-IEEE International Conference on Formal Methods and Models for Codesign (MEMOCODE), Oct. 2013, pp. 35–46.

[9] S. Stuijk, M. Geilen, and T. Basten, “Throughput-Buffering Trade-Off Exploration for Cyclo-Static and Synchronous Dataflow Graphs,” IEEE Transactions on Computers, vol. 57, no. 10, pp. 1331–1345, Oct. 2008.

[10] M. Wiggers, M. Bekooij, and G. Smit, “Efficient Computa-tion of Buffer Capacities for Cyclo-Static Dataflow Graphs,” in Proceedings of the 44th ACM/IEEE Design Automation Conference (DAC). IEEE, 2007, pp. 658–663.

[11] T. Parks, J. Pino, and E. Lee, “A Comparison of Synchronous and Cyclo-static Dataflow,” in Proceedings of the 29th Asilo-mar Conference on Signals, Systems and Computers, vol. 1. IEEE Comput. Soc. Press, 1995, pp. 204–210.

(10)

[12] S. Sriram and S. S. Bhattacharyya, Embedded Multiproces-sors: Scheduling and Synchronization. CRC Press, Feb. 2009.

[13] S. Ha and H. Oh, “Decidable Dataflow Models for Signal Processing: Synchronous Dataflow and its Extensions,” in Handbook of Signal Processing Systems, S. S. Bhattacharyya, E. F. Deprettere, R. Leupers, and J. Takal, Eds. Springer, 2013, pp. 1083–1109.

[14] A. Ghamarian, M. Geilen, T. Basten, B. Theelen, M. Mousavi, and S. Stuijk, “Liveness and boundedness of synchronous data flow graphs,” FMCAD06, no. August, pp. 68–75, 2006. [15] R. de Groote, J. Kuper, H. Broersma, and G. J. Smit,

“Max-Plus Algebraic Throughput Analysis of Synchronous Dataflow Graphs,” in Proceedings of the 38th Euromicro Con-ference on Software Engineering and Advanced Applications (SEAA). IEEE, Sep. 2012, pp. 29–38.

[16] B. Heidergott, G. J. Olsder, and J. van der Woude, Max Plus at Work: modeling and analysis of synchronized systems. Princeton University Press, 2006.

[17] J. P. Hausmans, S. J. Geuns, M. H. Wiggers, and M. J. Bekooij, “Compositional temporal analysis model for incre-mental hard real-time system design,” in Proceedings of the

10th ACM International Conference on Embedded Software (EMSOFT). New York, NY, USA: ACM Press, Oct. 2012, pp. 185–194.

[18] M. Benazouz and A. Munier-Kordon, “Cyclo-static DataFlow phases scheduling optimization for buffer sizes minimiza-tion,” in Proceedings of the 16th International Workshop on Software and Compilers for Embedded Systems (M-SCOPES). New York, NY, USA: ACM Press, Jun. 2013, pp. 3–12. [19] G. Cohen, G. J. Olsder, and J.-P. Quadrat, Synchronization

and linearity. Wiley New York, 1992.

[20] R. Reiter, “Scheduling Parallel Computations,” Journal of the ACM, vol. 15, no. 4, pp. 590–599, Oct. 1968.

[21] E. Lee and T. Parks, “Dataflow process networks,” Proceed-ings of the IEEE, vol. 83, no. 5, pp. 773–801, May 1995. [22] R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete

Mathematics: A Foundation for Computer Science. Addison Wesley, Jan. 1994.

[23] M. H. Wiggers, “Aperiodic Multiprocessor Scheduling for Real-Time Stream Processing Applications,” Ph.D. disserta-tion, University of Twente, Enschede, The Netherlands, Jun. 2009.

Referenties

GERELATEERDE DOCUMENTEN

Butts (2008) relational event model was employed to examine the communication dynamics amongst the pilots in the cockpit of flight AF447, and illustrate how communication patterns

Weil die Verteilung der Energie uber den beiden Elektroden innerhalb einer Periode genau gemessen werden kann, brauchen wir uns bei der Versuchsdurchfuhrung nicht

In the final section it is indicated how a manpower data sys- tem in combination with a forecasting and recruitment planning pr, l'edure may yield a very

De lengte van de minstens 1m brede greppel bedraagt minimaal 38 m, maar het tracé ervan kan ongetwijfeld zowel in

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

Figure 1 Influence of electron beam radiation on drawn 1.5 wt % UHMW-PE tapes determined via the swelling ratio (SR), and the corresponding M~ as a function of the draw ratio for

Inventarisatielijst Zorgstandaard naar Zorgprogramma Dementie– Ontwikkeld door Vilans in samenwerking met Kwaliteitsinstituut &amp; Alzheimer Nederland ©Vilans mei 2013 Hebben