summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/AnalogSpec.scala
diff options
context:
space:
mode:
authorchick2019-12-17 13:26:08 -0800
committerchick2020-06-29 10:22:11 -0700
commit0a17d89fe76c11efadc3d0f90dc1d93a690d861a (patch)
treea4cfb7c210767a315473014ecd600e9857d1799f /src/test/scala/chiselTests/AnalogSpec.scala
parenta1edc8f4cd525c8475e847ff7ddd9cb8fc1d3c51 (diff)
This adds a mechanism for the unittests to be run with the TreadleBackend
This mechanism is not enabled and should not change the behavior of existing tests A following PR will deliver a switch that will allow changing the backend. The reasons for this PR - Treadle tests run much faster, enabling quicker debugging and CI cycles - This will help ensure fidelity of Treadle to the Verilator backend A few tests are marked as verilator only due to black box limitations Change treadle to a direct dependency I tried to make it a test only dependency but the TesterDriver sits in src/main requiring that regular compile have access to treadle Oops, made treadle the default A number of changes in response to @ducky64 review - made backend check clearer and add error handling for multiple backends specified - Fixed duplicate TargetDirAnnotation uses in Treadle backend - Cleaned up BlackBox test formatting - Undid unnecessary debugging changes from Counter - Undid .gitignore change, that should be on another PR A number of changes in response to @ducky64 review - Undid debugging changes made to BitWiseOps
Diffstat (limited to 'src/test/scala/chiselTests/AnalogSpec.scala')
-rw-r--r--src/test/scala/chiselTests/AnalogSpec.scala20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/scala/chiselTests/AnalogSpec.scala b/src/test/scala/chiselTests/AnalogSpec.scala
index 7fca6b7b..1ae64d07 100644
--- a/src/test/scala/chiselTests/AnalogSpec.scala
+++ b/src/test/scala/chiselTests/AnalogSpec.scala
@@ -5,8 +5,8 @@ package chiselTests
import chisel3._
import chisel3.stage.ChiselStage
import chisel3.util._
-import chisel3.testers.BasicTester
-import chisel3.experimental.{Analog, attach, BaseModule}
+import chisel3.testers.{BasicTester, TesterDriver}
+import chisel3.experimental.{Analog, BaseModule, attach}
// IO for Modules that just connect bus to out
class AnalogReaderIO extends Bundle {
@@ -158,7 +158,7 @@ class AnalogSpec extends ChiselFlatSpec with Utils {
val mod = Module(new AnalogReaderBlackBox)
mod.io.bus <> writer.io.bus
check(mod)
- }, Seq("/chisel3/AnalogBlackBox.v"))
+ }, Seq("/chisel3/AnalogBlackBox.v"), TesterDriver.verilatorOnly)
}
it should "error if any bulk connected more than once" in {
@@ -221,7 +221,7 @@ class AnalogSpec extends ChiselFlatSpec with Utils {
val mods = Seq.fill(2)(Module(new AnalogReaderBlackBox))
attach(writer.io.bus, mods(0).io.bus, mods(1).io.bus)
mods.foreach(check(_))
- }, Seq("/chisel3/AnalogBlackBox.v"))
+ }, Seq("/chisel3/AnalogBlackBox.v"), TesterDriver.verilatorOnly)
}
it should "work with 3 blackboxes separately attached via a wire" in {
@@ -232,7 +232,7 @@ class AnalogSpec extends ChiselFlatSpec with Utils {
attach(busWire, mods(0).io.bus)
attach(mods(1).io.bus, busWire)
mods.foreach(check(_))
- }, Seq("/chisel3/AnalogBlackBox.v"))
+ }, Seq("/chisel3/AnalogBlackBox.v"), TesterDriver.verilatorOnly)
}
// This does not currently work in Verilator unless Firrtl does constant prop and dead code
@@ -245,7 +245,7 @@ class AnalogSpec extends ChiselFlatSpec with Utils {
attach(busWire(1), mod.io.bus)
attach(busWire(0), busWire(1))
check(mod)
- }, Seq("/chisel3/AnalogBlackBox.v"))
+ }, Seq("/chisel3/AnalogBlackBox.v"), TesterDriver.verilatorOnly)
}
it should "work with blackboxes at different levels of the module hierarchy" in {
@@ -254,7 +254,7 @@ class AnalogSpec extends ChiselFlatSpec with Utils {
val busWire = Wire(writer.io.bus.cloneType)
attach(writer.io.bus, mods(0).bus, mods(1).bus)
mods.foreach(check(_))
- }, Seq("/chisel3/AnalogBlackBox.v"))
+ }, Seq("/chisel3/AnalogBlackBox.v"), TesterDriver.verilatorOnly)
}
// This does not currently work in Verilator, but does work in VCS
@@ -265,7 +265,7 @@ class AnalogSpec extends ChiselFlatSpec with Utils {
connector.io.bus1 <> writer.io.bus
reader.io.bus <> connector.io.bus2
check(reader)
- }, Seq("/chisel3/AnalogBlackBox.v"))
+ }, Seq("/chisel3/AnalogBlackBox.v"), TesterDriver.verilatorOnly)
}
it should "NOT support conditional connection of analog types" in {
@@ -285,7 +285,7 @@ class AnalogSpec extends ChiselFlatSpec with Utils {
val mod = Module(new VecAnalogReaderWrapper)
mod.bus <> writer.io.bus
check(mod)
- }, Seq("/chisel3/AnalogBlackBox.v"))
+ }, Seq("/chisel3/AnalogBlackBox.v"), TesterDriver.verilatorOnly)
}
it should "work with Vecs of Bundles of Analog" in {
@@ -293,6 +293,6 @@ class AnalogSpec extends ChiselFlatSpec with Utils {
val mod = Module(new VecBundleAnalogReaderWrapper)
mod.bus <> writer.io.bus
check(mod)
- }, Seq("/chisel3/AnalogBlackBox.v"))
+ }, Seq("/chisel3/AnalogBlackBox.v"), TesterDriver.verilatorOnly)
}
}