aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2022-05-02 15:01:13 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2022-06-10 13:24:05 -0500
commit022386279a3ef4fa364ab5e2041eedeb3bd7b07b (patch)
treef06c647280942c6f056ed8bba07320303936c091 /host/tests
parent76156b15b7fa5636281a4139c2c856da0a7b05c5 (diff)
downloaduhd-022386279a3ef4fa364ab5e2041eedeb3bd7b07b.tar.gz
uhd-022386279a3ef4fa364ab5e2041eedeb3bd7b07b.tar.bz2
uhd-022386279a3ef4fa364ab5e2041eedeb3bd7b07b.zip
rfnoc: Add atomic_item_size property to FFT block
The atomic item size for the FFT block is always equal to the length of the FFT, multiplied by bytes-per-sample (4). For now, this is all the FFT block supports.
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/rfnoc_block_tests/fft_block_test.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/host/tests/rfnoc_block_tests/fft_block_test.cpp b/host/tests/rfnoc_block_tests/fft_block_test.cpp
index 15e1de8f2..f386a2b5f 100644
--- a/host/tests/rfnoc_block_tests/fft_block_test.cpp
+++ b/host/tests/rfnoc_block_tests/fft_block_test.cpp
@@ -178,6 +178,8 @@ BOOST_FIXTURE_TEST_CASE(fft_test_graph, fft_block_fixture)
node_accessor.init_props(&mock_ddc_block);
mock_sink_term.set_edge_property<std::string>(
"type", "sc16", {res_source_info::INPUT_EDGE, 0});
+ mock_sink_term.set_edge_property<size_t>(
+ PROP_KEY_ATOMIC_ITEM_SIZE, 1234, {res_source_info::INPUT_EDGE, 0});
UHD_LOG_INFO("TEST", "Creating graph...");
graph.connect(&mock_radio_block, &mock_ddc_block, edge_info);
@@ -186,4 +188,13 @@ BOOST_FIXTURE_TEST_CASE(fft_test_graph, fft_block_fixture)
UHD_LOG_INFO("TEST", "Committing graph...");
graph.commit();
UHD_LOG_INFO("TEST", "Commit complete.");
+
+ UHD_LOG_INFO("TEST", "Testing atomic item size manipulation...");
+ // Try setting the atomic item size to some other value, it should bounce
+ // back
+ mock_sink_term.set_edge_property<size_t>(
+ PROP_KEY_ATOMIC_ITEM_SIZE, 1996, {res_source_info::INPUT_EDGE, 0});
+ BOOST_CHECK_EQUAL(test_fft->get_length() * 4,
+ mock_sink_term.get_edge_property<size_t>(
+ PROP_KEY_ATOMIC_ITEM_SIZE, {res_source_info::INPUT_EDGE, 0}));
}