diff options
Diffstat (limited to 'no-plugin-tests/src')
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") +} |
