From 667610b4e528e2ec5536007239547bf8a9c7bc2e Mon Sep 17 00:00:00 2001 From: Trung N Tran Date: Tue, 8 May 2018 15:30:08 -0700 Subject: 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. --- host/lib/rfnoc/legacy_compat.cpp | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'host/lib/rfnoc') 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++; } -- cgit v1.2.3