X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=FFT_support.cpp;h=7fc2484be97043c091505e99354a165015e2e2a1;hb=00b2c5a7eced88e39b762255d361d61f78e2abe3;hp=23d07f08ca102e114e7428807701f364fcdcc566;hpb=a62dbd706365d44bdcac9f8ac4c7c6dd05484642;p=matthijs%2Fprojects%2Fmontium-fft.git diff --git a/FFT_support.cpp b/FFT_support.cpp index 23d07f0..7fc2484 100644 --- a/FFT_support.cpp +++ b/FFT_support.cpp @@ -2,12 +2,11 @@ #include #include - -/* Didn't the Montium use Q15 instead of Q14? */ +/* Use Q15 fixed point format (1 sign bit plus 15 fractional bits) */ #define FIXED_POINT 15 #define WORD_SIZE 16 -#define WORDS_PER_LINE 4 +#define WORDS_PER_LINE 8 #define WORDS_PER_GROUP 1 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; @@ -68,7 +67,9 @@ void pre_run() for (i=0;iid, 0, PARAM_N_t/2, "Memory/sin_a_re.mm"); + save_mem_range_to_file(input_a_im->id, 0, PARAM_N_t/2, "Memory/sin_a_im.mm"); + save_mem_range_to_file(input_b_re->id, 0, PARAM_N_t/2, "Memory/sin_b_re.mm"); + save_mem_range_to_file(input_b_im->id, 0, PARAM_N_t/2, "Memory/sin_b_im.mm"); + save_mem_range_to_file(twiddle_re->id, 0, PARAM_N_t/2, "Memory/twiddle_re.mm"); + save_mem_range_to_file(twiddle_im->id, 0, PARAM_N_t/2, "Memory/twiddle_im.mm"); } void post_run() { if (PARAM_n_t % 2 == 0) { - /* When the number of stages is odd, the + /* When the number of stages is even, the * outputs end up at the left memories again */ output_a_re = alloc_mem(P0M0); output_a_im = alloc_mem(P1M0); @@ -117,11 +126,18 @@ void post_run() output_b_re = alloc_mem(P2M1); output_b_im = alloc_mem(P3M1); } - printf("re(out_a)\n"); + printf("re(out)\n"); print_mem(output_a_re, 0, PARAM_N_t/2, true); print_mem(output_b_re, 0, PARAM_N_t/2, true); - printf("im(out_a)\n"); + printf("im(out)\n"); print_mem(output_a_im, 0, PARAM_N_t/2, true); print_mem(output_b_im, 0, PARAM_N_t/2, true); + + printf("re(out)\n"); + print_mem(output_a_re, 0, PARAM_N_t/2, false); + print_mem(output_b_re, 0, PARAM_N_t/2, false); + printf("im(out)\n"); + print_mem(output_a_im, 0, PARAM_N_t/2, false); + print_mem(output_b_im, 0, PARAM_N_t/2, false); }