stanford-ppl / spatial

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

ScalaGen emitControlObject Mistake #89

Closed mattfel1 closed 6 years ago

mattfel1 commented 6 years ago

See SingleLayerConv_RCIO for an example. The ifThenElse node thinks that things defined inside of its scope are inputs to the kernel. I think it has something to do with binds not looking beyond the first layer?

    val ins    = func.flatMap(_.nestedInputs)
    val binds  = lhs.op.map{d => d.binds ++ d.blocks.map(_.result) }.getOrElse(Set.empty).toSeq
    val inputs = (lhs.op.map{_.inputs}.getOrElse(Nil) ++ ins).filterNot(_.isMem).distinct diff binds
dkoeplin commented 6 years ago

The culprit here was the SeriesForeach and Array[Map,Reduce,etc.] methods, none of which had the op binds fields properly defined.

dkoeplin commented 6 years ago

Fixed in e3d38a38ac9b7885f4c3e40026119acb3672753a