From 8142c4f0d988242c0e5c2efc5f792356f378d4f7 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 22 Jun 2012 13:58:36 +0200 Subject: [PATCH] examples/dataflow/dma: use new dataflow API (thanks Ross Manyika for reporting) --- examples/dataflow/dma.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/dataflow/dma.py b/examples/dataflow/dma.py index 44987323..ffc4d979 100644 --- a/examples/dataflow/dma.py +++ b/examples/dataflow/dma.py @@ -43,7 +43,7 @@ def trgen_gen(): def wishbone_sim(efragment, master, end_simulation): peripheral = wishbone.Target(MyModelWB()) tap = wishbone.Tap(peripheral.bus) - interconnect = wishbone.InterconnectPointToPoint(master.bus, peripheral.bus) + interconnect = wishbone.InterconnectPointToPoint(master.actor.bus, peripheral.bus) def _end_simulation(s): s.interrupt = end_simulation(s) fragment = efragment \ @@ -70,27 +70,27 @@ def asmi_sim(efragment, hub, end_simulation): def test_wb_reader(): print("*** Testing Wishbone reader") - adrgen = SimActor(adrgen_gen(), ("address", Source, [("a", BV(30))])) - reader = dma_wishbone.Reader() - dumper = SimActor(dumper_gen(), ("data", Sink, [("d", BV(32))])) + adrgen = ActorNode(SimActor(adrgen_gen(), ("address", Source, [("a", BV(30))]))) + reader = ActorNode(dma_wishbone.Reader()) + dumper = ActorNode(SimActor(dumper_gen(), ("data", Sink, [("d", BV(32))]))) g = DataFlowGraph() g.add_connection(adrgen, reader) g.add_connection(reader, dumper) comp = CompositeActor(g) wishbone_sim(comp.get_fragment(), reader, - lambda s: adrgen.done and not s.rd(comp.busy)) + lambda s: adrgen.actor.done and not s.rd(comp.busy)) def test_wb_writer(): print("*** Testing Wishbone writer") - trgen = SimActor(trgen_gen(), ("address_data", Source, [("a", BV(30)), ("d", BV(32))])) - writer = dma_wishbone.Writer() + trgen = ActorNode(SimActor(trgen_gen(), ("address_data", Source, [("a", BV(30)), ("d", BV(32))]))) + writer = ActorNode(dma_wishbone.Writer()) g = DataFlowGraph() g.add_connection(trgen, writer) comp = CompositeActor(g) wishbone_sim(comp.get_fragment(), writer, - lambda s: trgen.done and not s.rd(comp.busy)) + lambda s: trgen.actor.done and not s.rd(comp.busy)) def test_asmi_seqreader(): print("*** Testing ASMI sequential reader") @@ -99,16 +99,16 @@ def test_asmi_seqreader(): port = hub.get_port() hub.finalize() - adrgen = SimActor(adrgen_gen(), ("address", Source, [("a", BV(32))])) - reader = dma_asmi.SequentialReader(port) - dumper = SimActor(dumper_gen(), ("data", Sink, [("d", BV(32))])) + adrgen = ActorNode(SimActor(adrgen_gen(), ("address", Source, [("a", BV(32))]))) + reader = ActorNode(dma_asmi.SequentialReader(port)) + dumper = ActorNode(SimActor(dumper_gen(), ("data", Sink, [("d", BV(32))]))) g = DataFlowGraph() g.add_connection(adrgen, reader) g.add_connection(reader, dumper) comp = CompositeActor(g) asmi_sim(hub.get_fragment() + comp.get_fragment(), hub, - lambda s: adrgen.done and not s.rd(comp.busy)) + lambda s: adrgen.actor.done and not s.rd(comp.busy)) test_wb_reader() test_wb_writer() -- 2.30.2