diff options
Diffstat (limited to 'host/lib/rfnoc/legacy_compat.cpp')
-rw-r--r-- | host/lib/rfnoc/legacy_compat.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp index 7acaa898c..bf653a89a 100644 --- a/host/lib/rfnoc/legacy_compat.cpp +++ b/host/lib/rfnoc/legacy_compat.cpp @@ -45,6 +45,7 @@ using uhd::stream_cmd_t; ***********************************************************************/ static const std::string RADIO_BLOCK_NAME = "Radio"; static const std::string DFIFO_BLOCK_NAME = "DmaFIFO"; +static const std::string SFIFO_BLOCK_NAME = "FIFO"; static const std::string DDC_BLOCK_NAME = "DDC"; static const std::string DUC_BLOCK_NAME = "DUC"; static const size_t MAX_BYTES_PER_HEADER = @@ -131,6 +132,7 @@ public: _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_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. _num_tx_chans_per_radio( @@ -165,8 +167,12 @@ public: } if (args.has_key("skip_dram")) { UHD_LEGACY_LOG() << "[legacy_compat] Skipping DRAM by user request." << std::endl; - } else if (not _has_dmafifo) { - UHD_MSG(warning) << "[legacy_compat] No DMA FIFO detected. You will only be able to transmit at slow rates." << std::endl; + } + if (args.has_key("skip_sram")) { + UHD_LEGACY_LOG() << "[legacy_compat] Skipping SRAM by user request." << std::endl; + } + if (not _has_dmafifo and not _has_sramfifo) { + UHD_MSG(warning) << "[legacy_compat] No FIFO detected. Higher transmit rates may encounter errors." << std::endl; } for (size_t mboard = 0; mboard < _num_mboards; mboard++) { @@ -522,7 +528,9 @@ private: // methods size_t &port_index ) { if (dir == uhd::TX_DIRECTION) { - if (_has_dmafifo) { + if (_has_sramfifo) { + return block_id_t(mboard_idx, SFIFO_BLOCK_NAME, radio_index).to_string(); + } else if (_has_dmafifo) { port_index = radio_index; return block_id_t(mboard_idx, DFIFO_BLOCK_NAME, 0).to_string(); } else { @@ -736,7 +744,15 @@ private: // methods block_id_t(mboard, RADIO_BLOCK_NAME, radio), chan, tx_bpp ); - if (_has_dmafifo) { + // Prioritize SRAM over DRAM for performance + if (_has_sramfifo) { + // We have SRAM FIFO *and* DUCs + _graph->connect( + block_id_t(mboard, SFIFO_BLOCK_NAME, radio), chan, + block_id_t(mboard, DUC_BLOCK_NAME, radio), chan, + tx_bpp + ); + } else if (_has_dmafifo) { // We have DMA FIFO *and* DUCs _graph->connect( block_id_t(mboard, DFIFO_BLOCK_NAME, 0), radio, @@ -744,6 +760,13 @@ private: // methods tx_bpp ); } + } else if (_has_sramfifo) { + // We have SRAM FIFO, *no* DUCs + _graph->connect( + block_id_t(mboard, SFIFO_BLOCK_NAME, radio), radio, + block_id_t(mboard, RADIO_BLOCK_NAME, radio), chan, + tx_bpp + ); } else if (_has_dmafifo) { // We have DMA FIFO, *no* DUCs _graph->connect( @@ -843,6 +866,7 @@ private: // attributes const bool _has_ducs; const bool _has_ddcs; const bool _has_dmafifo; + const bool _has_sramfifo; const size_t _num_mboards; const size_t _num_radios_per_board; const size_t _num_tx_chans_per_radio; |