Chisel 未绑定到凿子内存中的可合成节点异常

Chisel 未绑定到凿子内存中的可合成节点异常,chisel,Chisel,我在凿子代码中得到以下异常 [info] - should correctly write and read data *** FAILED *** [info] chisel3.core.Binding$BindingException: 'this' (chisel3.core.UInt@d7): Not bound to synthesizable node, currently only Type description [info] at chisel3.core.Bindin

我在凿子代码中得到以下异常

[info] - should correctly write and read data *** FAILED ***
[info]   chisel3.core.Binding$BindingException: 'this' (chisel3.core.UInt@d7): Not bound to synthesizable node, currently only Type description
[info]   at chisel3.core.Binding$.checkSynthesizable(Binding.scala:184)
[info]   at chisel3.core.Data.connect(Data.scala:139)
[info]   at chisel3.core.Data.$colon$eq(Data.scala:204)
[info]   at Common.OnChipMemory$$anonfun$1.apply(memory.scala:88)
[info]   at Common.OnChipMemory$$anonfun$1.apply(memory.scala:60)
[info]   at scala.collection.immutable.Range.foreach(Range.scala:166)
[info]   at Common.OnChipMemory.<init>(memory.scala:60)
[info]   at Common.memoryTester$$anonfun$3$$anonfun$apply$1$$anonfun$apply$mcV$sp$1.apply(memoryTest.scala:32)
[info]   at Common.memoryTester$$anonfun$3$$anonfun$apply$1$$anonfun$apply$mcV$sp$1.apply(memoryTest.scala:32)
[info]   at chisel3.core.Module$.do_apply(Module.scala:35)
这是问题的根源。紧跟在这之前的代码发布在下面

val lsb_idx = log2Up(4) // index of lsb in address

val chipMem = Mem(Vec(4, UInt(width = 8)), num_lines)   // memory

val data_idx = req_addr >> UInt(lsb_idx)    //req_addr is a UInt

val read_data = Bits()

从那以后,我一直没能找到问题的原因。我尝试将读取数据更改为UInt的Vec,并使用read()从内存中读取。

问题在于
读取数据的声明
Bits()
只是构造一个类型,而不是实际的硬件值。您需要将读取的数据设置为实际的
线路
,而不仅仅是位
类型。还要注意,
read_data
的类型需要与Mem的类型相同,因此您应该声明
read_data
,如下所示:

val read_data = Wire(Vec(4, UInt(8.W)) 
val read_data = Wire(Vec(4, UInt(8.W))