summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/chiselTests/AutoClonetypeSpec.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/AutoClonetypeSpec.scala b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
index 1170ed12..0b02c3ab 100644
--- a/src/test/scala/chiselTests/AutoClonetypeSpec.scala
+++ b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
@@ -47,6 +47,9 @@ class ModuleWithInner extends Module {
require(myWire.i == 14)
}
+// A Bundle with an argument that is also a field.
+// Not necessarily good style (and not necessarily recommended), but allowed to preserve compatibility.
+class BundleWithArgumentField(val x: Data, val y: Data) extends Bundle
class AutoClonetypeSpec extends ChiselFlatSpec {
"Bundles with Scala args" should "not need clonetype" in {
@@ -112,4 +115,12 @@ class AutoClonetypeSpec extends ChiselFlatSpec {
"Inner bundles with Scala args" should "not need clonetype" in {
elaborate { new ModuleWithInner }
}
+
+ "Bundles with arguments as fields" should "not need clonetype" in {
+ elaborate { new Module {
+ val io = IO(Output(new BundleWithArgumentField(UInt(8.W), UInt(8.W))))
+ io.x := 1.U
+ io.y := 1.U
+ } }
+ }
}