aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-12-22 11:55:17 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:06:11 -0800
commitc8cdbfc4d4e307017e02dd48c449d3e3f38118af (patch)
treeb948b848fbcae0bbe0cd49d2f8a1068c48566282 /host/lib/rfnoc
parent29bff463b29f523f22aa1d4426eafa8d0e4a4706 (diff)
downloaduhd-c8cdbfc4d4e307017e02dd48c449d3e3f38118af.tar.gz
uhd-c8cdbfc4d4e307017e02dd48c449d3e3f38118af.tar.bz2
uhd-c8cdbfc4d4e307017e02dd48c449d3e3f38118af.zip
rfnoc: compat: Disable DMA FIFO if more radios than DMA channels exist
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r--host/lib/rfnoc/legacy_compat.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp
index 137909d8b..31297f271 100644
--- a/host/lib/rfnoc/legacy_compat.cpp
+++ b/host/lib/rfnoc/legacy_compat.cpp
@@ -86,6 +86,36 @@ size_t calc_num_tx_chans_per_radio(
);
}
+bool check_if_has_dma_fifo(
+ const uhd::device_addr_t &args,
+ uhd::device3::sptr device,
+ uhd::property_tree::sptr tree
+) {
+ if (device->find_blocks(DFIFO_BLOCK_NAME).empty()) {
+ return false;
+ }
+
+ if (args.has_key("skip_dram")) {
+ UHD_LOG_DEBUG("RFNOC",
+ "[legacy_compat] Skipping DRAM at user request.");
+ return false;
+ }
+
+ const size_t num_radios_per_board =
+ device->find_blocks<radio_ctrl>("0/Radio").size();
+ const size_t num_radio_ports = (num_radios_per_board > 0)
+ ? num_ports(tree, RADIO_BLOCK_NAME, "in")
+ : 0;
+ const size_t num_dmafifo_ports = num_ports(tree, DFIFO_BLOCK_NAME, "in");
+ if (num_dmafifo_ports < num_radios_per_board * num_radio_ports) {
+ UHD_LOG_WARNING("RFNOC",
+ "[legacy_compat] More radio channels than DMA FIFO channels. "
+ "Skipping DMA FIFO.");
+ return false;
+ }
+ return true;
+}
+
/*! Recreate passed property without bound subscribers. Maintains current property value.
*/
template <typename T>
@@ -111,7 +141,7 @@ public:
_tree(device->get_tree()),
_has_ducs(not args.has_key("skip_duc") and not device->find_blocks(DUC_BLOCK_NAME).empty()),
_has_ddcs(not args.has_key("skip_ddc") and not device->find_blocks(DDC_BLOCK_NAME).empty()),
- _has_dmafifo(not args.has_key("skip_dram") and not device->find_blocks(DFIFO_BLOCK_NAME).empty()),
+ _has_dmafifo(check_if_has_dma_fifo(args, device, _tree)),
_has_sramfifo(not args.has_key("skip_sram") and not device->find_blocks(SFIFO_BLOCK_NAME).empty()),
_num_mboards(_tree->list("/mboards").size()),
_num_radios_per_board(device->find_blocks<radio_ctrl>("0/Radio").size()), // These might throw, maybe we catch that and provide a nicer error message.