2017-01-28 5 views
3

チゼルコードで次の例外が発生します。私はライン、チゼルメモリで合成可能ノードの例外にバインドされていません

read_data := chipMem(data_idx) //line 88 

が問題を引き起こしていることを見つけることができるこのスタックトレースと、いくつかの試行錯誤の試験から

[info] - should correctly write and read data *** FAILED *** 
[info] chisel3.core.Binding$BindingException: 'this' ([email protected]): 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() 

その後、私は問題の原因を見つけることができませんでした。 read_dataをVecのUIntに変更し、read()を使ってメモリから読み込もうとしました。

答えて

3

問題はread_dataの宣言にあります。 Bits()は、実際のハードウェア値ではなくタイプを単純に構成します。 read_dataをBitsタイプの代わりに実際にWireにする必要があります。 read_dataのタイプはMemのタイプと同じである必要があることに注意してください。を次のように宣言する必要があります。

val read_data = Wire(Vec(4, UInt(8.W)) 
関連する問題