Skip to content

Commit

Permalink
test: Simplify ImageTransfer test
Browse files Browse the repository at this point in the history
Due to DMA configurability and previously introduced inheritance,
the reflection is no longer needed for the test case.

Signed-off-by: Wiktoria Kuna <[email protected]>
  • Loading branch information
wkkuna committed Mar 19, 2024
1 parent 0c65c6e commit 186af33
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/test/scala/DMAController/ImageTransfer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SPDX-License-Identifier: Apache-2.0

package DMAController

import scala.reflect.runtime.universe._
import DMAController.Bfm.ChiselBfm
import DMAController.Worker.{InterruptBundle, SyncBundle}
import chiseltest.iotesters.PeekPokeTester
Expand All @@ -40,15 +39,14 @@ class ImageTransfer(dut: DMATop, dmaFull: DMAFull, dmaConfig: DMAConfig) extends
assert(cnt >= min)
}

val cls = runtimeMirror(getClass.getClassLoader).reflect(this)
val members = cls.symbol.typeSignature.members

def bfms = members.filter(_.typeSignature <:< typeOf[ChiselBfm])
val reader = dmaFull.reader
val writer = dmaFull.writer
val control = dmaFull.control

def stepSingle(): Unit = {
for(bfm <- bfms){
cls.reflectField(bfm.asTerm).get.asInstanceOf[ChiselBfm].update(cnt)
}
reader.update(cnt)
writer.update(cnt)
control.update(cnt)
super.step(1)
}

Expand All @@ -58,10 +56,6 @@ class ImageTransfer(dut: DMATop, dmaFull: DMAFull, dmaConfig: DMAConfig) extends
}
}

val reader = dmaFull.reader
val writer = dmaFull.writer
val control = dmaFull.control

reader.loadFromFile("./img0.rgba")
writer.loadFromFile("./img1.rgba")

Expand Down

0 comments on commit 186af33

Please sign in to comment.