Merge with next

This commit is contained in:
Javier Arribas 2022-12-12 15:30:30 +01:00
commit b8decef94d
187 changed files with 3423 additions and 1965 deletions

View File

@ -4,11 +4,10 @@ on:
push:
paths:
- CITATION.cff
workflow_dispatch:
pull_request:
paths:
- CITATION.cff
workflow_dispatch:
workflow_dispatch:
name: CITATION.cff
jobs:
@ -17,23 +16,15 @@ jobs:
name: Validate CITATION.cff
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"
steps:
- name: Checkout
uses: actions/checkout@v2
# This is needed for workflows running on
# ubuntu-20.04 or later
- name: Install V8
if: runner.os == 'Linux'
run: |
sudo apt-get install -y libv8-dev
uses: actions/checkout@v3
- name: Validate CITATION.cff
uses: dieghernan/cff-validator@main
# Upload artifact
- uses: actions/upload-artifact@v2
# Upload artifact in case of failure
- name: Update artifact
uses: actions/upload-artifact@v3
if: failure()
with:
name: citation-cff-errors

View File

@ -5,106 +5,124 @@ name: Simple CI
on:
pull_request:
paths-ignore:
- '**/CITATION.cff'
- "**/CITATION.cff"
push:
paths-ignore:
- '**/CITATION.cff'
- "**/CITATION.cff"
jobs:
build-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: sudo apt-get update && sudo apt-get install ninja-build libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-serialization-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr libpugixml-dev libpcap-dev libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev libmatio-dev googletest protobuf-compiler libprotobuf-dev python3-mako liborc-0.4-dev
- name: configure
run: cd build && cmake -GNinja ..
- name: build
run: cd build && ninja
- name: check
run: cd build && ninja check && ../install/volk_gnsssdr_profile && ../install/run_tests
- name: default position_test
run: cd build && cmake -DENABLE_SYSTEM_TESTING_EXTRA=ON .. && ninja && ../install/position_test
- uses: actions/checkout@v3
- name: install dependencies
run: |
sudo apt-get update -y
sudo apt install -y libunwind-dev
sudo apt-get install -y --no-install-recommends ninja-build cmake \
libboost-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev \
libboost-thread-dev libboost-chrono-dev libboost-serialization-dev \
liblog4cpp5-dev gnuradio-dev gr-osmosdr libpugixml-dev libpcap-dev libblas-dev \
liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev \
libgnutls-openssl-dev libmatio-dev googletest protobuf-compiler libprotobuf-dev \
python3-mako liborc-0.4-dev
- name: configure
run: cd build && cmake -GNinja ..
- name: build
run: cd build && ninja
- name: check
run: cd build && ninja check && ../install/volk_gnsssdr_profile && ../install/run_tests
- name: default position_test
run: cd build && cmake -DENABLE_SYSTEM_TESTING_EXTRA=ON .. && ninja && ../install/position_test
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: brew update && brew install ninja pkg-config hdf5 automake armadillo lapack gflags glog gnuradio log4cpp openssl pugixml protobuf && pip3 install mako
- name: configure
run: cd build && cmake -GNinja ..
- name: build
run: cd build && ninja
- name: check
run: cd build && ninja check && ../install/volk_gnsssdr_profile && ../install/run_tests
- name: default position_test
run: cd build && cmake -DENABLE_SYSTEM_TESTING_EXTRA=ON .. && ninja && ../install/position_test
- uses: actions/checkout@v3
- name: install dependencies
run: brew update && brew install ninja pkg-config hdf5 automake armadillo lapack gflags glog gnuradio log4cpp openssl pugixml protobuf && pip3 install mako
- name: configure
run: cd build && cmake -GNinja ..
- name: build
run: cd build && ninja
- name: check
run: cd build && ninja check && ../install/volk_gnsssdr_profile && ../install/run_tests
- name: default position_test
run: cd build && cmake -DENABLE_SYSTEM_TESTING_EXTRA=ON .. && ninja && ../install/position_test
build-macos-xcode:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: brew update && brew install ninja pkg-config hdf5 automake armadillo lapack gflags glog gnuradio log4cpp openssl pugixml protobuf && pip3 install mako
- name: configure
run: cd build && cmake -GXcode ..
- name: build
run: cd build && xcodebuild -configuration Release
- name: check
run: cd build && xcodebuild -configuration Release -target check && ../install/volk_gnsssdr_profile && ../install/run_tests
- name: default position_test
run: cd build && cmake -DENABLE_SYSTEM_TESTING_EXTRA=ON .. && xcodebuild -configuration Release -target position_test && ../install/position_test
clang-format:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: brew install clang-format
- name: run clang-format
run: find . -iname \*.h -o -iname \*.c -o -iname \*.cc | xargs clang-format -style=file -i
- name: check
run: git diff > clang_format.patch && echo -e "if \n [ -s clang_format.patch ] \nthen \n echo "clang-format not applied:"; echo ""; more clang_format.patch; exit 1 \nfi \n" > detect && chmod +x ./detect && ./detect
- uses: actions/checkout@v3
- name: install dependencies
run: brew install clang-format
- name: run clang-format
run: find . -iname \*.h -o -iname \*.c -o -iname \*.cc | xargs clang-format -style=file -i
- name: check
run: git diff > clang_format.patch && echo -e "if \n [ -s clang_format.patch ] \nthen \n echo "clang-format not applied:"; echo ""; more clang_format.patch; exit 1 \nfi \n" > detect && chmod +x ./detect && ./detect
clang-tidy:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: brew update && brew install llvm pkg-config hdf5 armadillo lapack gflags glog gnuradio libmatio log4cpp openssl pugixml protobuf && ln -s $(brew --prefix llvm)/bin/clang-tidy /usr/local/bin && ln -s $(brew --prefix llvm)/bin/clang-apply-replacements /usr/local/bin && ln -s $(brew --prefix llvm)/bin/run-clang-tidy /usr/local/bin && pip3 install mako
- name: Prepare run
run: cd build && cmake .. && make volk_gnsssdr_module gtest-1.12.1 core_monitor core_libs pvt_libs
- name: run clang-tidy
run: cd build && run-clang-tidy -fix
- name: check
run: git diff > clang_tidy.patch && echo -e "if \n [ -s clang_tidy.patch ] \nthen \n echo "clang_tidy not applied:"; echo ""; more clang_tidy.patch; exit 1 \nfi \n" > detect && chmod +x ./detect && ./detect
- uses: actions/checkout@v3
- name: install dependencies
run: brew update && brew install llvm pkg-config hdf5 armadillo lapack gflags glog gnuradio libmatio log4cpp openssl pugixml protobuf && ln -s $(brew --prefix llvm)/bin/clang-tidy /usr/local/bin && ln -s $(brew --prefix llvm)/bin/clang-apply-replacements /usr/local/bin && ln -s $(brew --prefix llvm)/bin/run-clang-tidy /usr/local/bin && pip3 install mako
- name: Prepare run
run: cd build && cmake .. && make volk_gnsssdr_module gtest-1.12.1 core_monitor core_libs pvt_libs
- name: run clang-tidy
run: cd build && run-clang-tidy -fix
- name: check
run: git diff > clang_tidy.patch && echo -e "if \n [ -s clang_tidy.patch ] \nthen \n echo "clang_tidy not applied:"; echo ""; more clang_tidy.patch; exit 1 \nfi \n" > detect && chmod +x ./detect && ./detect
cpplint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: sudo apt-get install python3-pip && sudo pip3 install cpplint
- name: run checks
run: "find ./src/ -iname *.h -o -iname *.cc | xargs cpplint
--filter=-,+build/class,+build/c++14,+build/deprecated,+build/explicit_make_pair,\
+build/include_what_you_use,+build/printf_format,+build/storage_class,\
+readability/constructors,+readability/namespace,+readability/newline,\
+readability/utf8,+runtime/casting,+runtime/explicit,\
+runtime/indentation_namespace,+runtime/init,+runtime/invalid_increment,\
+runtime/member_string_references,+runtime/memset,+runtime/operator,\
+runtime/printf,+runtime/printf_format,+whitespace/blank_line,\
+whitespace/comma,+whitespace/comments,+whitespace/empty_conditional_body,\
+whitespace/end-of-line,+whitespace/ending-newline,+whitespace/semicolon,\
+whitespace/tab --exclude=./src/core/interfaces/gnss_block_interface.h
--exclude=./src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/hwcaps_for_testing.*
--exclude=./src/utils/nav-listener/build/nav_message.pb.h"
- uses: actions/checkout@v3
- name: install dependencies
run: sudo apt-get install python3-pip && sudo pip3 install cpplint
- name: run checks
run: "find ./src/ -iname *.h -o -iname *.cc | xargs cpplint
--filter=-,+build/class,+build/c++14,+build/deprecated,+build/explicit_make_pair,\
+build/include_what_you_use,+build/printf_format,+build/storage_class,\
+readability/constructors,+readability/namespace,+readability/newline,\
+readability/utf8,+runtime/casting,+runtime/explicit,\
+runtime/indentation_namespace,+runtime/init,+runtime/invalid_increment,\
+runtime/member_string_references,+runtime/memset,+runtime/operator,\
+runtime/printf,+runtime/printf_format,+whitespace/blank_line,\
+whitespace/comma,+whitespace/comments,+whitespace/empty_conditional_body,\
+whitespace/end-of-line,+whitespace/ending-newline,+whitespace/semicolon,\
+whitespace/tab --exclude=./src/core/interfaces/gnss_block_interface.h
--exclude=./src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/hwcaps_for_testing.*
--exclude=./src/utils/nav-listener/build/nav_message.pb.h"
prettier-markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: sudo npm install --global prettier
- name: check markdown
run: find . -iname "*.md" | xargs prettier --parser markdown --print-width 80 --prose-wrap always --list-different
cmakelint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: |
sudo python -m pip install --upgrade pip
@ -112,91 +130,85 @@ jobs:
- name: check CMake scripts
run: find . -iname "CMakeLists.txt" -o -iname "*.cmake" | xargs cmakelint --filter=-linelength,-readability/wonkycase
volk-gnsssdr-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mako
- name: configure
shell: powershell
run: cd build; cmake -G "Visual Studio 17 2022" ..\src\algorithms\libs\volk_gnsssdr_module\volk_gnsssdr
- name: build
run: cmake --build build --config Release
- name: test
shell: powershell
run: cd build; ctest -C Release
- name: install
run: cmake --install build
- name: run profile
run: cd 'C:\Program Files (x86)\volk_gnsssdr\bin'; .\volk_gnsssdr_profile.exe
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mako
- name: configure
shell: powershell
run: cd build; cmake -G "Visual Studio 17 2022" ..\src\algorithms\libs\volk_gnsssdr_module\volk_gnsssdr
- name: build
run: cmake --build build --config Release
- name: test
shell: powershell
run: cd build; ctest -C Release
- name: install
run: cmake --install build
- name: run profile
run: cd 'C:\Program Files (x86)\volk_gnsssdr\bin'; .\volk_gnsssdr_profile.exe
volk-gnsssdr-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: sudo apt install python3-mako liborc-dev
- name: configure
run: cd build && cmake ../src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
- name: build
run: cd build && make -j2
- name: install
run: cd build && sudo make install && sudo ldconfig
- name: test
run: volk_gnsssdr_profile
- uses: actions/checkout@v3
- name: install dependencies
run: sudo apt install python3-mako liborc-dev
- name: configure
run: cd build && cmake ../src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
- name: build
run: cd build && make -j2
- name: install
run: cd build && sudo make install && sudo ldconfig
- name: test
run: volk_gnsssdr_profile
volk-gnsssdr-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: pip3 install mako
- name: configure
run: cd build && cmake ../src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
- name: build
run: cd build && make -j2 && sudo make install
- name: test
run: cd build && ctest -C Release --exclude-regex volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc
- uses: actions/checkout@v3
- name: install dependencies
run: pip3 install mako
- name: configure
run: cd build && cmake ../src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
- name: build
run: cd build && make -j2 && sudo make install
- name: test
run: cd build && ctest -C Release --exclude-regex volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc
volk-gnsssdr-macos-xcode:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: pip3 install mako
- name: configure
run: cd build && cmake -GXcode ../src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
- name: build
run: cd build && xcodebuild -configuration Release
- name: install
run: cd build && sudo xcodebuild -configuration Release -target install
- name: test
run: cd build && ctest -C Release --exclude-regex volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc
- uses: actions/checkout@v3
- name: install dependencies
run: pip3 install mako
- name: configure
run: cd build && cmake -GXcode ../src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
- name: build
run: cd build && xcodebuild -configuration Release
- name: install
run: cd build && sudo xcodebuild -configuration Release -target install
- name: test
run: cd build && ctest -C Release --exclude-regex volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: sudo apt install shellcheck
- name: check scripts
run: shellcheck src/utils/scripts/*
- uses: actions/checkout@v3
- name: install dependencies
run: sudo apt install shellcheck
- name: check scripts
run: shellcheck src/utils/scripts/*
REUSE-compliance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Check REUSE compliance
uses: docker://fsfe/reuse
with:
args: lint
- uses: actions/checkout@v3
- name: Check REUSE compliance
uses: docker://fsfe/reuse
with:
args: lint

View File

@ -3,12 +3,11 @@
on:
push:
paths:
- 'src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/**'
workflow_dispatch:
- "src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/**"
pull_request:
paths:
- 'src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/**'
workflow_dispatch:
- "src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/**"
workflow_dispatch:
name: Build volk-gnssdr on Android NDK
jobs:
@ -27,30 +26,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.0.0
- uses: actions/checkout@v3.0.0
- name: Update repositories
run: sudo apt update
- name: Update repositories
run: sudo apt update
# All dependencies
- name: Install dependencies
run: sudo apt install -y cmake openjdk-11-jre-headless wget unzip make python3-mako
# All dependencies
- name: Install dependencies
run: sudo apt install -y cmake openjdk-11-jre-headless wget unzip make python3-mako
# Setup Android SDK, and auto-accept licenses
- name: Install Android SDK
run: wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip && mkdir android-sdk-linux && unzip -qq android-sdk.zip -d android-sdk-linux && export ANDROID_HOME=./android-sdk-linux && echo y | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=android-sdk-linux --update && (echo y; echo y; echo y; echo y; echo y; echo y; echo y; echo y) | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=android-sdk-linux --licenses
# Setup Android SDK, and auto-accept licenses
- name: Install Android SDK
run: wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip && mkdir android-sdk-linux && unzip -qq android-sdk.zip -d android-sdk-linux && export ANDROID_HOME=./android-sdk-linux && echo y | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=android-sdk-linux --update && (echo y; echo y; echo y; echo y; echo y; echo y; echo y; echo y) | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=android-sdk-linux --licenses
# Call SDKManager to install the Android NDK
- name: Install Android NDK
run: $GITHUB_WORKSPACE/android-sdk-linux/cmdline-tools/bin/sdkmanager --sdk_root=$GITHUB_WORKSPACE/android-sdk-linux --install "ndk;24.0.8215888" --channel=3
# Call SDKManager to install the Android NDK
- name: Install Android NDK
run: $GITHUB_WORKSPACE/android-sdk-linux/cmdline-tools/bin/sdkmanager --sdk_root=$GITHUB_WORKSPACE/android-sdk-linux --install "ndk;24.0.8215888" --channel=3
# Setup build directory
- name: Setup ${{ matrix.arch.name }}
shell: bash
run: cd $GITHUB_WORKSPACE/ && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-sdk-linux/ndk/24.0.8215888/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.arch.name }} -DANDROID_PLATFORM=android-24 ../src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
# Setup build directory
- name: Setup ${{ matrix.arch.name }}
shell: bash
run: cd $GITHUB_WORKSPACE/ && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-sdk-linux/ndk/24.0.8215888/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.arch.name }} -DANDROID_PLATFORM=android-24 ../src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr
# Build
- name: Build ${{ matrix.arch.name }}
shell: bash
run: cd $GITHUB_WORKSPACE/build && make
continue-on-error: ${{ matrix.arch.allow_fail }}
# Build
- name: Build ${{ matrix.arch.name }}
shell: bash
run: cd $GITHUB_WORKSPACE/build && make
continue-on-error: ${{ matrix.arch.allow_fail }}

View File

@ -82,6 +82,11 @@ authors:
email: cillian.odriscoll@gmail.com
family-names: "O'Driscoll"
given-names: Cillian
- affiliation: "Finnish Geospatial Research Institute"
alias: IntoPa
email: into.paakkonen@aalto.fi
family-names: "Pääkkönen"
given-names: Into
- affiliation: "Centre Tecnològic de Telecomunicacions de Catalunya (CTTC)"
email: david.pubill@cttc.cat
family-names: Pubill
@ -309,22 +314,6 @@ references:
title: "Design patterns for GNSS software receivers"
type: conference-paper
year: 2010
- authors:
- name: "The GNU Radio Project team"
doi: 10.5281/zenodo.2704343
repository-code: "https://github.com/gnuradio/gnuradio"
scope: "Software dependency: the SDR framework."
title: "GNU Radio: The Free & Open Software Radio Ecosystem"
type: software
url: "https://www.gnuradio.org"
- authors:
- name: "The VOLK Project team"
doi: 10.5281/zenodo.3360942
repository-code: "https://github.com/gnuradio/volk"
scope: "Software dependency: the portable SIMD library."
title: "VOLK: The Vector-Optimized Library of Kernels"
type: software
url: "https://www.libvolk.org"
repository-code: "https://github.com/gnss-sdr/gnss-sdr"
title: GNSS-SDR
type: software

View File

@ -16,7 +16,7 @@ endif()
# Build type can still be overridden by setting -DCMAKE_BUILD_TYPE=
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "")
cmake_minimum_required(VERSION 2.8.12...3.24)
cmake_minimum_required(VERSION 2.8.12...3.25)
project(gnss-sdr CXX C)
set(GNSSSDR_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) # Allows to be a sub-project
@ -134,7 +134,7 @@ if(ENABLE_FPGA)
endif()
option(ENABLE_BENCHMARKS "Build code snippets benchmarks" OFF)
if(CMAKE_VERSION VERSION_LESS 3.5.1)
if(CMAKE_VERSION VERSION_LESS 3.16.3)
set(ENABLE_BENCHMARKS OFF)
endif()
@ -276,7 +276,11 @@ endif()
# allow 'large' files in 32 bit builds
if(UNIX)
add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES)
if(CMAKE_VERSION VERSION_GREATER 3.12.0)
add_compile_definitions(_LARGEFILE_SOURCE _FILE_OFFSET_BITS=64 _LARGE_FILES)
else()
add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES)
endif()
endif()
# If this is an out-of-tree build, do not pollute the original source directory
@ -345,11 +349,11 @@ else()
set(GNSSSDR_GTEST_LOCAL_VERSION "1.12.1")
endif()
set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master")
set(GNSSSDR_GNSSTK_LOCAL_VERSION "13.4.0")
set(GNSSSDR_GNSSTK_LOCAL_VERSION "13.7.0")
set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.23")
set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.12")
set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "21.5")
set(GNSSSDR_BENCHMARK_LOCAL_VERSION "1.7.0")
set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.13")
set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "21.9")
set(GNSSSDR_BENCHMARK_LOCAL_VERSION "1.7.1")
set(GNSSSDR_MATHJAX_EXTERNAL_VERSION "2.7.7")
if(CMAKE_VERSION VERSION_LESS "3.16")
@ -1117,13 +1121,11 @@ if(NOT VOLKGNSSSDR_FOUND)
if(PYTHON_EXECUTABLE)
set(USE_THIS_PYTHON "-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(CMAKE_GENERATOR STREQUAL Xcode)
set(VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild"
"-configuration" $<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo>$<$<CONFIG:MinSizeRel>:MinSizeRel>
"-target"
)
endif()
if(CMAKE_GENERATOR STREQUAL Xcode)
set(VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild"
"-configuration" $<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo>$<$<CONFIG:MinSizeRel>:MinSizeRel>
)
endif()
if(CMAKE_TOOLCHAIN_FILE)
@ -1157,11 +1159,7 @@ if(NOT VOLKGNSSSDR_FOUND)
${STRIP_VOLK_GNSSSDR_PROFILE}
${USE_THIS_PYTHON}
)
if(CMAKE_VERSION VERSION_GREATER 3.18.99 AND CMAKE_GENERATOR STREQUAL Xcode)
if(XCODE_VERSION VERSION_GREATER 11)
set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} -T buildsystem=1)
endif()
endif()
if(DEFINED ENV{OECORE_TARGET_SYSROOT})
set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS}
-DCROSSCOMPILE_MULTILIB=TRUE
@ -1189,7 +1187,7 @@ if(NOT VOLKGNSSSDR_FOUND)
include(GNUInstallDirs)
set(SUPPORTED_CPU_FEATURES_ARCH FALSE)
if(CMAKE_SYSTEM_PROCESSOR MATCHES
"(^mips)|(^arm)|(^aarch64)|(x86_64)|(AMD64|amd64)|(^i.86$)|(^powerpc)|(^ppc)")
"(^mips)|(^arm)|(^aarch64)|(x86_64)|(AMD64|amd64)|(^i.86$)|(^powerpc)|(^ppc)|(^s390x)")
set(SUPPORTED_CPU_FEATURES_ARCH TRUE)
endif()
if(${CMAKE_INSTALL_LIBDIR} MATCHES lib64)
@ -1206,7 +1204,7 @@ if(NOT VOLKGNSSSDR_FOUND)
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
PATCH_COMMAND ""
BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile
BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND}
INSTALL_DIR ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install
)
else()
@ -1257,7 +1255,7 @@ if(NOT VOLKGNSSSDR_FOUND)
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
PATCH_COMMAND ""
BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile
BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND}
BUILD_BYPRODUCTS ${VOLK_GNSSSDR_BUILD_BYPRODUCTS}
INSTALL_DIR ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install
)
@ -1276,9 +1274,10 @@ if(NOT VOLKGNSSSDR_FOUND)
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
PATCH_COMMAND ""
BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile
BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND}
BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}
${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile
${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info
INSTALL_DIR ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install
)
endif()
@ -3369,7 +3368,7 @@ add_feature_info(ENABLE_LIMESDR ENABLE_LIMESDR "Enables Limesdr_Signal_Source. R
add_feature_info(ENABLE_FMCOMMS2 ENABLE_FMCOMMS2 "Enables Fmcomms2_Signal_Source for FMCOMMS2/3/4 devices. Requires gr-iio and libad9361-dev.")
add_feature_info(ENABLE_PLUTOSDR ENABLE_PLUTOSDR "Enables Plutosdr_Signal_Source for using ADALM-PLUTO boards. Requires gr-iio.")
add_feature_info(ENABLE_AD9361 ENABLE_AD9361 "Enables Ad9361_Fpga_Signal_Source for devices with the AD9361 chipset. Requires libiio and libad9361-dev.")
add_feature_info(ENABLE_AD936X_SDR ENABLE_AD9361 "Enables Ad936x_Iio_Signal_Source to access AD936X front-ends using libiio. Requires libiio and libad9361-dev.")
add_feature_info(ENABLE_AD936X_SDR ENABLE_AD936X_SDR "Enables Ad936x_Iio_Signal_Source to access AD936X front-ends using libiio. Requires libiio and libad9361-dev.")
add_feature_info(ENABLE_RAW_UDP ENABLE_RAW_UDP "Enables Custom_UDP_Signal_Source for custom UDP packet sample source. Requires libpcap.")
add_feature_info(ENABLE_FLEXIBAND ENABLE_FLEXIBAND "Enables Flexiband_Signal_Source for using Teleorbit's Flexiband RF front-end. Requires gr-teleorbit.")
add_feature_info(ENABLE_ARRAY ENABLE_ARRAY "Enables Raw_Array_Signal_Source and Array_Signal_Conditioner for using CTTC's antenna array. Requires gr-dbfcttc.")

331
README.md
View File

@ -59,58 +59,60 @@ information about this open-source, software-defined GNSS receiver.
<summary><b>(click to expand)</b></summary>
<!-- MarkdownTOC -->
1. [How to build GNSS-SDR](#how-to-build-gnss-sdr)
1. [Table of Contents](#table-of-contents)
2. [How to build GNSS-SDR](#how-to-build-gnss-sdr)
1. [GNU/Linux](#gnulinux)
1. [Alternative 1: Install dependencies using software packages](#alternative-1-install-dependencies-using-software-packages)
- [Debian / Ubuntu](#debian--ubuntu)
- [Arch Linux](#arch-linux)
- [CentOS](#centos)
- [Fedora](#fedora)
- [OpenSUSE](#opensuse)
- [Rocky Linux](#rocky-linux)
1. [Alternative 2: Install dependencies using PyBOMBS](#alternative-2-install-dependencies-using-pybombs)
- [Manual installation of other required dependencies](#manual-installation-of-other-required-dependencies)
- [Armadillo](#install-armadillo-a-c-linear-algebra-library)
- [gflags](#install-gflags-a-commandline-flags-processing-module-for-c)
- [google-glog](#install-glog-a-library-that-implements-application-level-logging)
- [googletest](#download-the-google-c-testing-framework-also-known-as-google-test)
- [GnuTLS or OpenSSL](#install-the-gnutls-or-openssl-libraries)
- [matio](#install-matio-matlab-mat-file-io-library)
- [Protocol Buffers](#install-protocol-buffers-a-portable-mechanism-for-serialization-of-structured-data)
- [pugixml](#install-pugixml-a-light-weight-c-xml-processing-library)
1. [Clone GNSS-SDR's Git repository](#clone-gnss-sdrs-git-repository)
1. [Build and install GNSS-SDR](#build-and-install-gnss-sdr)
- [Build OsmoSDR support (optional)](#build-osmosdr-support-optional)
- [Build IIO support (optional)](#build-fmcomms2-based-sdr-hardware-support-optional)
- [Build OpenCL support (optional)](#build-opencl-support-optional)
- [Build CUDA support (optional)](#build-cuda-support-optional)
- [Build a portable binary](#build-a-portable-binary)
1. [macOS](#macos)
1. [Debian / Ubuntu](#debian--ubuntu)
2. [Arch Linux](#arch-linux)
3. [CentOS](#centos)
4. [Fedora](#fedora)
5. [openSUSE](#opensuse)
6. [Rocky Linux](#rocky-linux)
2. [Alternative 2: Install dependencies using PyBOMBS](#alternative-2-install-dependencies-using-pybombs)
3. [Manual installation of other required dependencies](#manual-installation-of-other-required-dependencies)
1. [Install Armadillo, a C++ linear algebra library](#install-armadillo-a-c-linear-algebra-library)
2. [Install Gflags, a commandline flags processing module for C++](#install-gflags-a-commandline-flags-processing-module-for-c)
3. [Install Glog, a library that implements application-level logging](#install-glog-a-library-that-implements-application-level-logging)
4. [Install the GnuTLS or OpenSSL libraries](#install-the-gnutls-or-openssl-libraries)
5. [Install Matio, MATLAB MAT file I/O library](#install-matio-matlab-mat-file-io-library)
6. [Install Protocol Buffers, a portable mechanism for serialization of structured data](#install-protocol-buffers-a-portable-mechanism-for-serialization-of-structured-data)
7. [Install Pugixml, a light-weight C++ XML processing library](#install-pugixml-a-light-weight-c-xml-processing-library)
8. [Download GoogleTest](#download-googletest)
4. [Clone GNSS-SDR's Git repository](#clone-gnss-sdrs-git-repository)
5. [Build and install GNSS-SDR](#build-and-install-gnss-sdr)
1. [Build OSMOSDR support (OPTIONAL)](#build-osmosdr-support-optional)
2. [Build FMCOMMS2 based SDR Hardware support (OPTIONAL)](#build-fmcomms2-based-sdr-hardware-support-optional)
3. [Build OpenCL support (OPTIONAL)](#build-opencl-support-optional)
4. [Build CUDA support (OPTIONAL)](#build-cuda-support-optional)
5. [Build a portable binary](#build-a-portable-binary)
2. [macOS](#macos)
1. [Macports](#macports)
1. [Homebrew](#homebrew)
1. [Build GNSS-SDR](#build-gnss-sdr)
1. [Other builds](#other-builds)
1. [Updating GNSS-SDR](#updating-gnss-sdr)
1. [Getting started](#getting-started)
1. [Using GNSS-SDR](#using-gnss-sdr)
1. [Control Plane](#control-plane)
2. [Homebrew](#homebrew)
3. [Other package managers](#other-package-managers)
4. [Build GNSS-SDR](#build-gnss-sdr)
3. [Other builds](#other-builds)
3. [Updating GNSS-SDR](#updating-gnss-sdr)
4. [Getting started](#getting-started)
5. [Using GNSS-SDR](#using-gnss-sdr)
1. [Control plane](#control-plane)
1. [Configuration](#configuration)
1. [GNSS block factory](#gnss-block-factory)
1. [Signal Processing Plane](#signal-processing-plane)
2. [GNSS block factory](#gnss-block-factory)
2. [Signal Processing plane](#signal-processing-plane)
1. [Signal Source](#signal-source)
1. [Signal Conditioner](#signal-conditioner)
- [Data type adapter](#data-type-adapter)
- [Input filter](#input-filter)
- [Resampler](#resampler)
1. [Channel](#channel)
- [Acquisition](#acquisition)
- [Tracking](#tracking)
- [Decoding of the navigation message](#decoding-of-the-navigation-message)
1. [Observables](#observables)
1. [Computation of Position, Velocity and Time](#computation-of-position-velocity-and-time)
1. [About the software license](#about-the-software-license)
1. [Publications and Credits](#publications-and-credits)
1. [Ok, now what?](#ok-now-what)
2. [Signal Conditioner](#signal-conditioner)
1. [Data type adapter](#data-type-adapter)
2. [Input filter](#input-filter)
3. [Resampler](#resampler)
3. [Channel](#channel)
1. [Acquisition](#acquisition)
2. [Tracking](#tracking)
3. [Decoding of the navigation message](#decoding-of-the-navigation-message)
4. [Observables](#observables)
5. [Computation of Position, Velocity, and Time](#computation-of-position-velocity-and-time)
6. [About the software license](#about-the-software-license)
7. [Publications and Credits](#publications-and-credits)
8. [Ok, now what?](#ok-now-what)
<!-- /MarkdownTOC -->
</details>
@ -118,7 +120,7 @@ information about this open-source, software-defined GNSS receiver.
# How to build GNSS-SDR
This section describes how to set up the compilation environment in GNU/Linux or
[macOS / Mac OS X](#macosx), and to build GNSS-SDR. See also our
[macOS / Mac OS X](#macos), and to build GNSS-SDR. See also our
[build and install page](https://gnss-sdr.org/build-and-install/ "GNSS-SDR's Build and Install").
## GNU/Linux
@ -197,7 +199,7 @@ above. Install `libtool`, `automake` and `libhdf5-dev` instead. You will also
need `python-six`.
Once you have installed these packages, you can jump directly to
[download the source code and build GNSS-SDR](#download-and-build-linux).
[download the source code and build GNSS-SDR](#clone-gnss-sdrs-git-repository).
#### Arch Linux
@ -210,7 +212,7 @@ $ pacman -S gcc make cmake pkgconf git boost boost-libs log4cpp libvolk gnuradio
```
Once you have installed these packages, you can jump directly to
[download the source code and build GNSS-SDR](#download-and-build-linux).
[download the source code and build GNSS-SDR](#clone-gnss-sdrs-git-repository).
#### CentOS
@ -229,7 +231,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel libtool \
```
Once you have installed these packages, you can jump directly to
[download the source code and build GNSS-SDR](#download-and-build-linux).
[download the source code and build GNSS-SDR](#clone-gnss-sdrs-git-repository).
#### Fedora
@ -275,7 +277,7 @@ $ zypper install cmake git gcc-c++ boost-devel libboost_atomic-devel \
```
Once you have installed these packages, you can jump directly to
[download the source code and build GNSS-SDR](#download-and-build-linux).
[download the source code and build GNSS-SDR](#clone-gnss-sdrs-git-repository).
#### Rocky Linux
@ -293,7 +295,7 @@ $ yum install -y make gcc gcc-c++ kernel-devel cmake git boost-devel \
```
Once you have installed these packages, you can jump directly to
[download the source code and build GNSS-SDR](#download-and-build-linux).
[download the source code and build GNSS-SDR](#clone-gnss-sdrs-git-repository).
### Alternative 2: Install dependencies using PyBOMBS
@ -374,11 +376,11 @@ $ pybombs install armadillo gflags glog gnutls matio
```
or manually as explained below, and then please follow instructions on how to
[download the source code and build GNSS-SDR](#download-and-build-linux).
[download the source code and build GNSS-SDR](#clone-gnss-sdrs-git-repository).
### Manual installation of other required dependencies
#### Install [Armadillo](http://arma.sourceforge.net/ "Armadillo's Homepage"), a C++ linear algebra library:
#### Install [Armadillo](http://arma.sourceforge.net/ "Armadillo's Homepage"), a C++ linear algebra library
```
$ sudo apt-get install libblas-dev liblapack-dev # For Debian/Ubuntu/LinuxMint
@ -400,7 +402,7 @@ correspondingly. CMake will also generate a run-time armadillo library, which is
a combined alias for all the relevant libraries present on your system (e.g.,
BLAS, LAPACK, and ATLAS).
#### Install [Gflags](https://github.com/gflags/gflags "Gflags' Homepage"), a commandline flags processing module for C++:
#### Install [Gflags](https://github.com/gflags/gflags "Gflags' Homepage"), a commandline flags processing module for C++
```
$ wget https://github.com/gflags/gflags/archive/v2.2.2.tar.gz
@ -412,7 +414,7 @@ $ sudo make install
$ sudo ldconfig
```
#### Install [Glog](https://github.com/google/glog "Glog's Homepage"), a library that implements application-level logging:
#### Install [Glog](https://github.com/google/glog "Glog's Homepage"), a library that implements application-level logging
```
$ wget https://github.com/google/glog/archive/v0.6.0.tar.gz
@ -425,7 +427,73 @@ $ sudo make install
$ sudo ldconfig
```
#### Download the [Google C++ Testing Framework](https://github.com/google/googletest "Googletest Homepage"), also known as Google Test:
#### Install the GnuTLS or OpenSSL libraries
```
$ sudo apt-get install libgnutls-openssl-dev # For Debian/Ubuntu/LinuxMint
$ sudo yum install openssl-devel # For Fedora/CentOS/RHEL
$ sudo zypper install openssl-devel # For OpenSUSE
$ sudo pacman -S openssl # For Arch Linux
```
In case the [GnuTLS](https://www.gnutls.org/ "GnuTLS's Homepage") library with
openssl extensions package is not available in your GNU/Linux distribution,
GNSS-SDR can also work well with
[OpenSSL](https://www.openssl.org/ "OpenSSL's Homepage").
#### Install [Matio](https://github.com/tbeu/matio "Matio's Homepage"), MATLAB MAT file I/O library
```
$ wget https://github.com/tbeu/matio/releases/download/v1.5.23/matio-1.5.23.tar.gz
$ tar xvfz matio-1.5.23.tar.gz
$ cd matio-1.5.23
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig
```
#### Install [Protocol Buffers](https://developers.google.com/protocol-buffers/ "Protocol Buffers' Homepage"), a portable mechanism for serialization of structured data
GNSS-SDR requires Protocol Buffers v3.0.0 or later. If the packages that come
with your distribution are older than that (_e.g._, Ubuntu 16.04 Xenial and
Debian 8 Jessie came with older versions), then you will need to install it
manually. First, install the dependencies:
```
$ sudo apt-get install autoconf automake libtool curl make g++ unzip
```
and then:
```
$ git clone https://github.com/protocolbuffers/protobuf.git
$ cd protobuf
$ git submodule update --init --recursive
$ ./autogen.sh
$ /configure
$ make -j$(nproc)
$ sudo make install
$ sudo ldconfig
```
For more options, please check the
[Protocol Buffers' installation instructions](https://github.com/protocolbuffers/protobuf/blob/main/src/README.md/).
#### Install [Pugixml](https://pugixml.org/ "Pugixml's Homepage"), a light-weight C++ XML processing library
```
$ wget https://github.com/zeux/pugixml/releases/download/v1.13/pugixml-1.13.tar.gz
$ tar xvfz pugixml-1.13.tar.gz
$ cd pugixml-1.13
$ mkdir build && cd build
$ cmake ..
$ make
$ sudo make install
$ sudo ldconfig
```
#### Download [GoogleTest](https://github.com/google/googletest "Googletest Homepage")
```
$ wget https://github.com/google/googletest/archive/release-1.12.1.zip
@ -462,71 +530,9 @@ environment variable is not defined, or the source code is not installed by a
package, then it will download a fresh copy of the Google Test source code and
will compile and link it for you.
#### Install the [GnuTLS](https://www.gnutls.org/ "GnuTLS's Homepage") or [OpenSSL](https://www.openssl.org/ "OpenSSL's Homepage") libraries:
<a name="download-and-build-linux"></a>
```
$ sudo apt-get install libgnutls-openssl-dev # For Debian/Ubuntu/LinuxMint
$ sudo yum install openssl-devel # For Fedora/CentOS/RHEL
$ sudo zypper install openssl-devel # For OpenSUSE
$ sudo pacman -S openssl # For Arch Linux
```
In case the GnuTLS library with openssl extensions package is not available in
your GNU/Linux distribution, GNSS-SDR can also work well with OpenSSL.
#### Install [Matio](https://github.com/tbeu/matio "Matio's Homepage"), MATLAB MAT file I/O library:
```
$ wget https://github.com/tbeu/matio/releases/download/v1.5.23/matio-1.5.23.tar.gz
$ tar xvfz matio-1.5.23.tar.gz
$ cd matio-1.5.23
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig
```
#### Install [Protocol Buffers](https://developers.google.com/protocol-buffers/ "Protocol Buffers' Homepage"), a portable mechanism for serialization of structured data:
GNSS-SDR requires Protocol Buffers v3.0.0 or later. If the packages that come
with your distribution are older than that (_e.g._, Ubuntu 16.04 Xenial and
Debian 8 Jessie came with older versions), then you will need to install it
manually. First, install the dependencies:
```
$ sudo apt-get install autoconf automake libtool curl make g++ unzip
```
and then:
```
$ git clone https://github.com/protocolbuffers/protobuf.git
$ cd protobuf
$ git submodule update --init --recursive
$ ./autogen.sh
$ /configure
$ make -j$(nproc)
$ sudo make install
$ sudo ldconfig
```
For more options, please check the
[Protocol Buffers' installation instructions](https://github.com/protocolbuffers/protobuf/blob/main/src/README.md/).
#### Install [Pugixml](https://pugixml.org/ "Pugixml's Homepage"), a light-weight C++ XML processing library:
```
$ wget https://github.com/zeux/pugixml/releases/download/v1.12/pugixml-1.12.tar.gz
$ tar xvfz pugixml-1.12.tar.gz
$ cd pugixml-1.12
$ mkdir build && cd build
$ cmake ..
$ make
$ sudo make install
$ sudo ldconfig
```
### <a name="download-and-build-linux">Clone GNSS-SDR's Git repository</a>:
### Clone GNSS-SDR's Git repository
```
$ git clone https://github.com/gnss-sdr/gnss-sdr
@ -665,7 +671,7 @@ and then import the created project into Eclipse:
After building the project, you will find the generated binaries at
`eclipse/install`.
###### Build OSMOSDR support (OPTIONAL):
#### Build OSMOSDR support (OPTIONAL)
Install the [OsmoSDR](https://osmocom.org/projects/sdr "OsmoSDR's Homepage")
library and GNU Radio's source block:
@ -701,7 +707,7 @@ $ sudo make install
(in order to disable the `Osmosdr_Signal_Source` compilation, you can pass
`-DENABLE_OSMOSDR=OFF` to cmake and build GNSS-SDR again).
###### Build FMCOMMS2 based SDR Hardware support (OPTIONAL):
#### Build FMCOMMS2 based SDR Hardware support (OPTIONAL)
Install the [libiio](https://github.com/analogdevicesinc/libiio.git) (>=v0.11),
[libad9361](https://github.com/analogdevicesinc/libad9361-iio.git) (>=v0.1-1)
@ -757,7 +763,7 @@ The `Plutosdr_Signal_Source` offers a simpler manner to use the ADALM-PLUTO
because implements only a subset of FMCOMMS2's parameters valid for those
devices.
###### Build OpenCL support (OPTIONAL):
#### Build OpenCL support (OPTIONAL)
In order to enable the building of blocks that use OpenCL, type:
@ -767,7 +773,7 @@ $ make
$ sudo make install
```
###### Build CUDA support (OPTIONAL):
#### Build CUDA support (OPTIONAL)
In order to enable the building of blocks that use CUDA, NVIDIA's parallel
programming model that enables graphics processing unit (GPU) acceleration for
@ -784,7 +790,7 @@ $ sudo make install
Of course, you will also need a GPU that
[supports CUDA](https://developer.nvidia.com/cuda-gpus "CUDA GPUs").
###### Build a portable binary
#### Build a portable binary
In order to build an executable that not depends on the specific SIMD
instruction set that is present in the processor of the compiling machine, so
@ -804,7 +810,7 @@ substitutes a generic, non-SIMD implementation.
More details can be found in our tutorial about
[GNSS-SDR configuration options at building time](https://gnss-sdr.org/docs/tutorials/using-git/ "Configuration options at building time").
## <a name="macosx">macOS</a>
## macOS
GNSS-SDR can be built on macOS (or the former Mac OS X), starting from 10.9
(Mavericks) and including 11 (Big Sur). If you still have not installed
@ -827,7 +833,7 @@ $ sudo xcodebuild -license
Software pre-requisites can be installed using either [Macports](#macports) or
[Homebrew](#homebrew).
#### <a name="macports">Macports</a>
### Macports
First, [install Macports](https://www.macports.org/install.php). If you are
upgrading from a previous installation, please follow the
@ -857,7 +863,7 @@ and you can activate a certain version by typing:
$ sudo port select --set python python37
```
#### <a name="homebrew">Homebrew</a>
### Homebrew
First, install [Homebrew](https://brew.sh/). Paste this in a terminal prompt:
@ -886,7 +892,32 @@ $ brew install --cask mactex # when completed, restart Terminal
$ brew install graphviz doxygen
```
#### Build GNSS-SDR
### Other package managers
GNU Radio and other dependencies can also be installed using other package
managers than Macports, such as [Fink](http://www.finkproject.org/ "Fink").
Since the version of Python that ships with OS X is great for learning but it is
not good for development, you could have another Python executable in a
non-standard location. If that is the case, you need to inform GNSS-SDR's
configuration system by defining the `PYTHON_EXECUTABLE` variable as:
```
$ cmake -DPYTHON_EXECUTABLE=/path/to/bin/python3 ..
```
In case you have installed Macports in a non-standard location, you can use:
```
$ cmake -DCMAKE_PREFIX_PATH=/opt/local -DUSE_MACPORTS_PYTHON=/opt/local/bin/python ..
```
changing `/opt/local` by the base directory in which your software is installed.
The CMake script will create Makefiles that download, build and link Armadillo,
Gflags, Glog, Matio, Protocol Buffers, PugiXML and Google Test on the fly at
compile time if they are not detected in your machine.
### Build GNSS-SDR
Finally, you are ready to clone the GNSS-SDR repository, configure and build the
software:
@ -933,32 +964,6 @@ the function to execute. It mimics GNU Radio's [VOLK](https://www.libvolk.org/)
library, so if you still have not run `volk_profile`, this is a good moment to
do so.
###### Other package managers
GNU Radio and other dependencies can also be installed using other package
managers than Macports, such as [Fink](http://www.finkproject.org/ "Fink") or
[Homebrew](https://brew.sh/ "Homebrew"). Since the version of Python that ships
with OS X is great for learning but it is not good for development, you could
have another Python executable in a non-standard location. If that is the case,
you need to inform GNSS-SDR's configuration system by defining the
`PYTHON_EXECUTABLE` variable as:
```
cmake -DPYTHON_EXECUTABLE=/path/to/bin/python3 ..
```
In case you have installed Macports in a non-standard location, you can use:
```
$ cmake -DCMAKE_PREFIX_PATH=/opt/local -DUSE_MACPORTS_PYTHON=/opt/local/bin/python ..
```
changing `/opt/local` by the base directory in which your software is installed.
The CMake script will create Makefiles that download, build and link Armadillo,
Gflags, Glog, Matio, Protocol Buffers, PugiXML and Google Test on the fly at
compile time if they are not detected in your machine.
## Other builds
- **Docker image**: A technology providing operating-system-level virtualization
@ -982,10 +987,10 @@ compile time if they are not detected in your machine.
- **GNSS-SDR in embedded platforms**: we provide a Software Development Kit
(SDK) based on [OpenEmbedded](http://www.openembedded.org/wiki/Main_Page) for
cross-compiling GNSS-SDR in your desktop computer and for producing
executables that can run in embedded platforms, such as a Zedboard or a
Raspberry Pi 3. Visit
[Cross-compiling GNSS-SDR](https://gnss-sdr.org/docs/tutorials/cross-compiling/)
for instructions.
executables that can run in embedded platforms, such as Xilinx's Zynq and
ZynqMP architectures, Raspberry Pi, and many others. Please check
[yocto-geniux](https://github.com/carlesfernandez/yocto-geniux) for
instructions on how to build bootable images.
# Updating GNSS-SDR
@ -1921,7 +1926,7 @@ TelemetryDecoder_1B.dump=false
More documentation at the
[Telemetry Decoder Blocks page](https://gnss-sdr.org/docs/sp-blocks/telemetry-decoder/).
#### Observables
### Observables
GNSS systems provide different kinds of observations. The most commonly used are
the code observations, also called pseudoranges. The _pseudo_ comes from the
@ -1949,7 +1954,7 @@ Observables.dump_filename=./observables.dat
More documentation at the
[Observables Blocks page](https://gnss-sdr.org/docs/sp-blocks/observables/).
#### Computation of Position, Velocity and Time
### Computation of Position, Velocity, and Time
Although data processing for obtaining high-accuracy PVT solutions is out of the
scope of GNSS-SDR, we provide a module that can compute position fixes (stored

View File

@ -127,6 +127,7 @@ if(GNSSTK_FOUND AND NOT ENABLE_OWN_GNSSTK AND NOT TARGET Gnsstk::gnsstk)
IMPORTED_LOCATION "${GNSSTK_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GNSSTK_INCLUDE_DIR};${GNSSTK_INCLUDE_DIR}/gpstk"
INTERFACE_LINK_LIBRARIES "${GNSSTK_LIBRARY}"
IMPORTED_IMPLIB "${GNSSTK_LIBRARY}"
)
else()
set_target_properties(Gnsstk::gnsstk PROPERTIES
@ -134,6 +135,7 @@ if(GNSSTK_FOUND AND NOT ENABLE_OWN_GNSSTK AND NOT TARGET Gnsstk::gnsstk)
IMPORTED_LOCATION "${GNSSTK_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GNSSTK_INCLUDE_DIR};${GNSSTK_INCLUDE_DIR}/gnsstk"
INTERFACE_LINK_LIBRARIES "${GNSSTK_LIBRARY}"
IMPORTED_IMPLIB "${GNSSTK_LIBRARY}"
)
endif()
endif()

View File

@ -75,12 +75,13 @@ find_path(MATIO_INCLUDE_DIR
/usr/include
/usr/local/include
/opt/local/include
${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include
DOC "The MATIO include directory"
)
# Look for the library.
find_library(MATIO_LIBRARY
NAMES matio
NAMES matio libmatio
PATHS
${MATIO_ROOT_USER_DEFINED}/lib
${MATIO_ROOT_USER_DEFINED}/lib64
@ -110,6 +111,7 @@ find_library(MATIO_LIBRARY
/usr/local/lib
/usr/local/lib64
/opt/local/lib
${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib
DOC "The MATIO library"
)
@ -182,5 +184,6 @@ if(MATIO_FOUND AND NOT TARGET Matio::matio)
IMPORTED_LOCATION "${MATIO_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${MATIO_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${MATIO_LIBRARY}"
IMPORTED_IMPLIB "${MATIO_LIBRARY}"
)
endif()

View File

@ -32,7 +32,6 @@ SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
SignalSource.enable_throttle_control=false
SignalSource.enable_dds_lo=false
SignalSource.freq_rf_tx_hz=1260000000
SignalSource.freq_dds_tx_hz=1000

View File

@ -42,7 +42,6 @@ SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############

View File

@ -41,7 +41,6 @@ SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############

View File

@ -23,7 +23,6 @@ SignalSource.AGC_enabled=false
SignalSource.samples=0
SignalSource.repeat=false
SignalSource.osmosdr_args=bladerf=0 ; This line enables the bladeRF
SignalSource.enable_throttle_control=false
SignalSource.dump=false
SignalSource.dump_filename=./signal_source.dat

View File

@ -42,7 +42,6 @@ SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Signal_Conditioner

View File

@ -31,13 +31,20 @@ SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Signal_Conditioner
DataTypeAdapter.implementation=Ishort_To_Cshort
;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Ishort_To_Complex
;######### INPUT_FILTER CONFIG ############
InputFilter.implementation=Pass_Through
InputFilter.item_type=cshort
InputFilter.input_item_type=gr_complex
InputFilter.output_item_type=gr_complex
;######### RESAMPLER CONFIG ############
Resampler.implementation=Direct_Resampler
Resampler.sample_freq_in=4000000
Resampler.sample_freq_out=2000000
Resampler.item_type=cshort
Resampler.item_type=gr_complex
;######### CHANNELS GLOBAL CONFIG ############
Channels_1C.count=8
@ -47,7 +54,7 @@ Channel.signal=1C
;######### ACQUISITION GLOBAL CONFIG ############
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition_1C.item_type=cshort
Acquisition_1C.item_type=gr_complex
Acquisition_1C.coherent_integration_time_ms=1
Acquisition_1C.pfa=0.01
;Acquisition_1C.pfa=0.000001
@ -59,7 +66,7 @@ Acquisition_1C.blocking=false;
;######### TRACKING GLOBAL CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=cshort
Tracking_1C.item_type=gr_complex
Tracking_1C.pll_bw_hz=40.0;
Tracking_1C.dll_bw_hz=4.0;
Tracking_1C.order=3;

View File

@ -44,7 +44,6 @@ SignalSource.buffer_size=65000
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.dump_filename=./capture.dat
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Pass_Through

View File

@ -44,7 +44,6 @@ SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
SignalSource.enable_throttle_control=false
SignalSource.address=127.0.0.1
SignalSource.port=1234
SignalSource.swap_iq=false

View File

@ -45,7 +45,6 @@ SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
SignalSource.enable_throttle_control=false
;# Please note that the new RTL-SDR Blog V3 dongles ship a < 1 PPM
;# temperature compensated oscillator (TCXO), which is well suited for GNSS

View File

@ -40,7 +40,6 @@ SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############

View File

@ -43,7 +43,6 @@ SignalSource.samples=0
SignalSource.repeat=false
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############

View File

@ -28,7 +28,6 @@ SignalSource.subdevice=A:0
SignalSource.samples=0
SignalSource.dump=false
SignalSource.dump_filename=../data/signal_source.dat
SignalSource.enable_throttle_control=false
;######### SIGNAL_CONDITIONER CONFIG ############

View File

@ -1269,7 +1269,7 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
d_dump_file.write(reinterpret_cast<char *>(&d_dop[2]), sizeof(double));
d_dump_file.write(reinterpret_cast<char *>(&d_dop[3]), sizeof(double));
}
catch (const std::ifstream::failure &e)
catch (const std::ofstream::failure &e)
{
LOG(WARNING) << "Exception writing RTKLIB dump file " << e.what();
}

View File

@ -40,30 +40,28 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
: configuration_(configuration),
gnss_synchro_(nullptr),
role_(role),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration_->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 4)),
max_dwells_(configuration_->property(role + ".max_dwells", 1)),
in_streams_(in_streams),
out_streams_(out_streams)
out_streams_(out_streams),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type",
default_item_type);
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
if (sampled_ms_ % 4 != 0)
{
@ -73,11 +71,6 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
<< sampled_ms_ << " ms will be used.";
}
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
dump_filename_ = configuration_->property(role + ".dump_filename",
default_dump_filename);
// -- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(round(
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
@ -90,9 +83,9 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
bool enable_monitor_output = configuration->property("AcquisitionMonitor.enable_monitor", false);
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = galileo_pcps_8ms_make_acquisition_cc(sampled_ms_, max_dwells_,
doppler_max_, fs_in_, samples_per_ms, code_length_,
dump_, dump_filename_, enable_monitor_output);
@ -104,7 +97,9 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
stream_to_vector_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -37,20 +37,19 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
configuration_(configuration),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
configuration_(configuration),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acquire_pilot_(configuration->property(role + ".acquire_pilot", false))
{
acq_parameters_.ms_per_code = 4;
acq_parameters_.SetFromConfiguration(configuration_, role, GALILEO_E1_CODE_CHIP_RATE_CPS, GALILEO_E1_OPT_ACQ_FS_SPS);
DLOG(INFO) << "role " << role;
acq_parameters_.SetFromConfiguration(configuration_, role_, GALILEO_E1_CODE_CHIP_RATE_CPS, GALILEO_E1_OPT_ACQ_FS_SPS);
if (FLAGS_doppler_max != 0)
{
@ -61,7 +60,6 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
item_type_ = acq_parameters_.item_type;
item_size_ = acq_parameters_.it_size;
fs_in_ = acq_parameters_.fs_in;
acquire_pilot_ = configuration->property(role + ".acquire_pilot", false);
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
@ -69,6 +67,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
sampled_ms_ = acq_parameters_.sampled_ms;
DLOG(INFO) << "role " << role_;
acquisition_ = pcps_make_acquisition(acq_parameters_);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";

View File

@ -34,17 +34,17 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acquire_pilot_(configuration->property(role + ".acquire_pilot", false))
{
acq_parameters_.SetFromConfiguration(configuration, role, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E1_CODE_CHIP_RATE_CPS, GALILEO_E1_B_CODE_LENGTH_CHIPS);
DLOG(INFO) << "role " << role;
acq_parameters_.SetFromConfiguration(configuration, role_, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E1_CODE_CHIP_RATE_CPS, GALILEO_E1_B_CODE_LENGTH_CHIPS);
if (FLAGS_doppler_max != 0)
{
@ -53,7 +53,6 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
doppler_max_ = acq_parameters_.doppler_max;
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
fs_in_ = acq_parameters_.fs_in;
acquire_pilot_ = configuration->property(role + ".acquire_pilot", false); // could be true in future versions
uint32_t code_length = acq_parameters_.code_length;
uint32_t nsamples_total = acq_parameters_.samples_per_code;
@ -131,6 +130,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
acq_parameters_.all_fft_codes = d_all_fft_codes_.data();
DLOG(INFO) << "role " << role_;
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters_);
if (in_streams_ > 1)

View File

@ -197,7 +197,6 @@ private:
volk_gnsssdr::vector<uint32_t> d_all_fft_codes_; // memory that contains all the code ffts
std::weak_ptr<ChannelFsm> channel_fsm_;
Gnss_Synchro* gnss_synchro_;
const ConfigurationInterface* configuration_;
Acq_Conf_Fpga acq_parameters_;
std::string role_;
int64_t fs_in_;

View File

@ -32,29 +32,28 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
: configuration_(configuration),
role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration_->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 4)),
max_dwells_(configuration_->property(role + ".max_dwells", 1)),
in_streams_(in_streams),
out_streams_(out_streams)
out_streams_(out_streams),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
if (sampled_ms_ % 4 != 0)
{
@ -64,11 +63,6 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
<< sampled_ms_ << " ms will be used.";
}
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
dump_filename_ = configuration_->property(role + ".dump_filename",
default_dump_filename);
// -- Find number of samples per spreading code (4 ms) -----------------
code_length_ = static_cast<unsigned int>(round(
fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)));
@ -82,9 +76,9 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_cccwsr_make_acquisition_cc(sampled_ms_, max_dwells_,
doppler_max_, fs_in_, samples_per_ms, code_length_,
dump_, dump_filename_, enable_monitor_output);
@ -96,7 +90,8 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -40,30 +40,28 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
: configuration_(configuration),
role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration_->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 8)),
in_streams_(in_streams),
out_streams_(out_streams)
out_streams_(out_streams),
bit_transition_flag_(configuration_->property(role + ".bit_transition_flag", false)),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type",
default_item_type);
item_type_ = configuration_->property(role + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8);
/* --- Find number of samples per spreading code (4 ms) -----------------*/
code_length_ = static_cast<unsigned int>(round(
@ -71,6 +69,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
auto samples_per_ms = static_cast<int>(round(code_length_ / 4.0));
DLOG(INFO) << "role " << role;
/*Calculate the folding factor value based on the formula described in the paper.
This may be a bug, but acquisition also work by variying the folding factor at va-
lues different that the expressed in the paper. In adition, it is important to point
@ -100,7 +99,6 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
}
// vector_length_ = (sampled_ms_/folding_factor_) * code_length_;
vector_length_ = sampled_ms_ * samples_per_ms;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
if (!bit_transition_flag_)
{
@ -111,8 +109,6 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
max_dwells_ = 2;
}
dump_filename_ = configuration_->property(role + ".dump_filename",
default_dump_filename);
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
@ -124,7 +120,6 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
<< ", Code Length: " << code_length_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_,
sampled_ms_, max_dwells_, doppler_max_, fs_in_,
samples_per_ms, code_length_, bit_transition_flag_,
@ -138,7 +133,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
}
else
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = nullptr;
item_size_ = 0;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -40,29 +40,28 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
: configuration_(configuration),
gnss_synchro_(nullptr),
role_(role),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration_->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 4)),
tong_init_val_(configuration->property(role + ".tong_init_val", 1)),
tong_max_val_(configuration->property(role + ".tong_max_val", 2)),
tong_max_dwells_(configuration->property(role + ".tong_max_dwells", tong_max_val_ + 1)),
in_streams_(in_streams),
out_streams_(out_streams)
out_streams_(out_streams),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type",
default_item_type);
DLOG(INFO) << "role " << role_;
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
if (sampled_ms_ % 4 != 0)
{
@ -72,12 +71,10 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
<< sampled_ms_ << " ms will be used.";
}
tong_init_val_ = configuration->property(role + ".tong_init_val", 1);
tong_max_val_ = configuration->property(role + ".tong_max_val", 2);
tong_max_dwells_ = configuration->property(role + ".tong_max_dwells", tong_max_val_ + 1);
dump_filename_ = configuration_->property(role + ".dump_filename",
default_dump_filename);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
@ -94,7 +91,6 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_,
fs_in_, samples_per_ms, code_length_, tong_init_val_,
tong_max_val_, tong_max_dwells_, dump_, dump_filename_, enable_monitor_output);
@ -107,7 +103,8 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -46,30 +46,33 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
: configuration_(configuration),
role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
Zero_padding(configuration_->property(role + ".Zero_padding", 0)),
CAF_window_hz_(configuration_->property(role + ".CAF_window_hz", 0)),
channel_(0),
doppler_max_(configuration_->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 1)),
max_dwells_(configuration_->property(role + ".max_dwells", 1)),
in_streams_(in_streams),
out_streams_(out_streams)
out_streams_(out_streams),
bit_transition_flag_(configuration_->property(role + ".bit_transition_flag", false)),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_filename("../data/acquisition.dat");
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
CAF_window_hz_ = configuration_->property(role + ".CAF_window_hz", 0);
Zero_padding = configuration_->property(role + ".Zero_padding", 0);
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
DLOG(INFO) << "role " << role_;
if (sampled_ms_ > 3)
{
sampled_ms_ = 3;
@ -83,10 +86,6 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
std::cout << "Zero padding activated. Changing to 1ms code + 1ms zero padding\n";
}
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
// -- Find number of samples per spreading code (1ms)-------------------------
code_length_ = static_cast<int>(round(static_cast<double>(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_CPS * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS)));
@ -105,14 +104,14 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
}
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(sampled_ms_, max_dwells_,
doppler_max_, fs_in_, code_length_, code_length_, bit_transition_flag_,
dump_, dump_filename_, both_signal_components, CAF_window_hz_, Zero_padding, enable_monitor_output);
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -37,19 +37,19 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acq_pilot_(configuration->property(role + ".acquire_pilot", false)),
acq_iq_(configuration->property(role + ".acquire_iq", false))
{
acq_parameters_.ms_per_code = 1;
acq_parameters_.SetFromConfiguration(configuration, role, GALILEO_E5A_CODE_CHIP_RATE_CPS, GALILEO_E5A_OPT_ACQ_FS_SPS);
DLOG(INFO) << "Role " << role;
acq_parameters_.SetFromConfiguration(configuration, role_, GALILEO_E5A_CODE_CHIP_RATE_CPS, GALILEO_E5A_OPT_ACQ_FS_SPS);
if (FLAGS_doppler_max != 0)
{
@ -61,22 +61,21 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(
item_size_ = acq_parameters_.it_size;
fs_in_ = acq_parameters_.fs_in;
acq_pilot_ = configuration->property(role + ".acquire_pilot", false);
acq_iq_ = configuration->property(role + ".acquire_iq", false);
if (acq_iq_)
{
acq_pilot_ = false;
}
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS)));
vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0));
code_ = volk_gnsssdr::vector<std::complex<float>>(vector_length_);
sampled_ms_ = acq_parameters_.sampled_ms;
DLOG(INFO) << "Role " << role_;
acquisition_ = pcps_make_acquisition(acq_parameters_);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";
if (acq_iq_)
{
acq_pilot_ = false;
}
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";

View File

@ -33,17 +33,17 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acq_pilot_(configuration->property(role + ".acquire_pilot", false)),
acq_iq_(configuration->property(role + ".acquire_iq", false))
{
acq_parameters_.SetFromConfiguration(configuration, role, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E5A_CODE_CHIP_RATE_CPS, GALILEO_E5A_CODE_LENGTH_CHIPS);
DLOG(INFO) << "Role " << role;
acq_parameters_.SetFromConfiguration(configuration, role_, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E5A_CODE_CHIP_RATE_CPS, GALILEO_E5A_CODE_LENGTH_CHIPS);
if (FLAGS_doppler_max != 0)
{
@ -53,13 +53,6 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
fs_in_ = acq_parameters_.fs_in;
acq_pilot_ = configuration->property(role + ".acquire_pilot", false);
acq_iq_ = configuration->property(role + ".acquire_iq", false);
if (acq_iq_)
{
acq_pilot_ = false;
}
uint32_t code_length = acq_parameters_.code_length;
uint32_t nsamples_total = acq_parameters_.samples_per_code;
@ -70,6 +63,11 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
d_all_fft_codes_ = volk_gnsssdr::vector<uint32_t>(nsamples_total * GALILEO_E5A_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
if (acq_iq_)
{
acq_pilot_ = false;
}
float max; // temporary maxima search
int32_t tmp;
int32_t tmp2;
@ -138,6 +136,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(
acq_parameters_.all_fft_codes = d_all_fft_codes_.data();
DLOG(INFO) << "role " << role_;
acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters_);
if (in_streams_ > 1)

View File

@ -204,7 +204,6 @@ private:
std::weak_ptr<ChannelFsm> channel_fsm_;
volk_gnsssdr::vector<uint32_t> d_all_fft_codes_; // memory that contains all the code ffts
Gnss_Synchro* gnss_synchro_;
const ConfigurationInterface* configuration_;
Acq_Conf_Fpga acq_parameters_;
std::string role_;
int64_t fs_in_;

View File

@ -37,19 +37,19 @@ namespace own = gsl;
GalileoE5bPcpsAcquisition::GalileoE5bPcpsAcquisition(const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
role_(role),
threshold_(0.0),
doppler_center_(0),
channel_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acq_pilot_(configuration->property(role + ".acquire_pilot", false)),
acq_iq_(configuration->property(role + ".acquire_iq", false))
{
acq_parameters_.ms_per_code = 1;
acq_parameters_.SetFromConfiguration(configuration, role, GALILEO_E5B_CODE_CHIP_RATE_CPS, GALILEO_E5B_OPT_ACQ_FS_SPS);
DLOG(INFO) << "Role " << role;
acq_parameters_.SetFromConfiguration(configuration, role_, GALILEO_E5B_CODE_CHIP_RATE_CPS, GALILEO_E5B_OPT_ACQ_FS_SPS);
if (FLAGS_doppler_max != 0)
{
@ -61,22 +61,21 @@ GalileoE5bPcpsAcquisition::GalileoE5bPcpsAcquisition(const ConfigurationInterfac
item_size_ = acq_parameters_.it_size;
fs_in_ = acq_parameters_.fs_in;
acq_pilot_ = configuration->property(role + ".acquire_pilot", false);
acq_iq_ = configuration->property(role + ".acquire_iq", false);
if (acq_iq_)
{
acq_pilot_ = false;
}
code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GALILEO_E5B_CODE_CHIP_RATE_CPS / GALILEO_E5B_CODE_LENGTH_CHIPS)));
vector_length_ = static_cast<unsigned int>(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0F : 1.0F));
code_ = volk_gnsssdr::vector<std::complex<float>>(vector_length_);
sampled_ms_ = acq_parameters_.sampled_ms;
DLOG(INFO) << "role " << role_;
acquisition_ = pcps_make_acquisition(acq_parameters_);
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";
if (acq_iq_)
{
acq_pilot_ = false;
}
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";

View File

@ -32,16 +32,18 @@
GalileoE5bPcpsAcquisitionFpga::GalileoE5bPcpsAcquisitionFpga(const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: gnss_synchro_(nullptr),
role_(role),
doppler_center_(0),
channel_(0),
doppler_step_(0),
in_streams_(in_streams),
out_streams_(out_streams),
acq_pilot_(configuration->property(role + ".acquire_pilot", false)),
acq_iq_(configuration->property(role + ".acquire_iq", false))
{
acq_parameters_.SetFromConfiguration(configuration, role, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E5B_CODE_CHIP_RATE_CPS, GALILEO_E5B_CODE_LENGTH_CHIPS);
acq_parameters_.SetFromConfiguration(configuration, role_, fpga_downsampling_factor, fpga_buff_num, fpga_blk_exp, GALILEO_E5B_CODE_CHIP_RATE_CPS, GALILEO_E5B_CODE_LENGTH_CHIPS);
if (FLAGS_doppler_max != 0)
{
acq_parameters_.doppler_max = FLAGS_doppler_max;
@ -50,13 +52,6 @@ GalileoE5bPcpsAcquisitionFpga::GalileoE5bPcpsAcquisitionFpga(const Configuration
doppler_step_ = static_cast<unsigned int>(acq_parameters_.doppler_step);
fs_in_ = acq_parameters_.fs_in;
acq_pilot_ = configuration->property(role + ".acquire_pilot", false);
acq_iq_ = configuration->property(role + ".acquire_iq", false);
if (acq_iq_)
{
acq_pilot_ = false;
}
uint32_t code_length = acq_parameters_.code_length;
uint32_t nsamples_total = acq_parameters_.samples_per_code;
@ -67,6 +62,11 @@ GalileoE5bPcpsAcquisitionFpga::GalileoE5bPcpsAcquisitionFpga(const Configuration
volk_gnsssdr::vector<std::complex<float>> fft_codes_padded(nsamples_total);
d_all_fft_codes_ = volk_gnsssdr::vector<uint32_t>(nsamples_total * GALILEO_E5B_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
if (acq_iq_)
{
acq_pilot_ = false;
}
float max; // temporary maxima search
int32_t tmp;
int32_t tmp2;

View File

@ -204,7 +204,6 @@ private:
std::weak_ptr<ChannelFsm> channel_fsm_;
Gnss_Synchro* gnss_synchro_;
const ConfigurationInterface* configuration_;
Acq_Conf_Fpga acq_parameters_;
std::string role_;
int64_t fs_in_;

View File

@ -31,36 +31,39 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
doppler_max_(configuration->property(role + ".doppler_max", 5000)),
max_dwells_(configuration->property(role + ".max_dwells", 1)),
channel_(0),
doppler_step_(0),
sampled_ms_(configuration->property(role + ".coherent_integration_time_ms", 1)),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./acquisition.mat";
DLOG(INFO) << "role " << role;
Acq_Conf acq_parameters = Acq_Conf();
item_type_ = configuration->property(role + ".item_type", default_item_type);
item_type_ = configuration->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
acq_parameters.fs_in = fs_in_;
acq_parameters.samples_per_chip = static_cast<unsigned int>(ceil(GPS_L1_CA_CHIP_PERIOD_S * static_cast<float>(acq_parameters.fs_in)));
dump_ = configuration->property(role + ".dump", false);
acq_parameters.dump = dump_;
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename);
acq_parameters.dump_filename = dump_filename_;
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
acq_parameters.doppler_max = doppler_max_;
sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1);
acq_parameters.sampled_ms = sampled_ms_;
max_dwells_ = configuration->property(role + ".max_dwells", 1);
acq_parameters.max_dwells = max_dwells_;
acq_parameters.blocking_on_standby = configuration->property(role + ".blocking_on_standby", false);
// -- Find number of samples per spreading code -------------------------
@ -68,22 +71,18 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
acq_parameters.samples_per_ms = static_cast<float>(vector_length_);
code_ = std::vector<std::complex<float>>(vector_length_);
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(acq_parameters);
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}
channel_ = 0;
threshold_ = 0.0;
doppler_step_ = 0;
gnss_synchro_ = nullptr;
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";

View File

@ -202,7 +202,6 @@ private:
std::weak_ptr<ChannelFsm> channel_fsm_;
volk_gnsssdr::vector<uint32_t> d_all_fft_codes_; // memory that contains all the code ffts
Gnss_Synchro* gnss_synchro_;
const ConfigurationInterface* configuration_;
Acq_Conf_Fpga acq_parameters_;
std::string role_;
int64_t fs_in_;

View File

@ -30,28 +30,33 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
doppler_max_(configuration->property(role + ".doppler_max", 5000)),
max_dwells_(configuration->property(role + ".max_dwells", 1)),
channel_(0),
doppler_step_(0),
sampled_ms_(configuration->property(role + ".coherent_integration_time_ms", 1)),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role;
item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename);
item_type_ = configuration->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration->property(role + ".dump", false);
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
doppler_min_ = configuration->property(role + ".doppler_min", -doppler_max_);
sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1);
max_dwells_ = configuration->property(role + ".max_dwells", 1);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
doppler_min_ = configuration->property(role_ + ".doppler_min", -doppler_max_);
bool enable_monitor_output = configuration->property("AcquisitionMonitor.enable_monitor", false);
// --- Find number of samples per spreading code -------------------------
@ -59,24 +64,20 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
code_ = std::vector<std::complex<float>>(vector_length_);
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_, sampled_ms_,
doppler_max_, doppler_min_, fs_in_, vector_length_,
dump_, dump_filename_, enable_monitor_output);
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}
channel_ = 0;
threshold_ = 0.0;
doppler_step_ = 0;
gnss_synchro_ = nullptr;
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";

View File

@ -41,34 +41,34 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
: configuration_(configuration),
role_(role),
gnss_synchro_(nullptr),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 4)),
in_streams_(in_streams),
out_streams_(out_streams)
out_streams_(out_streams),
bit_transition_flag_(configuration_->property(role + ".bit_transition_flag", false)),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
// -- Find number of samples per spreading code -------------------------
code_length_ = static_cast<unsigned int>(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)));
/* Calculate the folding factor value based on the calculations */
/* Calculate the folding factor value */
auto temp = static_cast<unsigned int>(ceil(sqrt(log2(code_length_))));
folding_factor_ = configuration_->property(role + ".folding_factor", temp);
folding_factor_ = configuration_->property(role_ + ".folding_factor", temp);
if (sampled_ms_ % folding_factor_ != 0)
{
@ -89,23 +89,24 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
}
vector_length_ = code_length_ * sampled_ms_;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
if (!bit_transition_flag_)
{
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
max_dwells_ = configuration_->property(role_ + ".max_dwells", 1);
}
else
{
max_dwells_ = 2;
}
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
int samples_per_ms = round(code_length_);
code_ = std::vector<std::complex<float>>(code_length_);
DLOG(INFO) << "role " << role_;
/* Object relevant information for debugging */
LOG(INFO) << "Implementation: " << this->implementation()
<< ", Vector Length: " << vector_length_
@ -116,7 +117,6 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_quicksync_make_acquisition_cc(folding_factor_,
sampled_ms_, max_dwells_, doppler_max_, fs_in_,
samples_per_ms, code_length_, bit_transition_flag_,
@ -130,7 +130,8 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
}
else
{
item_size_ = sizeof(gr_complex);
item_size_ = 0;
acquisition_cc_ = nullptr;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -40,35 +40,33 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
: configuration_(configuration),
gnss_synchro_(nullptr),
role_(role),
item_size_(sizeof(gr_complex)),
threshold_(0.0),
channel_(0),
doppler_max_(configuration->property(role + ".doppler_max", 5000)),
doppler_step_(0),
sampled_ms_(configuration_->property(role + ".coherent_integration_time_ms", 1)),
tong_init_val_(configuration->property(role + ".tong_init_val", 1)),
tong_max_val_(configuration->property(role + ".tong_max_val", 2)),
tong_max_dwells_(configuration->property(role + ".tong_max_dwells", tong_max_val_ + 1)),
in_streams_(in_streams),
out_streams_(out_streams)
out_streams_(out_streams),
dump_(configuration_->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
std::string default_dump_filename = "./data/acquisition.dat";
DLOG(INFO) << "role " << role;
item_type_ = configuration_->property(role + ".item_type", default_item_type);
DLOG(INFO) << "role " << role_;
item_type_ = configuration_->property(role_ + ".item_type", default_item_type);
int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
dump_ = configuration_->property(role + ".dump", false);
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
dump_filename_ = configuration_->property(role_ + ".dump_filename", default_dump_filename);
if (FLAGS_doppler_max != 0)
{
doppler_max_ = FLAGS_doppler_max;
}
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
tong_init_val_ = configuration->property(role + ".tong_init_val", 1);
tong_max_val_ = configuration->property(role + ".tong_max_val", 2);
tong_max_dwells_ = configuration->property(role + ".tong_max_dwells", tong_max_val_ + 1);
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
bool enable_monitor_output = configuration_->property("AcquisitionMonitor.enable_monitor", false);
// -- Find number of samples per spreading code -------------------------
@ -80,7 +78,6 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
if (item_type_ == "gr_complex")
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_tong_make_acquisition_cc(sampled_ms_, doppler_max_, fs_in_,
code_length_, code_length_, tong_init_val_, tong_max_val_, tong_max_dwells_,
dump_, dump_filename_, enable_monitor_output);
@ -92,7 +89,8 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
}
else
{
item_size_ = sizeof(gr_complex);
acquisition_cc_ = nullptr;
item_size_ = 0;
LOG(WARNING) << item_type_ << " unknown acquisition item type";
}

View File

@ -22,7 +22,6 @@
#include "configuration_interface.h"
#include "gnss_sdr_fft.h"
#include "gnss_sdr_flags.h"
#include "gnss_synchro.h"
#include "gps_l2c_signal_replica.h"
#include <glog/logging.h>
#include <gnuradio/gr_complex.h> // for gr_complex

View File

@ -22,6 +22,7 @@
#include "acq_conf_fpga.h"
#include "channel_fsm.h"
#include "gnss_synchro.h"
#include "pcps_acquisition_fpga.h"
#include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
@ -35,7 +36,6 @@
* \{ */
class Gnss_Synchro;
class ConfigurationInterface;
/*!
@ -164,7 +164,6 @@ private:
volk_gnsssdr::vector<uint32_t> d_all_fft_codes_; // memory that contains all the code ffts
std::weak_ptr<ChannelFsm> channel_fsm_;
Gnss_Synchro* gnss_synchro_;
const ConfigurationInterface* configuration_;
Acq_Conf_Fpga acq_parameters_;
std::string role_;
int64_t fs_in_;

View File

@ -204,7 +204,6 @@ private:
std::weak_ptr<ChannelFsm> channel_fsm_;
volk_gnsssdr::vector<uint32_t> d_all_fft_codes_; // memory that contains all the code ffts
Gnss_Synchro* gnss_synchro_;
const ConfigurationInterface* configuration_;
Acq_Conf_Fpga acq_parameters_;
std::string role_;
int64_t fs_in_;

View File

@ -34,7 +34,6 @@ void Acq_Conf_Fpga::SetFromConfiguration(const ConfigurationInterface *configura
// downsampling factor
uint32_t downsampling_factor = configuration->property(role + ".downsampling_factor", downs_factor);
downsampling_factor = downsampling_factor;
fs_in = fs_in / downsampling_factor;
// code length in samples

View File

@ -34,18 +34,19 @@ Channel::Channel(const ConfigurationInterface* configuration,
std::shared_ptr<TelemetryDecoderInterface> nav,
const std::string& role,
const std::string& signal_str,
Concurrent_Queue<pmt::pmt_t>* queue) : acq_(std::move(acq)),
trk_(std::move(trk)),
nav_(std::move(nav)),
role_(role),
channel_(channel)
Concurrent_Queue<pmt::pmt_t>* queue)
: acq_(std::move(acq)),
trk_(std::move(trk)),
nav_(std::move(nav)),
role_(role),
channel_(channel),
glonass_extend_correlation_ms_(configuration->property("Tracking_1G.extend_correlation_ms", 0) + configuration->property("Tracking_2G.extend_correlation_ms", 0)),
connected_(false),
repeat_(configuration->property("Acquisition_" + signal_str + ".repeat_satellite", false)),
flag_enable_fpga_(configuration->property("GNSS-SDR.enable_FPGA", false))
{
glonass_extend_correlation_ms_ = configuration->property("Tracking_1G.extend_correlation_ms", 0) + configuration->property("Tracking_2G.extend_correlation_ms", 0);
channel_fsm_ = std::make_shared<ChannelFsm>();
flag_enable_fpga_ = configuration->property("GNSS-SDR.enable_FPGA", false);
acq_->set_channel(channel_);
acq_->set_channel_fsm(channel_fsm_);
trk_->set_channel(channel_);
@ -56,6 +57,8 @@ Channel::Channel(const ConfigurationInterface* configuration,
acq_->set_gnss_synchro(&gnss_synchro_);
trk_->set_gnss_synchro(&gnss_synchro_);
repeat_ = configuration->property("Acquisition_" + signal_str + std::to_string(channel_) + ".repeat_satellite", repeat_);
// Provide a warning to the user about the change of parameter name
if (channel_ == 0)
{
@ -91,9 +94,6 @@ Channel::Channel(const ConfigurationInterface* configuration,
acq_->set_threshold(threshold);
acq_->init();
repeat_ = configuration->property("Acquisition_" + signal_str + ".repeat_satellite", false);
repeat_ = configuration->property("Acquisition_" + signal_str + std::to_string(channel_) + ".repeat_satellite", repeat_);
DLOG(INFO) << "Channel " << channel_ << " satellite repeat = " << repeat_;
channel_fsm_->set_acquisition(acq_);
channel_fsm_->set_tracking(trk_);
@ -101,8 +101,6 @@ Channel::Channel(const ConfigurationInterface* configuration,
channel_fsm_->set_channel(channel_);
channel_fsm_->set_queue(queue);
connected_ = false;
gnss_signal_ = Gnss_Signal(signal_str);
channel_msg_rx_ = channel_msg_receiver_make_cc(channel_fsm_, repeat_);
@ -273,7 +271,7 @@ void Channel::start_acquisition()
DLOG(INFO) << "Channel start_acquisition()";
}
bool Channel::glonass_dll_pll_c_aid_tracking_check()
bool Channel::glonass_dll_pll_c_aid_tracking_check() const
{
if (glonass_extend_correlation_ms_)
{

View File

@ -96,7 +96,7 @@ public:
inline std::shared_ptr<TelemetryDecoderInterface> telemetry() const { return nav_; }
private:
bool glonass_dll_pll_c_aid_tracking_check();
bool glonass_dll_pll_c_aid_tracking_check() const;
std::shared_ptr<ChannelFsm> channel_fsm_;
std::shared_ptr<AcquisitionInterface> acq_;
std::shared_ptr<TrackingInterface> trk_;

View File

@ -20,8 +20,13 @@
#include <utility>
ByteToShort::ByteToShort(const ConfigurationInterface* configuration, std::string role,
unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams)
ByteToShort::ByteToShort(const ConfigurationInterface* configuration,
std::string role,
unsigned int in_streams,
unsigned int out_streams) : role_(std::move(role)),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_input_item_type("byte");
const std::string default_output_item_type("short");
@ -30,12 +35,8 @@ ByteToShort::ByteToShort(const ConfigurationInterface* configuration, std::strin
DLOG(INFO) << "role " << role_;
input_item_type_ = configuration->property(role_ + ".input_item_type", default_input_item_type);
dump_ = configuration->property(role_ + ".dump", false);
dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename);
const size_t item_size = sizeof(int16_t);
gr_char_to_short_ = gr::blocks::char_to_short::make();
DLOG(INFO) << "data_type_adapter_(" << gr_char_to_short_->unique_id() << ")";
@ -43,6 +44,7 @@ ByteToShort::ByteToShort(const ConfigurationInterface* configuration, std::strin
if (dump_)
{
DLOG(INFO) << "Dumping output into file " << dump_filename_;
const size_t item_size = sizeof(int16_t);
file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str());
}
if (in_streams_ > 1)

View File

@ -21,8 +21,14 @@
#include <volk/volk.h>
IbyteToCbyte::IbyteToCbyte(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
IbyteToCbyte::IbyteToCbyte(const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams),
inverted_spectrum(configuration->property(role + ".inverted_spectrum", false)),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_input_item_type("byte");
const std::string default_output_item_type("lv_8sc_t");
@ -31,12 +37,7 @@ IbyteToCbyte::IbyteToCbyte(const ConfigurationInterface* configuration, const st
DLOG(INFO) << "role " << role_;
input_item_type_ = configuration->property(role_ + ".input_item_type", default_input_item_type);
dump_ = configuration->property(role_ + ".dump", false);
dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename);
inverted_spectrum = configuration->property(role + ".inverted_spectrum", false);
const size_t item_size = sizeof(lv_8sc_t);
ibyte_to_cbyte_ = make_interleaved_byte_to_complex_byte();
@ -45,6 +46,7 @@ IbyteToCbyte::IbyteToCbyte(const ConfigurationInterface* configuration, const st
if (dump_)
{
DLOG(INFO) << "Dumping output into file " << dump_filename_;
const size_t item_size = sizeof(lv_8sc_t);
file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str());
}
if (inverted_spectrum)

View File

@ -20,7 +20,12 @@
IbyteToComplex::IbyteToComplex(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams),
inverted_spectrum(configuration->property(role + ".inverted_spectrum", false)),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_input_item_type("byte");
const std::string default_output_item_type("gr_complex");
@ -29,12 +34,7 @@ IbyteToComplex::IbyteToComplex(const ConfigurationInterface* configuration, cons
DLOG(INFO) << "role " << role_;
input_item_type_ = configuration->property(role_ + ".input_item_type", default_input_item_type);
dump_ = configuration->property(role_ + ".dump", false);
dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename);
inverted_spectrum = configuration->property(role + ".inverted_spectrum", false);
const size_t item_size = sizeof(gr_complex);
gr_interleaved_char_to_complex_ = gr::blocks::interleaved_char_to_complex::make();
@ -47,6 +47,7 @@ IbyteToComplex::IbyteToComplex(const ConfigurationInterface* configuration, cons
if (dump_)
{
DLOG(INFO) << "Dumping output into file " << dump_filename_;
const size_t item_size = sizeof(gr_complex);
file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str());
}
if (in_streams_ > 1)

View File

@ -21,8 +21,14 @@
#include <volk/volk.h>
IbyteToCshort::IbyteToCshort(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
IbyteToCshort::IbyteToCshort(const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams),
inverted_spectrum(configuration->property(role + ".inverted_spectrum", false)),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_input_item_type("byte");
const std::string default_output_item_type("cshort");
@ -31,12 +37,7 @@ IbyteToCshort::IbyteToCshort(const ConfigurationInterface* configuration, const
DLOG(INFO) << "role " << role_;
input_item_type_ = configuration->property(role_ + ".input_item_type", default_input_item_type);
dump_ = configuration->property(role_ + ".dump", false);
dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename);
inverted_spectrum = configuration->property(role + ".inverted_spectrum", false);
const size_t item_size = sizeof(lv_16sc_t);
interleaved_byte_to_complex_short_ = make_interleaved_byte_to_complex_short();
@ -45,6 +46,7 @@ IbyteToCshort::IbyteToCshort(const ConfigurationInterface* configuration, const
if (dump_)
{
DLOG(INFO) << "Dumping output into file " << dump_filename_;
const size_t item_size = sizeof(lv_16sc_t);
file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str());
}
if (inverted_spectrum)

View File

@ -19,8 +19,14 @@
#include <glog/logging.h>
IshortToComplex::IshortToComplex(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
IshortToComplex::IshortToComplex(const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams),
inverted_spectrum(configuration->property(role + ".inverted_spectrum", false)),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_input_item_type("short");
const std::string default_output_item_type("gr_complex");
@ -29,12 +35,7 @@ IshortToComplex::IshortToComplex(const ConfigurationInterface* configuration, co
DLOG(INFO) << "role " << role_;
input_item_type_ = configuration->property(role_ + ".input_item_type", default_input_item_type);
dump_ = configuration->property(role_ + ".dump", false);
dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename);
inverted_spectrum = configuration->property(role + ".inverted_spectrum", false);
const size_t item_size = sizeof(gr_complex);
gr_interleaved_short_to_complex_ = gr::blocks::interleaved_short_to_complex::make();
@ -47,6 +48,7 @@ IshortToComplex::IshortToComplex(const ConfigurationInterface* configuration, co
if (dump_)
{
DLOG(INFO) << "Dumping output into file " << dump_filename_;
const size_t item_size = sizeof(gr_complex);
file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str());
}
if (in_streams_ > 1)

View File

@ -21,8 +21,14 @@
#include <volk/volk.h>
IshortToCshort::IshortToCshort(const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
IshortToCshort::IshortToCshort(const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams),
inverted_spectrum(configuration->property(role + ".inverted_spectrum", false)),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_input_item_type("short");
const std::string default_output_item_type("cshort");
@ -31,12 +37,7 @@ IshortToCshort::IshortToCshort(const ConfigurationInterface* configuration, cons
DLOG(INFO) << "role " << role_;
input_item_type_ = configuration->property(role_ + ".input_item_type", default_input_item_type);
dump_ = configuration->property(role_ + ".dump", false);
dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename);
inverted_spectrum = configuration->property(role + ".inverted_spectrum", false);
const size_t item_size = sizeof(lv_16sc_t);
interleaved_short_to_complex_short_ = make_interleaved_short_to_complex_short();
@ -45,6 +46,7 @@ IshortToCshort::IshortToCshort(const ConfigurationInterface* configuration, cons
if (dump_)
{
DLOG(INFO) << "Dumping output into file " << dump_filename_;
const size_t item_size = sizeof(lv_16sc_t);
file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str());
}
if (inverted_spectrum)

View File

@ -26,12 +26,12 @@ BeamformerFilter::BeamformerFilter(
unsigned int in_stream, unsigned int out_stream)
: role_(role),
in_stream_(in_stream),
out_stream_(out_stream)
out_stream_(out_stream),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_file("./data/input_filter.dat");
item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")

View File

@ -31,7 +31,8 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(const ConfigurationInterface* configu
unsigned int out_streams)
: role_(std::move(role)),
in_streams_(in_streams),
out_streams_(out_streams)
out_streams_(out_streams),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_input_item_type("gr_complex");
const std::string default_output_item_type("gr_complex");
@ -59,7 +60,6 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(const ConfigurationInterface* configu
intermediate_freq_ = configuration->property(role_ + ".IF", default_intermediate_freq);
sampling_freq_ = configuration->property(role_ + ".sampling_frequency", default_sampling_freq);
decimation_factor_ = configuration->property(role_ + ".decimation_factor", default_decimation_factor);
dump_ = configuration->property(role_ + ".dump", false);
if (filter_type != "lowpass")
{

View File

@ -28,7 +28,8 @@ NotchFilter::NotchFilter(const ConfigurationInterface* configuration,
unsigned int out_streams)
: role_(role),
in_streams_(in_streams),
out_streams_(out_streams)
out_streams_(out_streams),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_file("./data/input_filter.dat");
@ -46,7 +47,6 @@ NotchFilter::NotchFilter(const ConfigurationInterface* configuration,
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_ = configuration->property(role + ".dump", false);
DLOG(INFO) << "role " << role_;
if (item_type_ == "gr_complex")

View File

@ -29,7 +29,8 @@ NotchFilterLite::NotchFilterLite(const ConfigurationInterface* configuration,
unsigned int out_streams)
: role_(role),
in_streams_(in_streams),
out_streams_(out_streams)
out_streams_(out_streams),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_file("./data/input_filter.dat");
@ -39,7 +40,6 @@ NotchFilterLite::NotchFilterLite(const ConfigurationInterface* configuration,
const int default_n_segments_reset = 5000000;
const int default_length_ = 32;
const int default_n_segments_est = 12500;
const float samp_freq = configuration->property("SignalSource.sampling_frequency", default_samp_freq);
const float default_coeff_rate = samp_freq * 0.1F;
const float p_c_factor = configuration->property(role + ".p_c_factor", default_p_c_factor);
@ -51,7 +51,6 @@ NotchFilterLite::NotchFilterLite(const ConfigurationInterface* configuration,
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_ = configuration->property(role + ".dump", false);
int n_segments_coeff = static_cast<int>((samp_freq / coeff_rate) / static_cast<float>(length_));
n_segments_coeff = std::max(1, n_segments_coeff);

View File

@ -53,13 +53,6 @@ target_include_directories(input_filter_gr_blocks
${GNSSSDR_SOURCE_DIR}/src/core/interfaces
)
if(LOG4CPP_WITH_OLD_CMAKE)
target_link_libraries(input_filter_gr_blocks
PRIVATE
Log4cpp::log4cpp
)
endif()
if(GNURADIO_USES_STD_POINTERS)
target_compile_definitions(input_filter_gr_blocks
PUBLIC -DGNURADIO_USES_STD_POINTERS=1

View File

@ -27,18 +27,17 @@ void glonass_l1_ca_code_gen_complex(own::span<std::complex<float>> dest, uint32_
const uint32_t code_length = 511;
std::bitset<code_length> G1{};
auto G1_register = std::bitset<9>{}.set(); // All true
bool feedback1;
bool aux;
uint32_t delay;
uint32_t lcv;
uint32_t lcv2;
bool feedback1;
bool aux;
/* Generate G1 Register */
for (lcv = 0; lcv < code_length; lcv++)
{
G1[lcv] = G1_register[2];
feedback1 = G1_register[4] xor G1_register[0];
feedback1 = G1_register[4] ^ G1_register[0];
for (lcv2 = 0; lcv2 < 8; lcv2++)
{
@ -62,11 +61,6 @@ void glonass_l1_ca_code_gen_complex(own::span<std::complex<float>> dest, uint32_
}
}
/* Set the delay */
delay = code_length;
delay += chip_shift;
delay %= code_length;
/* Generate PRN from G1 and G2 Registers */
for (lcv = 0; lcv < code_length; lcv++)
{
@ -79,8 +73,6 @@ void glonass_l1_ca_code_gen_complex(own::span<std::complex<float>> dest, uint32_
{
dest[lcv] = std::complex<float>(-1, 0);
}
delay++;
delay %= code_length;
}
}

View File

@ -27,18 +27,17 @@ void glonass_l2_ca_code_gen_complex(own::span<std::complex<float>> dest, uint32_
const uint32_t code_length = 511;
std::bitset<code_length> G1{};
auto G1_register = std::bitset<9>{}.set(); // All true
bool feedback1;
bool aux;
uint32_t delay;
uint32_t lcv;
uint32_t lcv2;
bool feedback1;
bool aux;
/* Generate G1 Register */
for (lcv = 0; lcv < code_length; lcv++)
{
G1[lcv] = G1_register[2];
feedback1 = G1_register[4] xor G1_register[0];
feedback1 = G1_register[4] ^ G1_register[0];
for (lcv2 = 0; lcv2 < 8; lcv2++)
{
@ -62,11 +61,6 @@ void glonass_l2_ca_code_gen_complex(own::span<std::complex<float>> dest, uint32_
}
}
/* Set the delay */
delay = code_length;
delay += chip_shift;
delay %= code_length;
/* Generate PRN from G1 and G2 Registers */
for (lcv = 0; lcv < code_length; lcv++)
{
@ -79,8 +73,6 @@ void glonass_l2_ca_code_gen_complex(own::span<std::complex<float>> dest, uint32_
{
dest[lcv] = std::complex<float>(-1, 0);
}
delay++;
delay %= code_length;
}
}

View File

@ -187,7 +187,7 @@
#if !defined(CL_CALLBACK)
#define CL_CALLBACK
#endif //CL_CALLBACK
#endif // CL_CALLBACK
#include <iterator>
#include <limits>
@ -1070,8 +1070,8 @@ namespace detail
#define __DEFAULT_INITIALIZED 4
/*
* Compare and exchange primitives are needed for handling of defaults
*/
* Compare and exchange primitives are needed for handling of defaults
*/
#ifdef CL_HPP_CPP11_ATOMICS_SUPPORTED
inline int compare_exchange(std::atomic<int>* dest, int exchange, int comparand)
@ -3460,9 +3460,9 @@ public:
bool readOnly, bool useHostPtr = false, cl_int* err = nullptr);
/*!
* \brief Construct a Buffer from a host container via iterators using a specified queue.
* If useHostPtr is specified iterators must represent contiguous data.
*/
* \brief Construct a Buffer from a host container via iterators using a specified queue.
* If useHostPtr is specified iterators must represent contiguous data.
*/
template <typename IteratorType>
Buffer(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
bool readOnly, bool useHostPtr = false, cl_int* err = nullptr);
@ -3626,13 +3626,13 @@ public:
}
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
BufferD3D10(const BufferD3D10& buf) : Buffer(buf) {}
/*! \brief Copy assignment to forward copy to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
BufferD3D10& operator=(const BufferD3D10& buf)
{
Buffer::operator=(buf);
@ -3641,13 +3641,13 @@ public:
#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
/*! \brief Move constructor to forward move to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
BufferD3D10(BufferD3D10&& buf) CL_HPP_NOEXCEPT : Buffer(std::move(buf)) {}
/*! \brief Move assignment to forward move to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
BufferD3D10& operator=(BufferD3D10&& buf)
{
Buffer::operator=(std::move(buf));
@ -3713,13 +3713,13 @@ public:
}
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
BufferGL(const BufferGL& buf) : Buffer(buf) {}
/*! \brief Copy assignment to forward copy to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
BufferGL& operator=(const BufferGL& buf)
{
Buffer::operator=(buf);
@ -3728,13 +3728,13 @@ public:
#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
/*! \brief Move constructor to forward move to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
BufferGL(BufferGL&& buf) CL_HPP_NOEXCEPT : Buffer(std::move(buf)) {}
/*! \brief Move assignment to forward move to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
BufferGL& operator=(BufferGL&& buf)
{
Buffer::operator=(std::move(buf));
@ -4703,26 +4703,26 @@ public:
#endif // #if defined(CL_VERSION_1_2)
/*! \brief Class interface for GL Render Buffer Memory Objects.
*
* This is provided to facilitate interoperability with OpenGL.
*
* See Memory for details about copy semantics, etc.
*
* \see Memory
*/
*
* This is provided to facilitate interoperability with OpenGL.
*
* See Memory for details about copy semantics, etc.
*
* \see Memory
*/
class BufferRenderGL :
#if defined(CL_VERSION_1_2)
public ImageGL
#else // #if defined(CL_VERSION_1_2)
public Image2DGL
#endif //#if defined(CL_VERSION_1_2)
#endif // #if defined(CL_VERSION_1_2)
{
public:
/*! \brief Constructs a BufferRenderGL in a specified context, from a given
* GL Renderbuffer.
*
* Wraps clCreateFromGLRenderbuffer().
*/
* GL Renderbuffer.
*
* Wraps clCreateFromGLRenderbuffer().
*/
BufferRenderGL(
const Context& context,
cl_mem_flags flags,
@ -4748,12 +4748,12 @@ public:
BufferRenderGL() : ImageGL(){};
#else // #if defined(CL_VERSION_1_2)
BufferRenderGL() : Image2DGL(){};
#endif //#if defined(CL_VERSION_1_2)
#endif // #if defined(CL_VERSION_1_2)
/*! \brief Constructor from cl_mem - takes ownership.
*
* See Memory for further details.
*/
*
* See Memory for further details.
*/
#if defined(CL_VERSION_1_2)
__CL_EXPLICIT_CONSTRUCTORS BufferRenderGL(const cl_mem& buffer) : ImageGL(buffer)
{
@ -4762,27 +4762,27 @@ public:
__CL_EXPLICIT_CONSTRUCTORS BufferRenderGL(const cl_mem& buffer) : Image2DGL(buffer)
{
}
#endif //#if defined(CL_VERSION_1_2)
#endif // #if defined(CL_VERSION_1_2)
/*! \brief Assignment from cl_mem - performs shallow copy.
*
* See Memory for further details.
*/
*
* See Memory for further details.
*/
BufferRenderGL& operator=(const cl_mem& rhs)
{
#if defined(CL_VERSION_1_2)
ImageGL::operator=(rhs);
#else // #if defined(CL_VERSION_1_2)
Image2DGL::operator=(rhs);
#endif //#if defined(CL_VERSION_1_2)
#endif // #if defined(CL_VERSION_1_2)
return *this;
}
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
#if defined(CL_VERSION_1_2)
BufferRenderGL(const BufferRenderGL& buf) : ImageGL(buf)
{
@ -4791,25 +4791,25 @@ public:
BufferRenderGL(const BufferRenderGL& buf) : Image2DGL(buf)
{
}
#endif //#if defined(CL_VERSION_1_2)
#endif // #if defined(CL_VERSION_1_2)
/*! \brief Copy assignment to forward copy to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
BufferRenderGL& operator=(const BufferRenderGL& rhs)
{
#if defined(CL_VERSION_1_2)
ImageGL::operator=(rhs);
#else // #if defined(CL_VERSION_1_2)
Image2DGL::operator=(rhs);
#endif //#if defined(CL_VERSION_1_2)
#endif // #if defined(CL_VERSION_1_2)
return *this;
}
#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
/*! \brief Move constructor to forward move to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
#if defined(CL_VERSION_1_2)
BufferRenderGL(BufferRenderGL&& buf) CL_HPP_NOEXCEPT : ImageGL(std::move(buf))
{
@ -4818,19 +4818,19 @@ public:
BufferRenderGL(BufferRenderGL&& buf) CL_HPP_NOEXCEPT : Image2DGL(std::move(buf))
{
}
#endif //#if defined(CL_VERSION_1_2)
#endif // #if defined(CL_VERSION_1_2)
/*! \brief Move assignment to forward move to the superclass correctly.
* Required for MSVC.
*/
* Required for MSVC.
*/
BufferRenderGL& operator=(BufferRenderGL&& buf)
{
#if defined(CL_VERSION_1_2)
ImageGL::operator=(std::move(buf));
#else // #if defined(CL_VERSION_1_2)
Image2DGL::operator=(std::move(buf));
#endif //#if defined(CL_VERSION_1_2)
#endif // #if defined(CL_VERSION_1_2)
return *this;
}
@ -5066,7 +5066,7 @@ Local(::size_t size)
return ret;
}
//class KernelFunctor;
// class KernelFunctor;
/*! \brief Class interface for cl_kernel.
*
@ -5780,8 +5780,8 @@ public:
}
}
/*!
* \brief Constructs a CommandQueue for an implementation defined device in the given context
*/
* \brief Constructs a CommandQueue for an implementation defined device in the given context
*/
explicit CommandQueue(
const Context& context,
cl_command_queue_properties properties = 0,

View File

@ -25,15 +25,17 @@
#include <ostream> // for operator<<
Pass_Through::Pass_Through(const ConfigurationInterface* configuration, const std::string& role,
Pass_Through::Pass_Through(const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams)
unsigned int out_streams)
: role_(role),
in_streams_(in_streams),
out_streams_(out_streams),
inverted_spectrum(configuration->property(role + ".inverted_spectrum", false))
{
const std::string default_item_type("gr_complex");
item_type_ = configuration->property(role + ".item_type", default_item_type);
inverted_spectrum = configuration->property(role + ".inverted_spectrum", false);
if (item_type_ == "float")
{

View File

@ -8,10 +8,7 @@
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 2.8.12...3.24)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
cmake_minimum_required(VERSION 2.8.12...3.25)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type: None Debug Release RelWithDebInfo MinSizeRel")
project(volk_gnsssdr)
enable_language(CXX)
@ -227,7 +224,11 @@ endif()
set(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\" if you have and want to use multiple C development libs installed for cross compile")
if(MSVC)
add_definitions(-D_USE_MATH_DEFINES) # enables math constants on all supported versions of MSVC
if(CMAKE_VERSION VERSION_GREATER 3.12.0)
add_compile_definitions(_USE_MATH_DEFINES) # enables math constants on all supported versions of MSVC
else()
add_definitions(-D_USE_MATH_DEFINES) # enables math constants on all supported versions of MSVC
endif()
add_compile_options(/W1) # reduce warnings
add_compile_options(/wo4309)
add_compile_options(/wd4752)
@ -237,11 +238,11 @@ endif()
# allow 'large' files in 32 bit builds
if(UNIX)
add_definitions(-D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64
-D_LARGE_FILES
-D_FORTIFY_SOURCE=2
)
if(CMAKE_VERSION VERSION_GREATER 3.12.0)
add_compile_definitions(_LARGEFILE_SOURCE _FILE_OFFSET_BITS=64 _LARGE_FILES)
else()
add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES)
endif()
endif()
@ -257,7 +258,7 @@ endif()
# cpu_features - sensible defaults, user settable option
if(CMAKE_SYSTEM_PROCESSOR MATCHES
"(^mips)|(^arm)|(^aarch64)|(x86_64)|(AMD64|amd64)|(^i.86$)|(^powerpc)|(^ppc)")
"(^mips)|(^arm)|(^aarch64)|(x86_64)|(AMD64|amd64)|(^i.86$)|(^powerpc)|(^ppc)|(^s390x)")
option(VOLK_CPU_FEATURES "volk-gnsssdr uses cpu_features" ON)
else()
option(VOLK_CPU_FEATURES "volk-gnsssdr uses cpu_features" OFF)
@ -319,7 +320,11 @@ if(MSVC)
endif()
set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking")
if(BOOST_ALL_DYN_LINK)
add_definitions(-DBOOST_ALL_DYN_LINK) # setup boost auto-linking in msvc
if(CMAKE_VERSION VERSION_GREATER 3.12.0)
add_compile_definitions(BOOST_ALL_DYN_LINK) # enables math constants on all supported versions of MSVC
else()
add_definitions(-DBOOST_ALL_DYN_LINK) # setup boost auto-linking in msvc
endif()
else()
unset(BOOST_REQUIRED_COMPONENTS) # empty components list for static link
endif()

View File

@ -57,7 +57,6 @@ if(NOT FILESYSTEM_FOUND)
target_link_libraries(volk_gnsssdr_profile PRIVATE ${Boost_LIBRARIES})
endif()
if(FILESYSTEM_FOUND)
add_definitions(-DHAS_STD_FILESYSTEM=1)
if(${find_experimental})
@ -70,10 +69,8 @@ if(ENABLE_STATIC_LIBS)
target_link_libraries(volk_gnsssdr_profile PRIVATE volk_gnsssdr_static ${orc_lib})
else()
target_link_libraries(volk_gnsssdr_profile PRIVATE volk_gnsssdr ${orc_lib})
add_dependencies(volk_gnsssdr_profile volk_gnsssdr)
endif()
if(ENABLE_STRIP)
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
set_target_properties(volk_gnsssdr_profile
@ -82,23 +79,19 @@ if(ENABLE_STRIP)
endif()
endif()
install(
TARGETS volk_gnsssdr_profile
DESTINATION bin
COMPONENT "volk_gnsssdr"
)
# MAKE volk_gnsssdr-config-info
add_executable(volk_gnsssdr-config-info volk_gnsssdr-config-info.cc ${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr_option_helpers.cc)
if(ENABLE_STATIC_LIBS)
target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr_static ${orc_lib})
else()
target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${orc_lib})
add_dependencies(volk_gnsssdr-config-info volk_gnsssdr)
endif()
if(ENABLE_STRIP)
@ -115,7 +108,6 @@ install(
COMPONENT "volk_gnsssdr"
)
# Launch volk_gnsssdr_profile if requested to do so
if(ENABLE_PROFILING)
if(DEFINED VOLK_CONFIGPATH)

View File

@ -112,7 +112,18 @@ endif()
# Sets the python installation directory VOLK_PYTHON_DIR
########################################################################
if(NOT DEFINED VOLK_PYTHON_DIR)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
if(PYTHON_VERSION_STRING VERSION_GREATER "3.9.99")
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
import os
import sys
if os.name == 'posix':
print(os.path.join('lib', 'python' + sys.version[:4], 'dist-packages'))
if os.name == 'nt':
print(os.path.join('Lib', 'site-packages'))
" OUTPUT_VARIABLE VOLK_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
import os
import sys
if os.name == 'posix':
@ -120,7 +131,8 @@ if os.name == 'posix':
if os.name == 'nt':
print(os.path.join('Lib', 'site-packages'))
" OUTPUT_VARIABLE VOLK_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
)
)
endif()
endif()
file(TO_CMAKE_PATH ${VOLK_PYTHON_DIR} VOLK_PYTHON_DIR)

View File

@ -55,6 +55,7 @@ set(PROCESSOR_IS_ARM FALSE)
set(PROCESSOR_IS_AARCH64 FALSE)
set(PROCESSOR_IS_X86 FALSE)
set(PROCESSOR_IS_POWER FALSE)
set(PROCESSOR_IS_S390X FALSE)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
set(PROCESSOR_IS_MIPS TRUE)
@ -66,6 +67,8 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(AMD64|amd64)|(^i.86$)")
set(PROCESSOR_IS_X86 TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
set(PROCESSOR_IS_POWER TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x)")
set(PROCESSOR_IS_S390X TRUE)
endif()
macro(add_cpu_features_headers_and_sources HDRS_LIST_NAME SRCS_LIST_NAME)
@ -85,6 +88,8 @@ macro(add_cpu_features_headers_and_sources HDRS_LIST_NAME SRCS_LIST_NAME)
list(APPEND ${SRCS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/internal/windows_utils.h)
elseif(PROCESSOR_IS_POWER)
list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_ppc.h)
elseif(PROCESSOR_IS_S390X)
list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_s390x.h)
else()
message(FATAL_ERROR "Unsupported architectures ${CMAKE_SYSTEM_PROCESSOR}")
endif()
@ -211,8 +216,8 @@ if(BUILD_TESTING)
# Add googletest directly to our build. This defines the gtest and
# gtest_main targets.
add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
${CMAKE_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)
${CMAKE_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)
endif()
add_subdirectory(test)

View File

@ -158,14 +158,14 @@ flags : aes,avx,cx16,smx,sse4_1,sse4_2,ssse3
## What's supported
| | x86³ | ARM | AArch64 | MIPS⁴ | POWER |
| ------- | :--: | :-----: | :-----: | :-----: | :-----: |
| Android | yes² | yes¹ | yes¹ | yes¹ | N/A |
| iOS | N/A | not yet | not yet | N/A | N/A |
| Linux | yes² | yes¹ | yes¹ | yes¹ | yes¹ |
| MacOS | yes² | N/A | yes² | N/A | no |
| Windows | yes² | not yet | not yet | N/A | N/A |
| FreeBSD | yes² | not yet | not yet | not yet | not yet |
| | x86³ | AArch64 | ARM | MIPS⁴ | s390x | POWER |
| ------- | :--: | :-----: | :-----: | :-----: | :-----: | :-----: |
| Linux | yes² | yes¹ | yes¹ | yes¹ | yes¹ | yes¹ |
| FreeBSD | yes² | not yet | not yet | not yet | not yet | not yet |
| MacOs | yes² | not yet | N/A | N/A | no | no |
| Windows | yes² | not yet | not yet | N/A | N/A | N/A |
| Android | yes² | yes¹ | yes¹ | yes¹ | N/A | N/A |
| iOS | N/A | not yet | not yet | N/A | N/A | N/A |
1. **Features revealed from Linux.** We gather data from several sources
depending on availability:

View File

@ -56,6 +56,10 @@
#define CPU_FEATURES_ARCH_RISCV
#endif
#if defined(__s390x__)
#define CPU_FEATURES_ARCH_S390X
#endif
#if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 32
#define CPU_FEATURES_ARCH_RISCV32
#endif

View File

@ -0,0 +1,102 @@
// SPDX-FileCopyrightText: 2022 IBM
// SPDX-License-Identifier: Apache-2.0
#ifndef CPU_FEATURES_INCLUDE_CPUINFO_S390X_H_
#define CPU_FEATURES_INCLUDE_CPUINFO_S390X_H_
#include "cpu_features_cache_info.h"
#include "cpu_features_macros.h"
CPU_FEATURES_START_CPP_NAMESPACE
typedef struct
{
int esan3 : 1; // instructions named N3, "backported" to esa-mode
int zarch : 1; // z/Architecture mode active
int stfle : 1; // store-facility-list-extended
int msa : 1; // message-security assist
int ldisp : 1; // long-displacement
int eimm : 1; // extended-immediate
int dfp : 1; // decimal floating point & perform floating point operation
int edat : 1; // huge page support
int etf3eh : 1; // extended-translation facility 3 enhancement
int highgprs : 1; // 64-bit register support for 31-bit processes
int te : 1; // transactional execution
int vx : 1; // vector extension facility
int vxd : 1; // vector-packed-decimal facility
int vxe : 1; // vector-enhancement facility 1
int gs : 1; // guarded-storage facility
int vxe2 : 1; // vector-enhancements facility 2
int vxp : 1; // vector-packed-decimal-enhancement facility
int sort : 1; // enhanced-sort facility
int dflt : 1; // deflate-conversion facility
int vxp2 : 1; // vector-packed-decimal-enhancement facility 2
int nnpa : 1; // neural network processing assist facility
int pcimio : 1; // PCI mio facility
int sie : 1; // virtualization support
// Make sure to update S390XFeaturesEnum below if you add a field here.
} S390XFeatures;
typedef struct
{
S390XFeatures features;
} S390XInfo;
S390XInfo GetS390XInfo(void);
typedef struct
{
char platform[64]; // 0 terminated string
} S390XPlatformTypeStrings;
typedef struct
{
int num_processors; // -1 if N/A
S390XPlatformTypeStrings type;
} S390XPlatformStrings;
S390XPlatformStrings GetS390XPlatformStrings(void);
////////////////////////////////////////////////////////////////////////////////
// Introspection functions
typedef enum
{
S390_ESAN3,
S390_ZARCH,
S390_STFLE,
S390_MSA,
S390_LDISP,
S390_EIMM,
S390_DFP,
S390_EDAT,
S390_ETF3EH,
S390_HIGHGPRS,
S390_TE,
S390_VX,
S390_VXD,
S390_VXE,
S390_GS,
S390_VXE2,
S390_VXP,
S390_SORT,
S390_DFLT,
S390_VXP2,
S390_NNPA,
S390_PCIMIO,
S390_SIE,
S390X_LAST_,
} S390XFeaturesEnum;
int GetS390XFeaturesEnumValue(const S390XFeatures* features, S390XFeaturesEnum value);
const char* GetS390XFeaturesEnumName(S390XFeaturesEnum);
CPU_FEATURES_END_CPP_NAMESPACE
#if !defined(CPU_FEATURES_ARCH_S390X)
#error "Including cpuinfo_s390x.h from a non-s390x target."
#endif
#endif // CPU_FEATURES_INCLUDE_CPUINFO_S390X_H_

View File

@ -49,6 +49,7 @@ typedef struct
int sse4a : 1;
int avx : 1;
int avx_vnni : 1;
int avx2 : 1;
int avx512f : 1;
@ -70,6 +71,7 @@ typedef struct
int avx512_4fmaps : 1;
int avx512_bf16 : 1;
int avx512_vp2intersect : 1;
int avx512_fp16 : 1;
int amx_bf16 : 1;
int amx_tile : 1;
int amx_int8 : 1;
@ -86,7 +88,15 @@ typedef struct
int dca : 1;
int ss : 1;
int adx : 1;
// Make sure to update X86FeaturesEnum below if you add a field here.
int lzcnt : 1; // Note: this flag is called ABM for AMD, LZCNT for Intel.
int gfni : 1;
int movdiri : 1;
int movdir64b : 1;
int fs_rep_mov : 1; // Fast short REP MOV
int fz_rep_movsb : 1; // Fast zero-length REP MOVSB
int fs_rep_stosb : 1; // Fast short REP STOSB
int fs_rep_cmpsb_scasb : 1; // Fast short REP CMPSB/SCASB
// Make sure to update X86FeaturesEnum below if you add a field here.
} X86Features;
typedef struct
@ -110,56 +120,60 @@ CacheInfo GetX86CacheInfo(void);
typedef enum
{
X86_UNKNOWN,
ZHAOXIN_ZHANGJIANG, // ZhangJiang
ZHAOXIN_WUDAOKOU, // WuDaoKou
ZHAOXIN_LUJIAZUI, // LuJiaZui
ZHAOXIN_YONGFENG, // YongFeng
INTEL_80486, // 80486
INTEL_P5, // P5
INTEL_LAKEMONT, // LAKEMONT
INTEL_CORE, // CORE
INTEL_PNR, // PENRYN
INTEL_NHM, // NEHALEM
INTEL_ATOM_BNL, // BONNELL
INTEL_WSM, // WESTMERE
INTEL_SNB, // SANDYBRIDGE
INTEL_IVB, // IVYBRIDGE
INTEL_ATOM_SMT, // SILVERMONT
INTEL_HSW, // HASWELL
INTEL_BDW, // BROADWELL
INTEL_SKL, // SKYLAKE
INTEL_ATOM_GMT, // GOLDMONT
INTEL_KBL, // KABY LAKE
INTEL_CFL, // COFFEE LAKE
INTEL_WHL, // WHISKEY LAKE
INTEL_CML, // COMET LAKE
INTEL_CNL, // CANNON LAKE
INTEL_ICL, // ICE LAKE
INTEL_TGL, // TIGER LAKE
INTEL_SPR, // SAPPHIRE RAPIDS
INTEL_ADL, // ALDER LAKE
INTEL_RCL, // ROCKET LAKE
INTEL_KNIGHTS_M, // KNIGHTS MILL
INTEL_KNIGHTS_L, // KNIGHTS LANDING
INTEL_KNIGHTS_F, // KNIGHTS FERRY
INTEL_KNIGHTS_C, // KNIGHTS CORNER
INTEL_NETBURST, // NETBURST
AMD_HAMMER, // K8 HAMMER
AMD_K10, // K10
AMD_K11, // K11
AMD_K12, // K12
AMD_BOBCAT, // K14 BOBCAT
AMD_PILEDRIVER, // K15 PILEDRIVER
AMD_STREAMROLLER, // K15 STREAMROLLER
AMD_EXCAVATOR, // K15 EXCAVATOR
AMD_BULLDOZER, // K15 BULLDOZER
AMD_JAGUAR, // K16 JAGUAR
AMD_PUMA, // K16 PUMA
AMD_ZEN, // K17 ZEN
AMD_ZEN_PLUS, // K17 ZEN+
AMD_ZEN2, // K17 ZEN 2
AMD_ZEN3, // K19 ZEN 3
AMD_ZEN4, // K19 ZEN 4
ZHAOXIN_ZHANGJIANG, // ZhangJiang
ZHAOXIN_WUDAOKOU, // WuDaoKou
ZHAOXIN_LUJIAZUI, // LuJiaZui
ZHAOXIN_YONGFENG, // YongFeng
INTEL_80486, // 80486
INTEL_P5, // P5
INTEL_LAKEMONT, // LAKEMONT
INTEL_CORE, // CORE
INTEL_PNR, // PENRYN
INTEL_NHM, // NEHALEM
INTEL_ATOM_BNL, // BONNELL
INTEL_WSM, // WESTMERE
INTEL_SNB, // SANDYBRIDGE
INTEL_IVB, // IVYBRIDGE
INTEL_ATOM_SMT, // SILVERMONT
INTEL_HSW, // HASWELL
INTEL_BDW, // BROADWELL
INTEL_SKL, // SKYLAKE
INTEL_CCL, // CASCADELAKE
INTEL_ATOM_GMT, // GOLDMONT
INTEL_ATOM_GMT_PLUS, // GOLDMONT+
INTEL_ATOM_TMT, // TREMONT
INTEL_KBL, // KABY LAKE
INTEL_CFL, // COFFEE LAKE
INTEL_WHL, // WHISKEY LAKE
INTEL_CML, // COMET LAKE
INTEL_CNL, // CANNON LAKE
INTEL_ICL, // ICE LAKE
INTEL_TGL, // TIGER LAKE
INTEL_SPR, // SAPPHIRE RAPIDS
INTEL_ADL, // ALDER LAKE
INTEL_RCL, // ROCKET LAKE
INTEL_RPL, // RAPTOR LAKE
INTEL_KNIGHTS_M, // KNIGHTS MILL
INTEL_KNIGHTS_L, // KNIGHTS LANDING
INTEL_KNIGHTS_F, // KNIGHTS FERRY
INTEL_KNIGHTS_C, // KNIGHTS CORNER
INTEL_NETBURST, // NETBURST
AMD_HAMMER, // K8 HAMMER
AMD_K10, // K10
AMD_K11, // K11
AMD_K12, // K12 LLANO
AMD_BOBCAT, // K14 BOBCAT
AMD_PILEDRIVER, // K15 PILEDRIVER
AMD_STREAMROLLER, // K15 STREAMROLLER
AMD_EXCAVATOR, // K15 EXCAVATOR
AMD_BULLDOZER, // K15 BULLDOZER
AMD_JAGUAR, // K16 JAGUAR
AMD_PUMA, // K16 PUMA
AMD_ZEN, // K17 ZEN
AMD_ZEN_PLUS, // K17 ZEN+
AMD_ZEN2, // K17 ZEN 2
AMD_ZEN3, // K19 ZEN 3
AMD_ZEN4, // K19 ZEN 4
X86_MICROARCHITECTURE_LAST_,
} X86Microarchitecture;
@ -205,6 +219,7 @@ typedef enum
X86_SSE4_2,
X86_SSE4A,
X86_AVX,
X86_AVX_VNNI,
X86_AVX2,
X86_AVX512F,
X86_AVX512CD,
@ -225,6 +240,7 @@ typedef enum
X86_AVX512_4FMAPS,
X86_AVX512_BF16,
X86_AVX512_VP2INTERSECT,
X86_AVX512_FP16,
X86_AMX_BF16,
X86_AMX_TILE,
X86_AMX_INT8,
@ -239,6 +255,14 @@ typedef enum
X86_DCA,
X86_SS,
X86_ADX,
X86_LZCNT,
X86_GFNI,
X86_MOVDIRI,
X86_MOVDIR64B,
X86_FS_REP_MOV,
X86_FZ_REP_MOVSB,
X86_FS_REP_STOSB,
X86_FS_REP_CMPSB_SCASB,
X86_LAST_,
} X86FeaturesEnum;
@ -254,4 +278,4 @@ CPU_FEATURES_END_CPP_NAMESPACE
#error "Including cpuinfo_x86.h from a non-x86 target."
#endif
#endif // CPU_FEATURES_INCLUDE_CPUINFO_X86_H_
#endif // CPU_FEATURES_INCLUDE_CPUINFO_X86_H_

View File

@ -164,6 +164,34 @@ CPU_FEATURES_START_CPP_NAMESPACE
#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000
#endif
// https://elixir.bootlin.com/linux/v6.0-rc6/source/arch/s390/include/asm/elf.h
#define HWCAP_S390_ESAN3 1
#define HWCAP_S390_ZARCH 2
#define HWCAP_S390_STFLE 4
#define HWCAP_S390_MSA 8
#define HWCAP_S390_LDISP 16
#define HWCAP_S390_EIMM 32
#define HWCAP_S390_DFP 64
#define HWCAP_S390_HPAGE 128
#define HWCAP_S390_ETF3EH 256
#define HWCAP_S390_HIGH_GPRS 512
#define HWCAP_S390_TE 1024
#define HWCAP_S390_VX 2048
#define HWCAP_S390_VXRS HWCAP_S390_VX
#define HWCAP_S390_VXD 4096
#define HWCAP_S390_VXRS_BCD HWCAP_S390_VXD
#define HWCAP_S390_VXE 8192
#define HWCAP_S390_VXRS_EXT HWCAP_S390_VXE
#define HWCAP_S390_GS 16384
#define HWCAP_S390_VXRS_EXT2 32768
#define HWCAP_S390_VXRS_PDE 65536
#define HWCAP_S390_SORT 131072
#define HWCAP_S390_DFLT 262144
#define HWCAP_S390_VXRS_PDE2 524288
#define HWCAP_S390_NNPA 1048576
#define HWCAP_S390_PCI_MIO 2097152
#define HWCAP_S390_SIE 4194304
// https://elixir.bootlin.com/linux/latest/source/arch/riscv/include/uapi/asm/hwcap.h
#define RISCV_HWCAP_A (1UL << ('A' - 'A'))
#define RISCV_HWCAP_C (1UL << ('C' - 'A'))

View File

@ -3,6 +3,10 @@
#ifndef CPU_FEATURES_INCLUDE_INTERNAL_WINDOWS_UTILS_H_
#define CPU_FEATURES_INCLUDE_INTERNAL_WINDOWS_UTILS_H_
#include "cpu_features_macros.h"
#ifdef CPU_FEATURES_OS_WINDOWS
#include <windows.h> // IsProcessorFeaturePresent
// modern WinSDK winnt.h contains newer features detection definitions
@ -18,4 +22,5 @@
#define PF_SSE4_2_INSTRUCTIONS_AVAILABLE 38
#endif
#endif // CPU_FEATURES_OS_WINDOWS
#endif // CPU_FEATURES_INCLUDE_INTERNAL_WINDOWS_UTILS_H_

View File

@ -58,6 +58,7 @@
LINE(PPC_SCV, scv, "scv", 0, PPC_FEATURE2_SCV) \
LINE(PPC_HTM_NO_SUSPEND, htm_no_suspend, "htm-no-suspend", 0, \
PPC_FEATURE2_HTM_NO_SUSPEND)
#undef PPC // Remove conflict with compiler generated preprocessor
#define INTROSPECTION_PREFIX PPC
#define INTROSPECTION_ENUM_PREFIX PPC
#include "define_introspection_and_hwcaps.inl"

View File

@ -0,0 +1,119 @@
// SPDX-FileCopyrightText: 2022 IBM
// SPDX-License-Identifier: Apache-2.0
#include "cpu_features_macros.h"
#ifdef CPU_FEATURES_ARCH_S390X
#ifdef CPU_FEATURES_OS_LINUX
#include "cpuinfo_s390x.h"
////////////////////////////////////////////////////////////////////////////////
// Definitions for introspection.
////////////////////////////////////////////////////////////////////////////////
#define INTROSPECTION_TABLE \
LINE(S390_ESAN3, esan3, "esan3", HWCAP_S390_ESAN3, 0) \
LINE(S390_ZARCH, zarch, "zarch", HWCAP_S390_ZARCH, 0) \
LINE(S390_STFLE, stfle, "stfle", HWCAP_S390_STFLE, 0) \
LINE(S390_MSA, msa, "msa", HWCAP_S390_MSA, 0) \
LINE(S390_LDISP, ldisp, "ldisp", HWCAP_S390_LDISP, 0) \
LINE(S390_EIMM, eimm, "eimm", HWCAP_S390_EIMM, 0) \
LINE(S390_DFP, dfp, "dfp", HWCAP_S390_DFP, 0) \
LINE(S390_EDAT, edat, "edat", HWCAP_S390_HPAGE, 0) \
LINE(S390_ETF3EH, etf3eh, "etf3eh", HWCAP_S390_ETF3EH, 0) \
LINE(S390_HIGHGPRS, highgprs, "highgprs", HWCAP_S390_HIGH_GPRS, 0) \
LINE(S390_TE, te, "te", HWCAP_S390_TE, 0) \
LINE(S390_VX, vx, "vx", HWCAP_S390_VXRS, 0) \
LINE(S390_VXD, vxd, "vxd", HWCAP_S390_VXRS_BCD, 0) \
LINE(S390_VXE, vxe, "vxe", HWCAP_S390_VXRS_EXT, 0) \
LINE(S390_GS, gs, "gs", HWCAP_S390_GS, 0) \
LINE(S390_VXE2, vxe2, "vxe2", HWCAP_S390_VXRS_EXT2, 0) \
LINE(S390_VXP, vxp, "vxp", HWCAP_S390_VXRS_PDE, 0) \
LINE(S390_SORT, sort, "sort", HWCAP_S390_SORT, 0) \
LINE(S390_DFLT, dflt, "dflt", HWCAP_S390_DFLT, 0) \
LINE(S390_VXP2, vxp2, "vxp2", HWCAP_S390_VXRS_PDE2, 0) \
LINE(S390_NNPA, nnpa, "nnpa", HWCAP_S390_NNPA, 0) \
LINE(S390_PCIMIO, pcimio, "pcimio", HWCAP_S390_PCI_MIO, 0) \
LINE(S390_SIE, sie, "sie", HWCAP_S390_SIE, 0)
#define INTROSPECTION_PREFIX S390X
#define INTROSPECTION_ENUM_PREFIX S390X
#include "define_introspection_and_hwcaps.inl"
////////////////////////////////////////////////////////////////////////////////
// Implementation.
////////////////////////////////////////////////////////////////////////////////
#include "internal/bit_utils.h"
#include "internal/filesystem.h"
#include "internal/hwcaps.h"
#include "internal/stack_line_reader.h"
#include "internal/string_view.h"
#include <stdbool.h>
static bool HandleS390XLine(const LineResult result,
S390XPlatformStrings* const strings)
{
StringView line = result.line;
StringView key, value;
if (CpuFeatures_StringView_GetAttributeKeyValue(line, &key, &value))
{
if (CpuFeatures_StringView_IsEquals(key, str("# processors")))
{
strings->num_processors = CpuFeatures_StringView_ParsePositiveNumber(value);
}
}
return !result.eof;
}
static void FillProcCpuInfoData(S390XPlatformStrings* const strings)
{
const int fd = CpuFeatures_OpenFile("/proc/cpuinfo");
if (fd >= 0)
{
StackLineReader reader;
StackLineReader_Initialize(&reader, fd);
for (;;)
{
if (!HandleS390XLine(StackLineReader_NextLine(&reader), strings))
{
break;
}
}
CpuFeatures_CloseFile(fd);
}
}
static const S390XInfo kEmptyS390XInfo;
S390XInfo GetS390XInfo(void)
{
S390XInfo info = kEmptyS390XInfo;
const HardwareCapabilities hwcaps = CpuFeatures_GetHardwareCapabilities();
for (size_t i = 0; i < S390X_LAST_; ++i)
{
if (CpuFeatures_IsHwCapsSet(kHardwareCapabilities[i], hwcaps))
{
kSetters[i](&info.features, true);
}
}
return info;
}
static const S390XPlatformStrings kEmptyS390XPlatformStrings;
S390XPlatformStrings GetS390XPlatformStrings(void)
{
S390XPlatformStrings strings = kEmptyS390XPlatformStrings;
const char* platform = CpuFeatures_GetPlatformPointer();
FillProcCpuInfoData(&strings);
if (platform != NULL)
CpuFeatures_StringView_CopyString(str(platform), strings.type.platform,
sizeof(strings.type.platform));
return strings;
}
#endif // CPU_FEATURES_OS_LINUX
#endif // CPU_FEATURES_ARCH_S390X

View File

@ -266,6 +266,7 @@ static void ParseCpuId(const Leaves* leaves, X86Info* info,
const Leaf leaf_1 = leaves->leaf_1;
const Leaf leaf_7 = leaves->leaf_7;
const Leaf leaf_7_1 = leaves->leaf_7_1;
const Leaf leaf_80000001 = leaves->leaf_80000001;
const bool have_xsave = IsBitSet(leaf_1.ecx, 26);
const bool have_osxsave = IsBitSet(leaf_1.ecx, 27);
@ -321,9 +322,17 @@ static void ParseCpuId(const Leaves* leaves, X86Info* info,
features->clflushopt = IsBitSet(leaf_7.ebx, 23);
features->clwb = IsBitSet(leaf_7.ebx, 24);
features->sha = IsBitSet(leaf_7.ebx, 29);
features->gfni = IsBitSet(leaf_7.ecx, 8);
features->vaes = IsBitSet(leaf_7.ecx, 9);
features->vpclmulqdq = IsBitSet(leaf_7.ecx, 10);
features->movdiri = IsBitSet(leaf_7.ecx, 27);
features->movdir64b = IsBitSet(leaf_7.ecx, 28);
features->fs_rep_mov = IsBitSet(leaf_7.edx, 4);
features->fz_rep_movsb = IsBitSet(leaf_7_1.eax, 10);
features->fs_rep_stosb = IsBitSet(leaf_7_1.eax, 11);
features->fs_rep_cmpsb_scasb = IsBitSet(leaf_7_1.eax, 12);
features->adx = IsBitSet(leaf_7.ebx, 19);
features->lzcnt = IsBitSet(leaf_80000001.ecx, 5);
/////////////////////////////////////////////////////////////////////////////
// The following section is devoted to Vector Extensions.
@ -355,6 +364,7 @@ static void ParseCpuId(const Leaves* leaves, X86Info* info,
{
features->fma3 = IsBitSet(leaf_1.ecx, 12);
features->avx = IsBitSet(leaf_1.ecx, 28);
features->avx_vnni = IsBitSet(leaf_7_1.eax, 4);
features->avx2 = IsBitSet(leaf_7.ebx, 5);
}
if (os_preserves->avx512_registers)
@ -378,6 +388,7 @@ static void ParseCpuId(const Leaves* leaves, X86Info* info,
features->avx512_4fmaps = IsBitSet(leaf_7.edx, 3);
features->avx512_bf16 = IsBitSet(leaf_7_1.eax, 5);
features->avx512_vp2intersect = IsBitSet(leaf_7.edx, 8);
features->avx512_fp16 = IsBitSet(leaf_7.edx, 23);
}
if (os_preserves->amx_registers)
{
@ -491,6 +502,15 @@ X86Microarchitecture GetX86Microarchitecture(const X86Info* info)
case CPUID(0x06, 0x5C):
// https://en.wikipedia.org/wiki/Goldmont
return INTEL_ATOM_GMT;
case CPUID(0x06, 0x7A):
// https://en.wikichip.org/wiki/intel/microarchitectures/goldmont_plus
return INTEL_ATOM_GMT_PLUS;
case CPUID(0x06, 0x8A):
case CPUID(0x06, 0x96):
case CPUID(0x06, 0x9C):
// https://en.wikichip.org/wiki/intel/microarchitectures/tremont
return INTEL_ATOM_TMT;
case CPUID(0x06, 0x0E):
case CPUID(0x06, 0x0F):
case CPUID(0x06, 0x16):
// https://en.wikipedia.org/wiki/Intel_Core_(microarchitecture)
@ -531,10 +551,16 @@ X86Microarchitecture GetX86Microarchitecture(const X86Info* info)
// https://en.wikipedia.org/wiki/Broadwell_(microarchitecture)
return INTEL_BDW;
case CPUID(0x06, 0x4E):
case CPUID(0x06, 0x55):
case CPUID(0x06, 0x5E):
// https://en.wikipedia.org/wiki/Skylake_(microarchitecture)
return INTEL_SKL;
case CPUID(0x06, 0x55):
if (info->stepping >= 6 && info->stepping <= 7)
{
// https://en.wikipedia.org/wiki/Cascade_Lake_(microprocessor)
return INTEL_CCL;
}
return INTEL_SKL;
case CPUID(0x06, 0x66):
// https://en.wikipedia.org/wiki/Cannon_Lake_(microarchitecture)
return INTEL_CNL;
@ -582,11 +608,15 @@ X86Microarchitecture GetX86Microarchitecture(const X86Info* info)
// https://en.wikichip.org/wiki/intel/microarchitectures/alder_lake
return INTEL_ADL;
case CPUID(0x06, 0xA5):
case CPUID(0x06, 0xA6):
// https://en.wikichip.org/wiki/intel/microarchitectures/comet_lake
return INTEL_CML;
case CPUID(0x06, 0xA7):
// https://en.wikichip.org/wiki/intel/microarchitectures/rocket_lake
return INTEL_RCL;
case CPUID(0x06, 0xB7):
// https://en.wikichip.org/wiki/intel/microarchitectures/raptor_lake
return INTEL_RPL;
case CPUID(0x06, 0x85):
// https://en.wikichip.org/wiki/intel/microarchitectures/knights_mill
return INTEL_KNIGHTS_M;
@ -702,6 +732,7 @@ X86Microarchitecture GetX86Microarchitecture(const X86Info* info)
case CPUID(0x11, 0x03):
// http://developer.amd.com/wordpress/media/2012/10/41788.pdf
return AMD_K11;
case CPUID(0x12, 0x00):
case CPUID(0x12, 0x01):
// https://www.amd.com/system/files/TechDocs/44739_12h_Rev_Gd.pdf
return AMD_K12;
@ -714,9 +745,11 @@ X86Microarchitecture GetX86Microarchitecture(const X86Info* info)
// https://en.wikichip.org/wiki/amd/microarchitectures/bulldozer
return AMD_BULLDOZER;
case CPUID(0x15, 0x02):
case CPUID(0x15, 0x10):
case CPUID(0x15, 0x11):
case CPUID(0x15, 0x13):
// https://en.wikichip.org/wiki/amd/microarchitectures/piledriver
// https://www.amd.com/system/files/TechDocs/48931_15h_Mod_10h-1Fh_Rev_Guide.pdf
return AMD_PILEDRIVER;
case CPUID(0x15, 0x30):
case CPUID(0x15, 0x38):
@ -728,6 +761,7 @@ X86Microarchitecture GetX86Microarchitecture(const X86Info* info)
// https://en.wikichip.org/wiki/amd/microarchitectures/excavator
return AMD_EXCAVATOR;
case CPUID(0x16, 0x00):
case CPUID(0x16, 0x26):
return AMD_JAGUAR;
case CPUID(0x16, 0x30):
return AMD_PUMA;
@ -760,6 +794,7 @@ X86Microarchitecture GetX86Microarchitecture(const X86Info* info)
// https://en.wikichip.org/wiki/amd/microarchitectures/zen_3
return AMD_ZEN3;
case CPUID(0x19, 0x10):
case CPUID(0x19, 0x61):
// https://en.wikichip.org/wiki/amd/microarchitectures/zen_4
return AMD_ZEN4;
default:
@ -1687,16 +1722,18 @@ static void ParseCacheInfo(const int max_cpuid_leaf, uint32_t leaf_id,
const Leaf leaf = SafeCpuIdEx(max_cpuid_leaf, leaf_id, index);
int cache_type_field = ExtractBitRange(leaf.eax, 4, 0);
CacheType cache_type;
if (cache_type_field == 0)
break;
else if (cache_type_field == 1)
if (cache_type_field == 1)
cache_type = CPU_FEATURE_CACHE_DATA;
else if (cache_type_field == 2)
cache_type = CPU_FEATURE_CACHE_INSTRUCTION;
else if (cache_type_field == 3)
cache_type = CPU_FEATURE_CACHE_UNIFIED;
else
break; // Should not occur as per documentation.
// Intel Processor Identification and the CPUID Instruction Application
// Note 485 page 37 Table 5-10. Deterministic Cache Parameters.
// We skip cache parsing in case null of cache type or cache type in the
// range of 4-31 according to documentation.
break;
int level = ExtractBitRange(leaf.eax, 7, 5);
int line_size = ExtractBitRange(leaf.ebx, 11, 0) + 1;
int partitioning = ExtractBitRange(leaf.ebx, 21, 12) + 1;
@ -1717,6 +1754,123 @@ static void ParseCacheInfo(const int max_cpuid_leaf, uint32_t leaf_id,
if (info.size > 0) *old_info = info;
}
typedef struct
{
int level;
int cache_id;
CacheType cache_type;
} CacheLevelInfoLegacyAMD;
static int GetWaysLegacyAMD(int cache_level, const uint32_t cache_id)
{
// https://www.amd.com/system/files/TechDocs/25481.pdf page 23
// CPUID.8000_0005_ECX[23:16] L1 data cache associativity.
// CPUID.8000_0005_EDX[23:16] L1 instruction cache associativity.
if (cache_level == 1)
{
return ExtractBitRange(cache_id, 23, 16);
}
// https://www.amd.com/system/files/TechDocs/25481.pdf page 24
// See Table 4: L2/L3 Cache and TLB Associativity Field Definition.
// CPUID.8000_0006_ECX[15:12] L2 cache associativity.
// CPUID.8000_0006_EDX[15:12] L3 cache associativity.
const int ways = ExtractBitRange(cache_id, 15, 12);
switch (ways)
{
case 0x0:
case 0x1:
case 0x2:
case 0x4:
return ways;
case 0x6:
return 8;
case 0x8:
return 16;
case 0xA:
return 32;
case 0xB:
return 48;
case 0xC:
return 64;
case 0xD:
return 96;
case 0xE:
return 128;
case 0xF:
return 255;
default:
return -1; // Reserved
}
}
static int GetCacheSizeLegacyAMD(int cache_level, const uint32_t cache_id)
{
switch (cache_level)
{
case 1:
// https://www.amd.com/system/files/TechDocs/25481.pdf page 23
// CPUID.8000_0005_ECX[31:24] L1 data cache size in KB.
// CPUID.8000_0005_EDX[31:24] L1 instruction cache size KB.
return ExtractBitRange(cache_id, 31, 24);
case 2:
// https://www.amd.com/system/files/TechDocs/25481.pdf page 25
// CPUID.8000_0006_ECX[31:16] L2 cache size in KB.
return ExtractBitRange(cache_id, 31, 16);
case 3:
// https://www.amd.com/system/files/TechDocs/25481.pdf page 25
// CPUID.8000_0006_EDX[31:18] L3 cache size.
// Specifies the L3 cache size is within the following range:
// (L3Size[31:18] * 512KB) <= L3 cache size < ((L3Size[31:18]+1) * 512KB).
return ExtractBitRange(cache_id, 31, 18) * 512;
default:
return 0;
}
}
#define LEGACY_AMD_MAX_CACHE_LEVEL 4
// https://www.amd.com/system/files/TechDocs/25481.pdf
// CPUID Fn8000_0005_E[A,B,C,D]X, Fn8000_0006_E[A,B,C,D]X - TLB and Cache info
static void ParseCacheInfoLegacyAMD(const uint32_t max_ext, CacheInfo* info)
{
const Leaf cache_tlb_leaf1 = SafeCpuIdEx(max_ext, 0x80000005, 0);
const Leaf cache_tlb_leaf2 = SafeCpuIdEx(max_ext, 0x80000006, 0);
const CacheLevelInfoLegacyAMD legacy_cache_info[LEGACY_AMD_MAX_CACHE_LEVEL] =
{(CacheLevelInfoLegacyAMD){.cache_id = cache_tlb_leaf1.ecx,
.cache_type = CPU_FEATURE_CACHE_DATA,
.level = 1},
(CacheLevelInfoLegacyAMD){.cache_id = cache_tlb_leaf1.edx,
.cache_type = CPU_FEATURE_CACHE_INSTRUCTION,
.level = 1},
(CacheLevelInfoLegacyAMD){.cache_id = cache_tlb_leaf2.ecx,
.cache_type = CPU_FEATURE_CACHE_UNIFIED,
.level = 2},
(CacheLevelInfoLegacyAMD){.cache_id = cache_tlb_leaf2.edx,
.cache_type = CPU_FEATURE_CACHE_UNIFIED,
.level = 3}};
const int KiB = 1024;
const int UNDEF = -1;
for (int i = 0; i < LEGACY_AMD_MAX_CACHE_LEVEL; ++i)
{
const int level = legacy_cache_info[i].level;
const int cache_id = legacy_cache_info[i].cache_id;
const CacheType cache_type = legacy_cache_info[i].cache_type;
const int cache_size = GetCacheSizeLegacyAMD(level, cache_id);
if (cache_size == 0) break;
info->levels[i] =
(CacheLevelInfo){.level = level,
.cache_type = cache_type,
.cache_size = cache_size * KiB,
.ways = GetWaysLegacyAMD(level, cache_id),
.line_size = ExtractBitRange(cache_id, 7, 0),
.tlb_entries = UNDEF,
.partitioning = UNDEF};
++info->size;
}
}
CacheInfo GetX86CacheInfo(void)
{
CacheInfo info = kEmptyCacheInfo;
@ -1738,6 +1892,10 @@ CacheInfo GetX86CacheInfo(void)
{
ParseCacheInfo(leaves.max_cpuid_leaf_ext, 0x8000001D, &info);
}
else
{
ParseCacheInfoLegacyAMD(leaves.max_cpuid_leaf_ext, &info);
}
}
return info;
}
@ -1773,6 +1931,7 @@ CacheInfo GetX86CacheInfo(void)
LINE(X86_SSE4_2, sse4_2, , , ) \
LINE(X86_SSE4A, sse4a, , , ) \
LINE(X86_AVX, avx, , , ) \
LINE(X86_AVX_VNNI, avx_vnni, , , ) \
LINE(X86_AVX2, avx2, , , ) \
LINE(X86_AVX512F, avx512f, , , ) \
LINE(X86_AVX512CD, avx512cd, , , ) \
@ -1793,6 +1952,7 @@ CacheInfo GetX86CacheInfo(void)
LINE(X86_AVX512_4FMAPS, avx512_4fmaps, , , ) \
LINE(X86_AVX512_BF16, avx512_bf16, , , ) \
LINE(X86_AVX512_VP2INTERSECT, avx512_vp2intersect, , , ) \
LINE(X86_AVX512_FP16, avx512_fp16, , , ) \
LINE(X86_AMX_BF16, amx_bf16, , , ) \
LINE(X86_AMX_TILE, amx_tile, , , ) \
LINE(X86_AMX_INT8, amx_int8, , , ) \
@ -1806,7 +1966,15 @@ CacheInfo GetX86CacheInfo(void)
LINE(X86_RDRND, rdrnd, , , ) \
LINE(X86_DCA, dca, , , ) \
LINE(X86_SS, ss, , , ) \
LINE(X86_ADX, adx, , , )
LINE(X86_ADX, adx, , , ) \
LINE(X86_LZCNT, lzcnt, , , ) \
LINE(X86_GFNI, gfni, , , ) \
LINE(X86_MOVDIRI, movdiri, , , ) \
LINE(X86_MOVDIR64B, movdir64b, , , ) \
LINE(X86_FS_REP_MOV, fs_rep_mov, , , ) \
LINE(X86_FZ_REP_MOVSB, fz_rep_movsb, , , ) \
LINE(X86_FS_REP_STOSB, fs_rep_stosb, , , ) \
LINE(X86_FS_REP_CMPSB_SCASB, fs_rep_cmpsb_scasb, , , )
#define INTROSPECTION_PREFIX X86
#define INTROSPECTION_ENUM_PREFIX X86
#include "define_introspection.inl"
@ -1831,7 +1999,10 @@ CacheInfo GetX86CacheInfo(void)
LINE(INTEL_HSW) \
LINE(INTEL_BDW) \
LINE(INTEL_SKL) \
LINE(INTEL_CCL) \
LINE(INTEL_ATOM_GMT) \
LINE(INTEL_ATOM_GMT_PLUS) \
LINE(INTEL_ATOM_TMT) \
LINE(INTEL_KBL) \
LINE(INTEL_CFL) \
LINE(INTEL_WHL) \
@ -1842,6 +2013,7 @@ CacheInfo GetX86CacheInfo(void)
LINE(INTEL_SPR) \
LINE(INTEL_ADL) \
LINE(INTEL_RCL) \
LINE(INTEL_RPL) \
LINE(INTEL_KNIGHTS_M) \
LINE(INTEL_KNIGHTS_L) \
LINE(INTEL_KNIGHTS_F) \

View File

@ -23,6 +23,8 @@
#include "cpuinfo_mips.h"
#elif defined(CPU_FEATURES_ARCH_PPC)
#include "cpuinfo_ppc.h"
#elif defined(CPU_FEATURES_ARCH_S390X)
#include "cpuinfo_s390x.h"
#endif
// Design principles
@ -212,6 +214,9 @@ DEFINE_ADD_FLAGS(GetMipsFeaturesEnumValue, GetMipsFeaturesEnumName,
#elif defined(CPU_FEATURES_ARCH_PPC)
DEFINE_ADD_FLAGS(GetPPCFeaturesEnumValue, GetPPCFeaturesEnumName, PPCFeatures,
PPC_LAST_)
#elif defined(CPU_FEATURES_ARCH_S390X)
DEFINE_ADD_FLAGS(GetS390XFeaturesEnumValue, GetS390XFeaturesEnumName, S390XFeatures,
S390X_LAST_)
#endif
// Prints a json string with characters escaping.
@ -389,7 +394,6 @@ static Node* CreateTree(void)
{
Node* root = CreateMap();
#if defined(CPU_FEATURES_ARCH_X86)
char brand_string[49];
const X86Info info = GetX86Info();
const CacheInfo cache_info = GetX86CacheInfo();
AddMapEntry(root, "arch", CreateString("x86"));
@ -435,6 +439,14 @@ static Node* CreateTree(void)
AddMapEntry(root, "microarchitecture",
CreateString(strings.type.base_platform));
AddFlags(root, &info.features);
#elif defined(CPU_FEATURES_ARCH_S390X)
const S390XInfo info = GetS390XInfo();
const S390XPlatformStrings strings = GetS390XPlatformStrings();
AddMapEntry(root, "arch", CreateString("s390x"));
AddMapEntry(root, "platform", CreateString("zSeries"));
AddMapEntry(root, "model", CreateString(strings.type.platform));
AddMapEntry(root, "# processors", CreateInt(strings.num_processors));
AddFlags(root, &info.features);
#endif
return root;
}

View File

@ -92,3 +92,10 @@ if(PROCESSOR_IS_POWER)
target_link_libraries(cpuinfo_ppc_test all_libraries)
add_test(NAME cpuinfo_ppc_test COMMAND cpuinfo_ppc_test)
endif()
##------------------------------------------------------------------------------
## cpuinfo_s390x_test
if(PROCESSOR_IS_S390X)
add_executable(cpuinfo_s390x_test cpuinfo_s390x_test.cc ../src/impl_s390x_linux.c)
target_link_libraries(cpuinfo_s390x_test all_libraries)
add_test(NAME cpuinfo_s390x_test COMMAND cpuinfo_s390x_test)
endif()

View File

@ -0,0 +1,79 @@
// SPDX-FileCopyrightText: 2022 IBM
// SPDX-License-Identifier: Apache-2.0
#include "cpuinfo_s390x.h"
#include "filesystem_for_testing.h"
#include "gtest/gtest.h"
#include "hwcaps_for_testing.h"
namespace cpu_features
{
namespace
{
TEST(CpustringsS390XTest, S390XFeaturesEnum)
{
const char* last_name = GetS390XFeaturesEnumName(S390X_LAST_);
EXPECT_STREQ(last_name, "unknown_feature");
for (int i = static_cast<int>(S390_ZARCH); i != static_cast<int>(S390X_LAST_); ++i)
{
const auto feature = static_cast<S390XFeaturesEnum>(i);
const char* name = GetS390XFeaturesEnumName(feature);
ASSERT_FALSE(name == nullptr);
EXPECT_STRNE(name, "");
EXPECT_STRNE(name, last_name);
}
}
TEST(CpustringsS390XTest, FromHardwareCap)
{
ResetHwcaps();
SetHardwareCapabilities(HWCAP_S390_ESAN3 | HWCAP_S390_HPAGE |
HWCAP_S390_NNPA | HWCAP_S390_SIE,
0);
GetEmptyFilesystem(); // disabling /proc/cpuinfo
const auto info = GetS390XInfo();
EXPECT_TRUE(info.features.esan3);
EXPECT_TRUE(info.features.edat);
EXPECT_TRUE(info.features.nnpa);
EXPECT_TRUE(info.features.sie);
EXPECT_FALSE(info.features.msa);
EXPECT_FALSE(info.features.stfle);
EXPECT_FALSE(info.features.vxp2);
EXPECT_FALSE(info.features.pcimio);
}
TEST(CpustringsS390XTest, z16)
{
ResetHwcaps();
auto& fs = GetEmptyFilesystem();
fs.CreateFile("/proc/cpuinfo",
R"(vendor_id : IBM/S390
# processors : 24
bogomips per cpu: 26315.00
max thread id : 1
features : esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt vxp2 nnpa pcimio sie )");
SetPlatformPointer("z16");
const auto strings = GetS390XPlatformStrings();
EXPECT_EQ(strings.num_processors, 24);
ASSERT_STREQ(strings.type.platform, "z16");
}
TEST(CpustringsS390XTest, z15)
{
ResetHwcaps();
auto& fs = GetEmptyFilesystem();
fs.CreateFile("/proc/cpuinfo",
R"(vendor_id : IBM/S390
# processors : 2
bogomips per cpu: 24038.00
max thread id : 1
features : esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt sie)");
SetPlatformPointer("z15");
const auto strings = GetS390XPlatformStrings();
EXPECT_EQ(strings.num_processors, 2);
ASSERT_STREQ(strings.type.platform, "z15");
}
} // namespace
} // namespace cpu_features

View File

@ -7,8 +7,8 @@
#include <map>
#include <set>
#if defined(CPU_FEATURES_OS_WINDOWS)
#include <windows.h> // IsProcessorFeaturePresent
#endif // CPU_FEATURES_OS_WINDOWS
#include "internal/windows_utils.h"
#endif // CPU_FEATURES_OS_WINDOWS
#include "filesystem_for_testing.h"
#include "gtest/gtest.h"
@ -161,7 +161,7 @@ TEST_F(CpuidX86Test, SandyBridge)
{{0x00000007, 0}, Leaf{0x00000000, 0x00000000, 0x00000000, 0x00000000}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "GenuineIntel");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x02A);
EXPECT_EQ(info.stepping, 0x06);
@ -225,13 +225,39 @@ TEST_F(CpuidX86Test, SkyLake)
{{0x00000007, 0}, Leaf{0x00000000, 0x029C67AF, 0x00000000, 0x00000000}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "GenuineIntel");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x04E);
EXPECT_EQ(info.stepping, 0x03);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_SKL);
}
// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel0050654_SkylakeXeon_CPUID8.txt
TEST_F(CpuidX86Test, SkyLakeXeon)
{
cpu().SetLeaves({{{0x00000000, 0}, Leaf{0x00000016, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x00050654, 0x00100800, 0x7FFEFBFF, 0xBFEBFBFF}}});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x055);
EXPECT_EQ(info.stepping, 0x04);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_SKL);
}
// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel0050657_CascadeLakeXeon_CPUID.txt
TEST_F(CpuidX86Test, CascadeLake)
{
cpu().SetLeaves({{{0x00000000, 0}, Leaf{0x00000016, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x00050657, 0x00400800, 0x7FFEFBFF, 0xBFEBFBFF}}});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x055);
EXPECT_EQ(info.stepping, 0x07);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_CCL);
}
TEST_F(CpuidX86Test, Branding)
{
cpu().SetLeaves({
@ -266,7 +292,7 @@ TEST_F(CpuidX86Test, KabyLakeCache)
const auto info = GetX86CacheInfo();
EXPECT_EQ(info.size, 4);
EXPECT_EQ(info.levels[0].level, 1);
EXPECT_EQ(info.levels[0].cache_type, 1);
EXPECT_EQ(info.levels[0].cache_type, CacheType::CPU_FEATURE_CACHE_DATA);
EXPECT_EQ(info.levels[0].cache_size, 32 * KiB);
EXPECT_EQ(info.levels[0].ways, 8);
EXPECT_EQ(info.levels[0].line_size, 64);
@ -274,7 +300,8 @@ TEST_F(CpuidX86Test, KabyLakeCache)
EXPECT_EQ(info.levels[0].partitioning, 1);
EXPECT_EQ(info.levels[1].level, 1);
EXPECT_EQ(info.levels[1].cache_type, 2);
EXPECT_EQ(info.levels[1].cache_type,
CacheType::CPU_FEATURE_CACHE_INSTRUCTION);
EXPECT_EQ(info.levels[1].cache_size, 32 * KiB);
EXPECT_EQ(info.levels[1].ways, 8);
EXPECT_EQ(info.levels[1].line_size, 64);
@ -282,7 +309,7 @@ TEST_F(CpuidX86Test, KabyLakeCache)
EXPECT_EQ(info.levels[1].partitioning, 1);
EXPECT_EQ(info.levels[2].level, 2);
EXPECT_EQ(info.levels[2].cache_type, 3);
EXPECT_EQ(info.levels[2].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[2].cache_size, 256 * KiB);
EXPECT_EQ(info.levels[2].ways, 4);
EXPECT_EQ(info.levels[2].line_size, 64);
@ -290,7 +317,7 @@ TEST_F(CpuidX86Test, KabyLakeCache)
EXPECT_EQ(info.levels[2].partitioning, 1);
EXPECT_EQ(info.levels[3].level, 3);
EXPECT_EQ(info.levels[3].cache_type, 3);
EXPECT_EQ(info.levels[3].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[3].cache_size, 6 * MiB);
EXPECT_EQ(info.levels[3].ways, 12);
EXPECT_EQ(info.levels[3].line_size, 64);
@ -316,7 +343,7 @@ TEST_F(CpuidX86Test, HSWCache)
const auto info = GetX86CacheInfo();
EXPECT_EQ(info.size, 4);
EXPECT_EQ(info.levels[0].level, 1);
EXPECT_EQ(info.levels[0].cache_type, 1);
EXPECT_EQ(info.levels[0].cache_type, CacheType::CPU_FEATURE_CACHE_DATA);
EXPECT_EQ(info.levels[0].cache_size, 32 * KiB);
EXPECT_EQ(info.levels[0].ways, 8);
EXPECT_EQ(info.levels[0].line_size, 64);
@ -324,7 +351,8 @@ TEST_F(CpuidX86Test, HSWCache)
EXPECT_EQ(info.levels[0].partitioning, 1);
EXPECT_EQ(info.levels[1].level, 1);
EXPECT_EQ(info.levels[1].cache_type, 2);
EXPECT_EQ(info.levels[1].cache_type,
CacheType::CPU_FEATURE_CACHE_INSTRUCTION);
EXPECT_EQ(info.levels[1].cache_size, 32 * KiB);
EXPECT_EQ(info.levels[1].ways, 8);
EXPECT_EQ(info.levels[1].line_size, 64);
@ -332,7 +360,7 @@ TEST_F(CpuidX86Test, HSWCache)
EXPECT_EQ(info.levels[1].partitioning, 1);
EXPECT_EQ(info.levels[2].level, 2);
EXPECT_EQ(info.levels[2].cache_type, 3);
EXPECT_EQ(info.levels[2].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[2].cache_size, 256 * KiB);
EXPECT_EQ(info.levels[2].ways, 8);
EXPECT_EQ(info.levels[2].line_size, 64);
@ -340,7 +368,7 @@ TEST_F(CpuidX86Test, HSWCache)
EXPECT_EQ(info.levels[2].partitioning, 1);
EXPECT_EQ(info.levels[3].level, 3);
EXPECT_EQ(info.levels[3].cache_type, 3);
EXPECT_EQ(info.levels[3].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[3].cache_size, 6 * MiB);
EXPECT_EQ(info.levels[3].ways, 12);
EXPECT_EQ(info.levels[3].line_size, 64);
@ -359,7 +387,7 @@ TEST_F(CpuidX86Test, AMD_K11_GRIFFIN)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x11);
EXPECT_EQ(info.model, 0x03);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_K11);
@ -376,7 +404,7 @@ TEST_F(CpuidX86Test, AMD_K12_LLANO)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x12);
EXPECT_EQ(info.model, 0x01);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_K12);
@ -393,7 +421,7 @@ TEST_F(CpuidX86Test, AMD_K14_BOBCAT_AMD0500F01)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x14);
EXPECT_EQ(info.model, 0x00);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_BOBCAT);
@ -418,7 +446,7 @@ TEST_F(CpuidX86Test, AMD_K14_BOBCAT_AMD0500F10)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x14);
EXPECT_EQ(info.model, 0x01);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_BOBCAT);
@ -435,7 +463,7 @@ TEST_F(CpuidX86Test, AMD_K14_BOBCAT_AMD0500F20)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x14);
EXPECT_EQ(info.model, 0x02);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_BOBCAT);
@ -456,7 +484,7 @@ TEST_F(CpuidX86Test, AMD_K15_EXCAVATOR_STONEY_RIDGE)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x15);
EXPECT_EQ(info.model, 0x70);
EXPECT_STREQ(info.brand_string,
@ -480,7 +508,7 @@ TEST_F(CpuidX86Test, AMD_K15_PILEDRIVER_ABU_DHABI)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x15);
EXPECT_EQ(info.model, 0x02);
EXPECT_STREQ(info.brand_string,
@ -508,7 +536,7 @@ TEST_F(CpuidX86Test, AMD_K15_PILEDRIVER_ABU_DHABI_CACHE_INFO)
EXPECT_EQ(info.size, 4);
EXPECT_EQ(info.levels[0].level, 1);
EXPECT_EQ(info.levels[0].cache_type, 1);
EXPECT_EQ(info.levels[0].cache_type, CacheType::CPU_FEATURE_CACHE_DATA);
EXPECT_EQ(info.levels[0].cache_size, 16 * KiB);
EXPECT_EQ(info.levels[0].ways, 4);
EXPECT_EQ(info.levels[0].line_size, 64);
@ -516,7 +544,8 @@ TEST_F(CpuidX86Test, AMD_K15_PILEDRIVER_ABU_DHABI_CACHE_INFO)
EXPECT_EQ(info.levels[0].partitioning, 1);
EXPECT_EQ(info.levels[1].level, 1);
EXPECT_EQ(info.levels[1].cache_type, 2);
EXPECT_EQ(info.levels[1].cache_type,
CacheType::CPU_FEATURE_CACHE_INSTRUCTION);
EXPECT_EQ(info.levels[1].cache_size, 64 * KiB);
EXPECT_EQ(info.levels[1].ways, 2);
EXPECT_EQ(info.levels[1].line_size, 64);
@ -524,7 +553,7 @@ TEST_F(CpuidX86Test, AMD_K15_PILEDRIVER_ABU_DHABI_CACHE_INFO)
EXPECT_EQ(info.levels[1].partitioning, 1);
EXPECT_EQ(info.levels[2].level, 2);
EXPECT_EQ(info.levels[2].cache_type, 3);
EXPECT_EQ(info.levels[2].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[2].cache_size, 2 * MiB);
EXPECT_EQ(info.levels[2].ways, 16);
EXPECT_EQ(info.levels[2].line_size, 64);
@ -532,7 +561,7 @@ TEST_F(CpuidX86Test, AMD_K15_PILEDRIVER_ABU_DHABI_CACHE_INFO)
EXPECT_EQ(info.levels[2].partitioning, 1);
EXPECT_EQ(info.levels[3].level, 3);
EXPECT_EQ(info.levels[3].cache_type, 3);
EXPECT_EQ(info.levels[3].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[3].cache_size, 6 * MiB);
EXPECT_EQ(info.levels[3].ways, 48);
EXPECT_EQ(info.levels[3].line_size, 64);
@ -540,6 +569,30 @@ TEST_F(CpuidX86Test, AMD_K15_PILEDRIVER_ABU_DHABI_CACHE_INFO)
EXPECT_EQ(info.levels[3].partitioning, 1);
}
// https://github.com/InstLatx64/InstLatx64/blob/master/AuthenticAMD/AuthenticAMD0610F01_K15_Piledriver_CPUID.txt
TEST_F(CpuidX86Test, AMD_K15_PILEDRIVER_A10)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x0000000D, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x00000001, 0}, Leaf{0x00610F01, 0x00040800, 0x3E98320B, 0x178BFBFF}},
{{0x00000007, 0}, Leaf{0x00000000, 0x00000008, 0x00000000, 0x00000000}},
{{0x80000000, 0}, Leaf{0x8000001E, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x80000001, 0}, Leaf{0x00610F01, 0x20000000, 0x01EBBFFF, 0x2FD3FBFF}},
{{0x80000002, 0}, Leaf{0x20444D41, 0x2D303141, 0x30303835, 0x5041204B}},
{{0x80000003, 0}, Leaf{0x69772055, 0x52206874, 0x6F656461, 0x6D74286E}},
{{0x80000004, 0}, Leaf{0x44482029, 0x61724720, 0x63696870, 0x00202073}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x15);
EXPECT_EQ(info.model, 0x10);
EXPECT_STREQ(info.brand_string,
"AMD A10-5800K APU with Radeon(tm) HD Graphics ");
EXPECT_EQ(GetX86Microarchitecture(&info),
X86Microarchitecture::AMD_PILEDRIVER);
}
// http://users.atw.hu/instlatx64/AuthenticAMD/AuthenticAMD0600F12_K15_Interlagos_CPUID3.txt
TEST_F(CpuidX86Test, AMD_K15_BULLDOZER_INTERLAGOS)
{
@ -555,7 +608,7 @@ TEST_F(CpuidX86Test, AMD_K15_BULLDOZER_INTERLAGOS)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x15);
EXPECT_EQ(info.model, 0x01);
EXPECT_STREQ(info.brand_string,
@ -580,7 +633,7 @@ TEST_F(CpuidX86Test, AMD_K15_STREAMROLLER_GODAVARI)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x15);
EXPECT_EQ(info.model, 0x38);
EXPECT_EQ(info.stepping, 0x01);
@ -590,6 +643,28 @@ TEST_F(CpuidX86Test, AMD_K15_STREAMROLLER_GODAVARI)
X86Microarchitecture::AMD_STREAMROLLER);
}
// http://users.atw.hu/instlatx64/AuthenticAMD/AuthenticAMD0600F12_K15_Zambezi8C_CPUID.txt
TEST_F(CpuidX86Test, AMD_K15_BULLDOZER_ZAMBEZI_ABM)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x0000000D, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x00000001, 0}, Leaf{0x00600F12, 0x00080800, 0x1E98220B, 0x178BFBFF}},
{{0x00000007, 0}, Leaf{0x00000000, 0x00000000, 0x00000000, 0x00000000}},
{{0x80000000, 0}, Leaf{0x8000001E, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x80000001, 0}, Leaf{0x00600F12, 0x10000000, 0x01C9BFFF, 0x2FD3FBFF}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x15);
EXPECT_EQ(info.model, 0x01);
EXPECT_EQ(GetX86Microarchitecture(&info),
X86Microarchitecture::AMD_BULLDOZER);
EXPECT_TRUE(info.features.lzcnt);
}
// http://users.atw.hu/instlatx64/AuthenticAMD/AuthenticAMD0700F01_K16_Kabini_CPUID.txt
TEST_F(CpuidX86Test, AMD_K16_JAGUAR_KABINI)
{
@ -605,7 +680,7 @@ TEST_F(CpuidX86Test, AMD_K16_JAGUAR_KABINI)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x16);
EXPECT_EQ(info.model, 0x00);
EXPECT_STREQ(info.brand_string,
@ -628,7 +703,7 @@ TEST_F(CpuidX86Test, AMD_K16_PUMA_BEEMA)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x16);
EXPECT_EQ(info.model, 0x30);
EXPECT_STREQ(info.brand_string,
@ -636,6 +711,29 @@ TEST_F(CpuidX86Test, AMD_K16_PUMA_BEEMA)
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_PUMA);
}
// https://github.com/InstLatx64/InstLatx64/blob/master/AuthenticAMD/AuthenticAMD0720F61_K16_Cato_CPUID.txt
TEST_F(CpuidX86Test, AMD_K16_CATO)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x0000000D, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x00000001, 0}, Leaf{0x00720F61, 0x00080800, 0x3ED8220B, 0x178BFBFF}},
{{0x00000007, 0}, Leaf{0x00000000, 0x00000008, 0x00000000, 0x00000000}},
{{0x80000000, 0}, Leaf{0x8000001E, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x80000001, 0}, Leaf{0x00720F61, 0x00000000, 0x154837FF, 0x2FD3FBFF}},
{{0x80000002, 0}, Leaf{0x20444D41, 0x392D3941, 0x20303238, 0x636F7250}},
{{0x80000003, 0}, Leaf{0x6F737365, 0x00000072, 0x00000000, 0x00000000}},
{{0x80000004, 0}, Leaf{0x00000000, 0x00000000, 0x00000000, 0x00000000}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x16);
EXPECT_EQ(info.model, 0x26);
EXPECT_STREQ(info.brand_string,
"AMD A9-9820 Processor");
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_JAGUAR);
}
// http://users.atw.hu/instlatx64/AuthenticAMD/AuthenticAMD0820F01_K17_Dali_CPUID.txt
TEST_F(CpuidX86Test, AMD_K17_ZEN_DALI)
{
@ -651,7 +749,7 @@ TEST_F(CpuidX86Test, AMD_K17_ZEN_DALI)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x17);
EXPECT_EQ(info.model, 0x20);
EXPECT_STREQ(info.brand_string,
@ -674,7 +772,7 @@ TEST_F(CpuidX86Test, AMD_K17_ZEN_PLUS_PINNACLE_RIDGE)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x17);
EXPECT_EQ(info.model, 0x08);
EXPECT_STREQ(info.brand_string,
@ -697,7 +795,7 @@ TEST_F(CpuidX86Test, AMD_K17_ZEN2_XBOX_SERIES_X)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x17);
EXPECT_EQ(info.model, 0x47);
EXPECT_STREQ(info.brand_string, "AMD 4700S 8-Core Processor Desktop Kit");
@ -719,7 +817,7 @@ TEST_F(CpuidX86Test, AMD_K18_ZEN_DHYANA)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "HygonGenuine");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_HYGON_GENUINE);
EXPECT_EQ(info.family, 0x18);
EXPECT_EQ(info.model, 0x00);
EXPECT_STREQ(info.brand_string,
@ -744,7 +842,7 @@ TEST_F(CpuidX86Test, AMD_K18_ZEN_DHYANA_CACHE_INFO)
EXPECT_EQ(info.size, 4);
EXPECT_EQ(info.levels[0].level, 1);
EXPECT_EQ(info.levels[0].cache_type, 1);
EXPECT_EQ(info.levels[0].cache_type, CacheType::CPU_FEATURE_CACHE_DATA);
EXPECT_EQ(info.levels[0].cache_size, 32 * KiB);
EXPECT_EQ(info.levels[0].ways, 8);
EXPECT_EQ(info.levels[0].line_size, 64);
@ -752,7 +850,8 @@ TEST_F(CpuidX86Test, AMD_K18_ZEN_DHYANA_CACHE_INFO)
EXPECT_EQ(info.levels[0].partitioning, 1);
EXPECT_EQ(info.levels[1].level, 1);
EXPECT_EQ(info.levels[1].cache_type, 2);
EXPECT_EQ(info.levels[1].cache_type,
CacheType::CPU_FEATURE_CACHE_INSTRUCTION);
EXPECT_EQ(info.levels[1].cache_size, 64 * KiB);
EXPECT_EQ(info.levels[1].ways, 4);
EXPECT_EQ(info.levels[1].line_size, 64);
@ -760,7 +859,7 @@ TEST_F(CpuidX86Test, AMD_K18_ZEN_DHYANA_CACHE_INFO)
EXPECT_EQ(info.levels[1].partitioning, 1);
EXPECT_EQ(info.levels[2].level, 2);
EXPECT_EQ(info.levels[2].cache_type, 3);
EXPECT_EQ(info.levels[2].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[2].cache_size, 512 * KiB);
EXPECT_EQ(info.levels[2].ways, 8);
EXPECT_EQ(info.levels[2].line_size, 64);
@ -768,7 +867,7 @@ TEST_F(CpuidX86Test, AMD_K18_ZEN_DHYANA_CACHE_INFO)
EXPECT_EQ(info.levels[2].partitioning, 1);
EXPECT_EQ(info.levels[3].level, 3);
EXPECT_EQ(info.levels[3].cache_type, 3);
EXPECT_EQ(info.levels[3].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[3].cache_size, 8 * MiB);
EXPECT_EQ(info.levels[3].ways, 16);
EXPECT_EQ(info.levels[3].line_size, 64);
@ -791,7 +890,7 @@ TEST_F(CpuidX86Test, AMD_K19_ZEN3_VERMEER)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x19);
EXPECT_EQ(info.model, 0x21);
EXPECT_STREQ(info.brand_string,
@ -813,7 +912,7 @@ TEST_F(CpuidX86Test, AMD_K19_ZEN3)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "AuthenticAMD");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x19);
EXPECT_EQ(info.model, 0x44);
EXPECT_STREQ(info.brand_string,
@ -821,6 +920,28 @@ TEST_F(CpuidX86Test, AMD_K19_ZEN3)
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_ZEN3);
}
// http://users.atw.hu/instlatx64/AuthenticAMD/AuthenticAMD0A60F12_K19_Raphael_01_CPUID.txt
TEST_F(CpuidX86Test, AMD_K19_ZEN4_RAPHAEL)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000010, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x00000001, 0}, Leaf{0x00A60F12, 0x000C0800, 0x7EF8320B, 0x178BFBFF}},
{{0x80000000, 0}, Leaf{0x80000028, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x80000001, 0}, Leaf{0x00A60F12, 0x00000000, 0x75C237FF, 0x2FD3FBFF}},
{{0x80000002, 0}, Leaf{0x20444D41, 0x657A7952, 0x2035206E, 0x30303637}},
{{0x80000003, 0}, Leaf{0x2D362058, 0x65726F43, 0x6F725020, 0x73736563}},
{{0x80000004, 0}, Leaf{0x2020726F, 0x20202020, 0x20202020, 0x00202020}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(info.family, 0x19);
EXPECT_EQ(info.model, 0x61);
EXPECT_STREQ(info.brand_string,
"AMD Ryzen 5 7600X 6-Core Processor ");
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_ZEN4);
}
// http://users.atw.hu/instlatx64/HygonGenuine/HygonGenuine0900F11_Hygon_01_CPUID.txt
TEST_F(CpuidX86Test, AMD_K18_ZEN_DHYANA_OCTAL_CORE_C86_3250)
{
@ -837,12 +958,274 @@ TEST_F(CpuidX86Test, AMD_K18_ZEN_DHYANA_OCTAL_CORE_C86_3250)
EXPECT_EQ(info.model, 0x01);
EXPECT_EQ(info.family, 0x18);
EXPECT_STREQ(info.vendor, "HygonGenuine");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_HYGON_GENUINE);
EXPECT_STREQ(info.brand_string,
"Hygon C86 3250 8-core Processor ");
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_ZEN);
}
// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00906A4_AlderLakeP_00_CPUID.txt
TEST_F(CpuidX86Test, INTEL_ALDER_LAKE_AVX_VNNI)
{
cpu().SetOsBackupsExtendedRegisters(true);
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000020, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000906A4, 0x00400800, 0x7FFAFBBF, 0xBFEBFBFF}},
{{0x00000007, 0}, Leaf{0x00000001, 0x239CA7EB, 0x984007AC, 0xFC18C410}},
{{0x00000007, 1}, Leaf{0x00400810, 0x00000000, 0x00000000, 0x00000000}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x9A);
EXPECT_TRUE(info.features.avx_vnni);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_ADL);
}
// https://github.com/InstLatx64/InstLatx64/blob/master/GenuineIntel/GenuineIntel0090672_AlderLake_BC_AVX512_CPUID01.txt
TEST_F(CpuidX86Test, INTEL_ALDER_LAKE_AVX512)
{
cpu().SetOsBackupsExtendedRegisters(true);
#if defined(CPU_FEATURES_OS_MACOS)
cpu().SetDarwinSysCtlByName("hw.optional.avx512f");
#endif
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000020, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000906A4, 0x00400800, 0x7FFAFBBF, 0xBFEBFBFF}},
{{0x00000007, 0}, Leaf{0x00000001, 0xF3BFA7EB, 0x98C07FEE, 0xFC9CC510}},
{{0x00000007, 1}, Leaf{0x00401C30, 0x00000000, 0x00000000, 0x00000000}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x9A);
EXPECT_TRUE(info.features.avx512f);
EXPECT_TRUE(info.features.avx512bw);
EXPECT_TRUE(info.features.avx512dq);
EXPECT_TRUE(info.features.avx512cd);
EXPECT_TRUE(info.features.avx512vl);
EXPECT_TRUE(info.features.avx512_vp2intersect);
EXPECT_TRUE(info.features.avx512vbmi);
EXPECT_TRUE(info.features.avx512vbmi2);
EXPECT_TRUE(info.features.avx512bitalg);
EXPECT_TRUE(info.features.avx512vpopcntdq);
EXPECT_TRUE(info.features.avx512ifma);
EXPECT_TRUE(info.features.avx512_bf16);
EXPECT_TRUE(info.features.avx512_fp16);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_ADL);
}
// https://github.com/InstLatx64/InstLatx64/blob/master/GenuineIntel/GenuineIntel00806C1_TigerLake_CPUID3.txt
TEST_F(CpuidX86Test, INTEL_TIGER_LAKE_AVX512)
{
cpu().SetOsBackupsExtendedRegisters(true);
#if defined(CPU_FEATURES_OS_MACOS)
cpu().SetDarwinSysCtlByName("hw.optional.avx512f");
#endif
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x0000001B, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000806C1, 0x00100800, 0x7FFAFBBF, 0xBFEBFBFF}},
{{0x00000007, 0}, Leaf{0x00000000, 0xF3BFA7EB, 0x18C05FCE, 0xFC100510}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x8C);
EXPECT_TRUE(info.features.avx512f);
EXPECT_TRUE(info.features.avx512bw);
EXPECT_TRUE(info.features.avx512dq);
EXPECT_TRUE(info.features.avx512cd);
EXPECT_TRUE(info.features.avx512vl);
EXPECT_TRUE(info.features.avx512_vp2intersect);
EXPECT_TRUE(info.features.avx512vbmi);
EXPECT_TRUE(info.features.avx512vbmi2);
EXPECT_TRUE(info.features.avx512bitalg);
EXPECT_TRUE(info.features.avx512vpopcntdq);
EXPECT_TRUE(info.features.avx512ifma);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_TGL);
}
// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00706E5_IceLakeY_CPUID.txt
TEST_F(CpuidX86Test, INTEL_ICE_LAKE_GFNI)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x0000001B, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000706E5, 0x00100800, 0x7FFAFBBF, 0xBFEBFBFF}},
{{0x00000007, 0}, Leaf{0x00000000, 0xF2BF27EF, 0x40405F4E, 0xBC000410}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x7E);
EXPECT_TRUE(info.features.gfni);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_ICL);
}
// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00906C0_JasperLake_CPUID01.txt
TEST_F(CpuidX86Test, INTEL_TREMONT_JASPER_LAKE_MOVDR)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x0000001B, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x00090661, 0x00800800, 0x4FF8EBBF, 0xBFEBFBFF}},
{{0x00000007, 0}, Leaf{0x00000000, 0x2394A2C3, 0x18400124, 0xFC000400}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x96);
EXPECT_TRUE(info.features.movdiri);
EXPECT_TRUE(info.features.movdir64b);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_ATOM_TMT);
}
// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel0090672_AlderLake_LC_BC_CPUID01.txt
TEST_F(CpuidX86Test, INTEL_ALDER_LAKE_REP)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000020, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x00090672, 0x00800800, 0x7FFAFBFF, 0xBFEBFBFF}},
{{0x00000007, 0}, Leaf{0x00000001, 0x239CA7EB, 0x98C027AC, 0xFC1CC410}},
{{0x00000007, 1}, Leaf{0x00400810, 0x00000000, 0x00000000, 0x00000000}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x97);
EXPECT_TRUE(info.features.erms);
EXPECT_TRUE(info.features.fs_rep_mov);
EXPECT_FALSE(info.features.fz_rep_movsb);
EXPECT_TRUE(info.features.fs_rep_stosb);
EXPECT_FALSE(info.features.fs_rep_cmpsb_scasb);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_ADL);
}
// http://users.atw.hu/instlatx64/AuthenticAMD/AuthenticAMD0100FA0_K10_Thuban_CPUID.txt
TEST_F(CpuidX86Test, AMD_THUBAN_CACHE_INFO)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000006, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x80000000, 0}, Leaf{0x8000001B, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x80000001, 0}, Leaf{0x00100FA0, 0x10000050, 0x000037FF, 0xEFD3FBFF}},
{{0x80000005, 0}, Leaf{0xFF30FF10, 0xFF30FF20, 0x40020140, 0x40020140}},
{{0x80000006, 0}, Leaf{0x20800000, 0x42004200, 0x02008140, 0x0030B140}},
});
const auto info = GetX86CacheInfo();
EXPECT_EQ(info.size, 4);
EXPECT_EQ(info.levels[0].level, 1);
EXPECT_EQ(info.levels[0].cache_type, CacheType::CPU_FEATURE_CACHE_DATA);
EXPECT_EQ(info.levels[0].cache_size, 64 * KiB);
EXPECT_EQ(info.levels[0].ways, 2);
EXPECT_EQ(info.levels[0].line_size, 64);
EXPECT_EQ(info.levels[1].level, 1);
EXPECT_EQ(info.levels[1].cache_type,
CacheType::CPU_FEATURE_CACHE_INSTRUCTION);
EXPECT_EQ(info.levels[1].cache_size, 64 * KiB);
EXPECT_EQ(info.levels[1].ways, 2);
EXPECT_EQ(info.levels[1].line_size, 64);
EXPECT_EQ(info.levels[2].level, 2);
EXPECT_EQ(info.levels[2].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[2].cache_size, 512 * KiB);
EXPECT_EQ(info.levels[2].ways, 16);
EXPECT_EQ(info.levels[2].line_size, 64);
EXPECT_EQ(info.levels[3].level, 3);
EXPECT_EQ(info.levels[3].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[3].cache_size, 6 * MiB);
EXPECT_EQ(info.levels[3].ways, 48);
EXPECT_EQ(info.levels[3].line_size, 64);
}
// http://users.atw.hu/instlatx64/AuthenticAMD/AuthenticAMD0020FB1_K8_Manchester_CPUID.txt
TEST_F(CpuidX86Test, AMD_MANCHESTER_CACHE_INFO)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000001, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x80000000, 0}, Leaf{0x80000018, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x80000001, 0}, Leaf{0x00020FB1, 0x00000150, 0x00000003, 0xE3D3FBFF}},
{{0x80000005, 0}, Leaf{0xFF08FF08, 0xFF20FF20, 0x40020140, 0x40020140}},
{{0x80000006, 0}, Leaf{0x00000000, 0x42004200, 0x02008140, 0x00000000}},
});
const auto info = GetX86CacheInfo();
EXPECT_EQ(info.size, 3);
EXPECT_EQ(info.levels[0].level, 1);
EXPECT_EQ(info.levels[0].cache_type, CacheType::CPU_FEATURE_CACHE_DATA);
EXPECT_EQ(info.levels[0].cache_size, 64 * KiB);
EXPECT_EQ(info.levels[0].ways, 2);
EXPECT_EQ(info.levels[0].line_size, 64);
EXPECT_EQ(info.levels[1].level, 1);
EXPECT_EQ(info.levels[1].cache_type,
CacheType::CPU_FEATURE_CACHE_INSTRUCTION);
EXPECT_EQ(info.levels[1].cache_size, 64 * KiB);
EXPECT_EQ(info.levels[1].ways, 2);
EXPECT_EQ(info.levels[1].line_size, 64);
EXPECT_EQ(info.levels[2].level, 2);
EXPECT_EQ(info.levels[2].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[2].cache_size, 512 * KiB);
EXPECT_EQ(info.levels[2].ways, 16);
EXPECT_EQ(info.levels[2].line_size, 64);
}
// http://users.atw.hu/instlatx64/AuthenticAMD/AuthenticAMD0100F22_K10_Agena_CPUID.txt
TEST_F(CpuidX86Test, AMD_AGENA_CACHE_INFO)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000005, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x80000000, 0}, Leaf{0x8000001A, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x80000001, 0}, Leaf{0x00100F22, 0x10000000, 0x000007FF, 0xEFD3FBFF}},
{{0x80000005, 0}, Leaf{0xFF30FF10, 0xFF30FF20, 0x40020140, 0x40020140}},
{{0x80000006, 0}, Leaf{0x20800000, 0x42004200, 0x02008140, 0x0010A140}},
});
const auto info = GetX86CacheInfo();
EXPECT_EQ(info.size, 4);
EXPECT_EQ(info.levels[0].level, 1);
EXPECT_EQ(info.levels[0].cache_type, CacheType::CPU_FEATURE_CACHE_DATA);
EXPECT_EQ(info.levels[0].cache_size, 64 * KiB);
EXPECT_EQ(info.levels[0].ways, 2);
EXPECT_EQ(info.levels[0].line_size, 64);
EXPECT_EQ(info.levels[1].level, 1);
EXPECT_EQ(info.levels[1].cache_type,
CacheType::CPU_FEATURE_CACHE_INSTRUCTION);
EXPECT_EQ(info.levels[1].cache_size, 64 * KiB);
EXPECT_EQ(info.levels[1].ways, 2);
EXPECT_EQ(info.levels[1].line_size, 64);
EXPECT_EQ(info.levels[2].level, 2);
EXPECT_EQ(info.levels[2].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[2].cache_size, 512 * KiB);
EXPECT_EQ(info.levels[2].ways, 16);
EXPECT_EQ(info.levels[2].line_size, 64);
EXPECT_EQ(info.levels[3].level, 3);
EXPECT_EQ(info.levels[3].cache_type, CacheType::CPU_FEATURE_CACHE_UNIFIED);
EXPECT_EQ(info.levels[3].cache_size, 2 * MiB);
EXPECT_EQ(info.levels[3].ways, 32);
EXPECT_EQ(info.levels[3].line_size, 64);
}
// https://github.com/InstLatx64/InstLatx64/blob/master/GenuineIntel/GenuineIntel00106A1_Nehalem_CPUID.txt
TEST_F(CpuidX86Test, Nehalem)
{
@ -907,7 +1290,7 @@ flags : fpu mmx sse sse2 pni ssse3 sse4_1 sse4_2
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "GenuineIntel");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x1A);
EXPECT_EQ(info.stepping, 0x02);
@ -986,7 +1369,7 @@ flags : fpu mmx sse sse2 pni ssse3 sse4_1 sse4_2
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "GenuineIntel");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x37);
EXPECT_EQ(info.stepping, 0x03);
@ -1016,7 +1399,7 @@ TEST_F(CpuidX86Test, P4_CacheInfo)
EXPECT_EQ(info.size, 5);
EXPECT_EQ(info.levels[0].level, UNDEF);
EXPECT_EQ(info.levels[0].cache_type, CPU_FEATURE_CACHE_TLB);
EXPECT_EQ(info.levels[0].cache_type, CacheType::CPU_FEATURE_CACHE_TLB);
EXPECT_EQ(info.levels[0].cache_size, 4 * KiB);
EXPECT_EQ(info.levels[0].ways, UNDEF);
EXPECT_EQ(info.levels[0].line_size, UNDEF);
@ -1024,7 +1407,7 @@ TEST_F(CpuidX86Test, P4_CacheInfo)
EXPECT_EQ(info.levels[0].partitioning, 0);
EXPECT_EQ(info.levels[1].level, UNDEF);
EXPECT_EQ(info.levels[1].cache_type, CPU_FEATURE_CACHE_TLB);
EXPECT_EQ(info.levels[1].cache_type, CacheType::CPU_FEATURE_CACHE_TLB);
EXPECT_EQ(info.levels[1].cache_size, 4 * KiB);
EXPECT_EQ(info.levels[1].ways, UNDEF);
EXPECT_EQ(info.levels[1].line_size, UNDEF);
@ -1032,7 +1415,7 @@ TEST_F(CpuidX86Test, P4_CacheInfo)
EXPECT_EQ(info.levels[1].partitioning, 0);
EXPECT_EQ(info.levels[2].level, 1);
EXPECT_EQ(info.levels[2].cache_type, CPU_FEATURE_CACHE_DATA);
EXPECT_EQ(info.levels[2].cache_type, CacheType::CPU_FEATURE_CACHE_DATA);
EXPECT_EQ(info.levels[2].cache_size, 8 * KiB);
EXPECT_EQ(info.levels[2].ways, 4);
EXPECT_EQ(info.levels[2].line_size, 64);
@ -1040,7 +1423,8 @@ TEST_F(CpuidX86Test, P4_CacheInfo)
EXPECT_EQ(info.levels[2].partitioning, 0);
EXPECT_EQ(info.levels[3].level, 1);
EXPECT_EQ(info.levels[3].cache_type, CPU_FEATURE_CACHE_INSTRUCTION);
EXPECT_EQ(info.levels[3].cache_type,
CacheType::CPU_FEATURE_CACHE_INSTRUCTION);
EXPECT_EQ(info.levels[3].cache_size, 12 * KiB);
EXPECT_EQ(info.levels[3].ways, 8);
EXPECT_EQ(info.levels[3].line_size, UNDEF);
@ -1048,7 +1432,7 @@ TEST_F(CpuidX86Test, P4_CacheInfo)
EXPECT_EQ(info.levels[3].partitioning, 0);
EXPECT_EQ(info.levels[4].level, 2);
EXPECT_EQ(info.levels[4].cache_type, CPU_FEATURE_CACHE_DATA);
EXPECT_EQ(info.levels[4].cache_type, CacheType::CPU_FEATURE_CACHE_DATA);
EXPECT_EQ(info.levels[4].cache_size, 256 * KiB);
EXPECT_EQ(info.levels[4].ways, 8);
EXPECT_EQ(info.levels[4].line_size, 64);
@ -1088,7 +1472,7 @@ flags : fpu mmx sse
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "GenuineIntel");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x07);
EXPECT_EQ(info.stepping, 0x03);
@ -1113,7 +1497,7 @@ TEST_F(CpuidX86Test, INTEL_80486)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "GenuineIntel");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x04);
EXPECT_EQ(info.model, 0x08);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_80486);
@ -1128,7 +1512,7 @@ TEST_F(CpuidX86Test, INTEL_P54C)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "GenuineIntel");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x05);
EXPECT_EQ(info.model, 0x02);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_P5);
@ -1143,13 +1527,44 @@ TEST_F(CpuidX86Test, INTEL_LAKEMONT)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "GenuineIntel");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x05);
EXPECT_EQ(info.model, 0x09);
EXPECT_EQ(GetX86Microarchitecture(&info),
X86Microarchitecture::INTEL_LAKEMONT);
}
// https://github.com/InstLatx64/InstLatx64/blob/master/GenuineIntel/GenuineIntel00006E8_PM_Yonah_CPUID.txt
TEST_F(CpuidX86Test, INTEL_CORE_YONAH)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x0000000A, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000006E8, 0x00010800, 0x0000C109, 0xAFE9FBFF}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x0E);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_CORE);
}
// https://github.com/InstLatx64/InstLatx64/blob/master/GenuineIntel/GenuineIntel00706A8_GoldmontPlus_CPUID.txt
TEST_F(CpuidX86Test, INTEL_GOLDMONT_PLUS)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000018, 0x756E6547, 0x6c65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000706A8, 0x00400800, 0x4FF8EBBF, 0xBFEBFBFF}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x7A);
EXPECT_EQ(GetX86Microarchitecture(&info),
X86Microarchitecture::INTEL_ATOM_GMT_PLUS);
}
// https://github.com/InstLatx64/InstLatx64/blob/master/GenuineIntel/GenuineIntel0050670_KnightsLanding_CPUID.txt
TEST_F(CpuidX86Test, INTEL_KNIGHTS_LANDING)
{
@ -1159,7 +1574,7 @@ TEST_F(CpuidX86Test, INTEL_KNIGHTS_LANDING)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "GenuineIntel");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x57);
EXPECT_EQ(GetX86Microarchitecture(&info),
@ -1175,12 +1590,11 @@ TEST_F(CpuidX86Test, INTEL_CML_U)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "GenuineIntel");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x8E);
EXPECT_EQ(info.stepping, 0x0C);
EXPECT_EQ(GetX86Microarchitecture(&info),
X86Microarchitecture::INTEL_CML);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_CML);
}
// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00A0652_CometLake_CPUID1.txt
@ -1192,11 +1606,106 @@ TEST_F(CpuidX86Test, INTEL_CML_H)
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, "GenuineIntel");
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0xA5);
EXPECT_EQ(GetX86Microarchitecture(&info),
X86Microarchitecture::INTEL_CML);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_CML);
}
// https://github.com/InstLatx64/InstLatx64/blob/master/GenuineIntel/GenuineIntel00A0660_CometLake_CPUID1.txt
TEST_F(CpuidX86Test, INTEL_CML_U2)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000016, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000A0660, 0x00100800, 0x7FFAFBBF, 0xBFEBFBFF}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0xA6);
EXPECT_EQ(info.stepping, 0x00);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_CML);
}
// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00806A1_Lakefield_CPUID.txt
TEST_F(CpuidX86Test, INTEL_ATOM_TMT_LAKEFIELD)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x0000001B, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000806A1, 0x00100800, 0x4FD8EBBF, 0xBFEBFBFF}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x8A);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_ATOM_TMT);
}
// https://github.com/InstLatx64/InstLatx64/blob/master/GenuineIntel/GenuineIntel0090661_ElkhartLake_CPUID01.txt
TEST_F(CpuidX86Test, INTEL_ATOM_TMT_ELKHART_LAKE)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x0000001B, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x00090661, 0x00800800, 0x4FF8EBBF, 0xBFEBFBFF}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x96);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_ATOM_TMT);
}
// https://github.com/InstLatx64/InstLatx64/blob/master/GenuineIntel/GenuineIntel00906C0_JasperLake_01_CPUID.txt
TEST_F(CpuidX86Test, INTEL_ATOM_TMT_JASPER_LAKE)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x0000001B, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000906C0, 0x00800800, 0x4FF8EBBF, 0xBFEBFBFF}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x9C);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_ATOM_TMT);
}
// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00B0671_RaptorLake_02_CPUID.txt
TEST_F(CpuidX86Test, INTEL_RAPTOR_LAKE)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000020, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000B0671, 0x00800800, 0x7FFAFBBF, 0xBFEBFBFF}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0xB7);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_RPL);
}
// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00306F2_HaswellEP2_CPUID.txt
TEST_F(CpuidX86Test, INTEL_HASWELL_LZCNT)
{
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x0000000F, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000306F2, 0x00200800, 0x7FFEFBFF, 0xBFEBFBFF}},
{{0x00000007, 0}, Leaf{0x00000000, 0x000037AB, 0x00000000, 0x00000000}},
{{0x80000000, 0}, Leaf{0x80000008, 0x00000000, 0x00000000, 0x00000000}},
{{0x80000001, 0}, Leaf{0x00000000, 0x00000000, 0x00000021, 0x2C100000}},
});
const auto info = GetX86Info();
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0x3F);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_HSW);
EXPECT_TRUE(info.features.lzcnt);
}
// https://github.com/google/cpu_features/issues/200

