aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Lawson2019-02-21 12:43:19 -0800
committermergify[bot]2019-02-21 20:43:19 +0000
commitad0c4ce7afc9856c127031a582232330276bdafe (patch)
treeb63584fd24509ed3bbf769ebd3794f06c7a23c2d
parentb7d8744a4d799c09f86eee8876ff139afac6b688 (diff)
No time left for you - quickly rename deep bundles still occasionally fails. (#1025)
* No time left for you - quickly rename deep bundles still occasionally fails. Run the "quick" calibration test three times and choose the maximum as the basis for comparison with the "deep" test. * Rename local variable to less confusing name.
-rw-r--r--src/test/scala/firrtlTests/UniquifySpec.scala19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/test/scala/firrtlTests/UniquifySpec.scala b/src/test/scala/firrtlTests/UniquifySpec.scala
index 58290122..afb82384 100644
--- a/src/test/scala/firrtlTests/UniquifySpec.scala
+++ b/src/test/scala/firrtlTests/UniquifySpec.scala
@@ -294,12 +294,15 @@ class UniquifySpec extends FirrtlFlatSpec {
// Additionally, since executions times vary significantly under coverage testing, we check a global
// to see if timing measurements are accurate enough to enforce the timing checks.
val threshold = depth * 2.0
-
+ // As of 20-Feb-2019, this still fails occasionally:
+ // [info] 9038.99351 was not less than 6113.865 (UniquifySpec.scala:317)
+ // Run the "quick" test three times and choose the longest time as the basis.
+ val nCalibrationRuns = 3
def mkType(i: Int): String = {
if(i == 0) "UInt<8>" else s"{x: ${mkType(i - 1)}}"
}
- val (baseMs: Double, renameMs: Double) = {
- for (depth <- List(1, depth)) yield {
+ val timesMs = (
+ for (depth <- (List.fill(nCalibrationRuns)(1) :+ depth)) yield {
val input = s"""circuit Test:
| module Test :
| input in: ${mkType(depth)}
@@ -308,11 +311,11 @@ class UniquifySpec extends FirrtlFlatSpec {
|""".stripMargin
val (ms, _) = Utils.time(compileToVerilog(input))
ms
- }
- } match {
- case List(base, rename) => (base, rename)
- }
-
+ }
+ ).toArray
+ // The baseMs will be the maximum of the first calibration runs
+ val baseMs = timesMs.slice(0, nCalibrationRuns - 1).max
+ val renameMs = timesMs(nCalibrationRuns)
if (TestOptions.accurateTiming)
renameMs shouldBe < (baseMs * threshold)
}