summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/Direction.scala
diff options
context:
space:
mode:
authormergify[bot]2022-11-08 17:27:07 +0000
committerGitHub2022-11-08 17:27:07 +0000
commitbfa9f7465e6069b1e624126f9e14245b69e7c0a9 (patch)
treee0aff2088021876ca9ab378fc2d321793937b791 /src/test/scala/chiselTests/Direction.scala
parentf2ef3a8ee378a307661bd598cd44d4b895b9352e (diff)
Switch to using experimental trait for OpaqueTypes (backport #2783) (#2836)
* Switch to using experimental trait for OpaqueTypes (#2783) This makes it more clear that the feature is experimental. Users may still override the opaqueType method for more dynamic control over when instances of a given Record are OpaqueTypes or not, but they are discouraged from doing so. (cherry picked from commit 7525dc71ccc2050d8e4a68b38f3b76920ba693fc) * Fix cloneType in RecordSpec Co-authored-by: Jack Koenig <koenig@sifive.com>
Diffstat (limited to 'src/test/scala/chiselTests/Direction.scala')
-rw-r--r--src/test/scala/chiselTests/Direction.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/scala/chiselTests/Direction.scala b/src/test/scala/chiselTests/Direction.scala
index 03755e83..642a507c 100644
--- a/src/test/scala/chiselTests/Direction.scala
+++ b/src/test/scala/chiselTests/Direction.scala
@@ -4,6 +4,7 @@ package chiselTests
import org.scalatest._
import chisel3._
+import chisel3.experimental.OpaqueType
import chisel3.stage.ChiselStage
import org.scalatest.matchers.should.Matchers
@@ -370,10 +371,9 @@ class DirectionSpec extends ChiselPropSpec with Matchers with Utils {
val valid = Bool()
val ready = Flipped(Bool())
}
- class MyOpaqueType extends Record {
+ class MyOpaqueType extends Record with OpaqueType {
val k = new Decoupled()
val elements = SeqMap("" -> k)
- override def opaqueType = elements.size == 1
override def cloneType: this.type = (new MyOpaqueType).asInstanceOf[this.type]
}
class MyModule extends RawModule {