diff --git a/migen/fhdl/autofragment.py b/migen/fhdl/autofragment.py new file mode 100644 index 000000000..ecad96b5a --- /dev/null +++ b/migen/fhdl/autofragment.py @@ -0,0 +1,13 @@ +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"): + print("adding "+x) + f += obj.GetFragment() + return f