diff options
| author | Schuyler Eldridge | 2019-07-31 15:04:05 -0400 |
|---|---|---|
| committer | Schuyler Eldridge | 2019-07-31 15:53:26 -0400 |
| commit | 86b8e14f5f5dcb09546e4a7ff2b088e4109b0df9 (patch) | |
| tree | e7cba4ee10e6afac14951b8889f28250db34494e | |
| parent | d6bbbf664fa15e85132e33b42e64d4e37483a514 (diff) | |
Add VecLike deprecated compatibility tests
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
| -rw-r--r-- | src/test/scala/chiselTests/CompatibilitySpec.scala | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/CompatibilitySpec.scala b/src/test/scala/chiselTests/CompatibilitySpec.scala index 81c97ee9..11f44449 100644 --- a/src/test/scala/chiselTests/CompatibilitySpec.scala +++ b/src/test/scala/chiselTests/CompatibilitySpec.scala @@ -2,6 +2,8 @@ package chiselTests +import chisel3.testers.BasicTester + import org.scalacheck.Gen import org.scalatest.prop.GeneratorDrivenPropertyChecks @@ -503,4 +505,25 @@ class CompatibiltySpec extends ChiselFlatSpec with GeneratorDrivenPropertyChecks elaborate(new Foo) } + behavior of "Vec" + + it should "support legacy methods" in { + class Foo extends BasicTester { + val seq = Seq(Wire(UInt(0, width=4)), Wire(UInt(1, width=4)), Wire(UInt(2, width=4))) + val vec = Vec(seq) + + info("read works") + chisel3.assert(vec.read(UInt(0)) === UInt(0)) + + info("write works") + vec.write(UInt(1), UInt(3)) + chisel3.assert(vec.read(UInt(1)) === UInt(3)) + + val (_, done) = Counter(Bool(true), 4) + when (done) { stop } + } + + assertTesterPasses(new Foo) + } + } |
