aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/rfnoc_blocks_test.cpp
Commit message (Collapse)AuthorAgeFilesLines
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-031-2/+2
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* rfnoc: Provide make_args_t dtor in rfnoc_blocks_testAaron Rossetto2020-02-041-0/+3
|
* rfnoc: Create mock factoryMartin Braun2020-01-291-56/+14
| | | | | | 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: node: Add set_properties()Martin Braun2019-11-261-0/+5
| | | | | node_t::set_properties() is a convenience function that lets you set multiple properties at once from a device_addr_t.
* rfnoc: tests: Let block unit tests use regular factoryMartin Braun2019-11-261-38/+52
| | | | | | | 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: Add DUC block controllerMartin Braun2019-11-261-2/+154
|
* rfnoc: Add MTU trackingMartin Braun2019-11-261-1/+20
| | | | | | | | | | | | | | | | | 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: Introduce device-specific blocksLars Amsel2019-11-261-3/+3
| | | | | | | | | | | | | - 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: DDC: Fix property propagationMartin Braun2019-11-261-8/+65
| | | | | | | | | - 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: Add clock selection to blocksMartin Braun2019-11-261-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: Add shutdown feature to blocksMartin Braun2019-11-261-0/+6
| | | | | | | | On destruction, the rfnoc_graph will call shutdown() on all blocks. This allows a safe de-initialization of blocks independent of the lifetime of the noc_block_base::sptr. Also adds the shutdown feature to null_block_control.
* rfnoc: Add null block controllerMartin Braun2019-11-261-0/+87
|
* rfnoc: noc_block_base: Pass args into block on constructionMartin Braun2019-11-261-0/+2
| | | | | These args come from the framework, e.g., because the UHD session was launched with them.
* rfnoc: noc_block_base: Handle the tick_rate property internallyMartin Braun2019-11-261-0/+1
| | | | | | | | | | | All noc_block_base derivatives are now plugged into the tick rate system. Connected nodes can only have one tick rate among them. This implies there is also only ever one tick rate per block. set_tick_rate() is a protected API call which can be called by blocks such as radio blocks to actually set a tick rate. Other blocks would only ever read the tick rate, which is handled by the get_tick_rate() API call.
* rfnoc: Add DDC block controllerMartin Braun2019-11-261-0/+66