stanford-ppl / spatial

Spatial: "Specify Parameterized Accelerators Through Inordinately Abstract Language"
https://spatial.stanford.edu
MIT License
274 stars 32 forks source link

Buffer Recompute After Unrolling #86

Closed mattfel1 closed 6 years ago

mattfel1 commented 6 years ago

Sometimes the buffer info is wrong after unrolling, in a case like:

Foreach(N by 1){i => 
  Foreach(0 until 1 by 1){j =>
    ... = mux(j == 0, ..., mem(i)
  }
  Pipe{mem(i) = ...}
}
... = mem(i)

mem will get double buffered before unrolling but then the mux will be deleted when the Foreach turns into a unit pipe

This partially or fully accounts for the bug mentioned in #84