From: Sebastien Bourdeauducq Date: Sat, 10 Dec 2011 19:47:21 +0000 (+0100) Subject: fhdl: autofragment X-Git-Tag: 24jan2021_ls180~2099^2~1153 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=44f44b8a05c3b2d5bdfad0fb0541237b778e5997;p=litex.git fhdl: autofragment --- diff --git a/migen/fhdl/autofragment.py b/migen/fhdl/autofragment.py new file mode 100644 index 00000000..ecad96b5 --- /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