Closed tampler closed 5 years ago
Can you share the definition of DspTester
?
My DSP Module definition is the following:
class Grid[A <: Data, B <: Data] (inType:A, outType:B, xlen:Int = 1, ylen:Int = 1)
extends Module with Common { ... }
Here's my GridTest.scala
package my_pkg
import chisel3._
import chisel3.iotesters.{ChiselFlatSpec, Driver, PeekPokeTester}
import Cfg._
// Unit Tester
class GridUnitTest [A <: Data, B <: Data](inType:A, outType:B)(c: Grid[A,B])
extends PeekPokeTester(c) {...}
// Top Tester
class GridTester[A <: Data, B <: Data] (inType:A, outType:B) extends ChiselFlatSpec {
private val backendNames = Array("verilator")
"using --backend-name verilator" should "be an alternative way to run using verilator" in {
if(backendNames.contains("verilator")) {
iotesters.Driver.execute(Array("--backend-name", "verilator"), () => new Grid(inType, outType)) {
c => new GridUnitTest(inType, outType)(c)
} should be(true)
}
}
}
// Top app
object GridMain extends App {
//iotesters.Driver.execute (args, () => new Grid(inType, outType)){
// c => new GridUnitTest(inType, outType)(c)
//}
iotesters.Driver.executeFirrtlRepl(args, () => new Grid(inType, outType))
}
If I remove parametrization, the test runs seamlessly. If I run this code, I get "No tests were executed" Any ideas ?
I'm not sure it's possible for ScalaTest classes to take parameters like (inType:A, outType:B)
.
You could try something like https://stackoverflow.com/questions/35433177/passing-additional-arguments-to-tests-with-scalatest to pass arguments from the command line if need be.
DspTools tester allows this kind of parametrization. I used it successfully in past. However, I'd like to avoid using DspTools in my project due to a poor tech support and a cumbersome student implementation.
Maybe should lift few constructs from there thou
Hello I'm trying to run a test for a parametrized top with the following:
testOnly my_pkg.DspTester -- -z verilator
This works fine for a non-parametrized top, like
Buf fails for
giving: No tests to run for Test / testOnly
My tester is
Using Chisel3 and FIRRTL from master and Chisel-Template with changes to the latest Scala and Chisel
PS: Using Chisel-Template only, NOT DspTools