UnrollBank doesn't re-write same local variable names in different definitions.
Closed this issue · 0 comments
cgyurgyik commented
Given:
def A() = {
let k: ubit<2> = 0;
k := k + 1;
}
def B() = {
let k: ubit<2> = 0;
k := k + 1;
}
In the Lower unroll and bank pass
, we see the following name re-write:
def A() = {
let k_: ubit<2> = 0;
---
k_ := (k_ + 1);
}
def B() = {
let k: ubit<2> = 0; // <-- re-write never occurs.
---
k_ := (k_ + 1);
}
This results in:
[Type error] [Line 10, Column 3] `k_' is not bound in scope.
k_ := (k_ + 1);
^
Offending code (or at least part of it). My "hot" fix is removing the suffix.
dahlia/src/main/scala/passes/LowerUnroll.scala
Lines 485 to 486 in 275c620