aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc
Commit message (Collapse)AuthorAgeFilesLines
* chdr: Assert Ctrl Packet Size Before SerializingSamuel O'Brien2020-07-161-3/+4
| | | | | | | | | | | | | | This commit alters the ctrl_payload#serialize function to assert the serialized length of the packet fits inside the buffer before writing. Originally, the function writes the data and then asserts that the final pointer position isn't further than the end of the buffer. While this works, if it were to fail, that means we have already caused undefined behavior by writing to some random memory location, which isn't good practice. This commit is possible now that the get_length method exists. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* utils: Expose CHDR Parsing APISamuel O'Brien2020-07-131-0/+124
| | | | | | | | | | | | 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-136-15/+15
| | | | | | | | | | 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>
* rfnoc: Rename chdr_packet to chdr_packet_writerSamuel O'Brien2020-07-137-23/+19
| | | | | | | | | It would be confusing to have two classes named chdr_packet. As it makes more sense to name the new public chdr parser class chdr_packet, the internal uhd::rfnoc::chdr::chdr_packet class is being renamed to chdr_packet_writer to better represent its functionality. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* rfnoc: Add Log Power RFNoC block supportAaron Rossetto2020-06-292-0/+59
|
* python: Add window RFNoC block controller bindingsAaron Rossetto2020-06-291-0/+22
|
* rfnoc: Add window RFNoC block controllerAaron Rossetto2020-06-292-0/+144
|
* CHDR: support multiple CHDR widthsAndrew Lynch2020-06-261-9/+38
| | | | | Support management payloads on busses over 64 bits Automatically set CHDR width for mpmd_link_if_ctrl_udp
* python: Add FFT RFNoC block controller bindingsAaron Rossetto2020-06-181-0/+46
|
* rfnoc: Augment FFT RFNoC block controllerAaron Rossetto2020-06-181-30/+120
| | | | | | | This commit augments the existing FFT RFNoC block controller with C++ functions through which the block can be configured, as well as adding range checking to the various properties that sit atop the FFT RFNoC block registers.
* python: radio_control: Explicitly import ALL_CHANS into Python bindingsMartin Braun2020-06-151-1/+4
| | | | | This avoids a dynamic linker error by copying the ALL_CHANS value into the the Python bindings before using it.
* radio_control: Provide default implementations for ref power APIsMartin Braun2020-06-101-22/+39
| | | | | | | | The various implementations for the reference power APIs are always the same, assuming the existence of a pwr_cal_mgr object. We therefore store references to power cal managers in radio_control_impl, which radios can choose to populate. The APIs then don't have to be reimplemented in the various radio classes, unless they want to for whatever reason.
* python: Add __repr__, property bindings to NocBlockBaseAaron Rossetto2020-06-091-5/+17
| | | | | | | | | | | | | | | | | | | | | This commit adds a __repr__ function to the noc_block_base bindings, which helpfully displays the block's unique ID, e.g.: >>> block = g.get_block('0/VectorIIR#0') >>> block <NocBlock for block ID '0/VectorIIR#0'> Also added are get_property_ids and set_properties functions, so Python clients can set block properties by string if desired, e.g.: >>> block.get_property_ids() ['alpha', 'beta', 'delay', 'max_delay'] >>> block.set_properties('alpha=0.45,beta=0.77,delay=41') >>> viir = uhd.rfnoc.VectorIirBlockControl(block) >>> viir.get_alpha(0) 0.45 >>> viir.get_beta(0) 0.77
* python: Add null RFNoC block controller bindingsAaron Rossetto2020-06-091-0/+27
|
* python: Add vector IIR RFNoC block controller bindingsAaron Rossetto2020-06-092-1/+27
|
* python: Add radio RFNoC block controller bindingsAaron Rossetto2020-06-092-1/+171
|
* python: Add FIR filter RFNoC block controller bindingsAaron Rossetto2020-06-091-0/+23
|
* python: Add Fosphor RFNoC block controller bindingsAaron Rossetto2020-06-091-0/+66
|
* python: Add DUC RFNoC block controller bindingsAaron Rossetto2020-06-091-0/+31
|
* python: Add DDC RFNoC block controller bindingsAaron Rossetto2020-06-091-0/+32
|
* python: Add block controller factory utilityAaron Rossetto2020-06-091-0/+30
| | | | | | | | | | | | | | | This commit adds a utility class for use with the Python RFNoC block controller PyBind bindings which facilitates constructing instances of a specific block controller type from its noc_block_base base class. This allows Python code to create and configure specific block controller instances by calling get_block on a uhd.rfnoc.RfnocGraph object with the block ID of the block in question and then passing the result into the constructor method of the block controller, e.g.: graph = uhd.rfnoc.RfnocGraph("addr=...") block = graph.get_block(uhd.rfnoc.BlockID("0/DDC#0")) ddc = uhd.rfnoc.DdcBlockControl(block) ddc.set_input_rate(10e6, 0)
* rfnoc: Add Add/Sub RFNoC block supportAaron Rossetto2020-05-282-0/+79
|
* rfnoc: Add support for Split Stream RFNoC blockAaron Rossetto2020-05-282-0/+110
| | | | | | | | The split stream RFNoC block is an RFNoC block that takes in a single CHDR stream and duplicates it, creating a number of output streams for each input stream. Consult the split_stream_block_control class header file for more details on block configuration and behavior, including how property and action forwarding is handled by the block.
* rfnoc: Add USE_MAP prop/action forwarding policyAaron Rossetto2020-05-281-17/+61
| | | | | | | | | | | | This commit adds a new forwarding policy for properties and actions, USE_MAP. This forwarding policy causes the node to consult a user-provided map to determine how to forward the property or action. The map's key is the source edge of the incoming property or action, while the value is a list of destination edges to which the property should be propagated or action should be forwarded. It allows clients to construct sophisticated forwarding behaviors for specialized blocks, such as a split stream block that needs to forward properties and actions only to specific output edges based on the incoming edge.
* rfnoc: Fix _has_port() port existence checkAaron Rossetto2020-05-281-2/+2
| | | | | | This commit fixes a bug in node_t::_has_port(), which was using the wrong comparison operator to determine if the instance value in the incoming res_source_info parameter is within a valid range.
* rfnoc: radio: Add APIs to query cal keysMartin Braun2020-05-201-0/+10
| | | | | | | | This allows asking the radio for the keys it uses to read/write its calibration data. By querying radio_control::get_{rx,tx}_power_ref_keys(), the return values can be used to access uhd::usrp::cal::database::read_cal_data().
* rfnoc: Add Vector IIR RFNoC block supportAaron Rossetto2020-05-192-0/+174
|
* rfnoc: Use large timeout for reads when timed commands existCiro Nishiguchi2020-05-151-8/+24
| | | | | If a timed command is in the queue, writes use a large timeout. Changing reads to do the same.
* DUC/DDC: Add variable time incrementMichael West2020-05-122-21/+26
| | | | | | | | | Sets time increment based on tick rate and sample rate instead of assuming one tick per sample. Defaults to legacy behavior. Minor compat number bumped on DUC and DDC blocks. Signed-off-by: Michael West <michael.west@ettus.com>
* lib: rfnoc: Fix "unused" warnings for non-trace log levelsMartin Braun2020-04-172-9/+6
| | | | | | When the compile log level is higher than TRACE, the UHD_LOG_TRACE() macros get removed, which can lead to unused variables. This modifies UHD to avoid those warnings, with no functional changes.
* uhd: Add reference power level API to multi_usrp and radio_controlMartin Braun2020-04-171-0/+36
| | | | | | | | | | | | | | | | | | This adds the following API calls: - multi_usrp::has_{rx,tx}_power_reference() - multi_usrp::set_{rx,tx}_power_reference() - multi_usrp::get_{rx,tx}_power_reference() - radio_control::has_{rx,tx}_power_reference() - radio_control::set_{rx,tx}_power_reference() - radio_control::get_{rx,tx}_power_reference() It also adds a manual page explaining the philosophy of the API. Note that this does not actually add this feature to any device implementation. Calling the new API calls will thus result in `uhd::not_implemented_error` exceptions being thrown. This commit is to lock down the API and ABI.
* rfnoc: Add RFNoC fosphor blockWade Fife2020-04-142-0/+419
|
* multi_usrp_rfnoc: Manually pass sample rate to ddc/ducsteviez2020-04-132-0/+10
| | | | | | | | | | | | | | This adds (and calls) methods to manually pass radio block sample rate to the input/output properties of the ddc/duc during creation of the multi_usrp_rfnoc object. The ddc/duc require this information in order to return valid, possible output/input sample rates in get_rx_rates()/get_tx_rates(). Before, the ddc/duc wouldn't have this rate until the rfnoc_graph had been connected and committed, which happens in get_rx_stream()/get_tx_stream(). Thus, this fixes an issue where a user was unable to query possible sample rates prior to specifying a sample rate and creating a stream.
* lib: Properly do reset routines in client_zeroMartin Braun2020-04-091-2/+6
| | | | | The current reset routines write a '1' twice for reset, instead of '0' then '1' (resets get triggered on a rising edge).
* rfnoc: Add FIR filter RFNoC block controllerAaron Rossetto2020-04-072-0/+102
|
* fixup! rfnoc: Use multichannel register interface for RFNoC blocksmattprost2020-04-073-9/+9
|
* rfnoc: Use multichannel register interface for RFNoC blocksmattprost2020-04-023-54/+57
| | | | | | | | Allows RFNoC blocks to perform register peeks and pokes on blocks with multiple channels without having to worry about handling register address translation every time. Signed-off-by: mattprost <matt.prost@ni.com>
* 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