View File

@ -544,6 +544,7 @@ if(NOT (CMAKE_GENERATOR STREQUAL Xcode))
PRIVATE
$<TARGET_PROPERTY:cpu_features,INTERFACE_INCLUDE_DIRECTORIES>
)
add_dependencies(volk_gnsssdr_obj list_cpu_features)
endif()
endif()
# Configure object target properties
@ -557,65 +558,76 @@ else()
endif()
# Add dynamic library
if(CMAKE_GENERATOR STREQUAL Xcode)
add_library(volk_gnsssdr SHARED ${volk_gnsssdr_sources})
else()
add_library(volk_gnsssdr SHARED $<TARGET_OBJECTS:volk_gnsssdr_obj>)
endif()
if(USE_CPU_FEATURES)
if(CPUFEATURES_FOUND)
target_link_libraries(volk_gnsssdr
PUBLIC ${volk_gnsssdr_libraries}
PRIVATE CpuFeature::cpu_features
)
# Note: new Xcode buildsystem does not allow building both static and dynamic libraries
# so we only build dynamic if ENABLE_STATIC_LIBS is not enabled in that generator.
# For other generators than XCode, the dynamic library is always built.
if(NOT (ENABLE_STATIC_LIBS AND (CMAKE_GENERATOR STREQUAL Xcode)))
if(CMAKE_GENERATOR STREQUAL Xcode)
add_library(volk_gnsssdr SHARED ${volk_gnsssdr_sources})
else()
target_link_libraries(volk_gnsssdr
PUBLIC ${volk_gnsssdr_libraries}
PRIVATE cpu_features
add_library(volk_gnsssdr SHARED $<TARGET_OBJECTS:volk_gnsssdr_obj>)
endif()
if(USE_CPU_FEATURES)
if(CPUFEATURES_FOUND)
target_link_libraries(volk_gnsssdr
PUBLIC ${volk_gnsssdr_libraries}
PRIVATE CpuFeature::cpu_features
)
else()
target_link_libraries(volk_gnsssdr
PUBLIC ${volk_gnsssdr_libraries}
PRIVATE cpu_features
)
endif()
else()
target_link_libraries(volk_gnsssdr PUBLIC ${volk_gnsssdr_libraries})
endif()
target_include_directories(volk_gnsssdr
PUBLIC $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/kernels>
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC $<INSTALL_INTERFACE:include>
)
if(UNIX)
target_compile_definitions(volk_gnsssdr
PUBLIC $<$<CONFIG:Release>:_FORTIFY_SOURCE=2>$<$<CONFIG:RelWithDebInfo>:_FORTIFY_SOURCE=2>
)
endif()
else()
target_link_libraries(volk_gnsssdr PUBLIC ${volk_gnsssdr_libraries})
endif()
target_include_directories(volk_gnsssdr
PUBLIC $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/kernels>
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC $<INSTALL_INTERFACE:include>
)
if(USE_CPU_FEATURES)
if(CPUFEATURES_FOUND)
target_include_directories(volk_gnsssdr
PRIVATE
$<TARGET_PROPERTY:CpuFeature::cpu_features,INTERFACE_INCLUDE_DIRECTORIES>
)
else()
target_include_directories(volk_gnsssdr
PRIVATE
$<TARGET_PROPERTY:cpu_features,INTERFACE_INCLUDE_DIRECTORIES>
)
if(USE_CPU_FEATURES)
if(CPUFEATURES_FOUND)
target_include_directories(volk_gnsssdr
PRIVATE
$<TARGET_PROPERTY:CpuFeature::cpu_features,INTERFACE_INCLUDE_DIRECTORIES>
)
else()
target_include_directories(volk_gnsssdr
PRIVATE
$<TARGET_PROPERTY:cpu_features,INTERFACE_INCLUDE_DIRECTORIES>
)
endif()
endif()
endif()
# Configure target properties
if(ORC_FOUND)
target_link_libraries(volk_gnsssdr PRIVATE ${ORC_LIBRARIES})
endif()
if(NOT MSVC)
target_link_libraries(volk_gnsssdr PUBLIC m)
endif()
set_target_properties(volk_gnsssdr PROPERTIES VERSION ${VERSION})
set_target_properties(volk_gnsssdr PROPERTIES SOVERSION ${SOVERSION})
set_target_properties(volk_gnsssdr PROPERTIES DEFINE_SYMBOL "volk_gnsssdr_EXPORTS")
# Install locations
install(TARGETS volk_gnsssdr
EXPORT VOLK_GNSSSDR-export
LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_runtime" # .so file
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file
RUNTIME DESTINATION bin COMPONENT "volk_gnsssdr_runtime" # .dll file
)
# Configure target properties
if(ORC_FOUND)
target_link_libraries(volk_gnsssdr PRIVATE ${ORC_LIBRARIES})
endif()
if(NOT MSVC)
target_link_libraries(volk_gnsssdr PUBLIC m)
endif()
set_target_properties(volk_gnsssdr PROPERTIES VERSION ${VERSION})
set_target_properties(volk_gnsssdr PROPERTIES SOVERSION ${SOVERSION})
set_target_properties(volk_gnsssdr PROPERTIES DEFINE_SYMBOL "volk_gnsssdr_EXPORTS")
# Install locations
install(TARGETS volk_gnsssdr
EXPORT VOLK_GNSSSDR-export
LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_runtime" # .so file
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file
RUNTIME DESTINATION bin COMPONENT "volk_gnsssdr_runtime" # .dll file
)
endif()
# Configure static library
if(ENABLE_STATIC_LIBS)
@ -653,7 +665,11 @@ if(ENABLE_STATIC_LIBS)
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
)
if(UNIX)
target_compile_definitions(volk_gnsssdr_static
PUBLIC $<$<CONFIG:Release>:_FORTIFY_SOURCE=2>$<$<CONFIG:RelWithDebInfo>:_FORTIFY_SOURCE=2>
)
endif()
set_target_properties(volk_gnsssdr_static PROPERTIES OUTPUT_NAME volk_gnsssdr)
install(TARGETS volk_gnsssdr_static

View File

@ -23,16 +23,18 @@
#include <ostream> // for operator<<
HybridObservables::HybridObservables(const ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const std::string& role,
unsigned int in_streams,
unsigned int out_streams) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams),
dump_(configuration->property(role + ".dump", false)),
dump_mat_(configuration->property(role + ".dump_mat", true))
{
const std::string default_dump_filename("./observables.dat");
DLOG(INFO) << "role " << role;
dump_ = configuration->property(role + ".dump", false);
dump_mat_ = configuration->property(role + ".dump_mat", true);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
Obs_Conf conf{};
conf.dump = dump_;
conf.dump_mat = dump_mat_;
conf.dump_filename = dump_filename_;
@ -46,7 +48,7 @@ HybridObservables::HybridObservables(const ConfigurationInterface* configuration
{
conf.smoothing_factor = configuration->property(role + ".smoothing_factor", conf.smoothing_factor);
}
DLOG(INFO) << "role " << role;
if (conf.enable_carrier_smoothing == true)
{
LOG(INFO) << "Observables carrier smoothing enabled with smoothing factor " << conf.smoothing_factor;

View File

@ -149,13 +149,13 @@ hybrid_observables_gs::hybrid_observables_gs(const Obs_Conf &conf_)
std::cerr << "GNSS-SDR cannot create dump file for the Observables block. Wrong permissions?\n";
d_dump = false;
}
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit);
try
{
d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary);
LOG(INFO) << "Observables dump enabled Log file: " << d_dump_filename.c_str();
}
catch (const std::ifstream::failure &e)
catch (const std::ofstream::failure &e)
{
LOG(WARNING) << "Exception opening observables dump file " << e.what();
d_dump = false;
@ -871,7 +871,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
}
}
catch (const std::ifstream::failure &e)
catch (const std::ofstream::failure &e)
{
LOG(WARNING) << "Exception writing observables dump file " << e.what();
d_dump = false;

View File

@ -29,25 +29,30 @@
DirectResamplerConditioner::DirectResamplerConditioner(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_stream,
unsigned int out_stream)
: role_(role),
in_stream_(in_stream),
out_stream_(out_stream),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_item_type("short");
const std::string default_dump_file("./data/signal_conditioner.dat");
const double fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
const double fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0);
sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", fs_in);
if (std::fabs(fs_in - sample_freq_out_) > std::numeric_limits<double>::epsilon())
{
std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_sps and " + role_ + ".sample_freq_out are not set to the same value!";
LOG(WARNING) << aux_warn;
std::cout << aux_warn << '\n';
}
item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_ = configuration->property(role + ".dump", false);
DLOG(INFO) << "dump_ is " << dump_;
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
if (item_type_ == "gr_complex")
{

View File

@ -24,25 +24,30 @@
#include <vector>
MmseResamplerConditioner::MmseResamplerConditioner(
const ConfigurationInterface* configuration, const std::string& role,
unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
const ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_stream,
unsigned int out_stream)
: role_(role),
in_stream_(in_stream),
out_stream_(out_stream),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_file("./data/signal_conditioner.dat");
const double fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
const double fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0);
sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", fs_in);
if (std::fabs(fs_in - sample_freq_out_) > std::numeric_limits<double>::epsilon())
{
std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_sps and " + role_ + ".sample_freq_out are not set to the same value!";
LOG(WARNING) << aux_warn;
std::cout << aux_warn << '\n';
}
item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_ = configuration->property(role + ".dump", false);
DLOG(INFO) << "dump_ is " << dump_;
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
if (item_type_ == "gr_complex")
{

View File

@ -50,6 +50,11 @@ if(GNURADIO_USES_STD_POINTERS)
)
endif()
if(GNURADIO_IS_38_OR_GREATER)
target_compile_definitions(resampler_gr_blocks
PUBLIC -DGR_GREATER_38=1)
endif()
target_include_directories(resampler_gr_blocks
PUBLIC
${GNSSSDR_SOURCE_DIR}/src/core/interfaces

View File

@ -34,12 +34,14 @@ direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb(
direct_resampler_conditioner_cb::direct_resampler_conditioner_cb(
double sample_freq_in,
double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cb", gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), gr::io_signature::make(1, 1, sizeof(lv_8sc_t))),
d_sample_freq_in(sample_freq_in),
d_sample_freq_out(
sample_freq_out),
d_phase(0),
d_lphase(0)
double sample_freq_out)
: gr::block("direct_resampler_make_conditioner_cb",
gr::io_signature::make(1, 1, sizeof(lv_8sc_t)),
gr::io_signature::make(1, 1, sizeof(lv_8sc_t))),
d_sample_freq_in(sample_freq_in),
d_sample_freq_out(sample_freq_out),
d_phase(0),
d_lphase(0)
{
const double two_32 = 4294967296.0;
// Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296
@ -51,9 +53,11 @@ direct_resampler_conditioner_cb::direct_resampler_conditioner_cb(
{
d_phase_step = static_cast<uint32_t>(floor(two_32 * sample_freq_in / sample_freq_out));
}
set_relative_rate(1.0 * sample_freq_out / sample_freq_in);
set_output_multiple(1);
#ifdef GR_GREATER_38
this->set_relative_rate(static_cast<uint64_t>(sample_freq_out), static_cast<uint64_t>(sample_freq_in));
#else
this->set_relative_rate(sample_freq_out / sample_freq_in);
#endif
}

View File

@ -33,11 +33,14 @@ direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc(
direct_resampler_conditioner_cc::direct_resampler_conditioner_cc(
double sample_freq_in,
double sample_freq_out) : gr::block("direct_resampler_conditioner_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(gr_complex))),
d_sample_freq_in(sample_freq_in),
d_sample_freq_out(sample_freq_out),
d_phase(0),
d_lphase(0)
double sample_freq_out)
: gr::block("direct_resampler_conditioner_cc",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(1, 1, sizeof(gr_complex))),
d_sample_freq_in(sample_freq_in),
d_sample_freq_out(sample_freq_out),
d_phase(0),
d_lphase(0)
{
// Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296
const double two_32 = 4294967296.0;
@ -49,8 +52,11 @@ direct_resampler_conditioner_cc::direct_resampler_conditioner_cc(
{
d_phase_step = static_cast<uint32_t>(floor(two_32 * sample_freq_in / sample_freq_out));
}
set_relative_rate(1.0 * sample_freq_out / sample_freq_in);
set_output_multiple(1);
#ifdef GR_GREATER_38
this->set_relative_rate(static_cast<uint64_t>(sample_freq_out), static_cast<uint64_t>(sample_freq_in));
#else
this->set_relative_rate(sample_freq_out / sample_freq_in);
#endif
}

View File

@ -34,13 +34,14 @@ direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs(
direct_resampler_conditioner_cs::direct_resampler_conditioner_cs(
double sample_freq_in,
double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cs",
gr::io_signature::make(1, 1, sizeof(lv_16sc_t)),
gr::io_signature::make(1, 1, sizeof(lv_16sc_t))),
d_sample_freq_in(sample_freq_in),
d_sample_freq_out(sample_freq_out),
d_phase(0),
d_lphase(0)
double sample_freq_out)
: gr::block("direct_resampler_make_conditioner_cs",
gr::io_signature::make(1, 1, sizeof(lv_16sc_t)),
gr::io_signature::make(1, 1, sizeof(lv_16sc_t))),
d_sample_freq_in(sample_freq_in),
d_sample_freq_out(sample_freq_out),
d_phase(0),
d_lphase(0)
{
const double two_32 = 4294967296.0;
// Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296
@ -53,8 +54,11 @@ direct_resampler_conditioner_cs::direct_resampler_conditioner_cs(
d_phase_step = static_cast<uint32_t>(floor(two_32 * sample_freq_in / sample_freq_out));
}
set_relative_rate(1.0 * sample_freq_out / sample_freq_in);
set_output_multiple(1);
#ifdef GR_GREATER_38
this->set_relative_rate(static_cast<uint64_t>(sample_freq_out), static_cast<uint64_t>(sample_freq_in));
#else
this->set_relative_rate(sample_freq_out / sample_freq_in);
#endif
}

View File

@ -33,7 +33,10 @@
SignalGenerator::SignalGenerator(const ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream,
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused))) : role_(role),
in_stream_(in_stream),
out_stream_(out_stream),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_file("./data/gen_source.dat");
@ -41,7 +44,6 @@ SignalGenerator::SignalGenerator(const ConfigurationInterface* configuration,
const std::string default_signal("1C");
item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
const unsigned int fs_in = configuration->property("SignalSource.fs_hz", static_cast<unsigned>(4e6));

View File

@ -6,15 +6,12 @@
# Optional drivers
set(OPT_DRIVER_SOURCES "")
set(OPT_DRIVER_HEADERS "")
if(ENABLE_RAW_UDP AND PCAP_FOUND)
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} custom_udp_signal_source.h)
list(APPEND OPT_DRIVER_SOURCES custom_udp_signal_source.cc)
list(APPEND OPT_DRIVER_HEADERS custom_udp_signal_source.h)
endif()
if(ENABLE_PLUTOSDR)
##############################################
# ADALM-PLUTO (Analog Devices Inc.)
@ -29,31 +26,27 @@ if(ENABLE_PLUTOSDR)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} ad936x_custom_signal_source.h)
endif()
if(ENABLE_FMCOMMS2)
###############################################
# FMCOMMS2 based SDR Hardware
###############################################
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} fmcomms2_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} fmcomms2_signal_source.h)
list(APPEND OPT_DRIVER_SOURCES fmcomms2_signal_source.cc)
list(APPEND OPT_DRIVER_HEADERS fmcomms2_signal_source.h)
endif()
if(ENABLE_AD9361)
###############################################
# AD9361 DIRECT TO FPGA Hardware
###############################################
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} ad9361_fpga_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} ad9361_fpga_signal_source.h)
list(APPEND OPT_DRIVER_SOURCES ad9361_fpga_signal_source.cc)
list(APPEND OPT_DRIVER_HEADERS ad9361_fpga_signal_source.h)
endif()
if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND)
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h)
list(APPEND OPT_DRIVER_SOURCES flexiband_signal_source.cc)
list(APPEND OPT_DRIVER_HEADERS flexiband_signal_source.h)
endif()
if(ENABLE_ARRAY)
##############################################
# DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE
@ -62,32 +55,30 @@ if(ENABLE_ARRAY)
message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc")
message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled")
endif()
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} raw_array_signal_source.h)
list(APPEND OPT_DRIVER_SOURCES raw_array_signal_source.cc)
list(APPEND OPT_DRIVER_HEADERS raw_array_signal_source.h)
endif()
if(ENABLE_OSMOSDR)
################################################################################
# OsmoSDR - https://osmocom.org/projects/gr-osmosdr/
################################################################################
if(GROSMOSDR_FOUND)
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} osmosdr_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} osmosdr_signal_source.h)
list(APPEND OPT_DRIVER_SOURCES osmosdr_signal_source.cc)
list(APPEND OPT_DRIVER_HEADERS osmosdr_signal_source.h)
endif()
endif()
if(ENABLE_LIMESDR)
if(GRLIMESDR_FOUND)
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} limesdr_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} limesdr_signal_source.h)
list(APPEND OPT_DRIVER_SOURCES limesdr_signal_source.cc)
list(APPEND OPT_DRIVER_HEADERS limesdr_signal_source.h)
endif()
endif()
if(ENABLE_UHD)
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h)
list(APPEND OPT_DRIVER_SOURCES uhd_signal_source.cc)
list(APPEND OPT_DRIVER_HEADERS uhd_signal_source.h)
endif()
if(ENABLE_ZMQ)
@ -95,7 +86,6 @@ if(ENABLE_ZMQ)
list(APPEND OPT_DRIVER_HEADERS zmq_signal_source.h)
endif()
set(SIGNAL_SOURCE_ADAPTER_SOURCES
signal_source_base.cc
file_source_base.cc
@ -226,7 +216,6 @@ if(ENABLE_LIMESDR AND GRLIMESDR_FOUND)
)
endif()
if(ENABLE_AD9361 AND LIBIIO_FOUND)
target_link_libraries(signal_source_adapters
PRIVATE
@ -310,8 +299,6 @@ target_compile_definitions(signal_source_adapters
PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
)
set_property(TARGET signal_source_adapters
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

View File

@ -610,7 +610,7 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &filename0_, cons
// rx signal vectors
std::vector<int8_t> input_samples(sample_block_size * 2); // complex samples
// pointer to DMA buffer
std::array<int8_t, BUFFER_SIZE> *dma_buffer;
int8_t *dma_buffer;
int nread_elements = 0; // num bytes read from the file corresponding to frequency band 1
bool run_DMA = true;
@ -631,8 +631,8 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &filename0_, cons
// if only one file is enabled then clear the samples corresponding to the frequency band that is not used.
for (int index0 = 0; index0 < (nread_elements); index0 += 2)
{
(*dma_buffer)[dma_index + (2 - dma_buff_offset_pos)] = 0;
(*dma_buffer)[dma_index + 1 + (2 - dma_buff_offset_pos)] = 0;
dma_buffer[dma_index + (2 - dma_buff_offset_pos)] = 0;
dma_buffer[dma_index + 1 + (2 - dma_buff_offset_pos)] = 0;
dma_index += 4;
}
}
@ -673,8 +673,8 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &filename0_, cons
for (int index0 = 0; index0 < (nread_elements); index0 += 2)
{
// dma_buff_offset_pos is 1 for the L1 band and 0 for the other bands
(*dma_buffer)[dma_index + dma_buff_offset_pos] = input_samples[index0];
(*dma_buffer)[dma_index + 1 + dma_buff_offset_pos] = input_samples[index0 + 1];
dma_buffer[dma_index + dma_buff_offset_pos] = input_samples[index0];
dma_buffer[dma_index + 1 + dma_buff_offset_pos] = input_samples[index0 + 1];
dma_index += 4;
}
@ -704,8 +704,8 @@ void Ad9361FpgaSignalSource::run_DMA_process(const std::string &filename0_, cons
for (int index0 = 0; index0 < (nread_elements); index0 += 2)
{
// filename2 is never the L1 band
(*dma_buffer)[dma_index] = input_samples[index0];
(*dma_buffer)[dma_index + 1] = input_samples[index0 + 1];
dma_buffer[dma_index] = input_samples[index0];
dma_buffer[dma_index + 1] = input_samples[index0 + 1];
dma_index += 4;
}
}

View File

@ -23,7 +23,11 @@
#include "concurrent_queue.h"
#include "fpga_buffer_monitor.h"
#include "fpga_dma.h"
#if INTPTR_MAX == INT64_MAX // 64-bit processor architecture
#include "fpga_dma-proxy.h"
#else
#include "fpga_ezdma.h"
#endif
#include "fpga_dynamic_bit_selection.h"
#include "fpga_switch.h"
#include "gnss_block_interface.h"

View File

@ -25,17 +25,22 @@
using namespace std::string_literals;
CustomUDPSignalSource::CustomUDPSignalSource(const ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
const std::string& role,
unsigned int in_stream,
unsigned int out_stream,
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused)))
: SignalSourceBase(configuration, role, "Custom_UDP_Signal_Source"s),
item_size_(sizeof(gr_complex)),
RF_channels_(configuration->property(role + ".RF_channels", 1)),
channels_in_udp_(configuration->property(role + ".channels_in_udp", 1)),
in_stream_(in_stream),
out_stream_(out_stream)
out_stream_(out_stream),
IQ_swap_(configuration->property(role + ".IQ_swap", false)),
dump_(configuration->property(role + ".dump", false))
{
// DUMP PARAMETERS
const std::string default_dump_file("./data/signal_source.dat");
const std::string default_item_type("gr_complex");
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
// network PARAMETERS
@ -47,10 +52,6 @@ CustomUDPSignalSource::CustomUDPSignalSource(const ConfigurationInterface* confi
int port = configuration->property(role + ".port", default_port);
int payload_bytes = configuration->property(role + ".payload_bytes", 1024);
RF_channels_ = configuration->property(role + ".RF_channels", 1);
channels_in_udp_ = configuration->property(role + ".channels_in_udp", 1);
IQ_swap_ = configuration->property(role + ".IQ_swap", false);
const std::string default_sample_type("cbyte");
const std::string sample_type = configuration->property(role + ".sample_type", default_sample_type);
item_type_ = configuration->property(role + ".item_type", default_item_type);

View File

@ -74,9 +74,8 @@ private:
int channels_in_udp_;
unsigned int in_stream_;
unsigned int out_stream_;
bool dump_;
bool IQ_swap_;
bool dump_;
};

View File

@ -25,17 +25,21 @@
using namespace std::string_literals;
LabsatSignalSource::LabsatSignalSource(const ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue)
: SignalSourceBase(configuration, role, "Labsat_Signal_Source"s), in_stream_(in_stream), out_stream_(out_stream)
const std::string& role,
unsigned int in_stream,
unsigned int out_stream,
Concurrent_Queue<pmt::pmt_t>* queue)
: SignalSourceBase(configuration, role, "Labsat_Signal_Source"s),
in_stream_(in_stream),
out_stream_(out_stream),
enable_throttle_control_(configuration->property(role + ".enable_throttle_control", false)),
dump_(configuration->property(role + ".dump", false))
{
const std::string default_item_type("gr_complex");
const std::string default_dump_file("./labsat_output.dat");
item_type_ = configuration->property(role + ".item_type", default_item_type);
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false);
const int64_t sampling_frequency_deprecated = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(16368000));
const int64_t throttle_frequency_sps = configuration->property(role + ".throttle_frequency_sps", static_cast<int64_t>(sampling_frequency_deprecated));

