#define WORDS_PER_LINE 4\r
#define WORDS_PER_GROUP 1\r
\r
-extern mem input_a_re, input_a_im, input_b_re, input_b_im, output_a_re, output_a_im, output_b_re, output_b_im, twiddle_re, twiddle_im; \r
-\r
-\r
+mem input_a_re, input_a_im, input_b_re, input_b_im, output_a_re, output_a_im, output_b_re, output_b_im, twiddle_re, twiddle_im; \r
\r
int to_fixed(float n)\r
{\r
void pre_run()\r
{\r
int i;\r
-\r
+ /* Assign memories, at least for the first stage */\r
+ input_a_re = alloc_mem(P0M0);\r
+ input_a_im = alloc_mem(P1M0);\r
+ input_b_re = alloc_mem(P2M0);\r
+ input_b_im = alloc_mem(P3M0);\r
+ output_a_re = alloc_mem(P0M1);\r
+ output_a_im = alloc_mem(P1M1);\r
+ output_b_re = alloc_mem(P2M1);\r
+ output_b_im = alloc_mem(P3M1);\r
+ \r
/* TODO: Init memory and twiddles */\r
for (i=0;i<SIZE/2;i++)\r
{\r
-/*\r
-int main() {\r
- init();\r
- pre_run();\r
- update_gpi();\r
- run();\r
- post_run();\r
- return 0;\r
-}(*/\r
#include "FFT.h"\r
\r
int main(int argc, char* argv[]) {\r
- //CCU ccu;\r
- //FileInputStream input(ccu, SI3, "input/input.bin");\r
- //FileOutputStream output(ccu, SO3, "output_exe/output.bin");\r
- //FFT fft(ccu);\r
- init();\r
+\r
pre_run();\r
set_gpi(0, 1);\r
run();\r