aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/simulator/chdr_endpoint.py
diff options
context:
space:
mode:
authorSamuel O'Brien <sam.obrien@ni.com>2020-07-21 12:43:55 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-10-28 15:25:48 -0500
commitbd278a4b936f3e30f51d7cb9ff489f3ff7215379 (patch)
tree0001f604bf57831c8b760f7c135f134d91e950c2 /mpm/python/usrp_mpm/simulator/chdr_endpoint.py
parentd42ddc804118b2e9120c84efd477f9f4b3f8472e (diff)
downloaduhd-bd278a4b936f3e30f51d7cb9ff489f3ff7215379.tar.gz
uhd-bd278a4b936f3e30f51d7cb9ff489f3ff7215379.tar.bz2
uhd-bd278a4b936f3e30f51d7cb9ff489f3ff7215379.zip
sim: Support Configuration Files
This commit adds support for configuration files to the simulator. As of now, these files only change the source and sink of data samples, but they are easily extensible to add more configuration to the simulator. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
Diffstat (limited to 'mpm/python/usrp_mpm/simulator/chdr_endpoint.py')
-rw-r--r--mpm/python/usrp_mpm/simulator/chdr_endpoint.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/mpm/python/usrp_mpm/simulator/chdr_endpoint.py b/mpm/python/usrp_mpm/simulator/chdr_endpoint.py
index 303f3268d..17d707ae7 100644
--- a/mpm/python/usrp_mpm/simulator/chdr_endpoint.py
+++ b/mpm/python/usrp_mpm/simulator/chdr_endpoint.py
@@ -15,7 +15,6 @@ import select
from uhd.chdr import ChdrPacket, ChdrWidth
from .rfnoc_graph import XbarNode, XportNode, StreamEndpointNode, RFNoCGraph, NodeType
from .chdr_stream import SendWrapper, ChdrOutputStream, ChdrInputStream, SelectableQueue
-from .sample_source import NullSamples
CHDR_W = ChdrWidth.W64
@@ -25,14 +24,13 @@ class ChdrEndpoint:
traffic to the appropriate destination, and responding to said
traffic.
- The extra_args parameter is passed in from the periph_manager, and
- coresponds to the --default_args flag of usrp_hwd.py on the
- command line
+ The config parameter is a Config object (see simulator/config.py)
"""
- def __init__(self, log, extra_args):
+ def __init__(self, log, config):
self.log = log.getChild("ChdrEndpoint")
- self.source_gen = NullSamples
- self.sink_gen = NullSamples
+ self.config = config
+ self.source_gen = config.source_gen
+ self.sink_gen = config.sink_gen
self.xport_map = {}
self.send_queue = SelectableQueue()