1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-10-31 23:26:22 +00:00

Merge branch 'next' of git+ssh://github.com/gnss-sdr/gnss-sdr into next

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
This commit is contained in:
Carles Fernandez 2014-09-29 22:25:54 +02:00
commit 897043d9d8
7 changed files with 147 additions and 20 deletions

View File

@ -45,6 +45,7 @@ Daniel Fehr daniel.co@bluewin.ch Developer
Marc Sales marcsales92@gmail.com Developer
Damian Miralles dmiralles2009@gmail.com Developer
Leonardo Tonetto tonetto.dev@gmail.com Contributor
Anthony Arnold anthony.arnold@uqconnect.edu.au Contributor
Ignacio Paniego ignacio.paniego@gmail.com Web design
Eva Puchol eva.puchol@gmail.com Web developer
Carlos Paniego carpanie@hotmail.com Artwork

View File

@ -0,0 +1,83 @@
##############################################################################
# check if the compiler defines the architecture as ARM and set the
# version, if found.
#
# - Anthony Arnold
##############################################################################
if (__TEST_FOR_ARM_INCLUDED)
return ()
endif()
set(__TEST_FOR_ARM_INCLUDED TRUE)
# Function checks if the input string defines ARM version and sets the
# output variable if found.
function(check_arm_version ppdef input_string version output_var)
string(REGEX MATCH "${ppdef}" _VERSION_MATCH "${input_string}")
if (NOT _VERSION_MATCH STREQUAL "")
set(${output_var} "${version}" PARENT_SCOPE)
endif(NOT _VERSION_MATCH STREQUAL "")
endfunction()
message(STATUS "Checking for ARM")
set (IS_ARM NO)
set (ARM_VERSION "")
if (CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND echo "int main(){}"
COMMAND ${CMAKE_CXX_COMPILER} -dM -E -
OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS)
string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}")
if (NOT ARM_FOUND STREQUAL "")
set(IS_ARM YES)
message(STATUS "ARM system detected")
# detect the version
check_arm_version("__ARM_ARCH_2__" ${TEST_FOR_ARM_RESULTS} "armv2" ARM_VERSION)
check_arm_version("__ARM_ARCH_2A__" ${TEST_FOR_ARM_RESULTS} "armv2a" ARM_VERSION)
check_arm_version("__ARM_ARCH_3__" ${TEST_FOR_ARM_RESULTS} "armv3" ARM_VERSION)
check_arm_version("__ARM_ARCH_3M__" ${TEST_FOR_ARM_RESULTS} "armv3m" ARM_VERSION)
check_arm_version("__ARM_ARCH_4__" ${TEST_FOR_ARM_RESULTS} "armv4" ARM_VERSION)
check_arm_version("__ARM_ARCH_4T__" ${TEST_FOR_ARM_RESULTS} "armv4t" ARM_VERSION)
check_arm_version("__ARM_ARCH_5__" ${TEST_FOR_ARM_RESULTS} "armv5" ARM_VERSION)
check_arm_version("__ARM_ARCH_5T__" ${TEST_FOR_ARM_RESULTS} "armv5t" ARM_VERSION)
check_arm_version("__ARM_ARCH_5E__" ${TEST_FOR_ARM_RESULTS} "armv5e" ARM_VERSION)
check_arm_version("__ARM_ARCH_5TE__" ${TEST_FOR_ARM_RESULTS} "armv5te" ARM_VERSION)
check_arm_version("__ARM_ARCH_6__" ${TEST_FOR_ARM_RESULTS} "armv6" ARM_VERSION)
check_arm_version("__ARM_ARCH_6J__" ${TEST_FOR_ARM_RESULTS} "armv6j" ARM_VERSION)
check_arm_version("__ARM_ARCH_6K__" ${TEST_FOR_ARM_RESULTS} "armv6k" ARM_VERSION)
check_arm_version("__ARM_ARCH_6T2__" ${TEST_FOR_ARM_RESULTS} "armv6t2" ARM_VERSION)
check_arm_version("__ARM_ARCH_6Z__" ${TEST_FOR_ARM_RESULTS} "armv6z" ARM_VERSION)
check_arm_version("__ARM_ARCH_6ZK__" ${TEST_FOR_ARM_RESULTS} "armv6zk" ARM_VERSION)
check_arm_version("__ARM_ARCH_6M__" ${TEST_FOR_ARM_RESULTS} "armv6-m" ARM_VERSION)
check_arm_version("__ARM_ARCH_7__" ${TEST_FOR_ARM_RESULTS} "armv7" ARM_VERSION)
check_arm_version("__ARM_ARCH_7A__" ${TEST_FOR_ARM_RESULTS} "armv7-a" ARM_VERSION)
check_arm_version("__ARM_ARCH_7M__" ${TEST_FOR_ARM_RESULTS} "armv7-m" ARM_VERSION)
check_arm_version("__ARM_ARCH_7R__" ${TEST_FOR_ARM_RESULTS} "armv7-r" ARM_VERSION)
check_arm_version("__ARM_ARCH_7EM_" ${TEST_FOR_ARM_RESULTS} "armv7e-m" ARM_VERSION)
check_arm_version("__ARM_ARCH_7VE__" ${TEST_FOR_ARM_RESULTS} "armv7ve" ARM_VERSION)
check_arm_version("__ARM_ARCH_8A__" ${TEST_FOR_ARM_RESULTS} "armv8-a" ARM_VERSION)
# anything else just define as arm
if (ARM_VERSION STREQUAL "")
message(STATUS "Couldn't detect ARM version. Setting to 'arm'")
set(ARM_VERSION "arm")
else (ARM_VERSION STREQUAL "")
message(STATUS "ARM version ${ARM_VERSION} detected")
endif (ARM_VERSION STREQUAL "")
else (NOT ARM_FOUND STREQUAL "")
message(STATUS "System is not ARM")
endif(NOT ARM_FOUND STREQUAL "")
else (CMAKE_COMPILE_IS_GNUCXX)
# TODO: Other compilers
message(STATUS "Not detecting ARM on non-GNUCXX compiler. Defaulting to false")
message(STATUS "If you are compiling for ARM, set IS_ARM=ON manually")
endif(CMAKE_COMPILER_IS_GNUCXX)
set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM")
set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version")

View File

@ -0,0 +1,36 @@
###############################################################################
# Test for availability of SSE
#
# - Anthony Arnold
###############################################################################
function (test_for_sse h_file result_var name)
if (NOT DEFINED ${result_var})
execute_process(COMMAND echo "#include <${h_file}>"
COMMAND ${CMAKE_CXX_COMPILER} -c -x c++ -
RESULT_VARIABLE COMPILE_RESULT
OUTPUT_QUIET ERROR_QUIET)
if (COMPILE_RESULT EQUAL 0)
message(STATUS "Detected ${name}")
endif(COMPILE_RESULT EQUAL 0)
set(${result_var} ${compile_result} CACHE INTERNAL "${name} Available")
endif (NOT DEFINED ${result_var})
endfunction(test_for_sse)
message(STATUS "Testing for SIMD extensions")
enable_language(C)
test_for_sse("ammintrin.h" SSE4A_AVAILABLE "SSE4A")
test_for_sse("nmmintrin.h" SSE4_2_AVAILABLE "SSE4.2")
test_for_sse("smmintrin.h" SSE4_1_AVAILABLE "SSE4.1")
test_for_sse("tmmintrin.h" SSSE3_AVAILABLE "SSSE3")
test_for_sse("pmmintrin.h" SSE3_AVAILABLE "SSE3")
test_for_sse("emmintrin.h" SSE2_AVAILABLE "SSE2")
test_for_sse("xmmintrin.h" SSE_AVAILABLE "SSE1")
test_for_sse("mmintrin.h" MMX_AVAILABLE "MMX")
test_for_sse("wmmintrin.h" AES_AVAILABLE "AES")
test_for_sse("immintrin.h" AVX_AVAILABLE "AVX")

View File

@ -365,7 +365,7 @@ int Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::general_work (int noutput_items, gr_vec
update_local_carrier();
// perform Early, Prompt and Late correlation
#ifndef GENERIC_ARCH
#if USING_VOLK_CW_EPL_CORR_CUSTOM
d_correlator.Carrier_wipeoff_and_EPL_volk_custom(d_current_prn_length_samples,
in,
d_carr_sign,

View File

@ -40,6 +40,10 @@ if(ENABLE_GENERIC_ARCH)
add_definitions( -DGENERIC_ARCH=1 )
endif(ENABLE_GENERIC_ARCH)
if (SSE3_AVAILABLE)
add_definitions( -DHAVE_SSE3=1 )
endif(SSE3_AVAILABLE)
file(GLOB TRACKING_LIB_HEADERS "*.h")
add_library(tracking_lib ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS})
source_group(Headers FILES ${TRACKING_LIB_HEADERS})

View File

@ -36,7 +36,7 @@
#include "correlator.h"
#include <iostream>
#ifndef GENERIC_ARCH
#if USING_VOLK_CW_EPL_CORR_CUSTOM
#define LV_HAVE_SSE3
#include "volk_cw_epl_corr.h"
#endif
@ -145,7 +145,7 @@ Correlator::~Correlator ()
{}
#ifndef GENERIC_ARCH
#if USING_VOLK_CW_EPL_CORR_CUSTOM
void Correlator::Carrier_wipeoff_and_EPL_volk_custom(int signal_length_samples, const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code, gr_complex* E_out, gr_complex* P_out, gr_complex* L_out)
{
volk_cw_epl_corr_u(input, carrier, E_code, P_code, L_code, E_out, P_out, L_out, signal_length_samples);

View File

@ -41,6 +41,9 @@
#include <volk/volk.h>
#include <gnuradio/gr_complex.h>
#if !defined(GENERIC_ARCH) && HAVE_SSE3
#define USING_VOLK_CW_EPL_CORR_CUSTOM 1
#endif
/*!
* \brief Class that implements carrier wipe-off and correlators.
@ -60,8 +63,8 @@ public:
void Carrier_wipeoff_and_EPL_volk_IQ(int signal_length_samples, const gr_complex* input, gr_complex* carrier, gr_complex* E_code, gr_complex* P_code, gr_complex* L_code, gr_complex* P_data_code, gr_complex* E_out, gr_complex* P_out, gr_complex* L_out, gr_complex* P_data_out);
Correlator();
~Correlator();
#ifndef GENERIC_ARCH
void Carrier_wipeoff_and_EPL_volk_custom(int signal_length_samples, const gr_complex* input, gr_complex* carrier, gr_complex* E_code, gr_complex* P_code, gr_complex* L_code, gr_complex* E_out, gr_complex* P_out, gr_complex* L_out);
#if USING_VOLK_CW_EPL_CORR_CUSTOM
void Carrier_wipeoff_and_EPL_volk_custom(int signal_length_samples, const gr_complex* input, gr_complex* carrier, gr_complex* E_code, gr_complex* P_code, gr_complex* L_code, gr_complex* E_out, gr_complex* P_out, gr_complex* L_out, bool input_vector_unaligned);
#endif
private: