cucapra/dahlia

Multi-cycle binary operations emit incorrect `write_en` guard.

Closed this issue · 0 comments

When lowering a multiply to Calyx, we get a group such as the one below:

    group mult<"static"=1> {
      r.in = mult_pipe0.out;
      r.write_en = 1'd1;                     // <= This should only be high when the `mult_pipe` is done.
      mult[done] = bin_read0_0.done;
      mult_pipe0.left = v_0.out;
      mult_pipe0.right = d_0.out;
      mult_pipe0.go = !mult_pipe0.done ? 1'd1;
    }