From 44f44b8a05c3b2d5bdfad0fb0541237b778e5997 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 10 Dec 2011 20:47:21 +0100 Subject: [PATCH] fhdl: autofragment --- migen/fhdl/autofragment.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 migen/fhdl/autofragment.py 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 -- 2.30.2