From f3d4d317f7d8e83c1435de4208fa66754522c1e2 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 29 Jun 2017 17:24:20 -0700 Subject: rfnoc: Fixed SRAM FIFO indexing Loopback FIFOs ("SRAM FIFOs") only have a single channel, unlike the DRAM FIFOs (and that's also the reason why we have full bandwdith between all channels using those). We thus need to ensure that every TX stream gets its own SRAM FIFO. --- host/lib/rfnoc/legacy_compat.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'host/lib') diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp index 70fe067f8..7b80bf175 100644 --- a/host/lib/rfnoc/legacy_compat.cpp +++ b/host/lib/rfnoc/legacy_compat.cpp @@ -520,7 +520,10 @@ private: // methods ) { if (dir == uhd::TX_DIRECTION) { if (_has_sramfifo) { - return block_id_t(mboard_idx, SFIFO_BLOCK_NAME, radio_index).to_string(); + const size_t sfifo_idx = + radio_index * _num_tx_chans_per_radio + port_index; + port_index = 0; + return block_id_t(mboard_idx, SFIFO_BLOCK_NAME, sfifo_idx).to_string(); } else if (_has_dmafifo) { port_index = radio_index; return block_id_t(mboard_idx, DFIFO_BLOCK_NAME, 0).to_string(); @@ -738,8 +741,11 @@ private: // methods // Prioritize SRAM over DRAM for performance if (_has_sramfifo) { // We have SRAM FIFO *and* DUCs + // SRAM FIFOs have only 1 channel per block + const size_t sfifo_idx = + _num_tx_chans_per_radio * radio + chan; _graph->connect( - block_id_t(mboard, SFIFO_BLOCK_NAME, radio), chan, + block_id_t(mboard, SFIFO_BLOCK_NAME, sfifo_idx), chan, block_id_t(mboard, DUC_BLOCK_NAME, radio), chan, tx_bpp ); @@ -753,8 +759,11 @@ private: // methods } } else if (_has_sramfifo) { // We have SRAM FIFO, *no* DUCs + // SRAM FIFOs have only 1 channel per block + const size_t sfifo_idx = + _num_tx_chans_per_radio * radio + chan; _graph->connect( - block_id_t(mboard, SFIFO_BLOCK_NAME, radio), radio, + block_id_t(mboard, SFIFO_BLOCK_NAME, sfifo_idx), 0, block_id_t(mboard, RADIO_BLOCK_NAME, radio), chan, tx_bpp ); -- cgit v1.2.3