Commit graph

66 commits

Author SHA1 Message Date
Grant Meyerhoff
78156eabfa 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
2023-09-06 10:09:36 -05:00
Martin Anderseck
b3b5e69b02 SelfCal: Trigger if clocking has changed
This change ensures that ADC selfcal is triggered during session start
if the clocking was reconfigured. So it saves time if several
consecutive sessions are opened with always the same settings.
It also makes the ADC self cal run if in an open session either
set_clock_source(), set_time_source() or set_sync_source() are called
and a clock reconfiguration was triggered by that.
2023-07-07 12:35:55 -07:00
Martin Braun
371c4c139c mpm: Add support for X440/FBX
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Martin Anderseck <martin.anderseck@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Javier Valenzuela <javier.valenzuela@ni.com>
2023-06-12 10:27:29 -05:00
Martin Braun
e08d827346 mpm: Bump compat number to 5.0
This covers the two recent changes:
- Moving the get-rate API into the daughterboard
- Add the new synchronization procedure
2023-03-24 16:08:30 -07:00
David Raeman
8cb6699772 e320: Allow internal GPSDO to be powered-down via UHD session args
Currently the E320's integrated GPSDO can be disabled using the
"enable_gps" argment at MPM initialization time (e.g. when the radio
powers on and launches the MPM daemon). However, there is no way for
a UHD application to disable the GPSDO at connection time.

This patch allows the existing "enable_gps" arg to be accepted when
initiating an MPM session from UHD, such that an application can pass
the arg "enable_gps=0" at connection time to disable the GPSDO. The
default power state of the GPSDO is restored when the session ends.

Edit: On top of the original commit by draeman-synoptic, the MPM minor
compat number was also increased to denote new non-breaking feature
support.

Co-authored-by: mattprost <matt.prost@ni.com>
Signed-off-by: mattprost <matt.prost@ni.com>
2022-11-16 09:51:57 -06:00
Martin Braun
4d6b7263f5 Revert "uhd: Revert Raw UDP Host Changes"
This reverts commit 6cb1dcca83.

Raw UDP support is added back in on both MPM and UHD side.
2022-09-21 15:35:55 -07:00
Aaron Rossetto
640dd07ed3 uhd: Update MPM compat minor 2022-04-12 13:29:49 -07:00
Lane Kolbly
19f55a9d4a mpm: Bump MPM compat version to 4.0 2021-06-24 13:52:15 -05:00
Samuel O'Brien
00c306d5c4 sim: Integrate simulator into UHD
This commit adds a device::register_device which allows uhd to start up
a simulator when uhd is called with the arguments type=sim. Creating the
device object creates a subprocess using pybind and an embedded
interpreter, and destroying the object cleans up those subprocesses.

Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
2020-10-28 15:25:48 -05:00
Aaron Rossetto
ad707ab22d mpm, mpmd: Bump MPM compat number 2020-07-24 15:24:14 -05:00
Lane Kolbly
843527d303 uhd: mpm: Query prefs per-device for multi-device queries
If a user specifies a multi-device query, such as "serial0=1234,serial1=4321",
we have to look up the preferences for each device. To minimize the
impact to non-x400 devices, I simply push the get_usrp_args call down
into mpmd_impl and mpmd_find.
2020-04-08 15:32:50 -05:00
Martin Braun
876d4150aa uhd: Apply clang-format against all .cpp and .hpp files in host/
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
2020-03-03 08:51:32 -06:00
Martin Braun
1fe98e8701 uhd: Replace usage of boost smart pointers with C++11 counterparts
This removes the following Boost constructs:
- boost::shared_ptr, boost::weak_ptr
- boost::enable_shared_from_this
- boost::static_pointer_cast, boost::dynamic_pointer_cast

The appropriate includes were also removed. All C++11 versions of these
require #include <memory>.
Note that the stdlib and Boost versions have the exact same syntax, they
only differ in the namespace (boost vs. std). The modifications were all
done using sed, with the exception of boost::scoped_ptr, which was
replaced by std::unique_ptr.

References to boost::smart_ptr were also removed.

boost::intrusive_ptr is not removed in this commit, since it does not
have a 1:1 mapping to a C++11 construct.
2019-11-26 12:21:32 -08:00
Martin Braun
7d69dcdcc3 Remove proto-RFNoC files
This commit removes all files and parts of files that are used by
proto-RFNoC only.

