File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 22
33from amaranth import *
44from amaranth .lib .cdc import *
5- from amaranth_stdio .serial import AsyncSerial
5+ from amaranth_stdio .serial import AsyncSerial , AsyncSerialTX
66
77from .time .timer import *
88from ..interface import stream
99
1010
1111__all__ = [
1212 "AsyncSerialStream" ,
13+ "AsyncSerialTXStream" ,
1314 "AsyncSerialStreamHalfDuplex" ,
1415]
1516
1617
18+ class AsyncSerialTXStream (Elaboratable ):
19+ def __init__ (self , o , * args , ** kwargs ):
20+ self ._serial = AsyncSerialTX (* args , ** kwargs )
21+ self ._o = o
22+ dw = len (self ._serial .data )
23+ self .sink = stream .Endpoint ([("data" , dw )])
24+
25+ def elaborate (self , platform ):
26+ m = Module ()
27+ m .submodules += self ._serial
28+
29+ m .d .comb += [
30+ self ._serial .data .eq (self .sink .data ),
31+ self ._serial .ack .eq (self .sink .valid ),
32+ self .sink .ready .eq (self ._serial .rdy ),
33+ self ._o .eq (self ._serial .o ),
34+ ]
35+
36+ return m
37+
38+
1739class AsyncSerialStream (Elaboratable ):
1840 """ Stream wrapper around AsyncSerial.
1941
You can’t perform that action at this time.
0 commit comments