summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRichard Lin2019-07-18 22:39:27 -0700
committerGitHub2019-07-18 22:39:27 -0700
commitaaf963f95bf1f4e9f3e5a8225925b4df7d01e795 (patch)
tree1121b2fbdcb8a22e23524e73c3211bd01df6a135 /src/test
parentae784b6e9dde1a5692b37067573cfddc164cdf26 (diff)
Support Analog DontCare bulk-connect (#1056)
Short-term patch to enable this useful behavior. In the future, we may want to rearchitect the type system and/or rethink the more edge-case connect behavior.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/chiselTests/AnalogSpec.scala23
-rw-r--r--src/test/scala/chiselTests/ChiselSpec.scala2
2 files changed, 24 insertions, 1 deletions
diff --git a/src/test/scala/chiselTests/AnalogSpec.scala b/src/test/scala/chiselTests/AnalogSpec.scala
index b262074c..c78c8c0e 100644
--- a/src/test/scala/chiselTests/AnalogSpec.scala
+++ b/src/test/scala/chiselTests/AnalogSpec.scala
@@ -169,6 +169,29 @@ class AnalogSpec extends ChiselFlatSpec {
wires(0) <> wires(2)
})
}
+ a [ChiselException] should be thrownBy {
+ elaborate(new Module {
+ val io = IO(new Bundle {})
+ val wires = List.fill(2)(Wire(Analog(32.W)))
+ wires(0) <> DontCare
+ wires(0) <> wires(1)
+ })
+ }
+ }
+
+ it should "allow DontCare connection" in {
+ elaborate(new Module {
+ val io = IO(new Bundle {
+ val a = Analog(1.W)
+ })
+ io.a := DontCare
+ })
+ elaborate(new Module {
+ val io = IO(new Bundle {
+ val a = Analog(1.W)
+ })
+ io.a <> DontCare
+ })
}
it should "work with 3 blackboxes attached" in {
diff --git a/src/test/scala/chiselTests/ChiselSpec.scala b/src/test/scala/chiselTests/ChiselSpec.scala
index 0a0eb3f0..5973cb63 100644
--- a/src/test/scala/chiselTests/ChiselSpec.scala
+++ b/src/test/scala/chiselTests/ChiselSpec.scala
@@ -147,7 +147,7 @@ class ChiselTestUtilitiesSpec extends ChiselFlatSpec {
class ChiselPropSpec extends PropSpec with ChiselRunners with PropertyChecks with Matchers {
// Constrain the default number of instances generated for every use of forAll.
- implicit override val generatorDrivenConfig =
+ implicit override val generatorDrivenConfig: PropertyCheckConfiguration =
PropertyCheckConfiguration(minSuccessful = 8, minSize = 1, sizeRange = 3)
// Generator for small positive integers.