uhd: Fix include CMakeLists.txt, add missing files
2019-11-26 12:16:25 -08:00
Martin Braun
c256b9df65 x300/mpmd: Port all RFNoC devices to the new RFNoC framework
Co-Authored-By: Alex Williams <alex.williams@ni.com>
Co-Authored-By: Sugandha Gupta <sugandha.gupta@ettus.com>
Co-Authored-By: Brent Stapleton <brent.stapleton@ettus.com>
Co-Authored-By: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
2019-11-26 12:16:25 -08:00
Virendra Kakade
2001ac61e0 mpmd: Release resources on destruction
This will clear the property tree, block registry, transport managers,
and motherboard list on destruction of mpmd_impl.
2019-05-01 15:17:23 -07:00
Sugandha Gupta
fe3fa1dd31 device3: Constraint send/recv_frame_size based on down/upstream MTU
We need to properly contraint the send/recv_frame_size based on the
minimum MTU of all the down/upstream blocks. This fixes the issue with
E310 tx/rx streaming as it has smaller MTU sizes than the other usrps.
2019-05-01 15:17:23 -07:00
Brent Stapleton
967be2a4e8 uhd: mpm: apply clang-format to all files
Applying formatting changes to all .cpp and .hpp files in the following
directories:
```
find host/examples/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/tests/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/utils/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find mpm/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Also formatted host/include/, except Cpp03 was used as a the language
standard instead of Cpp11.
```
sed -i 's/ Cpp11/ Cpp03/g' .clang-format
find host/include/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Formatting style was designated by the .clang-format file.
2019-01-16 11:40:23 -08:00
Martin Braun
1be93abaef mpmd: Improve error message for compat number mismatches 2018-11-16 12:00:02 -08:00
Trung Tran
6013a51137 mpmd: add option to enum rfnoc blocks from args 2018-08-31 17:30:56 -07:00
Martin Braun
6652eb4a03 uhd: Move internal headers to uhdlib/
To avoid the proliferation of additional include directories and
multiple ways of including project-local headers, we now default to
moving all headers that are used across UHD into the uhdlib/
subdirectory.

Some #include statements were also reordered as they were modified for
closer compliance with the coding guidelines.

Internal cpp source files should now include files like this:

    #include <uhdlib/rfnoc/ctrl_iface.hpp>

Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
2018-03-14 15:17:44 -07:00
Brent Stapleton
bd2a518555 mpmd: add getter for components in property tree
Adding a publisher for updateable components listed in the property
tree. This calls MPM.get_component_info for the desired component, and
returns a dictionary containing that metadata.
2018-02-19 16:58:52 -08:00
Martin Braun
ae5211d71d uhd: Update license headers
All copyright is now attributed to "Ettus Research, a National
Instruments company".

SPDX headers were also updated to latest version 3.0.
2018-02-19 16:54:52 -08:00
Brent Stapleton
ca81898889 fixup! mpmd: Factor find and prop tree init code out of mpmd_impl.cpp 2018-02-09 01:41:32 +01:00
Martin Braun
3df3b6cc62 mpmd: Factor find and prop tree init code out of mpmd_impl.cpp
No functional changes.
2018-02-07 17:01:06 -08:00
Martin Braun
14babab1bd mpmd: Let 'find' via broadcast check for reachability
In particular, when running uhd_find_devices, this will limit the
devices to ones that can actually be reached via CHDR. There is a new
key, find_all, which allows finding all devices even those not
reachable from UHD.

Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-02-07 15:46:43 -08:00
Brent Stapleton
dca3914516 mpmd: image loader: increased timeout
-Increased timeout from 10s to 20s. This time is also per component file
being updated. For example, when updating the FPGA with new .bit and
.dts files, the timeout will be 40s.
-Also added log message to let user know their device is updating, not
frozen.
2018-01-29 15:42:13 -08:00
Martin Braun
ec4caf86f2 fixup! mpmd: Add API to read back logs from device and send to native logging 2018-01-11 17:11:56 -08:00
Martin Braun
20a4e2370a mpmd: Factor out compat number check 2018-01-08 17:46:00 -08:00
Martin Braun
33ddbbb257 mpmd: Refactor device initialization for better parallelizability
Note: This doesn't add any concurrency, rather, it changes the
structure of the code to allow that. Notable changes:
- All prop tree inits in one place
- No access to containers in methods that might be run in parallel
- Split initialization and claiming in mpmd_mboard_impl, calling ctor
  will no longer run the full initialization.
- Added comments to identify parallelizable spots
2018-01-08 17:38:29 -08:00
Brent Stapleton
acd1f6d91e mpm: Increase RPC timeout during update_component
Increases the host's timeout during update_component times, then resets
it to the default RPC timeout after the call is complete.

Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-01-05 16:10:47 -08:00
Martin Braun
83dd47dc88 mpmd: Allow user-overrides for MPM ports
Adds two device args: discovery_port and rpc_port. Both are integers
which override the respective constants.

Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
2018-01-04 14:17:09 -08:00
Ashish Chaudhari
fd7cfb676b mpmd: Fix fake results returned by mpmd_find
- For non-MPM Ethernet devices, mpmd_find would return a fake
  malformed discovery result which would accidentally trigger
  an mpmd_impl::make resulting in unexpected errors
