phy/sim: generate sop/eop

This commit is contained in:
Florent Kermarrec 2015-02-25 17:47:44 +01:00
parent 6b7026f521
commit eef679b6d4
1 changed files with 11 additions and 4 deletions

View File

@ -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.source.stb.eq(pads.sink_stb),
self.source.data.eq(pads.sink_data)
self.sink.ack.eq(1)
]
self.sync += [
self.source.stb.eq(pads.sink_stb),
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),
]