@@ -32,13 +32,13 @@ class RoutesVec(singleElementWidth:Int) extends Record {
3232
3333class MockArray (width: Int , height: Int , singleElementWidth: Int ) extends Module {
3434 val io = IO (new Bundle {
35- val insLeft = Input (Vec (width , UInt (singleElementWidth.W )))
35+ val insLeft = Input (Vec (height , UInt (singleElementWidth.W )))
3636 val insUp = Input (Vec (width, UInt (singleElementWidth.W )))
37- val insRight = Input (Vec (width , UInt (singleElementWidth.W )))
37+ val insRight = Input (Vec (height , UInt (singleElementWidth.W )))
3838 val insDown = Input (Vec (width, UInt (singleElementWidth.W )))
39- val outsLeft = Output (Vec (width , UInt (singleElementWidth.W )))
39+ val outsLeft = Output (Vec (height , UInt (singleElementWidth.W )))
4040 val outsUp = Output (Vec (width, UInt (singleElementWidth.W )))
41- val outsRight = Output (Vec (width , UInt (singleElementWidth.W )))
41+ val outsRight = Output (Vec (height , UInt (singleElementWidth.W )))
4242 val outsDown = Output (Vec (width, UInt (singleElementWidth.W )))
4343
4444 val lsbs = Output (Vec (width * height, Bool ()))
@@ -67,8 +67,10 @@ class MockArray(width:Int, height:Int, singleElementWidth:Int) extends Module {
6767
6868 ces.foreach{row =>
6969 row.head.io.lsbIns := DontCare
70- row.sliding(2 , 1 ).foreach{pair =>
71- pair(1 ).io.lsbIns := pair(0 ).io.lsbOuts
70+ if (row.length > 1 ) {
71+ row.sliding(2 , 1 ).foreach{pair =>
72+ pair(1 ).io.lsbIns := pair(0 ).io.lsbOuts
73+ }
7274 }}
7375
7476 io.lsbs := ces.map(_.last.io.lsbOuts).flatten
0 commit comments