Commit Graph

10889 Commits

Author SHA1 Message Date
Joerg Hofrichter
5ce9a6af21 docs: fixed warnings
This fixes the following warnings:

(...)/host/docs/install.dox:43: warning: Found unknown command '\VS20XX'
(...)/host/docs/install.dox:43: warning: Found unknown command '\MSYY'
(...)/host/docs/install.dox:43: warning: Found unknown command '\dll'

WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English).

WARNING: html_static_path entry '_static' does not exist
2024-11-28 16:03:05 +01:00
mkoop
3162d75122 docs: Fixed python version used by readthedocs to 3.12 2024-11-27 16:14:46 +01:00
Martin Braun
635ad362ae lib: rfnoc ddc/duc: Fix fractional frequency offset
The RFNoC DDC/DUC block controllers had a bug, in which they would only
program the upper 24 bits of the 32-bit phase increment value for the
digital frequency shifter.

The DDC/DUC use a 24-bit DDS + multiplier to shift frequency digitally,
but the phase increment input to the DDS is a 32-bit value, which we
were (incorrectly) quantizing to a 24-bit value. This meant we were
artificially limiting the digital frequency accuracy, e.g., for a 200
MHz sample clock, to 200MHz / 2^{24} == (approx.) 12 Hz, which in turn
meant there was an unnecessary frequency error of up to 6 Hz (for lower
clock rates, the error would be smaller but still unnecessarily high).

This patch fixes the width of the phase increment value and allows for
sub-Hz accuracy (once again).

This bug was introduced in 699870d (first released with UHD 4.2).
2024-11-12 08:27:16 +01:00
Joerg Hofrichter
601503e5fa ci: fpga: make changeset analyzer verbose 2024-11-11 08:21:53 +01:00
Joerg Hofrichter
aaa13b81db ci: fpga: Adapted changeset to include RFNoC core BSP files
... which are located at host/include/uhd/rfnoc/core
2024-11-11 08:21:53 +01:00
Martin Braun
5f38bb842a image builder: Fix error message for missing control SEP
When attempting to generate an image core file with no control SEPs
(which is illegal), the image builder would throw an exception while
trying to produce the proper error message. The exception would look
like this:

