aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* rfnoc: Use adapter_id_t for balancing load across linksAlex Williams2019-11-269-125/+164
| | | | | | | 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-264-4/+22
|
* transport: Add modeling of physical adaptersAlex Williams2019-11-269-5/+180
| | | | | | | 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-263-1/+39
| | | | | node_t::set_properties() is a convenience function that lets you set multiple properties at once from a device_addr_t.
* rfnoc: property: Add option to set properties from stringsMartin Braun2019-11-263-0/+53
|
* 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-267-19/+136
| | | | Now the user can choose which transport is used in connect() calls.
* rfnoc: tx_streamer: add support for async messagesCiro Nishiguchi2019-11-2613-22/+291
| | | | | | 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-264-27/+66
| | | | | | | | | | | | | | | | | | | | | 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
|
* tools: Update dissectors for Wireshark major version 3, new CHDRAlex Williams2019-11-2616-973/+1293
| | | | | Dissectors may now be incompatible with earlier versions. Fixes ZPU dissector.
* utils: remove thread priority elevationCiro Nishiguchi2019-11-267-14/+4
| | | | | | | | Remove UHD call to elevate thread priority to realtime from utils, and add warning in documentation of set_thread_priority function. Setting all threads to the same realtime priority can cause the threads to not share access to the network interface fairly, which adversely affects operation of the worker threads in UHD.
* rfnoc: tests: Let block unit tests use regular factoryMartin Braun2019-11-262-49/+53
| | | | | | | Up until now, these unit tests were bypassing the factory, and directly linking against the relevant block factories. This can cause linker issues, but it also doesn't test code paths. This change makes the unit tests look more like the actual usage.
* 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-264-7/+76
| | | | | | | | | | | 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: adding filter_api mixin class for blocksBrent Stapleton2019-11-261-0/+42
| | | | | Adding filter_node, a mixin class that provides an interface that multi_usrp_rfnoc will use to implement the filter API.
* 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-268-3/+820
|
* rfnoc: rfnoc_graph: FormattingBrent Stapleton2019-11-261-15/+10
| | | | Formatting in prep for changes
* rfnoc: rfnoc_graph: Add is_connectable() APIMartin Braun2019-11-262-0/+86
| | | | | | 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-269-6/+218
| | | | | | | | | | | | | | | | | 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-266-3/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-264-22/+48
| | | | | | | | 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-263-6/+22
| | | | | | 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.
* rfnoc: Introduce device-specific blocksLars Amsel2019-11-269-109/+108
| | | | | | | | | | | | | - Add device ID constants (e.g., E310 == 0xE310, X300 == 0xA300). These are stored in the device FPGA, and can be used for decisions later - Blocks can be specific to a device. For example, x300_radio_control can only work on an X300 series device. - Because blocks can be device-specific, all radio blocks can now share a common Noc-ID (0x12AD1000). - The registry and factory functions are modified to acommodate for this. - The motherboard access is now also factored into the same registry macro.
* rfnoc: Add a new builder script for FPGA images based on eRFNoC.Lars Amsel2019-11-2637-0/+2407
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The builder has two major jobs: * generate an image core file which reflects the FPGA image configuration given by the user * invoke Xilinx toolchain to actually build the FPGA image For this purpose it needs to know where to find the FPGA source tree. This tree can be give by the -F option. The code that represents the user configurable part of the image is written to a file called <device>_rfnoc_sandbox.v. To generate the file these configuration files are needed: * io_signatures.yml: A file describing the known IO signatures. This file is global for all devices and contains the superset of all signatures (not all signatures are used by all devices). It resides in usrp3/top/ of the tree given by -F. * bsp.yml: A file describing interfaces of a specific device such as AXIS transport interfaces or IO ports as well as device specific settings. It resides in usrp3/top/<device> of the tree given by -F. * <image>.yml: a file provided by the user with freely chosen name. It describes which elements the image should contain (RFNoC blocks, streaming endpoints, IO ports) and how to connect them. The file also contains image setting such as the CHDR width to be used. The script uses mako templates to generate the sandbox file. Before the template engine is invoked sanity checks are executed to ensure the configuration is synthactic correct. The script also build up structures to ease Verilog code generation in the template engine. The engine should not invoke more Python than echoing variables or iterating of lists or dictionaries. This eases debugging as errors in the template engine are hard to track and difficult to read for the user. All Python code is placed in a package called rfnoc. The templates used by the builder are also part of this package. image_builder.py contains a method called build_image which is the main entry point for the builder. It can also be utilized by other Python programs. To align with the existing uhd_image_builder there is also a wrapper in bin called rfnoc_image_builder which expects similar commands as the uhd_image_builder. For debugging purpuse the script can be invoked from host/utils using $ PYTHONPATH=. python bin/rfnoc_image_builder <options> When installed using cmake/make/make install the builder installs to ${CMAKE_INSTALL_PREFIX}bin and can be invoked without specifying a PYTHONPATH. One can also install the package using pip from host/utils $ pip install . Image config generation can also be done from GNU Radio Companion files. The required GRC files are merged into gr-ettus. Example usage: $ rfnoc_image_builder -F ~/src/fpgadev -d x310 \ -r path/to/x310_rfnoc_image_core.grc \ -b path/to/gr-ettus/grc Co-Authored-By: Alex Williams <alex.williams@ni.com> Co-Authored-By: Sugandha Gupta <sugandha.gupta@ettus.com> Co-Authored-By: Martin Braun <martin.braun@ettus.com>
* rfnoc: radio: Remove async message registers for timestampMartin Braun2019-11-261-8/+5
| | | | These are no longer used.
* rfnoc: async message: Include timestamp in async message handlingMartin Braun2019-11-264-9/+17
| | | | | | | | | Async messages (like, e.g., overrun messages) can include a timestamp. This change enables access to the timestamp in the async message handler. It is up to the FPGA block implementation to include the timestamp, if desired/necessary. The definition of the timestamp may also depend on the block, for example, the overrun async message will include the time when the overrun occurred.
* rfnoc: radio_control: Add async message handlerMartin Braun2019-11-262-14/+119
| | | | | | | This will receive async messages from the radio, and print OUL characters where appropriate. When an overrun message is received, it will send an action upstream to initiate overrun handling.
* rfnoc: actions: Add rx_event action typeMartin Braun2019-11-262-3/+33
|
* rfnoc: ctrlport_endpoint: Audit locks, lock more selectivelyMartin Braun2019-11-261-5/+14
| | | | | The existing implementation would lock judiciously, causing a deadlock when the async message handler would try and call poke32().
* rfnoc: rfnoc_graph: Correctly read local device IDs from mb_ifaceMartin Braun2019-11-261-8/+54
| | | | | | Previously, the code was using a hard-coded local device ID. Now, the GSM initialization code will read CHDR width and all local device IDs from the mb_iface to correctly dynamically initialize the GSM.
* rfnoc: mb_iface: Add API to query link endiannessMartin Braun2019-11-261-0/+9
|
* rfnoc: rfnoc_graph: Refactor classMartin Braun2019-11-261-110/+142
| | | | | | | - Remove duplicate calls to uhd::device::make - Do a try/catch on full class initialization - Separate setup_graph() into multiple sub-functions - Improve const-correctness
* rfnoc: DDC: Fix property propagationMartin Braun2019-11-264-85/+225
| | | | | | | | | - Combine scaling and samp_rate resolvers - Prioritize decim when user has set it for DDC: When samp_rate_in changes, either the samp_rate_out or the decim values may change to accommodate it. If decim has been set by the user (which can be determined by the valid flag), prefer changing samp_rate_out over decim.
* rfnoc: node: Make register_property() unlock RW accessMartin Braun2019-11-262-2/+14
|
* rfnoc: add rx and tx transports, and amend rfnoc_graphCiro Nishiguchi2019-11-2631-334/+4540
| | | | | | | | | | | | | | | | | | | | | | | transports: Transports build on I/O service and implements flow control and sequence number checking. The rx streamer subclass extends the streamer implementation to connect it to the rfnoc graph. It receives configuration values from property propagation and configures the streamer accordingly. It also implements the issue_stream_cmd rx_streamer API method. Add implementation of rx streamer creation and method to connect it to an rfnoc block. rfnoc_graph: Cache more connection info, clarify contract Summary of changes: - rfnoc_graph stores more information about static connections at the beginning. Some search algorithms are replaced by simpler lookups. - The contract for connect() was clarified. It is required to call connect, even for static connections.
* rfnoc: Add tracking of 'valid' bit to propertiesAlex Williams2019-11-265-18/+84
| | | | | | The valid bit helps prevent placeholder defaults from being propagated through the graph. Values that are not valid will not be forwarded.
* rfnoc: Enable users to query connections in the graphAlex Williams2019-11-265-13/+189
| | | | Implement uhd::rfnoc::rfnoc_graph::enumerate_*_connections()
* rfnoc: rfnoc_graph: Change block's subtrees to be /blocks/$BLOCKIDMartin Braun2019-11-261-2/+7
|
* rfnoc: graph: Initialize properties on all nodes during initMartin Braun2019-11-263-0/+14
| | | | | This will call init_props() on every block after the device initialization is complete, but before control returns to the user.
* rfnoc: flushing and reset blocks on graph creationBrent Stapleton2019-11-263-3/+71
| | | | | | During construction of the rfnoc_graph, flush and reset each block in each motherboard we need to enumerate. This will ensure that each block is in a clean state when we construct it's block controller.
* rfnoc: Add clock selection to blocksMartin Braun2019-11-2614-63/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | During registration, blocks must now specify which clock they are using for the timebase (i.e., for timed commands) and for the ctrlport (this is used to determine the length of sleeps and polls). For example, the X300 provides bus_clk and radio_clk; typically, the former is used for the control port, and the latter for the timebase clock. Another virtual clock is called "__graph__", and it means the clock is derived from property propagation via the graph. The actual clocks are provided by the mb_iface. It has two new API calls: get_timebase_clock() and get_ctrlport_clock(), which take an argument as to which clock exactly is requested. On block initialization, those clock_iface objects are copied into the block controller. The get_tick_rate() API call for blocks now exclusively checks the timebase clock_iface, and will no longer cache the current tick rate in a separate _tick_rate member variable. Block controllers can't manually modify the clock_iface, unless they also have access to the mb_controller (like the radio block), and that mb_controller has provided said access. This commit also adds the clock selection API changes to the DDC block, the Null block, and the default block.
* rfnoc: clock_iface: Add flag for clock to be (im-)mutableMartin Braun2019-11-261-1/+21
| | | | | An immutable clock means it has a locked frequency, and attempts to change the frequency will cause an exception to be thrown.