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

split views not lowered correctly #388

Open
rachitnigam opened this issue Feb 10, 2022 · 0 comments
Open

split views not lowered correctly #388

rachitnigam opened this issue Feb 10, 2022 · 0 comments
Labels
Comp: Calyx Issue related to the Calyx backend type: bug Bug in the compiler

Comments

@rachitnigam
Copy link
Member

The following program type checks and generates the expected output with the C++ backend:

decl out: ubit<32>[1];

let A: ubit<32>[4 bank 2];
split A_sp = A[by 2];

for (let i: ubit<3> = 0..2) {
  for (let j: ubit<3> = 0..2) unroll 2 {
    let t = A_sp[j][i];
  } combine {
    out[0] += t;
  }
}

However, with --lower, we get the cryptic error:

% ./fuse split.fuse --lower
[Type error] [Line 4, Column 14] `A' is not bound in scope.
split A_sp = A[by 2];

Using --pass-debug, we can see that Lower for loops doesn't handle split views:

...
let A0: ubit<32>[2];
let A1: ubit<32>[2];
split A_sp = A[by 2]; // <-- oops
...

It rewrites A to A0 and A1 but doesn't change the instances of A in the split view.

@rachitnigam rachitnigam added Comp: Calyx Issue related to the Calyx backend type: bug Bug in the compiler labels Feb 10, 2022
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 type: bug Bug in the compiler
Projects
None yet
Development

No branches or pull requests

1 participant