2013-05-22 11:11:09 -04:00
|
|
|
from migen.fhdl.std import *
|
2013-04-01 15:53:33 -04:00
|
|
|
from migen.fhdl import verilog
|
|
|
|
from migen.genlib.record import *
|
|
|
|
|
|
|
|
L = [
|
2015-04-13 14:07:07 -04:00
|
|
|
("position", [
|
|
|
|
("x", 10, DIR_M_TO_S),
|
|
|
|
("y", 10, DIR_M_TO_S),
|
|
|
|
]),
|
|
|
|
("color", 32, DIR_M_TO_S),
|
|
|
|
("stb", 1, DIR_M_TO_S),
|
|
|
|
("ack", 1, DIR_S_TO_M)
|
2013-04-01 15:53:33 -04:00
|
|
|
]
|
|
|
|
|
2015-04-13 14:45:35 -04:00
|
|
|
|
2013-04-01 15:53:33 -04:00
|
|
|
class Test(Module):
|
2015-04-13 14:07:07 -04:00
|
|
|
def __init__(self):
|
|
|
|
master = Record(L)
|
|
|
|
slave = Record(L)
|
|
|
|
self.comb += master.connect(slave)
|
2013-04-01 15:53:33 -04:00
|
|
|
|
|
|
|
print(verilog.convert(Test()))
|
|
|
|
print(layout_len(L))
|
|
|
|
print(layout_partial(L, "position/x", "color"))
|