diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/firrtl/stage/transforms/ExpandPrepares.scala | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/scala/firrtl/stage/transforms/ExpandPrepares.scala b/src/main/scala/firrtl/stage/transforms/ExpandPrepares.scala new file mode 100644 index 00000000..7a0621e4 --- /dev/null +++ b/src/main/scala/firrtl/stage/transforms/ExpandPrepares.scala @@ -0,0 +1,26 @@ +// See LICENSE for license details. + +package firrtl.stage.transforms + +import firrtl.{CircuitState, Transform} + +class ExpandPrepares(val underlying: Transform) extends Transform with WrappedTransform { + + /* Assert that this is not wrapping other transforms. */ + underlying match { + case _: WrappedTransform => throw new Exception( + s"'ExpandPrepares' must not wrap other 'WrappedTransforms', but wraps '${underlying.getClass.getName}'") + case _ => + } + + override def execute(c: CircuitState): CircuitState = { + underlying.transform(underlying.prepare(c)) + } + +} + +object ExpandPrepares { + + def apply(a: Transform): ExpandPrepares = new ExpandPrepares(a) + +} |
