Skip to content

Commit

Permalink
fhdl/autofragment: from_attributes
Browse files Browse the repository at this point in the history
Sebastien Bourdeauducq committed Feb 11, 2013
1 parent 7ff61d8 commit 63d399b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions migen/fhdl/autofragment.py
Original file line number Diff line number Diff line change
@@ -11,3 +11,10 @@ def from_local():
if hasattr(obj, "get_fragment"):
f += obj.get_fragment()
return f

def from_attributes(obj):
f = Fragment()
for x in obj.__dict__.values():
if hasattr(x, "get_fragment"):
f += x.get_fragment()
return f

0 comments on commit 63d399b

Please sign in to comment.