PandA-2024.02
gsm.c
Go to the documentation of this file.
1 /*
2 +--------------------------------------------------------------------------+
3 | CHStone : a suite of benchmark programs for C-based High-Level Synthesis |
4 | ======================================================================== |
5 | |
6 | * Collected and Modified : Y. Hara, H. Tomiyama, S. Honda, |
7 | H. Takada and K. Ishii |
8 | Nagoya University, Japan |
9 | |
10 | * Remark : |
11 | 1. This source code is modified to unify the formats of the benchmark |
12 | programs in CHStone. |
13 | 2. Test vectors are added for CHStone. |
14 | 3. If "main_result" is 0 at the end of the program, the program is |
15 | correctly executed. |
16 | 4. Please follow the copyright of each benchmark program. |
17 +--------------------------------------------------------------------------+
18 */
19 #include <stdio.h>
20 #include "lpc.c"
21 
22 /*
23 +--------------------------------------------------------------------------+
24 | * Test Vectors (added for CHStone) |
25 | inData : input data |
26 | outData, outLARc : expected output data |
27 +--------------------------------------------------------------------------+
28 */
29 #define N 160
30 #define M 8
31 
32 const word inData[N] =
33  { 81, 10854, 1893, -10291, 7614, 29718, 20475, -29215, -18949, -29806,
34  -32017, 1596, 15744, -3088, -17413, -22123, 6798, -13276, 3819, -16273,
35  -1573, -12523, -27103,
36  -193, -25588, 4698, -30436, 15264, -1393, 11418, 11370, 4986, 7869, -1903,
37  9123, -31726,
38  -25237, -14155, 17982, 32427, -12439, -15931, -21622, 7896, 1689, 28113,
39  3615, 22131, -5572,
40  -20110, 12387, 9177, -24544, 12480, 21546, -17842, -13645, 20277, 9987,
41  17652, -11464, -17326,
42  -10552, -27100, 207, 27612, 2517, 7167, -29734, -22441, 30039, -2368, 12813,
43  300, -25555, 9087,
44  29022, -6559, -20311, -14347, -7555, -21709, -3676, -30082, -3190, -30979,
45  8580, 27126, 3414,
46  -4603, -22303, -17143, 13788, -1096, -14617, 22071, -13552, 32646, 16689,
47  -8473, -12733, 10503,
48  20745, 6696, -26842, -31015, 3792, -19864, -20431, -30307, 32421, -13237,
49  9006, 18249, 2403,
50  -7996, -14827, -5860, 7122, 29817, -31894, 17955, 28836, -31297, 31821,
51  -27502, 12276, -5587,
52  -22105, 9192, -22549, 15675, -12265, 7212, -23749, -12856, -5857, 7521,
53  17349, 13773, -3091,
54  -17812, -9655, 26667, 7902, 2487, 3177, 29412, -20224, -2776, 24084, -7963,
55  -10438, -11938,
56  -14833, -6658, 32058, 4020, 10461, 15159
57 };
58 
59 const word outData[N] =
60  { 80, 10848, 1888, -10288, 7616, 29712, 20480, -29216, -18944, -29808,
61  -32016, 1600, 15744, -3088, -17408, -22128, 6800, -13280, 3824, -16272,
62  -1568, -12528, -27104,
63  -192, -25584, 4704, -30432, 15264, -1392, 11424, 11376, 4992, 7872, -1904,
64  9120, -31728, -25232,
65  -14160, 17984, 32432, -12432, -15936, -21616, 7904, 1696, 28112, 3616,
66  22128, -5568, -20112,
67  12384, 9184, -24544, 12480, 21552, -17840, -13648, 20272, 9984, 17648,
68  -11456, -17328, -10544,
69  -27104, 208, 27616, 2512, 7168, -29728, -22448, 30032, -2368, 12816, 304,
70  -25552, 9088, 29024,
71  -6560, -20304, -14352, -7552, -21712, -3680, -30080, -3184, -30976, 8576,
72  27120, 3408, -4608,
73  -22304, -17136, 13792, -1088, -14624, 22064, -13552, 32640, 16688, -8480,
74  -12736, 10496, 20752,
75  6704, -26848, -31008, 3792, -19856, -20432, -30304, 32416, -13232, 9008,
76  18256, 2400, -8000,
77  -14832, -5856, 7120, 29824, -31888, 17952, 28832, -31296, 31824, -27504,
78  12272, -5584, -22112,
79  9200, -22544, 15680, -12272, 7216, -23744, -12848, -5856, 7520, 17344,
80  13776, -3088, -17808,
81  -9648, 26672, 7904, 2480, 3184, 29408, -20224, -2768, 24080, -7968, -10432,
82  -11936, -14832,
83  -6656, 32064, 4016, 10464, 15152
84 };
85 
86 const word outLARc[M] = { 32, 33, 22, 13, 7, 5, 3, 2 };
87 
88 
89 int
90 main ()
91 {
92  int i;
93  int main_result;
94  word so[N];
95  word LARc[M];
96  main_result = 0;
97 
98  for (i = 0; i < N; i++)
99  so[i] = inData[i];
100 
101  Gsm_LPC_Analysis (so, LARc);
102 
103  for (i = 0; i < N; i++)
104  main_result += (so[i] != outData[i]);
105  for (i = 0; i < M; i++)
106  main_result += (LARc[i] != outLARc[i]);
107 
108  printf ("%d\n", main_result);
109  return main_result;
110  }
#define N
Definition: gsm.c:29
int main_result
Definition: mips.c:38
const word outData[N]
Definition: gsm.c:59
#define M
Definition: gsm.c:30
const word outLARc[M]
Definition: gsm.c:86
short word
Definition: private.h:30
int main()
Definition: gsm.c:90
const word inData[N]
Definition: gsm.c:32
void Gsm_LPC_Analysis(word *s, word *LARc)
Definition: lpc.c:314

Generated on Mon Feb 12 2024 13:02:49 for PandA-2024.02 by doxygen 1.8.13