aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/rfnoc_block_tests
Commit message (Collapse)AuthorAgeFilesLines
* rfnoc: Clarify usage of MTU vs. max payload size, remove DEFAULT_SPPMartin Braun2021-12-022-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These two values where being mixed up in the code. To summarize: - The MTU is the max CHDR packet size, including header & timestamp. - The max payload is the total number of bytes regular payload plus metadata that can be fit into into a CHDR packet. It is strictly smaller than the MTU. For example, for 64-bit CHDR widths, if a timestamp is desired, the max payload is 16 bytes smaller than the MTU. The other issue was that we were using a magic constant (DEFAULT_SPP) which was causing conflicts with MTUs and max payloads. This constant was harmful in multiple ways: - The explanatory comment was incorrect (it stated it would cap packets to 1500 bytes, which it didn't) - It imposed random, hardcoded values that interfered with an 'spp discovery', i.e., the ability to derive a good spp value from MTUs - The current value capped packet sizes to 8000 bytes CHDR packets, even when we wanted to use bigger ones This patch changes the following: - noc_block_base now has improved docs for MTU, and additional APIs (get_max_payload_size(), get_chdr_hdr_len()) which return the current payload size given MTU and CHDR width, and the CHDR header length. - The internally used graph nodes for TX and RX streamers also get equipped with the same new two API calls. - The radio, siggen, and replay block all where doing different calculations for their spp/ipp values. Now, they all use the max payload value to calculate spp/ipp. Unit tests where adapted accordingly. Usage of DEFAULT_SPP was removed. - The replay block used a hardcoded 16 bytes for header lengths, which was replaced by get_chdr_hdr_len() - The TX and RX streamers where discarding the MTU value and using the max payload size as the MTU, which then propagated throughout the graph. Now, both values are stored and can be used where appropriate.
* host: Add RPC calls for GPIO voltageLane Kolbly2021-11-051-1/+21
|
* host: Add GPIO functions to MPM RPC shimLane Kolbly2021-11-031-0/+15
|
* rfnoc: ddc: Improve unit tests and documentationMartin Braun2021-08-301-5/+19
| | | | | | | The previous commit fixed a bug in the DUC, where get_frequency_range() reported incorrect values. The DDC did not have this bug, but we port the updates to the unit tests and the documentation from the DUC to the DDC for consistency's sake.
* rfnoc: duc: Fix frequency range for DUC blockMartin Braun2021-08-301-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tuning range of the DUC depends on the output sample rate (which is larger), but it was using the input sample rate. This was causing a bug where for Tx, the DSP tuning range was limited when using multi_usrp API, and thus would not allow to DSP-tune beyond the current sampling rate. In this patch, we also re-use the existing calculation of the sampling rate, and harmonize that code between duc_block_control and ddc_block_control. Consider the following Python REPL code: >>> import uhd >>> U = uhd.usrp.MultiUSRP('type=x300') >>> U.set_rx_rate(10e6) >>> U.set_tx_rate(10e6) >>> # Creating a streaming is required, or the input rate will not be >>> # set: >>> S = U.get_tx_stream(uhd.usrp.StreamArgs("fc32", "sc16")) >>> treq = uhd.types.TuneRequest(1e9) >>> treq.rf_freq = 1e9 >>> treq.dsp_freq = 50e6 >>> treq.dsp_freq_policy = uhd.types.TuneRequestPolicy.manual >>> treq.rf_freq_policy = uhd.types.TuneRequestPolicy.manual >>> tres = U.set_rx_freq(treq, 0) >>> print(str(tres)) Tune Result: Target RF Freq: 1000.000000 (MHz) Actual RF Freq: 1000.000000 (MHz) Target DSP Freq: 50.000000 (MHz) Actual DSP Freq: 5.000000 (MHz) >>> # Note the last two lines: The *target* DSP freq was already clipped >>> # to 5 MHz. These lines show 50.0 MHz when this patch is applied. This bugfix is accompanied some related changes: - The unit test is amended to verify the behaviour - The API documentation is amended with details on its behaviour
* uhd: Fix usage of std::abs with template parametersMartin Braun2021-07-231-3/+3
| | | | | | | | | `std::abs` is only a templated function, when dealing with complex numbers. For real values, it is an overload. There is no documented standard way to use `std::abs<double>()` for real-valued arguments. We therefore remove all usages of `std::abs<>()` and replace them with `std::abs()` where they were taking a real-valued argument.
* zbx: Fix clang compiler warningsMartin Braun2021-06-221-2/+2
| | | | | | | | - Missing override - Superfluous 'this' lambda capture - Register state in zbx_cpld_ctrl was being initialized too late (this is actually a bug depending on compiler version) - Remove lots of unused fields from experts
* uhd: Add support for the USRP X410Lars Amsel2021-06-102-0/+1559
| | | | | | | | | | | | | | | | Co-authored-by: Lars Amsel <lars.amsel@ni.com> Co-authored-by: Michael Auchter <michael.auchter@ni.com> Co-authored-by: Martin Braun <martin.braun@ettus.com> Co-authored-by: Paul Butler <paul.butler@ni.com> Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com> Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com> Co-authored-by: Virendra Kakade <virendra.kakade@ni.com> Co-authored-by: Lane Kolbly <lane.kolbly@ni.com> Co-authored-by: Max Köhler <max.koehler@ni.com> Co-authored-by: Andrew Lynch <andrew.lynch@ni.com> Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com> Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com> Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
* tests: Remove unused constantsMartin Braun2021-03-045-18/+0
| | | | This fixes some clang warnings.
* host: Update code base using clang-tidyMartin Braun2021-03-048-21/+23
| | | | | | | | | 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
* rfnoc: replay: Add support for 32-bit memory address widthsettus2020-09-031-2/+2
| | | | | | Increases the supported memory sizes in software to 2^32 and beyond. Signed-off-by: mattprost <matt.prost@ni.com>
* rfnoc: Remove M_PI usage to fix Windows buildsSteven Koo2020-08-071-7/+5
| | | | | | M_PI may not exist if _USE_MATH_DEFINES isn't defined before the first include of math.h or cmath on Windows. This changes avoids the issue all together by defining our own PI.
* tests: Add unit test for Keep One in N block controllerAaron Rossetto2020-08-051-0/+137
|
* tests: Add Replay Block controller unit testmattprost2020-08-041-0/+759
| | | | Signed-off-by: mattprost <matt.prost@ni.com>
* tests: Add unit test for siggen RFNoC block controllerAaron Rossetto2020-07-301-0/+348
|
* rfnoc: Add Switchboard block unit testsJesse Zhang2020-07-301-0/+157
|
* tests: Add unit test for Moving Average RFNoC blockmattprost2020-07-161-0/+107
| | | | Signed-off-by: mattprost <matt.prost@ni.com>
* rfnoc: Add unit test for Log Power RFNoC blockAaron Rossetto2020-06-291-0/+81
|
* rfnoc: Add unit test for Window RFNoC blockAaron Rossetto2020-06-291-0/+248
|
* tests: Add unit test for FFT RFNoC blockAaron Rossetto2020-06-181-0/+187
|
* rfnoc: Add unit test for Add/Sub RFNoC blockAaron Rossetto2020-05-281-0/+89
|
* tests: Add unit test for Split Stream RFNoC blockAaron Rossetto2020-05-281-0/+228
| | | | This commit adds a unit test for the split stream RFNoC block.
* tests: Added unit test for Vector IIR RFNoC blockAaron Rossetto2020-05-191-0/+221
|
* tests: Add Fosphor block controller unit testWade Fife2020-04-141-0/+354
|
* tests: migrated rfnoc block tests to dedicated subdirectorymattprost2020-04-134-0/+668
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>