diff options
| author | Jack Koenig | 2021-03-12 15:33:58 -0800 |
|---|---|---|
| committer | Jack Koenig | 2021-03-12 16:16:45 -0800 |
| commit | 3bea6167159737b379f37031c3beef27337be06d (patch) | |
| tree | 0d2df183b022697a496d58a3be13b85d141cf7fc /src/test | |
| parent | a8d32388ffa8c29a3b0f9e78ab6cd917b92954cd (diff) | |
[plugin] Disable BundleComponent by default, add option to enable
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/scala/chiselTests/AutoClonetypeSpec.scala | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/test/scala/chiselTests/AutoClonetypeSpec.scala b/src/test/scala/chiselTests/AutoClonetypeSpec.scala index a3da109a..a6e5562a 100644 --- a/src/test/scala/chiselTests/AutoClonetypeSpec.scala +++ b/src/test/scala/chiselTests/AutoClonetypeSpec.scala @@ -4,6 +4,7 @@ package chiselTests import chisel3._ import chisel3.testers.TestUtils +import chisel3.util.QueueIO class BundleWithIntArg(val i: Int) extends Bundle { val out = UInt(i.W) @@ -65,6 +66,11 @@ class NestedAnonymousBundle extends Bundle { // Not necessarily good style (and not necessarily recommended), but allowed to preserve compatibility. class BundleWithArgumentField(val x: Data, val y: Data) extends Bundle +// Needs to be top-level so that reflective autoclonetype works +class InheritingBundle extends QueueIO(UInt(8.W), 8) { + val error = Output(Bool()) +} + // TODO all `.suggestNames` are due to https://github.com/chipsalliance/chisel3/issues/1802 class AutoClonetypeSpec extends ChiselFlatSpec with Utils { val usingPlugin: Boolean = TestUtils.usingPlugin @@ -253,10 +259,21 @@ class AutoClonetypeSpec extends ChiselFlatSpec with Utils { elaborate(new MyModule(3)) } + behavior of "Compiler Plugin Autoclonetype" + + // Necessary test for 3.4.x, but we will break this (for non-plugin users) in 3.5 + it should "NOT break code that extends chisel3.util Bundles (whether they use the plugin or not)" in { + class MyModule extends MultiIOModule { + val io = IO(new InheritingBundle) + io.deq <> io.enq + io.count := 0.U + io.error := true.B + } + elaborate(new MyModule) + } + // New tests from the plugin if (usingPlugin) { - behavior of "Compiler Plugin Autoclonetype" - it should "support Bundles with non-val parameters" in { class MyBundle(i: Int) extends Bundle { val foo = UInt(i.W) |
