From: Luke Kenneth Casson Leighton Date: Fri, 21 Jan 2022 13:28:48 +0000 (+0000) Subject: code-comments on uart in microwatt_verilator X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ca7ce551904baaca96978f2d1557c3e162b780b;p=microwatt.git code-comments on uart in microwatt_verilator --- diff --git a/verilator/microwatt-verilator.cpp b/verilator/microwatt-verilator.cpp index dea7c07..0dbbf29 100644 --- a/verilator/microwatt-verilator.cpp +++ b/verilator/microwatt-verilator.cpp @@ -49,9 +49,14 @@ void tick(Vmicrowatt *top, bool dump) main_time++; } +// simulated uart tx/rx, assumes a baud rate of 115200 based on CLK_FREQUENCY void uart_tx(unsigned char tx); unsigned char uart_rx(void); +// true if the uart tx and rx are both idle +// (saves having to save/restore/sync the uart state) +bool uart_idle(void); + // pretty-print dumped data in ASCII (to help identify strings) static void ascii_dump(unsigned char *data, int len, FILE *dump) {