Update to odulow per maintenance bronze
[o-du/phy.git] / fhi_lib / test / common / common_typedef_xran.h
1 /*******************************************************************************
2 *
3 * <COPYRIGHT_TAG>
4 *
5 *******************************************************************************/
6 /*! \file common_typedef_xran.h
7     \brief  This header file defines those data type both used by eNB and UE.
8 */
9
10 #ifndef _COMMON_TYPEDEF_XRAN_H_
11 #define _COMMON_TYPEDEF_XRAN_H_
12
13 #include <stdint.h>
14
15 #include <stdio.h>
16 #include <stdbool.h>
17
18 /*!
19     \struct COMPLEX32
20     \brief Defines 64-bit complex structure; both real part and image part have 32 bit width.
21 */
22 typedef struct {
23     float re; /*!< 32-bit real part */
24     float im; /*!< 32-bit image part */
25 } COMPLEX32;
26
27 //! @{
28 /*!
29     \struct complex_int16_t
30     \brief Defines 32-bit complex structure; both real part and image part have 16 bit width.
31     \brief Same defines as COMPLEX16
32 */
33 typedef struct {
34     int16_t re; /*!< 16-bit real part */
35     int16_t im; /*!< 16-bit image part */
36 }complex_int16_t,COMPLEX16;
37 //! @}
38
39 /*!
40     \struct complex_int32_t
41     \brief Defines 64-bit complex structure; both real part and image part have 32 bit width.
42 */
43 typedef struct {
44     int32_t re; /*!< 32-bit real part */
45     int32_t im; /*!< 32-bit image part */
46 }complex_int32_t;
47
48 /*!
49     \struct complex_float
50     \brief Defines 64-bit complex structure; both real part and image part have 32 bit width.
51 */
52 typedef struct {
53     float re; /*!< 32-bit real part */
54     float im; /*!< 32-bit image part */
55 }complex_float;
56
57 /*!
58     \struct complex_double
59     \brief Defines 128-bit complex structure; both real part and image part have 64 bit width.
60 */
61 typedef struct {
62     double re; /*!< 64-bit real part */
63     double im; /*!< 64-bit image part */
64 }complex_double;
65
66 /*!
67     \typedef half
68     \brief half is a 16-bit IEEE floating-point standard number format.
69     \note In future this will be known as `short float' or `__fp16'.
70     \note Older compilers must provide proxy support for it as a plain 16-bit integer
71 */
72 typedef int16_t half;
73
74 /*!
75     \struct complex_half
76     \brief Defines 32-bit complex structure; both real part and image part have 16 bit width.
77 */
78 typedef struct {
79     half re; /*!< 16-bit real part */
80     half im; /*!< 16-bit image part */
81 }complex_half;
82
83 /*!
84     \enum instruction_cpu_support
85     \brief Define instruction the CPU can support.
86 */
87 typedef enum{
88     CPU_GENERIC, /*!< C */
89     SSE4_2,      /*!< SSE4_2 */
90     AVX,         /*!< AVX */
91     AVX2,        /*!< AVX2 */
92     AVX_512,     /*!< AVX512 */
93 }instruction_cpu_support;
94
95 /*!
96     \enum bblib_modulation_order
97     \brief Common enums for modulation order.
98 */
99 enum bblib_modulation_order {
100     BBLIB_BPSK   = 1, /*!< BPSK */
101     BBLIB_QPSK   = 2, /*!< QPSK */
102     BBLIB_PAM4   = 3, /*!< PAM4 */
103     BBLIB_QAM16  = 4, /*!< QAM16 */
104     BBLIB_PAM8   = 5, /*!< PAM8 */
105     BBLIB_QAM64  = 6, /*!< QAM64 */
106     BBLIB_PAM16  = 7, /*!< PAM16 */
107     BBLIB_QAM256 = 8  /*!< QAM256 */
108 };
109
110
111 #ifdef _WIN64
112 #define __align(x) __declspec(align(x))
113 #else
114 #define __align(x) __attribute__((aligned(x)))
115 #define _aligned_malloc(x,y) memalign(y,x)
116 #endif
117
118 /* Test time and loops for unit test */
119 #define TIME 40
120 #define LOOP 30
121
122 #endif /* #ifndef _COMMON_TYPEDEF_H_ */
123