Synchronous Data-Flow Graphs
Synchronous Data-Flow Graphs (SDFGs) [65] are used to model periodic ap-plications that must be bound to a Multi Processor System on Chip. They allow modeling of both pipelined streaming and cyclic dependencies between tasks. This model of computation represents data movements between ac-tivities through tokens5 (i.e. dot on the arcs of the graph). To assess the performances of an application on a platform, one important parameter is the throughput. In the following we provide some preliminary notions on synchronous data flow graphs used in this thesis.
Definition 12. An SDFG is a pair hV, Ai consisting of a finite set V of activities (also called, nodes, tasks or actors) and a finite set A of dependency arcs. A dependency arc ~e = hi, j, p, q, δi denotes a dependency of activity j on i, with i, j ∈ V. When i executes, it produces p tokens on ~e and when j executes, it consumes q tokens from ~e. Arcs6 may contain initial tokens δ = tok(~e) = tok(i, j).
5The token in the SDF Model is equivalent to the repetition distances δ of the project graph presented in 2.
6Note that a dependency arc of a SDF graph could be physically represented as a FIFO Memory Buffer where data (i.e. tokens) are stored.
Figure 3.1: Synchronous Data-Flow Graph
An activity execution is defined in terms of firings. An essential prop-erty of SDFGs is that every time an activity fires it consumes a given and fixed amount of tokens from its input edges and produces a known and fixed amount of tokens on its output edges. These amounts are called rates. The rates determine how often activities have to fire w.r.t. each other such that the distribution of tokens over all edges is not changed. This property is cap-tured by the repetition vector. Figure 3.1 represents a simple Synchronous Data-Flow graph with 4 nodes; the execution times are:
A = 2, B = 5, C = 2, D = 1.
Definition 13. A repetition vector of an SDF G = hV, Ai is a function γ : V → N such that for every edge ~e = (i, j, p, q, δ) ∈ A from i ∈ V to j ∈ V, p · γ(i) = q · γ(j). A repetition vector q is called non-trivial if ∀i ∈ V, γ(i) > 0.
The smallest non trivial repetition vector is usually referred to as the repetition vector. We say the SDFG completes an sdf-iteration whenever each activity i has executed exactly γ(i) times. We refer as sdf-repetition to each activity executing within an sdf-iteration. For instance, the repetition vector of the graph described in Figure 3.1 is [1, 2, 2, 3]
3.2.1 Throughput
Throughput is an important design constraint for embedded multimedia sys-tems. The throughput of an SDFG refers to how often an activity produces tokens. To compute throughput, a notion of time must be associated with the execution of each activity (i.e., each activity has a duration di also called execution time) and an execution scheme must be defined. We consider as execution scheme the self timed execution of activities: each activity ex-ecutes as soon as all of its input data (i.e. tokens) are available (see [94]
for details). In a real platform the self timed execution is implemented by assigning to each processor a sequence of activities to be fired in fixed order:
the exact firing times are determined by synchronizing with other processors at run time.
Working with Synchronous Data-Flow models of computation, it becomes natural to adopt a scheduling strategy which defines only the allocation and let the run-time scheduler to decide the start times (i.e. the static-order scheduling technique, see Section 2.2.2).
Figure 3.2: Single-iteration self-time execution
Considering the SDF graph in Figure 3.1, its single-iteration self-timed execution can be expressed by the Gantt chart of Fig-ure 3.2. First activity A is executed, it produces two tokens on (A, B) since the out-rate of activity A on the edge is 2. The to-kens position is depicted in Figure 3.3a. The in-rate of activity B on the same edge is 1; therefore B can fire twice concurrently.
After both executions of B (see Figure 3.3b), the activity C can start. Its execution consumes 1 token on (B, C) and 3 on (D, C)
B C D
Figure 3.3: Synchronous Data-Flow Graph Execution Example and produces 3 tokens on (C, D) (see Figure 3.3c). Then, only the activity D could fire, because the activity C is constrained by the presence of only 2 tokens on (D, C). Actor D produces 2 tokens on (D, C) (see Figure 3.3d) and enables the firing of C whose execution enables the concurrent execution of two instances of D that terminate the single-iteration self-timed execution of the graph.
3.2.2 Homogeneous Synchronous Data Flow Graphs
SDFGs in which all rates equal 1 are called Homogeneous Synchronous Data Flow Graphs (HSDFGs, [65]). Every SDFG G = hV, Ai can be converted to an equivalent HSDFG GH = hV, Ai, by using the conversion algorithm in [14]. The transformation procedure is based on the repetition vector and produces an homogeneous graph that has a node for any sdf-repetition of each activity of the original SDF graph (i.e. γ(i) nodes in V for each activity i ∈ V); as a consequence the homogeneous graph is usually larger than the related SDF.
In figure 3.4 we report the HSDFG corresponding to the SDFG in Fig-ure 3.1. Note that, for example, activities B1 and B2 of the HSDFG
corre-Figure 3.4: Homogeneous Synchronous Data-Flow Graph
spond to the activity B of the SDFG that has a repetition vector γ(B) = 2.
In the figure the (unary) rates are omitted.
Figure 3.5: Filtered Homogeneous Synchronous Data-Flow Graph Note that turning an SDFG into the equivalent homogeneous graph may produce multiple arcs between pairs of nodes (see edges from D2 to C1 in Figure 3.4). Therefore the homogeneous graph should be simplified before throughput computation removing multiple edges between two nodes. Fig-ure 3.5 shows the filtered graph corresponding to the one in FigFig-ure 3.4.