2016-09-15 03:10:21 +02:00
|
|
|
// See LICENSE for license details.
|
|
|
|
|
2016-09-15 22:04:01 +02:00
|
|
|
package unittest
|
2016-09-15 03:10:21 +02:00
|
|
|
|
|
|
|
import scala.collection.mutable.LinkedHashSet
|
|
|
|
|
|
|
|
import Chisel._
|
2016-09-15 22:04:01 +02:00
|
|
|
import cde.{Parameters, Config, Knob, CDEMatchError}
|
2016-09-15 03:10:21 +02:00
|
|
|
import util.{ParameterizedBundle}
|
|
|
|
import rocket._
|
|
|
|
import uncore.tilelink._
|
|
|
|
import uncore.tilelink2.{LazyModule, LazyModuleImp}
|
|
|
|
import coreplex._
|
|
|
|
import rocketchip._
|
|
|
|
import unittest._
|
|
|
|
|
|
|
|
class WithUnitTest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case UnitTests => (testParams: Parameters) => {
|
|
|
|
val groundtest = if (site(XLen) == 64)
|
|
|
|
DefaultTestSuites.groundtest64
|
|
|
|
else
|
|
|
|
DefaultTestSuites.groundtest32
|
|
|
|
TestGeneration.addSuite(groundtest("p"))
|
|
|
|
TestGeneration.addSuite(DefaultTestSuites.emptyBmarks)
|
|
|
|
JunctionsUnitTests(testParams) ++ UncoreUnitTests(testParams)
|
|
|
|
}
|
|
|
|
case RegressionTestNames => LinkedHashSet("rv64ui-p-simple")
|
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
})
|
|
|
|
|
|
|
|
class UnitTestConfig extends Config(new WithUnitTest ++ new BaseConfig)
|
|
|
|
|
2016-09-15 20:48:09 +02:00
|
|
|
class TestHarness(implicit val p: Parameters) extends Module {
|
2016-09-15 03:10:21 +02:00
|
|
|
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
|
|
|
|
}
|