aboutsummaryrefslogtreecommitdiffstats
path: root/mpm
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-05-30 17:33:20 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:58 -0800
commit2406def0acd7ee4f3f7ac19e3ade1963b4f1c1f5 (patch)
treefac087703f36d91e0242c0c7bb75a86685a36ba7 /mpm
parent5dcaffcd0be91c7b835734d8ce1ed6f694eeab6f (diff)
downloaduhd-2406def0acd7ee4f3f7ac19e3ade1963b4f1c1f5.tar.gz
uhd-2406def0acd7ee4f3f7ac19e3ade1963b4f1c1f5.tar.bz2
uhd-2406def0acd7ee4f3f7ac19e3ade1963b4f1c1f5.zip
mpm/mpmd: Crossbar info is now polled instead of hardcoded
- Extended base periph manager to provide crossbar info
Diffstat (limited to 'mpm')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index e52a75fcb..031573551 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -26,6 +26,7 @@ from .udev import get_spidev_nodes
from usrp_mpm import net
from usrp_mpm import dtoverlay
from usrp_mpm import eeprom
+from usrp_mpm.rpc_server import no_claim, no_rpc
def get_dboard_class_from_pid(pid):
"""
@@ -368,3 +369,34 @@ class PeriphManagerBase(object):
"""
raise NotImplementedError("_allocate_sid() not implented")
+ @no_claim
+ def get_num_xbars(self):
+ """
+ Returns the number of crossbars instantiated in the current design
+ """
+ return 1 # FIXME
+
+ @no_claim
+ def get_num_blocks(self, xbar_index):
+ """
+ Returns the number of blocks connected to crossbar with index
+ xbar_index.
+
+ xbar_index -- The index of the crossbar that's being queried.
+ docstring for get_num_blocks"""
+ # FIXME
+ return int(open('/sys/class/rfnoc_crossbar/crossbar0/nports').read().strip()) - 3
+
+ @no_claim
+ def get_base_port(self, xbar_index):
+ """
+ Returns the index of the first port which is connected to an RFNoC
+ block. Example: Assume there are two SFPs connected to the crossbar, and
+ one DMA engine for CHDR traffic. The convention would be to connect
+ those to ports 0, 1, and 2, respectively. This makes port 3 the first
+ block to be connected to an RFNoC block.
+
+ xbar_index -- The index of the crossbar that's being queried
+ """
+ return 3 # FIXME This is the same 3 as in get_num_blocks
+