[unittest] split out Config and TestHarness into separate files, minimize imports
This commit is contained in:
parent
245f8ab76b
commit
851a336db4
@ -5,42 +5,19 @@ package unittest
|
|||||||
import scala.collection.mutable.LinkedHashSet
|
import scala.collection.mutable.LinkedHashSet
|
||||||
|
|
||||||
import Chisel._
|
import Chisel._
|
||||||
import cde.{Parameters, Config, Knob, CDEMatchError}
|
import cde.{Parameters, Config, CDEMatchError}
|
||||||
import util.{ParameterizedBundle}
|
|
||||||
import rocket._
|
|
||||||
import uncore.tilelink._
|
|
||||||
import uncore.tilelink2.{LazyModule, LazyModuleImp}
|
|
||||||
import coreplex._
|
import coreplex._
|
||||||
import rocketchip._
|
import rocketchip._
|
||||||
import unittest._
|
|
||||||
|
|
||||||
class WithUnitTest extends Config(
|
class WithUnitTest extends Config(
|
||||||
(pname, site, here) => pname match {
|
(pname, site, here) => pname match {
|
||||||
case UnitTests => (testParams: Parameters) => {
|
case UnitTests => (testParams: Parameters) => {
|
||||||
val groundtest = if (site(XLen) == 64)
|
TestGeneration.addSuite(DefaultTestSuites.groundtest64("p")) // TODO why
|
||||||
DefaultTestSuites.groundtest64
|
|
||||||
else
|
|
||||||
DefaultTestSuites.groundtest32
|
|
||||||
TestGeneration.addSuite(groundtest("p"))
|
|
||||||
TestGeneration.addSuite(DefaultTestSuites.emptyBmarks)
|
TestGeneration.addSuite(DefaultTestSuites.emptyBmarks)
|
||||||
JunctionsUnitTests(testParams) ++ UncoreUnitTests(testParams)
|
JunctionsUnitTests(testParams) ++ UncoreUnitTests(testParams) // TODO refactor
|
||||||
}
|
}
|
||||||
case RegressionTestNames => LinkedHashSet("rv64ui-p-simple")
|
case RegressionTestNames => LinkedHashSet("rv64ui-p-simple")
|
||||||
case _ => throw new CDEMatchError
|
case _ => throw new CDEMatchError
|
||||||
})
|
})
|
||||||
|
|
||||||
class UnitTestConfig extends Config(new WithUnitTest ++ new BaseConfig)
|
class UnitTestConfig extends Config(new WithUnitTest ++ new BaseConfig)
|
||||||
|
|
||||||
class TestHarness(implicit val p: Parameters) extends Module {
|
|
||||||
val io = new Bundle {
|
|
||||||
val success = Bool(OUTPUT)
|
|
||||||
}
|
|
||||||
|
|
||||||
p(NCoreplexExtClients).assign(0)
|
|
||||||
p(ConfigString).assign("")
|
|
||||||
|
|
||||||
val l1params = p.alterPartial({ case TLId => "L1toL2" })
|
|
||||||
val tests = Module(new UnitTestSuite()(l1params))
|
|
||||||
|
|
||||||
io.success := tests.io.finished
|
|
||||||
}
|
|
||||||
|
21
src/main/scala/unittest/TestHarness.scala
Normal file
21
src/main/scala/unittest/TestHarness.scala
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
// See LICENSE for license details.
|
||||||
|
|
||||||
|
package unittest
|
||||||
|
|
||||||
|
import Chisel._
|
||||||
|
import cde.Parameters
|
||||||
|
import rocketchip._
|
||||||
|
|
||||||
|
class TestHarness(implicit val p: Parameters) extends Module {
|
||||||
|
val io = new Bundle {
|
||||||
|
val success = Bool(OUTPUT)
|
||||||
|
}
|
||||||
|
|
||||||
|
p(NCoreplexExtClients).assign(0)
|
||||||
|
p(ConfigString).assign("")
|
||||||
|
|
||||||
|
val l1params = p.alterPartial({ case uncore.tilelink.TLId => "L1toL2" })
|
||||||
|
val tests = Module(new UnitTestSuite()(l1params))
|
||||||
|
|
||||||
|
io.success := tests.io.finished
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user