mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
fhdl: autofragment
This commit is contained in:
parent
4b15a84505
commit
44f44b8a05
1 changed files with 13 additions and 0 deletions
13
migen/fhdl/autofragment.py
Normal file
13
migen/fhdl/autofragment.py
Normal file
|
@ -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
|
Loading…
Reference in a new issue