Commit graph

16 commits

Author SHA1 Message Date
Martin Anderseck
c1cc72258d test: Correct sysref divider
In one of the previous changes for dual-rate a wrong value for the
sysref divider made it into test_two_sample_rates. This fixes this and
makes the MPM tests green again.
2023-11-29 08:47:48 -06:00
Martin Anderseck
f9d96f5c07 test: Add inverted rates test
This new test checks that the configurations in the X440 dual rate case
are inverted if the master clock rates are inverted and not changed. We
used to see different configurations per daughterboard when swapping the
MCRs which was fixed with the previous commit. This test ensures that
with future changes we don't break this again.
2023-11-27 15:47:02 -06:00
Martin Anderseck
dae45a7081 mpm: Update X440 clock policy
This adds all clocking restrictions that are necessary for a stable
operation of the flex-rate feature of X440.
2023-06-21 09:22:41 -05:00
Martin Braun
371c4c139c mpm: Add support for X440/FBX
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Martin Anderseck <martin.anderseck@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Javier Valenzuela <javier.valenzuela@ni.com>
2023-06-12 10:27:29 -05:00
Martin Braun
21107ff36c mpm: Fix test utilities
- Fix MockGpiod object: This class should mock the gpiod module, but it was
  missing the LINE_REQ_EV_FALLING_EDGE attribute.
- While we're at it, fix some pylint warnings.
2023-02-08 16:59:34 -06:00
Martin Braun
ee75bd984c mpm: Add CompatNumber utility class
This is a class that allows handling compat numbers as a type:

>>> cn = CompatNumber(4, 3)
>>> print(cn.major)
4
>>> cn < CompatNumber(4, 5)
True
>>> cn == CompatNumber(4.3)
True
2022-06-29 12:08:02 -07:00
Aaron Rossetto
f69d88ed1f mpm: tests: Add lib/ to library load path
Ensure that DYLD_LIBRARY_PATH on OS X or LD_LIBRARY_PATH on Linux
platforms is set appropriately before invoking MPM's Python unit tests.
2021-06-18 07:28:28 -05:00
Lars Amsel
2a575bf9b5 uhd: Add support for the USRP X410
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Michael Auchter <michael.auchter@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>
Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Lane Kolbly <lane.kolbly@ni.com>
Co-authored-by: Max Köhler <max.koehler@ni.com>
Co-authored-by: Andrew Lynch <andrew.lynch@ni.com>
Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com>
Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
2021-06-10 12:01:53 -05:00
Michael Auchter
15b94c53ed mpm: sys_utils: add libgpiod-based Gpio helper
This adds a new Gpio helper class, which uses libgpiod under the
hood instead of the deprecated sysfs GPIO access. This class provides
the ability to get/set a specific GPIO, which is looked up by name.
2021-06-03 09:34:55 -05:00
Lars Amsel
73462501f0 mpm: add unit tests for EEPROM readers 2021-05-31 05:28:47 -07:00
Toni Jones
f11fa1bff7 mpm: Create Mock classes for unit testing
Create Mock classes which mimic the behavior of a register interface
and logger to facilitate unit testing needs.
2021-02-18 07:25:34 -06:00
Samuel O'Brien
f54a22c60a sim: Embed MPM into libpyuhd
When ENABLE_SIM and ENABLE_PYTHON_API are set, this commit embeds MPM
(Built with -DMPM_DEVICE=sim) into the pyuhd package.

Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
2020-10-07 15:29:19 -05:00
Lane Kolbly
11bc3fa3a8 mpm: Make contextmanagers exception-safe
When making context managers in Python, the yield statement has to be wrapped in a try/finally clause in order to properly clean up after exceptions happen.
2020-03-03 15:16:06 -06:00
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
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
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