Commit graph

549 commits

Author SHA1 Message Date
Joerg Hofrichter
6ee886cfe2 mpm: optionally generate XML report when running unittests
If the unittests are invoked with an extra argument -x, an XML report
is generated if the xmlrunner module is installed
2020-01-22 12:19:03 -08:00
Martin Braun
1c3c7bddff mpm: mg: Make set_master_clock_rate() an async call
The ad9371 call set_master_clock_rate() can take a while depending on
the rate change, so make it asynchronous in order not to lock out the
reclaimer loop.
2019-11-26 12:21:35 -08:00
Martin Braun
e4c72d53d6 mpm: e31x: Remove superfluous code from e31x_periphs
- ref_locked failure would throw a warning, even though this can happen
  in normal operations, and the return value of the get_ref_locked()
  function is all the info needed
- get_fpga_type() doesn't need to be called from e31x_periphs, because
  it is not read from the motherboard registers (is read from the
  EEPROM)
2019-11-26 12:21:34 -08:00
Martin Braun
c481e32026 mpm: e31x: Fix setting of clock source
The clock source on E310 is always internal. This patch removes the
variables regarding the clock source (since they are superfluous). This
fixes a bug where self._clock_source on the e31x class would never get
initialized.
2019-11-26 12:21:34 -08:00
Martin Braun
9ede696528 mpm: e310: Enable GPS sensors
The GPS sensors are pulled in via gpsd_iface.
2019-11-26 12:21:34 -08:00
Martin Braun
14fb3cc6f4 e310: Fix issues in MPM and UHD
- Remove superfluous INFO logging
- Improve formatting in many places
- Improve Pylint score in various places
- Add tear_down to DB object
- Simplify custom EEPROM code for E310
- Fix time source selection code
- Remove references to GPS_CTRL and GPS_STATUS (are E320 only)
- Move clock source control out of MboardRegs object
2019-11-26 12:21:33 -08:00
Martin Braun
d60e4d87d8 mpm: Clean up code, improve Pylint score
Many small cleanups:
- Fix copyright headers
- Fix superfluous imports
- Pull some constants out of classes where appropriate
- Fix formatting
- Improve/fix some docstrings
- Disable specific Pylint warnings where appropriate
- Global catches use BaseException instead of Exception
- Don't use len() for empty checks
- Make sure to declare all self attributes in __init__ (note: this is
  particularly of interest for E310, becuase its regular init happens
  outside of __init__)
- Compacted some E310 code that had multi-DB checks
2019-11-26 12:21:33 -08:00
Martin Braun
ec488d49c0 mpm/mpmd: Remove token requirement for device info
This removes the token requirement for get_proto_ver() and
get_chdr_width().
2019-11-26 12:21:33 -08:00
Martin Braun
025ffdce34 mpm: Move common mboard regs code to common location
This assumes an existence of mboard_regs_control in PeriphManagerBase
and implements most TK controls there. All the *_periphs.py files can
now use a common class for registers, including the TK access, but also
git hash, build date, and device ID access.

This also fixes two issues:
- set_timekeeper_time() and set_tick_period() had a bug that would
  incorrectly calculate the upper 32 bits of their respective registers.
- N3xx had a bug that would swap around set time now and next PPS. This
  got auto-fixed because the common code never had this bug.
2019-11-26 12:21:33 -08:00
Martin Braun
d76cca76dd mpm: n3xx: Improve Pylint score
- Replace some `if len(seq)` with `if seq`
- Replace some `lambda: f()` with `f`
- Formatting
- Add some pylint: disable where appropriate
2019-11-26 12:21:33 -08:00
Aaron Rossetto
2da39536bb mpm: Fix calculation of link_rate for UDP xports 2019-11-26 12:21:32 -08:00
Alex Williams
f3a86a3294 rfnoc: Unify endianness of transports
Ethernet now uses the same serialization of the RFNoC stream as all
the other transports.
2019-11-26 12:21:31 -08:00
Martin Braun
7d69dcdcc3 Remove proto-RFNoC files
This commit removes all files and parts of files that are used by
proto-RFNoC only.

uhd: Fix include CMakeLists.txt, add missing files
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
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
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
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
Michael West
4042a319fd N3xx: Remove close-in noise on TX
Some close-in noise was observed on TX when using external references.
This change reduces the noise by changing U19 to select the GPSDO when
references are set to external.  Also included is a change to properly
read and apply settings from the configuration file.  This allows the
user to further quiet the transmission by adding 'enable_gps=False' to
the configuration file in order to power off the GPSDO.

