diff --git a/migen/fhdl/visit.py b/migen/fhdl/visit.py index d8b4ff861..66c2fd94b 100644 --- a/migen/fhdl/visit.py +++ b/migen/fhdl/visit.py @@ -197,3 +197,11 @@ class NodeTransformer: def visit_unknown(self, node): return node + +class TransformModule: + def __init__(self, transform, module): + self.transform = transform + self.module = module + + def get_fragment(self): + return self.transform(self.module.get_fragment())