diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a73c0932..74c539020 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -631,22 +631,20 @@ set(FILESYSTEM_FOUND FALSE)
if(NOT (GNURADIO_VERSION VERSION_LESS 3.8) AND LOG4CPP_READY_FOR_CXX17)
# Check if we have std::filesystem
if(NOT (CMAKE_VERSION VERSION_LESS 3.8))
- if((NOT ENABLE_UNIT_TESTING_EXTRA) AND (NOT ENABLE_SYSTEM_TESTING_EXTRA) AND (NOT ENABLE_FPGA)) # Workaround for GPSTk
- find_package(FILESYSTEM COMPONENTS Final Experimental)
- set_package_properties(FILESYSTEM PROPERTIES
- URL "https://en.cppreference.com/w/cpp/filesystem"
- DESCRIPTION "Provides facilities for performing operations on file systems and their components"
- PURPOSE "Work with paths, regular files, and directories."
- TYPE OPTIONAL
- )
- if(${FILESYSTEM_FOUND})
- if(CMAKE_VERSION VERSION_LESS 3.12)
- set(CMAKE_CXX_STANDARD 17)
- else()
- set(CMAKE_CXX_STANDARD 20)
- endif()
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
+ find_package(FILESYSTEM COMPONENTS Final Experimental)
+ set_package_properties(FILESYSTEM PROPERTIES
+ URL "https://en.cppreference.com/w/cpp/filesystem"
+ DESCRIPTION "Provides facilities for performing operations on file systems and their components"
+ PURPOSE "Work with paths, regular files, and directories."
+ TYPE OPTIONAL
+ )
+ if(${FILESYSTEM_FOUND})
+ if(CMAKE_VERSION VERSION_LESS 3.12)
+ set(CMAKE_CXX_STANDARD 17)
+ else()
+ set(CMAKE_CXX_STANDARD 20)
endif()
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
endif()
endif()
diff --git a/README.md b/README.md
index 8fc927993..22c7d4c76 100644
--- a/README.md
+++ b/README.md
@@ -571,7 +571,7 @@ More details can be found in our tutorial about [GNSS-SDR configuration options
macOS and Mac OS X
---------
-GNSS-SDR can be built on MacOS or Mac OS X, starting from 10.9 (Mavericks) and including 10.14 (Mojave). If you still have not installed [Xcode](https://developer.apple.com/xcode/ "Xcode"), do it now from the App Store (it's free). You will also need the Xcode Command Line Tools. Launch the Terminal, found in /Applications/Utilities/, and type:
+GNSS-SDR can be built on MacOS or Mac OS X, starting from 10.9 (Mavericks) and including 10.15 (Catalina). If you still have not installed [Xcode](https://developer.apple.com/xcode/ "Xcode"), do it now from the App Store (it's free). You will also need the Xcode Command Line Tools. Launch the Terminal, found in /Applications/Utilities/, and type:
~~~~~~
$ xcode-select --install
diff --git a/docs/changelog b/docs/changelog
index 840f6f8e7..2d89e4f62 100644
--- a/docs/changelog
+++ b/docs/changelog
@@ -21,8 +21,9 @@
- Fixed PVT solution in receivers processing L1 plus L2C and/or L5 signals.
- Added RINEX files generation for triple-band configurations (L1 + L2C + L5 and L1 + E1 + L2C + L5 + E5a).
-- Fixed a bug in the decoding of BeiDou navigation messages.
+- Fixed bugs in the decoding of BeiDou navigation messages.
- Improved management of devices with the AD9361 RF transceiver.
+- Fixed bugs in FPGA off-loading.
### Improvements in Maintainability:
@@ -45,11 +46,17 @@
- Decoding of navigation messages no longer rely on implementation defined behavior for shifting left a signed integer.
- Removed usage of functions with insecure API (e.g., strcpy, sprintf).
+- New type alias volk_gnsssdr::vector allows both aligned memory allocation and automatic deallocation.
- Added clang-tidy checks clang-analyzer-security.*, clang-analyzer-optin.portability.UnixAPI clang-tidy checks. Fixed raised warnings.
- Fixed cpplint.py runtime/printf and runtime/explicit errors.
- All constructors callable with one argument are marked with the keyword explicit. See MISRA C++:2008, 12-1-3 - All constructors that are callable with a single argument of fundamental type shall be declared explicit.
+### Improvements in Testability:
+
+- Add receiver runtime to position_test report.
+
+
### Improvements in Usability:
- A new parameter allows to process raw sample files containing GPS L1 C/A signals dated before July 14, 2009.
diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc
index 92055b5ac..afcf81f92 100644
--- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc
+++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc
@@ -38,7 +38,7 @@
#include // for fft_complex
#include // for gr_complex
#include // for volk_32fc_conjugate_32fc
-#include
+#include
#include // for copy_n
#include // for abs, pow, floor
#include // for complex
@@ -99,8 +99,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
// compute all the GALILEO E1 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time
// a channel is assigned)
auto fft_if = std::unique_ptr(new gr::fft::fft_complex(nsamples_total, true)); // Direct FFT
- std::vector> code(nsamples_total); // buffer for the local code
- auto* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
+ volk_gnsssdr::vector> code(nsamples_total); // buffer for the local code
+ volk_gnsssdr::vector fft_codes_padded(nsamples_total);
d_all_fft_codes_ = std::vector(nsamples_total * GALILEO_E1_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search
@@ -138,9 +138,9 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
code[s] = std::complex(0.0, 0.0);
}
- std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer
- fft_if->execute(); // Run the FFT of local code
- volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values
+ std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer
+ fft_if->execute(); // Run the FFT of local code
+ volk_32fc_conjugate_32fc(fft_codes_padded.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values
// normalize the code
max = 0; // initialize maximum value
@@ -182,9 +182,6 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
doppler_step_ = 0;
gnss_synchro_ = nullptr;
- // temporary buffers that we can release
- volk_gnsssdr_free(fft_codes_padded);
-
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc
index f331d5d4e..c81e3c126 100644
--- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc
+++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc
@@ -38,7 +38,7 @@
#include // for fft_complex
#include // for gr_complex
#include // for volk_32fc_conjugate_32fc
-#include
+#include
#include // for copy_n
#include // for abs, pow, floor
#include // for complex
@@ -100,8 +100,8 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
// compute all the GALILEO E5 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time
// a channel is assigned)
auto fft_if = std::unique_ptr(new gr::fft::fft_complex(nsamples_total, true)); // Direct FFT
- std::vector> code(nsamples_total); // buffer for the local code
- auto* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
+ volk_gnsssdr::vector> code(nsamples_total);
+ volk_gnsssdr::vector> fft_codes_padded(nsamples_total);
d_all_fft_codes_ = std::vector(nsamples_total * GALILEO_E5A_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search
@@ -142,9 +142,9 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
code[s] = std::complex(0.0, 0.0);
}
- std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer
- fft_if->execute(); // Run the FFT of local code
- volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values
+ std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer
+ fft_if->execute(); // Run the FFT of local code
+ volk_32fc_conjugate_32fc(fft_codes_padded.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values
max = 0; // initialize maximum value
for (uint32_t i = 0; i < nsamples_total; i++) // search for maxima
@@ -185,9 +185,6 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
doppler_step_ = 0;
gnss_synchro_ = nullptr;
- // temporary buffers that we can release
- volk_gnsssdr_free(fft_codes_padded);
-
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc
index 4530cb821..39ccdb307 100644
--- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc
+++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc
@@ -41,7 +41,7 @@
#include
#include // for gr_complex
#include // for volk_32fc_conjugate_32fc
-#include
+#include
#include // for copy_n
#include // for abs, pow, floor
#include // for complex
@@ -93,8 +93,8 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
// a channel is assigned)
auto fft_if = std::unique_ptr(new gr::fft::fft_complex(nsamples_total, true));
// allocate memory to compute all the PRNs and compute all the possible codes
- std::vector> code(nsamples_total); // buffer for the local code
- auto* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
+ volk_gnsssdr::vector> code(nsamples_total);
+ volk_gnsssdr::vector> fft_codes_padded(nsamples_total);
d_all_fft_codes_ = std::vector(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32
float max;
int32_t tmp;
@@ -117,9 +117,9 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
code[s] = std::complex(0.0, 0.0);
}
- std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer
- fft_if->execute(); // Run the FFT of local code
- volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values
+ std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer
+ fft_if->execute(); // Run the FFT of local code
+ volk_32fc_conjugate_32fc(fft_codes_padded.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values
max = 0; // initialize maximum value
for (uint32_t i = 0; i < nsamples_total; i++) // search for maxima
@@ -161,9 +161,6 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
doppler_step_ = 0;
gnss_synchro_ = nullptr;
- // temporary buffers that we can release
- volk_gnsssdr_free(fft_codes_padded);
-
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc
index 866bbc498..0113711c2 100644
--- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc
+++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc
@@ -41,7 +41,7 @@
#include // for fft_complex
#include // for gr_complex
#include // for volk_32fc_conjugate_32fc
-#include
+#include
#include // for copy_n
#include // for abs, pow, floor
#include // for complex
@@ -94,8 +94,8 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
// a channel is assigned)
auto fft_if = std::unique_ptr(new gr::fft::fft_complex(nsamples_total, true)); // Direct FFT
// allocate memory to compute all the PRNs and compute all the possible codes
- std::vector> code(nsamples_total); // buffer for the local code
- auto* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
+ volk_gnsssdr::vector> code(nsamples_total);
+ volk_gnsssdr::vector> fft_codes_padded(nsamples_total);
d_all_fft_codes_ = std::vector(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search
@@ -112,11 +112,11 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
{
code[s] = std::complex(0.0, 0.0);
}
- std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer
- fft_if->execute(); // Run the FFT of local code
- volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values
- max = 0; // initialize maximum value
- for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima
+ std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer
+ fft_if->execute(); // Run the FFT of local code
+ volk_32fc_conjugate_32fc(fft_codes_padded.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values
+ max = 0; // initialize maximum value
+ for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima
{
if (std::abs(fft_codes_padded[i].real()) > max)
{
@@ -152,9 +152,6 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
threshold_ = 0.0;
- // temporary buffers that we can release
- volk_gnsssdr_free(fft_codes_padded);
-
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc
index 335ae1a66..4ec52ac37 100644
--- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc
+++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc
@@ -41,7 +41,7 @@
#include // for fft_complex
#include // for gr_complex
#include // for volk_32fc_conjugate_32fc
-#include
+#include
#include // for copy_n
#include // for abs, pow, floor
#include // for complex
@@ -97,8 +97,8 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
// compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time
// a channel is assigned)
auto fft_if = std::unique_ptr(new gr::fft::fft_complex(nsamples_total, true)); // Direct FFT
- std::vector> code(nsamples_total);
- auto* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
+ volk_gnsssdr::vector> code(nsamples_total);
+ volk_gnsssdr::vector> fft_codes_padded(nsamples_total);
d_all_fft_codes_ = std::vector(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search
@@ -121,9 +121,9 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
// fill in zero padding
code[s] = std::complex(0.0, 0.0);
}
- std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer
- fft_if->execute(); // Run the FFT of local code
- volk_32fc_conjugate_32fc(fft_codes_padded, fft_if->get_outbuf(), nsamples_total); // conjugate values
+ std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer
+ fft_if->execute(); // Run the FFT of local code
+ volk_32fc_conjugate_32fc(fft_codes_padded.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values
max = 0; // initialize maximum value
for (uint32_t i = 0; i < nsamples_total; i++) // search for maxima
@@ -164,9 +164,6 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
doppler_step_ = 0;
gnss_synchro_ = nullptr;
- // temporary buffers that we can release
- volk_gnsssdr_free(fft_codes_padded);
-
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt
index 6cc0041d8..860191fd1 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt
@@ -76,12 +76,11 @@ target_link_libraries(acquisition_gr_blocks
Gnuradio::runtime
Gnuradio::fft
Volk::volk
+ Volkgnsssdr::volkgnsssdr
PRIVATE
Gflags::gflags
Glog::glog
Matio::matio
- Volkgnsssdr::volkgnsssdr
-
)
target_include_directories(acquisition_gr_blocks
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc
index 8baaa7e1a..46d09882d 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc
@@ -135,9 +135,9 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu
acq_parameters.max_dwells = 1; // Activation of acq_parameters.bit_transition_flag invalidates the value of acq_parameters.max_dwells
}
- d_tmp_buffer = std::vector(d_fft_size);
- d_fft_codes = std::vector>(d_fft_size);
- d_input_signal = std::vector>(d_fft_size);
+ d_tmp_buffer = volk_gnsssdr::vector(d_fft_size);
+ d_fft_codes = volk_gnsssdr::vector>(d_fft_size);
+ d_input_signal = volk_gnsssdr::vector>(d_fft_size);
// Direct FFT
d_fft_if = std::make_shared(d_fft_size, true);
@@ -147,10 +147,10 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu
d_gnss_synchro = nullptr;
d_worker_active = false;
- d_data_buffer = std::vector>(d_consumed_samples);
+ d_data_buffer = volk_gnsssdr::vector>(d_consumed_samples);
if (d_cshort)
{
- d_data_buffer_sc = std::vector(d_consumed_samples);
+ d_data_buffer_sc = volk_gnsssdr::vector(d_consumed_samples);
}
grid_ = arma::fmat();
narrow_grid_ = arma::fmat();
@@ -304,16 +304,16 @@ void pcps_acquisition::init()
// Create the carrier Doppler wipeoff signals
if (d_grid_doppler_wipeoffs.empty())
{
- d_grid_doppler_wipeoffs = std::vector>>(d_num_doppler_bins, std::vector>(d_fft_size));
+ d_grid_doppler_wipeoffs = volk_gnsssdr::vector>>(d_num_doppler_bins, volk_gnsssdr::vector>(d_fft_size));
}
if (acq_parameters.make_2_steps && (d_grid_doppler_wipeoffs_step_two.empty()))
{
- d_grid_doppler_wipeoffs_step_two = std::vector>>(d_num_doppler_bins_step2, std::vector>(d_fft_size));
+ d_grid_doppler_wipeoffs_step_two = volk_gnsssdr::vector>>(d_num_doppler_bins_step2, volk_gnsssdr::vector>(d_fft_size));
}
if (d_magnitude_grid.empty())
{
- d_magnitude_grid = std::vector>(d_num_doppler_bins, std::vector(d_fft_size));
+ d_magnitude_grid = volk_gnsssdr::vector>(d_num_doppler_bins, volk_gnsssdr::vector(d_fft_size));
}
for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h
index 30ca0102e..6d4ff4bb6 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h
@@ -62,17 +62,17 @@
#include
#include
#include
-#include // for gr_complex
-#include // for scoped_lock
-#include // for gr_vector_const_void_star
-#include // for Guidelines Support Library
-#include // for lv_16sc_t
+#include // for gr_complex
+#include // for scoped_lock
+#include // for gr_vector_const_void_star
+#include // for Guidelines Support Library
+#include // for lv_16sc_t
+#include // for volk_gnsssdr::vector
#include
#include
#include
#include
#include
-#include
class Gnss_Synchro;
class pcps_acquisition;
@@ -243,14 +243,14 @@ private:
float d_test_statistics;
float d_doppler_center_step_two;
std::string d_dump_filename;
- std::vector> d_magnitude_grid;
- std::vector d_tmp_buffer;
- std::vector> d_input_signal;
- std::vector>> d_grid_doppler_wipeoffs;
- std::vector>> d_grid_doppler_wipeoffs_step_two;
- std::vector> d_fft_codes;
- std::vector> d_data_buffer;
- std::vector d_data_buffer_sc;
+ volk_gnsssdr::vector> d_magnitude_grid;
+ volk_gnsssdr::vector d_tmp_buffer;
+ volk_gnsssdr::vector> d_input_signal;
+ volk_gnsssdr::vector>> d_grid_doppler_wipeoffs;
+ volk_gnsssdr::vector>> d_grid_doppler_wipeoffs_step_two;
+ volk_gnsssdr::vector> d_fft_codes;
+ volk_gnsssdr::vector> d_data_buffer;
+ volk_gnsssdr::vector d_data_buffer_sc;
std::shared_ptr d_fft_if;
std::shared_ptr d_ifft;
std::weak_ptr d_channel_fsm;
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc
index 80028c607..23ac3b535 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc
@@ -47,10 +47,10 @@
#include
#include
#include
-#include
#include // std::rotate, std::fill_n
#include
#include
+#include
#if HAS_STD_FILESYSTEM
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
@@ -87,12 +87,9 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con
d_max_dwells = conf_.max_dwells;
d_gnuradio_forecast_samples = d_fft_size;
d_state = 0;
- d_carrier = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
- d_fft_codes = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
- d_magnitude = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment()));
-
- d_10_ms_buffer = static_cast(volk_gnsssdr_malloc(50 * d_samples_per_ms * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
-
+ d_fft_codes.reserve(d_fft_size);
+ d_magnitude.reserve(d_fft_size);
+ d_10_ms_buffer.reserve(50 * d_samples_per_ms);
// Direct FFT
d_fft_if = std::make_shared(d_fft_size, true);
@@ -175,7 +172,7 @@ void pcps_acquisition_fine_doppler_cc::set_doppler_step(unsigned int doppler_ste
d_num_doppler_points = floor(std::abs(2 * d_config_doppler_max) / d_doppler_step);
- d_grid_data = std::vector>(d_num_doppler_points, std::vector(d_fft_size));
+ d_grid_data = volk_gnsssdr::vector>(d_num_doppler_points, volk_gnsssdr::vector(d_fft_size));
if (d_dump)
{
@@ -186,21 +183,12 @@ void pcps_acquisition_fine_doppler_cc::set_doppler_step(unsigned int doppler_ste
}
-pcps_acquisition_fine_doppler_cc::~pcps_acquisition_fine_doppler_cc()
-{
- volk_gnsssdr_free(d_carrier);
- volk_gnsssdr_free(d_fft_codes);
- volk_gnsssdr_free(d_magnitude);
- volk_gnsssdr_free(d_10_ms_buffer);
-}
-
-
void pcps_acquisition_fine_doppler_cc::set_local_code(std::complex *code)
{
memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size);
d_fft_if->execute(); // We need the FFT of local code
// Conjugate the local code
- volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
+ volk_32fc_conjugate_32fc(d_fft_codes.data(), d_fft_if->get_outbuf(), d_fft_size);
}
@@ -247,7 +235,7 @@ void pcps_acquisition_fine_doppler_cc::update_carrier_wipeoff()
// create the carrier Doppler wipeoff signals
int doppler_hz;
float phase_step_rad;
- d_grid_doppler_wipeoffs = std::vector>>(d_num_doppler_points, std::vector>(d_fft_size));
+ d_grid_doppler_wipeoffs = volk_gnsssdr::vector>>(d_num_doppler_points, volk_gnsssdr::vector>(d_fft_size));
for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++)
{
doppler_hz = d_doppler_step * doppler_index - d_config_doppler_max;
@@ -338,8 +326,8 @@ float pcps_acquisition_fine_doppler_cc::estimate_input_power(gr_vector_const_voi
const auto *in = reinterpret_cast(input_items[0]); // Get the input samples pointer
// Compute the input signal power estimation
float power = 0;
- volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size);
- volk_32f_accumulator_s32f(&power, d_magnitude, d_fft_size);
+ volk_32fc_magnitude_squared_32f(d_magnitude.data(), in, d_fft_size);
+ volk_32f_accumulator_s32f(&power, d_magnitude.data(), d_fft_size);
power /= static_cast(d_fft_size);
return power;
}
@@ -357,7 +345,7 @@ int pcps_acquisition_fine_doppler_cc::compute_and_accumulate_grid(gr_vector_cons
<< ", doppler_step: " << d_doppler_step;
// 2- Doppler frequency search loop
- auto *p_tmp_vector = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(float), volk_gnsssdr_get_alignment()));
+ volk_gnsssdr::vector p_tmp_vector(d_fft_size);
for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++)
{
@@ -371,18 +359,17 @@ int pcps_acquisition_fine_doppler_cc::compute_and_accumulate_grid(gr_vector_cons
// Multiply carrier wiped--off, Fourier transformed incoming signal
// with the local FFT'd code reference using SIMD operations with VOLK library
- volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), d_fft_if->get_outbuf(), d_fft_codes, d_fft_size);
+ volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), d_fft_if->get_outbuf(), d_fft_codes.data(), d_fft_size);
// compute the inverse FFT
d_ifft->execute();
// save the grid matrix delay file
- volk_32fc_magnitude_squared_32f(p_tmp_vector, d_ifft->get_outbuf(), d_fft_size);
+ volk_32fc_magnitude_squared_32f(p_tmp_vector.data(), d_ifft->get_outbuf(), d_fft_size);
// accumulate grid values
- volk_32f_x2_add_32f(d_grid_data[doppler_index].data(), d_grid_data[doppler_index].data(), p_tmp_vector, d_fft_size);
+ volk_32f_x2_add_32f(d_grid_data[doppler_index].data(), d_grid_data[doppler_index].data(), p_tmp_vector.data(), d_fft_size);
}
- volk_gnsssdr_free(p_tmp_vector);
return d_fft_size;
// debug
// std::cout << "iff=[";
@@ -408,39 +395,38 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler()
std::fill_n(fft_operator->get_inbuf(), fft_size_extended, gr_complex(0.0, 0.0));
// 1. generate local code aligned with the acquisition code phase estimation
- auto *code_replica = static_cast(volk_gnsssdr_malloc(signal_samples * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
+ volk_gnsssdr::vector code_replica(signal_samples);
- gps_l1_ca_code_gen_complex_sampled(gsl::span(code_replica, signal_samples * sizeof(gr_complex)), d_gnss_synchro->PRN, d_fs_in, 0);
+ gps_l1_ca_code_gen_complex_sampled(code_replica, d_gnss_synchro->PRN, d_fs_in, 0);
int shift_index = static_cast(d_gnss_synchro->Acq_delay_samples);
// Rotate to align the local code replica using acquisition time delay estimation
if (shift_index != 0)
{
- std::rotate(code_replica, code_replica + (d_fft_size - shift_index), code_replica + d_fft_size - 1);
+ std::rotate(code_replica.data(), code_replica.data() + (d_fft_size - shift_index), code_replica.data() + d_fft_size - 1);
}
for (int n = 0; n < prn_replicas - 1; n++)
{
- memcpy(&code_replica[(n + 1) * d_fft_size], code_replica, d_fft_size * sizeof(gr_complex));
+ memcpy(&code_replica[(n + 1) * d_fft_size], code_replica.data(), d_fft_size * sizeof(gr_complex));
}
// 2. Perform code wipe-off
- volk_32fc_x2_multiply_32fc(fft_operator->get_inbuf(), d_10_ms_buffer, code_replica, signal_samples);
+ volk_32fc_x2_multiply_32fc(fft_operator->get_inbuf(), d_10_ms_buffer.data(), code_replica.data(), signal_samples);
// 3. Perform the FFT (zero padded!)
fft_operator->execute();
// 4. Compute the magnitude and find the maximum
- auto *p_tmp_vector = static_cast(volk_gnsssdr_malloc(fft_size_extended * sizeof(float), volk_gnsssdr_get_alignment()));
-
- volk_32fc_magnitude_squared_32f(p_tmp_vector, fft_operator->get_outbuf(), fft_size_extended);
+ volk_gnsssdr::vector p_tmp_vector(fft_size_extended);
+ volk_32fc_magnitude_squared_32f(p_tmp_vector.data(), fft_operator->get_outbuf(), fft_size_extended);
uint32_t tmp_index_freq = 0;
- volk_gnsssdr_32f_index_max_32u(&tmp_index_freq, p_tmp_vector, fft_size_extended);
+ volk_gnsssdr_32f_index_max_32u(&tmp_index_freq, p_tmp_vector.data(), fft_size_extended);
// case even
int counter = 0;
- auto fftFreqBins = std::vector(fft_size_extended);
+ volk_gnsssdr::vector fftFreqBins(fft_size_extended);
for (int k = 0; k < (fft_size_extended / 2); k++)
{
@@ -466,9 +452,6 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler()
DLOG(INFO) << "Error estimating fine frequency Doppler";
}
- // free memory!!
- volk_gnsssdr_free(code_replica);
- volk_gnsssdr_free(p_tmp_vector);
return d_fft_size;
}
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h
index 92b2d6e93..981f6a975 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h
@@ -60,12 +60,12 @@
#include
#include
#include
+#include // for volk_gnsssdr::vector
#include
#include
#include
#include
#include
-#include
class pcps_acquisition_fine_doppler_cc;
@@ -83,7 +83,7 @@ public:
/*!
* \brief Default destructor.
*/
- ~pcps_acquisition_fine_doppler_cc();
+ ~pcps_acquisition_fine_doppler_cc() = default;
/*!
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
@@ -192,8 +192,7 @@ public:
gr_vector_void_star& output_items);
private:
- friend pcps_acquisition_fine_doppler_cc_sptr
- pcps_make_acquisition_fine_doppler_cc(const Acq_Conf& conf_);
+ friend pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(const Acq_Conf& conf_);
explicit pcps_acquisition_fine_doppler_cc(const Acq_Conf& conf_);
int compute_and_accumulate_grid(gr_vector_const_void_star& input_items);
@@ -215,12 +214,11 @@ private:
int d_doppler_step;
unsigned int d_fft_size;
uint64_t d_sample_counter;
- gr_complex* d_carrier;
- gr_complex* d_fft_codes;
- gr_complex* d_10_ms_buffer;
- float* d_magnitude;
- std::vector> d_grid_data;
- std::vector>> d_grid_doppler_wipeoffs;
+ volk_gnsssdr::vector d_fft_codes;
+ volk_gnsssdr::vector d_10_ms_buffer;
+ volk_gnsssdr::vector d_magnitude;
+ volk_gnsssdr::vector> d_grid_data;
+ volk_gnsssdr::vector>> d_grid_doppler_wipeoffs;
std::shared_ptr d_fft_if;
std::shared_ptr d_ifft;
Gnss_Synchro* d_gnss_synchro;
diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc
index 494c137c4..f1e6e06f1 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc
@@ -195,7 +195,6 @@ void pcps_acquisition_fpga::acquisition_core(uint32_t num_doppler_bins, uint32_t
if (total_block_exp > d_total_block_exp)
{
// if the attenuation factor of the FPGA FFT-IFFT is smaller than the reference attenuation factor then we need to update the reference attenuation factor
- std::cout << "changing blk exp..... d_total_block_exp = " << d_total_block_exp << " total_block_exp = " << total_block_exp << " chan = " << d_channel << std::endl;
d_total_block_exp = total_block_exp;
d_test_statistics = 0;
}
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt
index ff83b6231..26b6bcf59 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt
@@ -325,6 +325,7 @@ install(
)
install(FILES
+ ${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_alloc.h
${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_prefs.h
${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_complex.h
${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_common.h
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_alloc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_alloc.h
new file mode 100644
index 000000000..369e09927
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_alloc.h
@@ -0,0 +1,84 @@
+/*!
+ * \file volk_gnsssdr_alloc.h
+ * \author Carles Fernandez, 2019. cfernandez(at)cttc.es
+ * \brief C++11 allocator using volk_gnsssdr_malloc and volk_gnsssdr_free.
+ * Based on https://github.com/gnuradio/volk/pull/284/ by @hcab14
+ *
+ * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
+ *
+ * This file is part of GNSS-SDR.
+ *
+ * GNSS-SDR is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GNSS-SDR is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNSS-SDR. If not, see .
+ */
+
+#ifndef INCLUDED_VOLK_GNSSSDR_ALLOC_H
+#define INCLUDED_VOLK_GNSSSDR_ALLOC_H
+
+#include
+#include
+#include
+#include
+#include
+
+namespace volk_gnsssdr
+{
+/*!
+ * \brief C++11 allocator using volk_gnsssdr_malloc and volk_gnsssdr_free
+ *
+ * \details
+ * adapted from https://en.cppreference.com/w/cpp/named_req/Alloc
+ */
+template
+struct alloc
+{
+ typedef T value_type;
+
+ alloc() = default;
+
+ template
+ constexpr alloc(alloc const&) noexcept {}
+
+ T* allocate(std::size_t n)
+ {
+ if (n > std::numeric_limits::max() / sizeof(T)) throw std::bad_alloc();
+
+ if (auto p = static_cast(volk_gnsssdr_malloc(n * sizeof(T), volk_gnsssdr_get_alignment())))
+ return p;
+
+ throw std::bad_alloc();
+ }
+
+ void deallocate(T* p, std::size_t) noexcept { volk_gnsssdr_free(p); }
+};
+
+template
+bool operator==(alloc const&, alloc const&) { return true; }
+
+template
+bool operator!=(alloc const&, alloc const&) { return false; }
+
+
+/*!
+ * \brief type alias for std::vector using volk_gnsssdr::alloc
+ *
+ * \details
+ * example code:
+ * volk_gnsssdr::vector v(100); // vector using volk_gnsssdr_malloc, volk_gnsssdr_free
+ */
+template
+using vector = std::vector >;
+
+} // namespace volk_gnsssdr
+
+#endif // INCLUDED_VOLK_GNSSSDR_ALLOC_H
diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc
index 007070630..e59ddd6cf 100644
--- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc
+++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc
@@ -39,20 +39,21 @@
#include
#include
#include // for max
+#include // for std::this_thread
#include // for abs
#include // for exceptions
#include // for open, O_WRONLY
#include // for std::ifstream
#include // for cout, endl
#include // for string manipulation
+#include // for std::chrono
#include // for write
#include
#include
-
void run_DMA_process(const std::string &FreqBand, const std::string &Filename1, const std::string &Filename2, const bool &enable_DMA)
{
- const int MAX_INPUT_SAMPLES_TOTAL = 8192;
+ const int MAX_INPUT_SAMPLES_TOTAL = 16384;
int max_value = 0;
int tx_fd; // DMA descriptor
std::ifstream infile1;
@@ -256,6 +257,9 @@ void run_DMA_process(const std::string &FreqBand, const std::string &Filename1,
{
std::cerr << "Error: DMA could not send all the required samples " << std::endl;
}
+
+ // Throttle the DMA
+ std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
if (nread_elements != MAX_INPUT_SAMPLES_TOTAL * 2)
diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc
index f296aee9d..3705c2886 100644
--- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc
+++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc
@@ -42,7 +42,7 @@
#include "galileo_e1_signal_processing.h"
#include "gnss_sdr_flags.h"
#include
-#include
+#include
#include
GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
@@ -193,19 +193,18 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
//################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 2;
d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment()));
- float* ca_codes_f;
- float* data_codes_f = nullptr;
+ volk_gnsssdr::vector ca_codes_f(static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip);
+ volk_gnsssdr::vector data_codes_f;
d_data_codes = nullptr;
if (d_track_pilot)
{
d_data_codes = static_cast(volk_gnsssdr_malloc((static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment()));
}
- ca_codes_f = static_cast(volk_gnsssdr_malloc(static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment()));
if (d_track_pilot)
{
- data_codes_f = static_cast(volk_gnsssdr_malloc((static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment()));
+ data_codes_f.resize(static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip, 0.0);
}
for (uint32_t PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++)
@@ -214,8 +213,8 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
if (d_track_pilot)
{
std::array pilot_signal = {'1', 'C', '\0'};
- galileo_e1_code_gen_sinboc11_float(gsl::span(ca_codes_f, static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip), pilot_signal, PRN);
- galileo_e1_code_gen_sinboc11_float(gsl::span(data_codes_f, static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip), data_signal, PRN);
+ galileo_e1_code_gen_sinboc11_float(ca_codes_f, pilot_signal, PRN);
+ galileo_e1_code_gen_sinboc11_float(data_codes_f, data_signal, PRN);
// The code is generated as a series of 1s and -1s. In order to store the values using only one bit, a -1 is stored as a 0 in the FPGA
for (uint32_t s = 0; s < 2 * GALILEO_E1_B_CODE_LENGTH_CHIPS; s++)
@@ -238,7 +237,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
}
else
{
- galileo_e1_code_gen_sinboc11_float(gsl::span(ca_codes_f, static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip), data_signal, PRN);
+ galileo_e1_code_gen_sinboc11_float(ca_codes_f, data_signal, PRN);
// The code is generated as a series of 1s and -1s. In order to store the values using only one bit, a -1 is stored as a 0 in the FPGA
for (uint32_t s = 0; s < 2 * GALILEO_E1_B_CODE_LENGTH_CHIPS; s++)
@@ -254,11 +253,6 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
}
}
- volk_gnsssdr_free(ca_codes_f);
- if (d_track_pilot)
- {
- volk_gnsssdr_free(data_codes_f);
- }
trk_param_fpga.ca_codes = d_ca_codes;
trk_param_fpga.data_codes = d_data_codes;
trk_param_fpga.code_length_chips = GALILEO_E1_B_CODE_LENGTH_CHIPS;
diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc
index 990890720..4fb32b9d9 100644
--- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc
+++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc
@@ -37,7 +37,7 @@
#include "galileo_e5_signal_processing.h"
#include "gnss_sdr_flags.h"
#include
-#include
+#include
#include
GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
@@ -181,16 +181,19 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
trk_param_fpga.dev_file_num = configuration->property(role + ".dev_file_num", 27);
// compute the number of tracking channels that have already been instantiated. The order in which
// GNSS-SDR instantiates the tracking channels i L1, L2, L5, E1, E5a
+ // However E5a can use the same tracking HW accelerators as L5 (but not simultaneously).
+ // Therefore for the proper assignment of the FPGA tracking device file numbers to the E5a tracking channels,
+ // the number of channels that have already been assigned to L5 must not be substracted to this channel number,
+ // so they are not counted here.
trk_param_fpga.num_prev_assigned_ch = configuration->property("Channels_1C.count", 0) +
configuration->property("Channels_2S.count", 0) +
- configuration->property("Channels_L5.count", 0) +
configuration->property("Channels_1B.count", 0);
// ################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 1;
auto code_length_chips = static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS);
- auto *aux_code = static_cast(volk_gnsssdr_malloc(sizeof(gr_complex) * code_length_chips * code_samples_per_chip, volk_gnsssdr_get_alignment()));
+ volk_gnsssdr::vector aux_code(code_length_chips * code_samples_per_chip, gr_complex(0.0, 0.0));
d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast