From c219be2375fadcdd88851842e7b9029271230398 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Fri, 19 Apr 2019 10:42:40 -0400 Subject: Add PreservesAll stackable trait for DependencyAPI This adds a PreservesAll that can be used to override the default invalidation scheme (invalidated everything except yourself) such that nothing is invalidated. Signed-off-by: Schuyler Eldridge --- src/main/scala/firrtl/options/Phase.scala | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/main/scala/firrtl/options/Phase.scala b/src/main/scala/firrtl/options/Phase.scala index e4bb6f0d..e5aa87ec 100644 --- a/src/main/scala/firrtl/options/Phase.scala +++ b/src/main/scala/firrtl/options/Phase.scala @@ -86,6 +86,15 @@ trait DependencyAPI[A <: DependencyAPI[A]] { this: TransformLike[_] => } +/** A trait indicating that no invalidations occur, i.e., all previous transforms are preserved + * @tparam A some [[TransformLike]] + */ +trait PreservesAll[A <: DependencyAPI[A]] { this: DependencyAPI[A] => + + override def invalidates(a: A): Boolean = false + +} + /** A mathematical transformation of an [[AnnotationSeq]]. * * A [[firrtl.options.Phase Phase]] forms one unit in the Chisel/FIRRTL Hardware Compiler Framework (HCF). The HCF is -- cgit v1.2.3