#include <cstdio>\r
#include <cmath>\r
\r
-\r
-/* Didn't the Montium use Q15 instead of Q14? */\r
+/* Use Q15 fixed point format (1 sign bit plus 15 fractional bits) */\r
#define FIXED_POINT 15\r
#define WORD_SIZE 16\r
\r
print_mem(input_a_re, 0, PARAM_N_t/2, true);\r
printf("re(in_b)\n");\r
print_mem(input_b_re, 0, PARAM_N_t/2, true);\r
+ \r
+/* Write out memory contents for use by the python simulator */\r
+ save_mem_range_to_file(input_a_re->id, 0, PARAM_N_t/2, "Memory/sin_a_re.mm");\r
+ save_mem_range_to_file(input_a_im->id, 0, PARAM_N_t/2, "Memory/sin_a_im.mm");\r
+ save_mem_range_to_file(input_b_re->id, 0, PARAM_N_t/2, "Memory/sin_b_re.mm");\r
+ save_mem_range_to_file(input_b_im->id, 0, PARAM_N_t/2, "Memory/sin_b_im.mm");\r
+ save_mem_range_to_file(twiddle_re->id, 0, PARAM_N_t/2, "Memory/twiddle_re.mm");\r
+ save_mem_range_to_file(twiddle_im->id, 0, PARAM_N_t/2, "Memory/twiddle_im.mm");\r
}\r
\r
void post_run()\r
{\r
if (PARAM_n_t % 2 == 0) {\r
- /* When the number of stages is odd, the \r
+ /* When the number of stages is even, the \r
* outputs end up at the left memories again */\r
output_a_re = alloc_mem(P0M0);\r
output_a_im = alloc_mem(P1M0);\r
printf("im(out)\n");\r
print_mem(output_a_im, 0, PARAM_N_t/2, true);\r
print_mem(output_b_im, 0, PARAM_N_t/2, true);\r
+ \r
+ printf("re(out)\n");\r
+ print_mem(output_a_re, 0, PARAM_N_t/2, false);\r
+ print_mem(output_b_re, 0, PARAM_N_t/2, false);\r
+ printf("im(out)\n");\r
+ print_mem(output_a_im, 0, PARAM_N_t/2, false);\r
+ print_mem(output_b_im, 0, PARAM_N_t/2, false);\r
\r
}\r