Commit Graph

9571 Commits

Author SHA1 Message Date
Martin Braun
7f660c232e rfnoc: Update the MTU forwarding property for some blocks
Note that the default MTU forwarding policy is ONE_TO_ONE, therefore,
it is only strictly necessary to modify the MTU forwarding policy for
blocks that route data in a different manner. However, it may be nice to
explicitly state the forwarding policy for the benefit of the reader.

The following blocks had their policies updated:
- addsub: ONE_TO_FAN
- duc: ONE_TO_ONE
- dmafifo: ONE_TO_ONE
- null block: DROP
- replay block: DROP
- split stream: ONE_TO_FAN
- switchboard: ONE_TO_FAN
2022-04-01 14:36:35 -05:00
Martin Braun
cdb5adb190 mpm: Remove further references to rfnoc_num_blocks
This is a follow-up to 89f99fac. In 2a575bf9b, a reference to
rfnoc_num_blocks was accidentally put back into MPM.
2022-04-01 14:36:35 -05:00
Jaroslav Škarvada
9eac0c49d1 cmake: added libatomic check for boost/lockfree/queue.hpp
The boost/lockfree/queue.hpp requires linking with the
libatomic on some platforms (e.g. s390x).

Fixes #410

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2022-04-01 14:36:35 -05:00
Aaron Rossetto
bc37c11c7f rfnoc: Fix _set_subdev_spec() helper function
In 716ed77, refactoring was performed to merge `set_tx_subdev_spec()`
and `set_rx_subdev_spec()` via the use of a shared helper function,
`_set_subdev_spec()`, which factors out differences in the two
directions by accepting lambda functions from the caller. However, there
were two bugs introduced in the refactoring:

- The channel map parameter, which is either `_rx_chans` or `_tx_chans`
based on direction, was passed by value and not reference, so changes
made by the function were not persisted in the member variables
maintained in the `multi_usrp_rfnoc` class.
- The connection removal loop checks for the presence of an SEP block on
an edge as its termination condition. In the pre-refactored code, the
direction determined whether the source or destination of the edge was
checked for the SEP. However, in the refactoring, the source of the edge
is checked for both TX and RX. While this works for the
`set_tx_subdev_spec()` call, it breaks the `set_rx_subdev_spec()` call.
This commit fixes the issue by adding another lambda parameter to the
`set_subdev_spec()` function, which puts the onus of the edge check on
the direction-specific code to ensure it is looking at the correct side
of the edge.
2022-04-01 14:36:35 -05:00
Wade Fife
2963a68db7 fpga: docs: Add B205mini FPGA info
- Add ISE WebPACK supported FPGAs
- Add FPGA type for B205mini
- Update product name and URL for Vivado
2022-04-01 14:36:35 -05:00
michael-west
b0bf861422 RFNoC: Cache and re-use host endpoints
Constatntly incrementing endpoints was causing the entries in the
routing table on the device to be exhausted, eventually resulting in a
timeout error on control packets.  Since a connection between the host
and a stream endpoint on a device in a given direction is unique, the
host endpoints can be cached and re-used.  This change does that.

Signed-off-by: michael-west <michael.west@ettus.com>
2022-04-01 14:36:35 -05:00
Martin Braun
a88db324e7 cmake: uhdboost: Fix check for UHD_BOOST_REQUIRED being set
Previously, applying `-DUHD_BOOST_REQUIRED` to the cmake command line
would do nothing. Now, it is possible to skip Boost checking, e.g., to
only build the manual by calling

    cmake -DUHD_BOOST_REQUIRED=OFF -DENABLE_LIBUHD=OFF
2022-04-01 14:36:35 -05:00
Humberto Jimenez
27eaf7bb01 fpga: n3xx: rh: cpld: Refactor CPLD build process 2022-04-01 14:36:35 -05:00
Martin Braun
7c5ac1ad92 fpga: Remove noc_shell_regs.vh and sim_rfnoc_lib.svh
Both files are a UHD 3 remnant and potentially confusing for UHD
4 codebase readers.
2022-04-01 14:36:35 -05:00
Steven Koo
969be6a9df ci: Build gnuradio and gr-ettus
This change adds build support for gnuradio and gr-ettus.
After building gnuradio and gr-ettus 3.8 against the
uhddev commit, the job will upload the build artifact
for gnuradio and gr-ettus for use by downstream jobs,
like hardware testing.

Signed-off-by: Steven Koo <steven.koo@ni.com>
2022-04-01 14:36:35 -05:00
Steven Koo
4223b63719 ci: Add gnuradio deps to images
Adding gnuradio deps to build gnuradio as a job in
uhd's pipeline

