pytholite: prune unused registers
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 19 Dec 2012 15:03:05 +0000 (16:03 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Wed, 19 Dec 2012 15:03:05 +0000 (16:03 +0100)
migen/pytholite/compiler.py

index d25fe45579dc7fc9664fc39dd2bb873c67346834..2d437bc17d4882d9ec486e80cd60e7d7b5643ece 100644 (file)
@@ -237,8 +237,9 @@ def make_pytholite(func, **ioresources):
        
        regf = Fragment()
        for register in registers:
-               register.finalize()
-               regf += register.get_fragment()
+               if register.source_encoding:
+                       register.finalize()
+                       regf += register.get_fragment()
        
        fsm = implement_fsm(states)
        fsmf = LowerAbstractLoad().visit(fsm.get_fragment())