ucb-bar / chisel2-deprecated

chisel.eecs.berkeley.edu
389 stars 89 forks source link

JVM stack overflow on illegal use of wire #530

Closed nyuichi closed 9 years ago

nyuichi commented 9 years ago

I wrote the following (illegal) code because I didn't figure out how to use wires and found that this causes java.lang.StackOverflowError. It should be better raising a saner error by checking if wires are properly declared and used.

class Foo extends Module {

  val io = new Bundle {
    val a = UInt(OUTPUT, width = 32)
  }

  val b = Reg(UInt(width = 32))

  val c = Reg(UInt(width = 32))

  val d = UInt(0, width = 32)

  d := b

  c := d

  io.a := c
}
da-steve101 commented 9 years ago

@ucbjrl it appears width_ = None for node d Should assigning to a literal be disallowed (I think so) or should the width be assigned? Perhaps both? Im surprised it isn't already defined if declared with UInt( width = ...), should it be?

ucbjrl commented 9 years ago

Closed by #557 at https://github.com/ucb-bar/chisel/commit/201c2ee9faefcdc79385dd393bef7c67abeadd1b