Signed-off-by: Michael West <michael.west@ettus.com>
2019-10-11 12:26:12 -07:00
Martin Braun
96dd54c77a n3xx: Disable gpsdo reference source when enable_gps=0
When using enable_gps=0, the power to the LTE-Lite GPS chip is turned
off, and neither the reference sources (time/clock) nor the
location/time data (via gpsd) can be used.

This commit disables the gpsdo options for the set_time_source,
set_clock_source, and set_sync_source when enable_gps=0 is used, and
adds logging to inform the user about this.

This behaviour is consistent with X310, where `gpsdo` is only a valid
reference if the GPSDO module is plugged in.

The manual was also updated accordingly.
2019-10-11 12:25:52 -07:00
Martin Braun
da6bf176aa mpm: periph manager: Fix typo in docstring (update default args) 2019-10-11 12:25:52 -07:00
Joerg Hofrichter
3c38411bb6 mpm: usrp_hwd: fix for gevent 1.4.0
Openembedded release warrior includes python3-gevent 1.4.0 which
leads to the following error when starting usrp-hwd.py:

ImportError: cannot import name 'BlockingSwitchOutError' from 'gevent.hub'

This commit fixes the issue.

Signed-off-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
2019-10-08 12:03:47 -07:00
michael-west
abedbfe548 MPM: Increase E320 max rev to 4
Increase to currently shipping rev.

Signed-off-by: michael-west <michael.west@ettus.com>
2019-09-24 17:23:44 -07:00
Matthew Crymble
f47d805cc3 mpm: fixed mboard_max_revision value
This value should be 9 to correspond with the rev J motherboards.
This property was renamed to mboard_last_rev_compat in a previous commit.
But mboard_max_rev is actually a more accurate description,
since it specifies the latest hardware revision that the software
is aware of.  I renamed all references back to mboard_max_rev.
2019-09-24 17:23:44 -07:00
Martin Braun
227fe34217 n3xx: mg: Make set_freq() call asynchronous
This does not change the MPM/UHD API, but it makes the set_freq() call
asynchronous on the MPM side. The upside is that it will release the GIL
if the set_freq() call takes too long, e.g., because of MPM
calibrations.
2019-08-22 10:35:13 -07:00
Martin Braun
78f453f8b5 mpm: mg: Only import AD9371 API calls if not yet on Magnesium
This will avoid importing API calls from the self.mykonos object onto
the Magnesium class if the Magnesium class already has such a method.
2019-08-22 10:35:13 -07:00
Mark Meserve
0280a82aa0 e320: fix time source clobbering ref source
- Fixes a case where the e320 would be unable to lock to an external 10 MHz
  reference
- Previously, calling set_time_source would set the reference clock source to
  internal as a side effect
2019-08-15 09:00:09 -07:00
Martin Braun
e8b3319531 mpm: net: Fix typo in docstring 2019-07-20 14:41:00 -07:00
Patrick Sisterhen
c0f34ddf82 mpm: cmake: removing unnecessary destination prefix
Removing unnecessary CMAKE_INSTALL_PREFIX to destination for usrp mpm
python dir
2019-07-17 11:44:47 -07:00
Thomas Vogel
b89f76bd4d n3xx: bugfix for mpm set_db_eeprom access via network
access or data as bytes instead of str was not possible due to unconditional assert check for str
2019-06-13 09:00:46 -07:00
Trung Tran
75dc7a1d64 mpm: Change SW/HW compat check to use last_rev_compat
Newer revisions of the E320 and N3xx motherboards use EEPROM version 3,
and store a rev_compat field. The rev_compat is the last revision that
this hardware is compatible with. We now use that instead of simply the
revision.
2019-05-10 16:59:58 -07:00
Martin Braun
0812a5f6bf mpm: Add MB-EEPROMv3
This includes a rev_compat field, which we can use to identify the last
hardware revision this hardware is compatible with. Example: Say the
current hardware revision is 7, but it is compatible with version 5,
then we store 7 as the current rev, and 5 as the rev_compat. Software
can now check the rev_compat rather than the current rev for
compatibility. This makes MPM more future-proof against minor,
compatible hardware changes.
2019-05-10 16:59:58 -07:00
michael-west
436df1087b E320: Add support for rev E
- No driver changes required

