Skip to content

run_rtl: return simulator stdout and stderr outputs #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: v1.14_RC
Choose a base branch
from

Conversation

chiplet
Copy link
Contributor

@chiplet chiplet commented May 30, 2025

The simulator output logs are currently printed to the terminal, but not stored anywhere. In A-Core simulations, UART prints are output over STDERR stream. In order to post-process the values printed over serial, there needs to be a way to access the simulation logs from python.

This PR changes run_rtl to return the stdout and stderr streams, so that they are accessible in rtl testbenches.

The simulator output logs are currently printed to the terminal, but not
stored anywhere. In A-Core simulations, UART prints are output over
STDERR stream. In order to post-process the values printed over serial,
there needs to be a way to access the simulation logs from python.

This commit changes run_rtl to return the stdout and stderr streams, so
that they are accessible in rtl testbenches.
@chiplet
Copy link
Contributor Author

chiplet commented May 30, 2025

This has been tested to work on questa and icarus verilog with A-Core hello world test.

@chiplet chiplet changed the title run_rtl: return simulator stdout and stderr outputs wip: run_rtl: return simulator stdout and stderr outputs May 30, 2025
@chiplet chiplet changed the title wip: run_rtl: return simulator stdout and stderr outputs draft: run_rtl: return simulator stdout and stderr outputs May 30, 2025
@chiplet
Copy link
Contributor Author

chiplet commented May 30, 2025

Not quite ready yet. Simulator outputs are properly returned to the testbench, but stderr is no longer printed to terminal in real time.

Last commit added support for capturing simulator textual outputs, but
removed simulator output prints. This commit adds support for printing out
simulator stdout and stderr while capturing the output.

stdout and stderr are captured and printed one utf-8 code point at a
time instead of byte-by-byt to support real-time printing of unicode
symbols with multi-byte encoding.
@chiplet chiplet changed the title draft: run_rtl: return simulator stdout and stderr outputs run_rtl: return simulator stdout and stderr outputs Jun 2, 2025
@chiplet
Copy link
Contributor Author

chiplet commented Jun 2, 2025

Now this should work as before, while also being able to capture and return the simulator textual outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant