# Automatic Configurable Hardware Code Generation for Software-Defined Radios+
## 2 The SDF-AP Model  
A dataflow program is represented as a collection of computational elements (called actors) exchanging data objects (called tokens) through unidirectional channels (FIFOs). Execution (called firing) of actors is governed by a set of rules called the model of computation (MoC). These rules specify when the actor can be activated based on several tokens available on its input channels and when the tokens can be written on the output channels. A commonly used dataflow model, called synchronous dataflow (SDF) [12], guarantees decidability and predictability of key model properties at compile-time. However, it does not specify how tokens are consumed and produced with respect to precise times. This leads to a defensive and potentially ineffective design where buffer sizes allocated for channels may be too big or too small [10]. To alleviate this problem, the Static Dataflow with Access Patterns (SDF-AP) model was proposed by [10] and formally presented in [13; 14]. SDF-AP model is a big step towards improving the Synchronous Dataflow (SDF) model [12] by incorporating _access patterns_ which describe the precise clock cycles at which data production/consumption occurs, as a result SDF-AP is considered to have moved SDF closer to the hardware. Recently, [PERSON] et al. [15] proposed a solution named \"stretchable patterns\" which modify the characteristics of the access patterns of the SDF-AP model actors resulting in a model that operates with no buffers. While this solution significantly optimizes the generated hardware system, it is not applicable to the integration of the off-the-shelf IP cores that are typically characterized by fixed access patterns. An SDF-AP model \(\mathcal{G}=(\mathcal{A},\mathcal{C})\) is described as a directed graph with a set of vertices (actors) \(\mathcal{A}\) interconnected to one another by a set of edges (channels) \(\mathcal{C}\). At each execution (firing), an actor consumes data (represented by tokens) from one or more input channels or produces tokens onto one or more output channels. Each actor \(a\in\mathcal{A}\) is a tuple \((IN,OUT,ET,II)\), where \(IN(a)\subseteq\mathcal{P}\) is a set of input ports, \(OUT(a)\subseteq\mathcal{P}\) is a set of output ports with \(IN(a)\cap OUT(a)=\emptyset\); \(ET(a)\in\mathbb{N}\) represents _execution time_ which is the time in clock cycles for an actor to complete one firing, and \(II\) is the _initiation interval_ of an actor defined as the minimum interval between two successive firings of an actor \(a\). For a set of model source actors \(\mathcal{A}_{src}\subseteq\mathcal{A}\), \(IN(a)=\emptyset\); and for a set of model sink actors \(\mathcal{A}_{sink}\subseteq\mathcal{A}\), \(OUT(a)=\emptyset\). A channel \(c=(u,v,p,q,dy)\in\mathcal{C}\) represents a first-in, first-out (FIFO) buffer from source actor \(u\) (via source port \(p\in OUT(u)\)) to a destination actor \(v\) (via destination port \(q\in IN(v)\)) and \(dly\) is a _delay_ and denotes the initial tokens in channel \(c\). A port \(p\in OUT(u)\) is a tuple \((PR,PP)\) where \(PR(c)\) is the _production rate_ (i.e., number of tokens produced on channel \(c\)) and \(PP(c)\) is the _production pattern_ for output port \(p\). In addition, port \(q\in IN(v)\) is a pair \((CR,CP)\) where \(CR(c)\) is the _consumption rate_ (i.e., number of tokens consumed from channel \(c\)) and \(CP(c)\) is the _consumption pattern_ for input port \(q\). The access patterns \(PP=\mathbb{B}^{ET}\) and \(CP=\mathbb{B}^{ET}\) are a set of sequences of binary numbers with length \(ET(a)\). Their function is to determine when the actor reads or writes tokens at a particular clock cycle during firing. The \(i\)-_th_ element of the access pattern is denoted as \(PP_{i,c}\) (resp. \(CP_{i,c}\)) where \(i=\{0...ET(u)-1\) (resp. \(ET(v)-1\}\)). For a given clock cycle, the element with value 1 denotes a single token read (resp. write) from (resp. to) the input (resp. output) channel. The element with value 0 represents the fact that there is no token read (resp. write) from (resp.