File "[...]/site-packages/uhd/rfnoc_utils/builder_config.py", \
                                     line 330, in _check_configuration
    failures += [
TypeError: can only concatenate str (not "list") to str

This fixes the error, such that a regular error messages is shown now in
case of missing control SEPs.
2024-11-07 12:36:19 +01:00
Martin Braun
d30fde9d5f image builder: Accept ~ and ~user on command line
When using the following command syntax:

    rfnoc_image_builder --fpga-dir=~/path/to/uhd/fpga \
                        --yaml-config=~/path/to/image_core.yml

The shell won't expand the ~ (shorthand for $HOME) and the image builder
needs to expand the path itself, which is fixed in this commit (for
--fpga-dir, --yaml-config, and --grc-config).

Note that this is not a problem when skipping the "=", i.e., the
following work without this fix, assuming a shell that auto-expands the
tilde symbol (e.g., bash, zsh):

    rfnoc_image_builder --fpga-dir ~/path/to/uhd/fpga \
                        --yaml-config ~/path/to/image_core.yml

or

    rfnoc_image_builder -F ~/path/to/uhd/fpga \
                        -y ~/path/to/image_core.yml
2024-11-07 12:36:19 +01:00
Martin Braun
cc354e70ad image builder: Re-implement GRC support
This adds support for generating RFNoC bitfiles from GNU Radio Companion
(.grc) files. Note that this requires changes to GNU Radio as well
(updated block definition files for the GRC bindings).

There is a new mini-feature in the image builder itself: The option to
dump the YAML file into the build directory. For the GRC import, this
makes sense, because it allows reading the UHD YAML represenation of a GRC
image core.
2024-11-07 12:36:19 +01:00
Martin Braun
4f4b00b772 image builder: Improve error reporting for invalid connections 2024-11-07 12:36:19 +01:00
Martin Braun
f894f8c101 image builder: Add reload_dict() and read_yaml() to yaml_utils 2024-11-07 12:36:19 +01:00
Martin Braun
682c6bcf42 fpga: Fix X440 BSP (number of ports)
The IO port width of the radio ports is bitfile-dependent. We therefore
create a new device parameter for X440 called NUM_PORTS_PER_RADIO and
peg it to the RF_BW.
2024-11-07 11:59:52 +01:00
Martin Anderseck
787e1422b8 examples: rfnoc: Add Tune Requests to examples
Changed rfnoc_replay_samples_from_file and rfnoc_rx_to_file examples to
demonstrate the use of tune requests in RFNoC blocks.

Co-authored-by: Riya Alias <riya.alias@ni.com>
2024-11-06 14:40:07 +01:00
Martin Anderseck
fc7123e5e9 test: rfnoc: Add tests for Tune Requests
This adds tests for action forwarding in DDC and DUC block tests which
are required for Tune Requests in RFNoC.

Co-authored-by: Riya Alias <riya.alias@ni.com>
2024-11-06 14:40:07 +01:00
Martin Anderseck
7833aa71c3 rfnoc: Add Tune Request in RFNoC blocks
Implementing tune requests in rfnoc blocks using Action API.
Created new tune request action which contains the
tune_request, tune_result and ranges required for tuning.
The tune request can be issued using issue_tune_request() API from
RX/TX Streamers. The tune request action propagates through the
blocks in the rfnoc graph and does necessary frequency settings.
The output tune frequency can also be obtained from the RX/TX
streamers using get_rx_tune_frequency() or get_tx_tune_frequency()
respectively.

Co-authored-by: Riya Alias <riya.alias@ni.com>
2024-11-06 14:40:07 +01:00
Wade Fife
786e819ba6 github: Clarify purpose of issue tracker 2024-11-06 10:55:10 +01:00
ben
2ec9b1f60a doc: x440: Correct statement about RF connection - X440 uses MMPX
Co-authored-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
2024-11-06 09:49:40 +01:00
Martin Braun
e08b7bb806 image builder: Allow default clocks in domain checks
This fixes an issue where default clocks would not get detected
properly when checking for correct clock domain connections (change
added in ce96d9bf). The following error message could be observed with
some image cores:

[error] Invalid clock domain connection: _device_:rfnoc_chdr → ddc0:ce
(rfnoc_chdr is not a clock output)
[error] Invalid clock domain connection: _device_:rfnoc_chdr → duc0:ce
(rfnoc_chdr is not a clock output)

Clearly, _device_.rfnoc_chdr is a valid clock output, but it was not
detected because default clocks are stored differently from non-default
clocks.
2024-11-05 15:30:50 +01:00
Martin Braun
53b4d7a210 image builder: Use RADIO_NIPC parameter
This simplifies image core files by generating a RADIO_NIPC parameter
for the X410, X440 and E31x BSP files. The IO port widths for X410 are
now dynamically widened based on the NIPC value, which is a function of
the RF_BW parameter, and cannot be modified.

The radio block can now read the NIPC value from the BSP, and populate
its spc parameter dynamically. This avoids having to know the right spc
value when writing YAML image core files and reduces redundancy.

This also removes the RADIO_NIPC parameter entirely from all the image
core files. This parameter was fine, but it was a bit confusing because
it referenced a Verilog parameter, which you just had to know was there
in the generated Verilog. By referencing the BSP parameter instead, the
YAML files (BSP, radio.yml, and image core file) are now self-contained
regarding the RADIO_NIPC/spc information.

As a minor upside, the input wire widths for X410's and N310's
rfnoc_image_core.sv module are now generated with the correct widths,
and not, as before, with the worst-case width (and then we assume Vivado
will do the right thing).
2024-11-05 15:30:50 +01:00
Martin Braun
c74883092f image builder: Improve parameter resolution
- Default BSP parameters are now also resolved and can make use of
  previously defined BSP parameters
- Regular block parameter resolution is simplified
2024-11-05 15:30:50 +01:00
Martin Braun
cca9ff06e0 image builder: Improve IO port compat check
This improves error checking and -messages for IO ports. In particular,
this will now be able to check wire widths for compatibility. Imagine
you have a BSP with a radio connection of 1 SPC, 64-bit CHDR width, and
attempt to instantiate a radio block with 2 SPC (and also 64-bit CHDR
width). Without this changeset, the misconnection would either be caught
by the bitfile generation process, or not at all (e.g., if we are
connecting a narrow bus to a wider one, we would simply connect the
least significant bits).

With this changeset, a clear error message is given immediately when the
YAML is parsed such as this:

   Connection _device_:radio0 → radio0:radio has a wire width mismatch.
   Source port radio_rx_data_radio0 has width 64, destination port
   radio_rx_data has width 128.
2024-11-05 15:30:50 +01:00
Martin Braun
c5df0ebec7 dpdk: Remove unused variables and functions
Unused variables, constants, and functions cause compiler warnings on
recent compilers. We therefore remove those, or comment them out. The
heuristic for when to comment out and when to delete is as such: If
there is a list of constants or variables, where the unused constant
makes sense within a list, it is commented out. Otherwise, it is
deleted.
2024-11-05 10:33:30 +01:00
Martin Braun
6ed674d7e4 lib: dpdk: Fix compiler warning around dpdk_frame_buff
The class dpdk_frame_buff was referred to as a struct in the DPDK code,
which is valid, but can causes trouble. Recent compilers (e.g., clang
18) will produce a warning. We therefore fix the reference.
2024-11-05 10:33:30 +01:00
Martin Braun
48d077315e lib: dpdk: Fix compiler warning on virtual dtor
udp_dpdk_link did not have a virtual destructor, which it should have as
a virtual class (other classes inheriting from recv_link_if or
send_link_if do this correctly). This would produce compiler warnings on
more compilers (e.g., clang 18) like this:

 warning: destructor called on non-final 'uhd::transport::udp_dpdk_link'
 that has virtual functions but non-virtual destructor
 [-Wdelete-non-abstract-non-virtual-dtor]
2024-11-05 10:33:30 +01:00
Martin Braun
5340e24d83 lib: dpdk: Suppress DPDK-based compiler warnings
When using recent compilers (e.g. clang 18) and C++20 flags, the DPDK
headers that are included by UHD produce warnings because they are not
fully compliant.
Because those headers are external to UHD, we simply ignore the warnings
originating from DPDK.
2024-11-05 10:33:30 +01:00
Martin Braun
4313acbbde uhd: Add macros for checking for -W(deprecated-)volatile 2024-11-05 10:33:30 +01:00
Joerg Hofrichter
a2bb300224 ci: removed Fedora 38 builder 2024-11-04 10:28:16 +01:00
Joerg Hofrichter
b4bd952403 ci: added Fedora 41 builder 2024-11-04 10:28:16 +01:00
Joerg Hofrichter
ca3b816b79 ci: streaming test: test different DPDK versions
Test both DPDK 19.11 and 23.11
2024-11-04 10:27:58 +01:00
Joerg Hofrichter
40a02c0784 dpdk: Fix compatibility with DPDK version >= 22.11 (2)
In case of multiple NICs which have no restriction regarding
NUMA nodes, the pool_index needs to be 0 in all cases.
2024-11-04 10:27:58 +01:00
Martin Braun
ce96d9bf04 image builder: Improve clock connection checks
This adds more checks for clock connections:

- When an input clock is not connected, a warning is now produced, like
  this:

  ⚠   Unconnected clock input: gain0.ce

  Previously, this would go without any warning.

- When source or destination block are incorrectly specified, the error
  message is improved to give a much clearer indication which line of
  the input file is wrong:

  ⛔   Invalid clock domain connection: _device_:ce → gaen0:ce
  (destination block is not defined)

- When two input or output clocks are connected, this is now also
  flagged as an error:

  ⛔   Invalid clock domain connection: radio0:radio → gain0:ce (radio
  is not a clock output)

- When a block specifies a timebase or control clock (as the radio
  blocks on X4x0 do, for example) we now check the validity of the
  clocks. If an invalid or unknown clock is provided, there is now
  a clear error message:

  ⛔   Invalid timebase_clock for block radio0: _device_.tb_clk

- Clock checking is now performed on all modules, transport adapters,
  and blocks with the same rules applying to all of them.

- Because of all the new features, the clock management code was
  simplified to recoup some complexity. The `self.clocks` object was
  discarded, and all blocks, modules, and transport adapters now store
  all clock information on themselves. For example,
  `self.noc_blocks["radio0"].clocks` would provide all information on
  the clocks for radio0. This change also makes the builder object more
  similar to the YAML file (there is no "clocks" object in the YAML).

- As a result of the previous change, the template code for generating
  clock indices for control and timebase clock was simplified, and the
  logic for looking up the correct index was moved into
  builder_config.py.
2024-11-04 10:09:26 +01:00
Martin Braun
62641f8ffb image builder: Add nodevice argument to get_module_list()
The method ImageBuilderConfig.get_module_list() can now take
a 'nodevice' argument, which is a wildcard argument for "return all
blocks and modules, but not the device".

The docstring is also updated.
2024-11-04 10:09:26 +01:00
Martin Braun
945e873655 image builder: Fix linter issues 2024-11-04 10:09:26 +01:00
Martin Braun
ceeadd4704 deps: rpclib: Silence comments on unused constexpr lambda captures
Different compilers are not in agreement how to handle captures for
constexprs. On recent clang versions, a warning such as this is produced:

 warning: lambda capture 'max_read_bytes' is not required to be captured
 for this use [-Wunused-lambda-capture]

However, some versions of MSVC *require* the capture, so we have to
leave it in and live with the warnings. We therefore disable the
warnings as they have no value for us.
2024-10-29 17:59:59 +01:00
Martin Braun
5ea85c91dc lib: Fix unused-capture warning in x300_radio_control
Different compilers are not in agreement how to handle captures for
constexprs. On recent clang versions, a warning such as this is produced:

warning: lambda capture 'max_read_bytes' is not required to be captured
for this use [-Wunused-lambda-capture]

However, some versions of MSVC *require* the capture, so we have to
leave it in and live with the warnings. We therefore disable the
warnings as they have no value for us.
2024-10-29 17:59:59 +01:00
Martin Braun
52129c701d tests: Fix max287x_test compiler warnings
Previously, we had lambdas that would capture 'this' and then not use
it. Because on modern compilers (e.g., clang 18) this produces
a compiler warning, we remove the unnecessary captures.
2024-10-29 17:59:59 +01:00
Martin Braun
ef13bc8c12 uhd: Fix warnings about unused variables
There were a bunch of warnings about unused variables in UHD which were
handled in different manners:

- usrprio_rpc_common.hpp: Here a superfluous if statement was used to
  avoid the "unused" warning. However, recent compilers can also detect
  the superfluous if statement, so unused variable is now simply left
  undeclared.
- radio_control_impl.cpp had an unused constant which is now removed,
  and a conditionally used capture value which is now made "used" even
  when TRACE-level logging is disabled.
- Responder.cpp had an unused variable which was required to be
  specified as an output argument for a C-style function, so we declare
  it unused to silence the warnings.
2024-10-29 17:59:42 +01:00
Martin Braun
0fdc47dfaf examples: Remove unused constants
Unused variables, constants, and functions cause compiler warnings on
recent compilers. We therefore remove those, or comment them out. The
heuristic for when to comment out and when to delete is as such: If
there is a list of constants or variables, where the unused constant
makes sense within a list, it is commented out. Otherwise, it is
deleted.
2024-10-29 17:59:42 +01:00
Lars Amsel
1f2c28a399 Docu: Extend install instructions for libUSB on Windows
Co-authored-by: Eckhard Ohlmer <eckhard.ohlmer@ni.com>
Co-authored-by: Marian Koop <marian.koop@ni.com>
2024-10-29 16:03:34 +01:00
Joerg Hofrichter
8208bad1ad ci: devtest: abort execution if uhd_find_devices failed 2024-10-28 10:50:19 +01:00
Javier Valenzuela
19d7dd6d49 image builder: Add SYNTH and CHECK build options 2024-10-25 08:03:20 -05:00
Lars Amsel
f0638ee9c3 host: Remove duplicates in uhd::device::find result
When find issues a broadcast to identify devices in the network
it might happen that it receives multiple answers from the same
device due to network topology.

This fix removes these duplicates by utilizing the hash method
of device.cpp.

This fixes https://github.com/EttusResearch/uhd/issues/729.
2024-10-24 16:24:03 +02:00
Aki Tomita
fed089e961 docs: add a note about using the device arguments with the GPSDO 2024-10-24 08:28:12 +02:00
Lars Amsel
99b56616da MPM: Init DSP only if there is a radio frontend
Users might build X400 bitfiles without RF blocks in it. In that
case the DSP info will report 0 for both the TX and RX.
MPM needs to handle that case correct an skip RF block initialization
an fall back to default values. This will allow bitfiles without
RF to load.
2024-10-23 15:53:21 +02:00
Lars Amsel
92ebec5c86 MPM: Fix Linter issue
Fix linter issues on mpm/python/usrp_mpm/periph_manager/x4xx_clock_policy.py
before making changes to it.
2024-10-23 15:53:21 +02:00
Martin Braun
2530baeee1 image builder: Add additional checks for duplicate connections
This adds code to check if sources or destinations are referenced
multiple times in the connection list of a YAML file, and provides more
useful error messages if that is the case.
2024-10-23 12:04:08 +02:00
Martin Braun
abae1a38d9 image builder: Factor out connection-check code
This creates common.py and connections.py and moves code from
builder_config.py into those files. This is to facilitate future
modifications in the image builder.
2024-10-23 12:04:08 +02:00
Martin Braun
bfd2312c12 cmake: Increase C++ standard to 17 2024-10-21 17:42:57 +02:00
Martin Braun
55831a8f52 lib: Fix deprecated conversions of enums
In various points of UHD, we rely on implicit conversions of enum values
to double or other C++ types. In future versions of C++, those are
deprecated. In order to prepare for future versions, we fix those
implicit conversions by making them explicit.
2024-10-21 17:42:57 +02:00
Martin Braun
2dc7b3e572 lib: deps: rpclib: Fix future C++ compatibility
In C++20, copy-capture of `this` must be made explicit, which we fix
with this commit. In C++17, auto_ptr is deprecated so we replace it with
unique_ptr.
2024-10-21 17:42:57 +02:00
Joerg Hofrichter
6797cf45f5 tools: re-run UHD build if toplevel CMakeLists.txt changed 2024-10-21 17:42:57 +02:00