From 040204d23a0ea9630769b930755aa587370c6685 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 28 Mar 2018 15:20:01 +0200 Subject: [PATCH 1/2] Cleaning --- .../acquisition/libs/CMakeLists.txt | 50 +------------------ .../libs/gps_fpga_acquisition_8sc.cc | 18 +++---- 2 files changed, 10 insertions(+), 58 deletions(-) diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index 702ee57b8..53feb9366 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -16,40 +16,11 @@ # along with GNSS-SDR. If not, see . # - -#if(ENABLE_CUDA) -# # Append current NVCC flags by something, eg comput capability -# # set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --gpu-architecture sm_30) -# list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_30,code=sm_30; -std=c++11;-O3; -use_fast_math -default-stream per-thread") -# set(CUDA_PROPAGATE_HOST_FLAGS OFF) -# CUDA_INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}) -# set(LIB_TYPE STATIC) #set the lib type -# CUDA_ADD_LIBRARY(CUDA_CORRELATOR_LIB ${LIB_TYPE} cuda_multicorrelator.h cuda_multicorrelator.cu) -# set(OPT_TRACKING_LIBRARIES ${OPT_TRACKING_LIBRARIES} CUDA_CORRELATOR_LIB) -# set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS} ) -#endif(ENABLE_CUDA) - - - -#set(TRACKING_LIB_SOURCES + set(ACQUISITION_LIB_SOURCES gps_fpga_acquisition_8sc.cc -# cpu_multicorrelator.cc -# cpu_multicorrelator_16sc.cc -# lock_detectors.cc -# tcp_communication.cc -# tcp_packet_data.cc -# tracking_2nd_DLL_filter.cc -# tracking_2nd_PLL_filter.cc -# tracking_discriminators.cc -# tracking_FLL_PLL_filter.cc -# tracking_loop_filter.cc ) -#if(ENABLE_FPGA) -# SET(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} fpga_acquisition_8sc.cc) -#endif(ENABLE_FPGA) - include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core/system_parameters @@ -59,34 +30,17 @@ include_directories( ${VOLK_INCLUDE_DIRS} ${GLOG_INCLUDE_DIRS} ${GFlags_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDES} ${VOLK_GNSSSDR_INCLUDE_DIRS} ) -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") file(GLOB ACQUISITION_LIB_HEADERS "*.h") -#list(SORT TRACKING_LIB_HEADERS) list(SORT ACQUISITION_LIB_HEADERS) -#add_library(tracking_lib ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS}) add_library(acquisition_lib ${ACQUISITION_LIB_SOURCES} ${ACQUISITION_LIB_HEADERS}) -#source_group(Headers FILES ${TRACKING_LIB_HEADERS}) source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) -#target_link_libraries(tracking_lib ${OPT_TRACKING_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}) -target_link_libraries(acquisition_lib ${OPT_ACQUISITION_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}) +target_link_libraries(acquisition_lib ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES}) if(VOLK_GNSSSDR_FOUND) -# add_dependencies(tracking_lib glog-${glog_RELEASE}) add_dependencies(acquisition_lib glog-${glog_RELEASE}) else(VOLK_GNSSSDR_FOUND) -# add_dependencies(tracking_lib glog-${glog_RELEASE} volk_gnsssdr_module) add_dependencies(acquisition_lib glog-${glog_RELEASE} volk_gnsssdr_module) endif() diff --git a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc index 1cfc34c50..6ffd0225f 100644 --- a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc +++ b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc @@ -35,34 +35,32 @@ #include "gps_fpga_acquisition_8sc.h" #include "gps_sdr_signal_processing.h" +#include "GPS_L1_CA.h" #include +#include // allocate memory dynamically #include // libraries used by DMA test code and GIPO test code -#include +#include #include #include -#include +#include // libraries used by DMA test code #include -#include -#include -#include +#include +#include // libraries used by GPIO test code -#include -#include +#include +#include #include // logging #include -#include - -#include "GPS_L1_CA.h" #define PAGE_SIZE 0x10000 #define MAX_PHASE_STEP_RAD 0.999999999534339 // 1 - pow(2,-31); From aefcb8dac16da43fa887a8969e5c12600048ca93 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 28 Mar 2018 16:04:00 +0200 Subject: [PATCH 2/2] Replace C-style cast by C++ style --- src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc index 6ffd0225f..b1a855a11 100644 --- a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc +++ b/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc @@ -108,7 +108,7 @@ gps_fpga_acquisition_8sc::gps_fpga_acquisition_8sc(std::string device_name, // allocate memory to compute all the PRNs // and compute all the possible codes std::complex* code = new std::complex[nsamples_total]; // buffer for the local code - std::complex* code_total = new gr_complex[vector_length]; // buffer for the local code repeate every number of ms + std::complex* code_total = new gr_complex[vector_length]; // buffer for the local code repeat every number of ms gr_complex* d_fft_codes_padded = static_cast(volk_gnsssdr_malloc(vector_length * sizeof(gr_complex), volk_gnsssdr_get_alignment())); @@ -250,8 +250,8 @@ void gps_fpga_acquisition_8sc::set_phase_step(unsigned int doppler_index) { phase_step_rad_real = MAX_PHASE_STEP_RAD; } - phase_step_rad_int_temp = phase_step_rad_real * 4; // * 2^2 - phase_step_rad_int = (int32_t)(phase_step_rad_int_temp * (536870912)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings + phase_step_rad_int_temp = phase_step_rad_real * 4; // * 2^2 + phase_step_rad_int = static_cast(phase_step_rad_int_temp * (536870912)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings d_map_base[3] = phase_step_rad_int; }