Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function calls stored in temporaries. #333

Open
cgyurgyik opened this issue Dec 2, 2020 · 0 comments
Open

Function calls stored in temporaries. #333

cgyurgyik opened this issue Dec 2, 2020 · 0 comments
Labels
Comp: Calyx Issue related to the Calyx backend

Comments

@cgyurgyik
Copy link
Member

See discussion and related issues below:
Yup, that makes sense. This is the problem mentioned in #264. Take a look at this group:

    group let0 {
      exp0.exponent = A_read0_0.out;
      exp0.go = !exp0.done ? 1'd1;

      div_pipe0.left = exp0.out; // ASSUMES exp0.out is done immediately
      div_pipe0.right = const1.out;
      div_pipe0.go = !div_pipe0.done ? 1'd1;

      bin_read0_0.in = div_pipe0.out;
      bin_read0_0.write_en = div_pipe0.done;

      let0[done] = bin_read0_0.done;
    }

The short term fix is to have the backend rewrite:

let x = exp(Res[0]) / 1;

into:

let _tmp = expr(Res[0]);
---
let x = _tmp / 1;

Open an issue in the Dahlia repo saying that function calls need to be stored in temporaries.

For you, the temporary fix is to manually rewrite the code to do this.

Originally posted by @rachitnigam in calyxir/calyx#284 (comment)

@rachitnigam rachitnigam added the Comp: Calyx Issue related to the Calyx backend label Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Comp: Calyx Issue related to the Calyx backend
Projects
None yet
Development

No branches or pull requests

2 participants