diff options
author | Samuel O'Brien <sam.obrien@ni.com> | 2020-07-21 12:43:55 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-10-28 15:25:48 -0500 |
commit | bd278a4b936f3e30f51d7cb9ff489f3ff7215379 (patch) | |
tree | 0001f604bf57831c8b760f7c135f134d91e950c2 /mpm/python/usrp_mpm/periph_manager | |
parent | d42ddc804118b2e9120c84efd477f9f4b3f8472e (diff) | |
download | uhd-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/periph_manager')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/sim.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/sim.py b/mpm/python/usrp_mpm/periph_manager/sim.py index b5cc45807..3e761c809 100644 --- a/mpm/python/usrp_mpm/periph_manager/sim.py +++ b/mpm/python/usrp_mpm/periph_manager/sim.py @@ -17,6 +17,7 @@ from usrp_mpm.rpc_server import no_claim from usrp_mpm.periph_manager import PeriphManagerBase from usrp_mpm.simulator.sim_dboard_catalina import SimulatedCatalinaDboard from usrp_mpm.simulator.chdr_endpoint import ChdrEndpoint +from usrp_mpm.simulator.config import Config CLOCK_SOURCE_INTERNAL = "internal" @@ -81,9 +82,17 @@ class sim(PeriphManagerBase): ########################################################################### def __init__(self, args): super().__init__() + if 'config' in args: + config_path = args['config'] + self.log.info("Loading config from {}".format(config_path)) + self.config = Config.from_path(config_path) + else: + self.log.warn("No config specified, using default") + self.config = Config.default() + self.device_id = 1 - self.chdr_endpoint = ChdrEndpoint(self.log, args) + self.chdr_endpoint = ChdrEndpoint(self.log, self.config) # Unlike the real hardware drivers, if there is an exception here, # we just crash. No use missing an error when testing. |