summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/src/main/scala/chisel3/internal/plugin/ChiselComponent.scala13
1 files changed, 8 insertions, 5 deletions
diff --git a/plugin/src/main/scala/chisel3/internal/plugin/ChiselComponent.scala b/plugin/src/main/scala/chisel3/internal/plugin/ChiselComponent.scala
index eced652b..f98049e2 100644
--- a/plugin/src/main/scala/chisel3/internal/plugin/ChiselComponent.scala
+++ b/plugin/src/main/scala/chisel3/internal/plugin/ChiselComponent.scala
@@ -78,10 +78,13 @@ class ChiselComponent(val global: Global, arguments: ChiselPluginArguments)
}
}
- private val shouldMatchData: Type => Boolean = shouldMatchGen(tq"chisel3.Data")
- private val shouldMatchDataOrMem: Type => Boolean = shouldMatchGen(tq"chisel3.Data", tq"chisel3.MemBase[_]")
- private val shouldMatchModule: Type => Boolean = shouldMatchGen(tq"chisel3.experimental.BaseModule")
- private val shouldMatchInstance: Type => Boolean = shouldMatchGen(tq"chisel3.experimental.hierarchy.Instance[_]")
+ private val shouldMatchData: Type => Boolean = shouldMatchGen(tq"chisel3.Data")
+ // Checking for all chisel3.internal.NamedComponents, but since it is internal, we instead have
+ // to match the public subtypes
+ private val shouldMatchNamedComp: Type => Boolean =
+ shouldMatchGen(tq"chisel3.Data", tq"chisel3.MemBase[_]", tq"chisel3.VerificationStatement")
+ private val shouldMatchModule: Type => Boolean = shouldMatchGen(tq"chisel3.experimental.BaseModule")
+ private val shouldMatchInstance: Type => Boolean = shouldMatchGen(tq"chisel3.experimental.hierarchy.Instance[_]")
// Given a type tree, infer the type and return it
private def inferType(t: Tree): Type = localTyper.typed(t, nsc.Mode.TYPEmode).tpe
@@ -176,7 +179,7 @@ class ChiselComponent(val global: Global, arguments: ChiselPluginArguments)
treeCopy.ValDef(dd, mods, name, tpt, localTyper.typed(named))
}
// If a Data or a Memory, get the name and a prefix
- else if (shouldMatchDataOrMem(tpe)) {
+ else if (shouldMatchNamedComp(tpe)) {
val str = stringFromTermName(name)
val newRHS = transform(rhs)
val prefixed = q"chisel3.experimental.prefix.apply[$tpt](name=$str)(f=$newRHS)"