Commit graph

8058 commits

Author SHA1 Message Date
Brent Stapleton
d1a5b70a8f gain_groups: Add zero-value gain groups
Add convenience factory for making a gain group that has a single
zero-valued element. This factory requires a name, which should
probably be ALL_GAINS, or something similar (these constants are
device-specific).

Using this new make_zero factory in the X300 radio control when we
don't find any gain elements so that our gain groups aren't empty. This
simplifies our later setters/getters because we know that we'll always
have _something_ cached.
Note that we only register this zero value gain group for TX, as our
ADC is registered as a gain element, so our RX gain groups are never
empty.
2019-11-26 11:49:11 -08:00
Martin Braun
75ad0c5516 convert: Add chdr converters for sc16 -> fc32 and vice versa
These differ from the item32 converters in that they don't IQ swap, and
also don't have a BE/LE version.
2019-11-26 11:49:11 -08:00
Martin Braun
9df26a9d89 convert: sse2: Apply clang-format 2019-11-26 11:49:10 -08:00
Martin Braun
fed32af080 convert: Add CHDR converters
The difference between the _chdr converters and the _item32_ converters
is that the former do not require item32 boundaries, they do not require
endianness swapping, and they don't use IQ swapping either.

This is possible because the FPGA will do byte-swapping.
2019-11-26 11:49:10 -08:00
Aaron Rossetto
93d8c6f83b uhd: Add thread affinity utility functions 2019-11-26 11:49:10 -08:00
Martin Braun
1ee9529abd uhd: utils: Add compat check for 32-bit compat numbers 2019-11-26 11:49:10 -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
Martin Braun
e250da5003 utils: cast: Add from_str() typecast
This is the inverse to std::to_string(), and we can overload it with
UHD-internal types.
2019-11-26 11:49:10 -08:00
Martin Braun
e9fa920ad8 soft_register: Replace boost::unordered_map with std version
This is the only occurrence of boost::unordered_map in UHD.
2019-11-26 11:49:10 -08:00
Martin Braun
8aaf42a280 utils: soft_register: Remove 16-bit mode
This mode is never used, and makes it more cumbersome to maintain this
code.
2019-11-26 11:49:09 -08:00
Martin Braun
15bdf9b64b utils: dirty_tracked: Remove custom copy constructor
The custom copy ctor for dirty_tracked was using the = operator, which
wouldn't necessarily copy the dirty flag. By removing it (and thus using
the default copy ctor), the copied dirty_tracked object now has the same
value *and* dirty flag as the original.
2019-11-26 11:49:09 -08:00
Ashish Chaudhari
64dd48776c utils: Added set_thread_name for std::thread 2019-11-26 11:49:08 -08:00
Martin Braun
96a19dc03f nirio_fifo: Replace boost::atomic with std::atomic
This is the only occurrence of boost::atomic in UHD.
2019-11-26 11:49:08 -08:00
Martin Braun
6f6429c45b uhd: types: Extend stream_cmd_t::num_samps to 64 bits
Newer devices may be able to provide more then 32 bits worth of samples.
2019-11-26 11:49:08 -08:00
Martin Braun
3df500cb19 uhd: Add new exceptions for RFNoC-specific errors
Add the following exception types:
- rfnoc_error
- op_failed
- op_seqerr
- op_timeout
- op_timeerr
- access_error
  - It is meant to be used when access violations have taken place,
    i.e., when a resource is being accessed without appropriate
    permissions.
- resolve_error
  - This is a derivative of rfnoc_error, and will be used when a
    property resolution fails unexpectedly.
- routing_error
  - For use when the framework has path setup issues or general
    routing-related errors
2019-11-26 11:49:08 -08:00
Martin Braun
2ed94af772 uhd: Remove deprecated objects and methods
This removes the following symbols:
- otw_type_t
- clock_config_t
- Any functions that use those symbols
- Non-standard args from examples (e.g., --total-time is deprecated in
  favour of --duration)
2019-11-26 11:49:08 -08:00
Martin Braun
d94140a412 uhd: Remove support for N230
Note: N230 is still supported on the 3.15 LTS branch
2019-11-26 11:49:08 -08:00
Martin Braun
6c75624814 Update CODING guidelines
- Remove reference to Python 2
2019-11-26 11:49:08 -08:00
Martin Braun
9b0702c546 cmake: Bump dependency versions for UHD 4.0.0.0
- Boost >= 1.58
- CMake >= 3.5.1
- gcc >= 5.4.0
- Clang >= 3.8, AppleClang >= 600
- Python >= 3.5 (Py2k no longer supported)
- Numpy >= 1.11
- C++14 for lib, include may now use C++11 constructs.
  - Because there is no more code requiring C++03 syntax, we remove the
    include-specific clang-format file
2019-11-26 11:49:08 -08:00
mattprost
062b82f6fd x3x0: DPDK initialization fix
Pass original args into the x300_get_udp_factory() function. This
exposes the fact that this is a DPDK connection.
2019-11-25 13:41:35 -08:00
mattprost
9c0dc99e9d tools: update FPGA functional verification tests for X3x0 mcr's & dpdk
-Added test cases for the 184.32MHz clock rate.
-Removed some extra test cases for 200MHz clock rate in order to
cut down on test time.
-Added DPDK test cases (copied from 10gige and 2x_10gige test cases).
2019-11-25 13:38:34 -08:00
natetemple
d3e1d6e9be Examples: wrap up ref setting with option check 2019-11-24 16:56:27 -08:00
natetemple
0e184f7185 Examples: Set refs in RFNoC examples 2019-11-24 16:55:27 -08:00
Martin Braun
9b203bf95b mpm: i2cdev: Use O_LARGEFILE to open i2c devices 2019-11-22 21:27:37 -08:00
Martin Braun
39807cc9e2 mpm: i2cdev: Fix formatting and compiler warnings
- Remove superfluous includes
- Fix return value of _open() (was int, now void) => Fewer compiler
  warnings
- Apply clang-format
- Add {} to all ifs
2019-11-22 21:27:37 -08:00
Martin Braun
67a96646d0 rfx: Fix calculation of prescaler and band select
The code was broken when converting from BOOST_FOREACH to a range-based
for loop.
Without this fix, the board initialization would crash with an error
like this:

[ERROR] [DBMGR] The daughterboard manager encountered a recoverable
error in init.
Loading the "unknown" daughterboard implementations to continue.
The daughterboard cannot operate until this error is resolved.
LookupError: KeyError: key "0" not found in dict(i,
N14adf4360_regs_t17prescaler_value_tE)
2019-11-22 21:13:58 -08:00
natetemple
1996adfc49 Examples: tx_bursts add subdev, ref, lo-offset, bw options 2019-11-22 20:38:27 -08:00
steviez
1c1f9c4848 docs: clarifying which devices support DPDK 2019-11-22 19:26:24 -08:00
Joerg Hofrichter
8a83521478 docs: fixed links where original URL was not accessible anymore
Signed-off-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
2019-11-22 10:15:01 -08:00
Martin Braun
3b161d6f49 mpm: gpsd_iface: Sanitize return values for get_gps_info()
get_gps_info() can time out, or fail for other reasons. This adds some
checks to see if the return value is as expected.
2019-11-21 15:02:39 -08:00
Martin Braun
428288bbea utils: query_gpsdo_sensors: Fix ref_lock wait loop
The old loop didn't have any output, and had an inaccurate timeout. We
now use a timer for a 30 second timeout, and print a . every time we
poll the sensor.
2019-11-21 15:02:32 -08:00
Martin Braun
473a3e148a e31x: Remove spurious debug logs
This demotes INFO logs to TRACE that relate to the switch settings
during tuning.
2019-11-21 15:02:23 -08:00
Martin Braun
8688b1e645 examples: test_pps_input: Also test for ref_locked on E31x
The E31x will always have a valid PPS, because it is generated
internally. The external PPS however is used to drive the ppsloop, which
means the ref_locked sensor can be a substitute for the PPS, but only on
in this case.

This commit also removes some superfluous includes from this example.
2019-11-21 15:02:03 -08:00
iprivit
eb448043a9 python: MultiUSRP: Fix send_waveforms()
The send_waveform() function takes the waveform_proto array and if it
has only 1 channel, explicitly reshapes it to be
(1, waveform_proto.size), or uses np.tile to replicate the
waveform_proto array over X channels. It then proceeds to loop over the
waveform_proto array, but attempts to do so over the channel dimension
instead of looping over the actual samples. This results in sending the
entire waveform_proto array regardless of the duration specified.

The fix is to specify the dimension in which it crops, and not crop in
dimension of the channels.
2019-11-13 14:07:15 -08:00
Martin Braun
21ed72b5a2 devtese: Change default Python interpreter to 3
Usually, devtest is run via make (or ninja), and will use the correct
Python interpreter. When running directly on the command line, it is
important to pick the right Python interpreter so it will work with the
Python API.

