diff options
author | Ciro Nishiguchi <ciro.nishiguchi@ni.com> | 2020-05-15 09:39:26 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-05-15 16:21:51 -0500 |
commit | 8d9a2b5b94e33dc7b1f5272c13a2c5afe9ae6e81 (patch) | |
tree | 16826734b1e4ebd30d939f90108e869614b2a865 /host/lib/rfnoc | |
parent | b5232b8e3fe5655218f776231d3e92964aa799ed (diff) | |
download | uhd-8d9a2b5b94e33dc7b1f5272c13a2c5afe9ae6e81.tar.gz uhd-8d9a2b5b94e33dc7b1f5272c13a2c5afe9ae6e81.tar.bz2 uhd-8d9a2b5b94e33dc7b1f5272c13a2c5afe9ae6e81.zip |
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.
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r-- | host/lib/rfnoc/ctrlport_endpoint.cpp | 32 |
1 files changed, 24 insertions, 8 deletions
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, |