| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
This changes MTU handling for the "internal" UDP type. Because MPM
echo packets will not be returned for internal NICs, use the iface's
programmed MTU instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the c++ api, methods like chdr_packet#set_payload() and
chdr_packet#get_payload() are templated over the payload type
(payload_t). For methods like set_payload, they are overloaded by the
type of an argument, so in pybind we can just explicitly instaniate the
template for each payload_t and register it with pybind under the same
name. At runtime, pybind looks at the type of the argument and decides
which to call.
The problem arose with methods like get_payload, which are overloaded by
return type. In C++, the compiler can infer the template type by the
type of the target at the call site. In python, there is no way for the
pybind to determine which variant of get_payload to call, and it would
crash. Previously, the workaround for this was to declare
get_payload_ctrl, get_payload_mgmt, etc, but this was rather
anti-pythonic. This commit utilizes the fact that python methods don't
have a constrained return type to resolve this. Now, get_payload will
call a python method which looks at the chdr_packet#header#pkt_type
field to determine which variant of get_payload to call and returns that
type of payload_t.
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
|
|
|
|
|
|
|
|
|
| |
The script_test.py script is used to generate data .cpp files from a
wireshark trace for the C++ CHDR Parser tests. This commit expands the
script to also generate the data .py files for the Python CHDR Parser
tests.
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds pybind11 glue code for the userland chdr parsing code
introduced in the uhd::utils::chdr namespace. Additionally, it moves
some pybind11 adapter code to a common pybind_adaptors.hpp file which
originally existed in the cal_python.hpp file.
This commit also adds unit tests for the python bindings using a
captured wireshark trace which is located in rfnoc_packets_*.py and some
handwritten packets in hardcoded_packets.py
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit alters the ctrl_payload#serialize function to assert the
serialized length of the packet fits inside the buffer before writing.
Originally, the function writes the data and then asserts that the final
pointer position isn't further than the end of the buffer. While this
works, if it were to fail, that means we have already caused undefined
behavior by writing to some random memory location, which isn't good
practice.
This commit is possible now that the get_length method exists.
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces a new public api in uhd::utils which allows serializing
and deserializing chdr packets.
As far as testing, this commit adds the chdr_parse_test test. It uses a
wireshark trace located in rfnoc_packets_*.cpp as well as hand coded
packets from hardcoded_packets.cpp to test the serialization and
deserialization process
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
|
|
|
|
|
|
|
|
|
|
| |
This commit exposes uhdlib/rfnoc/chdr_types.hpp in the public includes.
Additionally, it takes some types from uhdlib/rfnoc/rfnoc_common.hpp and
exposes them publicly in uhd/rfnoc/rfnoc_types.hpp.
Finally, one constant is moved from uhdlib/rfnoc/rfnoc_common.hpp to
uhd/rfnoc/constants.hpp
Signed-off-by: robot-rover <sam.obrien@ni.com>
|
|
|
|
|
|
|
|
|
| |
It would be confusing to have two classes named chdr_packet. As it makes
more sense to name the new public chdr parser class chdr_packet, the
internal uhd::rfnoc::chdr::chdr_packet class is being renamed to
chdr_packet_writer to better represent its functionality.
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
get_lib_path() uses the libuhd location on disk to dynamically
determine the installation prefix at runtime. This fix normalizes the
libuhd path before any path operations are done to extract the library
directory and then prefix directory.
Previously, using a non-normalized library path, the returned prefix
directory would be incorrect in some cases (e.g. when loaded through
GNU Radio). In these error cases, the libuhd path would be
$PREFIX/lib/./libuhd.so
(with a no-op /. inserted) which would result in a technically correct
library directory of `$PREFIX/lib/.` but an incorrect prefix directory
of `$PREFIX/lib`.
With the normalization fix, the libuhd path is corrected to
$PREFIX/lib/libuhd.so
and the subsequent path manipulation to get the library and prefix
directories will work as intended.
|
| |
|
|
|
|
|
|
|
|
| |
The product ID check should be masked with 0xF8 and checked to be 0x08.
With a device off and weak pull-ups, the readback would always read
0xFF, passing the ID check when it obviously wasn't there. Extending
the mask to be 0xF8 shows that both 0's and 1's are read back from the
device.
|
|
|
|
|
|
| |
Letting garbage collection close the file works when using CPython, but
it fails with PyPy which uses a different garbage collection strategy.
This makes sure that the file is closed by using a file context manager.
|
| |
|
|
|
|
|
| |
This adds some more details on mpm.conf, what it does, how it works, and
which keys it accepts.
|
|
|
|
|
|
|
|
| |
This effectively reverts 0433e74. The set_shutdown() and get_shutdown()
API calls do not have a counterpart in simple_spi_core.v, which is
typically the HDL endpoint for this core driver, and thus could write to
a non-existent register. They are also never used in UHD, nor are they
part of the spi_iface interface.
|
|
|
|
| |
This removes some comment that include code that still gets executed.
|
|
|
|
|
|
|
| |
io_type's implementation was removed when host/lib/depricated.cpp was
removed. This commit also removes the hpp and installation.
Signed-off-by: Steven Koo <steven.koo@ni.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Support management payloads on busses over 64 bits
Automatically set CHDR width for mpmd_link_if_ctrl_udp
|
|
|
|
|
| |
This allows device::find() calls to proceed even when encountering an empty/invalid
serial number or serial number device argument hint.
|
| |
|
| |
|
|
|
|
|
| |
radio_control doesn't implement any discoverable_features in
particular, but this gives it the API to do so.
|
|
|
|
|
|
| |
Classes which want to implement discoverable_feature can simply inherit
from this registry and get access to an ergonomic map-backed registry of
features.
|
|
|
|
|
|
|
|
| |
The "discoverable features" API handles how clients access the myriad
features we offer, without simply adding a million has_FOO and do_FOO
methods to radio_control and multi_usrp. discoverable_features allows
clients to query the existance of, enumerate, and ultimately they get
(by enum or by type) an object which implements their wanted feature.
|
|
|
|
|
| |
This is useful when cross-compiling UHD for other architectures like arm or
aarch64.
|
|
|
|
|
|
| |
This runs update_fbs.py --verify as a unit test, and fail accordingly.
The test passes if git executable is not found or the schema files are
not within a git repo, because both are not a dependency of UHD.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each version of flatbuffers (might) generate different header files
for the same schema file. Therefore we cannot compare the content
of the generated headers to detect changes in the schema that are
not accompanied by a change in the generated header.
To have at least a minimal check that the schema matches the
generated header we compare the git hashes of both. We will not
allow to change the schema without changing the header and vice
versa. This condition is checked by a unit test.
|
|
|
|
|
|
|
|
|
| |
Flatbuffers offers an option to set the default extension for
binary files. Our calibration files have the extension .cal. Set
the extension in all schema files to ease conversion between
binary and text representation of calibration files.
Updated documentation accordingly.
|
|
|
|
|
| |
Note: timeouts were occurring on n310 due to an increase in
daughterboard re-initialization time.
|
|
|
|
|
|
|
| |
- The UHD auto-detection was broken. Now it can find UHD in the same
directory.
- The main() function was split into main() and run(), which would allow
loading this module and calling run() as it's own function.
|
|
|
|
|
| |
This makes the utility warn the user when they pass a path argument that
is invalid; the utility falls back to defaults if this occurs.
|
|
|
|
|
| |
The edge_list for a given rx/tx chain should never be empty so this
explicitly performs that check, which prevents a potential bad access.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit allows the RFNoC image builder utility to support block
definition .yml files where the num_ports values are numerical
expressions using values sourced from the parameters section when the
block is used in an RFNoC image. An example of such an expression for
num_ports is the split stream block, where the number of output ports is
defined as the product of the NUM_PORTS and NUM_BRANCHES parameters:
data:
fpga_iface: axis_chdr
clk_domain: rfnoc_chdr
inputs:
in:
num_ports: NUM_PORTS
outputs:
out:
num_ports: NUM_PORTS*NUM_BRANCHES
In an RFNoC image definition .yml file, these parameters can be
specified when a split stream block is instantiated in an image:
split0:
block_desc: 'split_stream.yml'
parameters:
NUM_PORTS: 2
NUM_BRANCHES: 3
Thus, the split0 instance of the split stream block is configured with 2
input ports and 6 output ports (2*3 from NUM_PORTS*NUM_BRANCHES).
When the RFNoC image builder runs and encounters a block instantiation
where that block has a non-integer string in the num_ports key of its
block definition, it performs a textual replacement of the identifiers
in the string with the corresponding values from the parameters section
of the block's instantiation. If no such parameter corresponding to the
identifier exists, the block definition file's parameters section is
consulted for a default value for the parameter. If no such parameter
can be found in either of these locations, the identifier is left
unchanged in place.
After the text substitution step, the expression is evaluated using
Python's expression evaluator. The expression should evaluate to an
integer value, which is then used as the num_ports value. If the
expression does not evaluate to an integer, or fails to evaluate, an
error will be reported.
|
|
|
|
|
|
|
|
| |
This fixes the rfnoc_null_src_sink, chdr_crossbar_nxn, and
chdr_stream_endpoint blocks so that wider CHDR widths are properly
supported. It also updates PkgChdrBfm to able to properly test these
blocks. The testbenches have been updated to test both 64 and 512-bit
widths.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This commit augments the existing FFT RFNoC block controller with
C++ functions through which the block can be configured, as well as
adding range checking to the various properties that sit atop the FFT
RFNoC block registers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current implementation needed manual interaction to calibrate each
antenna. More sophisticated setups are able to switch between channels
and antennas programmatically.
This commit introduces a base class that handle the switch behaviour. The
previous implementation moved to a ManualSwitch class which is the
default switch. Without any options the previous flow remains unchanged.
A new class is able to handle NI switch models. The switch port can
be given via options parameter (comA is default). The channels are connected
in ascending order. The user has to ensure that the cable setup matches
the order given for channels and antennas.
Co-authored-by: Martin Braun <martin.braun@ettus.com>
|
|
|
|
|
|
|
|
|
|
| |
UHD has a custom file to find libusb. This fixes a warning coming from
that file caused by the fact that we're looking for a package called
LIBUSB, but the file was called FindUSB1 (i.e., we're expecting
a package name of USB1).
Common CMake calls were also moved to lowercase for CMake coding
guidelines consistency.
|
|
|
|
|
|
|
|
|
| |
Add chapter to explain usage of supported switch classes which
handle connection of DUT and measurement devices. Documentation
is done for ManualSwitch (default) and NI switch for devices that
can be used by the niswitch Python package.
Co-authored-by: Martin Braun <martin.braun@ettus.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add UHD_ADD_PYTEST() CMake macro
- Add CMake code to tests/CMakeLists.txt to auto-run all registered
Python unit tests
- Add a token unit test (it replicates parts of ranges_test.cpp)
The way Python-based unit tests are implemented in UHD is that they can
import uhd, and then operate on the module as usual.
Writing unit tests in Python instead of C++ can have multiple
advantages:
- If they test PyBind-wrapped C++ code, they can test both the binding
and the underlying C++ code at once
- Writing unit tests in Python may be more concise
|