aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: Add unit test for USE_MAP prop forwarding policyAaron Rossetto2020-05-282-1/+259
| | | | | | | | | | | | | | | This commit adds a unit test for the USE_MAP property forwarding policy. It also adds a pair of new mock RFNoC nodes for use in unit testing: - mock_edge_node_t is a node with a configurable number of input and output ports each having an edge property named 'prop' associated with each. The node is also able to source actions from any of its edges and records incoming actions in a map. - mock_routing_node_t is a do-nothing node specifically for testing property and action forwarding between edges with the USE_MAP forwarding strategy. The node has functions to configure the property and action forwarding maps.
* tests: updated devtest runner to use standard device argsMatthew Crymble2020-05-272-3/+3
| | | | | This will allow run_testsuite.py to be called for specific devices instead of all devices for a certain type.
* cal: Minor fixes in power container, add unit testMartin Braun2020-05-261-0/+24
| | | | | | | - min_power and max_power arguments were swapped. They were always called correctly, so this is more of a documentation fix. - Add a unit test for the case where power values are not regular, which is the normal case with real data.
* tests: Add unit tests for pwr_cal_mgrMartin Braun2020-05-202-0/+157
|
* cal: database: Add option to register flash cal callbacksMartin Braun2020-05-201-0/+36
| | | | | | | | | | | This adds the possibility to read cal data from flash/EEPROM by adding callbacks to the database. Unlike the RC and FILESYSTEM data, this is very device-specific, but we can let devices register callbacks in the database so that reading cal data from flash can use the same APIs as from RC or filesystem. Note that this also gives a convenient way to inject call data during unit tests, if desired.
* tests: Added unit test for Vector IIR RFNoC blockAaron Rossetto2020-05-192-0/+225
|
* tests: Remove 'six' dependency from devtestMartin Braun2020-05-121-2/+1
| | | | This removes 'six' as a dependency for devtest.
* Remove remaining Python 2 referencesMartin Braun2020-05-075-5/+0
| | | | | | | 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
* test: Add output for gpio_testMichael West2020-04-301-0/+3
| | | | | | Print output from stdout and stderr upon error. Signed-off-by: Michael West <michael.west@ettus.com>
* devtest: Add support for TwinRX to x3x0Michael West2020-04-301-52/+92
| | | | | | | Adding necessary code to examine number of TX and RX channels and adjust test cases accordingly. Signed-off-by: Michael West <michael.west@ettus.com>
* devtest: Add method to get number of channelsMichael West2020-04-301-0/+36
| | | | | | Adding method to get number of TX and RX channels to usrp_probe. Signed-off-by: Michael West <michael.west@ettus.com>
* devtest: Fix benchmark_rate_test success criteriaMichael West2020-04-301-2/+2
| | | | | | | Allow success if testing either TX or RX. Previously required both TX and RX to be tested simultaneously. Signed-off-by: Michael West <michael.west@ettus.com>
* tests: Print images dir instead of simply reading itMartin Braun2020-04-171-1/+1
|
* cal: Add pwr_cal containerMartin Braun2020-04-172-0/+135
| | | | | | | This is a cal container for all types of power cal (RX or TX) that rely on a single, overall gain value. Includes Python API.
* lib: utils: interpolation: Add bilinear interpolationMartin Braun2020-04-171-1/+69
| | | | | | This allows to treat a std::map<KeyType<std::map<KeyType, ValueType>> as a set of x-y coordinates, and bilinearly interpolate a z-value given four x/y pairs.
* tests: Add Fosphor block controller unit testWade Fife2020-04-142-0/+358
|
* tests: migrated rfnoc block tests to dedicated subdirectorymattprost2020-04-136-381/+455
| | | | | | | | This separates the rfnoc block tests into files for each specific block. This was done to improve the readability of these files and declutter the tests directory. Signed-off-by: mattprost <matt.prost@ni.com>
* fixup! uhd: Add fuzzy serial number checkingmattprost2020-04-091-8/+8
|
* tests: Fix client_zero_test flush bit testMartin Braun2020-04-081-6/+12
| | | | | A test to check the address was using a & instead of a %, resulting in a -Wtautological-compare.
* uhd: Add fuzzy serial number checkingLane Kolbly2020-04-082-0/+28
| | | | | | | | | We have integer 32-bit serial numbers for MPM devices, for example "1234abcd". For serial numbers which have less than eight digits, e.g. "123abcd", a user may feel inclined to prefix this number with a 0 when they are searching for devices, e.g. "0123abcd". This change makes it so that specifying "0123abcd" will match a device with serial number "123ABCD".
* tests: Add FIR filter block controller unit testAaron Rossetto2020-04-072-0/+247
|
* uhd: math: Add interpolation.hppMartin Braun2020-04-074-10/+37
| | | | | | | | - Moves linear_interp from cal to utils - Moves the interp_mode enum class to interpolation.hpp - Adds three interpolation methods for maps: at_interpolate_1d(), at_nearest(), at_lin_interp() - Adds unit tests
* devtest: add missing devtest to n3xxCiro Nishiguchi2020-04-031-0/+1
|
* uhd: paths: Harmonize around XDG Base Directory specificationMartin Braun2020-04-021-9/+8
| | | | | | | | | | | | | | | | | | | | | | Up until now, we completely ignore the XDG specification. This commit does the following to change that: - It uses XDG_DATA_HOME and XDG_CONFIG_HOME for cal and config data, respectively. - If config data is in ~/.uhd/uhd.conf, that is still accepted, but if it conflicts with $XDG_CONFIG_HOME/uhd.conf, it is ignored and a warning is displayed - The default location for cal data is thus ${HOME}/.local/share/uhd/cal on Unix, and %LOCALAPPDATA%\uhd\cal on Windows. This is a change in location! - The UHD_CONFIG_DIR environment variable was confusingly named and is now removed. It provided an alternative location than the home directory. The same purpose is now much better served by XDG_DATA_HOME and XDG_CONFIG_HOME. The specification can be found here: specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
* rfnoc: Add multichannel register interfacemattprost2020-04-022-0/+181
| | | | | | | | | | | This utility class implements the register access methods of reg_iface but adds built-in address translation features for consecutive instances of an RFNoC block. The register peek and poke methods accept an extra 'instance' parameter which is used to calculate the absolute address for the register access. This can be used for accessing registers for the different channels of a multi-channel block (i.e. Radio, DDC, DUC, etc). Signed-off-by: mattprost <matt.prost@ni.com>
* uhd: cal: Add iq_cal calibration data container classMartin Braun2020-04-022-0/+82
| | | | | | | | This class can be used to store calibration coefficients for the X300 DC offset and IQ imbalance calibration. Note: This also modifies Doxyfile.in to not document files generated by flatc.
* uhd: cal: Add database classMartin Braun2020-03-262-0/+89
| | | | | | This class contains methods to store and retrieve data from the local calibration database. Note that in this case, the "database" is just a bunch of files on the local filesystem.
* uhd: paths: Add get_cal_data_path() API callMartin Braun2020-03-261-1/+3
| | | | This points to the location where cal data is stored.
* uhd: math: Add linear_interp()Martin Braun2020-03-181-1/+10
| | | | This lets you linearly interpolate between two points.
* utils: Add bool specialization to cast::from_str()Aaron Rossetto2020-03-181-0/+20
| | | | | | | This adds a specialization to `uhd::cast::from_str()` to handle `bool` as a target type and interpret strings like 'y', 'Y', 'n', 'No', 'True', 'False', etc. as Boolean values, as well as the traditional '0' and '1' (which also work).
* tests: Allow custom name for mock terminatorAaron Rossetto2020-03-131-4/+6
| | | | | | | Allow a unit test to instantiate a mock_terminator_t and provide a custom name to be displayed when get_unique_id() is called (generally for logging purposes). The custom name is optional and the generic 'MOCK_TERMINATOR' is used if unset.
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-0322-193/+212
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* rfnoc: Provide make_args_t dtor in rfnoc_blocks_testAaron Rossetto2020-02-041-0/+3
|
* rfnoc: Create mock factoryMartin Braun2020-01-294-197/+15
| | | | | | This is an API that allows creating mock block controllers, to write unit tests for block controllers. See rfnoc_blocks_test for an example how to use them.
* cmake: Find DPDK via pkg-config, if availableAlex Williams2020-01-221-2/+2
| | | | | | Debian uses pkg-config without the libdpdk.so linker script. Use the pkg-config file to grab the installed libraries and determine what to link to.
* uhd: fixing MSVC warningsBrent Stapleton2020-01-091-1/+2
| | | | | | | | | | | Small changes to remove various compiler warnings found in MSVC - Adding uhd::narrow_cast to verious spots - wavetable.hpp: all floats literals in the wavetable. - paths_test: unnecessary character escape - replay example: remove unreferenced noc_id - adfXXXX: Fixing qualifiers to match between parent and derived classes - rpc, block_id: Removing unused name in try...catch
* tests: fixup compiler warningBrent Stapleton2019-12-301-1/+1
| | | | Fixes cb40069b ("tests: Port polling-mode dpdk_test to new DPDK...")
* tests: Port polling-mode dpdk_test to new DPDK frameworkAlex Williams2019-12-203-83/+121
| | | | | | The mock_send_transport and mock_recv_transport are used, which ends up with two layers of flow control. More work may be needed here for comparisons with the old data.
* dpdk: Add new DPDK stack to integrate with I/O servicesAlex Williams2019-12-202-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | docs: Update DPDK docs with new parameters: Parameter names have had their hyphens changed to underscores, and the I/O CPU argument is now named after the lcores and reflects the naming used by DPDK. transport: Add new udp_dpdk_link, based atop the new APIs: This link is tightly coupled with the DPDK I/O service. The link class carries all the address information to communicate with the other host, and it can send packets directly through the DPDK NIC ports. However, for receiving packets, the I/O service must pull the packets from the DMA queue and attach them to the appropriate link object. The link object merely formats the frame_buff object underneath, which is embedded in the rte_mbuf container. For get_recv_buff, the link will pull buffers only from its internal queue (the one filled by the I/O service). transport: Add DPDK-specific I/O service: The I/O service is split into two parts, the user threads and the I/O worker threads. The user threads submit requests through various appropriate queues, and the I/O threads perform all the I/O on their behalf. This includes routing UDP packets to the correct receiver and getting the MAC address of a destination (by performing the ARP request and handling the ARP replies). The DPDK context stores I/O services. The context spawns all I/O services on init(), and I/O services can be fetched from the dpdk_ctx object by using a port ID. I/O service clients: The clients have two lockless ring buffers. One is to get a buffer from the I/O service; the other is to release a buffer back to the I/O service. Threads sleeping on buffer I/O are kept in a separate list from the service queue and are processed in the course of doing RX or TX. The list nodes are embedded in the dpdk_io_if, and the head of the list is on the dpdk_io_service. The I/O service will transfer the embedded wait_req to the list if it cannot acquire the mutex to complete the condition for waking. Co-authored-by: Martin Braun <martin.braun@ettus.com> Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com> Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
* tests: Add more tests for max rate streamingCiro Nishiguchi2019-12-184-89/+469
| | | | | Add more tests to compare streaming rates with previous releases. Changed the output string to a table.
* tests: Install all stream performance scriptsBrent Stapleton2019-12-061-1/+3
| | | | | | | Install all of the streaming performance tests scripts, not just the X300 one. Fixes: 2bf1f0acaa35 ("tests: Add script to execute batch of bench...")
* tests: Add tests to exercise max streaming rates and report resultsCiro Nishiguchi2019-12-063-0/+1008
|
* tests: Add script to execute batch of benchmark_rate runsCiro Nishiguchi2019-12-065-0/+424
| | | | | Script runs benchmark_rate repeatedly, parses results, and calculates average, min, and max of each value reported.
* lib: Add DPDK service queueAlex Williams2019-11-261-0/+65
| | | | | | | This is a data structure intended for use by the DPDK I/O service. It uses DPDK's lockless ring in multi-producer, single-consumer mode to allow clients to submit requests to the DPDK I/O service's worker thread. Clients can specify a timeout for the requests to be fulfilled.
* devtest: Add test_messages_test to X310Martin Braun2019-11-263-12/+14
| | | | | | - Fixes issues with test_messages_test (it had inverted the pass/fail condition) - Improve Pylint scores in affected files
* devtest: Use with() statement to open filesMartin Braun2019-11-261-5/+9
| | | | | | | | | | | | | | This fixes warnings such as this during devtest: /home/mbr0wn/src/uhddev/host/tests/devtest/uhd_test_base.py:112: ResourceWarning: unclosed file <_io.TextIOWrapper name='./results_x300_F457AD.log' mode='r' encoding='UTF-8'> self.results = yaml.safe_load(open(self.results_file).read()) or {} /path/to/uhd/host/tests/devtest/uhd_test_base.py:150: ResourceWarning: unclosed file <_io.TextIOWrapper name='./results_x300_F457AD.log' mode='w' encoding='UTF-8'> yaml.dump(self.results, default_flow_style=False)) ok
* tests: Add check for life on DPDK portAlex Williams2019-11-262-0/+62
|
* lib,tests: Remove old DPDK files from buildAlex Williams2019-11-261-19/+0
| | | | The DPDK files are left behind as a reference, for now.
* rfnoc: Make polling I/O service not block on flow controlCiro Nishiguchi2019-11-262-18/+31
| | | | | | Add a new method to io_service::send_io to check whether the destination is ready for data, to make it possible to poll send_io rather than block waiting for flow control credits.
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-264-20/+21
| | | | | | | | | | | | | | | | | | | | | Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include <boost/bind.hpp>, and makes sure all usages of std::bind have an #include <functional>. clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit.