aboutsummaryrefslogtreecommitdiffstats
path: root/host
Commit message (Collapse)AuthorAgeFilesLines
* mpm,mpmd: Add iface type and mtu info for UDP linksAlex Williams2020-07-162-2/+15
| | | | | | 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.
* python: Add payload agnostic methods to CHDR APISamuel O'Brien2020-07-163-1/+62
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* python: Document CHDR Test GenerationSamuel O'Brien2020-07-162-19/+44
| | | | | | | | | 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>
* python: Add bindings for C++ CHDR ParserSamuel O'Brien2020-07-1611-19/+47447
| | | | | | | | | | | | | 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>
* chdr: Assert Ctrl Packet Size Before SerializingSamuel O'Brien2020-07-161-3/+4
| | | | | | | | | | | | | | 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>
* utils: Expose CHDR Parsing APISamuel O'Brien2020-07-1317-13/+48472
| | | | | | | | | | | | 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>
* utils: Expose CHDR Types in Public APIrobot-rover2020-07-1322-55/+109
| | | | | | | | | | 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>
* rfnoc: Rename chdr_packet to chdr_packet_writerSamuel O'Brien2020-07-1318-74/+76
| | | | | | | | | 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>
* utils: Fix prefix determination in get_lib_path()Ryan Volz2020-07-131-1/+3
| | | | | | | | | | | | | | | | | | | | 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.
* utils: Make uhd_config_info print help by defaultDerek Kozel2020-07-091-1/+1
|
* ad9361: Fix mask for product ID checkBrian Padalino2020-07-091-1/+1
| | | | | | | | 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.
* uhd: Make sure generated file is closedRyan Volz2020-07-091-1/+2
| | | | | | 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.
* docs: n3xx: Include WX in table of N320 imagesSteve Czabaniuk2020-07-091-8/+8
|
* docs: Add comments on mpm.confMartin Braun2020-07-092-2/+65
| | | | | This adds some more details on mpm.conf, what it does, how it works, and which keys it accepts.
* cores: Remove shutdown function from spi_core_3000Martin Braun2020-07-082-21/+0
| | | | | | | | 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.
* e3xx: Remove superfluous commentsMartin Braun2020-07-081-11/+0
| | | | This removes some comment that include code that still gets executed.
* meta-ettus: remove io_type.hppSteven Koo2020-07-082-66/+0
| | | | | | | 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>
* rfnoc: Add unit test for Log Power RFNoC blockAaron Rossetto2020-06-292-0/+85
|
* rfnoc: Add Log Power RFNoC block supportAaron Rossetto2020-06-295-0/+88
|
* fpga: rfnoc: Add Log-Power blockWade Fife2020-06-291-0/+56
|
* python: Add window RFNoC block controller bindingsAaron Rossetto2020-06-293-1/+25
|
* rfnoc: Add unit test for Window RFNoC blockAaron Rossetto2020-06-292-0/+252
|
* rfnoc: Add window RFNoC block controllerAaron Rossetto2020-06-295-0/+220
|
* fpga: rfnoc: Add RFNoC Window blockWade Fife2020-06-291-0/+56
|
* CHDR: support multiple CHDR widthsAndrew Lynch2020-06-268-28/+192
| | | | | Support management payloads on busses over 64 bits Automatically set CHDR width for mpmd_link_if_ctrl_udp
* uhd: improved handling of empty serial number hintsMatthew Crymble2020-06-262-0/+5
| | | | | This allows device::find() calls to proceed even when encountering an empty/invalid serial number or serial number device argument hint.
* cmake: tests: Fix CMake warning introduced by QEMU unittest optionJoerg Hofrichter2020-06-261-1/+1
|
* fixup! uhd: Add discoverable_features APILane Kolbly2020-06-251-1/+4
|
* uhd: Implement discoverable_features for radio_controlLane Kolbly2020-06-252-2/+6
| | | | | radio_control doesn't implement any discoverable_features in particular, but this gives it the API to do so.
* uhd: Create discoverable feature registry implementationLane Kolbly2020-06-257-36/+113
| | | | | | Classes which want to implement discoverable_feature can simply inherit from this registry and get access to an ergonomic map-backed registry of features.
* uhd: Add discoverable_features APILane Kolbly2020-06-256-0/+227
| | | | | | | | 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.
* cmake: tests: Added option to use QEMU for running unittestsJoerg Hofrichter2020-06-252-1/+33
| | | | | This is useful when cross-compiling UHD for other architectures like arm or aarch64.
* test: Add verify-flatbuffer testLars Amsel2020-06-232-0/+34
| | | | | | 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.
* test: Use git hashes to verify flatbuffers schemaLars Amsel2020-06-231-55/+78
| | | | | | | | | | | | 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.
* cal: change default extension of calibration filesLars Amsel2020-06-235-16/+30
| | | | | | | | | 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.
* mpmd: Increase default long timeout to 30 secondsSteve Czabaniuk2020-06-221-2/+2
| | | | | Note: timeouts were occurring on n310 due to an increase in daughterboard re-initialization time.
* utils: update_fbs.py: Minor refactor, fix path bugMartin Braun2020-06-221-9/+15
| | | | | | | - 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.
* utils: Make uhd_images_downloader raise warning for invalid pathsSteve Czabaniuk2020-06-221-11/+21
| | | | | 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.
* multi_usrp: Assert that edge_lists are non-empty before accessingSteve Czabaniuk2020-06-221-0/+2
| | | | | 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.
* rfnoc: Update port format in block YAMLWade Fife2020-06-189-22/+22
|
* rfnoc: Add makefile_srcs to block YAMLWade Fife2020-06-185-0/+5
|
* utils: Support expressions for num_ports in block defsAaron Rossetto2020-06-181-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* fpga: rfnoc: Add support for 512-bit CHDR widthsAndrew Moch2020-06-181-0/+4
| | | | | | | | 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.
* python: Add FFT RFNoC block controller bindingsAaron Rossetto2020-06-183-0/+49
|
* tests: Add unit test for FFT RFNoC blockAaron Rossetto2020-06-182-0/+191
|
* rfnoc: Augment FFT RFNoC block controllerAaron Rossetto2020-06-183-56/+250
| | | | | | | 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.
* cal: Add automated port switchLars Amsel2020-06-174-20/+150
| | | | | | | | | | | | | | | | | 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>
* cmake: Fix warning finding libusbMartin Braun2020-06-172-3/+3
| | | | | | | | | | 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.
* cal: Add switch documentationLars Amsel2020-06-151-2/+24
| | | | | | | | | 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>
* tests: Add infrastructure to run Python unit testsMartin Braun2020-06-153-0/+49
| | | | | | | | | | | | | | | | - 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