diff options
| author | Jack Koenig | 2021-02-11 18:12:48 -0800 |
|---|---|---|
| committer | Jack Koenig | 2021-03-12 16:16:45 -0800 |
| commit | 1494231212425fd09f915d819102ca5cdef0dfcf (patch) | |
| tree | 2828c723f881775bff0978592e07d3d52d78d4a9 /no-plugin-tests | |
| parent | e80e9a3ba775efd2121b17a39b6d712e1cf8fac2 (diff) | |
[plugin] Implement autoclonetype in the compiler plugin
Diffstat (limited to 'no-plugin-tests')
3 files changed, 57 insertions, 0 deletions
diff --git a/no-plugin-tests/src/test/scala/chiselTests/AutoClonetypeSpec.scala b/no-plugin-tests/src/test/scala/chiselTests/AutoClonetypeSpec.scala new file mode 120000 index 00000000..ae3a7597 --- /dev/null +++ b/no-plugin-tests/src/test/scala/chiselTests/AutoClonetypeSpec.scala @@ -0,0 +1 @@ +../../../../../src/test/scala/chiselTests/AutoClonetypeSpec.scala
\ No newline at end of file diff --git a/no-plugin-tests/src/test/scala/chiselTests/AutoNestedCloneSpec.scala b/no-plugin-tests/src/test/scala/chiselTests/AutoNestedCloneSpec.scala new file mode 120000 index 00000000..4ff3aa4f --- /dev/null +++ b/no-plugin-tests/src/test/scala/chiselTests/AutoNestedCloneSpec.scala @@ -0,0 +1 @@ +../../../../../src/test/scala/chiselTests/AutoNestedCloneSpec.scala
\ No newline at end of file diff --git a/no-plugin-tests/src/test/scala/chiselTests/MissingCloneBindingExceptionSpec.scala b/no-plugin-tests/src/test/scala/chiselTests/MissingCloneBindingExceptionSpec.scala new file mode 100644 index 00000000..28673495 --- /dev/null +++ b/no-plugin-tests/src/test/scala/chiselTests/MissingCloneBindingExceptionSpec.scala @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: Apache-2.0 + +package chiselTests +import Chisel.ChiselException +import chisel3.stage.ChiselStage +import org.scalatest._ +import org.scalatest.matchers.should.Matchers + +class MissingCloneBindingExceptionSpec extends ChiselFlatSpec with Matchers with Utils { + behavior of "missing cloneType in Chisel3" + ( the [ChiselException] thrownBy extractCause[ChiselException] { + import chisel3._ + + class Test extends Module { + class TestIO(w: Int) extends Bundle { + val a = Input(Vec(4, UInt(w.W))) + } + + val io = IO(new TestIO(32)) + } + + class TestTop extends Module { + val io = IO(new Bundle {}) + + val subs = VecInit(Seq.fill(2) { + Module(new Test).io + }) + } + + ChiselStage.elaborate(new TestTop) + }).getMessage should include("make all parameters immutable") + + behavior of "missing cloneType in Chisel2" + ( the [ChiselException] thrownBy extractCause[ChiselException] { + import Chisel._ + + class Test extends Module { + class TestIO(w: Int) extends Bundle { + val a = Vec(4, UInt(width = w)).asInput + } + + val io = IO(new TestIO(32)) + } + + class TestTop extends Module { + val io = IO(new Bundle {}) + + val subs = Vec.fill(2) { + Module(new Test).io + } + } + + ChiselStage.elaborate(new TestTop) + }).getMessage should include("make all parameters immutable") +} |
