From 384041affb33d757aea016e511886da27dc6323f Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 10 Dec 2020 14:34:00 +0100 Subject: [PATCH] tools/litex_term/crossover: use burst to speed up reads. --- litex/tools/litex_term.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/litex/tools/litex_term.py b/litex/tools/litex_term.py index d9155861c..3eeaa7fe9 100755 --- a/litex/tools/litex_term.py +++ b/litex/tools/litex_term.py @@ -80,9 +80,16 @@ class CrossoverBridge: def crossover2pty(self): while True: - if self.bus.regs.uart_xover_rxempty.read() == 0: - r = self.bus.regs.uart_xover_rxtx.read() - os.write(self.file, bytes(chr(r).encode("utf-8"))) + if self.bus.regs.uart_txfull.read(): + length = 16 + 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 ----------------------------------------------------------------------------------------------