From 0dac9489d532268c935c68656d3a06a645734ca5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 9 Apr 2018 21:09:25 +0200 Subject: [PATCH 01/39] Improve C/N0 estimation --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 8 ++++---- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.h | 2 +- .../galileo_e1_tcp_connector_tracking_cc.cc | 2 +- .../glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- .../glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- .../glonass_l1_ca_dll_pll_tracking_cc.cc | 2 +- .../glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc | 2 +- .../glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- .../glonass_l2_ca_dll_pll_tracking_cc.cc | 2 +- .../gps_l1_ca_dll_pll_c_aid_tracking_cc.cc | 5 +++-- .../gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc | 2 +- .../gps_l1_ca_dll_pll_c_aid_tracking_sc.cc | 2 +- .../gps_l1_ca_dll_pll_tracking_gpu_cc.cc | 2 +- .../gps_l1_ca_tcp_connector_tracking_cc.cc | 2 +- src/algorithms/tracking/libs/lock_detectors.cc | 10 +++++----- src/algorithms/tracking/libs/lock_detectors.h | 8 ++++---- 16 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 4ae6f8195..d7fcdc160 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -606,7 +606,7 @@ bool dll_pll_veml_tracking::acquire_secondary() } -bool dll_pll_veml_tracking::cn0_and_tracking_lock_status() +bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_time_s) { // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### if (d_cn0_estimation_counter < FLAGS_cn0_samples) @@ -620,7 +620,7 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status() { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, static_cast(trk_parameters.fs_in), static_cast(d_code_length_chips)); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, coh_integration_time_s); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // Loss of lock detection @@ -1233,7 +1233,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_L_accu = *d_Late; // Check lock status - if (!cn0_and_tracking_lock_status()) + if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) * 1000.0)) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected @@ -1411,7 +1411,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) save_correlation_results(); // check lock status - if (!cn0_and_tracking_lock_status()) + if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) * 1000.0 * static_cast(trk_parameters.extend_correlation_symbols))) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index e9e41ccbc..5d8ec0133 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -88,7 +88,7 @@ private: dll_pll_veml_tracking(dllpllconf_t conf_); - bool cn0_and_tracking_lock_status(); + bool cn0_and_tracking_lock_status(double coh_integration_time_s); bool acquire_secondary(); void do_correlation_step(const gr_complex *input_samples); void run_dll_pll(); diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index a7c0062a2..61c77c9e2 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -381,7 +381,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, Galileo_E1_B_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, Galileo_E1_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index df57be51e..3fc22a696 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -762,7 +762,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index 313756921..a7acbfe21 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -753,7 +753,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc index d35b6159c..78de7f9b1 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc @@ -622,7 +622,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index 53f8f704b..48f149716 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -759,7 +759,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L2_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index decc5d5ca..92d17ab5e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -751,7 +751,7 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L2_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc index f6428bc5c..2989718e6 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc @@ -622,7 +622,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, d_fs_in, GLONASS_L2_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES, GLONASS_L2_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, CN0_ESTIMATION_SAMPLES); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc index c242a10b8..a5b92111b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -741,7 +741,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // Loss of lock detection @@ -842,7 +842,8 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib // PLL commands tmp_float = 1.0 / (d_carr_phase_error_secs_Ti * CURRENT_INTEGRATION_TIME_S); d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); - tmp_float = 1.0 / (d_code_error_filt_chips_Ti * CURRENT_INTEGRATION_TIME_S);; + tmp_float = 1.0 / (d_code_error_filt_chips_Ti * CURRENT_INTEGRATION_TIME_S); + ; d_dump_file.write(reinterpret_cast(&tmp_float), sizeof(float)); // DLL commands tmp_float = d_code_error_chips_Ti * CURRENT_INTEGRATION_TIME_S; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc index 1d1561a21..85f5c2e1c 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc @@ -558,7 +558,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work( { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc index 9a4332f06..9a01f1109 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -743,7 +743,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attrib { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc index 759128d0b..00fc6bd98 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc @@ -413,7 +413,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work(int noutput_items __attribut { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // Loss of lock detection diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index cd4c86652..d447d4985 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -418,7 +418,7 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib else { d_cn0_estimation_counter = 0; - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, d_fs_in, GPS_L1_CA_CODE_LENGTH_CHIPS); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GPS_L1_CA_CODE_PERIOD); d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); // ###### TRACKING UNLOCK NOTIFICATION ##### diff --git a/src/algorithms/tracking/libs/lock_detectors.cc b/src/algorithms/tracking/libs/lock_detectors.cc index 4457e361f..5194c4c3b 100644 --- a/src/algorithms/tracking/libs/lock_detectors.cc +++ b/src/algorithms/tracking/libs/lock_detectors.cc @@ -58,14 +58,14 @@ * \f$\hat{P}_{tot}=\frac{1}{N}\sum^{N-1}_{i=0}|Pc(i)|^2\f$ is the estimator of the total power, \f$|\cdot|\f$ is the absolute value, * \f$Re(\cdot)\f$ stands for the real part of the value, and \f$Pc(i)\f$ is the prompt correlator output for the sample index i. * - * The SNR value is converted to CN0 [dB-Hz], taking to account the receiver bandwidth and the PRN code gain, using the following formula: + * The SNR value is converted to CN0 [dB-Hz], taking to account the coherent integration time, using the following formula: * \f{equation} - * CN0_{dB}=10*log(\hat{\rho})+10*log(\frac{f_s}{2})-10*log(L_{PRN}), + * CN0_{dB}=10*log(\hat{\rho})-10*log(2 * T_{int}), * \f} - * where \f$f_s\f$ is the sampling frequency and \f$L_{PRN}\f$ is the PRN sequence length. + * where \f$T_{int}\f$ is the coherent integration time, in seconds. * */ -float cn0_svn_estimator(gr_complex* Prompt_buffer, int length, long fs_in, double code_length) +float cn0_svn_estimator(const gr_complex* Prompt_buffer, int length, double coh_integration_time_s) { double SNR = 0.0; double SNR_dB_Hz = 0.0; @@ -80,7 +80,7 @@ float cn0_svn_estimator(gr_complex* Prompt_buffer, int length, long fs_in, doubl Psig = Psig * Psig; Ptot /= static_cast(length); SNR = Psig / (Ptot - Psig); - SNR_dB_Hz = 10.0 * log10(SNR) + 10.0 * log10(static_cast(fs_in) / 2.0) - 10.0 * log10(code_length); + SNR_dB_Hz = 10.0 * log10(SNR) - 10.0 * log10(2.0 * coh_integration_time_s); return static_cast(SNR_dB_Hz); } diff --git a/src/algorithms/tracking/libs/lock_detectors.h b/src/algorithms/tracking/libs/lock_detectors.h index 22ec4945e..4955393d2 100644 --- a/src/algorithms/tracking/libs/lock_detectors.h +++ b/src/algorithms/tracking/libs/lock_detectors.h @@ -62,17 +62,17 @@ * \f$\hat{P}_{tot}=\frac{1}{N}\sum^{N-1}_{i=0}|Pc(i)|^2\f$ is the estimator of the total power, \f$|\cdot|\f$ is the absolute value, * \f$Re(\cdot)\f$ stands for the real part of the value, and \f$Pc(i)\f$ is the prompt correlator output for the sample index i. * - * The SNR value is converted to CN0 [dB-Hz], taking to account the receiver bandwidth and the PRN code gain, using the following formula: + * The SNR value is converted to CN0 [dB-Hz], taking to account the coherent integration time, using the following formula: * \f{equation} - * CN0_{dB}=10*log(\hat{\rho})+10*log(\frac{f_s}{2})-10*log(L_{PRN}), + * CN0_{dB}=10*log(\hat{\rho})-10*log(2 * T_{int}), * \f} - * where \f$f_s\f$ is the sampling frequency and \f$L_{PRN}\f$ is the PRN sequence length. + * where \f$T_{int}\f$ is the coherent integration time, in seconds. * Ref: Marco Pini, Emanuela Falletti and Maurizio Fantino, "Performance * Evaluation of C/N0 Estimators using a Real Time GNSS Software Receiver," * IEEE 10th International Symposium on Spread Spectrum Techniques and * Applications, pp.28-30, August 2008. */ -float cn0_svn_estimator(gr_complex* Prompt_buffer, int length, long fs_in, double code_length); +float cn0_svn_estimator(const gr_complex* Prompt_buffer, int length, double coh_integration_time_s); /*! \brief A carrier lock detector From d4a13f2bbd1624b9525b0ccc8dbdc3f730774192 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 9 Apr 2018 22:14:15 +0200 Subject: [PATCH 02/39] Fix CN0 estimation --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index d7fcdc160..8feeb7c5b 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -1233,7 +1233,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_L_accu = *d_Late; // Check lock status - if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) * 1000.0)) + if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) / 1000.0)) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected @@ -1411,7 +1411,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) save_correlation_results(); // check lock status - if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) * 1000.0 * static_cast(trk_parameters.extend_correlation_symbols))) + if (!cn0_and_tracking_lock_status((static_cast(d_correlation_length_ms) / 1000.0) * static_cast(trk_parameters.extend_correlation_symbols))) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected From 80de8a9770b02731aff30d246f270a777c0048e3 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 9 Apr 2018 23:10:50 +0200 Subject: [PATCH 03/39] Fix C/N0 estimation --- src/algorithms/tracking/libs/lock_detectors.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/tracking/libs/lock_detectors.cc b/src/algorithms/tracking/libs/lock_detectors.cc index 5194c4c3b..966dd48f1 100644 --- a/src/algorithms/tracking/libs/lock_detectors.cc +++ b/src/algorithms/tracking/libs/lock_detectors.cc @@ -80,7 +80,7 @@ float cn0_svn_estimator(const gr_complex* Prompt_buffer, int length, double coh_ Psig = Psig * Psig; Ptot /= static_cast(length); SNR = Psig / (Ptot - Psig); - SNR_dB_Hz = 10.0 * log10(SNR) - 10.0 * log10(2.0 * coh_integration_time_s); + SNR_dB_Hz = 10.0 * log10(SNR) - 10.0 * log10(coh_integration_time_s); return static_cast(SNR_dB_Hz); } From c175ebf4ddfded3cd8476741d163847cb9501fcb Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 10 Apr 2018 19:54:59 +0200 Subject: [PATCH 04/39] Minor fixes --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 8 ++++---- src/algorithms/tracking/libs/lock_detectors.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 8feeb7c5b..e121a36dd 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -1318,12 +1318,12 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_carrier_loop_filter.set_pdi(new_correlation_time); d_code_loop_filter.set_pdi(new_correlation_time); d_state = 3; // next state is the extended correlator integrator - LOG(INFO) << "Enabled " << trk_parameters.extend_correlation_symbols << " [symbols] extended correlator for CH " + LOG(INFO) << "Enabled " << trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " << d_channel - << " : Satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN); - std::cout << "Enabled " << trk_parameters.extend_correlation_symbols << " [symbols] extended correlator for CH " + << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN); + std::cout << "Enabled " << trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " << d_channel - << " : Satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; // Set narrow taps delay values [chips] d_code_loop_filter.set_DLL_BW(trk_parameters.dll_bw_narrow_hz); d_carrier_loop_filter.set_PLL_BW(trk_parameters.pll_bw_narrow_hz); diff --git a/src/algorithms/tracking/libs/lock_detectors.cc b/src/algorithms/tracking/libs/lock_detectors.cc index 966dd48f1..44201a4fb 100644 --- a/src/algorithms/tracking/libs/lock_detectors.cc +++ b/src/algorithms/tracking/libs/lock_detectors.cc @@ -60,7 +60,7 @@ * * The SNR value is converted to CN0 [dB-Hz], taking to account the coherent integration time, using the following formula: * \f{equation} - * CN0_{dB}=10*log(\hat{\rho})-10*log(2 * T_{int}), + * CN0_{dB}=10*log(\hat{\rho})-10*log(T_{int}), * \f} * where \f$T_{int}\f$ is the coherent integration time, in seconds. * From 31e634635ce96a0ba863e91943069d8a79f01823 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 13 Apr 2018 11:07:58 +0200 Subject: [PATCH 05/39] Move general_work to the bottom of the file --- .../gnuradio_blocks/pcps_acquisition.cc | 156 ++++++++-------- .../galileo_e1b_telemetry_decoder_cc.cc | 70 ++++---- .../galileo_e5a_telemetry_decoder_cc.cc | 70 ++++---- .../glonass_l1_ca_telemetry_decoder_cc.cc | 70 ++++---- .../glonass_l2_ca_telemetry_decoder_cc.cc | 70 ++++---- .../gps_l1_ca_telemetry_decoder_cc.cc | 76 ++++---- .../gps_l2c_telemetry_decoder_cc.cc | 70 ++++---- .../gps_l5_telemetry_decoder_cc.cc | 74 ++++---- .../sbas_l1_telemetry_decoder_cc.cc | 168 +++++++++--------- 9 files changed, 411 insertions(+), 413 deletions(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 0eb0cd3dd..62e55dd31 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -335,84 +335,6 @@ void pcps_acquisition::send_negative_acquisition() } -int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), - gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, - gr_vector_void_star& output_items __attribute__((unused))) -{ - /* - * By J.Arribas, L.Esteve and M.Molina - * Acquisition strategy (Kay Borre book + CFAR threshold): - * 1. Compute the input signal power estimation - * 2. Doppler serial search loop - * 3. Perform the FFT-based circular convolution (parallel time search) - * 4. Record the maximum peak and the associated synchronization parameters - * 5. Compute the test statistics and compare to the threshold - * 6. Declare positive or negative acquisition using a message port - */ - - gr::thread::scoped_lock lk(d_setlock); - if (!d_active or d_worker_active) - { - d_sample_counter += d_fft_size * ninput_items[0]; - consume_each(ninput_items[0]); - if (d_step_two) - { - d_doppler_center_step_two = static_cast(d_gnss_synchro->Acq_doppler_hz); - update_grid_doppler_wipeoffs_step2(); - d_state = 0; - d_active = true; - } - return 0; - } - - switch (d_state) - { - case 0: - { - //restart acquisition variables - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_well_count = 0; - d_mag = 0.0; - d_input_power = 0.0; - d_test_statistics = 0.0; - d_state = 1; - d_sample_counter += d_fft_size * ninput_items[0]; // sample counter - consume_each(ninput_items[0]); - break; - } - - case 1: - { - // Copy the data to the core and let it know that new data is available - if (d_cshort) - { - memcpy(d_data_buffer_sc, input_items[0], d_fft_size * sizeof(lv_16sc_t)); - } - else - { - memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(gr_complex)); - } - if (acq_parameters.blocking) - { - lk.unlock(); - acquisition_core(d_sample_counter); - } - else - { - gr::thread::thread d_worker(&pcps_acquisition::acquisition_core, this, d_sample_counter); - d_worker_active = true; - } - d_sample_counter += d_fft_size; - consume_each(1); - break; - } - } - return 0; -} - - void pcps_acquisition::acquisition_core(unsigned long int samp_count) { gr::thread::scoped_lock lk(d_setlock); @@ -686,3 +608,81 @@ void pcps_acquisition::acquisition_core(unsigned long int samp_count) } d_worker_active = false; } + + +int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), + gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items __attribute__((unused))) +{ + /* + * By J.Arribas, L.Esteve and M.Molina + * Acquisition strategy (Kay Borre book + CFAR threshold): + * 1. Compute the input signal power estimation + * 2. Doppler serial search loop + * 3. Perform the FFT-based circular convolution (parallel time search) + * 4. Record the maximum peak and the associated synchronization parameters + * 5. Compute the test statistics and compare to the threshold + * 6. Declare positive or negative acquisition using a message port + */ + + gr::thread::scoped_lock lk(d_setlock); + if (!d_active or d_worker_active) + { + d_sample_counter += d_fft_size * ninput_items[0]; + consume_each(ninput_items[0]); + if (d_step_two) + { + d_doppler_center_step_two = static_cast(d_gnss_synchro->Acq_doppler_hz); + update_grid_doppler_wipeoffs_step2(); + d_state = 0; + d_active = true; + } + return 0; + } + + switch (d_state) + { + case 0: + { + //restart acquisition variables + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_well_count = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; + d_state = 1; + d_sample_counter += d_fft_size * ninput_items[0]; // sample counter + consume_each(ninput_items[0]); + break; + } + + case 1: + { + // Copy the data to the core and let it know that new data is available + if (d_cshort) + { + memcpy(d_data_buffer_sc, input_items[0], d_fft_size * sizeof(lv_16sc_t)); + } + else + { + memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(gr_complex)); + } + if (acq_parameters.blocking) + { + lk.unlock(); + acquisition_core(d_sample_counter); + } + else + { + gr::thread::thread d_worker(&pcps_acquisition::acquisition_core, this, d_sample_counter); + d_worker_active = true; + } + d_sample_counter += d_fft_size; + consume_each(1); + break; + } + } + return 0; +} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc index 286ca0c68..6f2242454 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc @@ -272,6 +272,41 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols, in } +void galileo_e1b_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + DLOG(INFO) << "Navigation Satellite set to " << d_satellite; +} + + +void galileo_e1b_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + LOG(INFO) << "Navigation channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } +} + + int galileo_e1b_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -467,38 +502,3 @@ int galileo_e1b_telemetry_decoder_cc::general_work(int noutput_items __attribute //std::cout<<"GPS L1 TLM output on CH="<d_channel << " SAMPLE STAMP="<(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc index 8e032956e..c828fb859 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc @@ -245,6 +245,41 @@ galileo_e5a_telemetry_decoder_cc::~galileo_e5a_telemetry_decoder_cc() } +void galileo_e5a_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + DLOG(INFO) << "Navigation Satellite set to " << d_satellite; +} + + +void galileo_e5a_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + LOG(INFO) << "Navigation channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } +} + + int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -491,38 +526,3 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute return 0; } } - - -void galileo_e5a_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; - DLOG(INFO) << "Navigation Satellite set to " << d_satellite; -} - - -void galileo_e5a_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - LOG(INFO) << "Navigation channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc index ca6dc8681..09429a7e1 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc @@ -221,6 +221,41 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in } +void glonass_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + DLOG(INFO) << "Navigation Satellite set to " << d_satellite; +} + + +void glonass_l1_ca_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + LOG(INFO) << "Navigation channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what(); + } + } + } +} + + int glonass_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -408,38 +443,3 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu return 1; } - - -void glonass_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; - DLOG(INFO) << "Navigation Satellite set to " << d_satellite; -} - - -void glonass_l1_ca_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - LOG(INFO) << "Navigation channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc index e2a362974..b446b6e7e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc @@ -220,6 +220,41 @@ void glonass_l2_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in } +void glonass_l2_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + DLOG(INFO) << "Navigation Satellite set to " << d_satellite; +} + + +void glonass_l2_ca_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + LOG(INFO) << "Navigation channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what(); + } + } + } +} + + int glonass_l2_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -407,38 +442,3 @@ int glonass_l2_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu return 1; } - - -void glonass_l2_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; - DLOG(INFO) << "Navigation Satellite set to " << d_satellite; -} - - -void glonass_l2_ca_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - LOG(INFO) << "Navigation channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index 955d180d7..1070dca28 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -152,6 +152,44 @@ bool gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(unsigned int gpsword) } +void gps_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; + d_GPS_FSM.i_satellite_PRN = d_satellite.get_PRN(); + DLOG(INFO) << "Navigation Satellite set to " << d_satellite; +} + + +void gps_l1_ca_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + d_GPS_FSM.i_channel_ID = channel; + DLOG(INFO) << "Navigation channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel + << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); + } + } + } +} + + int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -411,41 +449,3 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ return 1; } - - -void gps_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; - d_GPS_FSM.i_satellite_PRN = d_satellite.get_PRN(); - DLOG(INFO) << "Navigation Satellite set to " << d_satellite; -} - - -void gps_l1_ca_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - d_GPS_FSM.i_channel_ID = channel; - DLOG(INFO) << "Navigation channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel - << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc index dee30987e..f06d19b6f 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc @@ -90,6 +90,41 @@ gps_l2c_telemetry_decoder_cc::~gps_l2c_telemetry_decoder_cc() } +void gps_l2c_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + DLOG(INFO) << "GPS L2C CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; +} + + +void gps_l2c_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + LOG(INFO) << "GPS L2C CNAV channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry_L2CM_"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel + << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L2 dump file " << e.what(); + } + } + } +} + + int gps_l2c_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -193,38 +228,3 @@ int gps_l2c_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( out[0] = current_synchro_data; return 1; } - - -void gps_l2c_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - DLOG(INFO) << "GPS L2C CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; -} - - -void gps_l2c_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - LOG(INFO) << "GPS L2C CNAV channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry_L2CM_"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel - << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L2 dump file " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc index 1cfd20162..0793428fa 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc @@ -100,6 +100,43 @@ gps_l5_telemetry_decoder_cc::~gps_l5_telemetry_decoder_cc() } +void gps_l5_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +{ + d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + LOG(INFO) << "GPS L5 CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; + d_CNAV_Message.reset(); +} + + +void gps_l5_telemetry_decoder_cc::set_channel(int channel) +{ + d_channel = channel; + d_CNAV_Message.reset(); + LOG(INFO) << "GPS L5 CNAV channel set to " << channel; + // ############# ENABLE DATA FILE LOG ################# + if (d_dump == true) + { + if (d_dump_file.is_open() == false) + { + try + { + d_dump_filename = "telemetry_L5_"; + d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(".dat"); + d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); + LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel + << " Log file: " << d_dump_filename.c_str(); + } + catch (const std::ifstream::failure &e) + { + LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L5 dump file " << e.what(); + } + } + } +} + + int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -243,40 +280,3 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u out[0] = current_synchro_data; return 1; } - - -void gps_l5_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) -{ - d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - LOG(INFO) << "GPS L5 CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; - d_CNAV_Message.reset(); -} - - -void gps_l5_telemetry_decoder_cc::set_channel(int channel) -{ - d_channel = channel; - d_CNAV_Message.reset(); - LOG(INFO) << "GPS L5 CNAV channel set to " << channel; - // ############# ENABLE DATA FILE LOG ################# - if (d_dump == true) - { - if (d_dump_file.is_open() == false) - { - try - { - d_dump_filename = "telemetry_L5_"; - d_dump_filename.append(boost::lexical_cast(d_channel)); - d_dump_filename.append(".dat"); - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); - d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); - LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel - << " Log file: " << d_dump_filename.c_str(); - } - catch (const std::ifstream::failure &e) - { - LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L5 dump file " << e.what(); - } - } - } -} diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc index 194db3c11..830a02636 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc @@ -87,88 +87,6 @@ sbas_l1_telemetry_decoder_cc::~sbas_l1_telemetry_decoder_cc() } -int sbas_l1_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) -{ - VLOG(FLOW) << "general_work(): " - << "noutput_items=" << noutput_items << "\toutput_items real size=" << output_items.size() << "\tninput_items size=" << ninput_items.size() << "\tinput_items real size=" << input_items.size() << "\tninput_items[0]=" << ninput_items[0]; - // get pointers on in- and output gnss-synchro objects - Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer - const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer - - Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block - //1. Copy the current tracking output - current_symbol = in[0]; - // copy correlation samples into samples vector - d_sample_buf.push_back(current_symbol.Prompt_I); //add new symbol to the symbol queue - - // store the time stamp of the first sample in the processed sample block - double sample_stamp = static_cast(in[0].Tracking_sample_counter) / static_cast(in[0].fs); - - // decode only if enough samples in buffer - if (d_sample_buf.size() >= d_block_size) - { - // align correlation samples in pairs - // and obtain the symbols by summing the paired correlation samples - std::vector symbols; - bool sample_alignment = d_sample_aligner.get_symbols(d_sample_buf, symbols); - - // align symbols in pairs - // and obtain the bits by decoding the symbol pairs - std::vector bits; - bool symbol_alignment = d_symbol_aligner_and_decoder.get_bits(symbols, bits); - - // search for preambles - // and extract the corresponding message candidates - std::vector msg_candidates; - d_frame_detector.get_frame_candidates(bits, msg_candidates); - - // verify checksum - // and return the valid messages - std::vector valid_msgs; - d_crc_verifier.get_valid_frames(msg_candidates, valid_msgs); - - // compute message sample stamp - // and fill messages in SBAS raw message objects - //std::vector sbas_raw_msgs; - for (std::vector::const_iterator it = valid_msgs.cbegin(); - it != valid_msgs.cend(); ++it) - { - int message_sample_offset = - (sample_alignment ? 0 : -1) + d_samples_per_symbol * (symbol_alignment ? -1 : 0) + d_samples_per_symbol * d_symbols_per_bit * it->first; - double message_sample_stamp = sample_stamp + static_cast(message_sample_offset) / 1000.0; - VLOG(EVENT) << "message_sample_stamp=" << message_sample_stamp - << " (sample_stamp=" << sample_stamp - << " sample_alignment=" << sample_alignment - << " symbol_alignment=" << symbol_alignment - << " relative_preamble_start=" << it->first - << " message_sample_offset=" << message_sample_offset - << ")"; - //Sbas_Raw_Msg sbas_raw_msg(message_sample_stamp, this->d_satellite.get_PRN(), it->second); - //sbas_raw_msgs.push_back(sbas_raw_msg); - } - - // parse messages - // and send them to the SBAS raw message queue - //for(std::vector::iterator it = sbas_raw_msgs.begin(); it != sbas_raw_msgs.end(); it++) - // { - //std::cout << "SBAS message type " << it->get_msg_type() << " from PRN" << it->get_prn() << " received" << std::endl; - //sbas_telemetry_data.update(*it); - // } - - // clear all processed samples in the input buffer - d_sample_buf.clear(); - } - - // UPDATE GNSS SYNCHRO DATA - // actually the SBAS telemetry decoder doesn't support ranging - current_symbol.Flag_valid_word = false; // indicate to observable block that this synchro object isn't valid for pseudorange computation - out[0] = current_symbol; - consume_each(1); // tell scheduler input items consumed - return 1; // tell scheduler output items produced -} - - void sbas_l1_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); @@ -184,7 +102,6 @@ void sbas_l1_telemetry_decoder_cc::set_channel(int channel) // ### helper class for sample alignment ### - sbas_l1_telemetry_decoder_cc::sample_aligner::sample_aligner() { d_n_smpls_in_history = 3; @@ -403,12 +320,11 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const st // ### helper class for checking the CRC of the message candidates ### - - void sbas_l1_telemetry_decoder_cc::crc_verifier::reset() { } + void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vector msg_candidates, std::vector &valid_msgs) { std::stringstream ss; @@ -500,3 +416,85 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_b << std::setfill('0') << std::hex << static_cast(byte) << std::setfill(' ') << std::resetiosflags(std::ios::hex); } + + +int sbas_l1_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) +{ + VLOG(FLOW) << "general_work(): " + << "noutput_items=" << noutput_items << "\toutput_items real size=" << output_items.size() << "\tninput_items size=" << ninput_items.size() << "\tinput_items real size=" << input_items.size() << "\tninput_items[0]=" << ninput_items[0]; + // get pointers on in- and output gnss-synchro objects + Gnss_Synchro *out = reinterpret_cast(output_items[0]); // Get the output buffer pointer + const Gnss_Synchro *in = reinterpret_cast(input_items[0]); // Get the input buffer pointer + + Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block + //1. Copy the current tracking output + current_symbol = in[0]; + // copy correlation samples into samples vector + d_sample_buf.push_back(current_symbol.Prompt_I); //add new symbol to the symbol queue + + // store the time stamp of the first sample in the processed sample block + double sample_stamp = static_cast(in[0].Tracking_sample_counter) / static_cast(in[0].fs); + + // decode only if enough samples in buffer + if (d_sample_buf.size() >= d_block_size) + { + // align correlation samples in pairs + // and obtain the symbols by summing the paired correlation samples + std::vector symbols; + bool sample_alignment = d_sample_aligner.get_symbols(d_sample_buf, symbols); + + // align symbols in pairs + // and obtain the bits by decoding the symbol pairs + std::vector bits; + bool symbol_alignment = d_symbol_aligner_and_decoder.get_bits(symbols, bits); + + // search for preambles + // and extract the corresponding message candidates + std::vector msg_candidates; + d_frame_detector.get_frame_candidates(bits, msg_candidates); + + // verify checksum + // and return the valid messages + std::vector valid_msgs; + d_crc_verifier.get_valid_frames(msg_candidates, valid_msgs); + + // compute message sample stamp + // and fill messages in SBAS raw message objects + //std::vector sbas_raw_msgs; + for (std::vector::const_iterator it = valid_msgs.cbegin(); + it != valid_msgs.cend(); ++it) + { + int message_sample_offset = + (sample_alignment ? 0 : -1) + d_samples_per_symbol * (symbol_alignment ? -1 : 0) + d_samples_per_symbol * d_symbols_per_bit * it->first; + double message_sample_stamp = sample_stamp + static_cast(message_sample_offset) / 1000.0; + VLOG(EVENT) << "message_sample_stamp=" << message_sample_stamp + << " (sample_stamp=" << sample_stamp + << " sample_alignment=" << sample_alignment + << " symbol_alignment=" << symbol_alignment + << " relative_preamble_start=" << it->first + << " message_sample_offset=" << message_sample_offset + << ")"; + //Sbas_Raw_Msg sbas_raw_msg(message_sample_stamp, this->d_satellite.get_PRN(), it->second); + //sbas_raw_msgs.push_back(sbas_raw_msg); + } + + // parse messages + // and send them to the SBAS raw message queue + //for(std::vector::iterator it = sbas_raw_msgs.begin(); it != sbas_raw_msgs.end(); it++) + // { + //std::cout << "SBAS message type " << it->get_msg_type() << " from PRN" << it->get_prn() << " received" << std::endl; + //sbas_telemetry_data.update(*it); + // } + + // clear all processed samples in the input buffer + d_sample_buf.clear(); + } + + // UPDATE GNSS SYNCHRO DATA + // actually the SBAS telemetry decoder doesn't support ranging + current_symbol.Flag_valid_word = false; // indicate to observable block that this synchro object isn't valid for pseudorange computation + out[0] = current_symbol; + consume_each(1); // tell scheduler input items consumed + return 1; // tell scheduler output items produced +} From c01d8d0dd90d6a8121691d849c7dc2514fa4ade7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 13 Apr 2018 11:39:05 +0200 Subject: [PATCH 06/39] Move general_work to the bottom of the file --- .../rtl_tcp_signal_source_c.cc | 70 +++++++++---------- .../unpack_spir_gss6450_samples.cc | 29 ++++---- 2 files changed, 50 insertions(+), 49 deletions(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index e874e8a14..4ec4420ce 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -158,41 +158,6 @@ rtl_tcp_signal_source_c::~rtl_tcp_signal_source_c() } -int rtl_tcp_signal_source_c::work(int noutput_items, - gr_vector_const_void_star & /*input_items*/, - gr_vector_void_star &output_items) -{ - gr_complex *out = reinterpret_cast(output_items[0]); - int i = 0; - if (io_service_.stopped()) - { - return -1; - } - - { - boost::mutex::scoped_lock lock(mutex_); - not_empty_.wait(lock, boost::bind(&rtl_tcp_signal_source_c::not_empty, - this)); - - for (; i < noutput_items && unread_ > 1; i++) - { - float re = buffer_[--unread_]; - float im = buffer_[--unread_]; - if (flip_iq_) - { - out[i] = gr_complex(im, re); - } - else - { - out[i] = gr_complex(re, im); - } - } - } - not_full_.notify_one(); - return i == 0 ? -1 : i; -} - - void rtl_tcp_signal_source_c::set_frequency(int frequency) { boost::system::error_code ec = @@ -359,3 +324,38 @@ void rtl_tcp_signal_source_c::handle_read(const boost::system::error_code &ec, this, _1, _2)); } } + + +int rtl_tcp_signal_source_c::work(int noutput_items, + gr_vector_const_void_star & /*input_items*/, + gr_vector_void_star &output_items) +{ + gr_complex *out = reinterpret_cast(output_items[0]); + int i = 0; + if (io_service_.stopped()) + { + return -1; + } + + { + boost::mutex::scoped_lock lock(mutex_); + not_empty_.wait(lock, boost::bind(&rtl_tcp_signal_source_c::not_empty, + this)); + + for (; i < noutput_items && unread_ > 1; i++) + { + float re = buffer_[--unread_]; + float im = buffer_[--unread_]; + if (flip_iq_) + { + out[i] = gr_complex(im, re); + } + else + { + out[i] = gr_complex(re, im); + } + } + } + not_full_.notify_one(); + return i == 0 ? -1 : i; +} diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc index a5bca6ee7..bd725b219 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc @@ -57,6 +57,21 @@ unpack_spir_gss6450_samples::~unpack_spir_gss6450_samples() } +int unpack_spir_gss6450_samples::compute_two_complement(unsigned long data) +{ + int res = 0; + if (static_cast(data) < two_compl_thres) + { + res = static_cast(data); + } + else + { + res = static_cast(data) - adc_bits_two_pow; + } + return res; +} + + int unpack_spir_gss6450_samples::work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items) { @@ -86,17 +101,3 @@ int unpack_spir_gss6450_samples::work(int noutput_items, } return noutput_items; } - -int unpack_spir_gss6450_samples::compute_two_complement(unsigned long data) -{ - int res = 0; - if (static_cast(data) < two_compl_thres) - { - res = static_cast(data); - } - else - { - res = static_cast(data) - adc_bits_two_pow; - } - return res; -} From 44c6d8622ce1c57a8c6274e547464a53dad6c31a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 13 Apr 2018 12:11:41 +0200 Subject: [PATCH 07/39] Make the test to correctly fail if no kml file is generated --- src/tests/system-tests/position_test.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index 350055d2f..bf0925dda 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -277,8 +277,8 @@ int StaticPositionSystemTest::configure_receiver() const float dll_bw_narrow_hz = 2.0; const int extend_correlation_ms = 1; - const int display_rate_ms = 1000; - const int output_rate_ms = 1000; + const int display_rate_ms = 500; + const int output_rate_ms = 500; config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_rate_internal)); @@ -358,10 +358,10 @@ int StaticPositionSystemTest::configure_receiver() config->set_property("Tracking_1C.pll_bw_hz", std::to_string(pll_bw_hz)); config->set_property("Tracking_1C.dll_bw_hz", std::to_string(dll_bw_hz)); config->set_property("Tracking_1C.early_late_space_chips", std::to_string(early_late_space_chips)); - + config->set_property("Tracking_1Cearly_late_space_narrow_chips", std::to_string(early_late_space_chips / 5.0)); config->set_property("Tracking_1C.pll_bw_narrow_hz", std::to_string(pll_bw_narrow_hz)); config->set_property("Tracking_1C.dll_bw_narrow_hz", std::to_string(dll_bw_narrow_hz)); - config->set_property("Tracking_1C.extend_correlation_ms", std::to_string(extend_correlation_ms)); + config->set_property("Tracking_1C.extend_correlation_symbols", std::to_string(extend_correlation_ms)); // Set Telemetry config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder"); @@ -454,6 +454,7 @@ int StaticPositionSystemTest::run_receiver() void StaticPositionSystemTest::check_results() { std::fstream myfile(StaticPositionSystemTest::generated_kml_file, std::ios_base::in); + ASSERT_TRUE(myfile.is_open()) << "No valid kml file could be opened"; std::string line; std::vector pos_e; @@ -466,6 +467,7 @@ void StaticPositionSystemTest::check_results() while (is_header) { std::getline(myfile, line); + ASSERT_FALSE(myfile.eof()) << "No valid kml file found."; std::size_t found = line.find(""); if (found != std::string::npos) is_header = false; } @@ -474,7 +476,11 @@ void StaticPositionSystemTest::check_results() //read data while (is_data) { - std::getline(myfile, line); + if (!std::getline(myfile, line)) + { + is_data = false; + break; + } std::size_t found = line.find(""); if (found != std::string::npos) is_data = false; @@ -504,6 +510,7 @@ void StaticPositionSystemTest::check_results() } } myfile.close(); + ASSERT_FALSE(pos_e.size() == 0) << "KML file is empty"; double sigma_E_2_precision = std::pow(compute_stdev_precision(pos_e), 2.0); double sigma_N_2_precision = std::pow(compute_stdev_precision(pos_n), 2.0); From fec1e374075df1851bd8b0a28de227015c859c4f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 14 Apr 2018 11:19:52 +0200 Subject: [PATCH 08/39] Fix Typo --- src/tests/system-tests/position_test.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index bf0925dda..4018552bc 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -358,7 +358,7 @@ int StaticPositionSystemTest::configure_receiver() config->set_property("Tracking_1C.pll_bw_hz", std::to_string(pll_bw_hz)); config->set_property("Tracking_1C.dll_bw_hz", std::to_string(dll_bw_hz)); config->set_property("Tracking_1C.early_late_space_chips", std::to_string(early_late_space_chips)); - config->set_property("Tracking_1Cearly_late_space_narrow_chips", std::to_string(early_late_space_chips / 5.0)); + config->set_property("Tracking_1C.pll_bw_narrow_hz", std::to_string(pll_bw_narrow_hz)); config->set_property("Tracking_1C.dll_bw_narrow_hz", std::to_string(dll_bw_narrow_hz)); config->set_property("Tracking_1C.extend_correlation_symbols", std::to_string(extend_correlation_ms)); @@ -366,7 +366,6 @@ int StaticPositionSystemTest::configure_receiver() // Set Telemetry config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder"); config->set_property("TelemetryDecoder_1C.dump", "false"); - config->set_property("TelemetryDecoder_1C.decimation_factor", std::to_string(decimation_factor)); // Set Observables config->set_property("Observables.implementation", "Hybrid_Observables"); From b1695375a854bda08df9c2f509b3af574171417a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 14 Apr 2018 16:04:33 +0200 Subject: [PATCH 09/39] Improve finding of gnuradio-iio library --- cmake/Modules/Findiio.cmake | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cmake/Modules/Findiio.cmake b/cmake/Modules/Findiio.cmake index 817e9f9f7..a1d526ae5 100644 --- a/cmake/Modules/Findiio.cmake +++ b/cmake/Modules/Findiio.cmake @@ -22,6 +22,28 @@ FIND_LIBRARY( /usr/local/lib64 /usr/lib /usr/lib64 + /usr/lib/x86_64-linux-gnu + /usr/lib/gcc/alpha-linux-gnu + /usr/lib/gcc/aarch64-linux-gnu + /usr/lib/gcc/arm-linux-gnueabi + /usr/lib/gcc/arm-linux-gnueabihf + /usr/lib/gcc/hppa-linux-gnu + /usr/lib/gcc/i686-gnu + /usr/lib/gcc/i686-linux-gnu + /usr/lib/gcc/x86_64-kfreebsd-gnu + /usr/lib/gcc/i686-kfreebsd-gnu + /usr/lib/gcc/m68k-linux-gnu + /usr/lib/gcc/mips-linux-gnu + /usr/lib/gcc/mips64el-linux-gnuabi64 + /usr/lib/gcc/mipsel-linux-gnu + /usr/lib/gcc/powerpc-linux-gnu + /usr/lib/gcc/powerpc-linux-gnuspe + /usr/lib/gcc/powerpc64-linux-gnu + /usr/lib/gcc/powerpc64le-linux-gnu + /usr/lib/gcc/s390x-linux-gnu + /usr/lib/gcc/sparc64-linux-gnu + /usr/lib/gcc/x86_64-linux-gnux32 + /usr/lib/gcc/sh4-linux-gnu ) INCLUDE(FindPackageHandleStandardArgs) From bce730f68da4c93d05a26aceed409e23d8acedb1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 14 Apr 2018 16:12:21 +0200 Subject: [PATCH 10/39] Improve finding of gnuradio-iio and libiio libraries --- cmake/Modules/Findiio.cmake | 42 +++++++++++++++++----------------- cmake/Modules/Findlibiio.cmake | 42 +++++++++++++++++----------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/cmake/Modules/Findiio.cmake b/cmake/Modules/Findiio.cmake index a1d526ae5..fc7af0d45 100644 --- a/cmake/Modules/Findiio.cmake +++ b/cmake/Modules/Findiio.cmake @@ -23,27 +23,27 @@ FIND_LIBRARY( /usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu - /usr/lib/gcc/alpha-linux-gnu - /usr/lib/gcc/aarch64-linux-gnu - /usr/lib/gcc/arm-linux-gnueabi - /usr/lib/gcc/arm-linux-gnueabihf - /usr/lib/gcc/hppa-linux-gnu - /usr/lib/gcc/i686-gnu - /usr/lib/gcc/i686-linux-gnu - /usr/lib/gcc/x86_64-kfreebsd-gnu - /usr/lib/gcc/i686-kfreebsd-gnu - /usr/lib/gcc/m68k-linux-gnu - /usr/lib/gcc/mips-linux-gnu - /usr/lib/gcc/mips64el-linux-gnuabi64 - /usr/lib/gcc/mipsel-linux-gnu - /usr/lib/gcc/powerpc-linux-gnu - /usr/lib/gcc/powerpc-linux-gnuspe - /usr/lib/gcc/powerpc64-linux-gnu - /usr/lib/gcc/powerpc64le-linux-gnu - /usr/lib/gcc/s390x-linux-gnu - /usr/lib/gcc/sparc64-linux-gnu - /usr/lib/gcc/x86_64-linux-gnux32 - /usr/lib/gcc/sh4-linux-gnu + /usr/lib/alpha-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/hppa-linux-gnu + /usr/lib/i686-gnu + /usr/lib/i686-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i686-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/sh4-linux-gnu ) INCLUDE(FindPackageHandleStandardArgs) diff --git a/cmake/Modules/Findlibiio.cmake b/cmake/Modules/Findlibiio.cmake index 4ce6ca9c5..22eccf4b2 100644 --- a/cmake/Modules/Findlibiio.cmake +++ b/cmake/Modules/Findlibiio.cmake @@ -24,27 +24,27 @@ FIND_LIBRARY( /usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu - /usr/lib/gcc/alpha-linux-gnu - /usr/lib/gcc/aarch64-linux-gnu - /usr/lib/gcc/arm-linux-gnueabi - /usr/lib/gcc/arm-linux-gnueabihf - /usr/lib/gcc/hppa-linux-gnu - /usr/lib/gcc/i686-gnu - /usr/lib/gcc/i686-linux-gnu - /usr/lib/gcc/x86_64-kfreebsd-gnu - /usr/lib/gcc/i686-kfreebsd-gnu - /usr/lib/gcc/m68k-linux-gnu - /usr/lib/gcc/mips-linux-gnu - /usr/lib/gcc/mips64el-linux-gnuabi64 - /usr/lib/gcc/mipsel-linux-gnu - /usr/lib/gcc/powerpc-linux-gnu - /usr/lib/gcc/powerpc-linux-gnuspe - /usr/lib/gcc/powerpc64-linux-gnu - /usr/lib/gcc/powerpc64le-linux-gnu - /usr/lib/gcc/s390x-linux-gnu - /usr/lib/gcc/sparc64-linux-gnu - /usr/lib/gcc/x86_64-linux-gnux32 - /usr/lib/gcc/sh4-linux-gnu + /usr/lib/alpha-linux-gnu + /usr/lib/aarch64-linux-gnu + /usr/lib/arm-linux-gnueabi + /usr/lib/arm-linux-gnueabihf + /usr/lib/hppa-linux-gnu + /usr/lib/i686-gnu + /usr/lib/i686-linux-gnu + /usr/lib/x86_64-kfreebsd-gnu + /usr/lib/i686-kfreebsd-gnu + /usr/lib/m68k-linux-gnu + /usr/lib/mips-linux-gnu + /usr/lib/mips64el-linux-gnuabi64 + /usr/lib/mipsel-linux-gnu + /usr/lib/powerpc-linux-gnu + /usr/lib/powerpc-linux-gnuspe + /usr/lib/powerpc64-linux-gnu + /usr/lib/powerpc64le-linux-gnu + /usr/lib/s390x-linux-gnu + /usr/lib/sparc64-linux-gnu + /usr/lib/x86_64-linux-gnux32 + /usr/lib/sh4-linux-gnu /Library/Frameworks/iio.framework/ ) From ddb7a6f3e0eb7d9cff863ae5d12f85e433d57621 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 14 Apr 2018 17:54:36 +0200 Subject: [PATCH 11/39] Fix detection of libiio package --- cmake/Modules/Findlibiio.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/Findlibiio.cmake b/cmake/Modules/Findlibiio.cmake index 22eccf4b2..c3fa42366 100644 --- a/cmake/Modules/Findlibiio.cmake +++ b/cmake/Modules/Findlibiio.cmake @@ -14,7 +14,7 @@ FIND_PATH( FIND_LIBRARY( LIBIIO_LIBRARIES - NAMES libiio.so iio + NAMES iio libiio.so.0 HINTS $ENV{LIBIIO_DIR}/lib ${PC_LIBIIO_LIBDIR} PATHS ${CMAKE_INSTALL_PREFIX}/lib From 6740ac42c82c1709d38d28f040367c609304bd6a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 14 Apr 2018 18:16:38 +0200 Subject: [PATCH 12/39] Fix detection of libiio-dev package --- cmake/Modules/Findlibiio.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/Findlibiio.cmake b/cmake/Modules/Findlibiio.cmake index c3fa42366..334dcf8d7 100644 --- a/cmake/Modules/Findlibiio.cmake +++ b/cmake/Modules/Findlibiio.cmake @@ -3,7 +3,7 @@ PKG_CHECK_MODULES(PC_LIBIIO libiio) FIND_PATH( LIBIIO_INCLUDE_DIRS - NAMES gnuradio/iio/api.h + NAMES iio.h HINTS $ENV{LIBIIO_DIR}/include ${PC_LIBIIO_INCLUDEDIR} PATHS ${CMAKE_INSTALL_PREFIX}/include From 4db5f9165f4fcc002c99657a2eb7689b21ed4837 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 18 Apr 2018 11:18:58 +0200 Subject: [PATCH 13/39] Fix bug counting channels when using Gal E5a configurations --- src/core/receiver/gnss_flowgraph.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index eec75d2f0..adda1183d 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -556,10 +556,9 @@ void GNSSFlowgraph::set_signals_list() */ unsigned int total_channels = configuration_->property("Channels_1C.count", 0) + - configuration_->property("Channels_2S.count", 0) + configuration_->property("Channels_1B.count", 0) + - configuration_->property("Channels_5X.count", 0) + configuration_->property("Channels_1G.count", 0) + + configuration_->property("Channels_2S.count", 0) + configuration_->property("Channels_2G.count", 0) + configuration_->property("Channels_5X.count", 0) + configuration_->property("Channels_L5.count", 0); From 6a3770c7629e2cd92f9d3694ec7262e0453e5ece Mon Sep 17 00:00:00 2001 From: mmajoral Date: Thu, 19 Apr 2018 12:09:08 +0200 Subject: [PATCH 14/39] - set output vectors is only done in the class constructor, no need to do it continuously - no need to multiply by two the results of the multicorrelator HW accelerators --- .../gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc | 3 ++- src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc index 7f8a4233b..069b426db 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_fpga_sc.cc @@ -172,6 +172,8 @@ Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc( d_carrier_phase_step_rad = 0.0; set_relative_rate(1.0 / static_cast(d_vector_length)); + + multicorrelator_fpga_8sc->set_output_vectors(d_correlator_outs); } void Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::start_tracking() @@ -320,7 +322,6 @@ int Gps_L1_Ca_Dll_Pll_Tracking_fpga_sc::general_work (int noutput_items __attrib // ################# CARRIER WIPEOFF AND CORRELATORS ############################## // perform carrier wipe-off and compute Early, Prompt and Late correlation - multicorrelator_fpga_8sc->set_output_vectors(d_correlator_outs); multicorrelator_fpga_8sc->Carrier_wipeoff_multicorrelator_resampler( d_rem_carr_phase_rad, d_carrier_phase_step_rad, d_rem_code_phase_chips, d_code_phase_step_chips, diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc index dba1da094..9c9e6af0b 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc +++ b/src/algorithms/tracking/libs/fpga_multicorrelator_8sc.cc @@ -403,14 +403,12 @@ void fpga_multicorrelator_8sc::read_tracking_gps_results(void) { readval_real = -2097152 + readval_real; } - readval_real = readval_real * 2; // the results are shifted two bits to the left due to the complex multiplier in the FPGA readval_imag = d_map_base[1 + d_n_correlators + k]; if (readval_imag >= 1048576) // 0x100000 (21 bits two's complement) { readval_imag = -2097152 + readval_imag; } - readval_imag = readval_imag * 2; // the results are shifted two bits to the left due to the complex multiplier in the FPGA d_corr_out[k] = gr_complex(readval_real,readval_imag); } } From 514fde256aa9a7b57131a864a8bf373c5fa20d13 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 20 Apr 2018 12:50:32 +0200 Subject: [PATCH 15/39] Fix assignment of a channel to a given satellite with ChannelN.satellite=PRN --- src/core/receiver/gnss_flowgraph.cc | 158 ++++++++++++++-------------- 1 file changed, 81 insertions(+), 77 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index adda1183d..255cb7609 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -9,7 +9,7 @@ * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -61,6 +61,8 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configurati GNSSFlowgraph::~GNSSFlowgraph() {} + + void GNSSFlowgraph::start() { if (running_) @@ -93,10 +95,9 @@ void GNSSFlowgraph::stop() void GNSSFlowgraph::connect() { - /* Connects the blocks in the flowgraph - * - * Signal Source > Signal conditioner >> Channels >> Observables >> PVT - */ + // Connects the blocks in the flowgraph + // Signal Source > Signal conditioner >> Channels >> Observables >> PVT + LOG(INFO) << "Connecting flowgraph"; if (connected_) { @@ -184,8 +185,8 @@ void GNSSFlowgraph::connect() { try { - //TODO: Remove this array implementation and create generic multistream connector - //(if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) + // TODO: Remove this array implementation and create generic multistream connector + // (if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) if (sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) { //Multichannel Array @@ -198,14 +199,14 @@ void GNSSFlowgraph::connect() } else { - //TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. - //Include GetRFChannels in the interface to avoid read config parameters here - //read the number of RF channels for each front-end + // TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. + // Include GetRFChannels in the interface to avoid read config parameters here + // read the number of RF channels for each front-end RF_Channels = configuration_->property(sig_source_.at(i)->role() + ".RF_channels", 1); for (int j = 0; j < RF_Channels; j++) { - //Connect the multichannel signal source to multiple signal conditioners + // Connect the multichannel signal source to multiple signal conditioners // GNURADIO max_streams=-1 means infinite ports! LOG(INFO) << "sig_source_.at(i)->get_right_block()->output_signature()->max_streams()=" << sig_source_.at(i)->get_right_block()->output_signature()->max_streams(); LOG(INFO) << "sig_conditioner_.at(signal_conditioner_ID)->get_left_block()->input_signature()=" << sig_conditioner_.at(signal_conditioner_ID)->get_left_block()->input_signature()->max_streams(); @@ -244,8 +245,8 @@ void GNSSFlowgraph::connect() } DLOG(INFO) << "Signal source connected to signal conditioner"; - //connect the signal source to sample counter - //connect the sample counter to Observables + // connect the signal source to sample counter + // connect the sample counter to Observables try { double fs = static_cast(configuration_->property("GNSS-SDR.internal_fs_sps", 0)); @@ -267,7 +268,6 @@ void GNSSFlowgraph::connect() return; } - // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) int selected_signal_conditioner_ID; for (unsigned int i = 0; i < channels_count_; i++) @@ -301,26 +301,46 @@ void GNSSFlowgraph::connect() top_block_->disconnect_all(); return; } + } - std::string gnss_signal = channels_.at(i)->get_signal().get_signal_str(); // use channel's implicit signal! - channels_.at(i)->set_signal(search_next_signal(gnss_signal, false)); - - if (channels_state_[i] == 1) + // Put channels fixed to a given satellite at the beginning of the vector, then the rest + std::vector vector_of_channels; + for (unsigned int i = 0; i < channels_count_; i++) + { + unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); + if (sat == 0) { - channels_.at(i)->start_acquisition(); - available_GNSS_signals_.pop_front(); - LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal(); - LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition"; + vector_of_channels.push_back(i); } else { - LOG(INFO) << "Channel " << i << " connected to observables in standby mode"; + auto it = vector_of_channels.begin(); + it = vector_of_channels.insert(it, i); } } - /* - * Connect the observables output of each channel to the PVT block - */ + // Assign satellites to channels in the initialization + for (unsigned int& i : vector_of_channels) + { + std::string gnss_signal = channels_.at(i)->get_signal().get_signal_str(); // use channel's implicit signal + unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); + if (sat == 0) + { + channels_.at(i)->set_signal(search_next_signal(gnss_signal, true)); + } + else + { + std::string gnss_system; + if ((gnss_signal.compare("1C") == 0) or (gnss_signal.compare("2S") == 0) or (gnss_signal.compare("L5") == 0)) gnss_system = "GPS"; + if ((gnss_signal.compare("1B") == 0) or (gnss_signal.compare("5X") == 0)) gnss_system = "Galileo"; + if ((gnss_signal.compare("1G") == 0) or (gnss_signal.compare("2G") == 0)) gnss_system = "Glonass"; + Gnss_Signal signal_value = Gnss_Signal(Gnss_Satellite(gnss_system, sat), gnss_signal); + available_GNSS_signals_.remove(signal_value); + channels_.at(i)->set_signal(signal_value); + } + } + + // Connect the observables output of each channel to the PVT block try { for (unsigned int i = 0; i < channels_count_; i++) @@ -337,6 +357,21 @@ void GNSSFlowgraph::connect() return; } + // Activate acquisition in enabled channels + for (unsigned int i = 0; i < channels_count_; i++) + { + LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal(); + if (channels_state_[i] == 1) + { + channels_.at(i)->start_acquisition(); + LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition"; + } + else + { + LOG(INFO) << "Channel " << i << " connected to observables in standby mode"; + } + } + connected_ = true; LOG(INFO) << "Flowgraph connected"; top_block_->dump(); @@ -374,12 +409,16 @@ bool GNSSFlowgraph::send_telemetry_msg(pmt::pmt_t msg) void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) { DLOG(INFO) << "Received " << what << " from " << who << ". Number of applied actions = " << applied_actions_; + unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(who) + ".satellite", 0); switch (what) { case 0: DLOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); - available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); - channels_.at(who)->set_signal(search_next_signal(channels_.at(who)->get_signal().get_signal_str(), true)); + if (sat == 0) + { + available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); + channels_.at(who)->set_signal(search_next_signal(channels_.at(who)->get_signal().get_signal_str(), true)); + } DLOG(INFO) << "Channel " << who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); channels_.at(who)->start_acquisition(); break; @@ -390,10 +429,14 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) acq_channels_count_--; for (unsigned int i = 0; i < channels_count_; i++) { + unsigned int sat_ = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); if (!available_GNSS_signals_.empty() && (acq_channels_count_ < max_acq_channels_) && (channels_state_[i] == 0)) { channels_state_[i] = 1; - channels_.at(i)->set_signal(search_next_signal(channels_.at(i)->get_signal().get_signal_str(), true)); + if (sat_ == 0) + { + channels_.at(i)->set_signal(search_next_signal(channels_.at(i)->get_signal().get_signal_str(), true)); + } acq_channels_count_++; DLOG(INFO) << "Channel " << i << " Starting acquisition " << channels_.at(i)->get_signal().get_satellite() << ", Signal " << channels_.at(i)->get_signal().get_signal_str(); channels_.at(i)->start_acquisition(); @@ -417,7 +460,10 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) { channels_state_[who] = 0; LOG(INFO) << "Channel " << who << " Idle state"; - available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); + if (sat == 0) + { + available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); + } } break; @@ -436,7 +482,6 @@ void GNSSFlowgraph::set_configuration(std::shared_ptr co LOG(WARNING) << "Unable to update configuration while flowgraph running"; return; } - if (connected_) { LOG(WARNING) << "Unable to update configuration while flowgraph connected"; @@ -541,20 +586,10 @@ void GNSSFlowgraph::init() void GNSSFlowgraph::set_signals_list() { - /* - * Sets a sequential list of GNSS satellites - */ + // Set a sequential list of GNSS satellites std::set::const_iterator available_gnss_prn_iter; - /* - * \TODO Describe GNSS satellites more nicely, with RINEX notation - * See http://igscb.jpl.nasa.gov/igscb/data/format/rinex301.pdf (page 5) - */ - - /* - * Read GNSS-SDR default GNSS system and signal - */ - + // Read GNSS systems and signals unsigned int total_channels = configuration_->property("Channels_1C.count", 0) + configuration_->property("Channels_1B.count", 0) + configuration_->property("Channels_1G.count", 0) + @@ -563,11 +598,7 @@ void GNSSFlowgraph::set_signals_list() configuration_->property("Channels_5X.count", 0) + configuration_->property("Channels_L5.count", 0); - /* - * Loop to create the list of GNSS Signals - * To add signals from other systems, add another loop 'for' - */ - + // Create the lists of GNSS satellites std::set available_gps_prn = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}; @@ -689,6 +720,7 @@ void GNSSFlowgraph::set_signals_list() std::string("L5"))); } } + if (configuration_->property("Channels_SBAS.count", 0) > 0) { /* @@ -704,7 +736,6 @@ void GNSSFlowgraph::set_signals_list() } } - if (configuration_->property("Channels_1B.count", 0) > 0) { /* @@ -764,39 +795,12 @@ void GNSSFlowgraph::set_signals_list() std::string("2G"))); } } - /* - * Ordering the list of signals from configuration file - */ - std::list::iterator gnss_it = available_GNSS_signals_.begin(); - - // Pre-assignation if not defined at ChannelX.signal=1C ...? In what order? - - for (unsigned int i = 0; i < total_channels; i++) - { - std::string gnss_signal = (configuration_->property("Channel" + boost::lexical_cast(i) + ".signal", std::string("1C"))); - std::string gnss_system; - if ((gnss_signal.compare("1C") == 0) or (gnss_signal.compare("2S") == 0) or (gnss_signal.compare("L5") == 0)) gnss_system = "GPS"; - if ((gnss_signal.compare("1B") == 0) or (gnss_signal.compare("5X") == 0)) gnss_system = "Galileo"; - if ((gnss_signal.compare("1G") == 0) or (gnss_signal.compare("2G") == 0)) gnss_system = "Glonass"; - unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); - LOG(INFO) << "Channel " << i << " system " << gnss_system << ", signal " << gnss_signal << ", sat " << sat; - if (sat == 0) // 0 = not PRN in configuration file - { - gnss_it++; - } - else - { - Gnss_Signal signal_value = Gnss_Signal(Gnss_Satellite(gnss_system, sat), gnss_signal); - available_GNSS_signals_.remove(signal_value); - gnss_it = available_GNSS_signals_.insert(gnss_it, signal_value); - } - } } void GNSSFlowgraph::set_channels_state() { - max_acq_channels_ = (configuration_->property("Channels.in_acquisition", channels_count_)); + max_acq_channels_ = configuration_->property("Channels.in_acquisition", channels_count_); if (max_acq_channels_ > channels_count_) { max_acq_channels_ = channels_count_; From b4cb0cc76bfb0b2249158c18babe1d810489044a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 20 Apr 2018 12:56:32 +0200 Subject: [PATCH 16/39] Improve wording --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a87240cb..262feeb0c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,7 +75,7 @@ the actual username of your GitHub account): 4. Your forked repository https://github.com/YOUR_USERNAME/gnss-sdr will receive the default name of `origin`. You can also add the original -gnss-sdr repository, which is usually called `upstream`: +gnss-sdr repository, which is usually referred to as `upstream`: $ cd gnss-sdr $ git remote add upstream https://github.com/gnss-sdr/gnss-sdr.git From 2cd1bed90c8de81f40236d7739e16d3aa6e02963 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 20 Apr 2018 13:20:10 +0200 Subject: [PATCH 17/39] Fix headers and documentation --- src/core/receiver/gnss_flowgraph.cc | 25 +++++++++++-------------- src/core/receiver/gnss_flowgraph.h | 21 ++++++++++++--------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 255cb7609..4df4c0727 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1,12 +1,10 @@ /*! * \file gnss_flowgraph.cc - * \brief Implementation of a GNSS receiver flowgraph + * \brief Implementation of a GNSS receiver flow graph * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2012. luis(at)epsilon-formacion.com * Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es * - * Detailed description of the file here if needed. - * * ------------------------------------------------------------------------- * * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) @@ -95,7 +93,7 @@ void GNSSFlowgraph::stop() void GNSSFlowgraph::connect() { - // Connects the blocks in the flowgraph + // Connects the blocks in the flow graph // Signal Source > Signal conditioner >> Channels >> Observables >> PVT LOG(INFO) << "Connecting flowgraph"; @@ -401,7 +399,7 @@ bool GNSSFlowgraph::send_telemetry_msg(pmt::pmt_t msg) /* - * Applies an action to the flowgraph + * Applies an action to the flow graph * * \param[in] who Who generated the action * \param[in] what What is the action 0: acquisition failed @@ -509,9 +507,9 @@ void GNSSFlowgraph::init() { std::cout << "Creating source " << i << std::endl; sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_, i)); - //TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. - //Include GetRFChannels in the interface to avoid read config parameters here - //read the number of RF channels for each front-end + // TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. + // Include GetRFChannels in the interface to avoid read config parameters here + // read the number of RF channels for each front-end RF_Channels = configuration_->property(sig_source_.at(i)->role() + ".RF_channels", 1); std::cout << "RF Channels " << RF_Channels << std::endl; for (int j = 0; j < RF_Channels; j++) @@ -523,11 +521,11 @@ void GNSSFlowgraph::init() } else { - //backwards compatibility for old config files + // backwards compatibility for old config files sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_, -1)); - //TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. - //Include GetRFChannels in the interface to avoid read config parameters here - //read the number of RF channels for each front-end + // TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. + // Include GetRFChannels in the interface to avoid read config parameters here + // read the number of RF channels for each front-end RF_Channels = configuration_->property(sig_source_.at(0)->role() + ".RF_channels", 0); if (RF_Channels != 0) { @@ -539,7 +537,7 @@ void GNSSFlowgraph::init() } else { - //old config file, single signal source and single channel, not specified + // old config file, single signal source and single channel, not specified sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, -1)); } } @@ -566,7 +564,6 @@ void GNSSFlowgraph::init() std::shared_ptr>> channels = block_factory_->GetChannels(configuration_, queue_); - //todo:check smart pointer coherence... channels_count_ = channels->size(); for (unsigned int i = 0; i < channels_count_; i++) { diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 7f8891f29..df041c8e8 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -1,12 +1,12 @@ /*! * \file gnss_flowgraph.h - * \brief Interface of a GNSS receiver flowgraph. + * \brief Interface of a GNSS receiver flow graph. * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com * Luis Esteve, 2011. luis(at)epsilon-formacion.com * Carles Fernandez-Prades, 2014. cfernandez(at)cttc.es * * It contains a signal source, - * a signal conditioner, a set of channels, a pvt and an output filter. + * a signal conditioner, a set of channels, an observables block and a pvt. * * ------------------------------------------------------------------------- * @@ -53,7 +53,7 @@ class ChannelInterface; class ConfigurationInterface; class GNSSBlockFactory; -/*! \brief This class represents a GNSS flowgraph. +/*! \brief This class represents a GNSS flow graph. * * It contains a signal source, * a signal conditioner, a set of channels, a PVT and an output filter. @@ -62,7 +62,7 @@ class GNSSFlowgraph { public: /*! - * \brief Constructor that initializes the receiver flowgraph + * \brief Constructor that initializes the receiver flow graph */ GNSSFlowgraph(std::shared_ptr configuration, gr::msg_queue::sptr queue); @@ -71,14 +71,14 @@ public: */ virtual ~GNSSFlowgraph(); - //! \brief Start the flowgraph + //! \brief Start the flow graph void start(); - //! \brief Stop the flowgraph + //! \brief Stop the flow graph void stop(); /*! - * \brief Connects the defined blocks in the flowgraph + * \brief Connects the defined blocks in the flow graph * * Signal Source > Signal conditioner > Channels >> Observables >> PVT > Output filter */ @@ -87,10 +87,10 @@ public: void wait(); /*! - * \brief Applies an action to the flowgraph + * \brief Applies an action to the flow graph * * \param[in] who Who generated the action - * \param[in] what What is the action 0: acquisition failed + * \param[in] what What is the action. 0: acquisition failed; 1: acquisition success; 2: tracking lost */ void apply_action(unsigned int who, unsigned int what); @@ -100,14 +100,17 @@ public: { return applied_actions_; } + bool connected() { return connected_; } + bool running() { return running_; } + /*! * \brief Sends a GNURadio asynchronous message from telemetry to PVT * From a584e8e51dfcba0a433820cf762ec2d462a7bca3 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Apr 2018 19:49:13 +0200 Subject: [PATCH 18/39] Add mutex to protect list of available signals Disconnect the flowgraph when leaving --- src/core/receiver/gnss_flowgraph.cc | 214 ++++++++++++++++++++++++++-- src/core/receiver/gnss_flowgraph.h | 8 +- 2 files changed, 206 insertions(+), 16 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 4df4c0727..3303d15b6 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -58,7 +58,13 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configurati } -GNSSFlowgraph::~GNSSFlowgraph() {} +GNSSFlowgraph::~GNSSFlowgraph() +{ + if (connected_) + { + GNSSFlowgraph::disconnect(); + } +} void GNSSFlowgraph::start() @@ -376,6 +382,183 @@ void GNSSFlowgraph::connect() } +void GNSSFlowgraph::disconnect() +{ + LOG(INFO) << "Disconnecting flowgraph"; + + if (!connected_) + { + LOG(INFO) << "flowgraph was not connected"; + return; + } + + // Signal Source (i) > Signal conditioner (i) > + int RF_Channels = 0; + int signal_conditioner_ID = 0; + + for (int i = 0; i < sources_count_; i++) + { + try + { + // TODO: Remove this array implementation and create generic multistream connector + // (if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) + if (sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0) + { + //Multichannel Array + for (int j = 0; j < GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS; j++) + { + top_block_->disconnect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(i)->get_left_block(), j); + } + } + else + { + // TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface. + // Include GetRFChannels in the interface to avoid read config parameters here + // read the number of RF channels for each front-end + RF_Channels = configuration_->property(sig_source_.at(i)->role() + ".RF_channels", 1); + + for (int j = 0; j < RF_Channels; j++) + { + if (sig_source_.at(i)->get_right_block()->output_signature()->max_streams() > 1) + { + top_block_->disconnect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); + } + else + { + if (j == 0) + { + // RF_channel 0 backward compatibility with single channel sources + top_block_->disconnect(sig_source_.at(i)->get_right_block(), 0, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); + } + else + { + // Multiple channel sources using multiple output blocks of single channel (requires RF_channel selector in call) + top_block_->disconnect(sig_source_.at(i)->get_right_block(j), 0, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0); + } + } + signal_conditioner_ID++; + } + } + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect signal source " << i << " to signal conditioner " << i << ": " << e.what(); + } + } + + try + { + top_block_->disconnect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0); + top_block_->disconnect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect sample counter: " << e.what(); + } + + // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) + int selected_signal_conditioner_ID; + for (unsigned int i = 0; i < channels_count_; i++) + { + selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast(i) + ".RF_channel_ID", 0); + try + { + top_block_->disconnect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, + channels_.at(i)->get_left_block(), 0); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect signal conditioner " << selected_signal_conditioner_ID << " to channel " << i << ": " << e.what(); + } + + // Signal Source > Signal conditioner >> Channels >> Observables + try + { + top_block_->disconnect(channels_.at(i)->get_right_block(), 0, + observables_->get_left_block(), i); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect channel " << i << " to observables: " << e.what(); + } + } + + try + { + for (unsigned int i = 0; i < channels_count_; i++) + { + top_block_->disconnect(observables_->get_right_block(), i, pvt_->get_left_block(), i); + top_block_->msg_disconnect(channels_.at(i)->get_right_block(), pmt::mp("telemetry"), pvt_->get_left_block(), pmt::mp("telemetry")); + } + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect observables to PVT: " << e.what(); + } + + for (int i = 0; i < sources_count_; i++) + { + try + { + sig_source_.at(i)->disconnect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect signal source block " << i << " internally: " << e.what(); + } + } + + // Signal Source > Signal conditioner > + for (unsigned int i = 0; i < sig_conditioner_.size(); i++) + { + try + { + sig_conditioner_.at(i)->disconnect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect signal conditioner block " << i << " internally: " << e.what(); + } + } + + for (unsigned int i = 0; i < channels_count_; i++) + { + try + { + channels_.at(i)->disconnect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect channel " << i << " internally: " << e.what(); + } + } + + try + { + observables_->disconnect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect observables block internally: " << e.what(); + } + + // Signal Source > Signal conditioner >> Channels >> Observables > PVT + try + { + pvt_->disconnect(top_block_); + } + catch (const std::exception& e) + { + LOG(INFO) << "Can't disconnect PVT block internally: " << e.what(); + } + + DLOG(INFO) << "blocks disconnected internally"; + + connected_ = false; + LOG(INFO) << "Flowgraph disconnected"; +} + + void GNSSFlowgraph::wait() { if (!running_) @@ -411,18 +594,19 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) switch (what) { case 0: - DLOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); + DLOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_[who]->get_signal().get_satellite() << ", Signal " << channels_[who]->get_signal().get_signal_str(); if (sat == 0) { - available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); - channels_.at(who)->set_signal(search_next_signal(channels_.at(who)->get_signal().get_signal_str(), true)); + std::lock_guard lock(signal_list_mutex); + available_GNSS_signals_.push_back(channels_[who]->get_signal()); + channels_[who]->set_signal(search_next_signal(channels_[who]->get_signal().get_signal_str(), true)); } - DLOG(INFO) << "Channel " << who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); - channels_.at(who)->start_acquisition(); + DLOG(INFO) << "Channel " << who << " Starting acquisition " << channels_[who]->get_signal().get_satellite() << ", Signal " << channels_[who]->get_signal().get_signal_str(); + channels_[who]->start_acquisition(); break; case 1: - LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_.at(who)->get_signal().get_satellite(); + LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_[who]->get_signal().get_satellite(); channels_state_[who] = 2; acq_channels_count_--; for (unsigned int i = 0; i < channels_count_; i++) @@ -433,26 +617,27 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) channels_state_[i] = 1; if (sat_ == 0) { - channels_.at(i)->set_signal(search_next_signal(channels_.at(i)->get_signal().get_signal_str(), true)); + std::lock_guard lock(signal_list_mutex); + channels_[i]->set_signal(search_next_signal(channels_[i]->get_signal().get_signal_str(), true)); } acq_channels_count_++; - DLOG(INFO) << "Channel " << i << " Starting acquisition " << channels_.at(i)->get_signal().get_satellite() << ", Signal " << channels_.at(i)->get_signal().get_signal_str(); - channels_.at(i)->start_acquisition(); + DLOG(INFO) << "Channel " << i << " Starting acquisition " << channels_[i]->get_signal().get_satellite() << ", Signal " << channels_[i]->get_signal().get_signal_str(); + channels_[i]->start_acquisition(); } DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i]; } break; case 2: - LOG(INFO) << "Channel " << who << " TRK FAILED satellite " << channels_.at(who)->get_signal().get_satellite(); + LOG(INFO) << "Channel " << who << " TRK FAILED satellite " << channels_[who]->get_signal().get_satellite(); DLOG(INFO) << "Number of channels in acquisition = " << acq_channels_count_; if (acq_channels_count_ < max_acq_channels_) { channels_state_[who] = 1; acq_channels_count_++; - LOG(INFO) << "Channel " << who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str(); - channels_.at(who)->start_acquisition(); + LOG(INFO) << "Channel " << who << " Starting acquisition " << channels_[who]->get_signal().get_satellite() << ", Signal " << channels_[who]->get_signal().get_signal_str(); + channels_[who]->start_acquisition(); } else { @@ -460,7 +645,8 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) LOG(INFO) << "Channel " << who << " Idle state"; if (sat == 0) { - available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); + std::lock_guard lock(signal_list_mutex); + available_GNSS_signals_.push_back(channels_[who]->get_signal()); } } break; diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index df041c8e8..a6915e97e 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -67,9 +68,9 @@ public: GNSSFlowgraph(std::shared_ptr configuration, gr::msg_queue::sptr queue); /*! - * \brief Virtual destructor + * \brief Destructor */ - virtual ~GNSSFlowgraph(); + ~GNSSFlowgraph(); //! \brief Start the flow graph void start(); @@ -84,6 +85,8 @@ public: */ void connect(); + void disconnect(); + void wait(); /*! @@ -147,6 +150,7 @@ private: gr::msg_queue::sptr queue_; std::list available_GNSS_signals_; std::vector channels_state_; + std::mutex signal_list_mutex; }; #endif /*GNSS_SDR_GNSS_FLOWGRAPH_H_*/ From bed15db08d4759c92e3582e6005f88385c47b5be Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Apr 2018 22:51:02 +0200 Subject: [PATCH 19/39] Use volk_gnsssdr to reserve memory --- .../telemetry_decoder/gnuradio_blocks/CMakeLists.txt | 7 ++++++- .../gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc | 9 ++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 335ae52df..26dae1cdf 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -37,10 +37,15 @@ include_directories( ${GFlags_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${VOLK_GNSSSDR_INCLUDE_DIRS} ) file(GLOB TELEMETRY_DECODER_GR_BLOCKS_HEADERS "*.h") list(SORT TELEMETRY_DECODER_GR_BLOCKS_HEADERS) add_library(telemetry_decoder_gr_blocks ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES} ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) source_group(Headers FILES ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) -target_link_libraries(telemetry_decoder_gr_blocks telemetry_decoder_libswiftcnav telemetry_decoder_lib gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES}) +target_link_libraries(telemetry_decoder_gr_blocks telemetry_decoder_libswiftcnav telemetry_decoder_lib gnss_system_parameters ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES}) + +if(NOT VOLK_GNSSSDR_FOUND) + add_dependencies(telemetry_decoder_gr_blocks volk_gnsssdr_module) +endif(NOT VOLK_GNSSSDR_FOUND) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index 1070dca28..5c0071307 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -32,8 +32,9 @@ #include "gps_l1_ca_telemetry_decoder_cc.h" #include "control_message_factory.h" #include -#include #include +#include +#include #ifndef _rotl @@ -63,10 +64,8 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc( // set the preamble unsigned short int preambles_bits[GPS_CA_PREAMBLE_LENGTH_BITS] = GPS_PREAMBLE; - //memcpy((unsigned short int*)this->d_preambles_bits, (unsigned short int*)preambles_bits, GPS_CA_PREAMBLE_LENGTH_BITS*sizeof(unsigned short int)); - // preamble bits to sampled symbols - d_preambles_symbols = static_cast(malloc(sizeof(signed int) * GPS_CA_PREAMBLE_LENGTH_SYMBOLS)); + d_preambles_symbols = static_cast(volk_gnsssdr_malloc(GPS_CA_PREAMBLE_LENGTH_SYMBOLS * sizeof(int), volk_gnsssdr_get_alignment())); int n = 0; for (int i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++) { @@ -112,7 +111,7 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc( gps_l1_ca_telemetry_decoder_cc::~gps_l1_ca_telemetry_decoder_cc() { - delete d_preambles_symbols; + volk_gnsssdr_free(d_preambles_symbols); if (d_dump_file.is_open() == true) { try From 9339ec4874af8c11644d874ca3531e2e7952a497 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Apr 2018 22:53:33 +0200 Subject: [PATCH 20/39] Display channel number when decoding data --- .../gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc index f06d19b6f..c27214c52 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc @@ -166,20 +166,20 @@ int gps_l2c_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( { // get ephemeris object for this SV std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_ephemeris()); - std::cout << TEXT_BLUE << "New GPS CNAV message received: ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_iono() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_iono()); - std::cout << TEXT_BLUE << "New GPS CNAV message received: iono model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": iono model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_utc_model() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_utc_model()); - std::cout << TEXT_BLUE << "New GPS CNAV message received: UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_BLUE << "New GPS CNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } From 61fbbc9abb393422e5bd9dd6640ca6c639213c9e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Apr 2018 23:07:34 +0200 Subject: [PATCH 21/39] Add color to GPS L5 CNAV message demodulation --- .../gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc | 14 +++++++------- .../gnuradio_blocks/gps_l5_telemetry_decoder_cc.h | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc index 0793428fa..1f2a8decf 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc @@ -1,7 +1,6 @@ /*! * \file gps_l5_telemetry_decoder_cc.cc - * \brief Implementation of a NAV message demodulator block based on - * Kay Borre book MATLAB-based GPS receiver + * \brief Implementation of a CNAV message demodulator block * \author Antonio Ramos, 2017. antonio.ramos(at)cttc.es * * ------------------------------------------------------------------------- @@ -31,12 +30,13 @@ #include "gps_l5_telemetry_decoder_cc.h" +#include "display.h" #include "gnss_synchro.h" #include "gps_cnav_ephemeris.h" #include "gps_cnav_iono.h" -#include -#include #include +#include +#include #include #include #include @@ -218,20 +218,20 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u { // get ephemeris object for this SV std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_ephemeris()); - std::cout << "New GPS L5 CNAV message received: ephemeris from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_iono() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_iono()); - std::cout << "New GPS L5 CNAV message received: iono model parameters from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": iono model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_CNAV_Message.have_new_utc_model() == true) { std::shared_ptr tmp_obj = std::make_shared(d_CNAV_Message.get_utc_model()); - std::cout << "New GPS L5 CNAV message received: UTC model parameters from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New GPS L5 CNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h index 59f0bf108..8afa6569e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h @@ -1,7 +1,6 @@ /*! * \file gps_l5_telemetry_decoder_cc.h - * \brief Interface of a CNAV message demodulator block based on - * Kay Borre book MATLAB-based GPS receiver + * \brief Interface of a CNAV message demodulator block * \author Antonio Ramos, 2017. antonio.ramos(at)cttc.es * ------------------------------------------------------------------------- * @@ -42,7 +41,8 @@ #include #include -extern "C" { +extern "C" +{ #include "cnav_msg.h" #include "edc.h" #include "bits.h" From 616812867feb62df72dc66aa56f4161c4c1388e5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Apr 2018 23:10:05 +0200 Subject: [PATCH 22/39] Report channel when decoding a NAV message --- .../telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc index d4980a532..e7379f7e0 100644 --- a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc +++ b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc @@ -39,13 +39,16 @@ //************ GPS WORD TO SUBFRAME DECODER STATE MACHINE ********** - struct Ev_gps_word_valid : sc::event { }; + + struct Ev_gps_word_invalid : sc::event { }; + + struct Ev_gps_word_preamble : sc::event { }; @@ -245,16 +248,20 @@ void GpsL1CaSubframeFsm::gps_word_to_subframe(int position) std::memcpy(&d_subframe[position * GPS_WORD_LENGTH], &d_GPS_frame_4bytes, sizeof(char) * GPS_WORD_LENGTH); } + void GpsL1CaSubframeFsm::clear_flag_new_subframe() { d_flag_new_subframe = false; } + + void GpsL1CaSubframeFsm::gps_subframe_to_nav_msg() { //int subframe_ID; // NEW GPS SUBFRAME HAS ARRIVED! d_subframe_ID = d_nav.subframe_decoder(this->d_subframe); //decode the subframe - std::cout << "New GPS NAV message received: subframe " + std::cout << "New GPS NAV message received in channel " << i_channel_ID << ": " + << "subframe " << d_subframe_ID << " from satellite " << Gnss_Satellite(std::string("GPS"), i_satellite_PRN) << std::endl; d_nav.i_satellite_PRN = i_satellite_PRN; @@ -263,6 +270,7 @@ void GpsL1CaSubframeFsm::gps_subframe_to_nav_msg() d_flag_new_subframe = true; } + void GpsL1CaSubframeFsm::Event_gps_word_valid() { this->process_event(Ev_gps_word_valid()); From 6f9fafcef06a82ae70d707752f42438a4bfbe823 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 23 Apr 2018 07:41:13 +0200 Subject: [PATCH 23/39] Disconnect flowgraph when finished --- src/core/receiver/control_thread.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index db3e3841b..b2d1838f4 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -148,6 +148,7 @@ void ControlThread::run() std::cout << "Stopping GNSS-SDR, please wait!" << std::endl; flowgraph_->stop(); stop_ = true; + flowgraph_->disconnect(); //Join keyboard thread #ifdef OLD_BOOST From 3e0587b28c0551e86633056844cbff9ca19c67c1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 23 Apr 2018 07:41:53 +0200 Subject: [PATCH 24/39] Display channel when decoding GNAV messages --- .../glonass_l2_ca_telemetry_decoder_cc.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc index b446b6e7e..a57307850 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc @@ -31,9 +31,10 @@ #include "glonass_l2_ca_telemetry_decoder_cc.h" +#include "display.h" #include -#include #include +#include #define CRC_ERROR_LIMIT 6 @@ -180,11 +181,11 @@ void glonass_l2_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in // 3. Check operation executed correctly if (d_nav.flag_CRC_test == true) { - LOG(INFO) << "GLONASS GNAV CRC correct on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV CRC correct in channel " << d_channel << " from satellite " << d_satellite; } else { - LOG(INFO) << "GLONASS GNAV CRC error on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV CRC error in channel " << d_channel << " from satellite " << d_satellite; } // 4. Push the new navigation data to the queues if (d_nav.have_new_ephemeris() == true) @@ -193,26 +194,29 @@ void glonass_l2_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in d_nav.gnav_ephemeris.i_satellite_freq_channel = d_satellite.get_rf_link(); std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV Ephemeris have been received on channel" << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV Ephemeris have been received in channel" << d_channel << " from satellite " << d_satellite; + std::cout << TEXT_CYAN << "New GLONASS L2 GNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; } if (d_nav.have_new_utc_model() == true) { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV UTC Model have been received on channel" << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV UTC Model have been received in channel" << d_channel << " from satellite " << d_satellite; + std::cout << TEXT_CYAN << "New GLONASS L2 GNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; } if (d_nav.have_new_almanac() == true) { unsigned int slot_nbr = d_nav.i_alm_satellite_slot_number; std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV Almanac have been received on channel" << d_channel << " in slot number " << slot_nbr; + LOG(INFO) << "GLONASS GNAV Almanac have been received in channel" << d_channel << " in slot number " << slot_nbr; + std::cout << TEXT_CYAN << "New GLONASS L2 GNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << TEXT_RESET << std::endl; } // 5. Update satellite information on system if (d_nav.flag_update_slot_number == true) { - LOG(INFO) << "GLONASS GNAV Slot Number Identified on channel " << d_channel; + LOG(INFO) << "GLONASS GNAV Slot Number Identified in channel " << d_channel; d_satellite.update_PRN(d_nav.gnav_ephemeris.d_n); d_satellite.what_block(d_satellite.get_system(), d_nav.gnav_ephemeris.d_n); d_nav.flag_update_slot_number = false; From 1b852336c6918ce3a0a1082992a61284210a141a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 23 Apr 2018 07:52:49 +0200 Subject: [PATCH 25/39] Improve memory management in Viterbi decoder --- .../galileo_e1b_telemetry_decoder_cc.cc | 65 ++++++++----------- .../galileo_e1b_telemetry_decoder_cc.h | 9 +++ .../galileo_e5a_telemetry_decoder_cc.cc | 64 +++++++----------- .../galileo_e5a_telemetry_decoder_cc.h | 9 +++ 4 files changed, 68 insertions(+), 79 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc index 6f2242454..b9aee4196 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc @@ -37,6 +37,7 @@ #include #include #include +#include #include @@ -54,38 +55,8 @@ galileo_e1b_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump void galileo_e1b_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols, int *page_part_bits) { - int CodeLength = 240; - int DataLength; - int nn, KK, mm, max_states; - int g_encoder[2]; - - nn = 2; // Coding rate 1/n - KK = 7; // Constraint Length - g_encoder[0] = 121; // Polynomial G1 - g_encoder[1] = 91; // Polynomial G2 - - mm = KK - 1; - max_states = 1 << mm; /* 2^mm */ - DataLength = (CodeLength / nn) - mm; - - /* create appropriate transition matrices */ - int *out0, *out1, *state0, *state1; - out0 = static_cast(calloc(max_states, sizeof(int))); - out1 = static_cast(calloc(max_states, sizeof(int))); - state0 = static_cast(calloc(max_states, sizeof(int))); - state1 = static_cast(calloc(max_states, sizeof(int))); - - nsc_transit(out0, state0, 0, g_encoder, KK, nn); - nsc_transit(out1, state1, 1, g_encoder, KK, nn); - Viterbi(page_part_bits, out0, state0, out1, state1, page_part_symbols, KK, nn, DataLength); - - /* Clean up memory */ - free(out0); - free(out1); - free(state0); - free(state1); } @@ -122,7 +93,7 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc( memcpy(static_cast(this->d_preambles_bits), static_cast(preambles_bits), GALILEO_INAV_PREAMBLE_LENGTH_BITS * sizeof(unsigned short int)); // preamble bits to sampled symbols - d_preambles_symbols = static_cast(malloc(sizeof(signed int) * d_symbols_per_preamble)); + d_preambles_symbols = static_cast(volk_gnsssdr_malloc(d_symbols_per_preamble * sizeof(int), volk_gnsssdr_get_alignment())); int n = 0; for (int i = 0; i < GALILEO_INAV_PREAMBLE_LENGTH_BITS; i++) { @@ -153,12 +124,28 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc( d_flag_preamble = false; d_channel = 0; flag_TOW_set = false; + + // vars for Viterbi decoder + int max_states = 1 << mm; /* 2^mm */ + g_encoder[0] = 121; // Polynomial G1 + g_encoder[1] = 91; // Polynomial G2 + out0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + out1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + state0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + state1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + /* create appropriate transition matrices */ + nsc_transit(out0, state0, 0, g_encoder, KK, nn); + nsc_transit(out1, state1, 1, g_encoder, KK, nn); } galileo_e1b_telemetry_decoder_cc::~galileo_e1b_telemetry_decoder_cc() { - delete d_preambles_symbols; + volk_gnsssdr_free(d_preambles_symbols); + volk_gnsssdr_free(out0); + volk_gnsssdr_free(out1); + volk_gnsssdr_free(state0); + volk_gnsssdr_free(state1); if (d_dump_file.is_open() == true) { try @@ -213,13 +200,13 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols, in d_nav.split_page(page_String, flag_even_word_arrived); if (d_nav.flag_CRC_test == true) { - LOG(INFO) << "Galileo E1 CRC correct on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "Galileo E1 CRC correct in channel " << d_channel << " from satellite " << d_satellite; //std::cout << "Galileo E1 CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl; } else { - std::cout << "Galileo E1 CRC error on channel " << d_channel << " from satellite " << d_satellite << std::endl; - LOG(INFO) << "Galileo E1 CRC error on channel " << d_channel << " from satellite " << d_satellite; + std::cout << "Galileo E1 CRC error in channel " << d_channel << " from satellite " << d_satellite << std::endl; + LOG(INFO) << "Galileo E1 CRC error in channel " << d_channel << " from satellite " << d_satellite; } flag_even_word_arrived = 0; } @@ -235,21 +222,21 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols, in { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); - std::cout << "New Galileo E1 I/NAV message received: ephemeris from satellite " << d_satellite << std::endl; + std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_nav.have_new_iono_and_GST() == true) { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_iono()); - std::cout << "New Galileo E1 I/NAV message received: iono/GST model parameters from satellite " << d_satellite << std::endl; + std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": iono/GST model parameters from satellite " << d_satellite << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_nav.have_new_utc_model() == true) { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model()); - std::cout << "New Galileo E1 I/NAV message received: UTC model parameters from satellite " << d_satellite << std::endl; + std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_nav.have_new_almanac() == true) @@ -257,7 +244,7 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols, in std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); //debug - std::cout << "Galileo E1 I/NAV almanac received!" << std::endl; + std::cout << "Galileo E1 I/NAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl; DLOG(INFO) << "GPS_to_Galileo time conversion:"; DLOG(INFO) << "A0G=" << tmp_obj->A_0G_10; DLOG(INFO) << "A1G=" << tmp_obj->A_1G_10; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h index 33900b7d1..6caf0aa6c 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.h @@ -112,6 +112,15 @@ private: std::string d_dump_filename; std::ofstream d_dump_file; + + // vars for Viterbi decoder + int *out0, *out1, *state0, *state1; + int g_encoder[2]; + const int nn = 2; // Coding rate 1/n + const int KK = 7; // Constraint Length + int mm = KK - 1; + const int CodeLength = 240; + int DataLength = (CodeLength / nn) - mm; }; #endif diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc index c828fb859..647647698 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.cc @@ -37,9 +37,11 @@ #include "galileo_e5a_telemetry_decoder_cc.h" #include "control_message_factory.h" #include "convolutional.h" +#include "display.h" #include #include #include +#include #include #include @@ -58,42 +60,8 @@ galileo_e5a_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump void galileo_e5a_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols, int *page_part_bits) { - // int CodeLength = 240; - int CodeLength = 488; - int DataLength; - int nn, KK, mm, max_states; - int g_encoder[2]; - - nn = 2; // Coding rate 1/n - KK = 7; // Constraint Length - g_encoder[0] = 121; // Polynomial G1 - g_encoder[1] = 91; // Polynomial G2 - // g_encoder[0] = 171; // Polynomial G1 - // g_encoder[1] = 133; // Polynomial G2 - - mm = KK - 1; - max_states = 1 << mm; // 2^mm - DataLength = (CodeLength / nn) - mm; - - //create appropriate transition matrices - - int *out0, *out1, *state0, *state1; - out0 = static_cast(calloc(max_states, sizeof(int))); - out1 = static_cast(calloc(max_states, sizeof(int))); - state0 = static_cast(calloc(max_states, sizeof(int))); - state1 = static_cast(calloc(max_states, sizeof(int))); - - nsc_transit(out0, state0, 0, g_encoder, KK, nn); - nsc_transit(out1, state1, 1, g_encoder, KK, nn); - Viterbi(page_part_bits, out0, state0, out1, state1, page_part_symbols, KK, nn, DataLength); - - //Clean up memory - free(out0); - free(out1); - free(state0); - free(state1); } @@ -147,32 +115,32 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols, int fra d_nav.split_page(page_String); if (d_nav.flag_CRC_test == true) { - LOG(INFO) << "Galileo E5a CRC correct on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "Galileo E5a CRC correct in channel " << d_channel << " from satellite " << d_satellite; //std::cout << "Galileo E5a CRC correct on channel " << d_channel << " from satellite " << d_satellite << std::endl; } else { - std::cout << "Galileo E5a CRC error on channel " << d_channel << " from satellite " << d_satellite << std::endl; - LOG(INFO) << "Galileo E5a CRC error on channel " << d_channel << " from satellite " << d_satellite; + std::cout << "Galileo E5a CRC error in channel " << d_channel << " from satellite " << d_satellite << std::endl; + LOG(INFO) << "Galileo E5a CRC error in channel " << d_channel << " from satellite " << d_satellite; } // 4. Push the new navigation data to the queues if (d_nav.have_new_ephemeris() == true) { std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); - std::cout << "New Galileo E5a F/NAV message received: ephemeris from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_nav.have_new_iono_and_GST() == true) { std::shared_ptr tmp_obj = std::make_shared(d_nav.get_iono()); - std::cout << "New Galileo E5a F/NAV message received: iono/GST model parameters from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": iono/GST model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } if (d_nav.have_new_utc_model() == true) { std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model()); - std::cout << "New Galileo E5a F/NAV message received: UTC model parameters from satellite " << d_satellite << std::endl; + std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); } } @@ -226,11 +194,27 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc( flag_bit_start = false; new_symbol = false; required_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS; + + // vars for Viterbi decoder + int max_states = 1 << mm; /* 2^mm */ + g_encoder[0] = 121; // Polynomial G1 + g_encoder[1] = 91; // Polynomial G2 + out0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + out1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + state0 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + state1 = static_cast(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment())); + /* create appropriate transition matrices */ + nsc_transit(out0, state0, 0, g_encoder, KK, nn); + nsc_transit(out1, state1, 1, g_encoder, KK, nn); } galileo_e5a_telemetry_decoder_cc::~galileo_e5a_telemetry_decoder_cc() { + volk_gnsssdr_free(out0); + volk_gnsssdr_free(out1); + volk_gnsssdr_free(state0); + volk_gnsssdr_free(state1); if (d_dump_file.is_open() == true) { try diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h index 5579f701a..5c004f18b 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e5a_telemetry_decoder_cc.h @@ -112,6 +112,15 @@ private: Gnss_Satellite d_satellite; // navigation message vars Galileo_Fnav_Message d_nav; + + // vars for Viterbi decoder + int *out0, *out1, *state0, *state1; + int g_encoder[2]; + const int nn = 2; // Coding rate 1/n + const int KK = 7; // Constraint Length + int mm = KK - 1; + const int CodeLength = 488; + int DataLength = (CodeLength / nn) - mm; }; #endif /* GNSS_SDR_GALILEO_E5A_TELEMETRY_DECODER_CC_H_ */ From 2c972b517b9652a5ad5818453f5c7bd33b7744a6 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 23 Apr 2018 07:53:47 +0200 Subject: [PATCH 26/39] Display info when decoding GNAV messages --- .../glonass_l1_ca_telemetry_decoder_cc.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc index 09429a7e1..a99daba1e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc @@ -181,11 +181,11 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in // 3. Check operation executed correctly if (d_nav.flag_CRC_test == true) { - LOG(INFO) << "GLONASS GNAV CRC correct on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV CRC correct in channel " << d_channel << " from satellite " << d_satellite; } else { - LOG(INFO) << "GLONASS GNAV CRC error on channel " << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV CRC error in channel " << d_channel << " from satellite " << d_satellite; } // 4. Push the new navigation data to the queues if (d_nav.have_new_ephemeris() == true) @@ -194,26 +194,29 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, in d_nav.gnav_ephemeris.i_satellite_freq_channel = d_satellite.get_rf_link(); std::shared_ptr tmp_obj = std::make_shared(d_nav.get_ephemeris()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV Ephemeris have been received on channel" << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV Ephemeris have been received in channel" << d_channel << " from satellite " << d_satellite; + std::cout << "New GLONASS L1 GNAV message received in channel " << d_channel << ": ephemeris from satellite " << d_satellite << std::endl; } if (d_nav.have_new_utc_model() == true) { // get object for this SV (mandatory) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_utc_model()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV UTC Model have been received on channel" << d_channel << " from satellite " << d_satellite; + LOG(INFO) << "GLONASS GNAV UTC Model have been received in channel" << d_channel << " from satellite " << d_satellite; + std::cout << "New GLONASS L1 GNAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << std::endl; } if (d_nav.have_new_almanac() == true) { unsigned int slot_nbr = d_nav.i_alm_satellite_slot_number; std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - LOG(INFO) << "GLONASS GNAV Almanac have been received on channel" << d_channel << " in slot number " << slot_nbr; + LOG(INFO) << "GLONASS GNAV Almanac have been received in channel" << d_channel << " in slot number " << slot_nbr; + std::cout << "New GLONASS L1 GNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl; } // 5. Update satellite information on system if (d_nav.flag_update_slot_number == true) { - LOG(INFO) << "GLONASS GNAV Slot Number Identified on channel " << d_channel; + LOG(INFO) << "GLONASS GNAV Slot Number Identified in channel " << d_channel; d_satellite.update_PRN(d_nav.gnav_ephemeris.d_n); d_satellite.what_block(d_satellite.get_system(), d_nav.gnav_ephemeris.d_n); d_nav.flag_update_slot_number = false; From c0375c99ff1d0af815f61651dd489596dc2aa594 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Mon, 23 Apr 2018 12:37:43 +0200 Subject: [PATCH 27/39] Adding GPS L1 C/A CN0 control in GPS DLL/PLL unit test --- .../gps_l1_ca_dll_pll_tracking_test.cc | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index 89f70f914..0d0bf4cf0 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -54,7 +54,8 @@ #include "test_flags.h" DEFINE_bool(plot_gps_l1_tracking_test, false, "Plots results of GpsL1CADllPllTrackingTest with gnuplot"); - +DEFINE_double(CN0_dBHz, std::numeric_limits::infinity(), "Enable noise generator and set the CN0 [dB-Hz]"); +DEFINE_int32(extend_correlation_symbols, 1, "Set the tracking coherent correlation to N symbols (up to 20 for GPS L1 C/A)"); // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CADllPllTrackingTest_msg_rx; @@ -121,7 +122,7 @@ public: std::string p3; std::string p4; std::string p5; - + std::string p6; std::string implementation = "GPS_L1_CA_DLL_PLL_Tracking"; //"GPS_L1_CA_DLL_PLL_C_Aid_Tracking"; const int baseband_sampling_freq = FLAGS_fs_gen_sps; @@ -183,6 +184,7 @@ int GpsL1CADllPllTrackingTest::configure_generator() p3 = std::string("-rinex_obs_file=") + FLAGS_filename_rinex_obs; // RINEX 2.10 observation file output p4 = std::string("-sig_out_file=") + FLAGS_filename_raw_data; // Baseband signal output file. Will be stored in int8_t IQ multiplexed samples p5 = std::string("-sampling_freq=") + std::to_string(baseband_sampling_freq); //Baseband sampling frequency [MSps] + p6 = std::string("-CN0_dBHz=") + std::to_string(FLAGS_CN0_dBHz); // Signal generator CN0 return 0; } @@ -191,7 +193,7 @@ int GpsL1CADllPllTrackingTest::generate_signal() { int child_status; - char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL}; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0],&p6[0], NULL}; int pid; if ((pid = fork()) == -1) @@ -223,12 +225,12 @@ void GpsL1CADllPllTrackingTest::configure_receiver() config->set_property("Tracking_1C.implementation", implementation); config->set_property("Tracking_1C.item_type", "gr_complex"); config->set_property("Tracking_1C.pll_bw_hz", "20.0"); - config->set_property("Tracking_1C.dll_bw_hz", "2.0"); + config->set_property("Tracking_1C.dll_bw_hz", "1.5"); config->set_property("Tracking_1C.early_late_space_chips", "0.5"); - config->set_property("Tracking_1C.pll_bw_narrow_hz", "20.0"); - config->set_property("Tracking_1C.dll_bw_narrow_hz", "2.0"); + config->set_property("Tracking_1C.extend_correlation_symbols", std::to_string(FLAGS_extend_correlation_symbols)); + config->set_property("Tracking_1C.pll_bw_narrow_hz", "2.0"); + config->set_property("Tracking_1C.dll_bw_narrow_hz", "1.0"); config->set_property("Tracking_1C.early_late_space_narrow_chips", "0.5"); - config->set_property("Tracking_1C.extend_correlation_ms", "1"); config->set_property("Tracking_1C.dump", "true"); config->set_property("Tracking_1C.dump_filename", "./tracking_ch_"); } @@ -471,6 +473,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std::vector late; std::vector promptI; std::vector promptQ; + std::vector CN0_dBHz; epoch_counter = 0; while (trk_dump.read_binary_obs()) @@ -488,6 +491,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) late.push_back(trk_dump.abs_L); promptI.push_back(trk_dump.prompt_I); promptQ.push_back(trk_dump.prompt_Q); + CN0_dBHz.push_back(trk_dump.CN0_SNV_dB_Hz); } // Align initial measurements and cut the tracking pull-in transitory @@ -555,6 +559,17 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g2.savetops("Constellation"); g2.savetopdf("Constellation", 18); g2.showonscreen(); // window output + + Gnuplot g3("linespoints"); + g3.set_title("GPS L1 C/A tracking CN0 output (satellite PRN #" + std::to_string(FLAGS_test_satellite_PRN) + ")"); + g3.set_grid(); + g3.set_xlabel("Time [s]"); + g3.set_ylabel("Reported CN0 [dB-Hz]"); + g3.cmd("set key box opaque"); + g3.plot_xy(timevec, CN0_dBHz, "Prompt", decimate); + g3.savetops("CN0_output"); + g3.savetopdf("CN0_output", 18); + g3.showonscreen(); // window output } catch (const GnuplotException& ge) { From 8b8e4887b857ee926cacc57d55a49bd8e8e9a662 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 24 Apr 2018 18:34:37 +0200 Subject: [PATCH 28/39] Fix experiment --- src/utils/reproducibility/ieee-access18/L2-access18.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/reproducibility/ieee-access18/L2-access18.conf b/src/utils/reproducibility/ieee-access18/L2-access18.conf index 57e1af0a3..e4bc4ae44 100644 --- a/src/utils/reproducibility/ieee-access18/L2-access18.conf +++ b/src/utils/reproducibility/ieee-access18/L2-access18.conf @@ -56,7 +56,7 @@ Resampler.item_type=gr_complex Channels_2S.count=10 -Channels.in_acquisition=1 +;Channels.in_acquisition=1 Channel0.signal=2S Channel1.signal=2S From 512bf3f4cf9d0925953520d664f1266c25263293 Mon Sep 17 00:00:00 2001 From: mmajoral Date: Fri, 27 Apr 2018 20:00:50 +0200 Subject: [PATCH 29/39] Created a generic gnuradio block acquisition class for the FPGA. --- .../gps_l1_ca_pcps_acquisition_fpga.cc | 236 +++++++------- .../gps_l1_ca_pcps_acquisition_fpga.h | 41 +-- .../gnuradio_blocks/CMakeLists.txt | 2 +- .../gps_pcps_acquisition_fpga_sc.cc | 298 ------------------ .../gps_pcps_acquisition_fpga_sc.h | 219 ------------- .../gnuradio_blocks/pcps_acquisition_fpga.cc | 247 +++++++++++++++ .../gnuradio_blocks/pcps_acquisition_fpga.h | 216 +++++++++++++ .../acquisition/libs/CMakeLists.txt | 2 +- ...acquisition_8sc.cc => fpga_acquisition.cc} | 140 +++----- ...a_acquisition_8sc.h => fpga_acquisition.h} | 33 +- 10 files changed, 655 insertions(+), 779 deletions(-) delete mode 100644 src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc delete mode 100644 src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h create mode 100644 src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc create mode 100644 src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h rename src/algorithms/acquisition/libs/{gps_fpga_acquisition_8sc.cc => fpga_acquisition.cc} (55%) rename src/algorithms/acquisition/libs/{gps_fpga_acquisition_8sc.h => fpga_acquisition.h} (78%) 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 00ff2008c..f585fdbc0 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 @@ -1,14 +1,18 @@ + /*! * \file gps_l1_ca_pcps_acquisition_fpga.cc - * \brief Adapts a PCPS acquisition block to an FPGA Acquisition Interface for - * GPS L1 C/A signals. This file is based on the file gps_l1_ca_pcps_acquisition.cc + * \brief Adapts a PCPS acquisition block to an FPGA AcquisitionInterface + * for GPS L1 C/A signals * \authors
    - *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
  • Marc Majoral, 2018. mmajoral(at)cttc.es + *
  • Javier Arribas, 2011. jarribas(at)cttc.es + *
  • Luis Esteve, 2012. luis(at)epsilon-formacion.com + *
  • Marc Molina, 2013. marc.molina.pena(at)gmail.com *
* * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -30,88 +34,109 @@ * * ------------------------------------------------------------------------- */ - -#include "gps_l1_ca_pcps_acquisition_fpga.h" -#include +#include +#include +#include #include -#include "GPS_L1_CA.h" +#include "gps_l1_ca_pcps_acquisition_fpga.h" #include "configuration_interface.h" +#include "gps_sdr_signal_processing.h" +#include "GPS_L1_CA.h" +#include "gnss_sdr_flags.h" + +#define NUM_PRNs 32 using google::LogMessage; GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( - ConfigurationInterface* configuration, std::string role, - unsigned int in_streams, unsigned int out_streams) : - role_(role), in_streams_(in_streams), out_streams_(out_streams) + ConfigurationInterface* configuration, std::string role, + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - unsigned int code_length; - bool bit_transition_flag; - bool use_CFAR_algorithm_flag; - unsigned int sampled_ms; - long fs_in; - long ifreq; - bool dump; - std::string dump_filename; - unsigned int nsamples_total; - unsigned int select_queue_Fpga; - std::string device_name; + pcpsconf_fpga_t acq_parameters; configuration_ = configuration; - std::string default_item_type = "cshort"; - std::string default_dump_filename = "./data/acquisition.dat"; + std::string default_item_type = "gr_complex"; + DLOG(INFO) << "role " << role; - item_type_ = configuration_->property(role + ".item_type", - default_item_type); - fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", 2048000); - ifreq = configuration_->property(role + ".if", 0); - dump = configuration_->property(role + ".dump", false); + + long 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_; + if_ = configuration_->property(role + ".if", 0); + acq_parameters.freq = if_; doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - sampled_ms = configuration_->property( - role + ".coherent_integration_time_ms", 1); - // note : the FPGA is implemented according to bit transition flag = 0. Setting bit transition flag to 1 has no effect. - bit_transition_flag = configuration_->property( - role + ".bit_transition_flag", false); - // note : the FPGA is implemented according to use_CFAR_algorithm = 0. Setting use_CFAR_algorithm to 1 has no effect. - use_CFAR_algorithm_flag = configuration_->property( - role + ".use_CFAR_algorithm", false); - // note : the FPGA does not use the max_dwells variable. - 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 ------------------------- - code_length = round( - fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); - // code length has the same value as d_fft_size - float nbits; - nbits = ceilf(log2f(code_length)); - nsamples_total = pow(2, nbits); - //vector_length_ = code_length_ * sampled_ms_; - vector_length_ = nsamples_total * sampled_ms; - // if( bit_transition_flag_ ) - // { - // vector_length_ *= 2; - // } - select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", - 0); - std::string default_device_name = "/dev/uio0"; - device_name = configuration_->property(role + ".devicename", - default_device_name); - if (item_type_.compare("cshort") == 0) + 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_; + code_length_ = static_cast(std::round(static_cast(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); + + // The FPGA can only use FFT lengths that are a power of two. + float nbits = ceilf(log2f((float) code_length_)); + unsigned int nsamples_total = pow(2, nbits); + vector_length_ = nsamples_total * sampled_ms_; + unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga",0); + acq_parameters.select_queue_Fpga = select_queue_Fpga; + std::string default_device_name = "/dev/uio0"; + std::string device_name = configuration_->property(role + ".devicename", default_device_name); + acq_parameters.device_name = device_name; + acq_parameters.samples_per_ms = nsamples_total; + acq_parameters.samples_per_code = nsamples_total; + + // compute all the GPS L1 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) + + // Direct FFT + gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length_, true); + // 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 + gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_all_fft_codes = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 + float max; // temporary maxima search + + for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) { - item_size_ = sizeof(lv_16sc_t); - gps_acquisition_fpga_sc_ = gps_pcps_make_acquisition_fpga_sc( - sampled_ms, max_dwells_, doppler_max_, ifreq, fs_in, - code_length, code_length, vector_length_, nsamples_total, - bit_transition_flag, use_CFAR_algorithm_flag, - select_queue_Fpga, device_name, dump, dump_filename); - DLOG(INFO) << "acquisition(" - << gps_acquisition_fpga_sc_->unique_id() << ")"; - } - else - { - LOG(FATAL) << item_type_ << " FPGA only accepts chsort"; - } + gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in_, 0); // generate PRN code + // fill in zero padding + for (int s=code_length_;sget_inbuf() + offset, code, sizeof(gr_complex) * nsamples_total); // 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 + { + if (std::abs(fft_codes_padded[i].real()) > max) + { + max = std::abs(fft_codes_padded[i].real()); + } + if (std::abs(fft_codes_padded[i].imag()) > max) + { + max = std::abs(fft_codes_padded[i].imag()); + } + } + for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs + { + d_all_fft_codes[i + nsamples_total * (PRN -1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), + static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max))); + + } + } + + acq_parameters.all_fft_codes = d_all_fft_codes; + //acq_parameters + // temporary buffers that we can delete + delete[] code; + delete fft_if; + delete[] fft_codes_padded; + + acquisition_fpga_ = pcps_make_acquisition(acq_parameters); + DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; + channel_ = 0; - threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = 0; } @@ -119,123 +144,94 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( GpsL1CaPcpsAcquisitionFpga::~GpsL1CaPcpsAcquisitionFpga() { + //delete[] code_; + delete[] d_all_fft_codes; } void GpsL1CaPcpsAcquisitionFpga::set_channel(unsigned int channel) { channel_ = channel; - gps_acquisition_fpga_sc_->set_channel(channel_); + acquisition_fpga_->set_channel(channel_); } void GpsL1CaPcpsAcquisitionFpga::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + ".pfa", 0.0); - - if (pfa == 0.0) - { - threshold_ = threshold; - } - else - { - threshold_ = calculate_threshold(pfa); - } - - DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_; - gps_acquisition_fpga_sc_->set_threshold(threshold_); + DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold; + acquisition_fpga_->set_threshold(threshold); } void GpsL1CaPcpsAcquisitionFpga::set_doppler_max(unsigned int doppler_max) { doppler_max_ = doppler_max; - gps_acquisition_fpga_sc_->set_doppler_max(doppler_max_); + acquisition_fpga_->set_doppler_max(doppler_max_); } void GpsL1CaPcpsAcquisitionFpga::set_doppler_step(unsigned int doppler_step) { doppler_step_ = doppler_step; - gps_acquisition_fpga_sc_->set_doppler_step(doppler_step_); + acquisition_fpga_->set_doppler_step(doppler_step_); } void GpsL1CaPcpsAcquisitionFpga::set_gnss_synchro(Gnss_Synchro* gnss_synchro) { gnss_synchro_ = gnss_synchro; - gps_acquisition_fpga_sc_->set_gnss_synchro(gnss_synchro_); + acquisition_fpga_->set_gnss_synchro(gnss_synchro_); } signed int GpsL1CaPcpsAcquisitionFpga::mag() { - return gps_acquisition_fpga_sc_->mag(); + return acquisition_fpga_->mag(); } void GpsL1CaPcpsAcquisitionFpga::init() { - gps_acquisition_fpga_sc_->init(); + acquisition_fpga_->init(); } void GpsL1CaPcpsAcquisitionFpga::set_local_code() { - gps_acquisition_fpga_sc_->set_local_code(); + acquisition_fpga_->set_local_code(); } void GpsL1CaPcpsAcquisitionFpga::reset() { - gps_acquisition_fpga_sc_->set_active(true); + acquisition_fpga_->set_active(true); } void GpsL1CaPcpsAcquisitionFpga::set_state(int state) { - gps_acquisition_fpga_sc_->set_state(state); -} - - -float GpsL1CaPcpsAcquisitionFpga::calculate_threshold(float pfa) -{ - //Calculate the threshold - unsigned int frequency_bins = 0; - for (int doppler = static_cast(-doppler_max_); doppler <= static_cast(doppler_max_); - doppler += doppler_step_) - { - frequency_bins++; - } - DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - unsigned int ncells = vector_length_ * frequency_bins; - double exponent = 1 / static_cast(ncells); - double val = pow(1.0 - pfa, exponent); - double lambda = double(vector_length_); - boost::math::exponential_distribution mydist(lambda); - float threshold = static_cast(quantile(mydist, val)); - return threshold; + acquisition_fpga_->set_state(state); } void GpsL1CaPcpsAcquisitionFpga::connect(gr::top_block_sptr top_block) { - //nothing to connect + // nothing to connect } void GpsL1CaPcpsAcquisitionFpga::disconnect(gr::top_block_sptr top_block) { - //nothing to disconnect + // nothing to disconnect } gr::basic_block_sptr GpsL1CaPcpsAcquisitionFpga::get_left_block() { - return gps_acquisition_fpga_sc_; + return acquisition_fpga_; } gr::basic_block_sptr GpsL1CaPcpsAcquisitionFpga::get_right_block() { - return gps_acquisition_fpga_sc_; + return acquisition_fpga_; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index 2c8f9eed4..d65e677e7 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -1,14 +1,17 @@ /*! * \file gps_l1_ca_pcps_acquisition_fpga.h - * \brief Adapts a PCPS acquisition block to an AcquisitionInterface for - * GPS L1 C/A signals. This file is based on the file gps_l1_ca_pcps_acquisition.h + * \brief Adapts a PCPS acquisition block that uses the FPGA to + * an AcquisitionInterface for GPS L1 C/A signals * \authors
    - *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
  • Marc Majoral, 2018. mmajoral(at)cttc.es + *
  • Javier Arribas, 2011. jarribas(at)cttc.es + *
  • Luis Esteve, 2012. luis(at)epsilon-formacion.com + *
  • Marc Molina, 2013. marc.molina.pena(at)gmail.com *
* * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -34,14 +37,11 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ -#include -#include -#include -#include "gnss_synchro.h" #include "acquisition_interface.h" -#include "gps_pcps_acquisition_fpga_sc.h" -#include "complex_byte_to_float_x2.h" -#include +#include "gnss_synchro.h" +#include "pcps_acquisition_fpga.h" +#include + class ConfigurationInterface; @@ -68,12 +68,13 @@ public: */ inline std::string implementation() override { - return "GPS_L1_CA_PCPS_Acquisition_Fpga"; + return "GPS_L1_CA_PCPS_Acquisition"; } inline size_t item_size() override { - return item_size_; + size_t item_size = sizeof(lv_16sc_t); + return item_size; } void connect(gr::top_block_sptr top_block) override; @@ -135,21 +136,21 @@ public: private: ConfigurationInterface* configuration_; - gps_pcps_acquisition_fpga_sc_sptr gps_acquisition_fpga_sc_; - size_t item_size_; - std::string item_type_; + pcps_acquisition_fpga_sptr acquisition_fpga_; unsigned int vector_length_; + unsigned int code_length_; unsigned int channel_; - float threshold_; unsigned int doppler_max_; unsigned int doppler_step_; - unsigned int max_dwells_; + unsigned int sampled_ms_; + long fs_in_; + long if_; Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; + lv_16sc_t *d_all_fft_codes; // memory that contains all the code ffts - float calculate_threshold(float pfa); }; -#endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ */ +#endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ */ diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index ca02bb952..9bfd4fc73 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -29,7 +29,7 @@ set(ACQ_GR_BLOCKS_SOURCES ) if(ENABLE_FPGA) - set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} gps_pcps_acquisition_fpga_sc.cc) + set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_acquisition_fpga.cc) endif(ENABLE_FPGA) if(OPENCL_FOUND) diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc b/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc deleted file mode 100644 index 53b54686d..000000000 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.cc +++ /dev/null @@ -1,298 +0,0 @@ -/*! - * \file gps_pcps_acquisition_fpga_sc.cc - * \brief This class implements a Parallel Code Phase Search Acquisition in the FPGA. - * This file is based on the file gps_pcps_acquisition_sc.cc - * \authors
    - *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat - *
- * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * 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 . - * - * ------------------------------------------------------------------------- - */ - -#include "gps_pcps_acquisition_fpga_sc.h" -#include -#include -#include -#include -#include -#include -#include "control_message_factory.h" -#include "GPS_L1_CA.h" - -#include - -using google::LogMessage; - -void wait3(int seconds) -{ - boost::this_thread::sleep_for(boost::chrono::seconds - { seconds }); -} - - -gps_pcps_acquisition_fpga_sc_sptr gps_pcps_make_acquisition_fpga_sc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, int samples_per_ms, - int samples_per_code, int vector_length, unsigned int nsamples_total, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - unsigned int select_queue_Fpga, std::string device_name, bool dump, - std::string dump_filename) -{ - return gps_pcps_acquisition_fpga_sc_sptr( - new gps_pcps_acquisition_fpga_sc(sampled_ms, max_dwells, - doppler_max, freq, fs_in, samples_per_ms, samples_per_code, - vector_length, nsamples_total, bit_transition_flag, - use_CFAR_algorithm_flag, select_queue_Fpga, device_name, - dump, dump_filename)); -} - - -gps_pcps_acquisition_fpga_sc::gps_pcps_acquisition_fpga_sc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, int samples_per_ms, - int samples_per_code, int vector_length, unsigned int nsamples_total, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - unsigned int select_queue_Fpga, std::string device_name, bool dump, - std::string dump_filename) : - - //gr::block("pcps_acquisition_fpga_sc", - gr::block("gps_pcps_acquisition_fpga_sc", - gr::io_signature::make(0, 0, sizeof(lv_16sc_t)), - gr::io_signature::make(0, 0, 0)) -{ - this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0; // sample counter - d_active = false; - d_state = 0; - d_samples_per_code = samples_per_code; - d_max_dwells = max_dwells; // Note : d_max_dwells is not used in the FPGA implementation - d_well_count = 0; - d_doppler_max = doppler_max; - d_fft_size = sampled_ms * samples_per_ms; - d_mag = 0; - d_num_doppler_bins = 0; - d_bit_transition_flag = bit_transition_flag; // Note : bit transition flag is ignored and assumed 0 in the FPGA implementation - d_use_CFAR_algorithm_flag = use_CFAR_algorithm_flag; // Note : user CFAR algorithm flag is ignored and assumed 0 in the FPGA implementation - d_threshold = 0.0; - d_doppler_step = 250; - d_channel = 0; - // For dumping samples into a file - d_dump = dump; - d_dump_filename = dump_filename; - d_gnss_synchro = 0; - // instantiate HW accelerator class - acquisition_fpga_8sc = std::make_shared < gps_fpga_acquisition_8sc> - (device_name, vector_length, d_fft_size, doppler_max, nsamples_total, fs_in, freq, sampled_ms, select_queue_Fpga); -} - - -gps_pcps_acquisition_fpga_sc::~gps_pcps_acquisition_fpga_sc() -{ - if (d_dump) - { - d_dump_file.close(); - } - acquisition_fpga_8sc->free(); -} - - -void gps_pcps_acquisition_fpga_sc::set_local_code() -{ - acquisition_fpga_8sc->set_local_code(d_gnss_synchro->PRN); -} - - -void gps_pcps_acquisition_fpga_sc::init() -{ - d_gnss_synchro->Flag_valid_acquisition = false; - d_gnss_synchro->Flag_valid_symbol_output = false; - d_gnss_synchro->Flag_valid_pseudorange = false; - d_gnss_synchro->Flag_valid_word = false; - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_mag = 0.0; - d_num_doppler_bins = ceil( - static_cast(static_cast(d_doppler_max) - - static_cast(-d_doppler_max)) - / static_cast(d_doppler_step)); - //acquisition_fpga_8sc->open_device(); - acquisition_fpga_8sc->init(); -} - - -void gps_pcps_acquisition_fpga_sc::set_state(int state) -{ - d_state = state; - if (d_state == 1) - { - d_gnss_synchro->Acq_delay_samples = 0.0; - d_gnss_synchro->Acq_doppler_hz = 0.0; - d_gnss_synchro->Acq_samplestamp_samples = 0; - d_well_count = 0; - d_mag = 0.0; - } - else if (d_state == 0) - { - } - else - { - LOG(ERROR) << "State can only be set to 0 or 1"; - } -} - - - - -void gps_pcps_acquisition_fpga_sc::set_active(bool active) -{ - float temp_peak_to_noise_level = 0.0; - float peak_to_noise_level = 0.0; - float input_power; - float test_statistics = 0.0; - //printf("ACQ : Block samples for PRN %d\n", d_gnss_synchro->PRN); -// acquisition_fpga_8sc->block_samples(); // block the samples to run the acquisition this is only necessary for the tests - d_active = active; - int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL - d_state = 1; - // initialize acquisition algorithm - int doppler; - uint32_t indext = 0; - float magt = 0.0; - //int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size ); - int effective_fft_size = d_fft_size; - d_mag = 0.0; - unsigned int initial_sample; - d_well_count++; - DLOG(INFO) << "Channel: " << d_channel - << " , doing acquisition of satellite: " << d_gnss_synchro->System - << " " << d_gnss_synchro->PRN << " ,sample stamp: " - << d_sample_counter << ", threshold: " << ", threshold: " - << d_threshold << ", doppler_max: " << d_doppler_max - << ", doppler_step: " << d_doppler_step; - - // Doppler frequency search loop - for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; - doppler_index++) - { - - doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - - acquisition_fpga_8sc->set_phase_step(doppler_index); - acquisition_fpga_8sc->run_acquisition(); // runs acquisition and waits until it is finished - acquisition_fpga_8sc->read_acquisition_results(&indext, &magt, - &initial_sample, &input_power); - d_sample_counter = initial_sample; - temp_peak_to_noise_level = static_cast(magt) / static_cast(input_power); - if (peak_to_noise_level < temp_peak_to_noise_level) - { - peak_to_noise_level = temp_peak_to_noise_level; - d_mag = magt; - input_power = (input_power - d_mag) - / (effective_fft_size - 1); - d_gnss_synchro->Acq_delay_samples = - static_cast(indext % d_samples_per_code); - d_gnss_synchro->Acq_doppler_hz = - static_cast(doppler); - d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; - test_statistics = d_mag / input_power; - } - // Record results to file if required - if (d_dump) - { - std::stringstream filename; - //std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write - filename.str(""); - boost::filesystem::path p = d_dump_filename; - filename << p.parent_path().string() - << boost::filesystem::path::preferred_separator - << p.stem().string() << "_" - << d_gnss_synchro->System << "_" - << d_gnss_synchro->Signal << "_sat_" - << d_gnss_synchro->PRN << "_doppler_" << doppler - << p.extension().string(); - DLOG(INFO) << "Writing ACQ out to " << filename.str(); - d_dump_file.open(filename.str().c_str(), - std::ios::out | std::ios::binary); - d_dump_file.close(); - } - - } - - - //printf("ACQ : unblocking samples for satellite %d\n", d_gnss_synchro->PRN); -// acquisition_fpga_8sc->unblock_samples(); // unblock samples before sending positive or negative acquisition message to let the samples flow when the - // set local code function is called - if (test_statistics > d_threshold) - { - d_state = 2; // Positive acquisition - // 6.1- Declare positive acquisition using a message port - DLOG(INFO) << "positive acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " - << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << input_power; - d_active = false; - d_state = 0; - acquisition_message = 1; - this->message_port_pub(pmt::mp("events"), - pmt::from_long(acquisition_message)); - } - else - { - d_state = 3; // Negative acquisition - // 6.2- Declare negative acquisition using a message port - DLOG(INFO) << "negative acquisition"; - DLOG(INFO) << "satellite " << d_gnss_synchro->System << " " - << d_gnss_synchro->PRN; - DLOG(INFO) << "sample_stamp " << d_sample_counter; - DLOG(INFO) << "test statistics value " << test_statistics; - DLOG(INFO) << "test statistics threshold " << d_threshold; - DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; - DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; - DLOG(INFO) << "magnitude " << d_mag; - DLOG(INFO) << "input signal power " << input_power; - d_active = false; - d_state = 0; - acquisition_message = 2; - this->message_port_pub(pmt::mp("events"), - pmt::from_long(acquisition_message)); - } - DLOG(INFO) << "Done. Consumed 1 item."; -} - - -int gps_pcps_acquisition_fpga_sc::general_work(int noutput_items, - gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items __attribute__((unused)), - gr_vector_void_star &output_items __attribute__((unused))) -{ - // general work not used with the acquisition - return noutput_items; -} diff --git a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h b/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h deleted file mode 100644 index a8316c634..000000000 --- a/src/algorithms/acquisition/gnuradio_blocks/gps_pcps_acquisition_fpga_sc.h +++ /dev/null @@ -1,219 +0,0 @@ -/*! - * \file gps_pcps_acquisition_fpga_sc.h - * \brief This class implements a Parallel Code Phase Search Acquisition in the FPGA. - * This file is based on the file gps_pcps_acquisition_sc.h - * - * Acquisition strategy (Kay Borre book + CFAR threshold). - *
    - *
  1. Compute the input signal power estimation - *
  2. Doppler serial search loop - *
  3. Perform the FFT-based circular convolution (parallel time search) - *
  4. Record the maximum peak and the associated synchronization parameters - *
  5. Compute the test statistics and compare to the threshold - *
  6. Declare positive or negative acquisition using a message port - *
- * - * Kay Borre book: K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, - * "A Software-Defined GPS and Galileo Receiver. A Single-Frequency - * Approach", Birkhauser, 2007. pp 81-84 - * - * \authors
    - *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat - *
- * - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * 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 GNSS_SDR_GPS_PCPS_ACQUISITION_FPGA_SC_H_ -#define GNSS_SDR_GPS_PCPS_ACQUISITION_FPGA_SC_H_ - -#include -#include -#include -#include -#include -#include "gnss_synchro.h" -#include "gps_fpga_acquisition_8sc.h" - -#include - -class gps_pcps_acquisition_fpga_sc; - -typedef boost::shared_ptr gps_pcps_acquisition_fpga_sc_sptr; - -gps_pcps_acquisition_fpga_sc_sptr -gps_pcps_make_acquisition_fpga_sc(unsigned int sampled_ms, - unsigned int max_dwells, unsigned int doppler_max, long freq, - long fs_in, int samples_per_ms, int samples_per_code, - int vector_length_, unsigned int nsamples_total_, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - unsigned int select_queue_Fpga, std::string device_name, bool dump, - std::string dump_filename); - -/*! - * \brief This class implements a Parallel Code Phase Search Acquisition. - * - * Check \ref Navitec2012 "An Open Source Galileo E1 Software Receiver", - * Algorithm 1, for a pseudocode description of this implementation. - */ -class gps_pcps_acquisition_fpga_sc : public gr::block -{ -private: - friend gps_pcps_acquisition_fpga_sc_sptr - gps_pcps_make_acquisition_fpga_sc(unsigned int sampled_ms, - unsigned int max_dwells, unsigned int doppler_max, long freq, - long fs_in, int samples_per_ms, int samples_per_code, - int vector_length, unsigned int nsamples_total, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - unsigned int select_queue_Fpga, std::string device_name, bool dump, - std::string dump_filename); - - gps_pcps_acquisition_fpga_sc(unsigned int sampled_ms, - unsigned int max_dwells, unsigned int doppler_max, long freq, - long fs_in, int samples_per_ms, int samples_per_code, - int vector_length, unsigned int nsamples_total, - bool bit_transition_flag, bool use_CFAR_algorithm_flag, - unsigned int select_queue_Fpga, std::string device_name, bool dump, - std::string dump_filename); - int d_samples_per_code; - float d_threshold; - unsigned int d_doppler_max; - unsigned int d_doppler_step; - unsigned int d_max_dwells; - unsigned int d_well_count; - unsigned int d_fft_size; - unsigned long int d_sample_counter; - unsigned int d_num_doppler_bins; - Gnss_Synchro *d_gnss_synchro; - float d_mag;bool d_bit_transition_flag;bool d_use_CFAR_algorithm_flag; - std::ofstream d_dump_file; - bool d_active; - int d_state;bool d_dump; - unsigned int d_channel; - std::string d_dump_filename; - std::shared_ptr acquisition_fpga_8sc; - //void set_active2(bool active); - boost::thread d_acq_thread; - -public: - /*! - * \brief Default destructor. - */ - ~gps_pcps_acquisition_fpga_sc(); - - /*! - * \brief Set acquisition/tracking common Gnss_Synchro object pointer - * to exchange synchronization data between acquisition and tracking blocks. - * \param p_gnss_synchro Satellite information shared by the processing blocks. - */ - inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) - { - d_gnss_synchro = p_gnss_synchro; - } - - /*! - * \brief Returns the maximum peak of grid search. - */ - inline unsigned int mag() const - { - return d_mag; - } - - /*! - * \brief Initializes acquisition algorithm. - */ - void init(); - - /*! - * \brief Sets local code for PCPS acquisition algorithm. - * \param code - Pointer to the PRN code. - */ - void set_local_code(); - - /*! - * \brief Starts acquisition algorithm, turning from standby mode to - * active mode - * \param active - bool that activates/deactivates the block. - */ - - - void set_active(bool active); - - /*! - * \brief If set to 1, ensures that acquisition starts at the - * first available sample. - * \param state - int=1 forces start of acquisition - */ - void set_state(int state); - - /*! - * \brief Set acquisition channel unique ID - * \param channel - receiver channel. - */ - inline void set_channel(unsigned int channel) - { - d_channel = channel; - } - - /*! - * \brief Set statistics threshold of PCPS algorithm. - * \param threshold - Threshold for signal detection (check \ref Navitec2012, - * Algorithm 1, for a definition of this threshold). - */ - inline void set_threshold(float threshold) - { - d_threshold = threshold; - } - - /*! - * \brief Set maximum Doppler grid search - * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. - */ - inline void set_doppler_max(unsigned int doppler_max) - { - d_doppler_max = doppler_max; - acquisition_fpga_8sc->set_doppler_max(doppler_max); - } - - /*! - * \brief Set Doppler steps for the grid search - * \param doppler_step - Frequency bin of the search grid [Hz]. - */ - inline void set_doppler_step(unsigned int doppler_step) - { - d_doppler_step = doppler_step; - acquisition_fpga_8sc->set_doppler_step(doppler_step); - } - - /*! - * \brief Parallel Code Phase Search Acquisition signal processing. - */ - int general_work(int noutput_items, gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - -}; - -#endif /* GNSS_SDR_GPS_PCPS_ACQUISITION_SC_H_*/ diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc new file mode 100644 index 000000000..4f21ffa7a --- /dev/null +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -0,0 +1,247 @@ +/*! + * \file pcps_acquisition_fpga.cc + * \brief This class implements a Parallel Code Phase Search Acquisition in the FPGA + * + * Note: The CFAR algorithm is not implemented in the FPGA. + * Note 2: The bit transition flag is not implemented in the FPGA + * + * \authors
    + *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
  • Javier Arribas, 2011. jarribas(at)cttc.es + *
  • Luis Esteve, 2012. luis(at)epsilon-formacion.com + *
  • Marc Molina, 2013. marc.molina.pena@gmail.com + *
  • Cillian O'Driscoll, 2017. cillian(at)ieee.org + *
+ * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * 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 . + * + * ------------------------------------------------------------------------- + */ + +#include "pcps_acquisition_fpga.h" +#include "GPS_L1_CA.h" // for GPS_TWO_PI +#include "GLONASS_L1_L2_CA.h" // for GLONASS_TWO_PI" +#include +#include + +using google::LogMessage; + +pcps_acquisition_fpga_sptr pcps_make_acquisition(pcpsconf_fpga_t conf_) +{ + return pcps_acquisition_fpga_sptr(new pcps_acquisition_fpga(conf_)); +} + + +pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) : gr::block("pcps_acquisition_fpga", + gr::io_signature::make(0, 0, 0), + gr::io_signature::make(0, 0, 0)) +{ + this->message_port_register_out(pmt::mp("events")); + + acq_parameters = conf_; + d_sample_counter = 0; // SAMPLE COUNTER + d_active = false; + d_state = 0; + d_fft_size = acq_parameters.sampled_ms * acq_parameters.samples_per_ms; + d_mag = 0; + d_input_power = 0.0; + d_num_doppler_bins = 0; + d_threshold = 0.0; + d_doppler_step = 0; + d_test_statistics = 0.0; + d_channel = 0; + d_gnss_synchro = 0; + + acquisition_fpga = std::make_shared + (acq_parameters.device_name, d_fft_size, acq_parameters.doppler_max, acq_parameters.samples_per_ms, + acq_parameters.fs_in, acq_parameters.freq, acq_parameters.sampled_ms, acq_parameters.select_queue_Fpga, acq_parameters.all_fft_codes); + +} + + +pcps_acquisition_fpga::~pcps_acquisition_fpga() +{ + acquisition_fpga->free(); +} + + +void pcps_acquisition_fpga::set_local_code() +{ + acquisition_fpga->set_local_code(d_gnss_synchro->PRN); +} + + +void pcps_acquisition_fpga::init() +{ + d_gnss_synchro->Flag_valid_acquisition = false; + d_gnss_synchro->Flag_valid_symbol_output = false; + d_gnss_synchro->Flag_valid_pseudorange = false; + d_gnss_synchro->Flag_valid_word = false; + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_num_doppler_bins = static_cast(std::ceil(static_cast(static_cast(acq_parameters.doppler_max) - static_cast(-acq_parameters.doppler_max)) / static_cast(d_doppler_step))); + + acquisition_fpga->init(); +} + + +void pcps_acquisition_fpga::set_state(int state) +{ + d_state = state; + if (d_state == 1) + { + d_gnss_synchro->Acq_delay_samples = 0.0; + d_gnss_synchro->Acq_doppler_hz = 0.0; + d_gnss_synchro->Acq_samplestamp_samples = 0; + //d_well_count = 0; + d_mag = 0.0; + d_input_power = 0.0; + d_test_statistics = 0.0; + d_active = true; + } + else if (d_state == 0) + { + } + else + { + LOG(ERROR) << "State can only be set to 0 or 1"; + } +} + + +void pcps_acquisition_fpga::send_positive_acquisition() +{ + // 6.1- Declare positive acquisition using a message port + //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + DLOG(INFO) << "positive acquisition" + << ", satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << ", sample_stamp " << d_sample_counter + << ", test statistics value " << d_test_statistics + << ", test statistics threshold " << d_threshold + << ", code phase " << d_gnss_synchro->Acq_delay_samples + << ", doppler " << d_gnss_synchro->Acq_doppler_hz + << ", magnitude " << d_mag + << ", input signal power " << d_input_power; + + this->message_port_pub(pmt::mp("events"), pmt::from_long(1)); +} + + +void pcps_acquisition_fpga::send_negative_acquisition() +{ + // 6.2- Declare negative acquisition using a message port + //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL + DLOG(INFO) << "negative acquisition" + << ", satellite " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << ", sample_stamp " << d_sample_counter + << ", test statistics value " << d_test_statistics + << ", test statistics threshold " << d_threshold + << ", code phase " << d_gnss_synchro->Acq_delay_samples + << ", doppler " << d_gnss_synchro->Acq_doppler_hz + << ", magnitude " << d_mag + << ", input signal power " << d_input_power; + + this->message_port_pub(pmt::mp("events"), pmt::from_long(2)); +} + + +void pcps_acquisition_fpga::set_active(bool active) +{ + d_active = active; + + // initialize acquisition algorithm + uint32_t indext = 0; + float magt = 0.0; + int effective_fft_size = d_fft_size; + float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); + + d_input_power = 0.0; + d_mag = 0.0; + //d_well_count++; + + DLOG(INFO) << "Channel: " << d_channel + << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN + << " ,sample stamp: " << d_sample_counter << ", threshold: " + << d_threshold << ", doppler_max: " << acq_parameters.doppler_max + << ", doppler_step: " << d_doppler_step + // no CFAR algorithm in the FPGA + << ", use_CFAR_algorithm_flag: false"; + + unsigned int initial_sample; + float input_power_all = 0.0; + float input_power_computed = 0.0; + for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) + { + // doppler search steps + int doppler = -static_cast(acq_parameters.doppler_max) + d_doppler_step * doppler_index; + + acquisition_fpga->set_phase_step(doppler_index); + acquisition_fpga->run_acquisition(); // runs acquisition and waits until it is finished + acquisition_fpga->read_acquisition_results(&indext, &magt, + &initial_sample, &d_input_power); + d_sample_counter = initial_sample; + + if (d_mag < magt) + { + d_mag = magt; + + input_power_all = d_input_power / (effective_fft_size - 1); + input_power_computed = (d_input_power - d_mag) / (effective_fft_size - 1); + d_input_power = (d_input_power - d_mag) / (effective_fft_size - 1); + + d_gnss_synchro->Acq_delay_samples = static_cast(indext % acq_parameters.samples_per_code); + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; + + d_test_statistics = (d_mag / d_input_power); //* correction_factor; + } + + // In the case of the FPGA the option of dumping the results of the acquisition to a file is not available + // because the IFFT vector is not available + } + + if (d_test_statistics > d_threshold) + { + d_active = false; + send_positive_acquisition(); + d_state = 0; // Positive acquisition + } + else + { + d_state = 0; + d_active = false; + send_negative_acquisition(); + } +} + + +int pcps_acquisition_fpga::general_work(int noutput_items __attribute__((unused)), + gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items __attribute__((unused))) +{ + // the general work is not used with the acquisition that uses the FPGA + return noutput_items; +} diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h new file mode 100644 index 000000000..d140f538c --- /dev/null +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h @@ -0,0 +1,216 @@ +/*! + * \file pcps_acquisition_fpga.h + * \brief This class implements a Parallel Code Phase Search Acquisition in the FPGA. + * + * Note: The CFAR algorithm is not implemented in the FPGA. + * Note 2: The bit transition flag is not implemented in the FPGA + * + * Acquisition strategy (Kay Borre book + CFAR threshold). + *
    + *
  1. Compute the input signal power estimation + *
  2. Doppler serial search loop + *
  3. Perform the FFT-based circular convolution (parallel time search) + *
  4. Record the maximum peak and the associated synchronization parameters + *
  5. Compute the test statistics and compare to the threshold + *
  6. Declare positive or negative acquisition using a message queue + *
+ * + * Kay Borre book: K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen, + * "A Software-Defined GPS and Galileo Receiver. A Single-Frequency + * Approach", Birkhauser, 2007. pp 81-84 + * + * \authors
    + *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
  • Javier Arribas, 2011. jarribas(at)cttc.es + *
  • Luis Esteve, 2012. luis(at)epsilon-formacion.com + *
  • Marc Molina, 2013. marc.molina.pena@gmail.com + *
  • Cillian O'Driscoll, 2017. cillian(at)ieee.org + *
  • Antonio Ramos, 2017. antonio.ramos@cttc.es + *
+ * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * 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 GNSS_SDR_PCPS_ACQUISITION_FPGA_H_ +#define GNSS_SDR_PCPS_ACQUISITION_FPGA_H_ + +#include "gnss_synchro.h" +#include +#include "fpga_acquisition.h" + +typedef struct +{ + /* pcps acquisition configuration */ + unsigned int sampled_ms; + unsigned int doppler_max; + long freq; + long fs_in; + int samples_per_ms; + int samples_per_code; + std::string dump_filename; + unsigned int select_queue_Fpga; + std::string device_name; + unsigned int code_length; + lv_16sc_t *all_fft_codes; // memory that contains all the code ffts + +} pcpsconf_fpga_t; + +class pcps_acquisition_fpga; + +typedef boost::shared_ptr pcps_acquisition_fpga_sptr; + +pcps_acquisition_fpga_sptr +pcps_make_acquisition(pcpsconf_fpga_t conf_); + +/*! + * \brief This class implements a Parallel Code Phase Search Acquisition that uses the FPGA. + * + * Check \ref Navitec2012 "An Open Source Galileo E1 Software Receiver", + * Algorithm 1, for a pseudocode description of this implementation. + */ +class pcps_acquisition_fpga : public gr::block +{ +private: + friend pcps_acquisition_fpga_sptr + + pcps_make_acquisition(pcpsconf_fpga_t conf_); + + pcps_acquisition_fpga(pcpsconf_fpga_t conf_); + + void send_negative_acquisition(); + + void send_positive_acquisition(); + + pcpsconf_fpga_t acq_parameters; + bool d_active; + float d_threshold; + float d_mag; + float d_input_power; + float d_test_statistics; + int d_state; + unsigned int d_channel; + unsigned int d_doppler_step; + unsigned int d_fft_size; + unsigned int d_num_doppler_bins; + unsigned long int d_sample_counter; + Gnss_Synchro* d_gnss_synchro; + std::shared_ptr acquisition_fpga; + + + +public: + ~pcps_acquisition_fpga(); + + /*! + * \brief Set acquisition/tracking common Gnss_Synchro object pointer + * to exchange synchronization data between acquisition and tracking blocks. + * \param p_gnss_synchro Satellite information shared by the processing blocks. + */ + inline void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) + { + d_gnss_synchro = p_gnss_synchro; + } + + /*! + * \brief Returns the maximum peak of grid search. + */ + inline unsigned int mag() const + { + return d_mag; + } + + /*! + * \brief Initializes acquisition algorithm. + */ + void init(); + + /*! + * \brief Sets local code for PCPS acquisition algorithm. + * \param code - Pointer to the PRN code. + */ + void set_local_code(); + + /*! + * \brief If set to 1, ensures that acquisition starts at the + * first available sample. + * \param state - int=1 forces start of acquisition + */ + void set_state(int state); + + /*! + * \brief Starts acquisition algorithm, turning from standby mode to + * active mode + * \param active - bool that activates/deactivates the block. + */ + void set_active(bool active); + + /*! + * \brief Set acquisition channel unique ID + * \param channel - receiver channel. + */ + inline void set_channel(unsigned int channel) + { + d_channel = channel; + } + + /*! + * \brief Set statistics threshold of PCPS algorithm. + * \param threshold - Threshold for signal detection (check \ref Navitec2012, + * Algorithm 1, for a definition of this threshold). + */ + inline void set_threshold(float threshold) + { + d_threshold = threshold; + } + + /*! + * \brief Set maximum Doppler grid search + * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. + */ + inline void set_doppler_max(unsigned int doppler_max) + { + acq_parameters.doppler_max = doppler_max; + acquisition_fpga->set_doppler_max(doppler_max); + } + + /*! + * \brief Set Doppler steps for the grid search + * \param doppler_step - Frequency bin of the search grid [Hz]. + */ + inline void set_doppler_step(unsigned int doppler_step) + { + d_doppler_step = doppler_step; + acquisition_fpga->set_doppler_step(doppler_step); + } + + /*! + * \brief Parallel Code Phase Search Acquisition signal processing. + */ + int general_work(int noutput_items, gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +#endif /* GNSS_SDR_PCPS_ACQUISITION_FPGA_H_*/ diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index 53feb9366..f4adf131c 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -18,7 +18,7 @@ set(ACQUISITION_LIB_SOURCES - gps_fpga_acquisition_8sc.cc + fpga_acquisition.cc ) include_directories( diff --git a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc b/src/algorithms/acquisition/libs/fpga_acquisition.cc similarity index 55% rename from src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc rename to src/algorithms/acquisition/libs/fpga_acquisition.cc index 16280e1d4..213183ba5 100644 --- a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.cc +++ b/src/algorithms/acquisition/libs/fpga_acquisition.cc @@ -1,12 +1,12 @@ /*! - * \file gps_fpga_acquisition_8sc.cc + * \file fpga_acquisition.cc * \brief High optimized FPGA vector correlator class * \authors
    - *
  • Marc Majoral, 2017. mmajoral(at)cttc.cat - *
+ *
  • Marc Majoral, 2018. mmajoral(at)cttc.cat + * * - * Class that controls and executes a high optimized vector correlator - * class in the FPGA + * Class that controls and executes a high optimized acquisition HW + * accelerator in the FPGA * * ------------------------------------------------------------------------- * @@ -33,65 +33,46 @@ * ------------------------------------------------------------------------- */ -#include "gps_fpga_acquisition_8sc.h" +#include "fpga_acquisition.h" #include "gps_sdr_signal_processing.h" -#include -// allocate memory dynamically -#include - -// libraries used by DMA test code and GIPO test code -#include +// libraries used by the GIPO #include -#include -#include - -// libraries used by DMA test code -#include -#include -#include -#include - -// libraries used by GPIO test code -#include -#include #include // logging #include -// volk -#include - // GPS L1 #include "GPS_L1_CA.h" #define PAGE_SIZE 0x10000 #define MAX_PHASE_STEP_RAD 0.999999999534339 // 1 - pow(2,-31); -#define NUM_PRNs 32 -#define TEST_REGISTER_ACQ_WRITEVAL 0x55AA +#define TEST_REG_SANITY_CHECK 0x55AA -bool gps_fpga_acquisition_8sc::init() +bool fpga_acquisition::init() { // configure the acquisition with the main initialization values - gps_fpga_acquisition_8sc::configure_acquisition(); + fpga_acquisition::configure_acquisition(); return true; } -bool gps_fpga_acquisition_8sc::set_local_code(unsigned int PRN) +bool fpga_acquisition::set_local_code(unsigned int PRN) { // select the code with the chosen PRN - gps_fpga_acquisition_8sc::fpga_configure_acquisition_local_code( + fpga_acquisition::fpga_configure_acquisition_local_code( &d_all_fft_codes[d_nsamples_total * (PRN - 1)]); return true; } -gps_fpga_acquisition_8sc::gps_fpga_acquisition_8sc(std::string device_name, - unsigned int vector_length, unsigned int nsamples, +fpga_acquisition::fpga_acquisition(std::string device_name, + unsigned int nsamples, unsigned int doppler_max, unsigned int nsamples_total, long fs_in, long freq, - unsigned int sampled_ms, unsigned select_queue) + unsigned int sampled_ms, unsigned select_queue, + lv_16sc_t *all_fft_codes) { + unsigned int vector_length = nsamples_total*sampled_ms; // initial values d_device_name = device_name; d_freq = freq; @@ -104,98 +85,49 @@ gps_fpga_acquisition_8sc::gps_fpga_acquisition_8sc(std::string device_name, d_doppler_step = 0; d_fd = 0; // driver descriptor d_map_base = nullptr; // driver memory map - // Direct FFT - d_fft_if = new gr::fft::fft_complex(vector_length, true); - // 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 - gr_complex* d_fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_all_fft_codes = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 - float max; // temporary maxima search - for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) - { - gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in, 0); // generate PRN code - // fill in zero padding - for (int s=nsamples;sget_inbuf() + offset, code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer - d_fft_if->execute(); // Run the FFT of local code - volk_32fc_conjugate_32fc(d_fft_codes_padded, d_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(d_fft_codes_padded[i].real()) > max) - { - max = std::abs(d_fft_codes_padded[i].real()); - } - if (std::abs(d_fft_codes_padded[i].imag()) > max) - { - max = std::abs(d_fft_codes_padded[i].imag()); - } - } - for (unsigned int i = 0; i < nsamples_total; i++) // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs - { - d_all_fft_codes[i + nsamples_total * (PRN -1)] = lv_16sc_t(static_cast(d_fft_codes_padded[i].real() * (pow(2, 7) - 1) / max), - static_cast(d_fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)); + d_all_fft_codes = all_fft_codes; - } - } // open communication with HW accelerator - //printf("opening device %s\n", d_device_name.c_str()); if ((d_fd = open(d_device_name.c_str(), O_RDWR | O_SYNC)) == -1) { LOG(WARNING) << "Cannot open deviceio" << d_device_name; - //std::cout << "acquisition cannot open deviceio"; } d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0)); + if (d_map_base == reinterpret_cast(-1)) { LOG(WARNING) << "Cannot map the FPGA acquisition module into user memory"; - //std::cout << "acquisition : could not map the fpga registers to the driver" << std::endl; } + // sanity check : check test register - // we only nee to do this when the class is created - // but the device is not opened yet when the class is create - // because we need to open and close the device every time we run an acquisition - // since the same device may be used by more than one class (gps acquisition, galileo - // acquisition, etc ..) - unsigned writeval = TEST_REGISTER_ACQ_WRITEVAL; + unsigned writeval = TEST_REG_SANITY_CHECK; unsigned readval; - readval = gps_fpga_acquisition_8sc::fpga_acquisition_test_register(writeval); + readval = fpga_acquisition::fpga_acquisition_test_register(writeval); if (writeval != readval) { LOG(WARNING) << "Acquisition test register sanity check failed"; - //std:: cout << "Acquisition test register sanity check failed" << std::endl; } else { - //std::cout << "Acquisition test register sanity check success !" << std::endl; LOG(INFO) << "Acquisition test register sanity check success !"; } - gps_fpga_acquisition_8sc::reset_acquisition(); + fpga_acquisition::reset_acquisition(); DLOG(INFO) << "Acquisition FPGA class created"; - // temporary buffers that we can delete - delete[] code; - delete d_fft_if; - delete[] d_fft_codes_padded; + } -gps_fpga_acquisition_8sc::~gps_fpga_acquisition_8sc() +fpga_acquisition::~fpga_acquisition() { close_device(); - delete[] d_all_fft_codes; } -bool gps_fpga_acquisition_8sc::free() +bool fpga_acquisition::free() { return true; } -unsigned gps_fpga_acquisition_8sc::fpga_acquisition_test_register(unsigned writeval) +unsigned fpga_acquisition::fpga_acquisition_test_register(unsigned writeval) { unsigned readval; // write value to test register @@ -206,7 +138,7 @@ unsigned gps_fpga_acquisition_8sc::fpga_acquisition_test_register(unsigned write return readval; } -void gps_fpga_acquisition_8sc::fpga_configure_acquisition_local_code(lv_16sc_t fft_local_code[]) +void fpga_acquisition::fpga_configure_acquisition_local_code(lv_16sc_t fft_local_code[]) { unsigned short local_code; unsigned int k, tmp, tmp2; @@ -224,7 +156,7 @@ void gps_fpga_acquisition_8sc::fpga_configure_acquisition_local_code(lv_16sc_t f } } -void gps_fpga_acquisition_8sc::run_acquisition(void) +void fpga_acquisition::run_acquisition(void) { // enable interrupts int reenable = 1; @@ -243,7 +175,7 @@ void gps_fpga_acquisition_8sc::run_acquisition(void) } } -void gps_fpga_acquisition_8sc::configure_acquisition() +void fpga_acquisition::configure_acquisition() { d_map_base[0] = d_select_queue; d_map_base[1] = d_vector_length; @@ -251,7 +183,7 @@ void gps_fpga_acquisition_8sc::configure_acquisition() d_map_base[5] = (int) log2((float) d_vector_length); // log2 FFTlength } -void gps_fpga_acquisition_8sc::set_phase_step(unsigned int doppler_index) +void fpga_acquisition::set_phase_step(unsigned int doppler_index) { float phase_step_rad_real; float phase_step_rad_int_temp; @@ -274,7 +206,7 @@ void gps_fpga_acquisition_8sc::set_phase_step(unsigned int doppler_index) d_map_base[3] = phase_step_rad_int; } -void gps_fpga_acquisition_8sc::read_acquisition_results(uint32_t* max_index, +void fpga_acquisition::read_acquisition_results(uint32_t* max_index, float* max_magnitude, unsigned *initial_sample, float *power_sum) { unsigned readval = 0; @@ -288,18 +220,18 @@ void gps_fpga_acquisition_8sc::read_acquisition_results(uint32_t* max_index, *max_index = readval; } -void gps_fpga_acquisition_8sc::block_samples() +void fpga_acquisition::block_samples() { d_map_base[14] = 1; // block the samples } -void gps_fpga_acquisition_8sc::unblock_samples() +void fpga_acquisition::unblock_samples() { d_map_base[14] = 0; // unblock the samples } -void gps_fpga_acquisition_8sc::close_device() +void fpga_acquisition::close_device() { unsigned * aux = const_cast(d_map_base); if (munmap(static_cast(aux), PAGE_SIZE) == -1) @@ -309,7 +241,7 @@ void gps_fpga_acquisition_8sc::close_device() close(d_fd); } -void gps_fpga_acquisition_8sc::reset_acquisition(void) +void fpga_acquisition::reset_acquisition(void) { d_map_base[6] = 2; // writing a 2 to d_map_base[6] resets the multicorrelator } diff --git a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h b/src/algorithms/acquisition/libs/fpga_acquisition.h similarity index 78% rename from src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h rename to src/algorithms/acquisition/libs/fpga_acquisition.h index 609abf0d9..45cae5475 100644 --- a/src/algorithms/acquisition/libs/gps_fpga_acquisition_8sc.h +++ b/src/algorithms/acquisition/libs/fpga_acquisition.h @@ -1,12 +1,12 @@ /*! - * \file fpga_acquisition_8sc.h - * \brief High optimized FPGA vector correlator class for lv_16sc_t (short int complex). + * \file fpga_acquisition.h + * \brief High optimized FPGA vector correlator class * \authors
      - *
    • Marc Majoral, 2017. mmajoral(at)cttc.cat + *
    • Marc Majoral, 2018. mmajoral(at)cttc.cat *
    * - * Class that controls and executes a high optimized vector correlator - * class in the FPGA + * Class that controls and executes a high optimized acquisition HW + * accelerator in the FPGA * * ------------------------------------------------------------------------- * @@ -33,26 +33,26 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_GPS_SDR_FPGA_ACQUISITION_8SC_H_ -#define GNSS_GPS_SDR_FPGA_ACQUISITION_8SC_H_ +#ifndef GNSS_SDR_FPGA_ACQUISITION_H_ +#define GNSS_SDR_FPGA_ACQUISITION_H_ #include -#include #include /*! * \brief Class that implements carrier wipe-off and correlators. */ -class gps_fpga_acquisition_8sc +class fpga_acquisition { public: - gps_fpga_acquisition_8sc(std::string device_name, - unsigned int vector_length, unsigned int nsamples, + fpga_acquisition(std::string device_name, + unsigned int nsamples, unsigned int doppler_max, unsigned int nsamples_total, long fs_in, long freq, - unsigned int sampled_ms, unsigned select_queue); - ~gps_fpga_acquisition_8sc();bool init();bool set_local_code( - unsigned int PRN); //int code_length_chips, const lv_16sc_t* local_code_in, float *shifts_chips); + unsigned int sampled_ms, unsigned select_queue, + lv_16sc_t *all_fft_codes); + ~fpga_acquisition();bool init();bool set_local_code( + unsigned int PRN); bool free(); void run_acquisition(void); void set_phase_step(unsigned int doppler_index); @@ -60,7 +60,7 @@ public: unsigned *initial_sample, float *power_sum); void block_samples(); void unblock_samples(); - //void open_device(); + /*! * \brief Set maximum Doppler grid search * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. @@ -69,6 +69,7 @@ public: { d_doppler_max = doppler_max; } + /*! * \brief Set Doppler steps for the grid search * \param doppler_step - Frequency bin of the search grid [Hz]. @@ -102,4 +103,4 @@ private: void close_device(); }; -#endif /* GNSS_GPS_SDR_FPGA_MULTICORRELATOR_H_ */ +#endif /* GNSS_SDR_FPGA_ACQUISITION_H_ */ From 1573c40938eb9fa77391893e9c790bb5ce2465c8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 28 Apr 2018 12:33:46 +0200 Subject: [PATCH 30/39] Expose some tracking parameters to the configuration Replace GPS_L5i_DLL_PLL_Tracking by GPS_L5_DLL_PLL_Tracking since now it can also track the Q component. Old name still recognized for backward compatibility Fix typo in flag documentation --- src/algorithms/libs/gnss_sdr_flags.cc | 2 +- src/algorithms/libs/gnss_sdr_flags.h | 2 +- .../tracking/adapters/CMakeLists.txt | 2 +- .../galileo_e1_dll_pll_veml_tracking.cc | 13 +++++ .../adapters/galileo_e5a_dll_pll_tracking.cc | 13 +++++ .../adapters/gps_l1_ca_dll_pll_tracking.cc | 13 +++++ .../adapters/gps_l2_m_dll_pll_tracking.cc | 13 +++++ ...tracking.cc => gps_l5_dll_pll_tracking.cc} | 37 ++++++++---- ...l_tracking.h => gps_l5_dll_pll_tracking.h} | 20 +++---- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 56 +++++++++++-------- .../gnuradio_blocks/dll_pll_veml_tracking.h | 5 +- src/core/receiver/gnss_block_factory.cc | 20 +++---- 12 files changed, 135 insertions(+), 61 deletions(-) rename src/algorithms/tracking/adapters/{gps_l5i_dll_pll_tracking.cc => gps_l5_dll_pll_tracking.cc} (81%) rename src/algorithms/tracking/adapters/{gps_l5i_dll_pll_tracking.h => gps_l5_dll_pll_tracking.h} (85%) diff --git a/src/algorithms/libs/gnss_sdr_flags.cc b/src/algorithms/libs/gnss_sdr_flags.cc index db6e37757..38fe3858f 100644 --- a/src/algorithms/libs/gnss_sdr_flags.cc +++ b/src/algorithms/libs/gnss_sdr_flags.cc @@ -54,7 +54,7 @@ DEFINE_int32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimat DEFINE_int32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)."); -DEFINE_int32(max_lock_fail, 50, "Number number of lock failures before dropping satellite."); +DEFINE_int32(max_lock_fail, 50, "Maximum number of lock failures before dropping a satellite."); DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad)."); diff --git a/src/algorithms/libs/gnss_sdr_flags.h b/src/algorithms/libs/gnss_sdr_flags.h index c0c67383d..762e94fe8 100644 --- a/src/algorithms/libs/gnss_sdr_flags.h +++ b/src/algorithms/libs/gnss_sdr_flags.h @@ -50,7 +50,7 @@ DECLARE_int32(doppler_step); //property(role + ".cn0_samples", 20); + if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + trk_param.cn0_samples = cn0_samples; + int cn0_min = configuration->property(role + ".cn0_min", 25); + if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + trk_param.cn0_min = cn0_min; + int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); + if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + trk_param.max_lock_fail = max_lock_fail; + double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); + if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + trk_param.carrier_lock_th = carrier_lock_th; + //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) { diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc index e4de78c22..0e95e1004 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -101,6 +101,19 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( trk_param.system = 'E'; char sig_[3] = "5X"; std::memcpy(trk_param.signal, sig_, 3); + int cn0_samples = configuration->property(role + ".cn0_samples", 20); + if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + trk_param.cn0_samples = cn0_samples; + int cn0_min = configuration->property(role + ".cn0_min", 25); + if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + trk_param.cn0_min = cn0_min; + int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); + if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + trk_param.max_lock_fail = max_lock_fail; + double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); + if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + trk_param.carrier_lock_th = carrier_lock_th; + //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) { diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index c43c1de8a..f0257d5b8 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -105,6 +105,19 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( trk_param.system = 'G'; char sig_[3] = "1C"; std::memcpy(trk_param.signal, sig_, 3); + int cn0_samples = configuration->property(role + ".cn0_samples", 20); + if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + trk_param.cn0_samples = cn0_samples; + int cn0_min = configuration->property(role + ".cn0_min", 25); + if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + trk_param.cn0_min = cn0_min; + int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); + if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + trk_param.max_lock_fail = max_lock_fail; + double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); + if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + trk_param.carrier_lock_th = carrier_lock_th; + //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) { diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc index 7ed9444a6..794983979 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc @@ -92,6 +92,19 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( trk_param.system = 'G'; char sig_[3] = "2S"; std::memcpy(trk_param.signal, sig_, 3); + int cn0_samples = configuration->property(role + ".cn0_samples", 20); + if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + trk_param.cn0_samples = cn0_samples; + int cn0_min = configuration->property(role + ".cn0_min", 25); + if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + trk_param.cn0_min = cn0_min; + int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); + if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + trk_param.max_lock_fail = max_lock_fail; + double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); + if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + trk_param.carrier_lock_th = carrier_lock_th; + //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) { diff --git a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc similarity index 81% rename from src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.cc rename to src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc index 38ab6f55e..f41797fe6 100644 --- a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -1,7 +1,7 @@ /*! - * \file gps_l5i_dll_pll_tracking.cc + * \file gps_l5_dll_pll_tracking.cc * \brief Interface of an adapter of a DLL+PLL tracking loop block - * for GPS L5i to a TrackingInterface + * for GPS L5 to a TrackingInterface * \author Javier Arribas, 2017. jarribas(at)cttc.es * * Code DLL + carrier PLL according to the algorithms described in: @@ -35,7 +35,7 @@ */ -#include "gps_l5i_dll_pll_tracking.h" +#include "gps_l5_dll_pll_tracking.h" #include "configuration_interface.h" #include "GPS_L5.h" #include "gnss_sdr_flags.h" @@ -45,7 +45,7 @@ using google::LogMessage; -GpsL5iDllPllTracking::GpsL5iDllPllTracking( +GpsL5DllPllTracking::GpsL5DllPllTracking( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { @@ -101,6 +101,19 @@ GpsL5iDllPllTracking::GpsL5iDllPllTracking( trk_param.system = 'G'; char sig_[3] = "L5"; std::memcpy(trk_param.signal, sig_, 3); + int cn0_samples = configuration->property(role + ".cn0_samples", 20); + if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + trk_param.cn0_samples = cn0_samples; + int cn0_min = configuration->property(role + ".cn0_min", 25); + if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + trk_param.cn0_min = cn0_min; + int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); + if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + trk_param.max_lock_fail = max_lock_fail; + double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); + if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + trk_param.carrier_lock_th = carrier_lock_th; + //################# MAKE TRACKING GNURadio object ################### if (item_type.compare("gr_complex") == 0) { @@ -117,12 +130,12 @@ GpsL5iDllPllTracking::GpsL5iDllPllTracking( } -GpsL5iDllPllTracking::~GpsL5iDllPllTracking() +GpsL5DllPllTracking::~GpsL5DllPllTracking() { } -void GpsL5iDllPllTracking::start_tracking() +void GpsL5DllPllTracking::start_tracking() { tracking_->start_tracking(); } @@ -131,20 +144,20 @@ void GpsL5iDllPllTracking::start_tracking() /* * Set tracking channel unique ID */ -void GpsL5iDllPllTracking::set_channel(unsigned int channel) +void GpsL5DllPllTracking::set_channel(unsigned int channel) { channel_ = channel; tracking_->set_channel(channel); } -void GpsL5iDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void GpsL5DllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) { tracking_->set_gnss_synchro(p_gnss_synchro); } -void GpsL5iDllPllTracking::connect(gr::top_block_sptr top_block) +void GpsL5DllPllTracking::connect(gr::top_block_sptr top_block) { if (top_block) { /* top_block is not null */ @@ -153,7 +166,7 @@ void GpsL5iDllPllTracking::connect(gr::top_block_sptr top_block) } -void GpsL5iDllPllTracking::disconnect(gr::top_block_sptr top_block) +void GpsL5DllPllTracking::disconnect(gr::top_block_sptr top_block) { if (top_block) { /* top_block is not null */ @@ -162,13 +175,13 @@ void GpsL5iDllPllTracking::disconnect(gr::top_block_sptr top_block) } -gr::basic_block_sptr GpsL5iDllPllTracking::get_left_block() +gr::basic_block_sptr GpsL5DllPllTracking::get_left_block() { return tracking_; } -gr::basic_block_sptr GpsL5iDllPllTracking::get_right_block() +gr::basic_block_sptr GpsL5DllPllTracking::get_right_block() { return tracking_; } diff --git a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h similarity index 85% rename from src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.h rename to src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h index 31a6d41f9..119776b9f 100644 --- a/src/algorithms/tracking/adapters/gps_l5i_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h @@ -1,7 +1,7 @@ /*! - * \file gps_l5idll_pll_tracking.h + * \file gps_l5_dll_pll_tracking.h * \brief Interface of an adapter of a DLL+PLL tracking loop block - * for GPS L5i to a TrackingInterface + * for GPS L5 to a TrackingInterface * \author Javier Arribas, 2017. jarribas(at)cttc.es * * Code DLL + carrier PLL according to the algorithms described in: @@ -34,8 +34,8 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_ -#define GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_ +#ifndef GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_H_ +#define GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_H_ #include "tracking_interface.h" #include "dll_pll_veml_tracking.h" @@ -46,25 +46,25 @@ class ConfigurationInterface; /*! * \brief This class implements a code DLL + carrier PLL tracking loop */ -class GpsL5iDllPllTracking : public TrackingInterface +class GpsL5DllPllTracking : public TrackingInterface { public: - GpsL5iDllPllTracking(ConfigurationInterface* configuration, + GpsL5DllPllTracking(ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams); - virtual ~GpsL5iDllPllTracking(); + virtual ~GpsL5DllPllTracking(); inline std::string role() override { return role_; } - //! Returns "GPS_L5i_DLL_PLL_Tracking" + //! Returns "GPS_L5_DLL_PLL_Tracking" inline std::string implementation() override { - return "GPS_L5i_DLL_PLL_Tracking"; + return "GPS_L5_DLL_PLL_Tracking"; } inline size_t item_size() override @@ -99,4 +99,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_GPS_L5i_DLL_PLL_TRACKING_H_ +#endif // GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_H_ diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index d53eaad66..515e21ada 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -48,7 +48,6 @@ #include "gps_l2c_signal.h" #include "GPS_L5.h" #include "gps_l5_signal.h" -#include "gnss_sdr_flags.h" #include #include #include @@ -93,6 +92,18 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_secondary_code_length = 0; d_secondary_code_string = nullptr; signal_type = std::string(trk_parameters.signal); + + std::map map_signal_pretty_name; + map_signal_pretty_name["1C"] = "L1 C/A"; + map_signal_pretty_name["1B"] = "E1"; + map_signal_pretty_name["1G"] = "L1 C/A"; + map_signal_pretty_name["2S"] = "L2C"; + map_signal_pretty_name["2G"] = "L2 C/A"; + map_signal_pretty_name["5X"] = "E5a"; + map_signal_pretty_name["L5"] = "L5"; + + signal_pretty_name = map_signal_pretty_name[signal_type]; + if (trk_parameters.system == 'G') { systemName = "GPS"; @@ -135,17 +146,19 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_code_length_chips = static_cast(GPS_L5i_CODE_LENGTH_CHIPS); // GPS L5 does not have pilot secondary code d_secondary = true; + interchange_iq = false; if (trk_parameters.track_pilot) { d_secondary_code_length = static_cast(GPS_L5q_NH_CODE_LENGTH); d_secondary_code_string = const_cast(&GPS_L5q_NH_CODE_STR); - interchange_iq = true; + signal_pretty_name = signal_pretty_name + "Q"; + //interchange_iq = true; } else { d_secondary_code_length = static_cast(GPS_L5i_NH_CODE_LENGTH); d_secondary_code_string = const_cast(&GPS_L5i_NH_CODE_STR); - interchange_iq = false; + signal_pretty_name = signal_pretty_name + "I"; } } else @@ -180,10 +193,12 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_secondary = true; d_secondary_code_length = static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH); d_secondary_code_string = const_cast(&Galileo_E1_C_SECONDARY_CODE); + signal_pretty_name = signal_pretty_name + "C"; } else { d_secondary = false; + signal_pretty_name = signal_pretty_name + "B"; } interchange_iq = false; // Note that E1-B and E1-C are in anti-phase, NOT IN QUADRATURE. See Galileo ICD. } @@ -197,16 +212,18 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_code_samples_per_chip = 1; d_code_length_chips = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); d_secondary = true; + interchange_iq = false; if (trk_parameters.track_pilot) { - interchange_iq = true; d_secondary_code_length = static_cast(Galileo_E5a_Q_SECONDARY_CODE_LENGTH); + signal_pretty_name = signal_pretty_name + "Q"; + // interchange_iq = true; } else { - interchange_iq = false; d_secondary_code_length = static_cast(Galileo_E5a_I_SECONDARY_CODE_LENGTH); d_secondary_code_string = const_cast(&Galileo_E5a_I_SECONDARY_CODE); + signal_pretty_name = signal_pretty_name + "I"; } } else @@ -338,11 +355,11 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl // CN0 estimation and lock detector buffers d_cn0_estimation_counter = 0; - d_Prompt_buffer = new gr_complex[FLAGS_cn0_samples]; + d_Prompt_buffer = new gr_complex[trk_parameters.cn0_samples]; d_carrier_lock_test = 1.0; d_CN0_SNV_dB_Hz = 0.0; d_carrier_lock_fail_counter = 0; - d_carrier_lock_threshold = FLAGS_carrier_lock_th; + d_carrier_lock_threshold = trk_parameters.carrier_lock_th; clear_tracking_vars(); @@ -361,16 +378,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(dllpllconf_t conf_) : gr::block("dl d_code_phase_samples = 0.0; d_last_prompt = gr_complex(0.0, 0.0); d_state = 0; // initial state: standby - - map_signal_pretty_name["1C"] = "L1 C/A"; - map_signal_pretty_name["1B"] = "E1"; - map_signal_pretty_name["1G"] = "L1 C/A"; - map_signal_pretty_name["2S"] = "L2C"; - map_signal_pretty_name["2G"] = "L2 C/A"; - map_signal_pretty_name["5X"] = "E5a"; - map_signal_pretty_name["L5"] = "L5"; - - signal_pretty_name = map_signal_pretty_name[signal_type]; } @@ -618,7 +625,8 @@ bool dll_pll_veml_tracking::acquire_secondary() bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_time_s) { // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### - if (d_cn0_estimation_counter < FLAGS_cn0_samples) + + if (d_cn0_estimation_counter < trk_parameters.cn0_samples) { // fill buffer with prompt correlator output values d_Prompt_buffer[d_cn0_estimation_counter] = d_P_accu; @@ -629,11 +637,11 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_ { d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, coh_integration_time_s); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, trk_parameters.cn0_samples, coh_integration_time_s); // Carrier lock indicator - d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); + d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, trk_parameters.cn0_samples); // Loss of lock detection - if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < FLAGS_cn0_min) + if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < trk_parameters.cn0_min) { d_carrier_lock_fail_counter++; } @@ -641,7 +649,7 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_ { if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; } - if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) + if (d_carrier_lock_fail_counter > trk_parameters.max_lock_fail) { std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; @@ -1242,7 +1250,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_L_accu = *d_Late; // Check lock status - if (!cn0_and_tracking_lock_status(static_cast(d_correlation_length_ms) / 1000.0)) + if (!cn0_and_tracking_lock_status(d_code_period)) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected @@ -1420,7 +1428,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) save_correlation_results(); // check lock status - if (!cn0_and_tracking_lock_status((static_cast(d_correlation_length_ms) / 1000.0) * static_cast(trk_parameters.extend_correlation_symbols))) + if (!cn0_and_tracking_lock_status(d_code_period * static_cast(trk_parameters.extend_correlation_symbols))) { clear_tracking_vars(); d_state = 0; // loss-of-lock detected diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index 6d1719173..5a77abe40 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -56,6 +56,10 @@ typedef struct float early_late_space_narrow_chips; float very_early_late_space_narrow_chips; int extend_correlation_symbols; + int cn0_samples; + int cn0_min; + int max_lock_fail; + double carrier_lock_th; bool track_pilot; char system; char signal[3]; @@ -119,7 +123,6 @@ private: std::string systemName; std::string signal_type; std::string *d_secondary_code_string; - std::map map_signal_pretty_name; std::string signal_pretty_name; //tracking state machine diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 0cf956706..bbc88df91 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -91,7 +91,7 @@ #include "glonass_l1_ca_dll_pll_c_aid_tracking.h" #include "glonass_l2_ca_dll_pll_tracking.h" #include "glonass_l2_ca_dll_pll_c_aid_tracking.h" -#include "gps_l5i_dll_pll_tracking.h" +#include "gps_l5_dll_pll_tracking.h" #include "gps_l1_ca_telemetry_decoder.h" #include "gps_l2c_telemetry_decoder.h" #include "gps_l5_telemetry_decoder.h" @@ -250,13 +250,13 @@ std::unique_ptr GNSSBlockFactory::GetObservables(std::shared GPS_channels += configuration->property("Channels_2S.count", 0); GPS_channels += configuration->property("Channels_L5.count", 0); unsigned int Glonass_channels = configuration->property("Channels_1G.count", 0); - unsigned int extra_channels = 1; // For monitor channel sample counter + unsigned int extra_channels = 1; // For monitor channel sample counter return GetBlock(configuration, "Observables", implementation, - Galileo_channels + + Galileo_channels + GPS_channels + Glonass_channels + extra_channels, - Galileo_channels + + Galileo_channels + GPS_channels + Glonass_channels); } @@ -617,7 +617,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( } - //********* GLONASS L2 C/A CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_2G( std::shared_ptr configuration, @@ -687,7 +686,6 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( } - //********* GPS L5 CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_L5( std::shared_ptr configuration, @@ -779,7 +777,7 @@ std::unique_ptr>> GNSSBlockFacto Channels_1B_count + Channels_5X_count + Channels_1G_count + - Channels_2G_count + + Channels_2G_count + Channels_L5_count; std::unique_ptr>> channels(new std::vector>(total_channels)); @@ -1437,9 +1435,9 @@ std::unique_ptr GNSSBlockFactory::GetBlock( out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) + else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)) { - std::unique_ptr block_(new GpsL5iDllPllTracking(configuration.get(), role, in_streams, + std::unique_ptr block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } @@ -1766,9 +1764,9 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( out_streams)); block = std::move(block_); } - else if (implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) + else if ((implementation.compare("GPS_L5i_DLL_PLL_Tracking") == 0) or (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)) { - std::unique_ptr block_(new GpsL5iDllPllTracking(configuration.get(), role, in_streams, + std::unique_ptr block_(new GpsL5DllPllTracking(configuration.get(), role, in_streams, out_streams)); block = std::move(block_); } From a92e6de3d99d6cec0a7353ab57ab539006bc4580 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 01:19:48 +0200 Subject: [PATCH 31/39] Add support for aarch64 --- .../cmake/Modules/VolkAddTest.cmake | 33 +++++---- .../arm_cortex_a15_hardfp_native.cmake | 8 +++ .../arm_cortex_a9_hardfp_native.cmake | 8 +++ .../volk_gnsssdr/cmake/msvc/sys/time.h | 72 +++++++++++++++++++ .../volk_gnsssdr/gen/archs.xml | 14 +++- .../volk_gnsssdr/gen/machines.xml | 10 ++- .../volk_gnsssdr_16i_resamplerxnpuppet_16i.h | 2 +- .../volk_gnsssdr_16i_xn_resampler_16i_xn.h | 2 +- ...nsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h | 12 ++-- ...dr_16ic_16i_rotator_dotprodxnpuppet_16ic.h | 4 +- .../volk_gnsssdr_16ic_conjugate_16ic.h | 4 +- .../volk_gnsssdr_16ic_convert_32fc.h | 4 +- .../volk_gnsssdr_16ic_resampler_fast_16ic.h | 4 +- ...lk_gnsssdr_16ic_resamplerfastpuppet_16ic.h | 4 +- ..._gnsssdr_16ic_resamplerfastxnpuppet_16ic.h | 2 +- ...volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h | 2 +- .../volk_gnsssdr_16ic_rotatorpuppet_16ic.h | 8 +-- .../volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h | 8 +-- .../volk_gnsssdr_16ic_x2_dot_prod_16ic.h | 12 ++-- .../volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h | 12 ++-- ...olk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h | 6 +- .../volk_gnsssdr_16ic_x2_multiply_16ic.h | 4 +- ...gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h | 12 ++-- ...sdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h | 4 +- .../volk_gnsssdr_16ic_xn_resampler_16ic_xn.h | 2 +- ...k_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h | 4 +- .../volk_gnsssdr_32f_index_max_32u.h | 4 +- .../volk_gnsssdr_32f_resamplerxnpuppet_32f.h | 2 +- .../volk_gnsssdr_32f_sincos_32fc.h | 4 +- .../volk_gnsssdr_32f_xn_resampler_32f_xn.h | 2 +- .../volk_gnsssdr_32fc_convert_16ic.h | 4 +- .../volk_gnsssdr_32fc_convert_8ic.h | 4 +- ...volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h | 2 +- ...gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h | 4 +- ...sdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h | 2 +- .../volk_gnsssdr_32fc_xn_resampler_32fc_xn.h | 2 +- .../volk_gnsssdr_8ic_conjugate_8ic.h | 4 +- .../volk_gnsssdr_8ic_x2_dot_prod_8ic.h | 4 +- .../volk_gnsssdr_s32f_sincos_32fc.h | 4 +- .../volk_gnsssdr_s32f_sincospuppet_32fc.h | 4 +- .../volk_gnsssdr/lib/CMakeLists.txt | 34 ++++++++- .../volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c | 53 +++++++++++++- 42 files changed, 289 insertions(+), 101 deletions(-) create mode 100644 src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake create mode 100644 src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake create mode 100644 src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/sys/time.h diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake index e78a3e30e..ea6b82ba1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake @@ -176,20 +176,19 @@ function(VOLK_ADD_TEST test_name executable_name) #set them in the PATH to run tests. The following appends the #path of a target dependency. # - #NOTE: get_target_property LOCATION is being deprecated as of - #CMake 3.2.0, which just prints a warning & notes that this - #functionality will be removed in the future. Leave it here for - #now until someone can figure out how to do this in Windows. - foreach(target ${test_name} ${VOLK_TEST_TARGET_DEPS}) - get_target_property(location "${target}" LOCATION) - if(location) - get_filename_component(path ${location} PATH) - string(REGEX REPLACE "\\$\\(.*\\)" ${CMAKE_BUILD_TYPE} path ${path}) - list(APPEND libpath ${path}) - endif(location) - endforeach(target) + #create a list of target directories to be determined by the + #"add_test" command, via the $ operator; make sure the + #test's directory is first, since it ($1) is prepended to PATH. + unset(TARGET_DIR_LIST) + foreach(target ${executable_name} ${VOLK_TEST_TARGET_DEPS}) + list(APPEND TARGET_DIR_LIST "$") + endforeach() + #replace list separator with the path separator (escaped) + string(REPLACE ";" "\\\\;" TARGET_DIR_LIST "${TARGET_DIR_LIST}") - list(APPEND libpath ${DLL_PATHS} "%PATH%") + #add command line argument (TARGET_DIR_LIST) to path and append current path + list(INSERT libpath 0 "%1") + list(APPEND libpath "%PATH%") #replace list separator with the path separator (escaped) string(REPLACE ";" "\\;" libpath "${libpath}") @@ -204,14 +203,18 @@ function(VOLK_ADD_TEST test_name executable_name) file(APPEND ${bat_file} "SET ${environ}\n") endforeach(environ) + set(VOLK_TEST_ARGS "${test_name}") + #redo the test args to have a space between each string(REPLACE ";" " " VOLK_TEST_ARGS "${VOLK_TEST_ARGS}") #finally: append the test name to execute - file(APPEND ${bat_file} ${test_name} " " ${VOLK_TEST_ARGS} "\n") + file(APPEND ${bat_file} "${executable_name} ${VOLK_TEST_ARGS}\n") file(APPEND ${bat_file} "\n") - add_test(${test_name} ${bat_file}) + add_test(NAME qa_${test_name} + COMMAND ${bat_file} ${TARGET_DIR_LIST} + ) endif(WIN32) endfunction(VOLK_ADD_TEST) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake new file mode 100644 index 000000000..274e63aea --- /dev/null +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake @@ -0,0 +1,8 @@ +######################################################################## +# Toolchain file for building native on a ARM Cortex A8 w/ NEON +# Usage: cmake -DCMAKE_TOOLCHAIN_FILE= +######################################################################## +set(CMAKE_CXX_COMPILER g++) +set(CMAKE_C_COMPILER gcc) +set(CMAKE_CXX_FLAGS "-march=armv7-a -mtune=cortex-a15 -mfpu=neon -mfloat-abi=hard" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE) #same flags for C sources diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake new file mode 100644 index 000000000..b8302c872 --- /dev/null +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake @@ -0,0 +1,8 @@ +######################################################################## +# Toolchain file for building native on a ARM Cortex A8 w/ NEON +# Usage: cmake -DCMAKE_TOOLCHAIN_FILE= +######################################################################## +set(CMAKE_CXX_COMPILER g++) +set(CMAKE_C_COMPILER gcc) +set(CMAKE_CXX_FLAGS "-march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE) #same flags for C sources diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/sys/time.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/sys/time.h new file mode 100644 index 000000000..fc62a7041 --- /dev/null +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/sys/time.h @@ -0,0 +1,72 @@ +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_SYS_TIME_H_ +#define _MSC_SYS_TIME_H_ + +#ifndef NOMINMAX +#define NOMINMAX +#endif + +//http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/430449b3-f6dd-4e18-84de-eebd26a8d668 +#include < time.h > +#include //I've omitted this line. +#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) +#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 +#else +#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL +#endif + +#if _MSC_VER < 1900 +struct timespec +{ + time_t tv_sec; /* Seconds since 00:00:00 GMT, */ + + /* 1 January 1970 */ + + long tv_nsec; /* Additional nanoseconds since */ + + /* tv_sec */ +}; +#endif + +struct timezone +{ + int tz_minuteswest; /* minutes W of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; + +static inline int gettimeofday(struct timeval *tv, struct timezone *tz) +{ + FILETIME ft; + unsigned __int64 tmpres = 0; + static int tzflag; + + if (NULL != tv) + { + GetSystemTimeAsFileTime(&ft); + + tmpres |= ft.dwHighDateTime; + tmpres <<= 32; + tmpres |= ft.dwLowDateTime; + + /*converting file time to unix epoch*/ + tmpres -= DELTA_EPOCH_IN_MICROSECS; + tv->tv_sec = (long)(tmpres / 1000000UL); + tv->tv_usec = (long)(tmpres % 1000000UL); + } + + if (NULL != tz) + { + if (!tzflag) + { + _tzset(); + tzflag++; + } + tz->tz_minuteswest = _timezone / 60; + tz->tz_dsttime = _daylight; + } + + return 0; +} diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml index ff1de1e15..a8bee46a2 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml @@ -13,12 +13,24 @@ - -mfpu=neon -funsafe-math-optimizations 16 + + -mfpu=neon + -funsafe-math-optimizations + 16 + + + + + -funsafe-math-optimizations + 16 + + + -m32 diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/machines.xml b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/machines.xml index b60f336cd..e7c6eaf20 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/machines.xml +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/machines.xml @@ -5,7 +5,15 @@ -generic neon softfp|hardfp orc| +generic neon orc| + + + +generic neon neonv7 softfp|hardfp orc| + + + +generic neon neonv8 diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h index ffce85d32..12e95411e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h @@ -249,7 +249,7 @@ static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_a_avx(int16_t* result, #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16i_resamplerxnpuppet_16i_neon(int16_t* result, const int16_t* local_code, unsigned int num_points) { int code_length_chips = 2046; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h index 3628ccf8c..7547ca5d8 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h @@ -526,7 +526,7 @@ static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_u_avx(int16_t** result, #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16i_xn_resampler_16i_xn_neon(int16_t** result, const int16_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, float* shifts_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_points) { diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h index fbf7e31f1..71d4d3c86 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h @@ -1049,7 +1049,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc } #endif /* LV_HAVE_AVX2 */ -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //#include //static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) @@ -1228,10 +1228,10 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc //} //} -//#endif [> LV_HAVE_NEON <] +//#endif [> LV_HAVE_NEONV7 <] -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //#include //#include @@ -1419,10 +1419,10 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc //} //} -//#endif [> LV_HAVE_NEON <] +//#endif [> LV_HAVE_NEONV7 <] -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //#include //#include @@ -1601,6 +1601,6 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc //} //} -//#endif [> LV_HAVE_NEON <] +//#endif [> LV_HAVE_NEONV7 <] #endif /*INCLUDED_volk_gnsssdr_16ic_16i_dot_prod_16ic_xn_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h index 6880b8d11..7466ac2c2 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h @@ -317,7 +317,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_avx2(lv_ //#endif // AVX2 -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) //{ //// phases must be normalized. Phase rotator expects a complex exponential input! @@ -348,7 +348,7 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_u_avx2(lv_ //#endif // NEON -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //static inline void volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_neon_vma(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) //{ //// phases must be normalized. Phase rotator expects a complex exponential input! diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h index b294d5ca9..cefef96c6 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_conjugate_16ic.h @@ -202,7 +202,7 @@ static inline void volk_gnsssdr_16ic_conjugate_16ic_u_avx2(lv_16sc_t* cVector, c // // -//#ifdef LV_HAVE_NEON +//#ifdef LV_HAVE_NEONV7 //#include // //static inline void volk_gnsssdr_16ic_conjugate_16ic_neon(lv_16sc_t* cVector, const lv_16sc_t* aVector, unsigned int num_points) @@ -228,6 +228,6 @@ static inline void volk_gnsssdr_16ic_conjugate_16ic_u_avx2(lv_16sc_t* cVector, c // *c++ = lv_conj(*a++); // } //} -//#endif /* LV_HAVE_NEON */ +//#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_16ic_conjugate_16ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h index 5d66452e0..eaaedaba5 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_convert_32fc.h @@ -180,7 +180,7 @@ static inline void volk_gnsssdr_16ic_convert_32fc_a_axv(lv_32fc_t* outputVector, #endif /* LV_HAVE_AVX */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_convert_32fc_neon(lv_32fc_t* outputVector, const lv_16sc_t* inputVector, unsigned int num_points) @@ -210,6 +210,6 @@ static inline void volk_gnsssdr_16ic_convert_32fc_neon(lv_32fc_t* outputVector, _in++; } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_32fc_convert_16ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h index cca2efa0d..d2f43e708 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h @@ -256,7 +256,7 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_u_sse2(lv_16sc_t* resul #endif /* LV_HAVE_SSE2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_resampler_fast_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, int code_length_chips, unsigned int num_output_samples) //, int* scratch_buffer, float* scratch_buffer_float) @@ -342,6 +342,6 @@ static inline void volk_gnsssdr_16ic_resampler_fast_16ic_neon(lv_16sc_t* result, } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_16ic_resampler_fast_16ic_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h index 038e70108..03032e01d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastpuppet_16ic.h @@ -72,7 +72,7 @@ static inline void volk_gnsssdr_16ic_resamplerfastpuppet_16ic_u_sse2(lv_16sc_t* #endif /* LV_HAVE_SSE2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_resamplerfastpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { @@ -82,6 +82,6 @@ static inline void volk_gnsssdr_16ic_resamplerfastpuppet_16ic_neon(lv_16sc_t* re volk_gnsssdr_16ic_resampler_fast_16ic_neon(result, local_code, rem_code_phase_chips, code_phase_step_chips, code_length_chips, num_points); } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif // INCLUDED_volk_gnsssdr_16ic_resamplerfastpuppet_16ic_H diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h index 934af8e88..9eff06510 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h @@ -128,7 +128,7 @@ static inline void volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic_u_sse2(lv_16sc_t #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { float code_phase_step_chips = 0.1; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h index 4582d6961..8ca8e7e33 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h @@ -250,7 +250,7 @@ static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_a_avx(lv_16sc_t* res #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_resamplerxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h index 245eed773..0438931e0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h @@ -137,7 +137,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_u_sse3_reload(lv_16sc_t* #endif /* LV_HAVE_SSE3 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_neon(lv_16sc_t* outVector, const lv_16sc_t* inVector, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! @@ -150,10 +150,10 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_neon(lv_16sc_t* outVecto volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(outVector, inVector, phase_inc[0], phase, num_points); } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_neon_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! @@ -166,7 +166,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_neon_reload(lv_16sc_t* o volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(outVector, inVector, phase_inc[0], phase, num_points); } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_16ic_rotatorpuppet_16ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h index 0de39ebc3..b43a5d95e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h @@ -645,7 +645,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3_reload(lv_16sc #endif /* LV_HAVE_SSE3 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) @@ -778,10 +778,10 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) @@ -972,6 +972,6 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h index ccf815d56..d7563e1f5 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h @@ -393,7 +393,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_a_axv2(lv_16sc_t* out, con #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon(lv_16sc_t* out, const lv_16sc_t* in_a, const lv_16sc_t* in_b, unsigned int num_points) @@ -462,10 +462,10 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon(lv_16sc_t* out, const } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_vma(lv_16sc_t* out, const lv_16sc_t* in_a, const lv_16sc_t* in_b, unsigned int num_points) @@ -515,10 +515,10 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_vma(lv_16sc_t* out, c } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_optvma(lv_16sc_t* out, const lv_16sc_t* in_a, const lv_16sc_t* in_b, unsigned int num_points) @@ -569,6 +569,6 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_neon_optvma(lv_16sc_t* out } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_16ic_x2_dot_prod_16ic_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h index 065fc75a8..5410222d0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h @@ -489,7 +489,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_u_avx2(lv_16sc_t* resul #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) @@ -575,10 +575,10 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon(lv_16sc_t* result, } } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) @@ -653,10 +653,10 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_vma(lv_16sc_t* res } } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) @@ -736,6 +736,6 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* } } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_16ic_xn_dot_prod_16ic_xn_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h index ad2ec4a77..9faf03be6 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h @@ -188,7 +188,7 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_u_avx2(lv_16sc_t* r #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { @@ -213,7 +213,7 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon(lv_16sc_t* res #endif // NEON -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon_vma(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { @@ -237,7 +237,7 @@ static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon_vma(lv_16sc_t* #endif // NEON -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_neon_optvma(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h index 9548f8954..29d4f5465 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_multiply_16ic.h @@ -292,7 +292,7 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_a_avx2(lv_16sc_t* out, con #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_multiply_16ic_neon(lv_16sc_t* out, const lv_16sc_t* in_a, const lv_16sc_t* in_b, unsigned int num_points) @@ -338,6 +338,6 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_neon(lv_16sc_t* out, const *out++ = (*a_ptr++) * (*b_ptr++); } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7*/ #endif /*INCLUDED_volk_gnsssdr_16ic_x2_multiply_16ic_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h index 60b5b7b38..44444efd5 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h @@ -1300,7 +1300,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_a_avx2_reload(l #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) @@ -1486,10 +1486,10 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include #include @@ -1683,10 +1683,10 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16s } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include #include @@ -1872,6 +1872,6 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_ } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_16ic_x2_dot_prod_16ic_xn_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h index 9b30bdbbd..8196c09a6 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h @@ -317,7 +317,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_u_avx2_relo #endif // AVX2 -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_neon(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! @@ -348,7 +348,7 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_neon(lv_16s #endif // NEON -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_neon_vma(lv_16sc_t* result, const lv_16sc_t* local_code, const lv_16sc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h index 661f4ace9..64eeb6d4a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h @@ -525,7 +525,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_u_avx(lv_16sc_t** resu #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_xn_resampler_16ic_xn_neon(lv_16sc_t** result, const lv_16sc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, float* shifts_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_points) { diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h index 112c213df..68b75f813 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h @@ -285,7 +285,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_u_sse2(lv_16sc_t* #endif /* LV_HAVE_SSE2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_neon(lv_16sc_t** result, const lv_16sc_t* local_code, float* rem_code_phase_chips, float code_phase_step_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_output_samples) @@ -384,6 +384,6 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_neon(lv_16sc_t** } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h index ace8271ea..af22131f1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_index_max_32u.h @@ -481,7 +481,7 @@ static inline void volk_gnsssdr_32f_index_max_32u_generic(uint32_t* target, cons #endif /*LV_HAVE_GENERIC*/ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32f_index_max_32u_neon(uint32_t* target, const float* src0, uint32_t num_points) @@ -546,6 +546,6 @@ static inline void volk_gnsssdr_32f_index_max_32u_neon(uint32_t* target, const f } } -#endif /*LV_HAVE_NEON*/ +#endif /*LV_HAVE_NEONV7*/ #endif /*INCLUDED_volk_gnsssdr_32f_index_max_32u_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h index b425ecb9b..b27579ff3 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h @@ -246,7 +246,7 @@ static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_u_avx(float* result, c } #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_32f_resamplerxnpuppet_32f_neon(float* result, const float* local_code, unsigned int num_points) { int code_length_chips = 2046; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h index b067c5f3d..8936901b0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h @@ -642,7 +642,7 @@ static inline void volk_gnsssdr_32f_sincos_32fc_generic_fxpt(lv_32fc_t* out, con #endif /* LV_HAVE_GENERIC */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include /* Adapted from http://gruntthepeon.free.fr/ssemath/neon_mathfun.h, original code from Julien Pommier */ /* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */ @@ -747,7 +747,7 @@ static inline void volk_gnsssdr_32f_sincos_32fc_neon(lv_32fc_t* out, const float } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_32f_sincos_32fc_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h index f130032ea..ef009d1cf 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h @@ -527,7 +527,7 @@ static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_u_avx(float** result, co #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32f_xn_resampler_32f_xn_neon(float** result, const float* local_code, float rem_code_phase_chips, float code_phase_step_chips, float* shifts_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_points) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h index 892a7c0e8..afb79afcc 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h @@ -386,7 +386,7 @@ static inline void volk_gnsssdr_32fc_convert_16ic_a_avx2(lv_16sc_t* outputVector #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32fc_convert_16ic_neon(lv_16sc_t* outputVector, const lv_32fc_t* inputVector, unsigned int num_points) @@ -450,7 +450,7 @@ static inline void volk_gnsssdr_32fc_convert_16ic_neon(lv_16sc_t* outputVector, } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h index ab8d32e32..82bc4940e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h @@ -373,7 +373,7 @@ static inline void volk_gnsssdr_32fc_convert_8ic_a_sse2(lv_8sc_t* outputVector, #endif /* LV_HAVE_SSE2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32fc_convert_8ic_neon(lv_8sc_t* outputVector, const lv_32fc_t* inputVector, unsigned int num_points) @@ -464,6 +464,6 @@ static inline void volk_gnsssdr_32fc_convert_8ic_neon(lv_8sc_t* outputVector, co } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_32fc_convert_8ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h index 1655b5ccd..598e3b821 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h @@ -306,7 +306,7 @@ static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_u_avx2(lv_32fc_t* re #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_32fc_resamplerxnpuppet_32fc_neon(lv_32fc_t* result, const lv_32fc_t* local_code, unsigned int num_points) { int code_length_chips = 2046; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h index c3c77233a..257ae2900 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h @@ -647,7 +647,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_t #endif /* LV_HAVE_AVX */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_32fc_t** in_a, int num_a_vectors, unsigned int num_points) @@ -800,6 +800,6 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_neon(lv_32fc_t* (*phase) = _phase; } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h index 846539fc9..9bbe75662 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h @@ -220,7 +220,7 @@ static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_a_avx(lv_32 #endif // AVX -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_neon(lv_32fc_t* result, const lv_32fc_t* local_code, const lv_32fc_t* in, unsigned int num_points) { // phases must be normalized. Phase rotator expects a complex exponential input! diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h index 3e6227a17..aaa43fec7 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h @@ -682,7 +682,7 @@ static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_a_avx2(lv_32fc_t** res #endif -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_32fc_xn_resampler_32fc_xn_neon(lv_32fc_t** result, const lv_32fc_t* local_code, float rem_code_phase_chips, float code_phase_step_chips, float* shifts_chips, unsigned int code_length_chips, int num_out_vectors, unsigned int num_points) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h index 177b1114d..814788d61 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_conjugate_8ic.h @@ -348,7 +348,7 @@ static inline void volk_gnsssdr_8ic_conjugate_8ic_u_orc(lv_8sc_t* cVector, const #endif /* LV_HAVE_ORC */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_8ic_conjugate_8ic_neon(lv_8sc_t* cVector, const lv_8sc_t* aVector, unsigned int num_points) @@ -374,6 +374,6 @@ static inline void volk_gnsssdr_8ic_conjugate_8ic_neon(lv_8sc_t* cVector, const *c++ = lv_conj(*a++); } } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_8ic_conjugate_8ic_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h index 88a689f8b..33102b385 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h @@ -436,7 +436,7 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_u_orc(lv_8sc_t* result, cons #endif /* LV_HAVE_ORC */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_neon(lv_8sc_t* result, const lv_8sc_t* in_a, const lv_8sc_t* in_b, unsigned int num_points) @@ -495,6 +495,6 @@ static inline void volk_gnsssdr_8ic_x2_dot_prod_8ic_neon(lv_8sc_t* result, const *result += dotProduct; } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /*INCLUDED_volk_gnsssdr_8ic_x2_dot_prod_8ic_H*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h index d6d58e4d0..50ac028d0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h @@ -833,7 +833,7 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_u_avx2(lv_32fc_t *out, const fl #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 #include /* Adapted from http://gruntthepeon.free.fr/ssemath/neon_mathfun.h, original code from Julien Pommier */ /* Based on algorithms from the cephes library http://www.netlib.org/cephes/ */ @@ -948,6 +948,6 @@ static inline void volk_gnsssdr_s32f_sincos_32fc_neon(lv_32fc_t *out, const floa (*phase) = _phase; } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_s32f_sincos_32fc_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h index e4f7c942f..9b1595e9d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h @@ -103,13 +103,13 @@ static inline void volk_gnsssdr_s32f_sincospuppet_32fc_u_avx2(lv_32fc_t* out, co #endif /* LV_HAVE_AVX2 */ -#ifdef LV_HAVE_NEON +#ifdef LV_HAVE_NEONV7 static inline void volk_gnsssdr_s32f_sincospuppet_32fc_neon(lv_32fc_t* out, const float phase_inc, unsigned int num_points) { float phase[1]; phase[0] = 3; volk_gnsssdr_s32f_sincos_32fc_neon(out, phase_inc, phase, num_points); } -#endif /* LV_HAVE_NEON */ +#endif /* LV_HAVE_NEONV7 */ #endif /* INCLUDED_volk_gnsssdr_s32f_sincospuppet_32fc_H */ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt index bf0bdd3a2..c6bf3c949 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt @@ -256,6 +256,36 @@ if(NOT CPU_IS_x86) OVERRULE_ARCH(avx "Architecture is not x86 or x86_64") endif(NOT CPU_IS_x86) +######################################################################## +# Select neon based on ARM ISA version +######################################################################## + +# First, compile a test program to see if compiler supports neon. + +include(CheckCSourceCompiles) + +check_c_source_compiles("#include \nint main(){ uint8_t *dest; uint8x8_t res; vst1_u8(dest, res); }" + neon_compile_result) + +if(neon_compile_result) + check_c_source_compiles("int main(){asm volatile(\"vrev32.8 q0, q0\");}" + have_neonv7_result ) + check_c_source_compiles("int main(){asm volatile(\"sub v1.4s,v1.4s,v1.4s\");}" + have_neonv8_result ) + + if (have_neonv7_result) + OVERRULE_ARCH(neonv8 "CPU is armv7") + endif() + + if (have_neonv8_result) + OVERRULE_ARCH(neonv7 "CPU is armv8") + endif() +else(neon_compile_result) + OVERRULE_ARCH(neon "Compiler doesn't support NEON") + OVERRULE_ARCH(neonv7 "Compiler doesn't support NEON") + OVERRULE_ARCH(neonv8 "Compiler doesn't support NEON") +endif(neon_compile_result) + ######################################################################## # implement overruling in the ORC case, # since ORC always passes flag detection @@ -423,7 +453,7 @@ include_directories( # on by default, but let users turn it off ######################################################################## if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") - set(ASM_ARCHS_AVAILABLE "neon") + set(ASM_ARCHS_AVAILABLE "neonv7" "neonv8") set(FULL_C_FLAGS "${CMAKE_C_FLAGS}" "${CMAKE_CXX_COMPILER_ARG1}") @@ -432,7 +462,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") # set up the assembler flags and include the source files foreach(ARCH ${ASM_ARCHS_AVAILABLE}) string(REGEX MATCH "${ARCH}" ASM_ARCH "${available_archs}") - if( ASM_ARCH STREQUAL "neon" ) + if( ASM_ARCH STREQUAL "neonv7" ) message(STATUS "---- Adding ASM files") # we always use ATT syntax message(STATUS "-- Detected neon architecture; enabling ASM") # setup architecture specific assembler flags diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c index f04f2d9ff..d690bc993 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c @@ -128,12 +128,12 @@ static inline unsigned int get_avx2_enabled(void) #include #include #include -#define VOLK_CPU_ARM +#define VOLK_CPU_ARMV7 #endif -static int has_neon(void) +static int has_neonv7(void) { -#if defined(VOLK_CPU_ARM) +#if defined(VOLK_CPU_ARMV7) FILE *auxvec_f; unsigned long auxvec[2]; unsigned int found_neon = 0; @@ -156,6 +156,53 @@ static int has_neon(void) return 0; #endif } + +//\todo: Fix this to really check for neon on aarch64 +//neon detection is linux specific +#if defined(__aarch64__) && defined(__linux__) +#include +#include +#include +#define VOLK_CPU_ARMV8 +#endif + +static int has_neonv8(void) +{ +#if defined(VOLK_CPU_ARMV8) + FILE *auxvec_f; + unsigned long auxvec[2]; + unsigned int found_neon = 0; + auxvec_f = fopen("/proc/self/auxv", "rb"); + if (!auxvec_f) return 0; + + size_t r = 1; + //so auxv is basically 32b of ID and 32b of value + //so it goes like this + while (!found_neon && r) + { + r = fread(auxvec, sizeof(unsigned long), 2, auxvec_f); + if ((auxvec[0] == AT_HWCAP) && (auxvec[1] & HWCAP_ASIMD)) + found_neon = 1; + } + + fclose(auxvec_f); + return found_neon; +#else + return 0; +#endif +} + +static int has_neon(void) +{ +#if defined(VOLK_CPU_ARMV8) || defined(VOLK_CPU_ARMV7) + if (has_neonv7() || has_neonv8()) + return 1; + else + return 0; +#else + return 0; +#endif +} // clang-format off %for arch in archs: From 01429132bd581500b2875d9c070a21add4d7da4d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 02:51:50 +0200 Subject: [PATCH 32/39] Avoid clash of redefined macros with Volk --- .../acquisition/gnuradio_blocks/pcps_acquisition.cc | 2 +- src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h | 2 +- .../volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h | 4 ++-- .../glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc | 1 - .../gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h | 2 +- .../glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc | 1 - .../gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h | 2 +- .../gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc | 1 - .../gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc | 1 - .../gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h | 2 +- .../gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc | 1 - .../gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h | 2 +- 12 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 62e55dd31..dd2243a23 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index 97e314fdb..3836b0c38 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -56,7 +56,7 @@ #include #include #include -#include +#include #include typedef struct diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h index 4159bdef7..84be60772 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h @@ -21,9 +21,9 @@ // clang-format off %for i, arch in enumerate(archs): -//#ifndef LV_${arch.name.upper()} +#ifndef LV_${arch.name.upper()} #define LV_${arch.name.upper()} ${i} -//#endif +#endif %endfor // clang-format on #endif /*INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED*/ diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index c7540b169..1f429eee3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h index 8a26c0e73..11ed0e145 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index 9b653dfa8..b8bd3de86 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h index 6ee493185..38cf9d8b9 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc index ee5843ee9..295f894d6 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc index 14d5683c8..5f9a6ec23 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h index fd6630eef..1bd8bb0c1 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.h @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc index 37898c14c..fdfd0c04d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h index ec68aed0f..0e690f74f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include From e74b72b9dff6094da56997a0f4d1ed6ff4bc4617 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 04:16:56 +0200 Subject: [PATCH 33/39] Reorder includes --- .../gps_l1_ca_dll_pll_tracking_gpu_cc.cc | 15 ++++++------- .../gps_l1_ca_dll_pll_tracking_gpu_cc.h | 11 +++++----- .../gps_l1_ca_tcp_connector_tracking_cc.cc | 22 +++++++++---------- .../gps_l1_ca_tcp_connector_tracking_cc.h | 8 +++---- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc index f39448ce3..e1f0c31c3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc @@ -29,21 +29,20 @@ */ #include "gps_l1_ca_dll_pll_tracking_gpu_cc.h" -#include -#include -#include -#include -#include -#include -#include #include "gps_sdr_signal_processing.h" #include "tracking_discriminators.h" #include "lock_detectors.h" #include "GPS_L1_CA.h" #include "control_message_factory.h" #include "gnss_sdr_flags.h" -// includes +#include #include +#include +#include +#include +#include +#include +#include using google::LogMessage; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h index 2743f5c99..be8959f49 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.h @@ -36,14 +36,15 @@ #ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_CC_H #define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_CC_H -#include -#include -#include -#include +#include "cuda_multicorrelator.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" -#include "cuda_multicorrelator.h" +#include +#include +#include +#include + class Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index 1eb6e960a..a650238cc 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -36,22 +36,22 @@ */ #include "gps_l1_ca_tcp_connector_tracking_cc.h" -#include -#include -#include +#include "control_message_factory.h" +#include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" +#include "GPS_L1_CA.h" +#include "lock_detectors.h" +#include "tcp_communication.h" +#include "tcp_packet_data.h" +#include "tracking_discriminators.h" #include #include #include #include #include -#include "gps_sdr_signal_processing.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" -#include "GPS_L1_CA.h" -#include "control_message_factory.h" -#include "gnss_sdr_flags.h" -#include "tcp_communication.h" -#include "tcp_packet_data.h" +#include +#include +#include using google::LogMessage; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h index 89140e4b6..21bf6f02c 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h @@ -37,13 +37,13 @@ #ifndef GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H #define GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_CC_H +#include "cpu_multicorrelator.h" +#include "gnss_synchro.h" +#include "tcp_communication.h" +#include #include #include #include -#include -#include "gnss_synchro.h" -#include "cpu_multicorrelator.h" -#include "tcp_communication.h" class Gps_L1_Ca_Tcp_Connector_Tracking_cc; From 471bb17b3cfa8d7cd22ff9b24e284d903a23a807 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 10:23:19 +0200 Subject: [PATCH 34/39] Improve readability --- src/algorithms/channel/libs/channel_fsm.cc | 9 +++++++++ .../channel/libs/channel_msg_receiver_cc.cc | 5 +++-- .../adapters/array_signal_conditioner.cc | 15 +++++++++------ .../conditioner/adapters/signal_conditioner.cc | 16 ++++++++++------ 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index 310a784ef..027ec8564 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -33,6 +33,7 @@ #include "control_message_factory.h" #include +using google::LogMessage; ChannelFsm::ChannelFsm() { @@ -135,35 +136,41 @@ bool ChannelFsm::Event_failed_tracking_standby() } } + void ChannelFsm::set_acquisition(std::shared_ptr acquisition) { std::lock_guard lk(mx); acq_ = acquisition; } + void ChannelFsm::set_tracking(std::shared_ptr tracking) { std::lock_guard lk(mx); trk_ = tracking; } + void ChannelFsm::set_queue(gr::msg_queue::sptr queue) { std::lock_guard lk(mx); queue_ = queue; } + void ChannelFsm::set_channel(unsigned int channel) { std::lock_guard lk(mx); channel_ = channel; } + void ChannelFsm::start_acquisition() { acq_->reset(); } + void ChannelFsm::start_tracking() { trk_->start_tracking(); @@ -174,6 +181,7 @@ void ChannelFsm::start_tracking() } } + void ChannelFsm::request_satellite() { std::unique_ptr cmf(new ControlMessageFactory()); @@ -183,6 +191,7 @@ void ChannelFsm::request_satellite() } } + void ChannelFsm::notify_stop_tracking() { std::unique_ptr cmf(new ControlMessageFactory()); diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index 9b1056bd6..217f9c0eb 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -42,6 +42,7 @@ channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptrEvent_valid_acquisition(); break; - case 2: //negative acquisition + case 2: // negative acquisition if (d_repeat == true) { result = d_channel_fsm->Event_failed_acquisition_repeat(); diff --git a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc index 91cf3abba..e0c6e9beb 100644 --- a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc @@ -37,12 +37,15 @@ using google::LogMessage; // Constructor ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configuration, - std::shared_ptr data_type_adapt, std::shared_ptr in_filt, - std::shared_ptr res, std::string role, std::string implementation) : data_type_adapt_(data_type_adapt), - in_filt_(in_filt), - res_(res), - role_(role), - implementation_(implementation) + std::shared_ptr data_type_adapt, + std::shared_ptr in_filt, + std::shared_ptr res, + std::string role, + std::string implementation) : data_type_adapt_(data_type_adapt), + in_filt_(in_filt), + res_(res), + role_(role), + implementation_(implementation) { connected_ = false; if (configuration) diff --git a/src/algorithms/conditioner/adapters/signal_conditioner.cc b/src/algorithms/conditioner/adapters/signal_conditioner.cc index b29a56c99..0f47b3a11 100644 --- a/src/algorithms/conditioner/adapters/signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/signal_conditioner.cc @@ -37,12 +37,15 @@ using google::LogMessage; // Constructor SignalConditioner::SignalConditioner(ConfigurationInterface *configuration, - std::shared_ptr data_type_adapt, std::shared_ptr in_filt, - std::shared_ptr res, std::string role, std::string implementation) : data_type_adapt_(data_type_adapt), - in_filt_(in_filt), - res_(res), - role_(role), - implementation_(implementation) + std::shared_ptr data_type_adapt, + std::shared_ptr in_filt, + std::shared_ptr res, + std::string role, + std::string implementation) : data_type_adapt_(data_type_adapt), + in_filt_(in_filt), + res_(res), + role_(role), + implementation_(implementation) { connected_ = false; if (configuration) @@ -101,6 +104,7 @@ gr::basic_block_sptr SignalConditioner::get_left_block() return data_type_adapt_->get_left_block(); } + gr::basic_block_sptr SignalConditioner::get_right_block() { return res_->get_right_block(); From 223d6a357b40f0d7f21d2cc0a6ac1eb4748e08e1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 12:02:40 +0200 Subject: [PATCH 35/39] Add header --- cmake/Modules/FindGFORTRAN.cmake | 16 ++++++++++++ cmake/Modules/FindGFlags.cmake | 25 +++++++++++++------ cmake/Modules/FindGLOG.cmake | 17 +++++++++++++ cmake/Modules/FindGPSTK.cmake | 17 +++++++++++++ cmake/Modules/FindGnuradio.cmake | 17 +++++++++++++ cmake/Modules/FindGperftools.cmake | 17 +++++++++++++ cmake/Modules/FindGrDbfcttc.cmake | 17 +++++++++++++ cmake/Modules/FindGrGN3S.cmake | 17 +++++++++++++ cmake/Modules/FindGrOsmoSDR.cmake | 17 +++++++++++++ cmake/Modules/FindLibOsmoSDR.cmake | 17 +++++++++++++ cmake/Modules/FindLog4cpp.cmake | 17 +++++++++++++ cmake/Modules/FindMATIO.cmake | 17 +++++++++++++ cmake/Modules/FindORC.cmake | 17 +++++++++++++ cmake/Modules/FindOpenBLAS.cmake | 17 +++++++++++++ cmake/Modules/FindOpenCL.cmake | 17 +++++++++++++ cmake/Modules/FindTeleorbit.cmake | 17 +++++++++++++ cmake/Modules/FindUHD.cmake | 17 +++++++++++++ cmake/Modules/FindVolk.cmake | 17 +++++++++++++ cmake/Modules/FindVolkGnssSdr.cmake | 17 +++++++++++++ cmake/Modules/Findiio.cmake | 17 +++++++++++++ cmake/Modules/Findlibiio.cmake | 17 +++++++++++++ cmake/Modules/SetupPython.cmake | 17 +++++++++++++ cmake/Modules/TestForARM.cmake | 17 +++++++++++++ cmake/Modules/TestForSSE.cmake | 18 +++++++++++++ cmake/Toolchains/oe-sdk_cross.cmake | 17 +++++++++++++ cmake/Toolchains/zynq-7000.cmake | 19 +++++++++++++- cmake/cmake_uninstall.cmake.in | 19 +++++++++++++- .../volk_gnsssdr/cmake/Modules/FindORC.cmake | 21 +++++++++++++--- .../cmake/Modules/VolkAddTest.cmake | 24 ++++++++---------- .../cmake/Modules/VolkBoost.cmake | 16 ++++++------ .../cmake/Modules/VolkBuildTypes.cmake | 16 ++++++------ .../cmake/Modules/VolkGnsssdrConfig.cmake.in | 17 +++++++++++++ .../Modules/VolkGnsssdrConfigVersion.cmake.in | 16 ++++++------ .../cmake/Modules/VolkPython.cmake | 16 ++++++------ .../cmake/Modules/VolkVersion.cmake | 16 ++++++------ .../arm_cortex_a15_hardfp_native.cmake | 17 +++++++++++++ .../arm_cortex_a9_hardfp_native.cmake | 17 +++++++++++++ .../cmake/cmake_uninstall.cmake.in | 18 +++++++++++++ .../volk_gnsssdr/cmake/msvc/config.h | 19 ++++++++++++++ 39 files changed, 613 insertions(+), 71 deletions(-) diff --git a/cmake/Modules/FindGFORTRAN.cmake b/cmake/Modules/FindGFORTRAN.cmake index b676fec0f..c9a7c2c6f 100644 --- a/cmake/Modules/FindGFORTRAN.cmake +++ b/cmake/Modules/FindGFORTRAN.cmake @@ -1,3 +1,19 @@ +# Copyright (C) 2011-2018 (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 . find_library(GFORTRAN NAMES gfortran PATHS /usr/lib diff --git a/cmake/Modules/FindGFlags.cmake b/cmake/Modules/FindGFlags.cmake index 804c908b2..61fa165db 100644 --- a/cmake/Modules/FindGFlags.cmake +++ b/cmake/Modules/FindGFlags.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + # - Try to find GFlags # # The following variables are optionally searched for defaults @@ -9,14 +26,6 @@ # GFlags_LIBS # GFlags_LIBRARY_DIRS -# - Try to find GFlags -# -# -# The following are set after configuration is done: -# GFlags_FOUND -# GFlags_INCLUDE_DIRS -# GFlags_LIBS -# GFlags_LIBRARY_DIRS cmake_minimum_required(VERSION 2.6) if(APPLE) diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake index 68b012c8d..4ae4aa5d7 100644 --- a/cmake/Modules/FindGLOG.cmake +++ b/cmake/Modules/FindGLOG.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + # - Try to find the Google Glog library # # This module defines the following variables diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake index 37ea1dbf0..7c3e79d96 100644 --- a/cmake/Modules/FindGPSTK.cmake +++ b/cmake/Modules/FindGPSTK.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + # - Find gpstk library # Find the native gpstk includes and library # This module defines diff --git a/cmake/Modules/FindGnuradio.cmake b/cmake/Modules/FindGnuradio.cmake index 8b540bee0..a0110b7a3 100644 --- a/cmake/Modules/FindGnuradio.cmake +++ b/cmake/Modules/FindGnuradio.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ######################################################################## # Find GNU Radio ######################################################################## diff --git a/cmake/Modules/FindGperftools.cmake b/cmake/Modules/FindGperftools.cmake index 5a97a29c5..5ad0ec303 100644 --- a/cmake/Modules/FindGperftools.cmake +++ b/cmake/Modules/FindGperftools.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + # Tries to find Gperftools. # # Usage of this module as follows: diff --git a/cmake/Modules/FindGrDbfcttc.cmake b/cmake/Modules/FindGrDbfcttc.cmake index 5624f8003..d68813480 100644 --- a/cmake/Modules/FindGrDbfcttc.cmake +++ b/cmake/Modules/FindGrDbfcttc.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ######################################################################## # Find GR-DBFCTTC Module ######################################################################## diff --git a/cmake/Modules/FindGrGN3S.cmake b/cmake/Modules/FindGrGN3S.cmake index 0f1c2cbc5..7147bf65c 100644 --- a/cmake/Modules/FindGrGN3S.cmake +++ b/cmake/Modules/FindGrGN3S.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ######################################################################## # Find GR-GN3S Module ######################################################################## diff --git a/cmake/Modules/FindGrOsmoSDR.cmake b/cmake/Modules/FindGrOsmoSDR.cmake index a67e1817e..c9d4199c8 100644 --- a/cmake/Modules/FindGrOsmoSDR.cmake +++ b/cmake/Modules/FindGrOsmoSDR.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + # Tries to find gr-osmosdr. # # Usage of this module as follows: diff --git a/cmake/Modules/FindLibOsmoSDR.cmake b/cmake/Modules/FindLibOsmoSDR.cmake index d024e0629..5e52fa0b0 100644 --- a/cmake/Modules/FindLibOsmoSDR.cmake +++ b/cmake/Modules/FindLibOsmoSDR.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + # Tries to find libosmosdr. # # Usage of this module as follows: diff --git a/cmake/Modules/FindLog4cpp.cmake b/cmake/Modules/FindLog4cpp.cmake index 8bddbcd76..8f1254561 100644 --- a/cmake/Modules/FindLog4cpp.cmake +++ b/cmake/Modules/FindLog4cpp.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + # - Find Log4cpp # Find the native LOG4CPP includes and library # diff --git a/cmake/Modules/FindMATIO.cmake b/cmake/Modules/FindMATIO.cmake index e1cb458d8..78ce0f14d 100644 --- a/cmake/Modules/FindMATIO.cmake +++ b/cmake/Modules/FindMATIO.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + # FindMATIO # # Try to find MATIO library diff --git a/cmake/Modules/FindORC.cmake b/cmake/Modules/FindORC.cmake index 9d0da9ee2..ea580334c 100644 --- a/cmake/Modules/FindORC.cmake +++ b/cmake/Modules/FindORC.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + FIND_PACKAGE(PkgConfig) PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22") diff --git a/cmake/Modules/FindOpenBLAS.cmake b/cmake/Modules/FindOpenBLAS.cmake index d8751b216..360f1c781 100644 --- a/cmake/Modules/FindOpenBLAS.cmake +++ b/cmake/Modules/FindOpenBLAS.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + # - Try to find OpenBLAS library (not headers!) # # The following environment variable is optionally searched diff --git a/cmake/Modules/FindOpenCL.cmake b/cmake/Modules/FindOpenCL.cmake index 1229090a9..4ae5d6aca 100644 --- a/cmake/Modules/FindOpenCL.cmake +++ b/cmake/Modules/FindOpenCL.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + # # This file taken from FindOpenCL project @ http://gitorious.com/findopencl # diff --git a/cmake/Modules/FindTeleorbit.cmake b/cmake/Modules/FindTeleorbit.cmake index 0d2d3c505..0e46255df 100644 --- a/cmake/Modules/FindTeleorbit.cmake +++ b/cmake/Modules/FindTeleorbit.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(PC_TELEORBIT teleorbit) diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake index 3534e6b87..5a359cece 100644 --- a/cmake/Modules/FindUHD.cmake +++ b/cmake/Modules/FindUHD.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ######################################################################## # Find the library for the USRP Hardware Driver ######################################################################## diff --git a/cmake/Modules/FindVolk.cmake b/cmake/Modules/FindVolk.cmake index 9621e16f7..37906c8ef 100644 --- a/cmake/Modules/FindVolk.cmake +++ b/cmake/Modules/FindVolk.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ######################################################################## # Find VOLK (Vector-Optimized Library of Kernels) ######################################################################## diff --git a/cmake/Modules/FindVolkGnssSdr.cmake b/cmake/Modules/FindVolkGnssSdr.cmake index b5890966b..a41584481 100644 --- a/cmake/Modules/FindVolkGnssSdr.cmake +++ b/cmake/Modules/FindVolkGnssSdr.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ######################################################################## # Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library ######################################################################## diff --git a/cmake/Modules/Findiio.cmake b/cmake/Modules/Findiio.cmake index fc7af0d45..ac3e4b1c3 100644 --- a/cmake/Modules/Findiio.cmake +++ b/cmake/Modules/Findiio.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(PC_IIO gnuradio-iio) diff --git a/cmake/Modules/Findlibiio.cmake b/cmake/Modules/Findlibiio.cmake index 334dcf8d7..9b39f82e3 100644 --- a/cmake/Modules/Findlibiio.cmake +++ b/cmake/Modules/Findlibiio.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(PC_LIBIIO libiio) diff --git a/cmake/Modules/SetupPython.cmake b/cmake/Modules/SetupPython.cmake index d3c2b3a12..c876d7bc5 100644 --- a/cmake/Modules/SetupPython.cmake +++ b/cmake/Modules/SetupPython.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ######################################################################## # Setup the python interpreter: # This allows the user to specify a specific interpreter, diff --git a/cmake/Modules/TestForARM.cmake b/cmake/Modules/TestForARM.cmake index 437a75e1a..0106690ae 100644 --- a/cmake/Modules/TestForARM.cmake +++ b/cmake/Modules/TestForARM.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ############################################################################## # check if the compiler defines the architecture as ARM and set the # version, if found. diff --git a/cmake/Modules/TestForSSE.cmake b/cmake/Modules/TestForSSE.cmake index 1280f83b3..868340c59 100644 --- a/cmake/Modules/TestForSSE.cmake +++ b/cmake/Modules/TestForSSE.cmake @@ -1,3 +1,21 @@ +# Copyright (C) 2011-2018 (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 . + + ############################################################################### # Test for availability of SSE # diff --git a/cmake/Toolchains/oe-sdk_cross.cmake b/cmake/Toolchains/oe-sdk_cross.cmake index 06f589c34..e0006d8fd 100644 --- a/cmake/Toolchains/oe-sdk_cross.cmake +++ b/cmake/Toolchains/oe-sdk_cross.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ########################################################## # Toolchain file for Open Embedded ########################################################## diff --git a/cmake/Toolchains/zynq-7000.cmake b/cmake/Toolchains/zynq-7000.cmake index 9ce876e56..b804fb943 100644 --- a/cmake/Toolchains/zynq-7000.cmake +++ b/cmake/Toolchains/zynq-7000.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ########################################################## # Toolchain file for Zynq-7000 devices ########################################################## @@ -23,4 +40,4 @@ set(CMAKE_CXX_FLAGS ${ZYNQ_FLAGS} CACHE STRING "" FORCE) set(CMAKE_LIBRARY_PATH ${CMAKE_SYSROOT}/usr/lib ${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf) -set(CMAKE_INSTALL_PREFIX ${CMAKE_SYSROOT}/usr CACHE STRING "" FORCE) \ No newline at end of file +set(CMAKE_INSTALL_PREFIX ${CMAKE_SYSROOT}/usr CACHE STRING "" FORCE) diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in index 2c34c8199..bb9201eb6 100644 --- a/cmake/cmake_uninstall.cmake.in +++ b/cmake/cmake_uninstall.cmake.in @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") @@ -18,4 +35,4 @@ foreach(file ${files}) else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") message(STATUS "File $ENV{DESTDIR}${file} does not exist.") endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) \ No newline at end of file +endforeach(file) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake index 8e8e4f292..ddd103a05 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindORC.cmake @@ -1,9 +1,24 @@ +# Copyright (C) 2015-2018 (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 . + + FIND_PACKAGE(PkgConfig) PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22") - - - FIND_PROGRAM(ORCC_EXECUTABLE orcc HINTS ${PC_ORC_TOOLSDIR} PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake index ea6b82ba1..727230715 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkAddTest.cmake @@ -1,21 +1,19 @@ -# Copyright 2015 Free Software Foundation, Inc. +# Copyright (C) 2015-2018 (see AUTHORS file for a list of contributors) # -# This file is part of Volk +# This file is part of GNSS-SDR. # -# Volk 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, or (at your option) -# any later version. +# 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. # -# Volk 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. +# 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 Volk; see the file COPYING. If not, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Boston, MA -# 02110-1301, USA. +# along with GNSS-SDR. If not, see . if(DEFINED __INCLUDED_VOLK_ADD_TEST) return() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake index dd0c6940f..c875492b4 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBoost.cmake @@ -1,21 +1,19 @@ -# Copyright 2010-2011 Free Software Foundation, Inc. +# Copyright (C) 2015-2018 (see AUTHORS file for a list of contributors) # -# This file is part of GNU Radio +# This file is part of GNSS-SDR. # -# GNU Radio is free software; you can redistribute it and/or modify +# 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, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# GNU Radio is distributed in the hope that it will be useful, +# 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. +# along with GNSS-SDR. If not, see . if(DEFINED __INCLUDED_VOLK_BOOST_CMAKE) return() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake index 5b0c2cc17..1d0e810b1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkBuildTypes.cmake @@ -1,21 +1,19 @@ -# Copyright 2014 Free Software Foundation, Inc. +# Copyright (C) 2014-2018 (see AUTHORS file for a list of contributors) # -# This file is part of VOLK +# This file is part of GNSS-SDR. # -# VOLK is free software; you can redistribute it and/or modify +# 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, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# VOLK is distributed in the hope that it will be useful, +# 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. +# along with GNSS-SDR. If not, see . if(DEFINED __INCLUDED_VOLK_BUILD_TYPES_CMAKE) return() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in index f07b02d50..1f41de730 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in @@ -1,3 +1,20 @@ +# Copyright (C) 2015-2018 (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 . + INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(PC_VOLK_GNSSSDR volk_gnsssdr) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in index 84dbe0b29..d7403f913 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfigVersion.cmake.in @@ -1,21 +1,19 @@ -# Copyright 2014 Free Software Foundation, Inc. +# Copyright (C) 2015-2018 (see AUTHORS file for a list of contributors) # -# This file is part of VOLK. +# This file is part of GNSS-SDR. # -# VOLK is free software; you can redistribute it and/or modify +# 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, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# VOLK is distributed in the hope that it will be useful, +# 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 VOLK; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. +# along with GNSS-SDR. If not, see . set(MAJOR_VERSION @VERSION_INFO_MAJOR_VERSION@) set(MINOR_VERSION @VERSION_INFO_MINOR_VERSION@) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake index dc6571e93..ed7118562 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake @@ -1,21 +1,19 @@ -# Copyright 2010-2011,2013 Free Software Foundation, Inc. +# Copyright (C) 2015-2018 (see AUTHORS file for a list of contributors) # -# This file is part of GNU Radio +# This file is part of GNSS-SDR. # -# GNU Radio is free software; you can redistribute it and/or modify +# 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, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# GNU Radio is distributed in the hope that it will be useful, +# 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. +# along with GNSS-SDR. If not, see . if(DEFINED __INCLUDED_VOLK_PYTHON_CMAKE) return() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkVersion.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkVersion.cmake index 4ed349aac..1cc60fedf 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkVersion.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkVersion.cmake @@ -1,21 +1,19 @@ -# Copyright 2014 Free Software Foundation, Inc. +# Copyright (C) 2014-2018 (see AUTHORS file for a list of contributors) # -# This file is part of VOLK. +# This file is part of GNSS-SDR. # -# VOLK is free software; you can redistribute it and/or modify +# 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, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# VOLK is distributed in the hope that it will be useful, +# 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 VOLK; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. +# along with GNSS-SDR. If not, see . if(DEFINED __INCLUDED_VOLK_VERSION_CMAKE) return() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake index 274e63aea..850220b28 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a15_hardfp_native.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ######################################################################## # Toolchain file for building native on a ARM Cortex A8 w/ NEON # Usage: cmake -DCMAKE_TOOLCHAIN_FILE= diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake index b8302c872..b4b79185e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Toolchains/arm_cortex_a9_hardfp_native.cmake @@ -1,3 +1,20 @@ +# Copyright (C) 2011-2018 (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 . + ######################################################################## # Toolchain file for building native on a ARM Cortex A8 w/ NEON # Usage: cmake -DCMAKE_TOOLCHAIN_FILE= diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in index 2c34c8199..7719dec23 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/cmake_uninstall.cmake.in @@ -1,3 +1,21 @@ +# Copyright (C) 2011-2018 (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 . + + if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h index 5da8f1bff..5b3c7f8f4 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/msvc/config.h @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2010-2015 (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 _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" #endif // _MSC_VER ] From a2eb5d534406652edc153c713e9a3175a52e10db Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 13:26:21 +0200 Subject: [PATCH 36/39] Improve readability, reorder includes --- ...o_e5a_noncoherent_iq_acquisition_caf_cc.cc | 16 ++++--- .../pcps_opencl_acquisition_cc.cc | 31 ++++++++----- .../pcps_opencl_acquisition_cc.h | 10 ++--- .../input_filter/gnuradio_blocks/notch_cc.cc | 12 +++-- .../gnuradio_blocks/notch_lite_cc.cc | 15 +++++-- .../gnuradio_blocks/pulse_blanking_cc.cc | 11 +++-- .../direct_resampler_conditioner_cb.cc | 15 ++++--- .../direct_resampler_conditioner_cc.cc | 8 +++- .../direct_resampler_conditioner_cs.cc | 14 +++--- .../gnuradio_blocks/signal_generator_c.cc | 45 +++++++++++-------- .../gnuradio_blocks/labsat23_source.cc | 10 ++--- 11 files changed, 118 insertions(+), 69 deletions(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index 7144a219b..f8fa95f8e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -36,12 +36,12 @@ */ #include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h" -#include -#include +#include "control_message_factory.h" #include +#include #include #include -#include "control_message_factory.h" +#include using google::LogMessage; @@ -62,11 +62,15 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make samples_per_code, bit_transition_flag, dump, dump_filename, both_signal_components_, CAF_window_hz_, Zero_padding_)); } + galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisition_caf_cc( unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, + unsigned int doppler_max, + long freq, + long fs_in, + int samples_per_ms, + int samples_per_code, bool bit_transition_flag, bool dump, std::string dump_filename, @@ -167,6 +171,7 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit d_gr_stream_buffer = 0; } + galileo_e5a_noncoherentIQ_acquisition_caf_cc::~galileo_e5a_noncoherentIQ_acquisition_caf_cc() { if (d_num_doppler_bins > 0) @@ -267,6 +272,7 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_local_code(std::complexFlag_valid_acquisition = false; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc index 17d3628d5..851ec0545 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc @@ -49,18 +49,18 @@ */ #include "pcps_opencl_acquisition_cc.h" -#include -#include -#include -#include -#include -#include -#include -#include #include "control_message_factory.h" #include "opencl/fft_base_kernels.h" #include "opencl/fft_internal.h" #include "GPS_L1_CA.h" //GPS_TWO_PI +#include +#include +#include +#include +#include +#include +#include +#include using google::LogMessage; @@ -78,10 +78,15 @@ pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc( samples_per_code, bit_transition_flag, dump, dump_filename)); } + pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long freq, long fs_in, - int samples_per_ms, int samples_per_code, + unsigned int sampled_ms, + unsigned int max_dwells, + unsigned int doppler_max, + long freq, + long fs_in, + int samples_per_ms, + int samples_per_code, bool bit_transition_flag, bool dump, std::string dump_filename) : gr::block("pcps_opencl_acquisition_cc", @@ -339,6 +344,7 @@ void pcps_opencl_acquisition_cc::init() } } + void pcps_opencl_acquisition_cc::set_local_code(std::complex *code) { if (d_opencl == 0) @@ -374,6 +380,7 @@ void pcps_opencl_acquisition_cc::set_local_code(std::complex *code) } } + void pcps_opencl_acquisition_cc::acquisition_core_volk() { // initialize acquisition algorithm @@ -496,6 +503,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk() d_core_working = false; } + void pcps_opencl_acquisition_cc::acquisition_core_opencl() { // initialize acquisition algorithm @@ -687,6 +695,7 @@ void pcps_opencl_acquisition_cc::set_state(int state) } } + int pcps_opencl_acquisition_cc::general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items __attribute__((unused))) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h index aebc73ef8..00a52b89a 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h @@ -51,14 +51,14 @@ #ifndef GNSS_SDR_PCPS_OPENCL_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_OPENCL_ACQUISITION_CC_H_ -#include -#include -#include +#include "gnss_synchro.h" +#include "opencl/fft_internal.h" #include #include #include -#include "opencl/fft_internal.h" -#include "gnss_synchro.h" +#include +#include +#include #ifdef __APPLE__ #include "opencl/cl.hpp" diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc index 8ada10c1f..632fd6d87 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc @@ -45,9 +45,13 @@ notch_sptr make_notch_filter(float pfa, float p_c_factor, } -Notch::Notch(float pfa, float p_c_factor, int length_, int n_segments_est, int n_segments_reset) : gr::block("Notch", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) +Notch::Notch(float pfa, + float p_c_factor, + int length_, + int n_segments_est, + int n_segments_reset) : gr::block("Notch", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { const int alignment_multiple = volk_get_alignment() / sizeof(gr_complex); set_alignment(std::max(1, alignment_multiple)); @@ -79,6 +83,7 @@ Notch::~Notch() volk_free(power_spect); } + void Notch::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { for (unsigned int aux = 0; aux < ninput_items_required.size(); aux++) @@ -87,6 +92,7 @@ void Notch::forecast(int noutput_items __attribute__((unused)), gr_vector_int &n } } + int Notch::general_work(int noutput_items, gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc index e55cc0e29..82d5f5304 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc @@ -43,9 +43,15 @@ notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int length_, return notch_lite_sptr(new NotchLite(p_c_factor, pfa, length_, n_segments_est, n_segments_reset, n_segments_coeff)); } -NotchLite::NotchLite(float p_c_factor, float pfa, int length_, int n_segments_est, int n_segments_reset, int n_segments_coeff) : gr::block("NotchLite", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) + +NotchLite::NotchLite(float p_c_factor, + float pfa, + int length_, + int n_segments_est, + int n_segments_reset, + int n_segments_coeff) : gr::block("NotchLite", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { const int alignment_multiple = volk_get_alignment() / sizeof(gr_complex); set_alignment(std::max(1, alignment_multiple)); @@ -74,11 +80,13 @@ NotchLite::NotchLite(float p_c_factor, float pfa, int length_, int n_segments_es d_fft = std::unique_ptr(new gr::fft::fft_complex(length_, true)); } + NotchLite::~NotchLite() { volk_free(power_spect); } + void NotchLite::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { for (unsigned int aux = 0; aux < ninput_items_required.size(); aux++) @@ -87,6 +95,7 @@ void NotchLite::forecast(int noutput_items __attribute__((unused)), gr_vector_in } } + int NotchLite::general_work(int noutput_items, gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { diff --git a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc index 1a6a0828e..a59d5c2be 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc @@ -44,9 +44,12 @@ pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int length_, } -pulse_blanking_cc::pulse_blanking_cc(float pfa, int length_, int n_segments_est, int n_segments_reset) : gr::block("pulse_blanking_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))) +pulse_blanking_cc::pulse_blanking_cc(float pfa, + int length_, + int n_segments_est, + int n_segments_reset) : gr::block("pulse_blanking_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { const int alignment_multiple = volk_get_alignment() / sizeof(gr_complex); set_alignment(std::max(1, alignment_multiple)); @@ -73,6 +76,7 @@ pulse_blanking_cc::~pulse_blanking_cc() volk_free(zeros_); } + void pulse_blanking_cc::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { for (unsigned int aux = 0; aux < ninput_items_required.size(); aux++) @@ -81,6 +85,7 @@ void pulse_blanking_cc::forecast(int noutput_items __attribute__((unused)), gr_v } } + int pulse_blanking_cc::general_work(int noutput_items, gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc index 9a053b46d..f51a9d45c 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc @@ -49,13 +49,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), - d_history(1) + 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), + d_history(1) { const double two_32 = 4294967296.0; // Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296 diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc index b238a7c0d..b7eb65691 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc @@ -49,7 +49,13 @@ 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), d_history(1) + 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), + d_history(1) { // Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296 const double two_32 = 4294967296.0; diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc index 8e7f32d80..32eb06241 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc @@ -48,13 +48,13 @@ 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), - d_history(1) + 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), + d_history(1) { const double two_32 = 4294967296.0; // Computes the phase step multiplying the resampling ratio by 2^32 = 4294967296 diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc index bfb1eb48a..848059434 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc @@ -56,32 +56,41 @@ signal_make_generator_c(std::vector signal1, std::vector signal1, std::vector system, const std::vector &PRN, - const std::vector &CN0_dB, const std::vector &doppler_Hz, - const std::vector &delay_chips, const std::vector &delay_sec, bool data_flag, bool noise_flag, - unsigned int fs_in, unsigned int vector_length, float BW_BB) : gr::block("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex) * vector_length)), - signal_(signal1), - system_(system), - PRN_(PRN), - CN0_dB_(CN0_dB), - doppler_Hz_(doppler_Hz), - delay_chips_(delay_chips), - delay_sec_(delay_sec), - data_flag_(data_flag), - noise_flag_(noise_flag), - fs_in_(fs_in), - num_sats_(PRN.size()), - vector_length_(vector_length), - BW_BB_(BW_BB * static_cast(fs_in) / 2.0) +signal_generator_c::signal_generator_c(std::vector signal1, + std::vector system, + const std::vector &PRN, + const std::vector &CN0_dB, + const std::vector &doppler_Hz, + const std::vector &delay_chips, + const std::vector &delay_sec, + bool data_flag, + bool noise_flag, + unsigned int fs_in, + unsigned int vector_length, + float BW_BB) : gr::block("signal_gen_cc", gr::io_signature::make(0, 0, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(gr_complex) * vector_length)), + signal_(signal1), + system_(system), + PRN_(PRN), + CN0_dB_(CN0_dB), + doppler_Hz_(doppler_Hz), + delay_chips_(delay_chips), + delay_sec_(delay_sec), + data_flag_(data_flag), + noise_flag_(noise_flag), + fs_in_(fs_in), + num_sats_(PRN.size()), + vector_length_(vector_length), + BW_BB_(BW_BB * static_cast(fs_in) / 2.0) { init(); generate_codes(); } + void signal_generator_c::init() { work_counter_ = 0; diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc index 118734dde..634b79cff 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc @@ -6,9 +6,6 @@ * ------------------------------------------------------------------------- * * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -52,9 +49,10 @@ std::string labsat23_source::generate_filename() } -labsat23_source::labsat23_source(const char *signal_file_basename, int channel_selector) : gr::block("labsat23_source", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(1, 1, sizeof(gr_complex))) +labsat23_source::labsat23_source(const char *signal_file_basename, + int channel_selector) : gr::block("labsat23_source", + gr::io_signature::make(0, 0, 0), + gr::io_signature::make(1, 1, sizeof(gr_complex))) { if (channel_selector < 1 or channel_selector > 2) { From 7832c4f1e56e7a1ef8ea499eb40aa91eb6638d5d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 18:19:57 +0200 Subject: [PATCH 37/39] Update Armadillo version to 8.500.0 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 270eaf8d5..ddb36c7c9 100644 --- a/README.md +++ b/README.md @@ -185,9 +185,9 @@ or manually as explained below, and then please follow instructions on how to [d $ sudo apt-get install libopenblas-dev liblapack-dev # For Debian/Ubuntu/LinuxMint $ sudo yum install lapack-devel blas-devel # For Fedora/CentOS/RHEL $ sudo zypper install lapack-devel blas-devel # For OpenSUSE -$ wget http://sourceforge.net/projects/arma/files/armadillo-8.200.2.tar.xz -$ tar xvfz armadillo-8.200.2.tar.xz -$ cd armadillo-8.200.2 +$ wget http://sourceforge.net/projects/arma/files/armadillo-8.500.0.tar.xz +$ tar xvfz armadillo-8.500.0.tar.xz +$ cd armadillo-8.500.0 $ cmake . $ make $ sudo make install From 627848458eb3ec65a15184b6b5adf61b3f41f03f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 29 Apr 2018 19:23:46 +0200 Subject: [PATCH 38/39] Remove unused variable --- src/core/receiver/gnss_flowgraph.cc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 3303d15b6..532aaaf15 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -772,15 +772,6 @@ void GNSSFlowgraph::set_signals_list() // Set a sequential list of GNSS satellites std::set::const_iterator available_gnss_prn_iter; - // Read GNSS systems and signals - unsigned int total_channels = configuration_->property("Channels_1C.count", 0) + - configuration_->property("Channels_1B.count", 0) + - configuration_->property("Channels_1G.count", 0) + - configuration_->property("Channels_2S.count", 0) + - configuration_->property("Channels_2G.count", 0) + - configuration_->property("Channels_5X.count", 0) + - configuration_->property("Channels_L5.count", 0); - // Create the lists of GNSS satellites std::set available_gps_prn = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, From 4433c0c6bea86801c857a7503425a88c2341388a Mon Sep 17 00:00:00 2001 From: mmajoral Date: Mon, 30 Apr 2018 11:59:56 +0200 Subject: [PATCH 39/39] Minor code cleaning. --- .../gps_l1_ca_pcps_acquisition_fpga.cc | 40 +++++++++---------- .../gps_l1_ca_pcps_acquisition_fpga.h | 9 +---- .../gnuradio_blocks/pcps_acquisition_fpga.cc | 13 +++--- .../gnuradio_blocks/pcps_acquisition_fpga.h | 7 +--- .../acquisition/libs/fpga_acquisition.cc | 37 +++++++++++------ 5 files changed, 52 insertions(+), 54 deletions(-) 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 f585fdbc0..455fac062 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 @@ -1,4 +1,3 @@ - /*! * \file gps_l1_ca_pcps_acquisition_fpga.cc * \brief Adapts a PCPS acquisition block to an FPGA AcquisitionInterface @@ -59,21 +58,21 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( DLOG(INFO) << "role " << role; long 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_; - if_ = configuration_->property(role + ".if", 0); - acq_parameters.freq = if_; + long fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + acq_parameters.fs_in = fs_in; + long ifreq = configuration_->property(role + ".if", 0); + acq_parameters.freq = ifreq; 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_; - code_length_ = static_cast(std::round(static_cast(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); + unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); + acq_parameters.sampled_ms = sampled_ms; + unsigned int code_length = static_cast(std::round(static_cast(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); // The FPGA can only use FFT lengths that are a power of two. - float nbits = ceilf(log2f((float) code_length_)); + float nbits = ceilf(log2f((float) code_length)); unsigned int nsamples_total = pow(2, nbits); - vector_length_ = nsamples_total * sampled_ms_; + unsigned int vector_length = nsamples_total * sampled_ms; unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga",0); acq_parameters.select_queue_Fpga = select_queue_Fpga; std::string default_device_name = "/dev/uio0"; @@ -85,20 +84,18 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( // compute all the GPS L1 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) - // Direct FFT - gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length_, true); - // allocate memory to compute all the PRNs - // and compute all the possible codes + gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT + // 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 gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - d_all_fft_codes = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 + d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 float max; // temporary maxima search for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) { - gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in_, 0); // generate PRN code + gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in, 0); // generate PRN code // fill in zero padding - for (int s=code_length_;s(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), + d_all_fft_codes_[i + nsamples_total * (PRN -1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)), static_cast(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max))); } } - acq_parameters.all_fft_codes = d_all_fft_codes; //acq_parameters + + acq_parameters.all_fft_codes = d_all_fft_codes_; + // temporary buffers that we can delete delete[] code; delete fft_if; @@ -144,8 +143,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( GpsL1CaPcpsAcquisitionFpga::~GpsL1CaPcpsAcquisitionFpga() { - //delete[] code_; - delete[] d_all_fft_codes; + delete[] d_all_fft_codes_; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index d65e677e7..642e9bf8e 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -37,10 +37,10 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ +#include #include "acquisition_interface.h" #include "gnss_synchro.h" #include "pcps_acquisition_fpga.h" -#include class ConfigurationInterface; @@ -137,19 +137,14 @@ public: private: ConfigurationInterface* configuration_; pcps_acquisition_fpga_sptr acquisition_fpga_; - unsigned int vector_length_; - unsigned int code_length_; unsigned int channel_; unsigned int doppler_max_; unsigned int doppler_step_; - unsigned int sampled_ms_; - long fs_in_; - long if_; Gnss_Synchro* gnss_synchro_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; - lv_16sc_t *d_all_fft_codes; // memory that contains all the code ffts + lv_16sc_t *d_all_fft_codes_; // memory that contains all the code ffts }; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc index 4f21ffa7a..6a337925e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -38,11 +38,10 @@ * ------------------------------------------------------------------------- */ -#include "pcps_acquisition_fpga.h" -#include "GPS_L1_CA.h" // for GPS_TWO_PI -#include "GLONASS_L1_L2_CA.h" // for GLONASS_TWO_PI" + #include #include +#include "pcps_acquisition_fpga.h" using google::LogMessage; @@ -175,12 +174,10 @@ void pcps_acquisition_fpga::set_active(bool active) // initialize acquisition algorithm uint32_t indext = 0; float magt = 0.0; - int effective_fft_size = d_fft_size; float fft_normalization_factor = static_cast(d_fft_size) * static_cast(d_fft_size); d_input_power = 0.0; d_mag = 0.0; - //d_well_count++; DLOG(INFO) << "Channel: " << d_channel << " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN @@ -208,9 +205,9 @@ void pcps_acquisition_fpga::set_active(bool active) { d_mag = magt; - input_power_all = d_input_power / (effective_fft_size - 1); - input_power_computed = (d_input_power - d_mag) / (effective_fft_size - 1); - d_input_power = (d_input_power - d_mag) / (effective_fft_size - 1); + input_power_all = d_input_power / (d_fft_size - 1); + input_power_computed = (d_input_power - d_mag) / (d_fft_size - 1); + d_input_power = (d_input_power - d_mag) / (d_fft_size - 1); d_gnss_synchro->Acq_delay_samples = static_cast(indext % acq_parameters.samples_per_code); d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h index d140f538c..3014a278a 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h @@ -56,9 +56,10 @@ #ifndef GNSS_SDR_PCPS_ACQUISITION_FPGA_H_ #define GNSS_SDR_PCPS_ACQUISITION_FPGA_H_ -#include "gnss_synchro.h" + #include #include "fpga_acquisition.h" +#include "gnss_synchro.h" typedef struct { @@ -69,10 +70,8 @@ typedef struct long fs_in; int samples_per_ms; int samples_per_code; - std::string dump_filename; unsigned int select_queue_Fpga; std::string device_name; - unsigned int code_length; lv_16sc_t *all_fft_codes; // memory that contains all the code ffts } pcpsconf_fpga_t; @@ -118,8 +117,6 @@ private: Gnss_Synchro* d_gnss_synchro; std::shared_ptr acquisition_fpga; - - public: ~pcps_acquisition_fpga(); diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.cc b/src/algorithms/acquisition/libs/fpga_acquisition.cc index 213183ba5..82f22e050 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.cc +++ b/src/algorithms/acquisition/libs/fpga_acquisition.cc @@ -33,9 +33,6 @@ * ------------------------------------------------------------------------- */ -#include "fpga_acquisition.h" -#include "gps_sdr_signal_processing.h" - // libraries used by the GIPO #include #include @@ -46,9 +43,23 @@ // GPS L1 #include "GPS_L1_CA.h" -#define PAGE_SIZE 0x10000 -#define MAX_PHASE_STEP_RAD 0.999999999534339 // 1 - pow(2,-31); -#define TEST_REG_SANITY_CHECK 0x55AA +#include "fpga_acquisition.h" +#include "gps_sdr_signal_processing.h" + +#define PAGE_SIZE 0x10000 // default page size for the multicorrelator memory map +#define MAX_PHASE_STEP_RAD 0.999999999534339 // 1 - pow(2,-31); +#define RESET_ACQUISITION 2 // command to reset the multicorrelator +#define LAUNCH_ACQUISITION 1 // command to launch the multicorrelator +#define TEST_REG_SANITY_CHECK 0x55AA // value to check the presence of the test register (to detect the hw) +#define LOCAL_CODE_CLEAR_MEM 0x10000000 // command to clear the internal memory of the multicorrelator +#define MEM_LOCAL_CODE_WR_ENABLE 0x0C000000 // command to enable the ENA and WR pins of the internal memory of the multicorrelator +#define POW_2_2 4 // 2^2 (used for the conversion of floating point numbers to integers) +#define POW_2_29 536870912 // 2^29 (used for the conversion of floating point numbers to integers) +#define SELECT_LSB 0x00FF // value to select the least significant byte +#define SELECT_MSB 0XFF00 // value to select the most significant byte +#define SELECT_16_BITS 0xFFFF // value to select 16 bits +#define SHL_8_BITS 256 // value used to shift a value 8 bits to the left + bool fpga_acquisition::init() { @@ -144,14 +155,14 @@ void fpga_acquisition::fpga_configure_acquisition_local_code(lv_16sc_t fft_local unsigned int k, tmp, tmp2; unsigned int fft_data; // clear memory address counter - d_map_base[4] = 0x10000000; + d_map_base[4] = LOCAL_CODE_CLEAR_MEM; // write local code for (k = 0; k < d_vector_length; k++) { tmp = fft_local_code[k].real(); tmp2 = fft_local_code[k].imag(); - local_code = (tmp & 0xFF) | ((tmp2 * 256) & 0xFF00); // put together the real part and the imaginary part - fft_data = 0x0C000000 | (local_code & 0xFFFF); + local_code = (tmp & SELECT_LSB) | ((tmp2 * SHL_8_BITS) & SELECT_MSB); // put together the real part and the imaginary part + fft_data = MEM_LOCAL_CODE_WR_ENABLE | (local_code & SELECT_16_BITS); d_map_base[4] = fft_data; } } @@ -162,7 +173,7 @@ void fpga_acquisition::run_acquisition(void) int reenable = 1; write(d_fd, reinterpret_cast(&reenable), sizeof(int)); // launch the acquisition process - d_map_base[6] = 1; // writing anything to reg 6 launches the acquisition process + d_map_base[6] = LAUNCH_ACQUISITION; // writing anything to reg 6 launches the acquisition process int irq_count; ssize_t nb; @@ -201,8 +212,8 @@ void fpga_acquisition::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 * POW_2_2; // * 2^2 + phase_step_rad_int = (int32_t) (phase_step_rad_int_temp * (POW_2_29)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings d_map_base[3] = phase_step_rad_int; } @@ -243,5 +254,5 @@ void fpga_acquisition::close_device() void fpga_acquisition::reset_acquisition(void) { - d_map_base[6] = 2; // writing a 2 to d_map_base[6] resets the multicorrelator + d_map_base[6] = RESET_ACQUISITION; // writing a 2 to d_map_base[6] resets the multicorrelator }