From 8d9a2b5b94e33dc7b1f5272c13a2c5afe9ae6e81 Mon Sep 17 00:00:00 2001 From: Ciro Nishiguchi Date: Fri, 15 May 2020 09:39:26 -0500 Subject: rfnoc: Use large timeout for reads when timed commands exist If a timed command is in the queue, writes use a large timeout. Changing reads to do the same. --- host/lib/rfnoc/ctrlport_endpoint.cpp | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'host/lib') diff --git a/host/lib/rfnoc/ctrlport_endpoint.cpp b/host/lib/rfnoc/ctrlport_endpoint.cpp index f259f8f5d..5cff24443 100644 --- a/host/lib/rfnoc/ctrlport_endpoint.cpp +++ b/host/lib/rfnoc/ctrlport_endpoint.cpp @@ -119,8 +119,12 @@ public: virtual uint32_t peek32( uint32_t addr, uhd::time_spec_t timestamp = uhd::time_spec_t::ASAP) { - // Compute transaction expiration time - auto timeout_time = start_timeout(_policy.timeout); + // Compute transaction expiration time, use MASSIVE_TIMEOUT if a timed + // command is in the queue + auto timeout_time = start_timeout( + check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout + ); + // Send request auto request = send_request_packet(OP_READ, addr, {uint32_t(0)}, timestamp, timeout_time); @@ -141,8 +145,11 @@ public: return values; /* TODO: Uncomment when the atomic block peek is implemented in the FPGA - // Compute transaction expiration time - auto timeout_time = start_timeout(_policy.timeout); + // Compute transaction expiration time, use MASSIVE_TIMEOUT if a timed + // command is in the queue + auto timeout_time = start_timeout( + check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout + ); // Send request auto request = send_request_packet(OP_READ, first_addr, @@ -165,8 +172,12 @@ public: // TODO: Uncomment when this is implemented in the FPGA throw uhd::not_implemented_error("Control poll not implemented in the FPGA"); - // Compute transaction expiration time - auto timeout_time = start_timeout(_policy.timeout); + // Compute transaction expiration time, use MASSIVE_TIMEOUT if a timed + // command is in the queue + auto timeout_time = start_timeout( + check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout + ); + // Send request auto request = send_request_packet(OP_POLL, addr, @@ -181,8 +192,13 @@ public: virtual void sleep(uhd::time_spec_t duration, bool ack = false) { - // Compute transaction expiration time - auto timeout_time = start_timeout(_policy.timeout); + + // Compute transaction expiration time, use MASSIVE_TIMEOUT if a timed + // command is in the queue + auto timeout_time = start_timeout( + check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout + ); + // Send request auto request = send_request_packet(OP_SLEEP, 0, -- cgit v1.2.3