# Automatic Configurable Hardware Code Generation for Software-Defined Radios+
## 3 Analysis of SDF-AP Model
The 1-periodic schedule is defined as \(\sigma(i,j,a)=\sigma(0,0,a)+i\cdot T+j\cdot\mu(a)\) where \(\sigma(i,j,a)\) is the actor schedule at iteration index \(i\in\mathbb{N}\) and actor instance index \(j\in\{0...RV(a)-1\}\), \(\sigma(0,0,a)\) is a start time (scheduling offset) of the first actor instance, iteration period (or iteration/schedule initiation interval) \(T\geq RV(a)\cdot\mu(a)\), and \(\mu(a)\) is the actor scheduling period (i.e., interval between successive actor instances in one iteration). The buffer computation for SDF-AP is briefly explained in [13; 14] whereby the constraint formulation is used to iteratively explore the buffer sizes for FIFO channels to the specified throughput. [PERSON] et al. [11] generalize this approach and introduce an optimization technique that is based on Integer Linear Programming (ILP) to minimize communication buffers. In this work, we present in Section 3.2, a method to formally compute a buffer size using a 1-periodic schedule which can easily be automated in high-level synthesis tool. Moreover, an actor is associated with the _execution pattern_ (_EP_) which is a sequence of binary elements of an _access pattern_ (\(AP=\{PP,CP\}\)) on the port of actor \(a\in\mathcal{A}\) where it is active (i.e., firing state) and idle (i.e., non-firing state) for a duration of iteration latency (_IL_) which will be explained in Section 3.1. The order of the _EP_ elements is determined by a 1-periodic schedule where the actor idleness (i.e., \(\sigma(i,j,a)=\emptyset\)) in the schedule is denoted by 0's. The _EP\({}_{i,p}\)_ (resp. _EP\({}_{i,q}\)_) is used to access the _i-th_ element of _EP_ on source (resp. sink) port \(q\) (resp. \(p\)) of channel \(c\). For example, in Figure 2 the execution pattern of a source port is  
\[EP_{*,p}=[ \begin{array}{cccccccccccccccc}0&1&1&\mathbf{0}&0&1&1&\mathbf{0}& 0&1&1&\mathbf{0}&\mathbf{0}\end{array} ]\]  
and that of the sink port is  
\[EP_{*,q}=[ \begin{array}{cccccccccccccccc}\mathbf{0}&\mathbf{0}&\mathbf{0}& 1&0&1&0&1&0&1&0&1\end{array} ].\]  
The asterisk (\(*\)) represents the whole vector _EP_ where the individual elements are for example accessed as follows, the element of _EP\({}_{*,p}\)_ at \(i=1\) is _EP\({}_{1,p}=1\)_ and the element of _EP\({}_{*,q}\)_ at \(i=1\) is _EP\({}_{1,q}=0\)_. Please note that the elements in bold represent locations where an actor is idle hence its neither producing nor consuming a token. We also define a _token counter_ (_TC_) as the sequence of length _IL_ which represents the total number of tokens that are produced (resp. consumed) (i.e., _TC\({}_{i,p}\)_ (resp. _TC\({}_{i,q}\)_)) to (resp. from) the channel up to the _i-th_ clock cycle. The _TC_ computation is a trivial cumulative sum of _EP_ and using the same example of _EP_ vectors above, the token counters for a channel can be determined as  
\[TC_{*,p}=[ \begin{array}{cccccccccccccccc}0&1&2&2&2&3&4&4&4&5&6&6&6\end{array} ]\]  
not occur. Each SDF-AP model iteration is represented by a sequence of actor firing with similar filled colour, hence the alternating white and shaded firing sequences correspond to individual iterations. The schedule has actor \(x\) which executes once every four clock cycles (i.e., \(\mu(x)=4\)) whereas actor \(y\) executes once in five or more clock cycles (\(\mu(y)\geq 5\)). The initiation interval of the model execution is \(12\) cycles (i.e., \(T=12\)), and the iteration latency is \(13\) cycles (i.e., \(IL=13\)). Given a throughput constraint, a valid buffer-size for each model channel can be computed from the \(1\)-periodic schedule [11] model provided that the system is bounded and deadlock-free. The throughput \(\tau(a)\) of an actor \(a\) is defined as the average number of firings per unit time and is determined using \(\tau(a)=(RV(a)\cdot PR(c)\) or \(CR(c))/T\). It can also be defined as how often the schedule \(\sigma\) executes, in this case, the throughput formula \(\tau(\sigma)=1/T\) is used where \(T\) is an iteration period.