recursivness.cpp File Reference

Annotate a signal expression with recursivness information. More...

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include "recursivness.hh"
Include dependency graph for recursivness.cpp:

Go to the source code of this file.

Functions

void recursivnessAnnotation (Tree sig)
 Annotate a signal with recursivness.
int getRecursivness (Tree sig)
 Return the recursivness of a previously annotated signal.

Detailed Description

Annotate a signal expression with recursivness information.

Recursiveness indicates the amount of recursive dependencies of a signal. A closed signal has a recursivness of 0 because is has no recursive dependencies. This means that the succesive samples of this signal can be computed in parallel. In a signal of type .(...F(x)...), F(x) has a recursivness of 1. In a signal of type .(... .(...F(x)...G(y)...)...) F(x) has a recursivness of 2 while G(y) has a recursivness of 1.

Definition in file recursivness.cpp.


Function Documentation

int getRecursivness ( Tree  sig  ) 

Return the recursivness of a previously annotated signal.

An error is generated if the signal has no recursivness property

Parameters:
sig signal
Returns:
recursivness of the signal

Definition at line 64 of file recursivness.cpp.

00065 {
00066     Tree tr;
00067     if ( ! getProperty(sig, RECURSIVNESS, tr)) {
00068         cerr << "Error in getRecursivness of " << *sig << endl;
00069         exit(1);
00070     }
00071     return tree2int(tr);
00072 }

void recursivnessAnnotation ( Tree  sig  ) 

Annotate a signal with recursivness.

Should be used before calling getRecursivness

Parameters:
sig signal to annotate

Definition at line 51 of file recursivness.cpp.

00052 {
00053     annotate(nil, sig);
00054 }

Generated by  doxygen 1.6.2-20100208