diff options
| author | Jack Koenig | 2020-08-13 21:30:55 -0700 |
|---|---|---|
| committer | GitHub | 2020-08-13 21:30:55 -0700 |
| commit | 6ea6f61aa9ed7fa572fb74641a6943a940bd6b82 (patch) | |
| tree | 6617414fb2fe5e721dc7ea8c9b226af419318d71 /src/test/scala/chiselTests | |
| parent | 22c92b97beb3711790ea035337345e6e688fcc55 (diff) | |
Move treadle dependency to the tests (#1554)
Use inheritance to make TesterDriver Backend API extensible, then define
a TreadleBackend in the test project
Diffstat (limited to 'src/test/scala/chiselTests')
| -rw-r--r-- | src/test/scala/chiselTests/ChiselSpec.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test/scala/chiselTests/ChiselSpec.scala b/src/test/scala/chiselTests/ChiselSpec.scala index e50f26e8..eb3ec3e6 100644 --- a/src/test/scala/chiselTests/ChiselSpec.scala +++ b/src/test/scala/chiselTests/ChiselSpec.scala @@ -10,7 +10,7 @@ import chisel3._ import chisel3.stage.{ChiselGeneratorAnnotation, ChiselStage} import chisel3.testers._ import firrtl.{AnnotationSeq, CommonOptions, EmittedVerilogCircuitAnnotation, ExecutionOptionsManager, FirrtlExecutionFailure, FirrtlExecutionSuccess, HasFirrtlOptions} -import firrtl.annotations.DeletedAnnotation +import firrtl.annotations.{Annotation, DeletedAnnotation} import firrtl.util.BackendCompilationUtilities import java.io.ByteArrayOutputStream import java.security.Permission @@ -26,7 +26,11 @@ trait ChiselRunners extends Assertions with BackendCompilationUtilities { additionalVResources: Seq[String] = Seq(), annotations: AnnotationSeq = Seq() ): Boolean = { - TesterDriver.execute(() => t, additionalVResources, annotations) + // Change this to enable Treadle as a backend + val defaultBackend = chisel3.testers.TesterDriver.defaultBackend + val hasBackend = TestUtils.containsBackend(annotations) + val annos: Seq[Annotation] = if (hasBackend) annotations else defaultBackend +: annotations + TesterDriver.execute(() => t, additionalVResources, annos) } def assertTesterPasses(t: => BasicTester, additionalVResources: Seq[String] = Seq(), |
