tools/litex_term/crossover: use burst to speed up reads.

This commit is contained in:
Florent Kermarrec 2020-12-10 14:34:00 +01:00
parent 48dc574703
commit 384041affb

View file

@ -80,9 +80,16 @@ class CrossoverBridge:
def crossover2pty(self): def crossover2pty(self):
while True: while True:
if self.bus.regs.uart_xover_rxempty.read() == 0: if self.bus.regs.uart_txfull.read():
r = self.bus.regs.uart_xover_rxtx.read() length = 16
os.write(self.file, bytes(chr(r).encode("utf-8"))) elif not self.bus.regs.uart_xover_rxempty.read():
length = 1
else:
length = 0
if length:
r = self.bus.read(self.bus.regs.uart_xover_rxtx.addr, length=length, burst="fixed")
for v in r:
os.write(self.file, bytes(chr(v).encode("utf-8")))
# SFL ---------------------------------------------------------------------------------------------- # SFL ----------------------------------------------------------------------------------------------