aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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)
* b200: Enable power calibration APIMartin Braun2020-06-032-19/+98
| | | | | | This lets the B200 transmit and/or receive at given reference power levels. Requirement is that the devices have been separately calibrated with an external calibration device.
* multi_usrp: Fix get_tx_freq() for RFNoC devicesMartin Braun2020-05-291-2/+8
| | | | | | | | | | | | | | | | get_tx_freq(), unlike get_rx_freq(), would not factor in the DSP frequency. Before, this would happen: >>> U = uhd.usrp.MultiUSRP("type=x300") >>> tr = uhd.types.TuneRequest(1e9, 10e6) >>> res = U.set_tx_freq(tr) >>> res.clipped_rf_freq 1000000000.0 >>> U.get_tx_freq() 1010000000.0 In other words, the TuneResult object was correct, but the return value of get_tx_freq() was not. This fixes the issue.
* 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.
* cal: Minor fixes in power container, add unit testMartin Braun2020-05-261-1/+1
| | | | | | | - min_power and max_power arguments were swapped. They were always called correctly, so this is more of a documentation fix. - Add a unit test for the case where power values are not regular, which is the normal case with real data.
* multi_usrp: Amend get_usrp_{rx,tx}_info() to include cal keysMartin Braun2020-05-202-0/+28
| | | | | | This adds two more keys to the dictionary return from get_usrp_{rx,tx}_info() which can be used to query the calibration key and serial.
* rfnoc: radio: Add APIs to query cal keysMartin Braun2020-05-202-0/+12
| | | | | | | | 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().
* fixup! lib: Add power cal managerMartin Braun2020-05-201-1/+2
| | | | | | - The tracking mode was not set to power when calling set_power() - The data consistency check had an inverted logic, thus always printing a warning
* cal: database: Add option to register flash cal callbacksMartin Braun2020-05-201-3/+51
| | | | | | | | | | | This adds the possibility to read cal data from flash/EEPROM by adding callbacks to the database. Unlike the RC and FILESYSTEM data, this is very device-specific, but we can let devices register callbacks in the database so that reading cal data from flash can use the same APIs as from RC or filesystem. Note that this also gives a convenient way to inject call data during unit tests, if desired.
* lib: Refactor cal::database for more efficient function lookupMartin Braun2020-05-201-24/+41
| | | | | | | This is a refactoring with no functional change. Instead of hard-coding the lookup of RC and FILESYSTEM data, we loop over a structure holding those. This will make it easier to add more types of data lookup in the future.
* rfnoc: Add Vector IIR RFNoC block supportAaron Rossetto2020-05-192-0/+174
|
* twinrx: Provide power cal IDMartin Braun2020-05-193-0/+19
| | | | | | | | | | | | | | | | | | Note that the TwinRX has a different behaviour if two or one channel are enabled. For that reason, TwinRX requires 8 different sets of calibration data: - For one vs. two channels - For channel 0 and channel 1 - For RX1 and RX2 Since every combination of these settings is possible, that results in 2^3 == 8 combinations. The choice of RX1 vs. RX2 is encoded in the calibration key. The choice of one vs. two channels is also encoded in the calibration key, and is derived using an expert node. Channel 0 and 1 are assumed symmetric, thus, the encoding for those happens in the calibration serial.
* basic/lf: Add IDs for calibration purposeMartin Braun2020-05-191-0/+4
| | | | | | | | This adds a property tree node "id" next to the "name" node. It is always either basicrx/lfrx/basixtx/lftx based on the daughterboard. The x300_radio_control uses this to help distinguish daughterboards for calibration's sake, where length strings, potentially with special characters, are too unwieldy.
* lib: pwr_cal: Fix power indexingMartin Braun2020-05-191-16/+28
| | | | | | | | | | | | | The pwr_cal::get_gain() method previously held the incorrect assumption that power values per frequency would be equidistant, i.e., be at the same indices as the gain values. Due to the frequency-dependent nature of the hardware, this is not a valid assumption (if that were the case, frequency-dependent calibration would be unnecessary). This changes get_gain() to not rely on that assumption. Note that it requires doing some more rounding: The bilinear interpolation method uses requires coordinates to be on a rectangular grid. This snaps the power values onto a single coordinate.
* lib: Add power cal managerMartin Braun2020-05-193-0/+426
| | | | | This is a utility class that can be used by USRP or daughterboard drivers to tie power calibration into their respective drivers.
* rh: Remove unnecessary register read during set frequencyCiro Nishiguchi2020-05-151-3/+0
| | | | | This unnecessary reads causes timed commands on rhodium to block. It also makes it behave differently based on whether logging is enabled.
* 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.
* uhd: Fix infinite recursion in N3xx timed commandsCiro Nishiguchi2020-05-124-31/+0
| | | | | | The implementation of set_command_time was calling wb_iface set_time, which in turn makes a recursive call to set_command_time. This removes the erroneous recursive call.
* multi_usrp_rfnoc: Misc fixesMichael West2020-05-121-6/+7
| | | | | | | | | - Change get_master_clock_rate() to return tick rate instead of sample rate - Make warning of incompatible rates conditional so it does not display for first channel Signed-off-by: Michael West <michael.west@ettus.com>
* TwinRX: Remove decimation from frontendMichael West2020-05-123-31/+7
| | | | | | | | | | | | | | The decimation in the rx_frontend_gen3 was added to reduce the bandwidth between the Radio and the DDC due to the limitation in bandwidth over the crossbar for dynamically connected blocks. The default FPGA image for the X300 now has a static connection between the Radio and DDC, so this is no longer necessary. This change allows the TwinRX receive channels to be time aligned with channels from other daughterboards so they can be used in the same streamer. Signed-off-by: Michael West <michael.west@ettus.com>
* 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>
* uhd: Add reference power level API to multi_usrp and radio_controlMartin Braun2020-05-111-0/+2
| | | | This adds the has_* API calls to the Python API.
* Remove remaining Python 2 referencesMartin Braun2020-05-0726-26/+26
| | | | | | | This changes two things in all applicable files: - Remove imports from __future__ - Change default shebangs from /usr/bin/env python to /usr/bin/env python3
* cores: Fix rx_vita_core_3000 assertion error in issue_stream_cmd()Martin Braun2020-05-051-3/+7
| | | | | | | | | | | | | | | | The current code had an assertion UHD_ASSERT_THROW(stream_cmd.num_samps <= 0x0fffffff); which would check that num_samps in a stream command don't exceed the counter depth in the FPGA. However, this is only relevant if the stream command is not "continuous" or "stop". num_samps could be unitialized, and randomly have a value larger than the maximum, and the assertion could trigger even though the value in num_samps is irrelevant. The new assertion checks for the correct case, and has a more verbose error message.
* multi_usrp: Remove rfnoc-specific code from multi_usrp.cppMartin Braun2020-04-281-38/+0
| | | | | This implementation of multi_usrp is only for non-RFNoC devices; the section was thus dead code.
* rh: Remove compiler warningMartin Braun2020-04-171-2/+4
| | | | | | | | | Adds UHD_UNUSED() to tag variables that is only used in a UHD_LOG_TRACE() macro. Note this would be also be possible by tagging the local functions {rx,tx}_band_to_log as unused, but g++ does not support that specific kind of attribute, at least in the current versions.
* ad9361: Remove compiler warningMartin Braun2020-04-171-1/+1
| | | | | Adds UHD_UNUSED() to tag a variable that is only used in a UHD_LOG_TRACE() macro.
* 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-175-0/+140
| | | | | | | | | | | | | | | | | | 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.
* cal: Add pwr_cal containerMartin Braun2020-04-173-0/+394
| | | | | | | This is a cal container for all types of power cal (RX or TX) that rely on a single, overall gain value. Includes Python API.
* lib: utils: interpolation: Add bilinear interpolationMartin Braun2020-04-171-0/+117
| | | | | | This allows to treat a std::map<KeyType<std::map<KeyType, ValueType>> as a set of x-y coordinates, and bilinearly interpolate a z-value given four x/y pairs.
* libusb: Remove deprecation warnings for libusb_set_debugMartin Braun2020-04-151-1/+14
| | | | | | | | | | | Starting with 1.0.22, libusb considers libusb_set_debug() deprecated. This replaces said call with libusb_set_option(), conditionally on the libusb version. This has no effect on the execution, but will remove some compiler versions, and make this code more future-proof. Note that Ubuntu 18.04 ships libusb 1.0.21, so this conditional code needs to remain until that version is deprecated and libusb version is bumped higher.
* rfnoc: Add RFNoC fosphor blockWade Fife2020-04-142-0/+419
|
* utils: log: fix logging race conditionmattprost2020-04-141-1/+3
| | | | | | | It was possible that output to cout would become interleaved inside of the uhd log messages. Signed-off-by: mattprost <matt.prost@ni.com>
* rpclib: Remove some warnings from object.hppMartin Braun2020-04-141-0/+12
| | | | | This removes -Wmaybe-uninitialized and -Wclass-memaccess from this file when using gcc.
* b200: Add a prop tree node usb_versionMartin Braun2020-04-141-0/+1
| | | | | At /mboards/0/usb_version, we can now read back an int. It's either 2 or 3, depending on what we're using.
* multi_usrp: Approximate legacy behaviour for recv_async_msg()Martin Braun2020-04-131-5/+29
| | | | | | | | | | | | | When using multi_usrp with an RFNoC device, the previous behaviour was to throw an exception when calling recv_async_msg() so users would know they're not supposed to call it (calling tx_stream::recv_async_msg is preferred). However, this breaks too many existing applications. Instead, we keep a weak pointer to the streamer, the same way that older devices do, and query the async message from that. This means that calling recv_async_msg() when there are multiple streamers can lead to unexpected behaviour, but that's a general issue with multi_usrp::recv_async_msg() and this way, the RFNoC devices now behave like older devices do.
* multi_usrp_rfnoc: Manually pass sample rate to ddc/ducsteviez2020-04-133-0/+24
| | | | | | | | | | | | | | 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.
* multi_usrp_rfnoc: Fix get_rx/tx_rates()steviez2020-04-131-12/+10
| | | | | This replaces incorrect code with the proper function calls to retrieve the range of possible sample rates.
* fixup! uhd: Add fuzzy serial number checkingmattprost2020-04-092-4/+3
|
* 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).
* uhd: mpm: Query prefs per-device for multi-device queriesLane Kolbly2020-04-083-6/+16
| | | | | | | If a user specifies a multi-device query, such as "serial0=1234,serial1=4321", we have to look up the preferences for each device. To minimize the impact to non-x400 devices, I simply push the get_usrp_args call down into mpmd_impl and mpmd_find.
* uhd: Add missing include guardsLane Kolbly2020-04-083-0/+6
|
* uhd: Replace include guards with pragma onceLane Kolbly2020-04-08113-451/+115
| | | | | Pragma once is the more modern version of include guards, eliminating any potential problems with mistyping include guards. Let's use those.
* uhd: Add fuzzy serial number checkingLane Kolbly2020-04-084-1/+55
| | | | | | | | | We have integer 32-bit serial numbers for MPM devices, for example "1234abcd". For serial numbers which have less than eight digits, e.g. "123abcd", a user may feel inclined to prefix this number with a 0 when they are searching for devices, e.g. "0123abcd". This change makes it so that specifying "0123abcd" will match a device with serial number "123ABCD".