Commit Graph

6388 Commits

Author SHA1 Message Date
Steven Koo
9aafc0ace2 uhd: enable vcpkg support on windows
vcpkg can be used for the Windows C++ dependencies for uhd with this commit.

To use vcpkg on Windows:
1) Copy the custom triplets in host/cmake/vcpkg/ to the vcpkg/triplets/ folder.
2) Install boost and libusb for the custom triplet

"vcpkg install libusb:uhd-x64-windows-static-md boost:uhd-x64-windows-static-md"

3) Call CMake with vcpkg toolchain file flags:
-DVCPKG_TARGET_TRIPLET=uhd-x64-windows-static-md
-DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALL_DIR%/scripts/buildsystems/vcpkg.cmake
-G "Visual Studio 16 2019" -A x64

Replace the -G with the installed version of Visual Studio and matching
architecture. Then build normally by running vcvarsall.bat and msbuild.

Signed-off-by: Steven Koo <steven.koo@ni.com>
2021-03-19 15:40:09 -05:00
Wade Fife
ada6a4e467 examples: Add IP to OOT RFNoC gain example
This updates the gain example to show how to use RFNoC IP, in-tree
Xilinx IP, and out-of-tree Xilinx IP in a custom RFNoC block.
2021-03-17 17:46:06 -05:00
Martin Braun
866df135ad lib: rpc: Add virtual dtor to RPC iface base class
This avoids more clang compiler warnings.
2021-03-17 15:49:26 -05:00
Martin Braun
b36fa03407 uhd: Fix radio_control-related method constness
The const-ness of some radio_control differed between base class and
implementation. This fixes the consistency, but also makes sure these
methods follow the rules for when to make methods 'const'.

The following rules apply:
- Methods that query static capabilities are const. Here, we made
  get_tx_lo_sources() const (the RX version was already const).
- Getters that may have to interact with the device (e.g., peek
  a register) are not const, because the act of peeking is usually also
  non-const. Here, we changed get_rx_lo_export_enabled() to non-const.
- All base classes are fixed such that the derived classes and the base
  classes have the same const-ness. Clang was warning about differences.
  This can cause very tricky bugs, where the radio_control_impl version
  can get called instead of the intended child class.
2021-03-17 15:49:26 -05:00
Martin Braun
668a04befd host: Update code base using clang-tidy
The checks from the new clang-tidy file are applied to the source tree
using:

$ find . -name "*.cpp" | sort -u | xargs \
      --max-procs 8 --max-args 1 clang-tidy --format-style=file \
      --fix -p /path/to/compile_commands.json

Note: This is the same procedure as 107a49c0, but applied to all the new
code since then.
2021-03-17 15:44:05 -05:00
Lane Kolbly
bbd511dbcc examples: Remove unused arguments for rfnoc_radio_loopback 2021-03-11 09:52:18 -06:00
Martin Braun
bed66b0b6f tests: Fix warnings for rf_control_gain_profile_test
- Remove unused const
- Fix includes to IWYU and clang-format order
2021-03-11 09:33:57 -06:00
Martin Braun
328572908b lib: Remove move-on-return for chdr_packet_writer
This is a pessimizing move, and clang warns about it.
2021-03-11 09:33:57 -06:00
Wade Fife
5070256a0a mg: Fix slot_idx reference 2021-03-08 09:16:30 -06:00
Aaron Rossetto
b517f882eb lib: Fix unresolved cleanup conflict (sorry!) 2021-03-04 15:26:36 -06:00
Aaron Rossetto
7a9ec29dbc rpclib: Fix warning on ARM build 2021-03-04 12:09:17 -06:00
Martin Braun
681713aaae lib: deps: Ignore more warnings in our versions of rpclib, pybind11
This modifies the UHD versions of those libraries to turn off warnings
that appear with Clang.
2021-03-04 08:24:28 -06:00
Martin Braun
47623aabb4 lib: Use const-ref in for loops instead of const-copy
This is potentially a performance issue, even though it doesn't have
a big impact in this context. Clang will warn about it, and this fixes
the compiler warning.
2021-03-04 08:24:09 -06:00
Martin Braun
49e5ef8153 lib: Add some virtual dtors
Classes where we call delete (implicitly or explicitly) with a virtual
inheritance structure need to declare dtors as virtual.
This reduces compiler warnings with clang. There are no known bugs (yet)
due to this.
2021-03-04 08:23:50 -06:00
Martin Braun
df6c2bebae twinrx: Fix missing default copy ctor
twinrx_gain_config_t defined an assignment operator, but not a default
copy ctor. This is not allowed in modern C++, although compilers let it
slide and provide their own defaults. Clang, however, throws a warning
so let's fix it.
2021-03-04 08:20:21 -06:00
Martin Braun
ecefbdd9ab lib: Fix warnings related to unnecessary lambda captures 2021-03-04 08:20:04 -06:00
Martin Braun
a6a6f25404 convert: Remove unused variables
This reduces compiler warnings when using clang.
2021-03-04 08:18:41 -06:00
Martin Braun
79c9b6f114 mg: Remove unused private attribute from ad9371_iface
This fixes a clang warning.
2021-03-04 08:18:41 -06:00
Martin Braun
0077580ab1 rh: Remove unused constant
This fixes a clang warning.
2021-03-04 08:18:41 -06:00
Martin Braun
6da4e7622b tests: Remove unused constants
This fixes some clang warnings.
2021-03-04 08:18:41 -06:00
Martin Braun
07f591aea9 lib: lmx2592: Comment out some unused constants
These constants are useful for reference, but they're not used. We keep
them in-tree (as comments) because of their utility, but comment them
out to fix clang warnings.
2021-03-04 08:18:41 -06:00
Martin Braun
d83cac9083 rh: cpld control: Comment out gain table address
This fixes a clang warning.
2021-03-04 08:18:41 -06:00
Martin Braun
a8223f8dea rfnoc: tx_streamer: Remove EOV size attribute
It is unused, and causes clang warnings.
2021-03-04 08:18:41 -06:00
Martin Braun
bfd184b879 rh: Remove use of magic number of identify duration
This fixes a clang compiler warning.
2021-03-04 08:18:41 -06:00
Martin Braun
69665ba47e utils: Remove unused constant from b2xx_fx3_utils
This reduces compiler warnings.
2021-03-04 08:18:41 -06:00
Martin Braun
01e65903c2 lib: Remove unused constants
The constants were either commented out, when their value is still
useful to the reader, or removed if not.
2021-03-04 08:18:41 -06:00
Martin Braun
107a49c0c2 host: Update code base using clang-tidy
The checks from the new clang-tidy file are applied to the source tree
using:

$ find . -name "*.cpp" | sort -u | xargs \
    --max-procs 8 --max-args 1 clang-tidy --format-style=file \
    --fix -p /path/to/compile_commands.json
2021-03-04 08:07:26 -06:00
Toni Jones
f2ae3e93f7 ic_reg_maps: Add SPCC reg map
Add SPCC reg map for reference and testing.
2021-03-01 15:57:01 -06:00
Steven Koo
72ac96b23a devtest: reapply allow extra device arguments when running devtests
This change is substantially the same as 7b86a47, but implemented in a ninja
supported way. ninja doesn't allow for arguments, so this uses an environment
variable. This is compatible with both make and ninja. The only change
from the calling point of view is you must set the environment variable
before calling "make test_[devicetype]" instead of after as an arg.

This allows running devtests for a single device instead of all connected devices
or selecting a specific network interface.

Set the additional device arguments with the EXTRA_DEV_ARGS variable.
This can be set as an environment variable or on the command line.
For example: EXTRA_DEV_ARGS=addr=192.168.30.2 make test_x3x0

Also-by: Matthew Crymble <matthew.crymble@ni.com>
Signed-off-by: Steven Koo <steven.koo@ni.com>
2021-02-12 13:16:01 -08:00
michael-west
13f1dc28f1 mpmd: Skip find if "resource" key is specified
MPM devices were being discovered when trying to locate PCIe connected
devices.  Adding filter to exclude them if the "resource" key is
specified in the device address arguments.

Replaces "lib: disable non pcie types in find with resource" to reduce
impact to older devices and remove API change.

Signed-off-by: michael-west <michael.west@ettus.com>
2021-02-11 07:16:48 -06:00
michael-west
910db73c9a TwinRX: Fix LO lock failure
Always write register 6 in the ADF5356.  Conditional write was causing
the LO not to lock at some frequencies.

Signed-off-by: michael-west <michael.west@ettus.com>
2021-02-10 12:38:59 -06:00
Matthew Crymble
50e6357b55 Revert "devtest: allow extra device arguments when running devtests"
This reverts commit 7b86a47bf7.
This was causing issues when building UHD with ninja
2021-02-08 15:27:16 -06:00
michael-west
fbb0b09989 ADF535x: Change freq_resolution to mod2
The freq_resolution parameter to the set_frequency() method was
confusing.  Changing it to the mod2 value clarifies the intention and
makes the math to reduce the FRAC2 and MOD2 values much easier to read
and maintain.

Signed-off-by: michael-west <michael.west@ettus.com>
2021-02-04 13:48:46 -06:00
Michael West
c5d7e88a9e dboard_iface: Modify sleep() function
The algorithm for the sleep() function is changed to first increment the
command time if the command time is set.  If the command time is not
set, it just performs a sleep on the host.  The intention is to make a
best effort to create the requested delay on the device.

Signed-off-by: Michael West <michael.west@ettus.com>
2021-02-04 13:48:46 -06:00
michael-west
6a5807ecab TwinRX: Spur cleanup
- Reduce FRAC2 and MOD2 values on ADF5356
- Add write to register 10 and delay during retune on ADF5356
- Make negative bleed conditional on integer or fractional N mode for
ADF5356
- Tune unused LOs out of band to remove interference

