# Automatic Configurable Hardware Code Generation for Software-Defined Radios+
## 4 Timed SDF-AP Semantics  
The operational semantics of an SDF-AP model is defined by a labelled transition system \(N\)[13]. This transition system represents a model for SDF-AP model and its behaviour is easy to analyse and compare with the model for hardware. A state \(s=(g,h)\) of the system is a tuple containing a vector \(g\) that describes the number of tokens in every channel and \(h\) associates to each actor \(a\) a multi-set \(h(a)\) of tuples of the form \((\eta,\kappa)\in\mathbb{N}_{0}\times\{w,r,\bot\}\). Each tuple \((\eta,\kappa)\in h(a)\) denotes an active actor instance where \(\eta\) is the number of clock cycles since the start of the execution in one iteration, and \(\kappa\) marks the stage of an active actor instance within the clock cycle. The stages are divided into three namely idle \(\bot\), reading \(r\) and writing \(w\). When \(h(a)=\emptyset\), an actor is considered to be inactive. A transition \((s,\ell,s^{\prime})\) is denoted as \(s\xrightarrow{\ell}s^{\prime}\) where \(s^{\prime}\) is a successor state of \(s\) and \(\ell\in L\) is an action label which belongs to a set of labels \(L=\{begin(a)\text{, }end(a)\text{, }tick\text{, }get(a)\text{, }put(a)\}\). A transition with label \(begin(a)\) denotes the beginning of firing of a newly added instance of actor \(a\) to a list of active actor instances. The removal of an instance from a list of active actor instances is marked by \(end(a)\) transition when the clock counter has reached \(ET(a)\). A transition \(tick\) denotes one time unit lapse of the clock where the clock counter for each actor is increased by 1. The clock counter is paired with a stage (i.e., \((\eta,\kappa)\)) allowing an actor to undergo the respective order of stages \(\bot\), \(r\), \(w\) and back to \(\bot\) at the end of firing. The transition labels \(get(a)\) (resp. \(put(a)\)) correspond \(a\) reading from (resp. writing to) input channels (resp. output channels). The preconditions for each of the labels are fully explained in [13]. A transition system for SDF-AP model in Figure 1 is shown in Figure 3 whereby the throughput constraint is set to \(6/12=0.5\) SPC. The system starts with a _begin(x)_ transition which adds an actor \(x\) instance to active instances in \(s_{1}\). Please note that in \(s_{1}\) actor \(x\) is in idle stage as this is the beginning of firing. A tick transition updates the tick count and a read stage in \(s_{2}\). This is followed by _get(x)_ transition which leads to token count that remains unchanged as the actor \(x\) is a source actor and consumes no tokens. A _put(x)_ transition does not produce a token because the output pattern _011_ begins with \(0\), as a result the token count does not change. The second tick transition from \(s_{4}\) to \(s_{5}\) increments actor \(x\) clock count to \(2\). The _get(x)_ transition leads to no change in token count while the _put(x)_ transition increases the token count to \(1\). An actor execution continues until it reaches _end(x)_ transition which takes place when the clock transition is \(2\) (i.e., \(ET(x)=2\)). Note the actor \(y\) only begins after \(3\) tick transitions and its _put(x)_ transition does not change the token count as it is a sink actor, however, when it consumes a token, its reduces the current token count in channel \(c1\) by \(1\). The broken lines between \(s_{23}\) between \(s_{n-7}\) represent the intermediate states and transitions up to the last tick (i.e., \((n-1)^{th}\)) transition. \(s_{n-1}\) marks an end of execution iteration and the transition that follow leads back to \(s_{1}\), most notably, \(s_{0}\) only occurs once while the rest of the states are repeated infinitely. Moreover, we constrain every channel of an SDF-AP model as a distinct _closed dataflow network_ in which every sink input port is connected to a source input port [18]. This implies that the source actor only has the output ports that connect with the sink actor input ports, likewise, the sink actor only has the input ports that connect with the source actor output ports.