0

I am getting the following error. but I am unable to understand the problem from the error messages printed.

run
[info] Running HyperCell.SwitchTopMain
[info] [0.340] // COMPILING < (class HyperCell.SwitchTop)>(9)
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
Re-running Chisel in debug mode to obtain erroneous line numbers...
[info] [1.120] // COMPILING < (class HyperCell.SwitchTop)>(9)
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2
[error] switchTop.scala:28: := not defined on class Chisel.UInt and class Chisel.Vec in class HyperCell.SwitchTop$$anonfun$2

The code that is generating this error is here

//One FIFO at each of the Output
    val fifoClass    = (0 until ports).map(x=>  { Module(new Fifo(0, widthParam, depthParam, ports))}).toList

    for(i<-0 until ports){
        deqWire(i)    := fifoClass(i).io.enqRdy
    }

    //Each iteration represents each FIFO at the output side
    for(i<-0 until ports){
        fifoClass(i).io.enqData    := switchClass.io.outPort(i)
        fifoClass(i).io.deqRdy        := deqWire
    }
dave_59
  • 39,096
  • 3
  • 24
  • 63
  • 3
    It's saying that this thing `:=` is not defined for the type Chisel.UInt. The message couldn't be more clearer. In fact it repeats it many times for you :) –  Sep 07 '15 at 13:28
  • 1
    No that I understood, but my exact question is why, how should I approach this if this is not possible. – Jayant Bedwal Sep 08 '15 at 05:21
  • Well you should know why you are writing the code that you are, unless this is just a copy and paste from somewhere else and you have no clue what you are copying and pasting. Without the definitions for your types we can't help. Post all your code with definitions and maybe you will get more help. –  Sep 08 '15 at 09:18
  • I suspect whoever wrote the code thinks `:=` is the assignment operator. It isn't, of course. – The Archetypal Paul Sep 11 '15 at 07:50
  • @TheArchetypalPaul It's a hardware design DSL embedded in Scala (chisel.eecs.berkeley.edu), so `:=` is an assignment operator in that language for describing assignments of hardware Nodes. – Chris Sep 15 '15 at 22:26
  • 1
    @Chris, ah, ok. Thanks – The Archetypal Paul Sep 16 '15 at 06:38

1 Answers1

0

The heart of the matter is you are trying to assign a Vec() to a UInt(). That's not going to work. The types don't match.


A couple of other issues though. First, you aren't showing us the line numbers so we can't match the error with the code. You also aren't showing us the definition of deqWire. What type of thing is that?

I'm also unsure of your idiom regarding fifoClass. Maybe that works, but I myself have found success with

val my_array_of_modules = Vec.fill(num_elements) { Module (new Thing()).io }

But that's probably not the issue.

Chris
  • 3,827
  • 22
  • 30