0

我收到以下错误。但我无法从打印的错误消息中理解问题。

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

产生此错误的代码在这里

//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
    }
4

1 回答 1

0

问题的核心是您试图将 Vec() 分配给 UInt()。那是行不通的。类型不匹配。


不过还有一些其他问题。首先,您没有向我们显示行号,因此我们无法将错误与代码匹配。您也没有向我们展示 deqWire 的定义。那是什么类型的东西?

我也不确定你关于 fifoClass 的成语。也许这行得通,但我自己已经找到了成功

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

但这可能不是问题。

于 2015-09-15T22:24:48.440 回答