Signed-off-by: Steven Koo <steven.koo@ni.com>
2022-04-01 14:36:35 -05:00
Martin Anderseck
4e51c270dc tests: Modularize x4xx_radio_mock to use it in other tests
Move x4xx_radio_mock_reg_iface_t and x400_radio_fixture from radio
block test into own file to reuse it more easily in the future.
2022-04-01 14:36:35 -05:00
Martin Braun
8f42f977fd uhd: Demote WARNING on minor compat mismatch to DEBUG
When the minor FPGA compat number on the device is ahead of what MPM
expects, we no longer print a warning. That's because by definition, the
FPGA is still compatible with the software in this case.

If UHD requires a certain minor compat number to enable a feature,
the appropriate behaviour would be to print a warning only for that
case.

This is the equivalent change to the MPM-only change in 88d28481.
2022-04-01 14:36:35 -05:00
Lane Kolbly
e3389f6bad images: Make get_images_dir return absolute path
__file__ isn't always an absolute path. It is sometimes when you import
it via a module, but if you directly call it (e.g. via
`python3 some_file.py`) then it seems like its a relative path. This
avoids any uncertainty by forcing it to be an absolute path.
2022-04-01 14:36:35 -05:00
Javier Valenzuela
c96008d3d7 fpga: x400: cpld: Bump copyright 2022-04-01 14:36:35 -05:00
Javier Valenzuela
61cdadb7bc fpga: x400: Bump copyright 2022-04-01 14:36:35 -05:00
Steven Koo
a0283ade53 ci: Generate installed binaries for downstream use
CMake doesn't allow source path to change once set.
This is problematic because downstream pipeline jobs
could use the artifacts to test but have no way to install.
Instead setup to install to uhdBuildDir-installed. Downstream
jobs then then directly reference uhd from there.

Signed-off-by: Steven Koo <steven.koo@ni.com>
2022-04-01 14:36:35 -05:00
Aaron Rossetto
1ccc5c9fcc rfnoc: Ignore errors in ctrlport response packets if ACKs not wanted
In 0caed5529, a change was made to ctrlpoint_endpoint's behavior such
that if a client does not care about checking for ACKs on poke or poll
operations, the code calls `wait_for_ack()` with a flag indicating that
it should not wait for the ACK, but find and remove the corresponding
response from the response queue. This prevents the queue from
potentially growing endlessly with response packets that the client
doesn't even care about.

However, this introduced a subtle, undesired behavioral change. When
`wait_for_ack()` finds the corresponding response for a request, it also
checks the status field of the response to report any errors flagged by
the hardware such as invalid command, routing error, etc. Prior to the
change mentioned above, since `wait_for_ack()` was never called when the
client doesn't want ACKs, the client would never be never notified of
any errors associated with the request. However, with the aforementioned
change in placd, when `wait_for_ack()` is called to find and remove the
unwanted response packet corresponding to the request, errors **are**
checked and reported up the user.

The behavior change was unearthed by the X410 ZBX CPLD initialization
code, which writes an initial value of 0 to all ZBX CPLD registers--even
read-only registers. A control request to write a read-only register
results in a response with CMDERR in its status field, as it should.
However, since the ZBX CPLD register initialization is performed with a
`poke32()` operation which by default doesn't wait for ACKs, this was
never a problem until the change to drain the response queue
inadvertently caused the error to surface. The result is that creating a
USRP session or RFNoC graph session to an X410 device is seen to
occasionally fail with a 'RuntimeError: RuntimeError: Failure to create
rfnoc_graph' message printed to the console.

This commit preserves the desired queue-draining behavior, but ignores
any error status on the response when it is found and removed from the
queue, thus restoring the behavior pre-0caed5529.
2022-04-01 14:36:35 -05:00
Steven Koo
b73175d844 ci: Add displayNames to parameters
Signed-off-by: Steven Koo <steven.koo@ni.com>
2022-04-01 14:36:35 -05:00
Steven Koo
59107937a7 ci: Add embedded builds to uhd mono pipeline
This commit adds in meta-ettus build support
into mono pipline. This uses the job implementation
in from meta-ettus for the existing pipelines.

Signed-off-by: Steven Koo <steven.koo@ni.com>
2022-04-01 14:36:35 -05:00
Steven Koo
cc4f9524c2 fixup! cmake: Replace distutils.sysconfig with sysconfig
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>
2022-04-01 14:36:35 -05:00
Steven Koo
0edc296902 lib: set dynamic_lookup and flat_namespace
This resolves some linking issues across binaries.

