mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
uart: add sim phy
This commit is contained in:
parent
649cdeb265
commit
1e6d1deae8
1 changed files with 18 additions and 0 deletions
18
misoclib/com/uart/phy/sim.py
Normal file
18
misoclib/com/uart/phy/sim.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
from migen.fhdl.std import *
|
||||
from migen.flow.actor import Sink, Source
|
||||
|
||||
class UARTPHYSim(Module):
|
||||
def __init__(self, pads):
|
||||
self.dw = 8
|
||||
self.tuning_word = Signal(32)
|
||||
self.sink = Sink([("d", 8)])
|
||||
self.source = Source([("d", 8)])
|
||||
|
||||
self.comb += [
|
||||
pads.source_stb.eq(self.sink.stb),
|
||||
pads.source_d.eq(self.sink.d),
|
||||
self.sink.ack.eq(pads.source_ack),
|
||||
|
||||
self.source.stb.eq(pads.sink_stb),
|
||||
self.source.d.eq(pads.sink_d)
|
||||
]
|
Loading…
Reference in a new issue