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 project are:

Preparation

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:
cd
mkdir ccss
cd ccss
And fetch the files for this exercise:
get-module idsp_tra idsp_tra
Now start CCSS (shell command ccss) and add the library idsp_tra to 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 idsp_tra library:

The 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 transposed 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. All parameters 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 respectively amp2.

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 Davis.

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 single stream.

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.

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.

Deliverables

Write a short report always motivating your choices and explaining the way you have reached your answers. Particular points of attention:

Grading


Go (back) to  Sabih's Home Page.
Last update on: Wed Mar 1 01:30:23 CET 2017 by Sabih Gerez.