Signed-off-by: Steven Koo <steven.koo@ni.com>
2022-04-01 14:36:34 -05:00
Steven Koo
016463cda9 tests: disable x4xx_radio_block_test on macOS
This commit disables x4xx_radio_block_test on macOS
because the platform has stricter casting and symbol
export rules, which causes this test to fail.

Signed-off-by: Steven Koo <steven.koo@ni.com>
2022-04-01 14:36:34 -05:00
Aaron Rossetto
f6c25fc44e fixup! lib: Make simple_claimer atomic 2022-04-01 14:36:34 -05:00
Martin Braun
d98ef6be8e lib: Make simple_claimer atomic
This fixes multiple issues:
- The simple_claimer was not truly atomic, it tested and set the
  locked-flag on separate lines
- It used a Boost yield statement, although we're not running Boost
  threads
- It used the deprecated UHD_INLINE macro

We also remove spin_wait_with_timeout(), which was only used in
claim_with_wait() because it's not worth putting into its own function.

This is no API change on simple_claimer, but it may result in different
performance of this spinlock.
2022-04-01 14:36:34 -05:00
Aaron Rossetto
0637516712 deps: rpclib: Replace distutils.dir_util with shutil
This commit replaces the use of distutils.dir_util.copy_tree() with the
equivalent function shutil.copytree().
2022-04-01 14:36:34 -05:00
Aaron Rossetto
2102ea2856 python: Use setup from setuptools
This commit replaces the use of setup() from distutils.core with setup()
from setuptools.
2022-04-01 14:36:34 -05:00
Aaron Rossetto
b9abc5db56 cmake: Replace distutils.sysconfig with sysconfig
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.
2022-04-01 14:36:34 -05:00
Aaron Rossetto
707e9cd46d cmake: Replace distutils with CMake for version checks
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).
2022-04-01 14:36:34 -05:00
Martin Braun
5f7becaa09 mpm: Demote WARNING on minor compat mismatch to DEBUG
When the minor FPGA compat number on the device is ahead of what MPM
expects, we no longer print a warning. That's because by definition, the
FPGA is still compatible with the software in this case.

If UHD or MPM require a certain minor compat number to enable a feature,
the appropriate behaviour would be to print a warning only for that
case.
2022-04-01 14:36:34 -05:00
mattprost
9341d52217 ci: Separate pipeline builds for different os
This allows parameterizing pipeline runs to only build for certain os.

Signed-off-by: mattprost <matt.prost@ni.com>
2022-04-01 14:36:34 -05:00
Wade Fife
43fd1381fd fpga: hls: Add version to generated HLS IP
This change causes HLS IP to be exported with a version of 1.0.0
instead of a date code. Due to a bug in Vivado, date codes after
0x7FFFFFFF (anything in 2022 or beyond) cause an error. Setting
an explicit revision avoids this issue.

See Xilinx AR 76960 for details.
2022-04-01 14:36:34 -05:00
Wade Fife
dfaea18eed fpga: tools: Fix adding directories for HDL source 2022-04-01 14:36:34 -05:00
Martin Braun
fe7a3d1af0 rfnoc: Always clear response queue in ctrlport_endpoint
This changes the behaviour of ctrlport_endpoint (the register interface
for block controllers) to always check for an ACK after doing a poke or
poll of any kind. Previously, the behaviour was to only check for an ACK
if the policy was set that way, or if the user requested the ACK to be
received.

The problem with the former approach was that if many pokes were
performed without ever requesting an ACK or a poll, the response queue
would fill up without ever getting emptied, eventually draining the
available heap space. Note that this is not a memory leak in the usual
sense, as the response queue was correctly holding on to the response
packets.

With this change, ctrlport_endpoint::wait_for_ack() now receives
a require_ack parameter. If it is false, the behaviour of wait_for_ack()
is changed as follows:
- If the response queue is empty, immediately return with an empty
  response payload object.
- Otherwise, continue reading elements out of the response queue until
  it is either depleted (in which case the previous rule kicks in), or
  we find the ACK corresponding to the command previously sent out.

Note that this replicates the corresponding behaviour in UHD 3 (see
ctrl_iface_impl::wait_for_ack()).
2022-04-01 14:36:34 -05:00
Lars Amsel
61c9881bda fixup! uhd: Allow pass raw IQ data array to tone generator 2022-04-01 14:36:34 -05:00
Wade Fife
fad5c47af9 fpga: x400: Fix rfnoc_image_core.vh path
Previously, when running rfnoc_image_builder, the rfnoc_image_core.vh
file in the main x400 directory was being used instead of the one
generated by rfnoc_image_builder.
2022-04-01 14:36:34 -05:00
Martin Braun
8ce2ce3abd x300: Fix LED configuration for TwinRX
The problem was that TwinRX has a special LED configuration (unlike most
other daughterboards): Since it has two channels, it is possible to
stream RX from both SMA ports. In that case, we would light up both LEDs
in green (which was not happening, only one LED would light up,
depending on which antenna was set last).

