Skip to content

Commit 60137f7

Browse files
committed
mock-array: one multiplier per element, faster builds
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 3e491e3 commit 60137f7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/orfs/mock-array/src/main/scala/MockArray.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,23 @@ class MockArray(width: Int, height: Int, singleElementWidth: Int)
9898
// Registered routing paths
9999
// left <-> down
100100
// up <-> right
101-
(io.outs.asSeq zip (io.ins.asSeq ++ Seq(io.ins.asSeq.head))
101+
(io.outs.asSeq.zipWithIndex zip (io.ins.asSeq ++ Seq(io.ins.asSeq.head))
102102
.sliding(2)
103103
.toSeq
104104
.reverse
105-
.map(_.map(RegNext(_)))).foreach { case (a, b) =>
106-
a := RegNext({
105+
.map(_.map(RegNext(_)))).foreach { case ((a, i), b) =>
106+
a := RegNext(if (i == 0) {
107107
val mult = Module(new Multiplier())
108108
mult.io.a := b(0)
109109
mult.io.b := b(1)
110110
// save some area and complexity by not having reset
111111
mult.io.rst := false.B
112112
mult.io.clk := clock
113113
mult.io.o
114+
} else {
115+
// Only one multiplier, simple addition for the rest, faster
116+
// testing, less area
117+
b.reduce(_ + _)
114118
})
115119
}
116120

0 commit comments

Comments
 (0)