Permalink
Browse files

fhdl/autofragment: from_attributes

  • Loading branch information...
1 parent 7ff61d8 commit 63d399b6adbd3feb410127f48a15d9195fcac396 @sbourdeauducq sbourdeauducq committed Feb 11, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 migen/fhdl/autofragment.py
@@ -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.