Here, we change the default interpreter from Python 2 to 3, because
that's the more common version, and will be the only option for upcoming
UHD 4.0 anyway.
2019-11-08 08:56:20 -08:00
mattprost
d2102d5999 docs: added N320/N321 to FPGA
Added appropriate references to N321 in the R&D testing doc for the
FPGA Functional Verification section.
2019-11-07 13:45:47 -08:00
Martin Braun
cfb8760204 docs: Add info on FPGA flavours for E320 and N3xx
This explains what the various FPGA flavours (XG, HG, 1G) are.
2019-11-07 13:44:39 -08:00
Martin Braun
00c3dc29c2 python: Make multi_usrp::get_*_usrp_info() return a Python dict
By using the conversion ability to std::map<>, we can make the Python
versions of get_?x_usrp_info() return a dict in Python.
Sample Python session:

>>> import uhd
>>> U = uhd.usrp.MultiUsrp(args)
>>> U.get_usrp_rx_info()
{'mboard_id': 'B200', 'rx_subdev_name': 'FE-RX2', ...}
2019-11-04 09:57:49 -08:00
Martin Braun
0014f5ba29 uhd: dict: Add typecast operator to std::map<>
This will now allow calls like this:

uhd::dict<k, v> d = /* ... */;
auto m = static_cast<std::map<k, v>>(d);
2019-11-04 09:57:49 -08:00
erickshepherdNI
ebb06c983a python: Included complex.h to allow pybind to convert that data type 2019-11-01 16:35:33 -07:00
Martin Braun
9d75460d36 mpm: rpc_server: Reenable timeouts after components have been updated
When updating a component like the FPGA, the timeouts for reclaiming get
disabled, because the update can potentially take a long time, during
which the RPC server might not be available.
There was a bug that didn't re-enable the timeouts. The most common case
where this causes issues was when the Ethernet connection was severed
during FPGA reloading, which could lead to UHD losing connection with
MPM altogether (for example because SFPs would come up with a different
IP address). In that case, MPM would remain unreachable until the next
reboot.
2019-10-28 14:39:16 -07:00
erickshepherdNI
fb71222b31 e3xx: corrected frontend name in devtest 2019-10-28 13:40:19 -07:00
Ciro Nishiguchi
60a70f7142 examples: remove thread priority elevation
Remove UHD call to elevate thread priority to realtime. 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.
2019-10-22 16:18:46 -07:00
Mark Meserve
14c5812fd7 libusb: fix global session race condition
- It was possible for two threads to generate a global session, which would
  cause one of them to become invalid.
2019-10-16 14:24:14 -07:00
Martin Braun
be183dae7a Update branch for upcoming 3.15 release
- Update submodule pointer
- Update CHANGELOG to incorporate latest changes
2019-10-15 16:30:49 -07:00
michael-west
5c0d0834a4 Docs: Adjust FPGA functional verification tests
- Reduce long tests from 3600 seconds to 600 seconds.
- Remove 2xRX@153.6e6 test for N310 10 GbE (not practical).

Signed-off-by: michael-west <michael.west@ettus.com>
2019-10-15 15:21:52 -07:00
michael-west
b2e042963a Docs: Fix MPM cmake command for E320
Add -DMPM_DEVICE=e320 to the command so the E320 version is built
and not the N3xx version.

Signed-off-by: michael-west <michael.west@ettus.com>
2019-10-15 15:21:52 -07:00
michael-west
725dc29fa9 MPM: Fix version string for logger
Added configuration of version.cpp file so @UHD_VERSION@ would be
properly replaced by the version string and @UHD_COMPONENT@ would
be properly replaced by the component string.

Signed-off-by: michael-west <michael.west@ettus.com>
2019-10-15 15:21:52 -07:00
michael-west
1004eef88e cmake: Add UHD_COMPONENT variable
Added cmake variable to set the component (currently UHD or MPM).
so the banner printed by the log_resource would reference the correct
component.  Added accessor function and appropriate calls in log.cpp.

Signed-off-by: michael-west <michael.west@ettus.com>
2019-10-15 15:21:52 -07:00
michael-west
c2f1f21d41 MPM: Add check for valid EEPROM address
Provides a more useful error message if the EEPROM cannot be found at
the specified address.  Without this change a generic index out of range
error is raised.

Signed-off-by: michael-west <michael.west@ettus.com>
2019-10-15 15:21:52 -07:00