Commit graph

69 commits

Author SHA1 Message Date
mattprost
d80d56114a twinrx: Bypass adf535x feedback divider
Bypass the LO1 feedback divider if it is not required. Some TwinRX units
have seen issues when tuning to frequencies between 3.5GHz and 5.1GHz
while following that data path.

Signed-off-by: mattprost <matt.prost@ni.com>
2020-09-03 15:02:05 -05:00
mattprost
fc3f91e0cf twinrx: update synthesizer register values for improved rf performance
Updated Register values for ADF5356:
R2) Expand Frac2 to a 28-bit value for ADF5356
R6) Use negative bleed current for improved spurious performance
R7) Set Fractional-N Lock Detect Precision to 12.0 ns because of bleed
currents
R8) Use magic number for reserved bits
R9) Fix VCO Band Division calculation for ADF5356
RD) Expand Frac2 to a 28-bit value for ADF5356

Signed-off-by: mattprost <matt.prost@ni.com>
2020-08-11 16:07:16 -05:00
Martin Braun
f2f8ca056e cores: Remove shutdown function from spi_core_3000
This effectively reverts 0433e74. The set_shutdown() and get_shutdown()
API calls do not have a counterpart in simple_spi_core.v, which is
typically the HDL endpoint for this core driver, and thus could write to
a non-existent register. They are also never used in UHD, nor are they
part of the spi_iface interface.
2020-07-08 12:50:47 -07:00
Martin Braun
2d7676e8cf lib: Add power cal manager
This is a utility class that can be used by USRP or daughterboard
drivers to tie power calibration into their respective drivers.
2020-05-19 13:24:59 -05:00
Michael West
d0c162bc7a TwinRX: Remove decimation from frontend
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>
2020-05-12 12:03:31 -05:00
Lane Kolbly
5802a362f8 uhd: Replace include guards with pragma once
Pragma once is the more modern version of include guards, eliminating
any potential problems with mistyping include guards. Let's use those.
2020-04-08 15:16:06 -05:00
Martin Braun
a1f9619469 uhd: cal: Use usrp::cal::database instead of CSV files
Now that we have cal::iq_cal and cal::database, there's no need to
manually wrangle CSV files for calibration data. This commit replaces
all CSV operations with cal::database calls and uses cal::iq_cal as
a container.

CSV files can still be read, but are considered deprecated.
2020-04-02 11:55:17 -05:00
Aaron Rossetto
3f1554f1a5 lib: Use from_str<bool> in constrained_device_args_t
This modifies `constrained_device_args_t::bool_arg::parse()` to use
`uhd::cast::from_str<bool>` to interpret strings as Boolean values,
deduplicating the string parsing code and single-sourcing it from
`uhd::cast`.
2020-03-18 07:43:20 -05:00
Martin Braun
876d4150aa uhd: Apply clang-format against all .cpp and .hpp files in host/
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
2020-03-03 08:51:32 -06:00
Martin Braun
883e658360 ad9361: Fix formatting
- Apply clang-format
- Remove unnecessary boost::format
2020-02-10 10:19:26 -06:00
Martin Braun
0cf54ce073 mpm/mpmd: Expose APIs to drive GPIO sources
The N310 has a feature that allows the front panel GPIOs to be driven by
various sources: The PS, or any of the radio channels. The MPM-based
APIs did not expose any way to change that.

Changes:
- Add MPM APIs to PeripheralManagerBase and n3xx classes
- Improve comments and explanations
- Add host-side hooks into these new APIs in mpmd_mb_controller
- Implement these APIs for N3xx

The N3xx devices will have the option to set the GPIO source to "PS", or
to one of "RF0", "RF1", "RF2", "RF3" (if there are four channels; the
N300 and N320 can only go up to RF1).

Note: The N310 radio does not have separate FP-GPIO banks for channels
0 and 1, which needs to be fixed in a separate commit.
2020-01-23 11:37:51 -08:00
Brent Stapleton
708840002e uhd: fixing MSVC warnings
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
2020-01-09 09:18:25 -08:00
Ciro Nishiguchi
d7e5a630ed usrp: Add I/O service manager for DPDK 2019-12-20 16:32:22 -08:00
Ciro Nishiguchi
837b89e2ec rfnoc: Rename thread affinity args
Rename thread affinity args such that they do not end with an integer.
Arg names ending with an integer are interpreted as being targeted at a
specific motherboard index in device_addr methods.
2019-11-26 12:21:33 -08:00
Ciro Nishiguchi
7b95cbd7fd rfnoc: Merge I/O service device args with stream args
This makes it possible for users to put I/O service-related args in
either the device args or stream args.
2019-11-26 12:21:32 -08:00
Aaron Rossetto
0bd233e642 uhd: Introduce I/O service manager
- 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>
2019-11-26 12:21:32 -08:00
Martin Braun
fcc2e9c602 uhd: Replace boost::function with std::function
This is mostly a search-and-replace operation, with few exceptions:
- boost::function has a clear() method. In C++11, this is achieved by
  assigning nullptr to the std::function object.
- The empty() method is replaced by std::function's bool() operator
2019-11-26 12:21:32 -08:00
Martin Braun
1fe98e8701 uhd: Replace usage of boost smart pointers with C++11 counterparts
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.
2019-11-26 12:21:32 -08:00
Martin Braun
f9f9cb0d2c rfnoc: Add DMA FIFO block controller 2019-11-26 12:16:25 -08:00
Martin Braun
c256b9df65 x300/mpmd: Port all RFNoC devices to the new RFNoC framework
Co-Authored-By: Alex Williams <alex.williams@ni.com>
Co-Authored-By: Sugandha Gupta <sugandha.gupta@ettus.com>
Co-Authored-By: Brent Stapleton <brent.stapleton@ettus.com>
Co-Authored-By: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
2019-11-26 12:16:25 -08:00
Brent Stapleton
23f4f8cf4e rfnoc: Add multi_usrp_rfnoc, modify multi_usrp
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>
2019-11-26 11:49:42 -08:00
Brent Stapleton
bb7ed79f01 gpio_atr_3000: Formatting changes
Applying clang format for upcoming changes.

clang-format -i --style=file host/lib/usrp/cores/gpio_atr_3000.cpp
clang-format -i --style=file \
    host/lib/include/uhdlib/usrp/cores/gpio_atr_3000.hpp
2019-11-26 11:49:25 -08:00
Martin Braun
0f59f6a8e5 cores: gpio_atr_3000: Add capability to configure register offset
The existing implementation assumes registers are spaced 4 bytes apart.
In the current radio block design, all backward compatible registers are
spaced 8 bytes apart. This adds a feature to configure that offset.
2019-11-26 11:49:25 -08:00
Brent Stapleton
d420f4968f tx_fe_200: make register offset controllable
Following the changes in RX frontend controls, TX frontend register
offsets are now arguments to the factory function. They default to 4,
which is what the register offset was in the file before these changes.
2019-11-26 11:49:25 -08:00
Brent Stapleton
5072a0f7b6 rx_fe_3000: Changing register address calc
Changing how we calculate RX frontend register addresses to allow for
different register offsets. The register addresses are now calculated
in a manor similar to how gpio_atr_300_impl does register address
calculations, which is to allow a reg_offset to be passes in at
construction. The current default is reg_offset=4.
2019-11-26 11:49:25 -08:00
Martin Braun
7fb8523c93 lib: cores: Adapt spi_core_3000 for use with register_iface
Removes the requirement for a wb_iface, and also the requirement for
regs to be 4 addresses apart.
2019-11-26 11:49:25 -08:00
Martin Braun
600640ddf1 lib: adf535x: Add trace logs for synth configuration 2019-11-26 11:49:12 -08:00
Martin Braun
4bbbedbb7e lib: Replace uhd::get_system_time() with steady_clock
Benchmarks show that using C++ chrono features beats
uhd::get_system_time(), and the latter is simply not appropriate unless
a uhd::time_spec_t is required.
2019-11-26 11:49:12 -08:00
Martin Braun
4d5ae0cc69 lib: utils: Add new signature to get_freq_and_freq_word()
The new signature uses tuple as the return value, instead of passing in
output variables as references (C-style).
2019-11-26 11:49:10 -08:00
Brent Stapleton
0956ed4ea9 rx_fe_3000: formatting for upcoming changes 2019-08-25 19:22:06 -07:00
Mark Meserve
153713a56e max287x: improve logging
- Split tuning log into 3 lines
- Remove duplicated MAX287X
2019-06-12 16:22:04 -07:00
Martin Braun
441c97d331 cores: Apply clang-format to ?x_dsp_core_3000.* 2019-05-22 15:35:15 -07:00
Mark Meserve
bd2c992cda adf435x: run clang-format 2019-05-07 16:30:36 -07:00
Mark Meserve
b1954e6fbe adf435x: add low spur tuning mode
- adds a new mode to the adf435x driver which provides general spur performance
  improvements
