aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/tests/test_utilities.py
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2021-06-04 08:27:50 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2021-06-10 12:01:53 -0500
commit2a575bf9b5a4942f60e979161764b9e942699e1e (patch)
tree2f0535625c30025559ebd7494a4b9e7122550a73 /mpm/python/tests/test_utilities.py
parente17916220cc955fa219ae37f607626ba88c4afe3 (diff)
downloaduhd-2a575bf9b5a4942f60e979161764b9e942699e1e.tar.gz
uhd-2a575bf9b5a4942f60e979161764b9e942699e1e.tar.bz2
uhd-2a575bf9b5a4942f60e979161764b9e942699e1e.zip
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>
Diffstat (limited to 'mpm/python/tests/test_utilities.py')
-rwxr-xr-xmpm/python/tests/test_utilities.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/mpm/python/tests/test_utilities.py b/mpm/python/tests/test_utilities.py
index 198eda5e8..942ad956a 100755
--- a/mpm/python/tests/test_utilities.py
+++ b/mpm/python/tests/test_utilities.py
@@ -90,6 +90,7 @@ class MockRegsIface(object):
self.map = register_map
self.recent_vals = {}
self.next_vals = {}
+ self.recent_addrs = []
def peek32(self, addr):
"""
@@ -110,12 +111,32 @@ class MockRegsIface(object):
"""
self.map.set_reg(addr, value)
+ self.recent_addrs.append(addr)
+
# Store written value in a list
if addr in self.recent_vals:
self.recent_vals[addr].append(value)
else:
self.recent_vals[addr] = [value]
+ def peek16(self, addr):
+ """
+ Pass the request to the 32 bit version
+ """
+ return self.peek32(addr) & 0xFFFF
+
+ def poke16(self, addr, value):
+ """
+ Pass the request to the 32 bit version
+ """
+ self.poke32(addr, value)
+
+ def get_recent_addrs(self):
+ return self.recent_addrs
+
+ def clear_recent_addrs(self):
+ self.recent_addrs = []
+
def get_recent_vals(self, addr):
"""
Returns the past values written to a given address.
@@ -123,6 +144,13 @@ class MockRegsIface(object):
"""
return self.recent_vals.get(addr, [])
+ def clear_recent_vals(self, addr):
+ """
+ Clears the past values written to a given address.
+ Useful for validating HW interaction
+ """
+ self.recent_vals[addr] = []
+
def set_next_vals(self, addr, vals):
"""
Sets a list of the next values to be read from the