- Fixed mpmd_find to return an empty device_addrs_t object if
  no MPM devices are found
2017-12-28 10:41:39 -08:00
Martin Braun
af0fe0f8dc mpmd: Optionally parallelize all calls to setup_rpc_blocks
Default is to not serialize inits.
2017-12-22 15:06:11 -08:00
Martin Braun
3b32e3b0de mpmd: Temporarily disable setting of clock and time source
Currently, calling these APIs could potentially put the device into bad
state. This will disable the APIs from UHD side and replace them with a
warning if the user's setting did not take effect.
2017-12-22 15:06:11 -08:00
Martin Braun
a2d0b50bc6 mpmd: Expose get_mtu() API to mpmd_mboard_impl and to prop tree 2017-12-22 15:06:11 -08:00
Martin Braun
27f2aa86ac n310: Move SID framing all the way to n310.py
MPM will now no longer keep a SID framer variable.

Reviewed-by: Trung Tran <trung.tran@ettus.com>
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:06:03 -08:00
Ashish Chaudhari
6af41376c1 mpmd: Device discovery fixes and cleanup
- Fixed issue where the "addr" device args was not honored
- Results returned by find only enumerate mgmt_addrs
- Explicitly require addr to be specified for RFNoC comms
- Cleaned up constants for mgmt_addr, addr and second_addr

Reviewed-by: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:06:03 -08:00
Martin Braun
87dbcd9f1a mpmd: Refactor MPM transport architecture, use managers
This splits up the transport code in mpmd_impl across multiple classes
to properly leverage the request_xport/commit_xport API in MPM.
Different types of transport (UDP, liberio) use their own distinct
classes, which are generated dynamically on request.

This is a true refactoring despite the large amount of changes; there
are no functional differences.

Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
Reviewed-By: Trung Tran <trung.tran@ettus.com>
Reviewed-By: Ashish Chaudhari <ashish.chaudhari@ettus.com>
2017-12-22 15:05:58 -08:00
Brent Stapleton
a927a364c5 mpm: mpmd: Add MPM compat number check
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
124b0ef3e9 mpmd: Allow to connect via addr or mgmt_addr
Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
a568e1d58c types: Change eeprom_map_to to uint8_t vectors
mpmd_impl was already using this type, fixed conversion from
std::string to std::vector<uint8_t> there too.

Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:05:58 -08:00
Brent Stapleton
a2029b0439 fpga load: Atomic updating of multiple components
- The MPM function update_component now accepts multiple components to
  be updated in one RPC call.
- Updated the property tree and image loader to match this change.
- Also added DTS loading to the image loader.
2017-12-22 15:05:43 -08:00
Brent Stapleton
5e5f409239 mpm: added additional filtering to mpm find routine
mpm_find now filters discovered devices using (if provided in args)
name, serial, type, and product. This method follows the same logic as
the x300 find routine.
2017-12-22 15:05:06 -08:00
Martin Braun
b12b9465ed mpm/mpmd: Move to request_xport()/commit_xport() architecture
This commit combines code from various branches to finally enable both
UDP and Liberio transports.
2017-12-22 15:05:06 -08:00
Brent Stapleton
24699d016b fpga load: mpmd property tree now uses the MPM list_updateable_components
Dynamically generates property tree by querying MPM device for a list of updateable components.
2017-12-22 15:05:06 -08:00
Brent Stapleton
7cab06dd39 fpga load: adding updateable components to mpmd property tree
The FPGA image, and other components, can now be set from the property tree. The registered function expects a component_file_t, which combines the data file and metadata dictionary.
2017-12-22 15:05:05 -08:00
Brent Stapleton
d884d7af8e mpmd: added support for the skip_init key in the device args
Adding skip_init to the device args makes it so rfnoc blocks, etc. are not initialized.
2017-12-22 15:05:05 -08:00
Martin Braun
cea45dda8f mpm: Add mboard EEPROM support
MPMD binds a property for the mboard EEPROM to the appropriate RPC
calls. PeriphManager now provides default implementations for an mboard
EEPROM.
2017-12-22 15:04:02 -08:00
Martin Braun
5c489c2597 mpm/n310: Moved the mboard ref_locked sensor into MPM
An N310 device will query all its dboards for ref lock status and
return a Boolean combination as a motherboard sensors (note: the N310
does not actually have a ref_locked sensor on the motherboard, this is
mostly for backwards-compat with UHD applications that expect a
motherboard ref lock sensor).
2017-12-22 15:04:02 -08:00