1 /** \r
2 * @file fftc_test.h\r
3 *\r
4 * @brief \r
5 * Header file with data structures and definitions required for the FFTC \r
6 * driver testing.\r
7 * \r
8 * \par\r
9 * ============================================================================\r
10 * @n (C) Copyright 2009, Texas Instruments, Inc.\r
11 * \r
12 * Redistribution and use in source and binary forms, with or without \r
13 * modification, are permitted provided that the following conditions \r
14 * are met:\r
15 *\r
16 * Redistributions of source code must retain the above copyright \r
17 * notice, this list of conditions and the following disclaimer.\r
18 *\r
19 * Redistributions in binary form must reproduce the above copyright\r
20 * notice, this list of conditions and the following disclaimer in the \r
21 * documentation and/or other materials provided with the \r
22 * distribution.\r
23 *\r
24 * Neither the name of Texas Instruments Incorporated nor the names of\r
25 * its contributors may be used to endorse or promote products derived\r
26 * from this software without specific prior written permission.\r
27 *\r
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
39 *\r
40 */\r
41 \r
42 #ifndef _FFTC_TEST_H_\r
43 #define _FFTC_TEST_H_\r
44 \r
45 /* XDC types include */\r
46 #include <xdc/std.h>\r
47 \r
48 /* FFTC driver include */\r
49 #include <ti/drv/fftc/fftc.h>\r
50 \r
51 /* FFTC OSAL include */\r
52 #include <fftc_osal.h> \r
53 \r
54 /* Chip Level definitions include */\r
55 #include <ti/csl/csl_chip.h>\r
56 #include <ti/csl/csl_semAux.h>\r
57 \r
58 /* PSC CSL definitions include */\r
59 #include <ti/csl/csl_psc.h>\r
60 #include <ti/csl/csl_pscAux.h>\r
61 \r
62 /* BIOS include */\r
63 #include <ti/sysbios/BIOS.h>\r
64 \r
65 /* IPC includes */ \r
66 #include <ti/ipc/GateMP.h>\r
67 #include <ti/ipc/Ipc.h>\r
68 #include <ti/ipc/ListMP.h>\r
69 #include <ti/ipc/SharedRegion.h>\r
70 #include <ti/ipc/MultiProc.h>\r
71 #include <ti/sysbios/knl/Task.h>\r
72 #include <xdc/runtime/Error.h>\r
73 #include <ti/sysbios/family/c64p/Hwi.h>\r
74 #include <ti/sysbios/family/c64p/EventCombiner.h> \r
75 \r
76 /* Standard C includes */\r
77 #include <stdio.h>\r
78 #include <string.h>\r
79 \r
80 /** Number of monolithic descriptors used by the FFTC test */\r
81 #define FFTC_TEST_NUM_MONOLITHIC_DESC 32\r
82 \r
83 /** Monolithic descriptor size. \r
84 *\r
85 * Big enough to hold all the mandatory fields of the \r
86 * monolithic descriptor + data.\r
87 */\r
88 #define FFTC_TEST_SIZE_MONOLITHIC_DESC 1024 \r
89 \r
90 /** Number of host descriptors used by the FFTC test */\r
91 #define FFTC_TEST_NUM_HOST_DESC 32\r
92 \r
93 /** Host descriptor size. \r
94 *\r
95 * Big enough to hold the mandatory fields of the \r
96 * host descriptor and 16 bytes of PS info if needed.\r
97 * \r
98 * = 32 Host desc + 16 PS Info = 48 bytes\r
99 * Round it off to next multiple of 16 = 64 bytes\r
100 * \r
101 */\r
102 #define FFTC_TEST_SIZE_HOST_DESC 64 \r
103 \r
104 /** Size of each test sample in bytes \r
105 *\r
106 * = sizeof (Cplx16) = 4 bytes\r
107 */\r
108 #define FFTC_TEST_SAMPLE_SIZE 4\r
109 \r
110 #define NUM_TEST_PACKETS 10\r
111 \r
112 \r
113 #define NUM_CORES 4\r
114 #define SYS_INIT_CORE 0\r
115 #define FFTC_APP_SEM 9\r
116 \r
117 /** \r
118 * @brief Cplx16\r
119 *\r
120 * Structure to represent the FFT data input/\r
121 * output format.\r
122 */ \r
123 #ifndef xdc_target__bigEndian\r
124 typedef struct _Cplx16\r
125 {\r
126 /** Imaginary part of the FFT data */ \r
127 Int16 imag;\r
128 \r
129 /** Real part of the FFT data */ \r
130 Int16 real;\r
131 } Cplx16;\r
132 #else\r
133 typedef struct _Cplx16\r
134 {\r
135 /** Real part of the FFT data */ \r
136 Int16 real;\r
137 \r
138 /** Imaginary part of the FFT data */ \r
139 Int16 imag;\r
140 } Cplx16;\r
141 #endif\r
142 \r
143 /** \r
144 * @brief FFT_TestCfg\r
145 *\r
146 * Structure to hold the FFT test input vector,\r
147 * output vector.\r
148 */ \r
149 typedef struct _FFT_TestCfg\r
150 {\r
151 /** Number of FFT blocks in the test vector */ \r
152 UInt8 numBlocks;\r
153 \r
154 /** FFT configuration for the test */ \r
155 Fftc_QLocalCfg fftcQCfg;\r
156 \r
157 /** Number of input test samples */ \r
158 UInt32 numInputSamples [FFTC_MAX_NUM_BLOCKS];\r
159 \r
160 /** Input FFT test vector data */ \r
161 Cplx16* pFftInputData [FFTC_MAX_NUM_BLOCKS];\r
162 \r
163 /** Number of output test samples */ \r
164 UInt32 numOutputSamples [FFTC_MAX_NUM_BLOCKS];\r
165 \r
166 /** Expected Output FFT result data */ \r
167 Cplx16* pFftOutputData [FFTC_MAX_NUM_BLOCKS];\r
168 \r
169 /** Expected Clipping detect value */\r
170 UInt32 bClippingDetected [FFTC_MAX_NUM_BLOCKS];\r
171 \r
172 /** Expected Block exponent value */\r
173 UInt32 blockExpVal [FFTC_MAX_NUM_BLOCKS];\r
174 \r
175 /** Expected cycle count value */\r
176 UInt32 numClockCycles [FFTC_MAX_NUM_BLOCKS];\r
177 } FFT_TestCfg;\r
178 \r
179 Int32 Fftc_getDeviceAccumulatorConfig (UInt8 instNum,UInt8* pAccChannelNum,UInt32* pAccRxQNum);\r
180 Void init_done ();\r
181 Void wait_init_done ();\r
182 Int32 fftc_parse_testCfg (UInt32 testCaseId, FFT_TestCfg* pFFTTestCfg,Fftc_BlockInfo* pBlockInfo);\r
183 Int32 fftc_clean_testCfg (FFT_TestCfg* pFFTTestCfg,Fftc_BlockInfo* pBlockInfo);\r
184 Void test_fftc_lld();\r
185 Void test_host_singlecore (Fftc_DrvHandle);\r
186 Void test_mono_singlecore (Fftc_DrvHandle);\r
187 Void test_host_singlecore_psinfo (Fftc_DrvHandle);\r
188 Void test_mono_singlecore_psinfo (Fftc_DrvHandle);\r
189 Void test_host_singlecore_poll (Fftc_DrvHandle);\r
190 Void test_singlecore_dftlist (Fftc_DrvHandle);\r
191 Void test_singlecore_shift (Fftc_DrvHandle);\r
192 Void test_host_singlecore_queueshare (UInt8, Fftc_DrvHandle);\r
193 Void test_host_singlecore_flowshare (UInt8, Fftc_DrvHandle);\r
194 Void test_host_singlecore_multiInst (UInt8, Fftc_DrvHandle);\r
195 Void test_multicore (Fftc_DrvHandle);\r
196 \r
197 #endif /* _FFTC_TEST_H_ */\r
198 \r