projects
/
matthijs
/
projects
/
montium-fft.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Add a missing ! in write_output_regular().
[matthijs/projects/montium-fft.git]
/
FFT.mc
diff --git
a/FFT.mc
b/FFT.mc
index 626b0dc51508f41d2eff5804bed7b8ac8f2537a7..6688275a9f32d7a7341ead36d3859efe18578e57 100644
(file)
--- a/
FFT.mc
+++ b/
FFT.mc
@@
-52,7
+52,7
@@
INLINE void write_output_regular(struct mems m, struct bf_out res, bool second_h
add_offset(m.output_b_re, 2);
\r
add_offset(m.output_b_im, 2);
\r
\r
add_offset(m.output_b_re, 2);
\r
add_offset(m.output_b_im, 2);
\r
\r
- if (second_half) {
\r
+ if (
!
second_half) {
\r
write_mem(m.output_a_re, res.a_re);
\r
write_mem(m.output_a_im, res.a_im);
\r
write_mem(m.output_b_re, res.b_re);
\r
write_mem(m.output_a_re, res.a_re);
\r
write_mem(m.output_a_im, res.a_im);
\r
write_mem(m.output_b_re, res.b_re);
\r
@@
-187,9
+187,9
@@
INLINE void do_half_regular_stage(struct mems m, bool stage_odd, bool second_hal
\r
/* Now, do half a single stage. That means N_t / 4 cycles. Since we do 2
\r
* cycles on every iteration, plus one before and after the loop,
\r
\r
/* Now, do half a single stage. That means N_t / 4 cycles. Since we do 2
\r
* cycles on every iteration, plus one before and after the loop,
\r
- * we will loop N_t / 8 - 1 times. */
\r
+ * we will loop N_t / 8 - 1 times.
We add an extra - 1 because this is a do while loop...
*/
\r
init_loop(LC2, (PARAM_N_t / 8) - 1);
\r
init_loop(LC2, (PARAM_N_t / 8) - 1);
\r
-
do
{
\r
+
while (loop_next(LC2))
{
\r
/* Write outputs of previous cycle */
\r
write_output_regular(m, out, second_half);
\r
\r
/* Write outputs of previous cycle */
\r
write_output_regular(m, out, second_half);
\r
\r
@@
-204,7
+204,7
@@
INLINE void do_half_regular_stage(struct mems m, bool stage_odd, bool second_hal
/* Even cycle */
\r
in = read_input_regular(m, EVEN_CYCLE, second_half);
\r
out = butterfly(in);
\r
/* Even cycle */
\r
in = read_input_regular(m, EVEN_CYCLE, second_half);
\r
out = butterfly(in);
\r
- }
while (loop_next(LC2));
\r
+ }
\r
\r
/* Write outputs of previous cycle */
\r
write_output_regular(m, out, second_half);
\r
\r
/* Write outputs of previous cycle */
\r
write_output_regular(m, out, second_half);
\r
@@
-256,7
+256,7
@@
void run() {
/* We need to do n_t regular stages. Since we do two stages each
\r
* iteration, we'll do n_t / 2 iterations. */
\r
init_loop(LC1, (PARAM_n_t / 2));
\r
/* We need to do n_t regular stages. Since we do two stages each
\r
* iteration, we'll do n_t / 2 iterations. */
\r
init_loop(LC1, (PARAM_n_t / 2));
\r
-
do
{
\r
+
while (loop_next(LC1))
{
\r
m = init_mem_mapping(EVEN_STAGE);
\r
init_input_addresses_regular(m, EVEN_STAGE);
\r
/* do_half_regular_stage will init output addresses */
\r
m = init_mem_mapping(EVEN_STAGE);
\r
init_input_addresses_regular(m, EVEN_STAGE);
\r
/* do_half_regular_stage will init output addresses */
\r
@@
-271,5
+271,5
@@
void run() {
do_half_regular_stage(m, ODD_STAGE, FIRST_HALF);
\r
do_half_regular_stage(m, ODD_STAGE, SECOND_HALF);
\r
stage++;
\r
do_half_regular_stage(m, ODD_STAGE, FIRST_HALF);
\r
do_half_regular_stage(m, ODD_STAGE, SECOND_HALF);
\r
stage++;
\r
- }
while (loop_next(LC1));
\r
+ }
\r
}
\r
}
\r