Guest User

Untitled

a guest
Jul 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.35 KB | None | 0 0
  1.  
  2. void BlockBasedFIR(double[256], double[256], double[256], int, int);
  3.  
  4. void BlockBasedFIR(double y[256], double x[256], double c[256], int BLOCK,
  5.         int NTAP) {
  6.     // *********************************
  7.     // SCoP null
  8.     //  - Parameters [BLOCK, NTAP]
  9.     //  
  10.     int i;
  11.     int j;
  12.     { // FSM 0
  13.       // FSM declarations
  14.         int done = 0, s, j, i;
  15.         // FSM initialization
  16.         if (BLOCK - 1 >= 0) {
  17.             s = 0;
  18.             j = 0;
  19.             i = 0;
  20.         } else
  21.             done = 1;
  22.         while (!done) {
  23.             // FSM Commands
  24.             if (((s - 1 == 0) && (j - 1 >= 0) && (-j + NTAP - 1 >= 0))
  25.                     || ((j == 0) && (s - 1 == 0) && (NTAP - 1 >= 0))) {
  26. #pragma ignore_memory_dependency for y,x,c
  27.                 S0: y[i] = y[i] + (x[i - j] * c[j]);
  28.             }
  29.             if ((j == 0) && (s == 0)) {
  30. #pragma ignore_memory_dependency for
  31.                 S1: y[i] = 0;
  32.             }
  33.             // FSM transitions
  34.             if ((i - BLOCK + 1 == 0) && (j == 0) && (s == 0)
  35.                     && (NTAP - 1 >= 0)) {
  36.                 s = 1;
  37.                 j = 0;
  38.                 i = 0;
  39.             } else if ((i - BLOCK + 1 == 0) && (s - 1 == 0)
  40.                     && (-j + NTAP - 2 >= 0) && (-j + BLOCK - 2 >= 0)) {
  41.                 s = 1;
  42.                 j = j + 1;
  43.                 i = j + 1;
  44.             } else if ((j == 0) && (s == 0) && (-i + BLOCK - 2 >= 0)) {
  45.                 s = 0;
  46.                 j = 0;
  47.                 i = i + 1;
  48.             } else if ((s - 1 == 0) && (-j + NTAP - 1 >= 0)
  49.                     && (-i + BLOCK - 2 >= 0)) {
  50.                 s = 1;
  51.                 i = i + 1;
  52.             } else
  53.                 done = 1;
  54.         }
  55.     }
  56.     // *********************************
  57. }
Add Comment
Please, Sign In to add comment