Project TRA: Data-Flow Transformations
This project is a compulsory part of the examination for the
Implementation of Digital Signal Processing
course at the University of Twente. The goals of this
- To apply the theory of data-flow transformations to a relatively
To develop your skills in the use of Synopsys Cocentric System
Make sure that you have performed the preparatory project PRE which
should help you to get acquainted with CCSS.
Files and Libraries
If you do not have done it yet, create a directory ccss in
your home directory and change to that directory:
And fetch the files for this exercise:
get-module idsp_tra idsp_tra
Now start CCSS (shell command ccss) and add the library
your workspace by means of
the Library -> Add Existing Libraries ... feature of CCSS.
If everything went well, you will have the following models in the
- mul_const: multiplication by a constant with different
data types for data and constant.
- sec_soc: a second-order filter section, also used in
System-on-Chip Design course.
- tb_sec_soc: a testbench for the second-order filter.
The figure below gives the data-flow graph (DFG) and z-domain description
of the filter to be used in this exercise.
The DFG represents the so-called
form of a second-order infinite impulse response (IIR) filter. The
delay element (T0) before the output has been introduced for implementation
reasons; in this way, the output of the filter corresponds to the contents
of a register.
This filter is made available to you in model sec_soc. The
coefficients have been defined as parameters to the model. Also the
data types are parameterized: there is a parameter T_d for
data and a parameter T_c for the coefficients. Initially, both
types are set to float.
have been defined at the testbench level and propagated down the
hierarchy to their destinations.
The testbench consists of two cosine generators. They generate two
sinusoidal signals with frequencies f_cos1 and
f_cos2 respectively. The sum of these two signals is fed into
the filter. Both the input and the output of the filter are recorded
for later viewing by Davis in WriteSignal blocks. The number
of samples written is given by parameter out_samples. By
changing its value you can change the duration of the simulation. Also
the amplitudes of the two cosines are parameterized by amp1
With the given coefficient values, the filter is high pass.
The idea is to generate two frequencies of which one is strongly
attenuated and the other passes without attenuation.
Exercise TRA-1: Familiarization
Generate code and simulate the given testbench as is. Repeat the
simulation with one of the two cosines active (put the amplitude of
the other to 0). Make sure that the filter behaves as expected. Use
either an scf script or the Level Watch tab of a
paused simulation to change the amplitudes without the need to
regenerate the code.
How much (in dB) is the lower frequency input approximately attenuated?
Estimate this number by measuring the input and output amplitudes in
Exercise TRA-2: Pipelining and Retiming
Assume that the implementation will require one clock cycle for an
addition and two clock cycles for a multiplication. Be aware that such
computational delay cannot be simulated by a data-flow model.
Assume that the filter will be realized with a non-overlapping schedule
(the delay elements will be replaced by output-input pairs). How long
is, in such a case the critical path? Draw it in the DFG.
Use now pipelining and retiming to minimize the critical path.
Make a copy of sec_soc (e.g. by means of Duplicate and then
Rename under the right mouse button in the model browser) and
then modify it.
Then simulate the modified model parallel to the original filter,
compute the difference between the two outputs (use the model
Sub from the cocentric -> models -> arithmetic library)
and show that the outputs are identical.
Exercise TRA-3: Unfolding
Unfold the original filter by a factor of two. Do this in such a way
that the topology of the original filter can be recognized in the
unfolded graph as drawn by you.
Make a model of the unfolded graph in System Studio, put it in
parallel with the original graph and show that the two behaviors are
identical. Note that the unfolded graph will have two input and
two output nodes. Use Demultiplex2 from
from the cocentric -> models -> flowcontrol library to
alternatively send inputs to either one or the other input and
Multiplex2 to merge the tokens from the two outputs into a
Note: It turns out that the current version of System Studio
may have problems to simulate unfolded graphs; it detects deadlocks
where there aren't any. This problem can be circumvented by the
following two actions:
Question: Does the transformation have any effect on the critical
path or critical loop? Explain.
- Select the top-level model in the model browser. Then issue
Model -> Configure Implementation .... In the window that pops
up, go to the Attributes tab and activate the property
always_dynamic, followed by OK or Apply. (This
property is normally used when a static schedule is not possible due
to data-dependent firing of nodes in the data-flow graph.)
- Repeat the above, but instead of the Attributes tab, now
open the Exit Condition tab. In the input field that shows up,
type a Boolean expression that is the logical AND of all sinks
of your model. It indicates to the simulator that the simulation
should only terminate when all sinks have received a sufficient number
of tokens. The exit condition of the distributed model
tb_sec_soc is e.g. sec_soc_in && sec_soc_out
referring to the only two WriteSignal sinks in the model.
Exercise TRA-4: Look-ahead transformation
Apply a one-step look-ahead transformation to the original
filter. Try to preserve the topology of the DFG as much as possible.
Proceed in the same way
as in TRA-3 to show that the result that you have obtained behaves the
same as the original filter. Comment on the critical path and loop.
Write a short report always motivating your choices and explaining the
way you have reached your answers. Particular points of attention:
- TRA-1: Answer to the question. Relevant plots as produced by Davis.
- TRA-2: Critical path, drawings of optimized DFG and modified
- TRA-3: Drawings of the unfolded DFG and the modified testbench;
- TRA-4: Drawings of the new DFG and the modified testbench;
- TRA-1: 1 point
- TRA-2: 2 points
- TRA-3: 4 points
- TRA-4: 3 points
Last update on:
Wed Mar 1 01:30:23 CET 2017
by Sabih Gerez.