diff options
| author | grebe | 2016-12-22 15:01:48 -0500 |
|---|---|---|
| committer | GitHub | 2016-12-22 15:01:48 -0500 |
| commit | 33854075e4c50995d0011f773813571535a830fa (patch) | |
| tree | 56bb7e5ad2111ae3cb3c5f6dbf0a1a65f878a674 /src | |
| parent | 033e71a69767664c4bfae246d6cef2e2880c4404 (diff) | |
| parent | 4eebd787312792f7a3722af61ab7e6349081d3b4 (diff) | |
Merge branch 'master' into fixedPointFromBits
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/scala/chiselTests/MissingCloneBindingExceptionSpec.scala | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/MissingCloneBindingExceptionSpec.scala b/src/test/scala/chiselTests/MissingCloneBindingExceptionSpec.scala new file mode 100644 index 00000000..719484ac --- /dev/null +++ b/src/test/scala/chiselTests/MissingCloneBindingExceptionSpec.scala @@ -0,0 +1,57 @@ +// See LICENSE for license details. + +package chiselTests +import Chisel.ChiselException +import org.scalatest._ + +class MissingCloneBindingExceptionSpec extends ChiselFlatSpec with Matchers { + behavior of "missing cloneType in Chisel3" + ( the[ChiselException] thrownBy { + import chisel3._ + + class TestIO(w: Int) extends Bundle { + val a = Vec(4, UInt(width = w)).asInput + + //override def cloneType = (new TestIO(w)).asInstanceOf[this.type] + } + + class Test extends Module { + val io = IO(new TestIO(32)) + } + + class TestTop extends Module { + val io = IO(new Bundle {}) + + val subs = Vec.fill(2) { + Module(new Test).io + } + } + + elaborate(new TestTop) + }).getMessage should include("needs cloneType method") + + behavior of "missing cloneType in Chisel2" + ( the[ChiselException] thrownBy { + import Chisel._ + + class TestIO(w: Int) extends Bundle { + val a = Vec(4, UInt(width = w)).asInput + + //override def cloneType = (new TestIO(w)).asInstanceOf[this.type] + } + + class Test extends Module { + val io = IO(new TestIO(32)) + } + + class TestTop extends Module { + val io = IO(new Bundle {}) + + val subs = Vec.fill(2) { + Module(new Test).io + } + } + + elaborate(new TestTop) + }).getMessage should include("needs cloneType method") +} |
