aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/include/uhd/rfnoc/register_iface.hpp4
-rw-r--r--host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp4
-rw-r--r--host/lib/rfnoc/ctrlport_endpoint.cpp3
-rw-r--r--host/lib/rfnoc/radio_control_impl.cpp15
4 files changed, 17 insertions, 9 deletions
diff --git a/host/include/uhd/rfnoc/register_iface.hpp b/host/include/uhd/rfnoc/register_iface.hpp
index a89d85717..3344b7c5e 100644
--- a/host/include/uhd/rfnoc/register_iface.hpp
+++ b/host/include/uhd/rfnoc/register_iface.hpp
@@ -38,8 +38,8 @@ public:
* modelled as a simple register write (key-value pair with addr/data) that
* is initiated by the FPGA.
*/
- using async_msg_callback_t =
- std::function<void(uint32_t addr, const std::vector<uint32_t>& data)>;
+ using async_msg_callback_t = std::function<void(
+ uint32_t addr, const std::vector<uint32_t>& data, boost::optional<uint64_t>)>;
/*! Write a 32-bit register implemented in the NoC block.
*
diff --git a/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp b/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp
index 9c3288164..0d10fd13b 100644
--- a/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp
+++ b/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp
@@ -269,7 +269,9 @@ private:
// - Overrun info
// - Underrun info
// - Late data packets
- void async_message_handler(uint32_t addr, const std::vector<uint32_t>& data);
+ void async_message_handler(uint32_t addr,
+ const std::vector<uint32_t>& data,
+ boost::optional<uint64_t> timestamp);
//! FPGA compat number
const uint32_t _fpga_compat;
diff --git a/host/lib/rfnoc/ctrlport_endpoint.cpp b/host/lib/rfnoc/ctrlport_endpoint.cpp
index 267ff5d71..5c0deca1d 100644
--- a/host/lib/rfnoc/ctrlport_endpoint.cpp
+++ b/host/lib/rfnoc/ctrlport_endpoint.cpp
@@ -275,7 +275,8 @@ public:
"CTRLEP", "Malformed async message request: Invalid num_data");
} else {
try {
- _handle_async_msg(rx_ctrl.address, rx_ctrl.data_vtr);
+ _handle_async_msg(
+ rx_ctrl.address, rx_ctrl.data_vtr, rx_ctrl.timestamp);
status = CMD_OKAY;
} catch (...) {
UHD_LOG_ERROR("CTRLEP", "Async message handler threw an exception");
diff --git a/host/lib/rfnoc/radio_control_impl.cpp b/host/lib/rfnoc/radio_control_impl.cpp
index 205185247..9ce1d83ec 100644
--- a/host/lib/rfnoc/radio_control_impl.cpp
+++ b/host/lib/rfnoc/radio_control_impl.cpp
@@ -203,10 +203,11 @@ radio_control_impl::radio_control_impl(make_args_ptr make_args)
regmap::SWREG_RX_ERR + regmap::SWREG_CHAN_OFFSET * rx_chan);
}
// Now register a function to receive the async messages
- regs().register_async_msg_handler(
- [this](uint32_t addr, const std::vector<uint32_t>& data) {
- this->async_message_handler(addr, data);
- });
+ regs().register_async_msg_handler([this](uint32_t addr,
+ const std::vector<uint32_t>& data,
+ boost::optional<uint64_t> timestamp) {
+ this->async_message_handler(addr, data, timestamp);
+ });
} /* ctor */
/******************************************************************************
@@ -791,7 +792,7 @@ void radio_control_impl::issue_stream_cmd(
* Private methods
*****************************************************************************/
void radio_control_impl::async_message_handler(
- uint32_t addr, const std::vector<uint32_t>& data)
+ uint32_t addr, const std::vector<uint32_t>& data, boost::optional<uint64_t> timestamp)
{
if (data.empty()) {
RFNOC_LOG_WARNING(
@@ -817,6 +818,10 @@ void radio_control_impl::async_message_handler(
"%s channel %d, addr_offset %d")
% addr % data.size() % (addr_base == regmap::SWREG_TX_ERR ? "TX" : "RX")
% chan % addr_offset));
+ if (timestamp) {
+ RFNOC_LOG_TRACE(
+ str(boost::format("Async message timestamp: %ul") % timestamp.get()));
+ }
switch (addr_base + addr_offset) {
case regmap::SWREG_TX_ERR: {
switch (code) {