From 6ebe514137fa41ac015122da4dcaba56af84e531 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sat, 19 Nov 2022 21:19:18 -0600 Subject: Implement JTAG-UART input --- tb/jtag_uart.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'tb/jtag_uart.hpp') diff --git a/tb/jtag_uart.hpp b/tb/jtag_uart.hpp index 6db50f8..3c378c3 100644 --- a/tb/jtag_uart.hpp +++ b/tb/jtag_uart.hpp @@ -11,14 +11,25 @@ namespace taller::avalon { public: jtag_uart(std::uint32_t base) noexcept; + ~jtag_uart() noexcept; + + void tick() noexcept; virtual bool read(std::uint32_t addr, std::uint32_t &data) noexcept final override; virtual bool write(std::uint32_t addr, std::uint32_t data, unsigned byte_enable) noexcept final override; + void takeover() noexcept; + void release() noexcept; + private: - bool ctrl_re = false; - bool ctrl_we = false; - bool ctrl_ac = true; + unsigned countdown = 0; + unsigned rx_avail = 0; + unsigned rx_next = 0; + bool ctrl_re = false; + bool ctrl_we = false; + bool ctrl_ac = true; + bool took_over = false; + std::uint8_t rx[64]; }; } -- cgit v1.2.3