diff options
Diffstat (limited to 'host')
| -rw-r--r-- | host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp | 17 | ||||
| -rw-r--r-- | host/lib/include/uhdlib/transport/rx_streamer_impl.hpp | 6 | ||||
| -rw-r--r-- | host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp | 16 | ||||
| -rw-r--r-- | host/lib/rfnoc/radio_control_impl.cpp | 16 | ||||
| -rw-r--r-- | host/lib/rfnoc/rfnoc_rx_streamer.cpp | 4 | 
5 files changed, 52 insertions, 7 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp b/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp index 5327105c8..fc0d19a0a 100644 --- a/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp +++ b/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp @@ -241,13 +241,16 @@ public:      struct err_codes      { -        static const uint32_t ERR_RX_LATE_CMD = -            1; // Late command (arrived after indicated time) -        static const uint32_t ERR_RX_OVERRUN = 2; // FIFO overflow -        static const uint32_t ERR_TX_UNDERRUN = -            1; // Data underflow (data not available when needed) -        static const uint32_t ERR_TX_LATE_DATA = -            2; // Late data (arrived after indicated time) +        //! Late command (stream command arrived after indicated time) +        static const uint32_t ERR_RX_LATE_CMD = 1; +        //! FIFO overflow +        static const uint32_t ERR_RX_OVERRUN = 2; +        // FIFO underrun (data not available when needed) +        static const uint32_t ERR_TX_UNDERRUN = 1; +        //! Late data (arrived after indicated time) +        static const uint32_t ERR_TX_LATE_DATA = 2; +        //! Acknowledge a TX burst with an EOB +        static const uint32_t EVENT_TX_BURST_ACK = 3;      };      //! Tree path to the dboard-specific properties diff --git a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp index b52358e55..c57a8e0d1 100644 --- a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp +++ b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp @@ -220,6 +220,12 @@ protected:          _zero_copy_streamer.set_stopped_due_to_overrun();      } +    //! Notifies the streamer that an overrun has occured +    void set_stopped_due_to_late_command() +    { +        _zero_copy_streamer.set_stopped_due_to_late_command(); +    } +      //! Provides a callback to handle overruns      void set_overrun_handler(          typename rx_streamer_zero_copy<transport_t>::overrun_handler_t handler) diff --git a/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp b/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp index 1f7320330..27b7eaf7d 100644 --- a/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp +++ b/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp @@ -93,6 +93,12 @@ public:          _stopped_due_to_overrun = true;      } +    //! Notifies the streamer that a late command has occured +    void set_stopped_due_to_late_command() +    { +        _stopped_due_to_late_cmd = true; +    } +      //! Provides a callback to handle overruns      void set_overrun_handler(overrun_handler_t handler)      { @@ -161,6 +167,12 @@ public:                  // Packets were not available with zero timeout, wait for them                  // to arrive using the specified timeout.                  result = _get_aligned_buffs(timeout_ms); +                if (_stopped_due_to_late_cmd) { +                    metadata.has_time_spec   = false; +                    metadata.error_code      = rx_metadata_t::ERROR_CODE_LATE_COMMAND; +                    _stopped_due_to_late_cmd = false; +                    return 0; +                }              }          } @@ -285,6 +297,10 @@ private:      // overrun error when no more packets are available.      std::atomic<bool> _stopped_due_to_overrun{false}; +    // Flag that indicates a late command occurred. The streamer will return a +    // late command error when no more packets are available. +    std::atomic<bool> _stopped_due_to_late_cmd{false}; +      // Callback for overrun      overrun_handler_t _overrun_handler;  }; diff --git a/host/lib/rfnoc/radio_control_impl.cpp b/host/lib/rfnoc/radio_control_impl.cpp index e400033b3..2a730e8df 100644 --- a/host/lib/rfnoc/radio_control_impl.cpp +++ b/host/lib/rfnoc/radio_control_impl.cpp @@ -872,6 +872,8 @@ bool radio_control_impl::async_message_validator(                  return true;              case err_codes::ERR_TX_LATE_DATA:                  return true; +            case err_codes::EVENT_TX_BURST_ACK: +                return true;              default:                  return false;          } @@ -939,6 +941,14 @@ void radio_control_impl::async_message_handler(                      RFNOC_LOG_TRACE("Posting late data event action message.");                      break;                  } +                case err_codes::EVENT_TX_BURST_ACK: { +                    auto tx_event_action = tx_event_action_info::make( +                        uhd::async_metadata_t::EVENT_CODE_BURST_ACK); +                    post_action(res_source_info{res_source_info::INPUT_EDGE, chan}, +                        tx_event_action); +                    RFNOC_LOG_TRACE("Posting burst ack event action message."); +                    break; +                }              }              break;          } @@ -963,6 +973,12 @@ void radio_control_impl::async_message_handler(                  }                  case err_codes::ERR_RX_LATE_CMD:                      UHD_LOG_FASTPATH("L"); +                    auto rx_event_action = rx_event_action_info::make(); +                    rx_event_action->error_code = +                        uhd::rx_metadata_t::ERROR_CODE_LATE_COMMAND; +                    RFNOC_LOG_TRACE("Posting RX late command message."); +                    post_action(res_source_info{res_source_info::OUTPUT_EDGE, chan}, +                        rx_event_action);                      break;              }              break; diff --git a/host/lib/rfnoc/rfnoc_rx_streamer.cpp b/host/lib/rfnoc/rfnoc_rx_streamer.cpp index 9383e3487..d6778267f 100644 --- a/host/lib/rfnoc/rfnoc_rx_streamer.cpp +++ b/host/lib/rfnoc/rfnoc_rx_streamer.cpp @@ -244,6 +244,10 @@ void rfnoc_rx_streamer::_handle_rx_event_action(          // Tell the streamer to flag an overrun to the user after the data that          // was buffered prior to the overrun is read.          set_stopped_due_to_overrun(); +    } else if (rx_event_action->error_code +               == uhd::rx_metadata_t::ERROR_CODE_LATE_COMMAND) { +        RFNOC_LOG_DEBUG("Received late command message on port " << src.instance); +        set_stopped_due_to_late_command();      }  }  | 
