FFTLIB User Guide
c7504/FFTLIB_types.h
Go to the documentation of this file.
1 /******************************************************************************
2  * *
3  * module name :FFTLIB *
4  * *
5  * module descripton :Matrix Multiply Accelerator Library module for C7x+MMA *
6  * *
7  * Copyright (C) 2017-2018 Texas Instruments Incorporated - https://www.ti.com/ *
8  * ALL RIGHTS RESERVED *
9  * *
10  ******************************************************************************/
11 
23 #ifndef C7504_FFTLIB_TYPES_H_
24 #define C7504_FFTLIB_TYPES_H_ 1
25 
26 #include <c7x.h> // for streaming engine, streaming address gen.
27 //#include <c7x_scalable.h> // for device scalability
28 
29 //using namespace c7x;
30 
34 
35 
36 
37 #ifdef __cplusplus
38 #include <c7x_scalable.h> // for device scalability
39 
40 /******************************************************************************
41  *
42  * PREDEFINED VECTORS
43  *
44  ******************************************************************************/
45 
46 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_1;
47 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_2;
48 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_3;
49 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_4;
50 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_5;
51 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_6;
52 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_7;
53 
54 // permutation register values for 32-bit bias
55 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec0_32bit_No_1;
56 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec1_32bit_No_1;
57 
58 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec0_32bit_No_2;
59 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec1_32bit_No_2;
60 
61 
62 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec0_32bit_No_3;
63 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec1_32bit_No_3;
64 
65 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec0_32bit_No_4;
66 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec1_32bit_No_4;
67 
68 // permutation register values for 64-bit bias
69 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec0_64bit_No_1;
70 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec1_64bit_No_1;
71 
72 // split groups
73 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_1;
74 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_2;
75 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_3;
76 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_4;
77 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_5;
78 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_6;
79 extern const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_7;
80 
81 // permutation register values for 32-bit bias, split groups
84 
87 
90 
93 
94 
95 // permutation register values for 64-bit bias, split groups
98 
99 
100 extern "C" {
101 #endif /* __cplusplus */
102 
110 /* @{ */
111 
112 /*******************************************************************************
113  *
114  * TYPEDEFS
115  *
116  ******************************************************************************/
117 
120 typedef enum {
126 } FFTLIB_activation_type_e; // formerly eMMAActivationType;
127 
128 
130  typedef enum {
134 
136  typedef enum {
140 
143 
145  typedef enum {
150 
151  /*******************************************************************************
152  *
153  * DEFINES
154  *
155  ******************************************************************************/
156 
157 #define FFTLIB_BYTE_WIDTH 32
158 
159 
160 
161  /* ---------------------------------------------------------------- */
162  /* MISRAC Rule 4.9(DEFINE.FUNC) Deviation: The advisory is not */
163  /* being addressed */
164  /* ---------------------------------------------------------------- */
167  #define FFTLIB_CALC_STRIDE(BYTES, ALIGN_SHIFT) \
168  (((((BYTES)-1) >> (ALIGN_SHIFT)) + 1) << (ALIGN_SHIFT))
169 
171  #define FFTLIB_MMA_SIZE_8_BIT_SHIFT \
172  5
173  #define FFTLIB_MMA_SIZE_16_BIT_SHIFT \
174  4
175  #define FFTLIB_MMA_SIZE_32_BIT_SHIFT \
176  3
177 
179  //#define FFTLIB_MMA_SIZE_1_BYTE 1
180  #define FFTLIB_MMA_SIZE_8_BIT \
181  ((uint32_t)(((uint32_t)1) \
182  << FFTLIB_MMA_SIZE_8_BIT_SHIFT))
184  #define FFTLIB_MMA_SIZE_16_BIT \
185  ((uint32_t)(((uint32_t)1) \
186  << FFTLIB_MMA_SIZE_16_BIT_SHIFT))
188  #define FFTLIB_MMA_SIZE_32_BIT \
189  ((int32_t)(((uint32_t)1) \
190  << FFTLIB_MMA_SIZE_32_BIT_SHIFT))
192 
193  /* @} */
194 
195 /*******************************************************************************
196  *
197  * DEFINES
198  *
199  ******************************************************************************/
200 
201 
202 /*******************************************************************************
203  *
204  * Macros
205  *
206  ******************************************************************************/
207 
208 #ifdef __cplusplus
209 }
210 #endif /* __cplusplus */
211 #endif /* C7120_FFTLIB_TYPES_H_ */
212 
213 /* ======================================================================== */
214 /* End of file: FFTLIB_types.h */
215 /* ======================================================================== */
FFTLIB_quantMethod_type_e
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_1
const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec1_64bit_No_1
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_biasVec1_32bit_No_3
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_biasVec0_64bit_No_1
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_biasVec1_32bit_No_2
const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_5
const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_4
const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec1_32bit_No_1
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_3
const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_2
const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_6
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_7
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_biasVec1_32bit_No_4
const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec0_64bit_No_1
const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_7
const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec0_32bit_No_1
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_6
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_biasVec0_32bit_No_1
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_biasVec0_32bit_No_3
const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec0_32bit_No_3
const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec1_32bit_No_4
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_5
const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec0_32bit_No_4
const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec1_32bit_No_3
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_4
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_scale_No_2
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_biasVec0_32bit_No_4
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_biasVec0_32bit_No_2
const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_3
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_biasVec1_64bit_No_1
const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec0_32bit_No_2
const c7x::uchar_vec FFTLIB_vperm_convolve_col_biasVec1_32bit_No_2
const c7x::uchar_vec FFTLIB_vperm_convolve_col_scale_No_1
const c7x::uchar_vec FFTLIB_vperm_convolve_col_splitGroups_biasVec1_32bit_No_1
FFTLIB_enableDynamicRange_type_e
The enumeration of possible dynamic range enable settings.
FFTLIB_initDynamicRange_type_e
The enumeration of possible dynamic range reset options.
FFTLIB_enableDynamicRange_type_e FFTLIB_enableDynamicRange_type
Type for enableDynamicRange variables.
FFTLIB_quantMethod_type_e
The enumeration of possible quantization methods.
@ FFTLIB_QUANT_PER_KERNEL
@ FFTLIB_QUANT_PER_CHANNEL
FFTLIB_quantMethod_type_e FFTLIB_quantMethod_type
Type for initDynamicRange variables.
FFTLIB_enableDynamicRange_type_e
The enumeration of possible dynamic range enable settings.
@ FFTLIB_DYNAMIC_RANGE_DISABLE
Disable dynamic range computation.
@ FFTLIB_DYNAMIC_RANGE_ENABLE
Enable dynamic range computation.
FFTLIB_activation_type_e
The enumeration of possible activation operations on the computation.
@ FFTLIB_PSAT
Return result after parameterized saturation.
@ FFTLIB_RELU
Return result after applying ReLU operation.
@ FFTLIB_NONE
Return result as-is (allow wrapping)
@ FFTLIB_SATURATION
Return result after saturating.
@ FFTLIB_ROUNDING
Return result after rounding.
FFTLIB_initDynamicRange_type_e FFTLIB_initDynamicRange_type
Type for initDynamicRange variables.
FFTLIB_initDynamicRange_type_e
The enumeration of possible dynamic range reset options.
@ FFTLIB_DYNAMIC_RANGE_NOINIT
Do not reset dynamic range min/max at start of computation.
@ FFTLIB_DYNAMIC_RANGE_INIT
Reset dynamic range min/max at start of computation.