litex/migen/fhdl/autofragment.py

13 lines
232 B
Python
Raw Normal View History

2011-12-10 14:47:21 -05:00
from .structure import *
import inspect
def FromLocal():
f = Fragment()
frame = inspect.currentframe().f_back
ns = frame.f_locals
for x in ns:
obj = ns[x]
if hasattr(obj, "GetFragment"):
f += obj.GetFragment()
return f