2019-05-07 16:30:36 -07:00
Mark Meserve
47c2ba9054 adf535x: add charge pump control 2019-05-02 14:36:21 -07:00
Mark Meserve
5645c3117a adf435x: add charge pump with double parameter 2019-05-02 14:36:21 -07:00
Mark Meserve
b2dd1655de adf435x: enhance logging messages 2019-05-02 14:36:21 -07:00
Martin Braun
32869d2f34 include: Remove BOOST_VERSION hacks for 1.58
This removes all version hacks that were required for Boost versions
1.53 through 1.58 (since we now require 1.58).
2019-04-24 11:55:05 -07:00
Martin Braun
a5fbf781a7 lib: Allow "0" and "1" as false/true values for constrained device args
Example:

$ uhd_usrp_probe --args type=x300,ignore_cal_file=0

is equivalent to (the currently supported):

$ uhd_usrp_probe --args type=x300,ignore_cal_file=false
2019-03-20 11:30:18 -07:00
Brent Stapleton
431deb855b uhd: mpm: update all license header w/ "-or-later"
Updating all SPDX license identifiers to include "-or-later"
2019-03-08 00:43:07 +01:00
Martin Braun
4047f692d4 include: max287x: Fix conversion warning 2019-02-28 10:24:52 -08:00
Martin Braun
52138314a4 uhd: Replace all usage of boost::noncopyable with uhd::noncopyable
This fixes the build errors that occur due to switching locations of
noncopyable.hpp within Boost, and also allows us to remove
boost::noncopyable in one fell swoop.
2019-02-15 11:12:54 -08:00
Michael Dickens
93ca7c4d3c lib: fix includes for boost::noncopyable
- expert_nodes.hpp: fix to work with BOOST_VERSION < 105600, since UHD
still supports Boost 1.53.00.
- gpio_atr_3000.hpp: requires boost::noncopyable header, so replicate
that (now) in export_nodes.hpp.
2019-02-11 13:57:50 -08:00
Martin Braun
7fab6b807e math: Replace boost::*::{lcm,gcd}() with portable versions
Boost changed the lcm() and gcd() functions in Boost 1.67. This creates
portable UHD versions to be used instead. They use various Boost
versions under the hood conditionally.
2019-01-18 09:37:12 -08:00
Brent Stapleton
eb1f8f160b formatting: preparing for uhd::math cleanup
Formatting files that will be touched in upcoming changes to uhd::math
2019-01-18 09:37:12 -08:00
Brent Stapleton
8bd7498ed9 uhd: skip formatting misc arrays, maps, etc.
Various data structures are nicely formatted to be human-readable.
clang-format makes these structures harder to read, so we can skip
formatting these sections.
2019-01-16 11:40:23 -08:00
Michael West
348ae82ccc TwinRX: Fix tuning
- Set SPI clock back to 3 MHz
- Fix returned frequency for ADF5355 (rev A and B boards)
2019-01-02 15:51:09 -08:00
michael-west
535b21c402 TwinRX: Enable phase resync on ADF535x 2018-12-10 19:14:18 -08:00
michael-west
d82d21246d TwinRX: Tuning improvements
- Added delay for VTUNE calibration as per ADF5355 and ADF5356 data sheets
- Increased SPI clock to 10 MHz
- Removed write to register 10 during tuning of ADF5356 to match ADF5355 code and reduce tune time
2018-12-10 19:14:18 -08:00
Mark Meserve
1d5553317c twinrx: revise adf5356 frac2 register calculation
- If FRAC2 isn't exactly FRAC1 at certain frequencies, drifting spurs can
  be seen in the spectrum
2018-10-17 18:08:26 -07:00