View File

@ -34,29 +34,30 @@ RtlTcpSignalSource::RtlTcpSignalSource(const ConfigurationInterface* configurati
unsigned int in_stream,
unsigned int out_stream,
Concurrent_Queue<pmt::pmt_t>* queue)
: SignalSourceBase(configuration, role, "RtlTcp_Signal_Source"s), in_stream_(in_stream), out_stream_(out_stream)
: SignalSourceBase(configuration, role, "RtlTcp_Signal_Source"s),
samples_(configuration->property(role + ".samples", static_cast<uint64_t>(0))),
rf_gain_(configuration->property(role + ".rf_gain", 40.0)),
sample_rate_(configuration->property(role + ".sampling_frequency", 2000000)),
freq_(configuration->property(role + ".freq", static_cast<int>(GPS_L1_FREQ_HZ))),
gain_(configuration->property(role + ".gain", 40)),
if_gain_(configuration->property(role + ".if_gain", 40)),
in_stream_(in_stream),
out_stream_(out_stream),
AGC_enabled_(configuration->property(role + ".AGC_enabled", true)),
flip_iq_(configuration->property(role + ".flip_iq", false)),
dump_(configuration->property(role + ".dump", false))
{
// DUMP PARAMETERS
const std::string default_dump_file("./data/signal_source.dat");
const std::string default_item_type("gr_complex");
samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0));
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename",
default_dump_file);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
// rtl_tcp PARAMETERS
const std::string default_address("127.0.0.1");
const int16_t default_port = 1234;
AGC_enabled_ = configuration->property(role + ".AGC_enabled", true);
freq_ = configuration->property(role + ".freq", static_cast<int>(GPS_L1_FREQ_HZ));
gain_ = configuration->property(role + ".gain", 40);
rf_gain_ = configuration->property(role + ".rf_gain", 40.0);
if_gain_ = configuration->property(role + ".if_gain", 40);
sample_rate_ = configuration->property(role + ".sampling_frequency", 2000000);
item_type_ = configuration->property(role + ".item_type", default_item_type);
address_ = configuration->property(role + ".address", default_address);
port_ = configuration->property(role + ".port", default_port);
flip_iq_ = configuration->property(role + ".flip_iq", false);
if (item_type_ == "short")
{

View File

@ -78,11 +78,11 @@ private:
std::string address_;
size_t item_size_;
uint64_t samples_;
double rf_gain_;
int sample_rate_;
int freq_;
int gain_;
int if_gain_;
double rf_gain_;
unsigned int in_stream_;
unsigned int out_stream_;
int16_t port_;

View File

@ -29,27 +29,29 @@
using namespace std::string_literals;
SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInterface* configuration,
const std::string& role, uint32_t in_streams, uint32_t out_streams, Concurrent_Queue<pmt::pmt_t>* queue)
const std::string& role,
uint32_t in_streams,
uint32_t out_streams,
Concurrent_Queue<pmt::pmt_t>* queue)
: SignalSourceBase(configuration, role, "Spir_GSS6450_File_Signal_Source"s),
item_type_("int"),
samples_(configuration->property(role + ".samples", static_cast<uint64_t>(0))),
sampling_frequency_(configuration->property(role + ".sampling_frequency", static_cast<int64_t>(0))),
item_size_(sizeof(int32_t)),
in_streams_(in_streams),
out_streams_(out_streams)
out_streams_(out_streams),
adc_bits_(configuration->property(role + ".adc_bits", 4)),
n_channels_(configuration->property(role + ".total_channels", 1)),
sel_ch_(configuration->property(role + ".sel_ch", 1)),
repeat_(configuration->property(role + ".repeat", false)),
dump_(configuration->property(role + ".dump", false)),
enable_throttle_control_(configuration->property(role + ".enable_throttle_control", false)),
endian_swap_(configuration->property(role + ".endian", false))
{
const std::string default_filename("../data/my_capture.dat");
const std::string default_dump_filename("../data/my_capture_dump.dat");
samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0));
sampling_frequency_ = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(0));
filename_ = configuration->property(role + ".filename", default_filename);
repeat_ = configuration->property(role + ".repeat", false);
dump_ = configuration->property(role + ".dump", false);
endian_swap_ = configuration->property(role + ".endian", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false);
adc_bits_ = configuration->property(role + ".adc_bits", 4);
n_channels_ = configuration->property(role + ".total_channels", 1);
sel_ch_ = configuration->property(role + ".sel_ch", 1);
const int64_t bytes_seek = configuration->property(role + ".bytes_to_skip", static_cast<int64_t>(65536));
const double sample_size_byte = static_cast<double>(adc_bits_) / 4.0;
@ -190,7 +192,6 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block)
if (n_channels_ > 1)
{
uint32_t aux = 0;
for (int32_t i = 0; i < n_channels_; i++)
{
if (i != (sel_ch_ - 1))
@ -204,8 +205,6 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block)
{
top_block->connect(deint_, i, unpack_spir_vec_.at(i), 0);
}
aux++;
}
}
}
@ -251,7 +250,6 @@ void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block)
}
if (n_channels_ > 1)
{
uint32_t aux = 0;
for (int32_t i = 0; i < n_channels_; i++)
{
if (i != (sel_ch_ - 1))
@ -265,8 +263,6 @@ void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block)
{
top_block->disconnect(deint_, i, unpack_spir_vec_.at(i), 0);
}
aux++;
}
}
}

