aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/examples/rfnoc_rx_to_file.cpp31
-rw-r--r--host/include/uhd/rfnoc/constants.hpp69
-rw-r--r--host/lib/include/uhdlib/rfnoc/mgmt_portal.hpp1
-rw-r--r--host/lib/rfnoc/mgmt_portal.cpp6
4 files changed, 6 insertions, 101 deletions
diff --git a/host/examples/rfnoc_rx_to_file.cpp b/host/examples/rfnoc_rx_to_file.cpp
index 2d648c10d..503582370 100644
--- a/host/examples/rfnoc_rx_to_file.cpp
+++ b/host/examples/rfnoc_rx_to_file.cpp
@@ -447,37 +447,6 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
std::cout << "Using streamer args: " << stream_args.args.to_string() << std::endl;
uhd::rx_streamer::sptr rx_stream = graph->create_rx_streamer(1, stream_args);
- // Set the stream args on the radio:
- // if (block_id.empty()) {
- // // If no extra block is required, connect to the radio:
- // streamer_args["block_id"] = radio_ctrl_id.to_string();
- // streamer_args["block_port"] = str(boost::format("%d") % radio_chan);
- //} else {
- // // Otherwise, see if the requested block exists and connect it to the radio:
- // if (not usrp->has_block(block_id)) {
- // std::cout << "Block does not exist on current device: " << block_id
- // << std::endl;
- // return EXIT_FAILURE;
- // }
-
- // uhd::rfnoc::source_block_ctrl_base::sptr blk_ctrl =
- // usrp->get_block_ctrl<uhd::rfnoc::source_block_ctrl_base>(block_id);
-
- // if (not block_args.empty()) {
- // // Set the block args on the other block:
- // blk_ctrl->set_args(uhd::device_addr_t(block_args));
- // }
- // // Connect:
- // std::cout << "Connecting " << radio_ctrl_id << " ==> " <<
- // blk_ctrl->get_block_id()
- // << std::endl;
- // rx_graph->connect(
- // radio_ctrl_id, radio_chan, blk_ctrl->get_block_id(), uhd::rfnoc::ANY_PORT);
- // streamer_args["block_id"] = blk_ctrl->get_block_id().to_string();
-
- // spp = blk_ctrl->get_args().cast<size_t>("spp", spp);
- //}
-
// Connect blocks and commit the graph
for (auto& edge : chain) {
if (uhd::rfnoc::block_id_t(edge.dst_blockid).match(uhd::rfnoc::NODE_ID_SEP)) {
diff --git a/host/include/uhd/rfnoc/constants.hpp b/host/include/uhd/rfnoc/constants.hpp
index fdcc40d99..fdd904d23 100644
--- a/host/include/uhd/rfnoc/constants.hpp
+++ b/host/include/uhd/rfnoc/constants.hpp
@@ -8,85 +8,16 @@
#pragma once
#include <uhd/rfnoc/defaults.hpp>
-#include <uhd/types/dict.hpp>
#include <stdint.h>
-#include <boost/assign/list_of.hpp>
#include <string>
namespace uhd { namespace rfnoc {
constexpr uint16_t RFNOC_PROTO_VER = 0x0100;
-static const size_t NOC_SHELL_COMPAT_MAJOR = 5;
-static const size_t NOC_SHELL_COMPAT_MINOR = 1;
-
-static const size_t MAX_PACKET_SIZE = 8000; // bytes
-static const size_t DEFAULT_PACKET_SIZE = 1456; // bytes
-
-// One line in FPGA is 64 Bits
-static const size_t BYTES_PER_LINE = 8;
-
-//! For flow control within a single crossbar
-static const size_t DEFAULT_FC_XBAR_RESPONSE_FREQ = 8;
-//! For flow control when data is flowing from device to host (rx)
-static const size_t DEFAULT_FC_RX_RESPONSE_FREQ = 64; // ACKs per flow control window
-//! For flow control when data is flowing from host to device (tx)
-static const size_t DEFAULT_FC_TX_RESPONSE_FREQ = 8; // ACKs per flow control window
-//! On the receive side, how full do we want the buffers?
-// Why not 100% full? Because we need to have some headroom to account for the inaccuracy
-// when computing the window size. We compute the flow control window based on the frame
-// size but the buffer can have overhead due to things like UDP headers, page alignment,
-// housekeeping info, etc. This number has to be transport agnostic so 20% of headroom is
-// safe.
-static const double DEFAULT_FC_RX_SW_BUFF_FULL_FACTOR = 0.80;
-
-// Common settings registers.
-static const uint32_t SR_FLOW_CTRL_BYTES_PER_ACK = 1;
-static const uint32_t SR_FLOW_CTRL_WINDOW_SIZE = 2;
-static const uint32_t SR_FLOW_CTRL_EN = 3;
-static const uint32_t SR_ERROR_POLICY = 4;
-static const uint32_t SR_BLOCK_SID = 5; // TODO rename to SRC_SID
-static const uint32_t SR_NEXT_DST_SID = 6;
-static const uint32_t SR_RESP_IN_DST_SID = 7;
-static const uint32_t SR_RESP_OUT_DST_SID = 8;
-static const uint32_t SR_FLOW_CTRL_PKT_LIMIT = 9;
-
-static const uint32_t SR_READBACK_ADDR = 124;
-static const uint32_t SR_READBACK = 127;
-
-static const uint32_t SR_CLEAR_RX_FC = 125;
-static const uint32_t SR_CLEAR_TX_FC = 126;
-
-//! Settings register readback
-enum settingsbus_reg_t {
- SR_READBACK_REG_ID = 0,
- SR_READBACK_REG_GLOBAL_PARAMS = 1,
- SR_READBACK_REG_FIFOSIZE = 2, // fifo size
- SR_READBACK_REG_MTU = 3,
- SR_READBACK_REG_BLOCKPORT_SIDS = 4,
- SR_READBACK_REG_USER = 5,
- SR_READBACK_COMPAT = 6
-};
-
-// AXI stream configuration bus (output master bus of axi wrapper) registers
-static const uint32_t AXI_WRAPPER_BASE = 128;
-static const uint32_t AXIS_CONFIG_BUS =
- AXI_WRAPPER_BASE + 1; // tdata with tvalid asserted
-static const uint32_t AXIS_CONFIG_BUS_TLAST =
- AXI_WRAPPER_BASE + 2; // tdata with tvalid & tlast asserted
-
static const size_t CMD_FIFO_SIZE = 256; // Lines == multiples of 8 bytes
static const size_t MAX_CMD_PKT_SIZE = 3; // Lines == multiples of 8 bytes
-// Named settings registers
-static const uhd::dict<std::string, uint32_t> DEFAULT_NAMED_SR =
- boost::assign::map_list_of("AXIS_CONFIG_BUS", AXIS_CONFIG_BUS)(
- "AXIS_CONFIG_BUS_TLAST", AXIS_CONFIG_BUS_TLAST);
-
-// Block ports
-static const size_t ANY_PORT = size_t(~0);
-static const size_t MAX_NUM_PORTS = 16;
-
// Regular expressions
static const std::string VALID_BLOCKNAME_REGEX = "[A-Za-z][A-Za-z0-9_]*";
static const std::string DEVICE_NUMBER_REGEX = R"-((?:(\d+)/)?)-";
diff --git a/host/lib/include/uhdlib/rfnoc/mgmt_portal.hpp b/host/lib/include/uhdlib/rfnoc/mgmt_portal.hpp
index 0e3e887f3..069ad9604 100644
--- a/host/lib/include/uhdlib/rfnoc/mgmt_portal.hpp
+++ b/host/lib/include/uhdlib/rfnoc/mgmt_portal.hpp
@@ -10,6 +10,7 @@
#include <uhdlib/rfnoc/chdr_ctrl_xport.hpp>
#include <uhdlib/rfnoc/chdr_packet_writer.hpp>
#include <uhdlib/rfnoc/rfnoc_common.hpp>
+#include <functional>
#include <memory>
#include <set>
diff --git a/host/lib/rfnoc/mgmt_portal.cpp b/host/lib/rfnoc/mgmt_portal.cpp
index 2fecacf2b..8ad214f5b 100644
--- a/host/lib/rfnoc/mgmt_portal.cpp
+++ b/host/lib/rfnoc/mgmt_portal.cpp
@@ -11,12 +11,16 @@
#include <uhdlib/rfnoc/chdr_packet_writer.hpp>
#include <uhdlib/rfnoc/mgmt_portal.hpp>
#include <uhdlib/utils/narrow.hpp>
-#include <unordered_set>
#include <boost/format.hpp>
+#include <chrono>
#include <cmath>
+#include <map>
#include <mutex>
#include <queue>
+#include <string>
#include <thread>
+#include <tuple>
+#include <vector>
namespace uhd { namespace rfnoc { namespace mgmt {