stanford-ppl / spatial-lang

Spatial: "Specify Parameterized Accelerators Through Inordinately Abstract Language"
MIT License
100 stars 12 forks source link

Chisel file splitting bug #198

Closed dkoeplin closed 7 years ago

dkoeplin commented 7 years ago
object ManyInts extends SpatialApp {
  val N = 200
  type R = Int
  type T = Int
  def f(x: Int, y: Int): Int = x | y

  @virtualize def main(): Unit = {
    val outs = List.fill(N)(ArgOut[R])
    val insA = List.fill(N)(ArgIn[T])
    val insB = List.fill(N)(ArgIn[T])

    (insA:::insB).foreach(setArg(_, zero[T]))

    Accel {
      (insA, insB, outs).zipped.foreach { case (inA, inB, out) =>
        out := f(inA.value, inB.value)
      }
    }
  }
}

This compiles and everything looks good when N = 200. If you set N = 300 or higher, though, it appears to not generate the split file GlobalWires properly. Specifically, the line declaring the trait is missing in GlobalWires_1.scala, and only the body of the trait and the closing bracket is generated.

mattfel1 commented 7 years ago

should be fixed now on develop