View File

@ -5,11 +5,9 @@
# SPDX-License-Identifier: BSD-3-Clause
set(OPT_DRIVER_SOURCES "")
set(OPT_DRIVER_HEADERS "")
if(ENABLE_RAW_UDP AND PCAP_FOUND)
set(OPT_DRIVER_SOURCES gr_complex_ip_packet_source.cc)
set(OPT_DRIVER_HEADERS gr_complex_ip_packet_source.h)
list(APPEND OPT_DRIVER_SOURCES gr_complex_ip_packet_source.cc)
list(APPEND OPT_DRIVER_HEADERS gr_complex_ip_packet_source.h)
endif()
if(ENABLE_AD936X_SDR)
@ -23,7 +21,6 @@ if(ENABLE_PLUTOSDR)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} ad936x_iio_source.h)
endif()
set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES
fifo_reader.cc
unpack_byte_2bit_samples.cc
@ -38,7 +35,6 @@ set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES
${OPT_DRIVER_SOURCES}
)
set(SIGNAL_SOURCE_GR_BLOCKS_HEADERS
fifo_reader.h
unpack_byte_2bit_samples.h
@ -147,6 +143,17 @@ else()
)
endif()
if(Boost_VERSION_STRING VERSION_GREATER "1.57.99")
target_compile_definitions(signal_source_gr_blocks
PRIVATE
-DHAS_BOOST_ENDIAN=1
)
target_link_libraries(signal_source_gr_blocks
PRIVATE
Boost::headers
)
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(signal_source_gr_blocks

View File

@ -32,6 +32,10 @@
#include <sstream>
#include <utility>
#if HAS_BOOST_ENDIAN
#include <boost/endian/conversion.hpp>
#endif
labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, const std::vector<int> &channel_selector, Concurrent_Queue<pmt::pmt_t> *queue, bool digital_io_enabled)
{
@ -737,7 +741,8 @@ void labsat23_source::decode_ls3w_register(uint64_t input, std::vector<gr_comple
{
std::bitset<64> bs(input);
// Reverse, since register are written to file as 64-bit little endian words
// Earlier samples are written in the MSBs of the register. Bit-reverse the register
// for easier indexing. Note this bit-reverses individual samples as well for quant > 1 bit
for (std::size_t i = 0; i < 32; ++i)
{
bool t = bs[i];
@ -1074,14 +1079,20 @@ int labsat23_source::general_work(int noutput_items,
std::size_t output_pointer = 0;
for (int i = 0; i < registers_to_read; i++)
{
uint64_t read_register = 0ULL;
// Labsat3W writes its 64-bit shift register to files in little endian. Read and convert to host endianness.
#if HAS_BOOST_ENDIAN
binary_input_file.read(reinterpret_cast<char *>(&read_register), sizeof(read_register));
boost::endian::little_to_native_inplace(read_register);
#else
std::array<char, 8> memory_block{};
binary_input_file.read(memory_block.data(), 8);
uint64_t read_register = 0ULL;
for (int k = 7; k >= 0; --k)
{
read_register <<= 8;
read_register |= uint64_t(memory_block[k]);
read_register |= uint64_t(memory_block[k]); // This is buggy if the MSB of the char is set.
}
#endif
if (binary_input_file.gcount() == 8)
{

View File

@ -19,8 +19,13 @@ if(ENABLE_FPGA OR ENABLE_AD9361)
set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_dynamic_bit_selection.h)
set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_buffer_monitor.cc)
set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_buffer_monitor.h)
set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_dma.cc)
set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_dma.h)
if(ARCH_64BITS)
set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_dma-proxy.cc)
set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_dma-proxy.h)
else()
set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_ezdma.cc)
set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_ezdma.h)
endif()
endif()

Some files were not shown because too many files have changed in this diff Show More