This fixes the problem and turns on both LEDs when both channels are
used, and both SMA ports are selected.

Note that the reason for this issue was an incorrect porting of this
code from UHD 3. There, we had separate LED ATR objects per channel.
2022-04-01 14:36:34 -05:00
Martin Braun
3799c07199 x300: clang-format 2022-04-01 14:36:34 -05:00
Steven Koo
0b404d998d uhd: update git://github.com references to https
GitHub is removing support for using git://. Switch to https.
https://github.blog/2021-09-01-improving-git-protocol-security-github/

Signed-off-by: Steven Koo <steven.koo@ni.com>
2022-04-01 14:36:34 -05:00
Martin Braun
67e6f07ea4 e3xx: Fix frequency querying
The E3xx devices have one LO per TX/RX, respectively. That means when
changing the frequency on channel 0, the frequency on channel 1 also
gets changed. The code didn't track this change properly: When setting
channel 1, channel 0's frequency didn't match.
2022-04-01 14:36:34 -05:00
michael-west
74cb296cf1 RFNoC: Fix DSP frequency accuracy
The host code was calculating and programming a 32-bit value for the DSP
frequency, but the DDS modules in the FPGA only use the upper 24-bits.
This led to inaccurate frequency values being returned.  This change
corrects the resolution of the value on the host side so an accurate
value is returned.

Signed-off-by: michael-west <michael.west@ettus.com>
2022-04-01 14:36:34 -05:00
Andrew Lynch
a9665c5a59 examples: support multiple streamers in benchmark_rate 2022-04-01 14:36:34 -05:00
Lars Amsel
c914a78975 MPM: X410: Set correct tuning word
The comment behind the tuning word is correct but 0x200 does not
give a voltage of 1.65V but 2.5V, because the full range of the
DAC is 5V not 3.3V).
2022-04-01 14:36:34 -05:00
Martin Braun
3cae4d51de rfnoc: transport: Check if streamers are connected in send() and recv()
This adds a check in send() and recv() whether or not the streamer is
actually connected. If not, an exception is thrown with the message:

    [rx_stream] Attempting to call recv() before all channels are connected!

or

    [tx_stream] Attempting to call send() before all channels are connected!

The check is a single boolean flag check, but it does add a branch in
our hot code. Since this event is unlikely, and only happens in badly
configured apps, we will get some help from the CPUs branch prediction
to reduce the additional cost of this check.
2022-04-01 14:36:34 -05:00
Lars Amsel
40d8c0dd99 uhd: Allow pass raw IQ data array to tone generator
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).
2022-04-01 14:36:34 -05:00
Martin Braun
f8c9a1cb6c fpga: e320: Connect CTRL_IN pins to FPGA
These pins control hardware-controlled fast-lock for tuning or
cycle-accurate gain control. This commit does nothing to these pins
other than expose them into the design and assign them to zero. This
does not change the current behaviour (the motherboard has pull-downs on
these pins, so they're low by default).
2022-04-01 14:36:34 -05:00
Martin Braun
ff2943d9a6 fpga: e320: Remove copy/paste from N310 code 2022-04-01 14:36:34 -05:00
Martin Braun
e985f0d8c5 mpm: x410: Fix docstrings related to GPS sensors
No code changes, only comment changes.
2022-04-01 14:36:34 -05:00
Martin Braun
2629195cda mpm: e320/e31x: Fix lo-lock sensors
The LO-locked sensors on these devices were getting routed to the MPM
API call get_lo_lock_sensor(), which takes a 'which' argument (rx or
tx). However, UHD wants to pass a 'chan' argument (0 or 1). The way the
code was structured, it would always return 'False' (LO not locked) when
the argument was neither 'rx' or 'tx'.

The solution is to add get_rx_lo_lock_sensor() and
get_tx_lo_lock_sensor(), which generate the appropriate 'which'
argument, but discard the 'chan' argument (there is only one LO per Tx
and Rx, respectively).
2022-04-01 14:36:34 -05:00
Martin Braun
9d0e9c5e39 e31x/e320: Amend LO-locked sensor names
In UHD 3, we had two sensors names for LO lock on these devices:
lo_lock, and lo_locked. The latter is the more standard, and is checked
in examples like rx_samples_to_file.

In UHD 4, the latter was removed without comment. This adds the sensor
back again and also updates the documentation accordingly.
2022-04-01 14:36:34 -05:00