PandA-2024.02
cordic.h
Go to the documentation of this file.
1 /* Originally written by Alex Paek. Then modified by Daniele Bagni */
2 
3 #ifndef CORDIC_H_
4 #define CORDIC_H_
5 
6 // LEGENDA: 4 possible implementations:
7 // 1)
8 // #define DB_DOUBLE_PRECISION //DB: solution1_double
9 //
10 // 2)
11 // #define DB_SINGLE_PRECISION //DB: solution1_float
12 //
13 // 3)
14 // #define DB_CORDIC //DB: solution1_cordic
15 //
16 // 4)
17 // #define DB_CORDIC //DB: solution2_cordic_bitaccurate
18 // #define BIT_ACCURATE
19 
20 
21 
22 #if defined(DB_DOUBLE_PRECISION)
23 
24 typedef double coord_t;
25 typedef double phase_t;
26 typedef unsigned char uint6_t;
27 
28 #elif defined(DB_SINGLE_PRECISION)
29 
30 typedef float coord_t;
31 typedef float phase_t;
32 typedef unsigned char uint6_t;
33 
34 #elif defined(DB_CORDIC)
35 
36 #include <ap_int.h>
37 #include <ap_fixed.h>
38 
39 typedef ap_fixed<18,9> coord_t;
40 typedef ap_fixed<16,4> phase_t;
41 typedef ap_uint<6> uint6_t;
42 
43 #else
44 
45 #error <UNDEFINED ATAN2 METHOD!>
46 
47 #endif
48 
49 #include <math.h>
50 
51 
52 #define ROT 8
53 #define SCALE 10
54 
55 
56 void top_atan2 (coord_t y0, coord_t x0, phase_t *zn);
57 
58 #endif
void top_atan2(coord_t y0, coord_t x0, phase_t *zn)

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