diff options
author | Trung N Tran <trung.tran@ettus.com> | 2018-05-08 15:30:08 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-05-09 07:17:04 -0700 |
commit | 667610b4e528e2ec5536007239547bf8a9c7bc2e (patch) | |
tree | ccb838163acec84158c58285f9c27e4e1d2a2ec3 /host/lib/rfnoc/legacy_compat.cpp | |
parent | 9cf1a8e99a76409b9be727d9efc8189bca54c4eb (diff) | |
download | uhd-667610b4e528e2ec5536007239547bf8a9c7bc2e.tar.gz uhd-667610b4e528e2ec5536007239547bf8a9c7bc2e.tar.bz2 uhd-667610b4e528e2ec5536007239547bf8a9c7bc2e.zip |
legacy_compat: skip fifo ports size check
We don't need to assert error if there are not enough fifo ports to connect
to radio. Radio ports still can be connected to all available fifo ports until they're running
out.
Diffstat (limited to 'host/lib/rfnoc/legacy_compat.cpp')
-rw-r--r-- | host/lib/rfnoc/legacy_compat.cpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp index e10d40511..ac3cc6e54 100644 --- a/host/lib/rfnoc/legacy_compat.cpp +++ b/host/lib/rfnoc/legacy_compat.cpp @@ -868,7 +868,7 @@ private: // methods const size_t rx_bpp = _rx_spp * BYTES_PER_SAMPLE + MAX_BYTES_PER_HEADER; const size_t tx_bpp = _tx_spp * BYTES_PER_SAMPLE + MAX_BYTES_PER_HEADER; block_name_to_block_map_t legacy_block_map = get_legacy_blocks(_device); - size_t index = 0 ; + size_t index = 0, sram_fifo_index = 0, dma_fifo_index = 0; auto ddc_snk_flat = _flatten_blocks_by_n_ports(legacy_block_map[DDC_BLOCK_NAME].second); auto duc_src_flat = _flatten_blocks_by_n_ports(legacy_block_map[DUC_BLOCK_NAME].first); auto duc_snk_flat = _flatten_blocks_by_n_ports(legacy_block_map[DUC_BLOCK_NAME].second); @@ -907,21 +907,29 @@ private: // methods down_stream_port = duc_snk_flat[index].second; } if (_has_sramfifo) { - UHD_ASSERT_THROW(index < sfifo_src_flat.size()); - auto sfifo_block = sfifo_src_flat[index].first->get_block_id(); - _graph->connect( - sfifo_block, sfifo_src_flat[index].second, - down_stream_block, down_stream_port, - tx_bpp - ); + if(sram_fifo_index < sfifo_src_flat.size()){ + auto sfifo_block = sfifo_src_flat[sram_fifo_index].first->get_block_id(); + _graph->connect( + sfifo_block, sfifo_src_flat[sram_fifo_index].second, + down_stream_block, down_stream_port, + tx_bpp + ); + sram_fifo_index++; + }else { + UHD_LOGGER_WARNING("RFNOC") << "[legacy compat] Running out of SRAM FIFO ports to connect."; + } }else if (_has_dmafifo) { - UHD_ASSERT_THROW(index < dfifo_src_flat.size()); - auto dfifo_block = dfifo_src_flat[index].first->get_block_id(); - _graph->connect( - dfifo_block, dfifo_src_flat[index].second, - down_stream_block, down_stream_port, - tx_bpp - ); + if(dma_fifo_index < dfifo_src_flat.size()){ + auto dfifo_block = dfifo_src_flat[dma_fifo_index].first->get_block_id(); + _graph->connect( + dfifo_block, dfifo_src_flat[dma_fifo_index].second, + down_stream_block, down_stream_port, + tx_bpp + ); + dma_fifo_index++; + }else { + UHD_LOGGER_WARNING("RFNOC") << "[legacy compat] Running out of DRAM FIFO ports to connect."; + } } index++; } |