Signed-off-by: michael-west <michael.west@ettus.com>
2021-02-04 13:48:46 -06:00
Lane Kolbly
e115e046ec usrp: Remove old header file declarations
The definitions of these functions were deleted in 23f4f8cf4e, and so
now we can remove the declarations from the header file to prevent any
confusion.
2021-02-03 15:15:52 -06:00
Martin Braun
9c4d9d826a lib: Fix missing includes in rpc.hpp 2021-02-01 13:31:39 -06:00
Matthew Crymble
1ed4dd7071 devtest: lower rate for rx_all_chans_fast test
Using 12.5 MS/s exceeded the maximum throughput when using 4 channels over 1 GbE
2021-02-01 13:31:29 -06:00
Michael Dickens
8aa73deb5a cmake: fix cut-and-paste typo to fix SIM APPLE build
Ref: 00c306d5c4
2021-01-25 15:24:17 -06:00
Aaron Rossetto
ea5a08dbc3 tests: Add lib/ to LD_LIBRARY_PATH for pytests
This commit sets the LD_LIBRARY_PATH environment variable when invoking
pytests to ensure that Python tests that use bindings to UHD in
libpyuhd.so can link to new symbols in libuhd.so without the need to
have UHD installed.
2021-01-22 11:38:41 -06:00
Steven Koo
e9176649d1 uhd: lambda capture the node instead of vert desc
This commit adds another resolve_all_properties method to use the
node instead of the vertex descriptor. The vertex descriptor could be
removed. This could cause the lambda capture to have an outdated
vertex descriptor, which would result in a hang when looking for it.
This resolves the issue by capturing the node and looking for the vertex
descriptor.

Signed-off-by: Steven Koo <steven.koo@ni.com>
2021-01-21 15:21:24 -06:00
Gwenhael Goavec-Merou
16b38ff6c6 msgpack/predef: add riscV support 2021-01-21 12:55:03 -06:00
Matthew Crymble
7b86a47bf7 devtest: allow extra device arguments when running devtests
This allows running devtests for a single device instead of all connected devices
or selecting a specific network interface.

Set the additional device arguments with the EXTRA_DEV_ARGS variable.
This can be set as an environment variable or on the command line.
For example: make test_x3x0 EXTRA_DEV_ARGS=addr=192.168.30.2
2021-01-21 12:48:30 -06:00
Aaron Rossetto
7e2edf7057 sim: Fix CHDR header stringification
Prior to Boost 1.66, boost::format() did not support the %b format
specifier, yet the minimum version of Boost required to build UHD is
Boost 1.58 (as specified in the CMakeLists.txt file).

Rather than force an upgrade of Boost on everyone, this commit replaces
the %b format specifiers with %c and provides 'Y' or 'N' values based on
the Booleans in the CHDR header being printed (EOV and EOB).
2021-01-21 12:47:54 -06:00
Steven Koo
a2f10eed67 uhd: Check for overflow after timeout buff read
Error processing has been moved to another thread, so it's possible
that consecutive recv calls may miss the signalling that
an overflow occurred. We have no guarantee that the flag had been
set by the time the second recv call to find the errors occurs.
This adds another check for an overflow after calling
_get_aligned_buffs with a min 1ms timeout. Hopefully this is long
enough for the error to propogate, but it's not guaranteed.

Signed-off-by: Steven Koo <steven.koo@ni.com>
2021-01-21 12:47:17 -06:00
Lane Kolbly
92cb632ce1 uhd_image_loader: Consume .lvbitx files
.lvbitx files contain the device tree and the FPGA bitstream, so this
change allows a user to download a .lvbitx to their device instead of
having to juggle separate .bin and .dts files.

If a .lvbitx file does not contain a .dts section for any reason,
download will still succeed, and a warning will be printed that no dts
file was found. This behaviour was chosen (over erroring) to mimic the
existing behaviour when a .bin file is found but there is no
corresponding .dts file.
2021-01-11 13:18:22 -06:00
Andrew Lynch
53ef97460e utils: check config file before finding devices for image loader 2021-01-11 13:18:22 -06:00
Virendra Kakade
fab4a5dd17 mpmd: Add support to delay and trigger fpga/dts load after update
Add a new image_loader argument delay_reload to provide a way to update
components but optionally delay the actual load.
Similarly add a new argument, just_reload, to enable uhd to reload
the fpga/dts components.

Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2021-01-11 13:18:22 -06:00
Wade Fife
643dd4f9d1 rfnoc: Update radio to support multiple SPC 2021-01-11 12:57:28 -06:00
Martin Braun
ea0ecfcaf7 chdr: Fix u64_to_host vs. u64_from_host usage 2021-01-11 12:40:20 -06:00