lowRISC / lowRISC/mocha

util/fpga_runner.py dropping chunks of UART stream

Open
#685 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SystemVerilog
Stars
38
Forks
21
Avg merge
2d 23h
Merged PRs (30d)
14

Description

util/fpga_runner.py has test mode which dumps UART output to the terminal, useful for monitoring test logs

However it periodically drops large chunks of the UART stream

Steps to reproduce:

  • First run the FPGA runner utility and capture the output in a text file
    • Run util/fpga_runner.py test -e <path to any test binary with a lot of deterministic UART output> 2>&1 > out1.txt
  • Next run the test and use Picocom to monitor the UART:
    • To start capturing, run picocom /dev/ttyUSB0 -b 1000000 --logfile out2.txt (or equivalent)
    • In a separate terminal, run util/fpga_runner.py run -e <path to same executable>
    • Return to the Picocom terminal and enter Ctrl+A-X to exit Picocom
  • Diff out1.txt and out2.txt

Workaround: use Picocom instead of relying on the UART monitoring in the Python script

Some of the diff will be due to standard output from the Python script which isn't captured by Picocom's UART monitor - this is not a problem:
Image

However further down there are inconsistencies:
Image

The behaviour is bursty - large chunks of the UART stream get lost - and seems to consistently happen around the same point during the log.

The stream does eventually recover:
Image

For now using Picocom is a perfectly good workaround but this is really a bug with the Python utility

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with util/fpga_runner.py and reproduce the loss using test mode with a deterministic UART-heavy executable, saving its output to out1.txt. Compare it with a Picocom capture from run mode, then trace the script's UART monitoring and output handling. Done means the Python utility preserves the UART stream without the bursty missing chunks seen in the comparison.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.