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

Banking Analyzer is Lying About Being Able to Bank This #273

Open
mattfel1 opened this issue Oct 16, 2019 · 0 comments
Open

Banking Analyzer is Lying About Being Able to Bank This #273

mattfel1 opened this issue Oct 16, 2019 · 0 comments

Comments

@mattfel1
Copy link
Member

This succeeds in the banking analyzer with only one duplicate, but it shouldn't! It is broadcasting incorrectly

@spatial class HowCanYouBank extends SpatialTest {
  override def compileArgs: Args = super.compileArgs and "--noBroadcast"
 def main(args: Array[String]): Unit = {
     type T = Int
     val N = ArgIn[Int]
     val np = 2
     val ep = 4
     val func: Idx => Int = {x => mux(random[Bit], 5.to[T], 10.to[T])}
     setArg(N, 888)
     Accel {
        val mem = SRAM[T](32,ep)
        Foreach(N by 1 par 1) { i =>
            Foreach(ep by 1 par 1) { j =>
                mem(i,j) = j
            }
        }
        Foreach(N by 1 par np) { i =>
           val a = func(i)
           val b = func(i)
           val slice = i % np
           Foreach(a by b par ep) { j =>
               val c = func(j)
               println(r"${mem(c,j)}")
           }
        }
     }

     assert(true)
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant