我收到以下错误。但我无法从打印的错误消息中了解问题。
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
}
答案 0 :(得分:0)
问题的核心是你试图将一个Vec()分配给一个UInt()。那不行。类型不匹配。
但是还有其他一些问题。首先,您没有向我们显示行号,因此我们无法将错误与代码匹配。您也没有向我们展示deqWire的定义。那是什么类型的东西?
我也不确定你对fifoClass的习语。也许这有效,但我自己已经找到了成功
val my_array_of_modules = Vec.fill(num_elements) { Module (new Thing()).io }
但这可能不是问题。