mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
20 lines
356 B
Python
20 lines
356 B
Python
from migen.fhdl.structure import *
|
|
from migen.corelogic.record import *
|
|
|
|
L = [
|
|
("x", 10, 8),
|
|
("y", 10, 8),
|
|
("level2", [
|
|
("a", 5, 32),
|
|
("b", 5, 16)
|
|
])
|
|
]
|
|
|
|
myrec = Record(L)
|
|
print(myrec.flatten())
|
|
print(myrec.flatten(True))
|
|
s = myrec.subrecord("level2/a", "x")
|
|
print(s.flatten())
|
|
print(s.level2.layout())
|
|
myrec2 = myrec.copy()
|
|
print(myrec2.flatten())
|