aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
Commit message (Collapse)AuthorAgeFilesLines
* uhd: Remove references to device3Martin Braun2021-04-302-11/+7
| | | | device3 was an object used in UHD-3 RFNoC. It is no longer required.
* uhd: Update all headers for setters on multi_usrp re coerce/throwMartin Braun2021-04-191-50/+144
| | | | | | | | | | | | | | | Our APIs are not consistent when it comes to handling invalid settings. Some setting (like antenna, LO name, ...) will trigger an exception when invalid. Other settings (gain, frequency, clock rate) will get coerced to a valid value. This behaviour does make sense for the most part (it is more intuitive that 81 dB gets coerced to 80 dB if that's the maximum, but coercing an invalid antenna value like "RX1" has no clear alternative). And in any case, this is the behaviour that UHD has always had. In this commit, all Doxygen headers in multi_usrp are updated to exactly describe their behaviour (coerce or throw).
* rfnoc: radio: Add getter for SPC valueMartin Braun2021-03-192-0/+27
| | | | | | This adds uhd::rfnoc::radio_control::get_spc(). It can be overridden by radio implementations, but radio_control_impl has a sensible default implementation, return the value that is in the SPC radio register.
* uhd: enable vcpkg support on windowsSteven Koo2021-03-192-4/+10
| | | | | | | | | | | | | | | | | | | | vcpkg can be used for the Windows C++ dependencies for uhd with this commit. To use vcpkg on Windows: 1) Copy the custom triplets in host/cmake/vcpkg/ to the vcpkg/triplets/ folder. 2) Install boost and libusb for the custom triplet "vcpkg install libusb:uhd-x64-windows-static-md boost:uhd-x64-windows-static-md" 3) Call CMake with vcpkg toolchain file flags: -DVCPKG_TARGET_TRIPLET=uhd-x64-windows-static-md -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALL_DIR%/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 16 2019" -A x64 Replace the -G with the installed version of Visual Studio and matching architecture. Then build normally by running vcvarsall.bat and msbuild. Signed-off-by: Steven Koo <steven.koo@ni.com>
* uhd: Fix radio_control-related method constnessMartin Braun2021-03-171-3/+2
| | | | | | | | | | | | | | | | | The const-ness of some radio_control differed between base class and implementation. This fixes the consistency, but also makes sure these methods follow the rules for when to make methods 'const'. The following rules apply: - Methods that query static capabilities are const. Here, we made get_tx_lo_sources() const (the RX version was already const). - Getters that may have to interact with the device (e.g., peek a register) are not const, because the act of peeking is usually also non-const. Here, we changed get_rx_lo_export_enabled() to non-const. - All base classes are fixed such that the derived classes and the base classes have the same const-ness. Clang was warning about differences. This can cause very tricky bugs, where the radio_control_impl version can get called instead of the intended child class.
* host: Update code base using clang-tidyMartin Braun2021-03-0411-127/+127
| | | | | | | | | 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
* mpmd: Skip find if "resource" key is specifiedmichael-west2021-02-111-7/+0
| | | | | | | | | | | MPM devices were being discovered when trying to locate PCIe connected devices. Adding filter to exclude them if the "resource" key is specified in the device address arguments. Replaces "lib: disable non pcie types in find with resource" to reduce impact to older devices and remove API change. Signed-off-by: michael-west <michael.west@ettus.com>
* usrp: Remove old header file declarationsLane Kolbly2021-02-031-33/+0
| | | | | | The definitions of these functions were deleted in 23f4f8cf4ea72, and so now we can remove the declarations from the header file to prevent any confusion.
* sim: Fix CHDR header stringificationAaron Rossetto2021-01-211-4/+5
| | | | | | | | | | Prior to Boost 1.66, boost::format() did not support the %b format specifier, yet the minimum version of Boost required to build UHD is Boost 1.58 (as specified in the CMakeLists.txt file). Rather than force an upgrade of Boost on everyone, this commit replaces the %b format specifiers with %c and provides 'Y' or 'N' values based on the Booleans in the CHDR header being printed (EOV and EOB).
* mpmd: Add support to delay and trigger fpga/dts load after updateVirendra Kakade2021-01-111-0/+2
| | | | | | | | | Add a new image_loader argument delay_reload to provide a way to update components but optionally delay the actual load. Similarly add a new argument, just_reload, to enable uhd to reload the fpga/dts components. Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
* rfnoc: Make NIPC match CHDR width by default for NSS blockWade Fife2021-01-111-1/+1
|
* rfnoc: Add accessors for item width and nipc for NSSWade Fife2021-01-111-0/+8
| | | | | | - Add get_item_width() and get_nipc() methods to the Null/Source/Sink block controller. - Add missing enumerated types for get_count() method.
* uhd: Split radio_control into rf_control interfacesLane Kolbly2021-01-115-582/+657
| | | | | | These rf_control interfaces allow easier implementation of radio controls as well as allowing easier sharing of code for implementing e.g. gain_profile.
* uhd: revert "Check property type at access..."Steven Koo2021-01-082-11/+3
| | | | | | | | | | This change reverts cb9329a681552e6ac6277d16e1627afcbb23e637. The type checking is causing some conversion issues on clang/macos. The type_index checking doesn't work correctly across shared libraries and should not be relied on to verify type, since it can vary from compiler to compiler. Signed-off-by: Steven Koo <steven.koo@ni.com>
* uhd: clang: Fix fallthrough attributeMartin Braun2021-01-081-1/+1
| | | | | | | See also: https://clang.llvm.org/docs/AttributeReference.html#fallthrough The attribute was missing a semicolon.
* graph: Restore default resolver callback at node removalAaron Rossetto2020-11-201-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default resolve callback behavior for a newly-instantiated `node_t` object resolves all dirty properties associated with the node, then marks the properties as clean. When the node is added to a graph, its resolver callback is updated to use the graph property propagation algorithm in `graph_t::resolve_all_properties()`, which is considerably more sophisticated and relies on the graph topology to do its work. When a connection between two nodes is broken via the `graph::disconnect()` method, nodes which no longer have incoming or outgoing edges (connections) are removed from the graph. Prior to this change, the removed node's resolver callback was left pointing at the graph property propagation algorithm. In certain use cases, this could result in unexpected client-facing behavior. Consider, for example, this code (incomplete and for illustrative purposes only) which creates a streamer on one transmit chain of a multi-channel device, destroys that streamer, then creates a stream on the other transmit chain. Attempting to set the TX rate on the first chain after destroying the streamer does not result in the expected rate change, despite the same code working correctly before creating the streamer: constexpr size_t CH0 = ..., CH1 = ...; uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(...); // Set a TX rate on both chains; this succeeds usrp->set_tx_rate(initial_rate, CH0); usrp->set_tx_rate(initial_rate, CH1); assert(initial_rate == usrp->get_tx_rate(CH0)); assert(initial_rate == usrp->get_tx_rate(CH1)); // Create a TX streamer for channel 0 std::vector<size_t> chain0_chans{CH0}; stream_args_t sa; sa.channels = chain0_chans; sa.otw_format = ...; sa.cpu_format = ...; uhd::tx_streamer::sptr txs = usrp->get_tx_stream(sa); // Destroy the first streamer (disconnecting the graph) and // create a streamer for channel 1 txs.reset(); std::vector<size_t> chain1_chans{CH1}; sa.channels = chain1_chans; txs = usrp->get_tx_stream(sa); // Now try to set a new TX rate on both chains usrp->set_tx_rate(updated_rate, CH0); usrp->set_tx_rate(updated_rate, CH1); assert(updated_rate == usrp->get_tx_rate(CH0)); // <--- FAILS assert(updated_rate == usrp->get_tx_rate(CH1)); The reason this fails is because the second call to `set_tx_rate()` on channel 0 internally sets the 'interp' (interpolation ratio) property on the DUC node via the call to the DUC block controller's `set_input_rate()` function. As the DUC node is no longer part of the graph, having been removed from it when the first streamer instance was destroyed, the graph property propagation algorithm doesn't 'see' the node with the dirty property, and the 'interp' property resolver callback is never invoked. As a result, the DUC's input rate property, which depends on the interpolation ratio value, is never updated, and thus calling the `get_tx_rate()` function to query the new rate of the TX chain results in an unexpected value. In fact, in this particular case, `set_tx_rate()` actually raises a warning that the TX rate couldn't be set, and a message is printed to the console. This commit remedies the situation by restoring the default resolve callback behavior for a node when it is removed from the graph. This allows the framework to be able to invoke the property resolver callback on that node when a property is updated, the expected behavior of a newly instantiated node.
* rfnoc: Add Makefile.srcs to switchboard.ymlWade Fife2020-11-191-0/+1
|
* tests: mock_block: Allow mock blocks to carry MB controllersMartin Braun2020-10-091-1/+3
|
* rfnoc: Alphabetize sections in CMakeLists.txtAaron Rossetto2020-10-091-22/+22
|
* rfnoc: Add add'l header files to CMakeLists.txtAaron Rossetto2020-10-091-0/+3
|
* lib: disable non pcie types in find with resourceSteven Koo2020-10-051-0/+7
| | | | | | | mpmd find doesn't respect the "resource" arg hint and can be detected when "resource" is set. This results in incorrect device selection when using PCIe. This change adds detection for "resource" as a prefix in the device hints for mpmd and the other devices.
* uhd: replace default initializers with named onesSteven Koo2020-09-251-1/+3
| | | | This resolves an issue with building on older compilers.
* multi_usrp: Add get_mb_controller() API callCristina Fuentes2020-09-241-0/+20
|
* fpga: Update DRAM IO signaturesWade Fife2020-09-037-147/+6
| | | | | | | | This updates the IO signatures so that all devices and RFNoC blocks use the same IO signature for the DRAM. This is needed because the IO signatures must match between the RFNoC blocks and the devices. This means that some devices have extra bits in the IO signature for the address, but the extra bits will simply be ignored.
* uhd: Add APIs for getting the available power rangeMartin Braun2020-08-172-0/+44
| | | | | | | | | The previously added APIs for getting/setting power reference levels was missing an option to read back the currently available power levels (minimum and maximum power levels). This adds getters for TX and RX power ranges to multi_usrp and radio_control. The power API is thus now more similar to the gain API, which always had getters for gain ranges.
* rfnoc: set a nop destructor for clang crashSteven Koo2020-08-121-0/+5
| | | | | Clang will generate an illegal instruction if a virtual destructor isn't defined.
* rfnoc: Resolves streamer/link segfaults on pythonSteven Koo2020-08-111-1/+1
| | | | | | | | | This commit resolves a segfault that occurs during teardown. Since teardown isn't detereministic in python, there were cases where the graph would destruct before the streamers or links got chance to cleanup. This would result in a segfault. This change gives the lambda a shared pointer to the object the callback method is calling on, so that it won't destruct before being called.
* rfnoc: Remove M_PI usage to fix Windows buildsSteven Koo2020-08-072-4/+5
| | | | | | M_PI may not exist if _USE_MATH_DEFINES isn't defined before the first include of math.h or cmath on Windows. This changes avoids the issue all together by defining our own PI.
* utils: Change template specialization namespacingBill Davis2020-08-051-8/+10
| | | | | There is a gcc bug for template specialization that causes compile errors. Reformatting the namespacing avoids the bug.
* rfnoc: Add Keep One in N block supportAaron Rossetto2020-08-053-0/+86
|
* fpga: rfnoc: Add RFNoC Keep One in N blockAaron Rossetto2020-08-051-0/+56
|
* RFNoC: Add disconnect methods to graphmichael-west2020-08-041-1/+39
| | | | | | | | | | - Added method to disconnect an edge - Added method to remove a node - Fixed algorithm to check edges during connect. Previous code was checking some edges twice and allowing duplicate edges to be created for existing edges. Signed-off-by: michael-west <michael.west@ettus.com>
* rfnoc: Add RFNoC replay blockmattprost2020-08-042-1/+326
| | | | Signed-off-by: mattprost <matt.prost@ni.com>
* fpga: rfnoc: Add RFNoC Replay blockWade Fife2020-08-041-0/+63
|
* rfnoc: Add siggen RFNoC block controller supportAaron Rossetto2020-07-303-0/+209
|
* fpga: rfnoc: Add Signal Generator RFNoC blockWade Fife2020-07-301-0/+55
|
* rfnoc: Add Switchboard block supportJesse Zhang2020-07-303-0/+50
|
* fpga: Add Switchboard RFNoC blockJesse Zhang2020-07-301-0/+41
|
* rfnoc: Support instance overrides in set_properties()Aaron Rossetto2020-07-242-0/+24
| | | | | | | | | | | | | | | | | | | | | | | This commit adds an enhancement to node_t::set_properties() in which the instance argument provided to the function (which normally applies to all properties in the key/value list) can be overridden on a per-property basis using a special syntax. If the key consists of the property name followed by a colon (':') and then a number, the number following the colon is used to determine which instance of the property this set pertains to, and the value passed via the instance parameter is ignored for that property. For example, in the following call: node->set_properties("dog=10,cat:2=5,bird:0=0.5", 1) instance 1 of node's 'dog' property is set to 10, the 1 coming from the instance parameter, instance 2 of the node's 'cat' property is set to 5 due to the override syntax provided in the string, and instance 0 of the node's 'bird' property is set to 0.5 due to its override. If the name/instance pair is malformed, e.g. 'value:=10' or 'value:foobar=10', a runtime error is thrown.
* uhd: remove liberioRobertWalstab2020-07-201-1/+0
|
* multi_usrp: Add get_radio_control() API callMartin Braun2020-07-161-0/+20
| | | | | This is an advanced API call that allows direct underlying access to the radio_control object for RFNoC devices.
* multi_usrp: Fix some documentationMartin Braun2020-07-161-1/+3
|
* fpga: rfnoc: Add RFNoC Moving Average blockWade Fife2020-07-161-0/+55
|
* rfnoc: Add Moving Average block controllermattprost2020-07-163-11/+75
| | | | Signed-off-by: mattprost <matt.prost@ni.com>
* python: Add bindings for C++ CHDR ParserSamuel O'Brien2020-07-162-0/+40
| | | | | | | | | | | | | This commit adds pybind11 glue code for the userland chdr parsing code introduced in the uhd::utils::chdr namespace. Additionally, it moves some pybind11 adapter code to a common pybind_adaptors.hpp file which originally existed in the cal_python.hpp file. This commit also adds unit tests for the python bindings using a captured wireshark trace which is located in rfnoc_packets_*.py and some handwritten packets in hardcoded_packets.py Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* utils: Expose CHDR Parsing APISamuel O'Brien2020-07-136-11/+371
| | | | | | | | | | | | This commit introduces a new public api in uhd::utils which allows serializing and deserializing chdr packets. As far as testing, this commit adds the chdr_parse_test test. It uses a wireshark trace located in rfnoc_packets_*.cpp as well as hand coded packets from hardcoded_packets.cpp to test the serialization and deserialization process Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* utils: Expose CHDR Types in Public APIrobot-rover2020-07-134-0/+920
| | | | | | | | | | This commit exposes uhdlib/rfnoc/chdr_types.hpp in the public includes. Additionally, it takes some types from uhdlib/rfnoc/rfnoc_common.hpp and exposes them publicly in uhd/rfnoc/rfnoc_types.hpp. Finally, one constant is moved from uhdlib/rfnoc/rfnoc_common.hpp to uhd/rfnoc/constants.hpp Signed-off-by: robot-rover <sam.obrien@ni.com>
* meta-ettus: remove io_type.hppSteven Koo2020-07-082-66/+0
| | | | | | | io_type's implementation was removed when host/lib/depricated.cpp was removed. This commit also removes the hpp and installation. Signed-off-by: Steven Koo <steven.koo@ni.com>
* rfnoc: Add Log Power RFNoC block supportAaron Rossetto2020-06-293-0/+29
|
* fpga: rfnoc: Add Log-Power blockWade Fife2020-06-291-0/+56
|