diff options
author | Grant Meyerhoff <grant.meyerhoff@ni.com> | 2023-08-24 16:18:33 -0500 |
---|---|---|
committer | Aki Tomita <121511582+atomita-ni@users.noreply.github.com> | 2023-09-06 10:09:36 -0500 |
commit | 78156eabfaab43182c46a4cdb9c7397bc4b10601 (patch) | |
tree | 6c129e9a76fd2be70258480905685d12b0c64d98 | |
parent | docs: x440: Fixed incorrect use of paragraph elements (diff) | |
download | uhd-78156eabfaab43182c46a4cdb9c7397bc4b10601.tar.xz uhd-78156eabfaab43182c46a4cdb9c7397bc4b10601.zip |
mpm: move pop_host_tasks to PeriphManagerBase
Move pop_host_tasks function call from just x4xx to all MPM devices so it can be safely called from mpmd_mboard_impl
-rw-r--r-- | host/lib/include/uhdlib/usrp/common/rpc.py | 2 | ||||
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_impl.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/x400/x400_radio_control.cpp | 3 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/base.py | 9 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/rpc_server.py | 2 |
5 files changed, 14 insertions, 4 deletions
diff --git a/host/lib/include/uhdlib/usrp/common/rpc.py b/host/lib/include/uhdlib/usrp/common/rpc.py index a3fec6332..5ed6b1370 100644 --- a/host/lib/include/uhdlib/usrp/common/rpc.py +++ b/host/lib/include/uhdlib/usrp/common/rpc.py @@ -69,6 +69,7 @@ IFACES = [ fn_from_string("void set_gpio_src(const std::string& bank, const std::vector<std::string>& src)"), Function("std::map<std::string, std::string>", "synchronize", [("const std::map<std::string, std::string>&", "sync_data"), ("bool", "finalize")]), Function("std::map<std::string, std::string>", "aggregate_sync_data", [("const std::list<std::map<std::string, std::string>>&", "collated_sync_data")]), + fn_from_string("std::vector<std::map<std::string, std::string>> pop_host_tasks(const std::string& task)"), # ref_clk_calibration fn_from_string("void set_ref_clk_tuning_word(uint32_t tuning_word)"), @@ -89,7 +90,6 @@ IFACES = [ fn_from_string("double get_spll_freq()"), fn_from_string("void setup_threshold(size_t db_number, size_t chan, size_t threshold_block, const std::string& mode, size_t delay, size_t under, size_t over)"), fn_from_string("bool is_db_gpio_ifc_present(size_t db_idx)"), - fn_from_string("std::vector<std::map<std::string, std::string>> pop_host_tasks(const std::string& task)"), # Digital I/O functions fn_from_string("void dio_set_voltage_level(const std::string& port, const std::string& level)"), diff --git a/host/lib/usrp/mpmd/mpmd_impl.cpp b/host/lib/usrp/mpmd/mpmd_impl.cpp index a989270aa..e51bcfcd3 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_impl.cpp @@ -31,7 +31,7 @@ namespace { //! Most pessimistic time for a CHDR query to go to device and back const double MPMD_CHDR_MAX_RTT = 0.02; //! MPM Compatibility number {MAJOR, MINOR} -const std::vector<size_t> MPM_COMPAT_NUM = {5, 2}; +const std::vector<size_t> MPM_COMPAT_NUM = {5, 3}; /************************************************************************* * Helper functions diff --git a/host/lib/usrp/x400/x400_radio_control.cpp b/host/lib/usrp/x400/x400_radio_control.cpp index d7e2a1c45..aca47e25d 100644 --- a/host/lib/usrp/x400/x400_radio_control.cpp +++ b/host/lib/usrp/x400/x400_radio_control.cpp @@ -234,7 +234,8 @@ x400_radio_control_impl::x400_radio_control_impl(make_args_ptr make_args) uhd::rfnoc::mb_controller::sync_source_updater_t self_cal_runner = [&](const uhd::rfnoc::mb_controller::sync_source_t&) { - auto self_cal_req = _rpcc->pop_host_tasks( + auto mpm_rpc = _mb_control->dynamic_cast_rpc_as<uhd::usrp::mpmd_rpc_iface>(); + auto self_cal_req = mpm_rpc->pop_host_tasks( "db" + std::to_string(get_block_id().get_block_count()) + "_ADCSelfCal"); if (self_cal_req.size() > 0) { if (has_feature<uhd::features::adc_self_calibration_iface>()) { diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index 2cb6dcc72..04936eec1 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -210,6 +210,15 @@ class PeriphManagerBase: device_args -- Arbitrary dictionary of info, typically user-defined """ return [] + + def pop_host_tasks(self, task): + """ + Queries all known sources of host tasks and returns a list of dicts + that can be used for parameterization of the requested task. Depending + on the return value of this, the host can trigger tasks. Currently we + only have such tasks in the clock manager. + """ + return [] # pylint: enable=unused-argument ### End of overridables ################################################### diff --git a/mpm/python/usrp_mpm/rpc_server.py b/mpm/python/usrp_mpm/rpc_server.py index 9b858ffa9..04b4433b8 100644 --- a/mpm/python/usrp_mpm/rpc_server.py +++ b/mpm/python/usrp_mpm/rpc_server.py @@ -34,7 +34,7 @@ TIMEOUT_INTERVAL = 5.0 # Seconds before claim expires (default value) LOCK_ACQ_TIMEOUT = 1 # Seconds to wait for acquiring shared lock (default value) TOKEN_LEN = 16 # Length of the token string # Compatibility number for MPM -MPM_COMPAT_NUM = (5, 2) +MPM_COMPAT_NUM = (5, 3) def no_claim(func): " Decorator for functions that require no token check " |