This modifies repeat_fpga_build.py such that it can take a YAML file as
input, not just a make target. It will then use the image builder to
prepare the build and generate a valid make command, which in turn is
used to build FPGA images repeatedly.
This options allows to install Python utils, including a subset of the
Python API 'uhd' module, without having to compile UHD. The main reason
to do this is to allow installing the RFNoC image builder without the
rest of UHD. To achieve this, run cmake as such:
cmake /path/to/uhd -DENABLE_LIBUHD=OFF -DENABLE_PYMOD_UTILS=ON
You might also want to disable building the manual in this case.
The refactoring required to enable this also fixes an issues when
installing UHD from source into a venv. This updates the CMake to use
pip3 to install the module, fixing some warnings and install issues.
- Use find_package(pybind11) to find a system-wide Pybind11. This will
take preference over the vendored version of Pybind11, unless
requested otherwise.
- Fix a typo.
- Image core files can now provide timebase_clock and ctrl_clock fields
to blocks, which will populate the backend interface accordingly.
- Clocks ports now have a direction associated (in, out).
When calling tx_waveforms.py with the --dram option, it will internally
use DramTransmitter and first upload the signal before transmitting it
from DRAM.
This fixes an issue where on Ubuntu 22.04 (with Python 3.10), the
installation of the Python module would go to $PREFIX/local/lib even if
the rest goes to $PREFIX/lib. We achieve this by avoiding a) using
sysconfig.get_path() to get *both* the prefix and the library path, and
then also avoiding the `posix_local` install scheme.
Note: This same logic fails to work for MPM, so we don't touch that, but
simply force MPM to use the same path as UHD has. This means MPM is
unaffected when built by itself, but follows the UHD path when built as
part of UHD.
Hat-tip to Johannes Demel for pointing out this solution path.
This adds support for different CHDR widths in the RFNoC image builder
and allows you to specify which crossbar paths to enable in the CHDR
crossbar.
In the HDL, a different CHDR width can be specified for each transport
adapter using Verilog parameters. In the RFNoC image YAML, the width of
each stream endpoint can be specified using the chdr_width parameter,
and the width for all blocks can be specified using the
block_chdr_width parameter.
With this change, the existing top-level "chdr_width" setting is now
effectively the default when not otherwise specified.
The crossbar_routes parameter can be provided using an NxN array where
N is the number of transport adapters + stream endpoints for the image
being built. For example, on X310 the following could be used:
crossbar_routes:
# eth0 pcie ep1 ep3 ep5
# eth1 ep0 ep2 ep4
- [ 1, 0, 0, 1, 1, 1, 1, 1, 1 ] # eth0 (10/1 GbE/Aurora)
- [ 0, 1, 0, 1, 1, 1, 1, 1, 1 ] # eth1 (10 GbE/Aurora)
- [ 0, 0, 1, 1, 1, 1, 1, 1, 1 ] # pcie
- [ 1, 1, 1, 0, 0, 0, 0, 1, 1 ] # ep0 (radio0.0)
- [ 1, 1, 1, 0, 0, 0, 0, 1, 1 ] # ep1 (radio0.1)
- [ 1, 1, 1, 0, 0, 0, 0, 1, 1 ] # ep2 (radio1.0)
- [ 1, 1, 1, 0, 0, 0, 0, 1, 1 ] # ep3 (radio1.1)
- [ 1, 1, 1, 1, 1, 1, 1, 0, 0 ] # ep4 (replay0.0)
- [ 1, 1, 1, 1, 1, 1, 1, 0, 0 ] # ep5 (replay0.1)
This would disable loopback paths between transport adapters, between
radio ports, and between replay ports.
Note that these features should be used with care. Removing some
crossbar routes may prevent the USRP from functioning correctly.
Specifying improper CHDR widths may lead to streaming issues.
This adds options to rfnoc_image_builder to make optional the fields of
the header in the generated RFNoC image core files. This includes the
copyright, license, date/time of generation, and source hash.
This commit adds support for the UHD power calibration API on the E3xx
family of radios. It also updates the documentation to reflect this
support, and it adds support to the uhd_power_cal.py utility by adding a
"calibrator" subclass for E3xx radios.
This adds two functions from C++ land into Python:
- uhd.types.separate_device_addr()
- uhd.types.combine_device_addrs()
Signed-off-by: Martin Braun <martin.braun@ettus.com>
The original commit did not add the compat_num.py file to the
CMakeLists.txt file. This would only be a problem when re-running
CMake with a different branch.
This allows a UHD build to link to python modules installed in a virtual
environment such a venv or pyenv.
Signed-off-by: mattprost <matt.prost@ni.com>
Adds checks for deprecated blocks (e.g., radio_1x64.yml instead of
radio.yml) as well as deprecated IO signature types (e.g., ctrl_port
instead of ctrlport).
Deprecated block descriptions are no longer parsed. Old IO signature
types are automatically converted to the new type. Warnings are
printed in both cases.
Add the Filter API to n3xx specifically for the AD937x device. The TX
filter is limited to 32 taps, and the RX filter is limited to 48 taps.
This feature requires MPM version 4.2 or later on the device.
Co-authored-by: bpadalino <bpadalino@gmail.com>
Signed-off-by: mattprost <matt.prost@ni.com>
Over the years the UHD code base got a whole bunch of tools to
control and configure devices. This is an attempt to unify these
tools into one.
Co-authored-by: Alexander Weber <alexander.weber@ni.com>
Without this, the following code fails:
>>> import uhd
>>> U = uhd.usrp.MultiUSRP("type=x4xx")
>>> M = U.get_mpm_client()
Traceback (most recent call last):
File "<input>", line 1, in <module>
M = U.get_mpm_client()
File ".../uhd/usrp/multi_usrp.py", line 37, in <lambda>
setattr(self,
'get_mpm_client', lambda: _get_mpm_client(token, mb_args))
File ".../uhd/usrp/multi_usrp.py", line 19, in _get_mpm_client
from uhd.utils import mpmtools
ModuleNotFoundError: No module named 'uhd.utils'
The original commit incorrectly fails the build
uhd in the meta-ettus context. This uses prefix
instead to get the base path.
Signed-off-by: Steven Koo <steven.koo@ni.com>
This commit replaces uses of distutils.sysconfig's get_python_lib()
function with sysconfig's near-equivalent get_path() function to get the
directory for site-specific, platform-specific files. Unfortunately,
get_path() does not have a way to easily modify or strip the prefix
applied to the path like get_python_lib() does, so the code must
manually modify the path to get the same effect:
- First, the platlib path is retrieved from the get_path() call.
- Next, the default base that is used to form the pathlib path is
queried via the get_config_var('base') call.
- Next, the portion of the platlib path that matches the default base is
stripped, and any leading path separator remaining is stripped. This
fundamentally replicates the behavior of get_python_lib() with an empty
prefix (i.e., the prefix positional parameter is specified as '').
- If a different prefix is desired, then the os.path.join() function is
used to combine the new prefix with the stripped pathlib path, ensuring
that the platform-specific path separator is used in crafting the path.
This commit replaces the use of distutils.version.LooseVersion() with
CMake's version comparison operator, which implements relational version
string checking in the same manner (i.e., comparing numeric components
of a version string numerically).
Instead of calculating a tone from its parameter it is also useful
to pass an precalculated signal to be played. This change modifies
the __init__ to take an iq_data as parameter for the internal buffer
and moves the generation of the tone from rate, frequency and amplitude
into a class method. The streamer parameter was deleted (never used).
When creating RFNoC images at least one SEP needs to have ctrl enabled
otherwise one will end up with a non-functional image.
This commit adds a method to the image builder to do plausibility checks
on the configuration. The only check done for now is to verify that there
is at least one SEP with ctrl enabled.
- Like with RX, this now allows passing in stream time and existing
streamer
- There was no EOB being sent at the end (now there is)
- Fixed some linter issues
- This function didn't set the time properly for multi-chan rx
- There was no way to set a start time manually
- It relied on garbage collection and correct destruction of streamers
when being called multiple times. Addressed this by adding an option
to pass in an existing streamer object.
- Linter wasn't too happy with this function.
See the CMake 3.8 documentation on these two variables:
https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.htmlhttps://cmake.org/cmake/help/v3.8/variable/CMAKE_SOURCE_DIR.html
Under normal circumstances, these two are identical. For sub-projects
(i.e., when building UHD as part of something else that is also a CMake
project), only the former is useful. There is no discernible downside of
using UHD_SOURCE_DIR over CMAKE_SOURCE_DIR.
This was changed using sed:
$ sed -i "s/CMAKE_SOURCE_DIR/UHD_SOURCE_DIR/g" \
`ag -l CMAKE_SOURCE_DIR **/{CMakeLists.txt,*.cmake}`
$ sed -i "s/CMAKE_BINARY_DIR/UHD_BINARY_DIR/g" \
`ag -l CMAKE_BINARY_DIR **/{CMakeLists.txt,*.cmake}`
At the same time, we also replace the CMake variable UHD_HOST_ROOT (used
in MPM) with UHD_SOURCE_DIR. There's no reason to have two variables
with the same meaning and different names, but more importantly, this
means that UHD_SOURCE_DIR is defined even in those cases where MPM calls
into CMake files from UHD without any additional patches.
Shoutout to GitHub user marcobergamin for bringing this up.
Adds a --vivado-path option to rfnoc_image_builder that, if present,
gets passed to setupenv.sh for the target device. This can be used to
specify the location of Vivado if it is not installed in one of the
default search locations.
This is a device-specific parameter to allow for the tune to settle
before proceeding with the calibration. On X410, we set this time to 500
ms. On other devices, we leave it at 0.