fhdl/visit: add TransformModule
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 10 Apr 2013 21:42:14 +0000 (23:42 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 10 Apr 2013 21:42:14 +0000 (23:42 +0200)
migen/fhdl/visit.py

index d8b4ff861c408ea263692b1024a52dc4df28a79a..66c2fd94b7f8caad380ca4e52263090ff24514a0 100644 (file)
@@ -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())