| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Add example to demonstrate and test SPI functionality.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This example would not specify a channel when querying the actual
frequency/bandwidth/gain after setting it. When using the --channels
options like this:
tx_bursts --channels 1 --freq 1e9 [...]
...it would request the frequency of 1 GHz on channel 1, then query the
frequency on channel 0 when reporting the "actual" frequency.
Also removes some boost::format().
|
|
|
|
|
|
| |
Some comments describing data flow direction were wrong. This commit
updates the Mako files and updates the noc_shell modules with newly
generated versions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This example had some major issues since UHD 4, which are now fixed.
Mainly, the option to include a custom RFNoC block was not working.
The example was rehauled severely:
- Custom blocks are now usable again.
- UHD/RFNoC code is used for the connections, rather than a custom
kludge.
- Sample rate is set via property propagation
- boost::format() was not helpful in this example, and was removed.
- A list of active connections is now printed
- The --block-args argument is dropped in favour of --block-props. The
former never did anything useful, and "block args" are a UHD 3 thing.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
"bank" refers to what the radio control sees, and "port" refers to what
the user looking at the physical device sees. For example, on X410 each
radio control only has a single (24-bit) output, which can be routed
to either of two ports.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes some constants from UHD that were left over from RFNoC/UHD
3.x. They are unused.
rfnoc_rx_to_file had a commented-out section that was also UHD-3 only.
Note that rfnoc/constants.hpp is pretty bare now, and could be removed.
However, it is in the public header section, so we shall leave the used
constants where they are.
This requires fixing includes in mgmt_portal.cpp.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a very mechanical task that could almost have been done with
sed. Boost versions of mutexes and locks were removed, and replaced with
std:: versions. The replacement tables are as follows:
== Mutexes ==
- boost::mutex -> std::mutex
- boost::recursive_mutex -> std::recursive_mutex
Mutexes behave identically between Boost and std:: and have the same
API.
== Locks ==
C++11 has only two types of lock that we use/need in UHD:
- std::lock_guard: Identical to boost::lock_guard
- std::unique_lock: Identical to boost::unique_lock
Boost also has boost::mutex::scoped_lock, which is a typedef for
boost::unique_lock<>. However, we often have used scoped_lock where we
meant to use lock_guard<>. The name is a bit misleading, "scoped lock"
sounding a bit like an RAII mechanism. Therefore, some previous
boost::mutex::scoped_lock are now std::lock_guard<>.
std::unique_lock is required when doing more than RAII locking (i.e.,
unlocking, relocking, usage with condition variables, etc.).
== Condition Variables ==
Condition variables were out of the scope of this lock/mutex change, but
in UHD, we inconsistently use boost::condition vs.
boost::condition_variable. The former is a templated version of the
latter, and thus works fine with std::mutex'es. Therefore, some
boost::condition_variable where changed to boost::condition.
All locks and mutexes use `#include <mutex>`. The corresponding Boost
includes were removed. In some cases, this exposed issues with implicit
Boost includes elsewhere. The missing explicit includes were added.
|
|
|
|
|
|
|
| |
the USRP power meter will only receive from a single channel which
is configured by the argument parameter. The streamer receive
data will therefor alwalys have a single channel. So do not index
with chan when passing the streamer to uhd.dsp.signals.get_usrp_power.
|
|
|
|
|
|
|
| |
- 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 fixes a subtle bug, where a variable to cache the timestamp of an
error gets bound to the metadata instead of creating a copy thereof.
Without this fix, the calculation of dropped samples would always be 0,
because the difference in timestamps would incorrectly be always zero.
This fix will now make a copy of the timestamp.
Shoutout to GitHub user bhorsfield for finding this issue.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Fixes a bug where the RX stream command set set independent of the
device time. Now, we read back get_time_now() to calculate the command
time.
- When using multiple RX USRPs, sync their times. Before, they were left
untouched, causing possible timing mismatches.
- Increase the initial timeout value. The previous value had only been
tested with N2x0.
- Replace the boost::thread_group with a std::thread.
- Remove some boost::format where it didn't add value.
|
|
|
|
|
| |
This reverts part of 09d94529e, which should not have touched these
particular CMake files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See the CMake 3.8 documentation on these two variables:
https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.html
https://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 example showing how to `include an in-tree Verilog header
file in the rfnoc_block_gain example.
|
| |
|
|
|
|
| |
The YAML file was using float-versions, not string versions.
|
| |
|
| |
|
|
|
|
| |
This Boost header is included in some places, despite not being used.
|
|
|
|
|
|
|
| |
Its behaviour is almost identical to std::lround, which we use instead.
The only downside of std::lround is that it always returns a long, which
we don't always need. We thus add some casts for those cases to make the
compiler happy.
|
|
|
|
|
| |
Change version from a numeric to a string, in order to
differentiate between versions like "1.1" and "1.10".
|
|
|
|
| |
The numbers for these were swapped.
|
|
|
|
|
|
| |
The DFT plotting routine hangs when the dynamic range equals zero,
so this change adds a limit so that the dynamic range never goes
below 10.
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
The implementation was not properly configuring the stream command if
the --random flag was used. It was especially bad when multiple
channels were specified.
Signed-off-by: michael-west <michael.west@ettus.com>
|
|
|
|
|
|
|
|
| |
- Add missing "uhd/" subdirectory.
- Update install path for YAML file.
- Fix include directories and link libraries for init_gain_block.
Signed-off-by: michael-west <michael.west@ettus.com>
|
|
|
|
|
|
|
| |
This example exercises the Replay Block RFNoC API. The Replay records
IQ data from a file and plays it back into a Radio for transmitting.
Signed-off-by: mattprost <matt.prost@ni.com>
|
|
|
|
|
|
|
|
|
|
|
| |
I was using this example for testing with the simulator. If there is a
flow control failure, the original example would just silently finish,
outputing the message "Done!" (Not even printing a timeout message).
This commit asserts that the number of samples sent is equal to the
number of samples provided.
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
|
|
|
|
|
|
| |
This PR applies antenna channel settings before available calibration
data, and moves initialization code to setup_device, returning necessary
settings in a tuple.
|
|
|
|
|
|
|
| |
Refresh screen after printing the DFT data.
Use C++14 std::this_thread::sleep_for to control the refresh rate.
Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
|
|
|
|
|
|
|
|
|
|
|
| |
This is a utility that can be used to measure received power, assuming
a calibrated device.
For example, it can be called like this:
usrp_power_meter.py -a type=x300 -f 1e9 --mode continuous
To continuously measure input power at 1 GHz.
|
|
|
|
|
|
|
| |
This changes two things in all applicable files:
- Remove imports from __future__
- Change default shebangs from /usr/bin/env python to /usr/bin/env
python3
|
|
|
|
|
| |
The DRAM was incorrectly connected, but it's also not necessary for this
example and is hence removed.
|
|
|
|
|
|
|
|
| |
The example assumed that there was always at least one TX and on RX
channel. Since that is not always true, this change checks for TX
and RX channels and only exucutes tests for what exists on the device.
Signed-off-by: Michael West <michael.west@ettus.com>
|
|
|
|
|
|
|
|
|
|
| |
The example assumed that there was always at least one TX and on RX
channel. Since that is not always true, this change checks for TX
and RX channels and only exucutes tests for what exists on the device.
Applied clang format.
Signed-off-by: Michael West <michael.west@ettus.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you run
tx_waveforms --power -20 [other args]
it will try to set the out power to -20 dBm. The signal amplitude is
factored in, so changing --ampl will not change the actual TX power
unless it causes clipping, or becomes too low.
If the USRP does not support setting a power, the program will terminate
early. If it does support setting a power, but can't reach the requested
power, it will coerce, and print the actual, available power.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The existing implementation would create a real signal for any type of
signal (CONST, RAMP, SQUARE, and SINE), and then create the complex
signal by simply delaying the Q value by a 90 degree phase. This had
surprising results for all waveforms:
- CONST waveforms would have a baseband value of ampl + j ampl, thus
increasing the output power by 3 dB vs. what one would expect when
setting an amplitude. It is now ampl + j * 0, and the power is
ampl**2. This now makes the power consistent with SINE, which it was
not, even though a const signal is a sine signal with a frequency of
zero.
- SQUARE waveforms would phase-delay the Q part, thus resulting in three
power output levels (when both phases are zero, when both phases are
ampl, and when one of them is zero and other is ampl). However, the
square signal is useful for watching it in the scope, and there, it
helps if the power is predictably either high or low within the
selected frequency. The Q value is now always zero.
- RAMP waveforms had the same issue and were also resolved by setting
Q to zero.
- SINE signals were fine, although the implementation used sin + j cos
to calculate a complex sine, not cos + j sin according to Euler's
formula.
To make this wavetable more useful with absolute power settings, the
changes mentioned above were implemented. The dBFs power of CONST and
SINE can now be calculated by using ampl**2, SQUARE by using
(ampl**2)/2, and RAMP by solving the integral over a ramp from -1 to 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit modifies the benchmark_rate example to use the operating
system's default thread priority, instead of real-time thread priority,
by default. UHD 4.0 includes a number of significant improvements to
the streaming architecture that allow for best performance to be
achieved without having to resort to elevating the process thread
priority to real-time. Internal testing shows degraded streaming
performance in common use cases (i.e. non-DPDK) when the process thread
priority is set to real-time.
It should be noted that applications which use DPDK may still experience
better performance when the process thread priority is set to real-time.
Users may continue to manually override the process thread priority
in benchmark_rate using the --priority=high command-line option. The
need to elevate the process thread priority will be application- and
deployment-dependent.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces chdr_word_t, which was a statically defined 64-bit data
type, with a paramaterizable data type that matches the defined CHDR_W.
Code that formerly referenced the chdr_word_t data type can now define
the data type for their desired CHDR_W and ITEM_W as follows:
// Define the CHDR word and item/sample data types
typedef ChdrData #(CHDR_W, ITEM_W)::chdr_word_t chdr_word_t;
typedef ChdrData #(CHDR_W, ITEM_W)::item_t item_t;
ITEM_W is optional when defining chdr_word_t if items are not
needed. Static methods in the ChdrData class also provide the ability to
convert between CHDR words and data items. For example:
// Convert CHDR data buffer to a buffer of samples
samples = ChdrData#(CHDR_W, ITEM_W)::chdr_to_item(data);
|
|
|
|
|
| |
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
|
|
|
|
|
| |
Non-RFNoC devices do not support get_gpio_src() entrypoing so wrap call
with a try/catch block
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds a ZPU register to control the FP GPIO source. These are 2bits
per GPIO pin, totalling 24 bits. 0 corresponds to RF-A, 1 corresponds
to RF-B. The following Python code will control the upper 6 bits of the
front-panel GPIO from the B-side radio on an X300:
>>> import uhd
>>> U = uhd.usrp.MultiUSRP("type=x300")
>>> U.get_gpio_src_banks()
['FP0']
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
'RFA', 'RFA']
>>> U.set_gpio_src("FP0", ['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
'RFB', 'RFB', 'RFB', 'RFB', 'RFB', 'RFB'])
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFB', 'RFB', 'RFB', 'RFB',
'RFB', 'RFB']
>>> # Make all GPIOs outputs:
>>> U.set_gpio_attr("FP0A", "DDR", 0xFFF)
>>> U.set_gpio_attr("FP0B", "DDR", 0xFFF)
>>> # Control all GPIOs from software (not ATR):
>>> U.set_gpio_attr("FP0A", "CTRL", 0x000)
>>> U.set_gpio_attr("FP0B", "CTRL", 0x000)
>>> # Bottom 3 pins go high from radio A
>>> U.set_gpio_attr("FP0A", "OUT", 0x007)
>>> # Top 3 pins go high from radio B
>>> U.set_gpio_attr("FP0B", "OUT", 0xE00)
Amends the gpio.cpp example to allow switching the source.
Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
|