aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/passes/Inline.scala
diff options
context:
space:
mode:
authorAdam Izraelevitz2016-11-23 11:57:02 -0800
committerJack Koenig2016-11-23 11:57:02 -0800
commit66d3ec0498a73319a914eeffcb4e0b1109b5f4c5 (patch)
tree325066fd05cc72b544d3b4d78d646e1a864119f3 /src/main/scala/firrtl/passes/Inline.scala
parent9a967a27aa8bb51f4b62969d2889f9a9caa48e31 (diff)
Stringified annotations (#367)
Restricts annotations to be string-based (and thus less typesafe) Makes annotations more easily serializable and interact with Chisel
Diffstat (limited to 'src/main/scala/firrtl/passes/Inline.scala')
-rw-r--r--src/main/scala/firrtl/passes/Inline.scala12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/scala/firrtl/passes/Inline.scala b/src/main/scala/firrtl/passes/Inline.scala
index 5c9d4367..002343ac 100644
--- a/src/main/scala/firrtl/passes/Inline.scala
+++ b/src/main/scala/firrtl/passes/Inline.scala
@@ -5,15 +5,19 @@ package passes
import firrtl.ir._
import firrtl.Mappers._
-import firrtl.Annotations._
+import firrtl.annotations._
// Datastructures
import scala.collection.mutable
// Tags an annotation to be consumed by this pass
-case class InlineAnnotation(target: Named) extends Annotation with Loose with Unstable {
- def duplicate(n: Named) = this.copy(target=n)
- def transform = classOf[InlineInstances]
+object InlineAnnotation {
+ def apply(target: Named): Annotation = Annotation(target, classOf[InlineInstances], "")
+
+ def unapply(a: Annotation): Option[Named] = a match {
+ case Annotation(named, t, _) if t == classOf[InlineInstances] => Some(named)
+ case _ => None
+ }
}
// Only use on legal Firrtl. Specifically, the restriction of