-
Notifications
You must be signed in to change notification settings - Fork 47
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
tty.c: added a nop hint to nop_putc() so that post-processing can see… #271
Conversation
… the characters being output to the serial port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Mentioning @ericlove @aswaterman who have both implemented this trick elsewhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@BrianGraysonSiV 's original description mentions
A simple awk script like the one attached suffices to parse the output files.
but I didn't see any attachments. Actually, that's probably for the best, because the formatting of the "output files", if any, depends on the machine this is run on (perhaps a simulator).
…gument is passed in a0
…linter didn't like
Port of #271 to Freedom Metal refactor work. Allows standard out to be extracted from an instruction trace when no other stdio method is available. Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
… the characters being output to the serial port.
With this change, a "customizable non-reserved NOP hint" instruction (slli x0, a0, 0x11) is used, with the character to be output in the specified register. This allows a post-processing tool to find occurrences of that instruction, grab the character value out of the register fields, and output the character.
A simple awk script suffices to parse the output files. Here's a one-liner version:
awk '/inst=.01151013/{printf "%c",strtonum("0x"substr($(NF-4),21,2));}' myfile