2012-01-15 10:41:15 -05:00
|
|
|
import networkx as nx
|
|
|
|
|
|
|
|
from migen.fhdl import verilog
|
|
|
|
from migen.flow.ala import *
|
|
|
|
from migen.flow.network import *
|
2012-01-15 16:08:33 -05:00
|
|
|
from migen.actorlib import dma_wishbone, control
|
2012-01-15 10:41:15 -05:00
|
|
|
|
|
|
|
L = [
|
|
|
|
("x", BV(10), 8),
|
|
|
|
("y", BV(10), 8),
|
|
|
|
("level2", [
|
|
|
|
("a", BV(5), 32),
|
|
|
|
("b", BV(5), 16)
|
|
|
|
])
|
|
|
|
]
|
|
|
|
|
2012-01-15 16:08:33 -05:00
|
|
|
adrgen = control.For(10)
|
2012-01-15 10:41:15 -05:00
|
|
|
reader = dma_wishbone.Reader(L)
|
2012-01-15 16:08:33 -05:00
|
|
|
|
|
|
|
g = nx.MultiDiGraph()
|
|
|
|
add_connection(g, adrgen, reader)
|
|
|
|
comp = CompositeActor(g)
|
|
|
|
|
|
|
|
frag = comp.get_fragment()
|
|
|
|
ios = set(reader.bus.signals())
|
|
|
|
ios.add(comp.busy)
|
|
|
|
print(verilog.convert(frag, ios=ios))
|