diff options
| author | Adam Izraelevitz | 2020-01-17 15:52:57 -0800 |
|---|---|---|
| committer | mergify[bot] | 2020-01-17 23:52:57 +0000 |
| commit | 0a98a82c588882eb2905a5564792670c2cfaf858 (patch) | |
| tree | 651d48f9162f53046b1ae8495d1fd0c3ef49c6ea /src/test | |
| parent | d4300b9deae6dde7ce0f314ea73a9ca4a1c3868c (diff) | |
Bugfix: Select.instances now works with blackboxes (#1303)
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/scala/chiselTests/aop/SelectSpec.scala | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/test/scala/chiselTests/aop/SelectSpec.scala b/src/test/scala/chiselTests/aop/SelectSpec.scala index f3c756ab..80ab518f 100644 --- a/src/test/scala/chiselTests/aop/SelectSpec.scala +++ b/src/test/scala/chiselTests/aop/SelectSpec.scala @@ -7,7 +7,9 @@ import chiselTests.ChiselFlatSpec import chisel3._ import chisel3.aop.Select.{PredicatedConnect, When, WhenNot} import chisel3.aop.{Aspect, Select} -import firrtl.{AnnotationSeq} +import chisel3.experimental.ExtModule +import chisel3.stage.{ChiselGeneratorAnnotation, DesignAnnotation} +import firrtl.AnnotationSeq import scala.reflect.runtime.universe.TypeTag @@ -139,5 +141,17 @@ class SelectSpec extends ChiselFlatSpec { ) } + "Blackboxes" should "be supported in Select.instances" in { + class BB extends ExtModule { } + class Top extends RawModule { + val bb = Module(new BB) + } + val top = ChiselGeneratorAnnotation(() => { + new Top() + }).elaborate(1).asInstanceOf[DesignAnnotation[Top]].design + val bbs = Select.collectDeep(top) { case b: BB => b } + assert(bbs.size == 1) + } + } |
