2

The chisel version I'm using is 3.2.2. When I try to create a Vec of member in a Bundle class, code is like,

class myIOBundle extends GenericParameterizedBundle {
  val en = Vec(4, Output(Bool()))
  val aa = Input(Vec(4, Bool()))  // Used in Debug.scala of rocket-chip
}

then I implement this Bundle class and pass it to IO of a Module class, the code is like,

class myModuleClass extends Module{
  val io = IO(new myIOBundle)
  ...
}

Then I got the error says :

[error] chisel3.package$RebindingException: Attempted reassignment of binding to UInt<3>(4)

But I see the same use of Vec in Debug.scala of rocket code. Is this error encoutered in old chisel version, not the chisel 3.4.3, since the rocket is using chisel 3.4.3?

hhhhy
  • 21
  • 2
  • 1
    I am unable to reproduce this issue in Chisel 3.2.2 so I believe the actual cause is something else not included in the code snippet (https://scastie.scala-lang.org/Y0IdvXGOQxGg0rwsAaisBA). I'll note that I had to not include `GenericParameterizedBundle`, but in this case, you don't need it either. – Jack Koenig Jan 27 '22 at 05:10
  • @JackKoenig Yes you are correct. This error is not related to chisel version. The root cause is that the Bundle have mixed-in a trait, and a enumeration is used in this trait for a FSM. (https://scastie.scala-lang.org/CJCksMSVRCO8Is5pxDL11A). If I remove this trait from the Bundle class, the code can be compiled correctly. :))) – hhhhy Jan 27 '22 at 07:47

0 Answers0