EE382C Embedded Software Systems - Introduction to SDF Scheduling

In SDF scheduling, we can make all scheduling decisions are compile time. For SDF graphs, we can determine in linear time whether or not a SDF graph has a periodic schedule by trying to compute the repetitions vector. If a repetitions vector exists, then the SDF graph has a periodic schedule and it is said to be sample rate consistent. The next stage is to find an admissible periodic schedule, called a valid schedule, that satisfies the data dependencies and delays in the SDF graph. An SDF graph with a valid schedule is said to be consistent. Every consistent SDF graph can be executed in bounded memory without halting using a static schedule. There are many approaches to scheduling SDF graphs.

Acyclic Precedence Graph

One family of SDF scheduling algorithms converts the SDF graph into an acyclic precedence graph (APG), and then schedules the APG. An APG is unique for a given SDF graph G and a positive integer block factor J. Each vertex of an APG corresponds to an instance of an actor invocation in the repetitions vector. Hence, the number of nodes in the APG is equal to the sum of the entries in the repetition vector. Figure 1a shows an SDF graph, and Figure 1b shows the associated APG for a blocking factor of 1.

          e            e             
  ----     1    ----    2     ----   
 | A  | -**--> | B  | -----> | C  |  
 |    |        |    |        |    |  
  ----          ----          ----   
       3      2      1      1        
                                     
  (a) A simple SDF graph.  The **    
      means a two-token delay. The   
      repetitions vector is          
      [2, 3, 3]' for A, B, and C.    
                                     
                ----          ----   
               | A  |        | A  |  
               |  1 |        |  2 |  
                ----\         ----   
                  |  \          |    
                  v   \         v    
  ----          ----   \      ----   
 | B  |        | B  |   ---> | B  |  
 |  1 |        |  2 |        |  3 |  
  ----          ----          ----   
    |             |             |    
    v             v             v    
  ----          ----          ----   
 | C  |        | C  |        | C  |  
 |  1 |        |  2 |        |  3 |  
  ----          ----          ----   
                                      
  (b) The Acyclic precedence graph   
      associated with the previous   
      SDF graph for a block factor   
      of 1.                          
Figure 1: Acyclic Precedence Graph representation for a Synchronous Dataflow graph

Even though the scheduling of an APG can be performed in polynomial time, the conversion from an SDF graph to an APG may be exponential in the size of the SDF graph. If we cascade a source actor, N actors that upsample by 2, and a sink actor together, then the repetitions vector is

[1 1 2 4 ... 2N-1 2N]
(Example provided on 2/24/97 by Dr. Joseph T. Buck from Synopsys.) In this example, the number of nodes in the APG is O(2^N), which is exponential in the number of nodes. As an example of best-case performance, consider an acyclic homogeneous SDF graph. The APG graph is the same as the SDF graph. So, any SDF scheduling algorithm that requires the APG as an intermediate step has worst-case complexity that is a polynomial function of an exponential function of the size of the SDF graph.

Class-S Algorithms

Lee and Messerschmitt defined a class of scheduling algorithms, called class-S algorithms, that construct valid schedules given a positive integer multiple of the repetitions vector r where r = k q for some positive integer k. A class-S algorithm maintains the state of the system as a vector b that is indexed by the edges of the SDF graph. Once an actor A has been scheduled r(A) times, a class-S algorithm does not schedule A again. A class-S algorithm constructs a valid schedule if and only if the SDF graph is consistent.

Figure 3.6 and 3.7 in the Software Synthesis from Dataflow Graphs describes a class-S algorithm to schedule an SDF graph given by (V, E). The routine computes the state (the number of tokens queued on the buffers) for one period of the SDF graph given by the repetition vector. If the final state is equal to the initial state, then the graph is consistent and we have a valid periodic schedule. Although this algorithm does not rely on converting the SDF graph to an APG, it nonetheless has the following complexity:

O ( I fi fo + | E | )

where

This complexity is therefore quadratic in the number of edges times an exponential function of the number of actors. Consider again an SDF graph formed by chaining together a source actor, N actors that upsample by 2, and a sink actor. The repetitions vector is
[1 1 2 4 ... 2N-1 2N]
so I is exponential in the number of actors. Even though this algorithm does not explicitly construct the APG, it does have to enumerate each invocation of each actor in the schedule by its repetitions factor (Praveen Murthy, U.C. Berkeley, e-mail). Therefore, the number of steps involved is proportional to the number of nodes in the APG.


Updated 03/02/99.