diff options
| author | Schuyler Eldridge | 2020-04-21 22:40:48 -0400 |
|---|---|---|
| committer | Schuyler Eldridge | 2020-04-22 16:41:06 -0400 |
| commit | 1bf80040825e96ce04c15374304c144b9d48e902 (patch) | |
| tree | 7c5d9870ed3f1fa80d04d33e6de6dd0452199b04 /src | |
| parent | 0c8261d7a9ce78901841dd42d67682a64e89bfd3 (diff) | |
Add ExpandPrepares wrapper
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
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) + +} |
