aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc
Commit message (Collapse)AuthorAgeFilesLines
* tests: Allow custom mock_reg_iface_t in mock blockAaron Rossetto2020-03-131-2/+4
| | | | | | Allow clients to pass a custom instance of a mock_reg_iface_t for use with mock_block_container. This is especially useful when a block test subclasses mock_reg_iface_t to implement specialized behaviors.
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-0321-173/+158
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* rfnoc: Reuse the graph objectAndrew Lynch2020-02-261-1/+20
| | | | | Keep a reference to the graph object so that when a new multi_usrp is opened to the same device, the same graph is also used.
* rfnoc: actions: Cleanup rx_event_action_info ctorsteviez2020-02-182-9/+14
| | | | | Set error code member variable in rx_event_action_info constructor instead of relying on the caller to set it after object creation
* rfnoc: actions: Fix uninitialized timestampssteviez2020-02-182-9/+13
| | | | | | tx_event_action_info objects were being created with uninitialized timestamp members which led to uhd::tx_streamer::recv_async_msg() returning with invalid timestamps
* rfnoc: ddc: Make scaling optional, prefer to change decimMartin Braun2020-02-071-28/+53
| | | | | | | | | | | This combines two intertwined changes: - The scaling_in and scaling_out properties of the DDC now start off uninitialized. This is to avoid invalid loops of property resolution: When the block is first initialized in a graph context, the default values for scaling over-constrain the resolution problem. - The resolver for samp_rate_in used to prefer changing samp_rate_out, it now prefers to modify the decimation. This is necessary to allow calling set_output_rate() before the graph is committed.
* rfnoc: Create mock factoryMartin Braun2020-01-293-3/+58
| | | | | | This is an API that allows creating mock block controllers, to write unit tests for block controllers. See rfnoc_blocks_test for an example how to use them.
* rfnoc: apply clang-format to block_idBrent Stapleton2020-01-101-1/+1
|
* uhd: fixing MSVC warningsBrent Stapleton2020-01-091-1/+2
| | | | | | | | | | | Small changes to remove various compiler warnings found in MSVC - Adding uhd::narrow_cast to verious spots - wavetable.hpp: all floats literals in the wavetable. - paths_test: unnecessary character escape - replay example: remove unreferenced noc_id - adfXXXX: Fixing qualifiers to match between parent and derived classes - rpc, block_id: Removing unused name in try...catch
* python: rfnoc: finishing noc_block_base::get_mtuBrent Stapleton2020-01-061-0/+26
| | | | | | | Adding bindings for res_source_info, which allows us to use noc_block_base::get_mtu. Fixes: 400b00c34338 ("rfnoc: adding RFNoC Python API")
* python: rfnoc: make block_id_t more compatible with stringsBrent Stapleton2020-01-061-0/+3
| | | | | Allows the RFNoC Python API to automatically convert strings to block_id_t's.
* rfnoc: adding RFNoC Python APIBrent Stapleton2020-01-021-0/+247
| | | | | | | | Adding Python bindings for the RFNoC API. This includes the rfnoc_graph, noc_block_base, and several other supporting classes. Templated functions are not currently supported. For example, `rfnoc_graph::get_block` can only return the basic block controller.
* uhd: fix for exception due to use of unconstructed mutexPatrick Sisterhen2020-01-021-4/+5
| | | | | | In chdr_ctrl_endpoint recv_thread, _recv_thread was starting at construction time and trying to lock mutex, but due to member declaration in class, mutex was not yet constructed
* rfnoc: Make chdr_ctrl_xport recv_io callbacks have symbolsAlex Williams2019-12-201-26/+43
| | | | This helps a little with debugging (for breakpoints).
* ddc: fixup decimation propertyBrent Stapleton2019-12-051-2/+2
| | | | | | | | - Use coerce_decim(), not int(), to coerce the decimation rate - Fix typo Fixes: a36fc4604f9b ("rfnoc: DDC: Fix property propagation") Fixes: 36853315741a ("rfnoc: Add DDC block controller")
* rfnoc: DDC/DUC: Fix fp-issues with samp_rate propertiesBrent Stapleton2019-11-272-6/+67
| | | | | | Only update DDC/DUC samp_rate properties if the number is substantially different (don't update for sub-1Hz property calculations). This fixes resolver exceptions for certain rates.
* ddc: Applying clang-formatBrent Stapleton2019-11-271-8/+7
|
* rfnoc: graph: Add logging to resolver errorsBrent Stapleton2019-11-271-1/+6
|
* detail::graph: Add shutdown capabilityMartin Braun2019-11-262-10/+23
| | | | | | | | | | | | In the existing graph, when the shutdown was simply a release. However, any outstanding actions would trigger warnings (because released graphs aren't supposed to still have actions being passed around), which would sometimes be visible at the end of an application. This is a safer solution than simply releasing, because it explicitly sets a shutdown flag that all graph-affecting functions (property propagation and action handling) respect. Once the flag is set, the graph can no longer be booted up again.
* rfnoc_graph: Modify find_blocks() to sort return valueMartin Braun2019-11-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch, the elements of of the return value of find_blocks() are sorted lexicographically (specifically, using uhd::rfnoc::block_id_it::operator<()). The underlying block_container class stores the blocks in an unordered set, so the return value for find_blocks() was always sorted randomly. multi_usrp_rfnoc had to sort the return values every time find_blocks() was used to get a useful return value. Because find_blocks() had no contract for the order of returned blocks, this change simply sorts the return value before returning it. multi_usrp_rfnoc is modified to remove all the sorts that are now superfluous. A good way to see the change is to run uhd_usrp_probe, which will now contain content like this: | _____________________________________________________ | / | | RFNoC blocks on this device: | | | | * 0/DDC#0 | | * 0/DDC#1 | | * 0/DUC#0 | | * 0/DUC#1 | | * 0/DmaFIFO#0 | | * 0/Radio#0 | | * 0/Radio#1 Assuming the blocks don't change, the order of this list will always be the same following this patch. Note that the order is unrelated to the order on the control crossbar, which it never was.
* rfnoc: Make polling I/O service not block on flow controlCiro Nishiguchi2019-11-262-7/+13
| | | | | | Add a new method to io_service::send_io to check whether the destination is ready for data, to make it possible to poll send_io rather than block waiting for flow control credits.
* rfnoc: xports: Count FC bytes as multiples of CHDR widthMartin Braun2019-11-262-0/+2
| | | | | | | | SEPs on the FPGA can only occupy multiples of the CHDR width in their FIFOs, unlike SW, where buffers are stored in RAM and can be aligned anyhow. Therefore, we align the counting of bytes for FC purpose and count multiples of CHDR width instead of the true number of bytes per packet.
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-261-1/+0
| | | | | | | | | | | | | | | | | | | | | Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include <boost/bind.hpp>, and makes sure all usages of std::bind have an #include <functional>. clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit.
* uhd: Introduce I/O service managerAaron Rossetto2019-11-263-11/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | - Implement I/O service detach link methods - The I/O service manager instantiates new I/O services or connects links to existing I/O services based on options provided by the user in stream_args. - Add a streamer ID parameter to methods to create transports so that the I/O service manager can group transports appropriately when using offload threads. - Change X300 and MPMD to use I/O service manager to connect links to I/O services. - There is now a single I/O service manager per rfnoc_graph (and it is also stored in the graph) - The I/O service manager now also knows the device args for the rfnoc_graph it was created with, and can make decisions based upon those (e.g, use a specific I/O service for DPDK, share cores between streamers, etc.) - The I/O Service Manager does not get any decision logic with this commit, though - The MB ifaces for mpmd and x300 now access this global I/O service manager - Add configuration of link parameters with overrides Co-Authored-By: Martin Braun <martin.braun@ettus.com> Co-Authored-By: Aaron Rossetto <aaron.rossetto@ni.com>
* rfnoc: Make trasnport safe to use with offload threadsCiro Nishiguchi2019-11-263-1/+24
| | | | | | | Make transports safe to use with an offload thread by ensuring that the callbacks and the API methods can execute concurrently. Also, ensure that the transports release their I/O service clients prior to allowing their other member variables be destroyed.
* uhd: Replace boost::regex with std::regexMartin Braun2019-11-261-9/+9
| | | | | | | | 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 usage of boost smart pointers with C++11 counterpartsMartin Braun2019-11-262-8/+6
| | | | | | | | | | | | | | | | | | | 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.
* 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-263-1/+73
|
* Remove proto-RFNoC filesMartin Braun2019-11-2639-7846/+0
| | | | | | | This commit removes all files and parts of files that are used by proto-RFNoC only. uhd: Fix include CMakeLists.txt, add missing files
* rfnoc: radio: Add API call to disable timestampsMartin Braun2019-11-261-0/+5
| | | | | 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.
* rfnoc: Fix transport buffer reservationsCiro Nishiguchi2019-11-263-10/+16
| | | | | | | | | 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.
* 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-264-9/+464
| | | | | | | 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-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-262-0/+20
| | | | | | | - 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-262-6/+46
|
* rfnoc: Implement flushing on overrunCiro Nishiguchi2019-11-262-43/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Use adapter_id_t for balancing load across linksAlex Williams2019-11-263-82/+99
| | | | | | | 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-261-5/+25
| | | | | | 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-262-4/+8
|
* 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-262-10/+85
| | | | Now the user can choose which transport is used in connect() calls.
* rfnoc: tx_streamer: add support for async messagesCiro Nishiguchi2019-11-265-10/+148
| | | | | | 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-263-23/+52
| | | | | | | | | | | | | | | | 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-263-40/+64
| | | | | | | | | | | | | 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.