Signed-off-by: michael-west <michael.west@ettus.com>
2019-05-02 08:35:59 -07:00
Sugandha Gupta
178b35569b e310/e320: Move E310 to MPM architecture and refactor
- Turns the E310 into an MPM device (like N3xx, E320)
- Factor out common code between E320 and E310, maximize sharing between
  the two devices
- Remove all pre-MPM E310 code that is no longer needed
- Modify MPM to remove all existing overlays before applying new ones
  (this is necessary to enable idle image mode for E310)

Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2019-05-01 15:17:23 -07:00
Sugandha Gupta
8a400f6a30 mpm: Add option for muxed data stream for liberio transport
If the number of channels for embedded mode streaming is 4
(1 for ctrl, 1 for async messages and 2 for data ), we need to
mux the data transport. This is needed for E310
2019-05-01 15:17:23 -07:00
Sugandha Gupta
b709c03e8b mpm: sys_utils: Remove hardcoded 'subsystem' for temp sensor
This is needed for E31x with thermal sensors on different
subsystems e.g. iio, hwmon.
2019-05-01 15:17:23 -07:00
Toni Jones
3642ac013e mpm: Generalize unittest Test Case functionality
Pull some general functionality out of a specific test case and create
a TestBase class. Future test cases will inherit from TestBase and have
access to this general functionality.
2019-04-11 09:11:43 -07:00
Martin Braun
164d76dcfd mpm: python: Move from Boost.Python to PyBind11 2019-04-02 10:39:57 -07:00
Toni Jones
8b080a8a14 cmake: Add unit testing framework to MPM
Add unit testing framework to MPM which can be run by calling
"make test". The testing is done using the built in unittest Python
module. Tests can be run on a dev machine or on the USRP itself when
compiling natively.
2019-03-26 15:15:05 -07:00
Martin Braun
d399ff0ac8 mpm: python: Clean out cruft
Remove some unused files.
2019-03-21 12:06:26 -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
435a1f13b8 mpm: rpc_server: Improve error message on double-claim
The error message will now include the IP address of the client trying
to double-claim a device.
2019-02-22 16:12:23 -08:00
Martin Braun
2a4f196068 mpm: rhodium: Fix clock value log formatting
Before, the log messages would occasionally print 6 digits worth of
precision for sample clock values that only require 2.
2019-02-22 16:12:23 -08:00
Martin Braun
0c658067bd mpm: rhodium: Fix typo in log message 2019-02-22 09:20:10 -08:00
Martin Braun
f0da25b14d mpm: n320: Update FPGA type if QSFP board is available
The N320 has FPGA types (XQ, AQ) which cannot be derived from the mboard
regs in the same way as the non-QSFP variants. We therefore bite the
bullet and hardcode those.
2019-02-22 09:20:10 -08:00
Martin Braun
356d623c23 mpm: n320: Demote warning on absence of QSFP board
The QSFP board can't be detected if support for it is not baked into
the current FPGA image, so the warning on its absence may be incorrect.
2019-02-22 09:20:10 -08:00
Martin Braun
1e5674967d mpm: bist: DDR3 test only enumerates first block 2019-02-20 12:31:49 -08:00
Martin Braun
fa52c97c00 mpm: n3xx: bist: Auto-load the AA image for the ddr3 BIST
When running

    $ n3xx_bist ddr3

The test will now load the AA image if the BIST fails, unless the user
specifies

    $ n3xx_bist ddr3 -o skip_load_fpga=1

The rationale is that by default, the AA image is the only one that
includes the DmaFIFO block.
2019-02-20 12:31:49 -08:00
Martin Braun
694538f595 mpm: n3xx: BIST: Improve DDR3 BIST to check for DmaFIFO
The capability to run the DDR3 BIST is built into the DmaFIFO RFNoC
block, which is not always available. This change performs a quick check
before for its existence before retrieving the throughput values, and
thus can provide a better error message in that case.
2019-02-20 12:31:49 -08:00
Martin Braun
564a106bd8 mpm: n3xx: Remove DDR3 from standard BIST collection
We can't guarantee that there is actually a DDR3/DRAM FIFO block on the
image. So, don't run that test by default.
In order to run the DDR3 bist, running `n3xx_bist ddr3` is still valid.
However, it requires an image with the DRAM FIFO enabled.
2019-02-20 12:31:49 -08:00
Sugandha Gupta
effa0dacad e320: add fpga_version_hash to e320 device info
Fixes uhd_usrp_probe FPGA version githash to report the
correct hash and not 'UNKNOWN'.
2019-02-19 18:12:11 -08:00