diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/scala/chiselTests/AutoClonetypeSpec.scala | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/AutoClonetypeSpec.scala b/src/test/scala/chiselTests/AutoClonetypeSpec.scala index 0b02c3ab..59ce98b7 100644 --- a/src/test/scala/chiselTests/AutoClonetypeSpec.scala +++ b/src/test/scala/chiselTests/AutoClonetypeSpec.scala @@ -47,6 +47,15 @@ class ModuleWithInner extends Module { require(myWire.i == 14) } +object CompanionObjectWithBundle { + class ParameterizedInner(val i: Int) extends Bundle { + val data = UInt(i.W) + } + class Inner extends Bundle { + val data = UInt(8.W) + } +} + // 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 @@ -123,4 +132,18 @@ class AutoClonetypeSpec extends ChiselFlatSpec { io.y := 1.U } } } + + "Bundles inside companion objects" should "not need clonetype" in { + elaborate { new Module { + val io = IO(Output(new CompanionObjectWithBundle.Inner)) + io.data := 1.U + } } + } + + "Parameterized bundles inside companion objects" should "not need clonetype" in { + elaborate { new Module { + val io = IO(Output(new CompanionObjectWithBundle.ParameterizedInner(8))) + io.data := 1.U + } } + } } |
