Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
Re-add -DwriteVcd=1 feature (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ducky64 authored Jan 15, 2020
1 parent 2b6cae0 commit 2f1cbae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/scala/chiseltest/ChiselScalatestTester.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import chisel3.MultiIOModule
import firrtl.AnnotationSeq
import org.scalatest._
import org.scalatest.exceptions.TestFailedException
import internal.WriteVcdAnnotation

import scala.util.DynamicVariable

Expand All @@ -18,7 +19,10 @@ trait ChiselScalatestTester extends Assertions with TestSuiteMixin with TestEnvI
}

def apply(testFn: T => Unit): Unit = {
val newAnnos = addDefaultTargetDir(getTestName, annotationSeq)
var newAnnos = addDefaultTargetDir(getTestName, annotationSeq)
if (scalaTestContext.value.get.configMap.contains("writeVcd")) {
newAnnos = newAnnos ++ Seq(WriteVcdAnnotation)
}
runTest(defaults.createDefaultTester(dutGen, newAnnos))(testFn)
}
// TODO: in the future, allow reset and re-use of a compiled design to avoid recompilation cost per test
Expand Down

0 comments on commit 2f1cbae

Please sign in to comment.