Digital Signal Processing Reference
In-Depth Information
gain: g_gain
Ramp
1/100
piggyback
gain
out
singen
state name: g_gain
period = 100
offset = 0
generate sin wave:
100 samples per period
Fig. 16 An SPDF graph that produces a sinusoidal waveform with varying amplitude at run-
time: the “gain” state of the “Gain” block is updated by the “Ramp” block through a global state,
“global gain”
Figure 16 shows another example that produces a sinusoidal waveform with
varying amplitude at run-time. The “Singen” block generates a sinusoidal waveform
( N samples per period) of unit amplitude and the “Gain” block amplifies the input
samples by the “gain” parameter of the block. To control the amplitude, the graph
uses a Piggyback block after the “Singen” block. Another source block, “Ramp”,
is connected to the state port of the Piggyback block. The “statename” of the
Piggyback is named “global gain” and the “gain” parameter of the “Gain” block
is also set to “global gain”. Then, the “gain” parameter of the “Gain” block is
updated with a global state named by “global gain” whose value is determined by
the “Ramp” block. In this example, the period of the Piggyback block is set to N so
that the amplitude of the sinusoidal waveform is incremented by one every period
as shown in Fig. 16 . If we insert two initial samples on the input arc of the “Gain”
block, the “offset” parameter of the Piggyback block should be 2.
Thus the SPDF model provides a safe mechanism to deliver state values
through shared memory instead of message passing. Communication through shared
memory is prohibited in conventional dataflow models since the access order to the
shared memory may vary depending on the schedule. But the SPDF model gives
another solution by observing that the side effect is caused by an implicit assumption
that the global state is assigned a memory location before scheduling is performed.
The SPDF model changes the order: allocate the memory for the global state after
the schedule is made. Since the scheduling decision is made at compile-time, we
know the access order to the variable and the life time of each global state variable.
Suppose that the schedule of Fig. 16 becomes “2(100(Singen) Ramp Piggyback)
200(Gain Display)”. From the static schedule, we know that we need to maintain
two memory locations for the global state, “global gain” since the Piggyback block
writes the second value to the global state before the “Gain” reads the first global
state.
Allowing shared memory communication without side effects gives a couple
of significant benefits over conventional dataflow models. First, it can remove the
unnecessary overhead of data copying of message passing communication since
the global state can be shared by multiple blocks. Second, it greatly enhances the
 
 
Search WWH ::




Custom Search