aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/convert
Commit message (Collapse)AuthorAgeFilesLines
* convert: Make narrowing conversions saturateAaron Rossetto2022-02-282-14/+24
| | | | | This commit modifies the explicitly written narrowing conversions to clamp the results to the limits of the signed integer type.
* convert: Minor cleanupAaron Rossetto2022-02-281-2/+2
| | | | | | | | | | | | | | | | | | | This commit implements some minor cleanup of various converter- and convert test-related code: * Improves the log messages regarding which converter was returned for a request. * Modifies the result checking code in the converter tests to only report an out-of-range sample error once, rather than reporting every out-of-range sample encountered during the test. This vastly cuts down on the output when a conversion has failed. * Adds a function `reverse_converter()` which, given a `convert::id_type` describing a conversion from C1 to C2, returns a `convert::id_type` describing the reverse conversion (C2 to C1). * Removes two redundant test cases from the converter test.
* conversion: Saturate transmit IQ levels on NEON architectures.Ron Economos2022-02-281-4/+4
| | | | Signed-off-by: Ron Economos <w6rz@comcast.net>
* cmake: correctly set and unset any CMAKE_REQUIRED variablesMichael Dickens2021-07-061-2/+2
|
* uhd: Remove all occurences of boost::math::*round()Martin Braun2021-06-241-3/+3
| | | | | | | 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.
* convert: Remove unused variablesMartin Braun2021-03-042-4/+0
| | | | This reduces compiler warnings when using clang.
* host: Update code base using clang-tidyMartin Braun2021-03-046-27/+36
| | | | | | | | | 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
* Remove remaining Python 2 referencesMartin Braun2020-05-071-1/+1
| | | | | | | 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
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-0312-663/+785
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* uhd: Replace boost::function with std::functionMartin Braun2019-11-261-0/+1
| | | | | | | This is mostly a search-and-replace operation, with few exceptions: - boost::function has a clear() method. In C++11, this is achieved by assigning nullptr to the std::function object. - The empty() method is replaced by std::function's bool() operator
* convert: Add chdr converters for sc16 -> fc32 and vice versaMartin Braun2019-11-265-0/+235
| | | | | These differ from the item32 converters in that they don't IQ swap, and also don't have a BE/LE version.
* convert: sse2: Apply clang-formatMartin Braun2019-11-269-679/+742
|
* convert: Add CHDR convertersMartin Braun2019-11-261-1/+72
| | | | | | | | The difference between the _chdr converters and the _item32_ converters is that the former do not require item32 boundaries, they do not require endianness swapping, and they don't use IQ swapping either. This is possible because the FPGA will do byte-swapping.
* converters: Improve exception string for illegal formatsMartin Braun2019-07-201-1/+1
| | | | | | | When trying to create a converter with an illegal string, it will now look like this: [convert] Cannot find an item size for: `???'
* uhd: mpm: update all license header w/ "-or-later"Brent Stapleton2019-03-082-2/+2
| | | | Updating all SPDX license identifiers to include "-or-later"
* endianness: Replace Boost macros with custom onesMartin Braun2019-01-211-1/+1
| | | | | | | | Boost changed the macros for endianness identification in 1.69, and the deprecation warning is a pretty noisy one during compilation. This abstracts away the Boost macro, so we have two UHD macros, UHD_BIG_ENDIAN and UHD_LITTLE_ENDIAN. They indicate big and little endian byte order.
* lib: transport: convert: apply clang-formatBrent Stapleton2019-01-211-119/+165
| | | | | | | | | | | | | This is a continuation of 967be2a4. Applying clang-format to files needed for endianness changes. $ clang-format -i --style=file \ host/include/uhd/types/endianness.hpp \ host/include/uhd/utils/byteswap.hpp \ host/include/uhd/utils/byteswap.ipp $ clang-format -i --style=file \ host/lib/convert/convert_with_tables.cpp \ host/lib/transport/chdr.cpp
* cmake: Update coding style to use lowercase commandsMartin Braun2018-11-141-31/+31
| | | | | | | | | | | | | | | | | Also updates our coding style file. Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code (with GNU compliant sed): cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done > convert.sed \ && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \ '*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed (Make sure the backslashes don't get mangled!)
* host: lib: convert: Add CMake flag for NEON SIMDBrent Stapleton2018-09-121-1/+5
| | | | | | | Adding CMake flag to enable/disable NEON SIMD instructions. This is an addition to the previous checks (check for NEON headers and checking the size of pointers), so behavior is unchanged unless users specify that they do not want to use NEON instructions.
* uhd: Update license headersMartin Braun2018-02-1924-22/+46
| | | | | | | All copyright is now attributed to "Ettus Research, a National Instruments company". SPDX headers were also updated to latest version 3.0.
* converters: Swap 16 bit samples (s16)Martin Braun2017-12-221-20/+6
|
* Move all license headers to SPDX format.Martin Braun2017-12-2224-288/+24
|
* converters: Remove log message in register_converterMartin Braun2017-09-291-1/+1
| | | | | Similar to b431866a5, this reduces logging in static initializer blocks. Those are prone to hang during DLL initialization.
* build: Enable SSSE3 sc12 converters by build switch onlyTom Tsou2017-07-261-0/+2
| | | | | | | | | | | | | | | The existence of SSSE3 intrinsic headers is not a sufficient condition that SSSE3 support is available, which may lead to 'illegal instruction' runtime failuire on some platforms. Major OS distributions (Ubuntu, Fedora, etc.) include x86_64 intrinsic headers, though the underlying architecture may or may not support the instruction set. Assuming SSE2 availability is safe as instructions are present on all x86_64 architectures for which instrinsic headers would be present. The same cannot be said for SSSE3. Issue: #1761
* convert: Add SSE implementation for sc12Tom Tsou2017-07-257-211/+719
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implementation uses SSSE3 intructions to perform 12-bit sample pack/unpack operations to/from standard 16 and 32 bit host values. Input/output shuffle orderings for a single 128-bit SSE register with 16-bit integers shown below. 16-bit interleaved I/Q --------------------------------------- | Q3 | I3 | Q2 | I2 | Q1 | I1 | Q0 | I0 | Input --------------------------------------- | 127 0 | 12-bit packed I/Q byteswapped ----------------------- | I0 | Q0 | I1 | 0 |-----------------------| | I1 | Q1 | I2 | Q2 | Output |-----------------------| | Q2 | I3 | Q3 | |-----------------------| | Unused | 3 ----------------------- 31 0 Fixes: #1740, #966 Related: #1739
* convert: Add sc12-sc16 convertersTom Tsou2017-07-182-24/+117
| | | | | | | | | | | | | | | | | Create missing sc12-sc16 and sc16-sc12 type converters. To avoid replicating the full sc12 converter class object, overload the converter calls with C++11 std::enable_if metafunctions. When used with std::is_floating and std::is_integral templates, this allow a single template interface with compile time function selection and static type checking. Note the below std::enable_if interface is confusing, but quite effective in this case. typename enable_if<is_floating_point<type>::value>::type* = NULL Fixes: #966 Related: #967, #1721
* utils: introduce new logging API and remove msg APIAndrej Rode2017-02-204-14/+8
|
* uhd: replace BOOST_FOREACH with C++11 range-based for loopAndrej Rode2017-02-101-2/+1
| | | | | Note: This is the first commit that uses for-range, and range-based for-loops are now usable for UHD development.
* Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width ↵Martin Braun2016-11-087-106/+106
| | | | | | | | types) - Also removes all references to boost/cstdint.hpp and replaces it with stdint.h (The 'correct' replacement would be <cstdint>, but not all of our compilers support that).
* Merge branch 'maint'Martin Braun2016-06-232-0/+10
|\ | | | | | | | | Conflicts: host/lib/usrp/b200/b200_impl.cpp
| * converters: Clarifying comment re packingMartin Braun2016-06-222-0/+10
| |
* | Merge branch 'maint'Martin Braun2016-06-171-2/+1
|\|
| * convert: remove duplicate registration of sc12 sizeNicholas Corgan2016-06-171-2/+1
| |
* | Merge branch 'maint'Martin Braun2016-03-251-2/+46
|\|
| * Unroll the loops in the NEON float to/from integer converters.Philip Balister2016-03-231-2/+46
| | | | | | | | | | | | | | | | Unrolling the RX loop showed marked improvement with perf. The TX path was only slightly better. Checked signal correctness with shinysdr to verify received signal and tx_waveforms into a spectrum analyzer for TX. Signed-off-by: Philip Balister <philip@opensdr.com>
* | convert: Fixed s16 that would fail on some platforms/compilersMartin Braun2015-10-081-8/+4
| |
* | Merge branch 'maint'Martin Braun2015-09-111-1/+1
|\|
| * cmake: Checked for ARMv8 to avoid building ARMv7 convertersMartin Braun2015-09-111-1/+1
| |
* | convert: Added s8, s16 types and did some refactoringMartin Braun2015-09-012-29/+106
|/
* convert: Added converters for raw stringsMartin Braun2015-07-313-14/+76
| | | | | - u8: Converts arbitrary-length strings from and to item32 - item32->item32 memcpy non-conversion
* uhd: Replacing Cheetah w/ Mako 0.4.2 (allows Python 3 compat)Martin Braun2015-07-141-37/+39
|
* uhd: Removed the ORC dependencyMartin Braun2015-07-014-181/+2
|
* convert: Add sc16-sc16 SSE converterTom Tsou2015-05-142-0/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | The sc16-sc16 wire to host type converter is effectively an I/Q swap or 16-bit byteswap for little and big endian cases respectively. This implmentation is a subset of fc32 and fc64 converters without the floating point portion and scaling. The resulting byte ordering is as follows: ----------------- | A | B | C | D | Wire ----------------- 0 1 2 3 ----------------- | C | D | A | B | Litte-endian ----------------- 0 1 2 3 ----------------- | B | A | D | C | Big-endian ----------------- 0 1 2 3 Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
* convert: Added logging point in get_converter()Martin Braun2015-01-271-1/+16
|
* convert: Modifications to id_typeMartin Braun2015-01-271-3/+12
| | | | | - Converter ID symbols are exported - to_string() function for lighter feedback
* docs: Amended docs for conversion routinesMartin Braun2015-01-141-0/+13
|
* convert: Removed default-all-lines 12-bit packerMartin Braun2015-01-141-21/+6
|
* convert: Limit sc12 converter buffer overwriteTom Tsou2015-01-141-12/+74
| | | | | | | | | | | | | | | | | | | | | This patch addresses issue #648 "B200: TX with SC12 format and MIMO". The observed MIMO header corruption was caused by overwriting the end of the packed 12-bit sample output buffer. The overwrite was due to the converter call always writing out 4 complex samples even if less than 4 samples were available. The extra samples would corrupt data with zero padding. Avoid the overwrite condition by only writing the minimum number of 32-bit lines necessary rather than the entire 12 byte struct. Samples 32-bit lines 1 1 2 2 3 3 4 3 Signed-off-by: Tom Tsou <tom@tsou.cc>
* convert: Fix sc12 unpack shiftingTom Tsou2015-01-121-8/+8
| | | | | | | | | | | | Resolve issue #666 "B200: Rx signal distortion when using SC12". During 12-bit unpacking, OTW samples are shifted into the high order bits of the 16-bit intermediate values. The remaining 4-bits are not zeroed and contain bits from adjacent samples. Consequently, signal distortion becomes noticable with spurs and other random signal garbage when operating at low signal levels. Signed-off-by: Tom Tsou <tom@tsou.cc>
* Initial commit E300 support.Martin Braun2014-10-073-1/+75
|