/
SynthUnitTests.scala
42 lines (34 loc) · 1.21 KB
/
SynthUnitTests.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// See LICENSE for license details.
package midas.unittest
import midas.core._
import chisel3._
import freechips.rocketchip.config.{Parameters, Config, Field}
import freechips.rocketchip.unittest.{UnitTests, TestHarness}
import midas.models.{CounterTableUnitTest, LatencyHistogramUnitTest, AddressRangeCounterUnitTest}
// Unittests
class WithAllUnitTests extends Config((site, here, up) => {
case UnitTests => (q: Parameters) => {
implicit val p = q
val timeout = 2000000
Seq(
Module(new PipeChannelUnitTest(latency = 0, timeout = timeout)),
Module(new PipeChannelUnitTest(latency = 1, timeout = timeout)),
Module(new ReadyValidChannelUnitTest(timeout = timeout)),
Module(new CounterTableUnitTest),
Module(new LatencyHistogramUnitTest),
Module(new AddressRangeCounterUnitTest)
)
}
})
// Failing tests
class WithTimeOutCheck extends Config((site, here, up) => {
case UnitTests => (q: Parameters) => {
implicit val p = q
Seq(
Module(new PipeChannelUnitTest(timeout = 100)),
)
}
})
// Complete configs
class AllUnitTests extends Config(new WithAllUnitTests ++ new midas.SimConfig)
class TimeOutCheck extends Config(new WithTimeOutCheck ++ new midas.SimConfig)