diff options
| author | Richard Lin | 2018-02-02 23:30:56 -0800 |
|---|---|---|
| committer | GitHub | 2018-02-02 23:30:56 -0800 |
| commit | 1bfca502c69a26edca86d716a1ca9d24e6789e59 (patch) | |
| tree | a5c035ee45c3cd66e2d9b63c74aca75575f78f83 /src/test/scala/chiselTests | |
| parent | 639617ea42c777b8dd1f4300d42784e45f294d76 (diff) | |
Autoclonetype will clone args that are of type data (#768)
Diffstat (limited to 'src/test/scala/chiselTests')
| -rw-r--r-- | src/test/scala/chiselTests/AutoClonetypeSpec.scala | 11 |
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 + } } + } } |
