aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
Commit message (Collapse)AuthorAgeFilesLines
* uhd: Replace boost::regex with std::regexMartin Braun2019-11-267-32/+32
| | | | | | | | boost::regex was a requirement until the minimum version of gcc was increased. Since it is at version 5.3 now, using Boost.Regex is no longer necessary. This change is a pure search-and-replace; Boost and std versions of regex are compatible and use the same syntax.
* uhd: Replace boost::function with std::functionMartin Braun2019-11-2616-34/+35
| | | | | | | This is mostly a search-and-replace operation, with few exceptions: - boost::function has a clear() method. In C++11, this is achieved by assigning nullptr to the std::function object. - The empty() method is replaced by std::function's bool() operator
* uhd: Replace BOOST_FOREACH(v, c) with for(v : c)Martin Braun2019-11-261-1/+1
| | | | | Also removes all references to boost/foreach.hpp. BOOST_FOREACH is no longer necessary since all headers require C++11 anyway.
* uhd: Replace usage of boost smart pointers with C++11 counterpartsMartin Braun2019-11-26101-338/+334
| | | | | | | | | | | | | | | | | | | This removes the following Boost constructs: - boost::shared_ptr, boost::weak_ptr - boost::enable_shared_from_this - boost::static_pointer_cast, boost::dynamic_pointer_cast The appropriate includes were also removed. All C++11 versions of these require #include <memory>. Note that the stdlib and Boost versions have the exact same syntax, they only differ in the namespace (boost vs. std). The modifications were all done using sed, with the exception of boost::scoped_ptr, which was replaced by std::unique_ptr. References to boost::smart_ptr were also removed. boost::intrusive_ptr is not removed in this commit, since it does not have a 1:1 mapping to a C++11 construct.
* transport: Implement an I/O service that uses an offload threadCiro Nishiguchi2019-11-263-0/+1065
| | | | | | | The offload_io_service executes another I/O service instance within an offload thread, and provides synchronization mechanisms to communicate with clients. Frame buffers are passed from the offload thread to the client and back via single-producer, single-consumer queues.
* rfnoc: Unify endianness of transportsAlex Williams2019-11-264-4/+4
| | | | | Ethernet now uses the same serialization of the RFNoC stream as all the other transports.
* uhd: Check property type at access; error if mismatchAaron Rossetto2019-11-261-1/+24
|
* rfnoc: Port FFT controllerLars Amsel2019-11-262-0/+115
| | | | | | rfnoc used noc-script for FFT controller implementation. Because erfnoc does not support noc-script yet, the implementation is done as a rfnoc controller.
* rfnoc: Add DMA FIFO block controllerMartin Braun2019-11-265-401/+350
|
* Remove proto-RFNoC filesMartin Braun2019-11-2686-14372/+166
| | | | | | | This commit removes all files and parts of files that are used by proto-RFNoC only. uhd: Fix include CMakeLists.txt, add missing files
* x300/mpmd: Port all RFNoC devices to the new RFNoC frameworkMartin Braun2019-11-2687-8168/+11173
| | | | | | | Co-Authored-By: Alex Williams <alex.williams@ni.com> Co-Authored-By: Sugandha Gupta <sugandha.gupta@ettus.com> Co-Authored-By: Brent Stapleton <brent.stapleton@ettus.com> Co-Authored-By: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
* rfnoc: radio: Add API call to disable timestampsMartin Braun2019-11-262-1/+9
| | | | | By calling radio_control::enable_rx_timestamps(false, chan), the radio will not add timestamps to outgoing packets.
* rfnoc: radio: Interpret MTU as max payload sizeMartin Braun2019-11-261-3/+3
| | | | This matches the streamer code.
* transport: Port liberio to link_ifAlex Williams2019-11-265-315/+333
|
* rfnoc: Fix transport buffer reservationsCiro Nishiguchi2019-11-266-57/+74
| | | | | | | | | Change transports to reserve the number of frame buffers they actually need from the I/O service. Previously some I/O service clients reserved 0 buffers since they shared frame buffers with other clients, as we know the two clients do not use the links simultaneously. This is possible with the inline_io_service but not with a multithreaded I/O service which queues buffer for clients before they are requested.
* streamer: Add option to ignore sequence errorsCiro Nishiguchi2019-11-263-8/+9
| | | | Add template parameter to ignore sequence errors, used for testing.
* rfnoc: rfnoc_graph: Safely deinit full graph on any kind of init errorMartin Braun2019-11-261-15/+15
| | | | | | | In the rfnoc_graph, we init blocks, GSM, motherboard controllers, and other things. Since any of these can potentially throw exceptions, we make sure to deinit those components that have already initialized properly before exiting.
* rfnoc: Hold reference to streamers in rfnoc_graphCiro Nishiguchi2019-11-261-2/+11
| | | | | | | Add a shared pointer to the streamers to the rfnoc_graph, so that the streamers are not deallocated before the graph. Nodes in the graph, including the streamers, must remain in memory until the graph is no longer needed.
* rfnoc: Move data xport sep configuration to static methodsCiro Nishiguchi2019-11-269-417/+597
| | | | | | | Move the configuration logic for stream endpoints to static methods of the chdr data transports. This separates those interactions from the main transport code, simplifying both. It also makes it easier to use the transports with mock link objects.
* rfnoc: Add multi_usrp_rfnoc, modify multi_usrpBrent Stapleton2019-11-269-395/+2418
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a separate version of multi_usrp for RFNoC devices. It is compatible with RFNoC devices only, and prefers C++ APIs over property tree usage. The factory of multi_usrp is modified such that it picks the correct version, users of multi_usrp don't care about this change. This also introduces some API changes: - Removing redundant GPIO functions. Now all GPIO control, setting, and readback is done with uint32_t's. - Adding getter/setter for GPIO source. This was done to simplify the other GPIO settings, as the source for each pin is not always a binary. The CTRL mode, for example, can either be ATR or GPIO. However, the source can be controlled by various radios or "PS" or some other source. - Removing the mask from the RFNoC radio controllers' set_gpio_attr(). - Adding state caching to gpio_atr_3000, and a getter for it. Whenever an attribute is set, that value is cached, and can now be retreieved. - Remove low-level register API. Since UHD 3.10, there is no USRP that implements that API. Modifying the filter API in the following ways: - Splitting filter API getter/setter/list into separate RX and TX functions - Adding channel numbers as an argument - The filter name will no longer be a property tree path, but rather a filter name. For RFNoC devices, this will take the form `BLOCK_ID:FILTER_NAME`. For non-RFNoC devices, this will just be the filter name (e.g. `HB_1`) - Removing search mask from listing function. Users can do their own searching Co-Authored-By: Martin Braun <martin.braun@ettus.com>
* rfnoc: radio/streamer: Handle late commands and burst ACKsMartin Braun2019-11-265-7/+52
| | | | | | | - Burst ACKs are already handled by the TX streamer, but the radio now also sends an action upstream on reception of a burst ACK - Late commands were only acquitted by an 'L', now an action gets sent downstream and is handled in the rx streamer
* rfnoc: Add MTU property to RX streamerCiro Nishiguchi2019-11-265-18/+90
|
* rfnoc: Implement flushing on overrunCiro Nishiguchi2019-11-266-72/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies the overrun handling such that the RX streamer does not restart the radios until the packets that were buffered prior to the overrun are read by the user. When an RX streamer receives an overrun, it will run the following algorithm: 1. Stop all upstream producers. 2. Set an internal flag in the streamer that indicates that the producers have stopped due to an overrun. 3. Continue servicing calls to recv until it runs out of packets in the host buffer (packets that can be read from the transport using a 0 timeout). 4. Once the packets are exhausted, return an overrun error from recv. The radio, if it was in continuous streaming mode before the overrun, includes a flag in its initial action whether or not to restart streaming. 5. If the radio requested a restart, the streamer submits a restart request action upstream. This action will be received by the radio. The radio will then check the current time, and send a stream command action back downstream. 6. The RX streamer receives the stream command action, and uses it to send another stream command to all upstream producers. This way, all upstream producers receive a start command for the same time.
* rfnoc: Allow MB controllers to init after blocks have initializedMartin Braun2019-11-262-6/+164
| | | | | | | | | | | | | | | | | | | | | This allows mb_controller childs to implement an init() call which rfnoc_graph will call after the block initialization is complete. rfnoc: graph/mb_controller: Add synchronization routine This adds two new API calls: * rfnoc_graph::synchronize_devices() and * mb_controller::synchronize(). The purpose is to synchronize devices in time and/or phase, depending on device capabilities. mb_controller childs can override or extend the default implementation, which is to simply set time next PPS and verify (similar to the set_time_unknown_pps() call in multi_usrp). rfnoc: mb_controller: Add gpio_src API Adds new API calls (get_gpio_src, get_gpio_srcs, set_gpio_src, get_gpio_banks) to mb_controllers
* rfnoc: Add nirio_link link objectMartin Braun2019-11-263-0/+576
|
* rfnoc: Use adapter_id_t for balancing load across linksAlex Williams2019-11-267-101/+145
| | | | | | | Since the mb_iface allocates local device IDs, also have it track the associated adapter IDs and provide a facility to retrieve them. Incorporate the adapter IDs in the user API to select the adapter for streamers.
* rfnoc: ctrlport: Fixing timeouts for timed commandsBrent Stapleton2019-11-262-5/+31
| | | | | | When issuing a timed command, if there is no room in the command FIFO and there is a timed command queue'd up, wait for a long time before timing out.
* rfnoc: client_zero can track num SEPs and num ctrl EPs separatelyMartin Braun2019-11-263-4/+21
|
* transport: Add modeling of physical adaptersAlex Williams2019-11-267-5/+149
| | | | | | | Now link instances must have the ability to report the corresponding physical adapter that is used for the local side of the link. This information can be used to help identify when multiple links share the same adapter.
* rfnoc: node: Add set_properties()Martin Braun2019-11-261-0/+19
| | | | | node_t::set_properties() is a convenience function that lets you set multiple properties at once from a device_addr_t.
* rfnoc: Add basic round-robin allocation for linksAlex Williams2019-11-261-12/+65
| | | | | | | | When multiple links are present, the graph_stream_manager will now alternate using them for different streams. It does not consider the required bandwidth of the stream, the channel capacity of the local and remote transport adapters, nor the total reserved capacity of the NIC.
* rfnoc: Add ability to select transport for streamers to user APIsAlex Williams2019-11-265-14/+98
| | | | Now the user can choose which transport is used in connect() calls.
* rfnoc: tx_streamer: add support for async messagesCiro Nishiguchi2019-11-2610-20/+262
| | | | | | Add an async message queue that aggregates errors from multiple sources. Errors can come from the strs packets originating from the stream endpoint or from the radio block through control packets to the host.
* rfnoc: Centralize initialization state of SEPs to epid_allocatorAlex Williams2019-11-266-25/+80
| | | | | | | | | | | | | | | | Because the initialization state of SEPs is a graph-wide property, link_stream_managers and mgmt_portals cannot rely on their private members to determine if they can reset an SEP. Move the call to init SEPs into the epid_allocator, and have it call into a mgmt_portal to gain access to the SEP. Thus, link_stream_managers only request that an epid_allocator ensure an SEP is numbered and initialized, and they provide a path to communicate with the SEP. The epid_allocator will ensure init only happens once, so a stream currently running on another link_stream_manager does not get interrupted. This could happen, for example, if the OSTRM went to one device, and the ISTRM came from another. In general, EPIDs should only be assigned once.
* rfnoc: Use link_stream_manager's mgmt_portal for all mgmt packetsAlex Williams2019-11-268-97/+100
| | | | | | | | | | | | | Change data transports to use the mgmt_portal from the link_stream_manager. The initialization state of a device's EPIDs needs to be shared amongst all the SEP users. Otherwise, an RX transport may attempt to do a full reset of the SEP while TX is streaming (for example). TODO: The code contained here is not sufficient to handle multiple links that can access the same SEPs, as those would have different link_stream_managers, and thus, different mgmt_portal instances and views of the SEP state.
* rfnoc: rfnoc_graph: Improve error reporting for init failuresMartin Braun2019-11-261-0/+4
|
* rfnoc: client0: Change flush-all-blocks to not throw on timeoutMartin Braun2019-11-263-23/+12
| | | | | The convenience call that flushed all the blocks would throw during timeout. Now, it returns a bool whether or not the flush was successful.
* rfnoc: graph: Optimize property propagation algorithmMartin Braun2019-11-263-24/+64
| | | | | | | | | | | | | | | | | | | | | This introduces the concept of a resolution context, because the property propagation algorithm needs to behave differently when called during an initialization step (e.g. when the graph is committed), or when the user changes a property on one of the nodes after it was committed. The algorithm is modified as follows: - When called during an initialization step, then all nodes get resolved at least once. If nodes added new properties, then all nodes get touched again until the max number of iterations is reached. - When called because a node modified one of its properties, then that node is always resolved first. From there, all other nodes are resolved in topological order. However, the algorithm immediately terminates as soon as there are no more dirty nodes. - When called because a node modified one of its properties, but the graph is currently not in a committed state, then that node will do a local property resolution.
* rfnoc: Add MTU property to TX streamerCiro Nishiguchi2019-11-263-7/+75
|
* rfnoc: graph: Lock release/commit stateMartin Braun2019-11-263-9/+27
| | | | | | | | | | | | | | | | | Property propagation and action handling depend on the release state, but they are lengthy operations. It is therefore imperative to not change the release/commit state during those methods. This commit changes the following: - Change the release state counter from an atomic to a non-atomic variable - Instead, use a mutex to lock the release state counter, and use the same mutex for locking access to the property propagation and action handling The rfnoc_graph now tries to release the graph before shutting down blocks to make sure they don't get destroyed while those algorithms are still running.
* rfnoc: radio: Add async message validationMartin Braun2019-11-262-0/+53
| | | | | This adds a method to the radio to check if an async message is valid, which can be used to ack async messages immediately.
* rfnoc: ctrlport: Separately validate and handle async messagesMartin Braun2019-11-262-5/+33
| | | | | | | | | | | This introduces the concept of an async message validator, an optional callback for functions to check if an async message has a valid payload. After validation, the async message is ack'd. Then, the async message handler is executed. This makes sure that an async message is ack'd as soon as possible, rather than after the async message handling, which can itself have all sorts of communication going on to the device.
* rfnoc: radio: Introduce coerce_rate() methodMartin Braun2019-11-262-3/+24
| | | | | This is a helper method for property resolution, where set_rate() is not appropriate.
* rfnoc: Add DUC block controllerMartin Braun2019-11-262-0/+525
|
* rfnoc: rfnoc_graph: FormattingBrent Stapleton2019-11-261-15/+10
| | | | Formatting in prep for changes
* rfnoc: rfnoc_graph: Add is_connectable() APIMartin Braun2019-11-261-0/+73
| | | | | | rfnoc_graph::is_connectable() allows to check if is possible to call connect() on blocks. If blocks are attached to other blocks statically, or if they are on unconnected devices, they are not connectable.
* rfnoc: Add MTU trackingMartin Braun2019-11-264-5/+124
| | | | | | | | | | | | | | | | | MTUs are now tracked through the framework for all childs of noc_block_base. Every edge gets an 'mtu' property. MTU can be set and get either through the prop API, or through new API calls (get_mtu(), set_mtu()). It is also possible to create custom properties that depend on the MTU by asking for a reference to the MTU property, and then adding that to the input list of a property resolver. The radio_control_impl includes a change in this commit where it sets the spp based on the MTU. Blocks can also set an MTU forwarding policy. The DDC block includes a change in this commit that sets a forwarding policy of ONE_TO_ONE, meaning that the MTU on an input edge is forwarded to the corresponding output edge (but not the other edges, as with the tick rate).
* rfnoc: Implement overrun handling using action APIMartin Braun2019-11-265-3/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to enable overrun handling through the action API, a few new features are implemented: - The RX streamer can now accept stream command actions. The streamer will interpret stream command actions as a request to send stream commands upstream to all producers. - A new action type is defined ('restart request') which is understood by the radio and streamer, and is a handshake between producers and consumers. In this case, it will ask the radio to send a stream command itself. When an RX streamer receives an overrun, it will now run the following algorithm: 1. Stop all upstream producers (this was already in the code before this commit). 2. If no restart is required, Wait for the radios to have space in the downstream blocks. The radio, if it was in continuous streaming mode before the overrun, includes a flag in its initial action whether or not to restart the streaming. Also, it will wait for the stop stream command from the streamer. When it receives that, it will initiate a restart request handshake. 3. The streamer submits a restart request action upstream. This action will be received by the radio. The radio will then check the current time, and send a stream command action back downstream. 4. The RX streamer receives the stream command action, and uses it to send another stream command to all upstream producers. This way, all upstream producers receive a start command for the same time.
* rfnoc: actions: Allow sending actions to selfMartin Braun2019-11-263-20/+43
| | | | | | | | Sending actions to self is useful because calling post_action() from within an action handler will not actually trigger the action. Instead, it will defer delivery of the action. Allowing sending actions to self will allow to add another action, in deterministic order, and the execution of another action handler.
* rfnoc: actions: Add dictionary to all actionsMartin Braun2019-11-261-4/+9
| | | | | | This can be used to set arbitrary key/value pairs on the action object. Easier to use than serialization, but doesn't require custom types, either.