summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests
diff options
context:
space:
mode:
authorducky2017-11-03 18:34:46 -0700
committerRichard Lin2018-01-02 13:41:13 -0800
commit7c3c18de2ffd56af51b99030c7ae7d3a321aed5f (patch)
tree55bc9cbb4cf5a1ba6c2d3e4c57dd9e3b6367060c /src/test/scala/chiselTests
parentcb7fcd2b18135230dc40f3c7bb98685e7ffde9d5 (diff)
Autoclonetype initial prototype
Diffstat (limited to 'src/test/scala/chiselTests')
-rw-r--r--src/test/scala/chiselTests/AutoClonetypeSpec.scala34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/AutoClonetypeSpec.scala b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
new file mode 100644
index 00000000..93031c1c
--- /dev/null
+++ b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
@@ -0,0 +1,34 @@
+// See LICENSE for license details.
+
+package chiselTests
+
+import chisel3._
+
+import chisel3.testers.BasicTester
+
+class BundleWithIntArg(val i: Int) extends Bundle {
+ val out = Output(UInt(i.W))
+}
+
+class ModuleWithInner extends Module {
+ class InnerBundle(val i: Int) extends Bundle {
+ val out = Output(UInt(i.W))
+ }
+
+ val io = IO(new InnerBundle(14))
+ io.out := 1.U
+}
+
+
+class AutoClonetypeSpec extends ChiselFlatSpec {
+ "Bundles with Scala args" should "not need clonetype" in {
+ elaborate { new Module {
+ val io = IO(new BundleWithIntArg(8))
+ io.out := 1.U
+ } }
+ }
+
+ "Inner bundles with Scala args" should "not need clonetype" in {
+ elaborate { new ModuleWithInner }
+ }
+}