From eef679b6d4a9c66d1e56e5643374c0156dc4e495 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 25 Feb 2015 17:47:44 +0100 Subject: [PATCH] phy/sim: generate sop/eop --- liteeth/phy/sim.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/liteeth/phy/sim.py b/liteeth/phy/sim.py index 3d9174cb..f7069dd9 100644 --- a/liteeth/phy/sim.py +++ b/liteeth/phy/sim.py @@ -26,11 +26,18 @@ class LiteEthPHYSim(Module, AutoCSR): self.submodules.crg = LiteEthPHYSimCRG() self.sink = sink = Sink(eth_phy_description(8)) self.source = source = Source(eth_phy_description(8)) + self.comb += [ pads.source_stb.eq(self.sink.stb), pads.source_data.eq(self.sink.data), - self.sink.ack.eq(1), + self.sink.ack.eq(1) + ] + self.sync += [ self.source.stb.eq(pads.sink_stb), - self.source.data.eq(pads.sink_data) + self.source.sop.eq(pads.sink_stb & ~self.source.stb), + self.source.data.eq(pads.sink_data), + ] + self.comb += [ + self.source.eop.eq(~pads.sink_stb & self.source.stb), ] -- 2.30.2