aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
Commit message (Collapse)AuthorAgeFilesLines
* fixup! examples: gpio: Refactor exampleMartin Braun2022-06-101-14/+32
| | | | | | The example refactoring required usage of the get/set source API, which isn't available on B2xx series. This patch tests for the existence of said API, and disables its usage if appropriate.
* fixup! examples: gpio: Refactor exampleMartin Braun2022-06-101-4/+13
| | | | | | | | | | The refactoring changed the behaviour of --bitbang: before, it would terminate after one readback unless --repeat was specified, in which case it would require a Ctrl-C (SIGINT). After the refactoring, it always required a SIGINT. This changes the behaviour back to prior to 727141d, and will now only read back once, unless --repeat is provided. This also fixes the bitbang devtest, which would go on indefinitely.
* examples: gpio: Refactor exampleMartin Braun2022-06-101-286/+368
| | | | | | | | | | | | | | | | The example had organically grown and was getting hard to read, and also had some known issues. Summary of fixes: - Default GPIO bank and connector are now derived from the device. This allows this example to pass without throwing an exception on E3xx and X4xx series when using default arguments. - The bitbang test is moved into its own code section, to make the rest more readable. - We move all the streamer-related code into a helper struct - Some repetitive parts of the code are moved into their own functions - The argument --require-loopback is added, which will fail tests if GPIO pins are not correctly looped back externally - --list-banks is renamed to --list_banks for consistency
* fpga: rfnoc: Remove rfnoc_version from target YAMLWade Fife2022-06-101-1/+0
| | | | | | This causes the latest RFNoC protocol version to be used by default and avoids the need to update YAML files every time the RFNoC protocol version gets bumped.
* examples: Fix gain testbench nameWade Fife2022-04-061-1/+1
|
* host: SPI: Read number of supported SPI slaves from deviceMartin Anderseck2022-04-041-3/+7
| | | | | | Add support for reading the number of supported SPI slaves from the device. This has become necessary because we may have bitfiles with different capabilities and we want to report this back correctly.
* rfnoc: Update device port names in image core YAMLWade Fife2022-03-311-50/+59
| | | | | | Update USRP RFNoC iamge core YAML files to use the more consistent device port names. Clean up the formatting and make the files more consistent.
* examples: Add replay_capture.pyMartin Braun2022-03-312-0/+311
| | | | | This is an example that allows capturing RF data into DRAM, and then stream it back to host, using the Python API.
* rfnoc: Remove UHD3-API usagesMartin Braun2022-03-111-3/+0
| | | | | | | - rfnoc_replay_samples_from_file still had UHD3-vestiges for selecting block port and ID - The documentation for stream_args_t also included block port and ID examples
* tests: Atomicize counters in benchmark_rateAaron Rossetto2022-03-071-10/+10
| | | | | | | | The counters that keep track of overruns, underruns, number of samples transferred, etc., were not atomic. Thus, running benchmark_rate with multiple threads would result in inaccurate statistics being reported at the end of the run. This commit makes those counters atomic variables so that they are updated properly.
* fpga: rfnoc: Regenerate noc_shellsWade Fife2022-03-041-1/+2
|
* examples: benchmark_rate improvementsmichael-west2022-03-031-95/+124
| | | | | | | - Added support for tx_spb and rx_spb arguments - Fixed TX thread timestamp for single channel Signed-off-by: michael-west <michael.west@ettus.com>
* examples: replay: Improve rfnoc_replay_samples_from_fileMartin Braun2022-03-021-127/+87
| | | | | | | | | | - Use connect_through_blocks() to create connections - Remove check for spp being an integer multiple of the word size, the atomic item size feature will do that for us now - When using --nsamps, automatically terminate application after samples have been tx'd. - Added sleep statements to throttle empty while loops - Minor formatting changes
* cmake: ncurses: fix building with split tinfoRick Farina (Zero_Chaos)2022-02-241-0/+1
| | | | | This fixes an issue where tinfo and ncurses are split into separate libraries.
* rfnoc: Remove references to nocscript from YAML filesMartin Braun2022-02-231-1/+0
| | | | | The sw_iface entry in the `control` section is yet underdefined, so we can remove it from the block descriptors.
* SPI: Add SPI exampleMartin Anderseck2022-01-142-0/+136
| | | | Add example to demonstrate and test SPI functionality.
* examples: support multiple streamers in benchmark_rateAndrew Lynch2022-01-101-43/+103
|
* examples: Fix tx_bursts bandwidth/freq/gain reportingMartin Braun2021-12-161-11/+9
| | | | | | | | | | | | | This example would not specify a channel when querying the actual frequency/bandwidth/gain after setting it. When using the --channels options like this: tx_bursts --channels 1 --freq 1e9 [...] ...it would request the frequency of 1 GHz on channel 1, then query the frequency on channel 0 when reporting the "actual" frequency. Also removes some boost::format().
* rfnoc: Fix noc_shell direction commentsWade Fife2021-12-081-2/+2
| | | | | | Some comments describing data flow direction were wrong. This commit updates the Mako files and updates the noc_shell modules with newly generated versions.
* examples: Improve rfnoc_rx_to_fileMartin Braun2021-12-011-112/+143
| | | | | | | | | | | | | | | This example had some major issues since UHD 4, which are now fixed. Mainly, the option to include a custom RFNoC block was not working. The example was rehauled severely: - Custom blocks are now usable again. - UHD/RFNoC code is used for the connections, rather than a custom kludge. - Sample rate is set via property propagation - boost::format() was not helpful in this example, and was removed. - A list of active connections is now printed - The --block-args argument is dropped in favour of --block-props. The former never did anything useful, and "block args" are a UHD 3 thing.
* examples: Use cmul for gain block in-tree IP exampleWade Fife2021-11-151-21/+18
|
* examples: Test all variants in gain testbenchWade Fife2021-11-043-15/+61
|
* examples: Make IQ order clear in gain RFNoC blockWade Fife2021-11-041-16/+25
|
* example: gpio: Separate bank and port argumentsLane Kolbly2021-11-031-10/+18
| | | | | | | "bank" refers to what the radio control sees, and "port" refers to what the user looking at the physical device sees. For example, on X410 each radio control only has a single (24-bit) output, which can be routed to either of two ports.
* rfnoc: Remove cruft from UHD 3 (constants)Martin Braun2021-11-021-31/+0
| | | | | | | | | | | | | This removes some constants from UHD that were left over from RFNoC/UHD 3.x. They are unused. rfnoc_rx_to_file had a commented-out section that was also UHD-3 only. Note that rfnoc/constants.hpp is pretty bare now, and could be removed. However, it is in the public header section, so we shall leave the used constants where they are. This requires fixing includes in mgmt_portal.cpp.
* uhd: Replace Boost mutexes and locks with standard optionsMartin Braun2021-10-191-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a very mechanical task that could almost have been done with sed. Boost versions of mutexes and locks were removed, and replaced with std:: versions. The replacement tables are as follows: == Mutexes == - boost::mutex -> std::mutex - boost::recursive_mutex -> std::recursive_mutex Mutexes behave identically between Boost and std:: and have the same API. == Locks == C++11 has only two types of lock that we use/need in UHD: - std::lock_guard: Identical to boost::lock_guard - std::unique_lock: Identical to boost::unique_lock Boost also has boost::mutex::scoped_lock, which is a typedef for boost::unique_lock<>. However, we often have used scoped_lock where we meant to use lock_guard<>. The name is a bit misleading, "scoped lock" sounding a bit like an RAII mechanism. Therefore, some previous boost::mutex::scoped_lock are now std::lock_guard<>. std::unique_lock is required when doing more than RAII locking (i.e., unlocking, relocking, usage with condition variables, etc.). == Condition Variables == Condition variables were out of the scope of this lock/mutex change, but in UHD, we inconsistently use boost::condition vs. boost::condition_variable. The former is a templated version of the latter, and thus works fine with std::mutex'es. Therefore, some boost::condition_variable where changed to boost::condition. All locks and mutexes use `#include <mutex>`. The corresponding Boost includes were removed. In some cases, this exposed issues with implicit Boost includes elsewhere. The missing explicit includes were added.
* bug: fix channel indexing when reading USRP powerLars Amsel2021-10-111-1/+1
| | | | | | | the USRP power meter will only receive from a single channel which is configured by the argument parameter. The streamer receive data will therefor alwalys have a single channel. So do not index with chan when passing the streamer to uhd.dsp.signals.get_usrp_power.
* python: multi_usrp: Fix issues in send_waveform()Martin Braun2021-10-061-7/+7
| | | | | | | - Like with RX, this now allows passing in stream time and existing streamer - There was no EOB being sent at the end (now there is) - Fixed some linter issues
* python: Fix dropped-sample calculation in benchmark_rate.pyMartin Braun2021-09-281-5/+7
| | | | | | | | | | This fixes a subtle bug, where a variable to cache the timestamp of an error gets bound to the metadata instead of creating a copy thereof. Without this fix, the calculation of dropped samples would always be 0, because the difference in timestamps would incorrectly be always zero. This fix will now make a copy of the timestamp. Shoutout to GitHub user bhorsfield for finding this issue.
* examples: Improve txrx_loopback_to_file (late recv, Boost, timing)Martin Braun2021-09-171-18/+22
| | | | | | | | | | | | - Fixes a bug where the RX stream command set set independent of the device time. Now, we read back get_time_now() to calculate the command time. - When using multiple RX USRPs, sync their times. Before, they were left untouched, causing possible timing mismatches. - Increase the initial timeout value. The previous value had only been tested with N2x0. - Replace the boost::thread_group with a std::thread. - Remove some boost::format where it didn't add value.
* cmake: Fix rfnoc-example (CMake paths)Martin Braun2021-09-173-11/+11
| | | | | This reverts part of 09d94529e, which should not have touched these particular CMake files.
* cmake: Replace CMAKE_{SOURCE,BINARY}_DIR with UHD_*_DIRMartin Braun2021-09-103-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | See the CMake 3.8 documentation on these two variables: https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.html https://cmake.org/cmake/help/v3.8/variable/CMAKE_SOURCE_DIR.html Under normal circumstances, these two are identical. For sub-projects (i.e., when building UHD as part of something else that is also a CMake project), only the former is useful. There is no discernible downside of using UHD_SOURCE_DIR over CMAKE_SOURCE_DIR. This was changed using sed: $ sed -i "s/CMAKE_SOURCE_DIR/UHD_SOURCE_DIR/g" \ `ag -l CMAKE_SOURCE_DIR **/{CMakeLists.txt,*.cmake}` $ sed -i "s/CMAKE_BINARY_DIR/UHD_BINARY_DIR/g" \ `ag -l CMAKE_BINARY_DIR **/{CMakeLists.txt,*.cmake}` At the same time, we also replace the CMake variable UHD_HOST_ROOT (used in MPM) with UHD_SOURCE_DIR. There's no reason to have two variables with the same meaning and different names, but more importantly, this means that UHD_SOURCE_DIR is defined even in those cases where MPM calls into CMake files from UHD without any additional patches. Shoutout to GitHub user marcobergamin for bringing this up.
* examples: Show how to use in-tree Verilog headerWade Fife2021-09-081-0/+17
| | | | | Adds example showing how to `include an in-tree Verilog header file in the rfnoc_block_gain example.
* examples: Add x400/x410 target to RFNoC exampleWade Fife2021-08-301-0/+3
|
* examples: Fix icores example to match current RFNoC specsMartin Braun2021-06-281-2/+2
| | | | The YAML file was using float-versions, not string versions.
* examples: Update example CMakeLists.txt for minimum version bumpsAaron Rossetto2021-06-282-3/+3
|
* examples: Fix tx frequency tuning in radio loopbackmattprost2021-06-251-2/+2
|
* uhd: Remove includes of list_of.hpp where appropriateMartin Braun2021-06-241-1/+0
| | | | This Boost header is included in some places, despite not being used.
* uhd: Remove all occurences of boost::math::*round()Martin Braun2021-06-242-5/+4
| | | | | | | Its behaviour is almost identical to std::lround, which we use instead. The only downside of std::lround is that it always returns a long, which we don't always need. We thus add some casts for those cases to make the compiler happy.
* fpga: Change RFNoC YAML version numbers to stringsWade Fife2021-06-081-2/+2
| | | | | Change version from a numeric to a string, in order to differentiate between versions like "1.1" and "1.10".
* examples: Fix underrun/seq error reporting in benchmark_rate.pyMartin Braun2021-05-201-10/+10
| | | | The numbers for these were swapped.
* examples: Add min dynamic range limit to ascii art DFT exampleLane Kolbly2021-04-152-3/+9
| | | | | | The DFT plotting routine hangs when the dynamic range equals zero, so this change adds a limit so that the dynamic range never goes below 10.
* examples: Add IP to OOT RFNoC gain exampleWade Fife2021-03-175-39/+335
| | | | | This updates the gain example to show how to use RFNoC IP, in-tree Xilinx IP, and out-of-tree Xilinx IP in a custom RFNoC block.
* examples: Remove unused arguments for rfnoc_radio_loopbackLane Kolbly2021-03-111-3/+14
|
* host: Update code base using clang-tidyMartin Braun2021-03-042-5/+5
| | | | | | | | | The checks from the new clang-tidy file are applied to the source tree using: $ find . -name "*.cpp" | sort -u | xargs \ --max-procs 8 --max-args 1 clang-tidy --format-style=file \ --fix -p /path/to/compile_commands.json
* examples: Fix PPS option in rfnoc_radio_loopbackLane Kolbly2020-11-171-1/+1
|
* examples: Fix --random option in benchmark_ratemichael-west2020-10-121-5/+11
| | | | | | | | The implementation was not properly configuring the stream command if the --random flag was used. It was especially bad when multiple channels were specified. Signed-off-by: michael-west <michael.west@ettus.com>
* Examples: Fix install paths in OOT RFNoC examplemichael-west2020-09-133-10/+14
| | | | | | | | - Add missing "uhd/" subdirectory. - Update install path for YAML file. - Fix include directories and link libraries for init_gain_block. Signed-off-by: michael-west <michael.west@ettus.com>
* examples: replay samples from filemattprost2020-08-113-414/+424
| | | | | | | This example exercises the Replay Block RFNoC API. The Replay records IQ data from a file and plays it back into a Radio for transmitting. Signed-off-by: mattprost <matt.prost@ni.com>
* example: Check for failure in tx_samples_from_fileSamuel O'Brien2020-07-311-3/+9
| | | | | | | | | | | I was using this example for testing with the simulator. If there is a flow control failure, the original example would just silently finish, outputing the message "Done!" (Not even printing a timeout message). This commit asserts that the number of samples sent is equal to the number of samples provided. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>