mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +00:00 
			
		
		
		
	replaced int and unsigned int by int32_t and uint32_t
removed some unused variables
This commit is contained in:
		| @@ -75,20 +75,19 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     acq_parameters.doppler_max = doppler_max_; | ||||
|     unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 4); | ||||
|     uint32_t sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 4); | ||||
|     acq_parameters.sampled_ms = sampled_ms; | ||||
|  | ||||
|     acquire_pilot_ = configuration_->property(role + ".acquire_pilot", false);  //will be true in future versions | ||||
|  | ||||
|     //--- Find number of samples per spreading code (4 ms)  ----------------- | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); | ||||
|     auto code_length = static_cast<uint32_t>(std::round(static_cast<double>(fs_in) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); | ||||
|  | ||||
|     acq_parameters.code_length = code_length; | ||||
|     // The FPGA can only use FFT lengths that are a power of two. | ||||
|     float nbits = ceilf(log2f((float)code_length*2)); | ||||
|     unsigned int nsamples_total = pow(2, nbits); | ||||
|     unsigned int vector_length = nsamples_total; | ||||
|     unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 0); | ||||
|     uint32_t nsamples_total = pow(2, nbits); | ||||
|     uint32_t 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"; | ||||
| @@ -96,7 +95,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|     acq_parameters.device_name = device_name; | ||||
|     acq_parameters.samples_per_ms = nsamples_total / sampled_ms; | ||||
|     acq_parameters.samples_per_code = nsamples_total; | ||||
|     acq_parameters.excludelimit = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / GALILEO_E1_CODE_CHIP_RATE_HZ)); | ||||
|     acq_parameters.excludelimit = static_cast<uint32_t>(std::round(static_cast<double>(fs_in) / GALILEO_E1_CODE_CHIP_RATE_HZ)); | ||||
|  | ||||
|     // compute all the GALILEO E1 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time | ||||
|     // a channel is assigned) | ||||
| @@ -106,7 +105,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|     d_all_fft_codes_ = new lv_16sc_t[nsamples_total * GALILEO_E1_NUMBER_OF_CODES];  // memory containing all the possible fft codes for PRN 0 to 32 | ||||
|     float max;                                                                      // temporary maxima search | ||||
|  | ||||
|     for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++) | ||||
|     for (uint32_t PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++) | ||||
|         { | ||||
|  | ||||
|         bool cboc = false; // cboc is set to 0 when using the FPGA | ||||
| @@ -125,14 +124,14 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|                     cboc, PRN, fs_in, 0, false); | ||||
|             } | ||||
|  | ||||
|         for (int s = code_length; s < 2*code_length; s++) | ||||
|         for (uint32_t s = code_length; s < 2*code_length; s++) | ||||
|             { | ||||
|                 code[s] = code[s - code_length]; | ||||
|             } | ||||
|  | ||||
|  | ||||
|         // fill in zero padding | ||||
|         for (int s = 2*code_length; s < nsamples_total; s++) | ||||
|         for (uint32_t s = 2*code_length; s < nsamples_total; s++) | ||||
|             { | ||||
|                 code[s] = std::complex<float>(static_cast<float>(0,0)); | ||||
|             } | ||||
| @@ -143,7 +142,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|  | ||||
|         // normalize the code | ||||
|         max = 0;                                                                           // initialize maximum value | ||||
|         for (unsigned int i = 0; i < nsamples_total; i++)                                  // search for maxima | ||||
|         for (uint32_t i = 0; i < nsamples_total; i++)                                  // search for maxima | ||||
|             { | ||||
|                 if (std::abs(fft_codes_padded[i].real()) > max) | ||||
|                     { | ||||
| @@ -154,10 +153,10 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|                         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 | ||||
|         for (uint32_t 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<int>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)), | ||||
|                     static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max))); | ||||
|                 d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int32_t>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)), | ||||
|                     static_cast<int32_t>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max))); | ||||
|             } | ||||
|  | ||||
|         } | ||||
|   | ||||
| @@ -151,10 +151,10 @@ private: | ||||
|     bool bit_transition_flag_; | ||||
|     bool use_CFAR_algorithm_flag_; | ||||
|     bool acquire_pilot_; | ||||
|     unsigned int channel_; | ||||
|     unsigned int doppler_max_; | ||||
|     unsigned int doppler_step_; | ||||
|     unsigned int max_dwells_; | ||||
|     uint32_t channel_; | ||||
|     uint32_t doppler_max_; | ||||
|     uint32_t doppler_step_; | ||||
|     uint32_t max_dwells_; | ||||
|     bool dump_; | ||||
|     bool blocking_; | ||||
|     std::string dump_filename_; | ||||
|   | ||||
| @@ -68,7 +68,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     acq_parameters.doppler_max = doppler_max_; | ||||
|  | ||||
|     unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|     uint32_t sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|     acq_parameters.sampled_ms = sampled_ms; | ||||
|  | ||||
|     acq_pilot_ = configuration_->property(role + ".acquire_pilot", false); | ||||
| @@ -78,14 +78,13 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|             acq_pilot_ = false; | ||||
|         } | ||||
|  | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS))); | ||||
|     auto code_length = static_cast<uint32_t>(std::round(static_cast<double>(fs_in) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast<double>(GALILEO_E5A_CODE_LENGTH_CHIPS))); | ||||
|     acq_parameters.code_length = code_length; | ||||
|  | ||||
|     // The FPGA can only use FFT lengths that are a power of two. | ||||
|     float nbits = ceilf(log2f((float)code_length*2)); | ||||
|     unsigned int nsamples_total = pow(2, nbits); | ||||
|     unsigned int vector_length = nsamples_total; | ||||
|     unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 1); | ||||
|     uint32_t nsamples_total = pow(2, nbits); | ||||
|     uint32_t select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 1); | ||||
|     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); | ||||
| @@ -93,7 +92,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|     acq_parameters.samples_per_ms = nsamples_total / sampled_ms; | ||||
|     acq_parameters.samples_per_code = nsamples_total; | ||||
|  | ||||
|     acq_parameters.excludelimit = static_cast<unsigned int>(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); | ||||
|     acq_parameters.excludelimit = static_cast<uint32_t>(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); | ||||
|  | ||||
|     // compute all the GALILEO E5 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time | ||||
|     // a channel is assigned) | ||||
| @@ -103,7 +102,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|     d_all_fft_codes_ = new lv_16sc_t[nsamples_total * GALILEO_E5A_NUMBER_OF_CODES];  // memory containing all the possible fft codes for PRN 0 to 32 | ||||
|     float max;                                                                       // temporary maxima search | ||||
|  | ||||
|     for (unsigned int PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++) | ||||
|     for (uint32_t PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++) | ||||
|         { | ||||
|             char signal_[3]; | ||||
|  | ||||
| @@ -123,13 +122,13 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|  | ||||
|             galileo_e5_a_code_gen_complex_sampled(code, signal_, PRN, fs_in, 0); | ||||
|  | ||||
|             for (int s = code_length; s < 2*code_length; s++) | ||||
|             for (uint32_t s = code_length; s < 2*code_length; s++) | ||||
|                 { | ||||
|                     code[s] = code[s - code_length]; | ||||
|                 } | ||||
|  | ||||
|             // fill in zero padding | ||||
|             for (int s = 2*code_length; s < nsamples_total; s++) | ||||
|             for (uint32_t s = 2*code_length; s < nsamples_total; s++) | ||||
|                 { | ||||
|                     code[s] = std::complex<float>(0.0, 0.0); | ||||
|                 } | ||||
| @@ -139,7 +138,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|             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 | ||||
|             for (uint32_t i = 0; i < nsamples_total; i++)  // search for maxima | ||||
|                 { | ||||
|                     if (std::abs(fft_codes_padded[i].real()) > max) | ||||
|                         { | ||||
| @@ -150,10 +149,10 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|                             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 | ||||
|             for (uint32_t 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<int>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)), | ||||
|                         static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max))); | ||||
|                     d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int32_t>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)), | ||||
|                         static_cast<int32_t>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max))); | ||||
|                 } | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -164,13 +164,13 @@ private: | ||||
|     bool blocking_; | ||||
|     bool acq_iq_; | ||||
|  | ||||
|     unsigned int vector_length_; | ||||
|     unsigned int code_length_; | ||||
|     unsigned int channel_; | ||||
|     unsigned int doppler_max_; | ||||
|     unsigned int doppler_step_; | ||||
|     unsigned int sampled_ms_; | ||||
|     unsigned int max_dwells_; | ||||
|     uint32_t vector_length_; | ||||
|     uint32_t code_length_; | ||||
|     uint32_t channel_; | ||||
|     uint32_t doppler_max_; | ||||
|     uint32_t doppler_step_; | ||||
|     uint32_t sampled_ms_; | ||||
|     uint32_t max_dwells_; | ||||
|     unsigned int in_streams_; | ||||
|     unsigned int out_streams_; | ||||
|  | ||||
|   | ||||
| @@ -75,53 +75,51 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( | ||||
|     doppler_max_ = configuration_->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     acq_parameters.doppler_max = doppler_max_; | ||||
|     unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|     uint32_t sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|     acq_parameters.sampled_ms = sampled_ms; | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); | ||||
|     auto code_length = static_cast<uint32_t>(std::round(static_cast<double>(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); | ||||
|     acq_parameters.code_length = code_length; | ||||
|     // The FPGA can only use FFT lengths that are a power of two. | ||||
|     float nbits = ceilf(log2f((float)code_length*2)); | ||||
|     unsigned int nsamples_total = pow(2, nbits); | ||||
|     unsigned int vector_length = nsamples_total; | ||||
|     unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 0); | ||||
|     uint32_t nsamples_total = pow(2, nbits); | ||||
|     uint32_t 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 / sampled_ms; | ||||
|     acq_parameters.samples_per_code = nsamples_total; | ||||
|     acq_parameters.excludelimit = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / GPS_L1_CA_CODE_RATE_HZ)); | ||||
|     acq_parameters.excludelimit = static_cast<uint32_t>(std::round(static_cast<double>(fs_in) / GPS_L1_CA_CODE_RATE_HZ)); | ||||
|  | ||||
|     // 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) | ||||
|     auto* fft_if = new gr::fft::fft_complex(vector_length, true);  // Direct FFT | ||||
|     auto* fft_if = new gr::fft::fft_complex(nsamples_total, true);  // Direct FFT | ||||
|     // allocate memory to compute all the PRNs and compute all the possible codes | ||||
|     auto* code = new std::complex<float>[nsamples_total];  // buffer for the local code | ||||
|     auto* fft_codes_padded = static_cast<gr_complex*>(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++) | ||||
|     for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++) | ||||
|         { | ||||
|             gps_l1_ca_code_gen_complex_sampled(code, PRN, fs_in, 0);  // generate PRN code | ||||
|              | ||||
|             for (int s = code_length; s < 2*code_length; s++) | ||||
|             for (uint32_t s = code_length; s < 2*code_length; s++) | ||||
|                 { | ||||
|                     code[s] = code[s - code_length]; | ||||
|                 } | ||||
|  | ||||
|             // fill in zero padding | ||||
|             for (int s = 2*code_length; s < nsamples_total; s++) | ||||
|             for (uint32_t s = 2*code_length; s < nsamples_total; s++) | ||||
|                 { | ||||
|                     code[s] = std::complex<float>(0.0, 0.0); | ||||
|                 } | ||||
|  | ||||
|             int offset = 0; | ||||
|             memcpy(fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * nsamples_total);   // copy to FFT buffer | ||||
|             memcpy(fft_if->get_inbuf(), 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 | ||||
|             for (uint32_t i = 0; i < nsamples_total; i++)  // search for maxima | ||||
|                 { | ||||
|                     if (std::abs(fft_codes_padded[i].real()) > max) | ||||
|                         { | ||||
| @@ -132,10 +130,10 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( | ||||
|                             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 | ||||
|             for (uint32_t 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<int>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)), | ||||
|                         static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max))); | ||||
|                     d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int32_t>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)), | ||||
|                         static_cast<int32_t>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max))); | ||||
|                 } | ||||
|  | ||||
|         } | ||||
|   | ||||
| @@ -145,9 +145,9 @@ public: | ||||
| private: | ||||
|     ConfigurationInterface* configuration_; | ||||
|     pcps_acquisition_fpga_sptr acquisition_fpga_; | ||||
|     unsigned int channel_; | ||||
|     unsigned int doppler_max_; | ||||
|     unsigned int doppler_step_; | ||||
|     uint32_t channel_; | ||||
|     uint32_t doppler_max_; | ||||
|     uint32_t doppler_step_; | ||||
|     Gnss_Synchro* gnss_synchro_; | ||||
|     std::string role_; | ||||
|     unsigned int in_streams_; | ||||
|   | ||||
| @@ -72,17 +72,16 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | ||||
|     doppler_max_ = configuration->property(role + ".doppler_max", 5000); | ||||
|     if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; | ||||
|     acq_parameters.doppler_max = doppler_max_; | ||||
|     unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|     uint32_t sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|     acq_parameters.sampled_ms = sampled_ms; | ||||
|  | ||||
|     //--- Find number of samples per spreading code ------------------------- | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5I_CODE_RATE_HZ / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS)))); | ||||
|     auto code_length = static_cast<uint32_t>(std::round(static_cast<double>(fs_in) / (GPS_L5I_CODE_RATE_HZ / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS)))); | ||||
|     acq_parameters.code_length = code_length; | ||||
|     // The FPGA can only use FFT lengths that are a power of two. | ||||
|     float nbits = ceilf(log2f((float)code_length*2)); | ||||
|     unsigned int nsamples_total = pow(2, nbits); | ||||
|     unsigned int vector_length = nsamples_total; | ||||
|     unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 1); | ||||
|     uint32_t nsamples_total = pow(2, nbits); | ||||
|     uint32_t select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 1); | ||||
|     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); | ||||
| @@ -90,7 +89,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | ||||
|     acq_parameters.samples_per_ms = nsamples_total/sampled_ms; | ||||
|     acq_parameters.samples_per_code = nsamples_total; | ||||
|  | ||||
|     acq_parameters.excludelimit = static_cast<unsigned int>(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); | ||||
|     acq_parameters.excludelimit = static_cast<uint32_t>(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast<float>(acq_parameters.fs_in))); | ||||
|  | ||||
|     // compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time | ||||
|     // a channel is assigned) | ||||
| @@ -100,16 +99,16 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | ||||
|     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++) | ||||
|     for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++) | ||||
|     { | ||||
|     	gps_l5i_code_gen_complex_sampled(code, PRN, fs_in); | ||||
|  | ||||
|         for (int s = code_length; s < 2*code_length; s++) | ||||
|         for (uint32_t s = code_length; s < 2*code_length; s++) | ||||
|             { | ||||
|                 code[s] = code[s - code_length]; | ||||
|             } | ||||
|  | ||||
|         for (int s = 2*code_length; s < nsamples_total; s++) | ||||
|         for (uint32_t s = 2*code_length; s < nsamples_total; s++) | ||||
|             { | ||||
|         		// fill in zero padding | ||||
|                 code[s] = std::complex<float>(static_cast<float>(0,0)); | ||||
| @@ -119,7 +118,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | ||||
| 		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 | ||||
|         for (uint32_t i = 0; i < nsamples_total; i++)                                  // search for maxima | ||||
|             { | ||||
|                 if (std::abs(fft_codes_padded[i].real()) > max) | ||||
|                     { | ||||
| @@ -130,10 +129,10 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | ||||
|                         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 | ||||
|         for (uint32_t 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<int>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)), | ||||
|                     static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max))); | ||||
|                 d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int32_t>(floor(fft_codes_padded[i].real() * (pow(2, 9) - 1) / max)), | ||||
|                     static_cast<int32_t>(floor(fft_codes_padded[i].imag() * (pow(2, 9) - 1) / max))); | ||||
|             } | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -151,15 +151,15 @@ private: | ||||
|     complex_byte_to_float_x2_sptr cbyte_to_float_x2_; | ||||
|     size_t item_size_; | ||||
|     std::string item_type_; | ||||
|     unsigned int vector_length_; | ||||
|     unsigned int code_length_; | ||||
|     uint32_t vector_length_; | ||||
|     uint32_t code_length_; | ||||
|     bool bit_transition_flag_; | ||||
|     bool use_CFAR_algorithm_flag_; | ||||
|     unsigned int channel_; | ||||
|     uint32_t channel_; | ||||
|     float threshold_; | ||||
|     unsigned int doppler_max_; | ||||
|     unsigned int doppler_step_; | ||||
|     unsigned int max_dwells_; | ||||
|     uint32_t doppler_max_; | ||||
|     uint32_t doppler_step_; | ||||
|     uint32_t max_dwells_; | ||||
|     int64_t fs_in_; | ||||
|     bool dump_; | ||||
|     bool blocking_; | ||||
|   | ||||
| @@ -109,7 +109,7 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura | ||||
|     // turn switch to A/D position | ||||
|     std::string default_device_name = "/dev/uio1"; | ||||
|     std::string device_name = configuration->property(role + ".devicename", default_device_name); | ||||
|     int switch_position = configuration->property(role + ".switch_position", 0); | ||||
|     int32_t switch_position = configuration->property(role + ".switch_position", 0); | ||||
|     switch_fpga = std::make_shared<Fpga_Switch>(device_name); | ||||
|     switch_fpga->set_switch_position(switch_position); | ||||
|     if (in_stream_ > 0) | ||||
|   | ||||
| @@ -43,7 +43,7 @@ | ||||
|  | ||||
| // constants | ||||
| const size_t PAGE_SIZE = 0x10000; | ||||
| const unsigned int TEST_REGISTER_TRACK_WRITEVAL = 0x55AA; | ||||
| const uint32_t TEST_REGISTER_TRACK_WRITEVAL = 0x55AA; | ||||
|  | ||||
| Fpga_Switch::Fpga_Switch(const std::string &device_name) | ||||
| { | ||||
| @@ -87,7 +87,7 @@ Fpga_Switch::~Fpga_Switch() | ||||
| } | ||||
|  | ||||
|  | ||||
| void Fpga_Switch::set_switch_position(int switch_position) | ||||
| void Fpga_Switch::set_switch_position(int32_t switch_position) | ||||
| { | ||||
|     d_map_base[0] = switch_position; | ||||
| } | ||||
|   | ||||
| @@ -46,7 +46,7 @@ class Fpga_Switch | ||||
| public: | ||||
|     Fpga_Switch(const std::string& device_name); | ||||
|     ~Fpga_Switch(); | ||||
|     void set_switch_position(int switch_position); | ||||
|     void set_switch_position(int32_t switch_position); | ||||
|  | ||||
| private: | ||||
|     int d_device_descriptor;        // driver descriptor | ||||
|   | ||||
| @@ -58,8 +58,8 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( | ||||
|     //################# CONFIGURATION PARAMETERS ######################## | ||||
|     std::string default_item_type = "gr_complex"; | ||||
|     std::string item_type = configuration->property(role + ".item_type", default_item_type); | ||||
|     int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); | ||||
|     int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); | ||||
|     int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     trk_param_fpga.fs_in = fs_in; | ||||
|     bool dump = configuration->property(role + ".dump", false); | ||||
|     trk_param_fpga.dump = dump; | ||||
| @@ -78,7 +78,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( | ||||
|     trk_param_fpga.pll_bw_narrow_hz = pll_bw_narrow_hz; | ||||
|     float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 0.25); | ||||
|     trk_param_fpga.dll_bw_narrow_hz = dll_bw_narrow_hz; | ||||
|     int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); | ||||
|     int32_t extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); | ||||
|     float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15); | ||||
|     trk_param_fpga.early_late_space_chips = early_late_space_chips; | ||||
|     float very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.6); | ||||
| @@ -105,18 +105,18 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( | ||||
|     trk_param_fpga.track_pilot = track_pilot; | ||||
|     d_track_pilot = track_pilot; | ||||
|     trk_param_fpga.extend_correlation_symbols = extend_correlation_symbols; | ||||
|     int vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); | ||||
|     int32_t vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); | ||||
|     trk_param_fpga.vector_length = vector_length; | ||||
|     trk_param_fpga.system = 'E'; | ||||
|     char sig_[3] = "1B"; | ||||
|     std::memcpy(trk_param_fpga.signal, sig_, 3); | ||||
|     int cn0_samples = configuration->property(role + ".cn0_samples", 20); | ||||
|     int32_t cn0_samples = configuration->property(role + ".cn0_samples", 20); | ||||
|     if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; | ||||
|     trk_param_fpga.cn0_samples = cn0_samples; | ||||
|     int cn0_min = configuration->property(role + ".cn0_min", 25); | ||||
|     int32_t cn0_min = configuration->property(role + ".cn0_min", 25); | ||||
|     if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; | ||||
|     trk_param_fpga.cn0_min = cn0_min; | ||||
|     int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); | ||||
|     int32_t 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_fpga.max_lock_fail = max_lock_fail; | ||||
|     double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); | ||||
| @@ -127,29 +127,29 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( | ||||
|     std::string default_device_name = "/dev/uio"; | ||||
|     std::string device_name = configuration->property(role + ".devicename", default_device_name); | ||||
|     trk_param_fpga.device_name = device_name; | ||||
|     unsigned int device_base = configuration->property(role + ".device_base", 15); | ||||
|     uint32_t device_base = configuration->property(role + ".device_base", 15); | ||||
|     trk_param_fpga.device_base = device_base; | ||||
|     trk_param_fpga.multicorr_type = 1;  // 0 -> 3 correlators, 1 -> 5 correlators | ||||
|  | ||||
|     //################# PRE-COMPUTE ALL THE CODES ################# | ||||
|     unsigned int code_samples_per_chip = 2; | ||||
|     d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); | ||||
|     uint32_t code_samples_per_chip = 2; | ||||
|     d_ca_codes = static_cast<int32_t*>(volk_gnsssdr_malloc(static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
|     float* ca_codes_f; | ||||
|     float* data_codes_f; | ||||
|  | ||||
|  | ||||
|     if (trk_param_fpga.track_pilot) | ||||
|         { | ||||
|             d_data_codes = static_cast<int*>(volk_gnsssdr_malloc((static_cast<unsigned int>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); | ||||
|             d_data_codes = static_cast<int32_t*>(volk_gnsssdr_malloc((static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
|         } | ||||
|     ca_codes_f = static_cast<float*>(volk_gnsssdr_malloc(static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); | ||||
|     ca_codes_f = static_cast<float*>(volk_gnsssdr_malloc(static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); | ||||
|  | ||||
|     if (trk_param_fpga.track_pilot) | ||||
|         { | ||||
|             data_codes_f = static_cast<float*>(volk_gnsssdr_malloc((static_cast<unsigned int>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); | ||||
|             data_codes_f = static_cast<float*>(volk_gnsssdr_malloc((static_cast<uint32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); | ||||
|         } | ||||
|  | ||||
|     for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++) | ||||
|     for (uint32_t PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++) | ||||
|         { | ||||
|             char data_signal[3] = "1B"; | ||||
|             if (trk_param_fpga.track_pilot) | ||||
| @@ -158,19 +158,19 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( | ||||
|                     galileo_e1_code_gen_sinboc11_float(ca_codes_f, pilot_signal, PRN); | ||||
|                     galileo_e1_code_gen_sinboc11_float(data_codes_f, data_signal, PRN); | ||||
|  | ||||
|                     for (unsigned int s = 0; s < 2 * GALILEO_E1_B_CODE_LENGTH_CHIPS; s++) | ||||
|                     for (uint32_t s = 0; s < 2 * GALILEO_E1_B_CODE_LENGTH_CHIPS; s++) | ||||
|                         { | ||||
|                             d_ca_codes[static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]); | ||||
|                             d_data_codes[static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(data_codes_f[s]); | ||||
|                             d_ca_codes[static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int32_t>(ca_codes_f[s]); | ||||
|                             d_data_codes[static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int32_t>(data_codes_f[s]); | ||||
|                         } | ||||
|                 } | ||||
|             else | ||||
|                 { | ||||
|                     galileo_e1_code_gen_sinboc11_float(ca_codes_f, data_signal, PRN); | ||||
|  | ||||
|                     for (unsigned int s = 0; s < 2 * GALILEO_E1_B_CODE_LENGTH_CHIPS; s++) | ||||
|                     for (uint32_t s = 0; s < 2 * GALILEO_E1_B_CODE_LENGTH_CHIPS; s++) | ||||
|                         { | ||||
|                             d_ca_codes[static_cast<int>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int>(ca_codes_f[s]); | ||||
|                             d_ca_codes[static_cast<int32_t>(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast<int32_t>(ca_codes_f[s]); | ||||
|                         } | ||||
|                 } | ||||
|         } | ||||
|   | ||||
| @@ -103,12 +103,12 @@ public: | ||||
| private: | ||||
|     dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc; | ||||
|     size_t item_size_; | ||||
|     unsigned int channel_; | ||||
|     uint32_t channel_; | ||||
|     std::string role_; | ||||
|     unsigned int in_streams_; | ||||
|     unsigned int out_streams_; | ||||
|     int* d_ca_codes; | ||||
|     int* d_data_codes; | ||||
|     uint32_t in_streams_; | ||||
|     uint32_t out_streams_; | ||||
|     int32_t* d_ca_codes; | ||||
|     int32_t* d_data_codes; | ||||
|     bool d_track_pilot; | ||||
| }; | ||||
|  | ||||
|   | ||||
| @@ -61,8 +61,8 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( | ||||
|     //################# CONFIGURATION PARAMETERS ######################## | ||||
|     std::string default_item_type = "gr_complex"; | ||||
|     std::string item_type = configuration->property(role + ".item_type", default_item_type); | ||||
|     int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12000000); | ||||
|     int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12000000); | ||||
|     int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     trk_param_fpga.fs_in = fs_in; | ||||
|     bool dump = configuration->property(role + ".dump", false); | ||||
|     trk_param_fpga.dump = dump; | ||||
| @@ -83,9 +83,9 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( | ||||
|     trk_param_fpga.dll_bw_narrow_hz = dll_bw_narrow_hz; | ||||
|     float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); | ||||
|     trk_param_fpga.early_late_space_chips = early_late_space_chips; | ||||
|     int vector_length = std::round(fs_in / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS)); | ||||
|     int32_t vector_length = std::round(fs_in / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS)); | ||||
|     trk_param_fpga.vector_length = vector_length; | ||||
|     int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); | ||||
|     int32_t extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); | ||||
|     float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15); | ||||
|     trk_param_fpga.early_late_space_narrow_chips = early_late_space_narrow_chips; | ||||
|     bool track_pilot = configuration->property(role + ".track_pilot", false); | ||||
| @@ -111,13 +111,13 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( | ||||
|     trk_param_fpga.system = 'E'; | ||||
|     char sig_[3] = "5X"; | ||||
|     std::memcpy(trk_param_fpga.signal, sig_, 3); | ||||
|     int cn0_samples = configuration->property(role + ".cn0_samples", 20); | ||||
|     int32_t cn0_samples = configuration->property(role + ".cn0_samples", 20); | ||||
|     if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; | ||||
|     trk_param_fpga.cn0_samples = cn0_samples; | ||||
|     int cn0_min = configuration->property(role + ".cn0_min", 25); | ||||
|     int32_t cn0_min = configuration->property(role + ".cn0_min", 25); | ||||
|     if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; | ||||
|     trk_param_fpga.cn0_min = cn0_min; | ||||
|     int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); | ||||
|     int32_t 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_fpga.max_lock_fail = max_lock_fail; | ||||
|     double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); | ||||
| @@ -128,13 +128,13 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( | ||||
|     std::string default_device_name = "/dev/uio"; | ||||
|     std::string device_name = configuration->property(role + ".devicename", default_device_name); | ||||
|     trk_param_fpga.device_name = device_name; | ||||
|     unsigned int device_base = configuration->property(role + ".device_base", 27); | ||||
|     uint32_t device_base = configuration->property(role + ".device_base", 27); | ||||
|     trk_param_fpga.device_base = device_base; | ||||
|     trk_param_fpga.multicorr_type = 1;  // 0 -> 3 correlators, 1 -> up to 5+1 correlators | ||||
|  | ||||
|     //################# PRE-COMPUTE ALL THE CODES ################# | ||||
|     unsigned int code_samples_per_chip = 1; | ||||
|     auto code_length_chips = static_cast<unsigned int>(GALILEO_E5A_CODE_LENGTH_CHIPS); | ||||
|     uint32_t code_samples_per_chip = 1; | ||||
|     auto code_length_chips = static_cast<uint32_t>(GALILEO_E5A_CODE_LENGTH_CHIPS); | ||||
|  | ||||
|     auto *aux_code = static_cast<gr_complex *>(volk_gnsssdr_malloc(sizeof(gr_complex) * code_length_chips * code_samples_per_chip, volk_gnsssdr_get_alignment())); | ||||
|  | ||||
| @@ -147,40 +147,40 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( | ||||
|         } | ||||
|     tracking_code = static_cast<float *>(volk_gnsssdr_malloc(code_samples_per_chip * code_length_chips * sizeof(float), volk_gnsssdr_get_alignment())); | ||||
|  | ||||
|     d_ca_codes = static_cast<int *>(volk_gnsssdr_malloc(static_cast<int>(code_length_chips) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); | ||||
|     d_ca_codes = static_cast<int32_t *>(volk_gnsssdr_malloc(static_cast<int32_t>(code_length_chips) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
|  | ||||
|     if (trk_param_fpga.track_pilot) | ||||
|         { | ||||
|             d_data_codes = static_cast<int *>(volk_gnsssdr_malloc((static_cast<unsigned int>(code_length_chips)) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); | ||||
|             d_data_codes = static_cast<int32_t *>(volk_gnsssdr_malloc((static_cast<uint32_t>(code_length_chips)) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
|         } | ||||
|  | ||||
|  | ||||
|     for (unsigned int PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++) | ||||
|     for (uint32_t PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++) | ||||
|         { | ||||
|             galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast<char *>(sig_)); | ||||
|             if (trk_param_fpga.track_pilot) | ||||
|                 { | ||||
|                     for (unsigned int i = 0; i < code_length_chips; i++) | ||||
|                     for (uint32_t i = 0; i < code_length_chips; i++) | ||||
|                         { | ||||
|                             tracking_code[i] = aux_code[i].imag(); | ||||
|                             data_code[i] = aux_code[i].real(); | ||||
|                         } | ||||
|                     for (unsigned int s = 0; s < code_length_chips; s++) | ||||
|                     for (uint32_t s = 0; s < code_length_chips; s++) | ||||
|                         { | ||||
|                             d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(tracking_code[s]); | ||||
|                             d_data_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(data_code[s]); | ||||
|                             d_ca_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = static_cast<int32_t>(tracking_code[s]); | ||||
|                             d_data_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = static_cast<int32_t>(data_code[s]); | ||||
|                         } | ||||
|                 } | ||||
|             else | ||||
|                 { | ||||
|                     for (unsigned int i = 0; i < code_length_chips; i++) | ||||
|                     for (uint32_t i = 0; i < code_length_chips; i++) | ||||
|                         { | ||||
|                             tracking_code[i] = aux_code[i].real(); | ||||
|                         } | ||||
|  | ||||
|                     for (unsigned int s = 0; s < code_length_chips; s++) | ||||
|                     for (uint32_t s = 0; s < code_length_chips; s++) | ||||
|                         { | ||||
|                             d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(tracking_code[s]); | ||||
|                             d_ca_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = static_cast<int32_t>(tracking_code[s]); | ||||
|                         } | ||||
|                 } | ||||
|         } | ||||
|   | ||||
| @@ -100,14 +100,14 @@ public: | ||||
| private: | ||||
|     dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc; | ||||
|     size_t item_size_; | ||||
|     unsigned int channel_; | ||||
|     uint32_t channel_; | ||||
|     std::string role_; | ||||
|     unsigned int in_streams_; | ||||
|     unsigned int out_streams_; | ||||
|     uint32_t in_streams_; | ||||
|     uint32_t out_streams_; | ||||
|  | ||||
|  | ||||
|     int* d_ca_codes; | ||||
|     int* d_data_codes; | ||||
|     int32_t* d_ca_codes; | ||||
|     int32_t* d_data_codes; | ||||
|     bool d_track_pilot; | ||||
| }; | ||||
|  | ||||
|   | ||||
| @@ -60,8 +60,8 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( | ||||
|     DLOG(INFO) << "role " << role; | ||||
|  | ||||
|     //################# CONFIGURATION PARAMETERS ######################## | ||||
|     int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); | ||||
|     int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); | ||||
|     int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     trk_param_fpga.fs_in = fs_in; | ||||
|     bool dump = configuration->property(role + ".dump", false); | ||||
|     trk_param_fpga.dump = dump; | ||||
| @@ -84,9 +84,9 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( | ||||
|     trk_param_fpga.early_late_space_chips = early_late_space_chips; | ||||
|     float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.5); | ||||
|     trk_param_fpga.early_late_space_narrow_chips = early_late_space_narrow_chips; | ||||
|     int vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); | ||||
|     int32_t vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)); | ||||
|     trk_param_fpga.vector_length = vector_length; | ||||
|     int symbols_extended_correlator = configuration->property(role + ".extend_correlation_symbols", 1); | ||||
|     int32_t symbols_extended_correlator = configuration->property(role + ".extend_correlation_symbols", 1); | ||||
|     if (symbols_extended_correlator < 1) | ||||
|         { | ||||
|             symbols_extended_correlator = 1; | ||||
| @@ -113,13 +113,13 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( | ||||
|     trk_param_fpga.system = 'G'; | ||||
|     char sig_[3] = "1C"; | ||||
|     std::memcpy(trk_param_fpga.signal, sig_, 3); | ||||
|     int cn0_samples = configuration->property(role + ".cn0_samples", 20); | ||||
|     int32_t cn0_samples = configuration->property(role + ".cn0_samples", 20); | ||||
|     if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; | ||||
|     trk_param_fpga.cn0_samples = cn0_samples; | ||||
|     int cn0_min = configuration->property(role + ".cn0_min", 25); | ||||
|     int32_t cn0_min = configuration->property(role + ".cn0_min", 25); | ||||
|     if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; | ||||
|     trk_param_fpga.cn0_min = cn0_min; | ||||
|     int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); | ||||
|     int32_t 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_fpga.max_lock_fail = max_lock_fail; | ||||
|     double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); | ||||
| @@ -130,15 +130,15 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( | ||||
|     std::string default_device_name = "/dev/uio"; | ||||
|     std::string device_name = configuration->property(role + ".devicename", default_device_name); | ||||
|     trk_param_fpga.device_name = device_name; | ||||
|     unsigned int device_base = configuration->property(role + ".device_base", 3); | ||||
|     uint32_t device_base = configuration->property(role + ".device_base", 3); | ||||
|     trk_param_fpga.device_base = device_base; | ||||
|     trk_param_fpga.multicorr_type = 0;  //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators | ||||
|  | ||||
|     //################# PRE-COMPUTE ALL THE CODES ################# | ||||
|     d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L1_CA_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); | ||||
|     for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) | ||||
|     d_ca_codes = static_cast<int32_t*>(volk_gnsssdr_malloc(static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
|     for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++) | ||||
|         { | ||||
|             gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0); | ||||
|             gps_l1_ca_code_gen_int(&d_ca_codes[(int32_t(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0); | ||||
|         } | ||||
|     trk_param_fpga.ca_codes = d_ca_codes; | ||||
|     trk_param_fpga.code_length_chips = GPS_L1_CA_CODE_LENGTH_CHIPS; | ||||
|   | ||||
| @@ -101,11 +101,11 @@ public: | ||||
| private: | ||||
|     dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc; | ||||
|     size_t item_size_; | ||||
|     unsigned int channel_; | ||||
|     uint32_t channel_; | ||||
|     std::string role_; | ||||
|     unsigned int in_streams_; | ||||
|     unsigned int out_streams_; | ||||
|     int* d_ca_codes; | ||||
|     uint32_t in_streams_; | ||||
|     uint32_t out_streams_; | ||||
|     int32_t* d_ca_codes; | ||||
| }; | ||||
|  | ||||
| #endif  // GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H_ | ||||
|   | ||||
| @@ -59,8 +59,8 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( | ||||
|     Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); | ||||
|     DLOG(INFO) << "role " << role; | ||||
|     //################# CONFIGURATION PARAMETERS ######################## | ||||
|     int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12500000); | ||||
|     int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12500000); | ||||
|     int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); | ||||
|     trk_param_fpga.fs_in = fs_in; | ||||
|     bool dump = configuration->property(role + ".dump", false); | ||||
|     trk_param_fpga.dump = dump; | ||||
| @@ -81,9 +81,9 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( | ||||
|     trk_param_fpga.dll_bw_narrow_hz = dll_bw_narrow_hz; | ||||
|     float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); | ||||
|     trk_param_fpga.early_late_space_chips = early_late_space_chips; | ||||
|     int vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L5I_CODE_RATE_HZ) / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS))); | ||||
|     int32_t vector_length = std::round(static_cast<double>(fs_in) / (static_cast<double>(GPS_L5I_CODE_RATE_HZ) / static_cast<double>(GPS_L5I_CODE_LENGTH_CHIPS))); | ||||
|     trk_param_fpga.vector_length = vector_length; | ||||
|     int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); | ||||
|     int32_t extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); | ||||
|     float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15); | ||||
|     trk_param_fpga.early_late_space_narrow_chips = early_late_space_narrow_chips; | ||||
|     bool track_pilot = configuration->property(role + ".track_pilot", false); | ||||
| @@ -109,13 +109,13 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( | ||||
|     trk_param_fpga.system = 'G'; | ||||
|     char sig_[3] = "L5"; | ||||
|     std::memcpy(trk_param_fpga.signal, sig_, 3); | ||||
|     int cn0_samples = configuration->property(role + ".cn0_samples", 20); | ||||
|     int32_t cn0_samples = configuration->property(role + ".cn0_samples", 20); | ||||
|     if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; | ||||
|     trk_param_fpga.cn0_samples = cn0_samples; | ||||
|     int cn0_min = configuration->property(role + ".cn0_min", 25); | ||||
|     int32_t cn0_min = configuration->property(role + ".cn0_min", 25); | ||||
|     if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; | ||||
|     trk_param_fpga.cn0_min = cn0_min; | ||||
|     int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); | ||||
|     int32_t 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_fpga.max_lock_fail = max_lock_fail; | ||||
|     double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.75); | ||||
| @@ -127,12 +127,12 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( | ||||
|     std::string default_device_name = "/dev/uio"; | ||||
|     std::string device_name = configuration->property(role + ".devicename", default_device_name); | ||||
|     trk_param_fpga.device_name = device_name; | ||||
|     unsigned int device_base = configuration->property(role + ".device_base", 27); | ||||
|     uint32_t device_base = configuration->property(role + ".device_base", 27); | ||||
|     trk_param_fpga.device_base = device_base; | ||||
|     trk_param_fpga.multicorr_type = 0;  //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators | ||||
|     //################# PRE-COMPUTE ALL THE CODES ################# | ||||
|     unsigned int code_samples_per_chip = 1; | ||||
|     auto code_length_chips = static_cast<unsigned int>(GPS_L5I_CODE_LENGTH_CHIPS); | ||||
|     uint32_t code_samples_per_chip = 1; | ||||
|     auto code_length_chips = static_cast<uint32_t>(GPS_L5I_CODE_LENGTH_CHIPS); | ||||
|  | ||||
|     float *tracking_code; | ||||
|     float *data_code; | ||||
| @@ -144,14 +144,14 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( | ||||
|             data_code = static_cast<float *>(volk_gnsssdr_malloc(code_length_chips * sizeof(float), volk_gnsssdr_get_alignment())); | ||||
|         } | ||||
|  | ||||
|     d_ca_codes = static_cast<int *>(volk_gnsssdr_malloc(static_cast<int>(code_length_chips * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); | ||||
|     d_ca_codes = static_cast<int32_t *>(volk_gnsssdr_malloc(static_cast<int32_t>(code_length_chips * NUM_PRNs) * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
|  | ||||
|     if (trk_param_fpga.track_pilot) | ||||
|         { | ||||
|             d_data_codes = static_cast<int *>(volk_gnsssdr_malloc((static_cast<unsigned int>(code_length_chips)) * NUM_PRNs * sizeof(int), volk_gnsssdr_get_alignment())); | ||||
|             d_data_codes = static_cast<int32_t *>(volk_gnsssdr_malloc((static_cast<uint32_t>(code_length_chips)) * NUM_PRNs * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
|         } | ||||
|  | ||||
|     for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) | ||||
|     for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++) | ||||
|         { | ||||
|             if (track_pilot) | ||||
|                 { | ||||
| @@ -159,19 +159,19 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( | ||||
|                     gps_l5i_code_gen_float(data_code, PRN); | ||||
|  | ||||
|  | ||||
|                     for (unsigned int s = 0; s < code_length_chips; s++) | ||||
|                     for (uint32_t s = 0; s < code_length_chips; s++) | ||||
|                         { | ||||
|                             d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(tracking_code[s]); | ||||
|                             d_data_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(data_code[s]); | ||||
|                             d_ca_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = static_cast<int32_t>(tracking_code[s]); | ||||
|                             d_data_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = static_cast<int32_t>(data_code[s]); | ||||
|                         } | ||||
|                 } | ||||
|  | ||||
|             else | ||||
|                 { | ||||
|                     gps_l5i_code_gen_float(tracking_code, PRN); | ||||
|                     for (unsigned int s = 0; s < code_length_chips; s++) | ||||
|                     for (uint32_t s = 0; s < code_length_chips; s++) | ||||
|                         { | ||||
|                             d_ca_codes[static_cast<int>(code_length_chips) * (PRN - 1) + s] = static_cast<int>(tracking_code[s]); | ||||
|                             d_ca_codes[static_cast<int32_t>(code_length_chips) * (PRN - 1) + s] = static_cast<int32_t>(tracking_code[s]); | ||||
|                         } | ||||
|                 } | ||||
|         } | ||||
|   | ||||
| @@ -98,13 +98,13 @@ public: | ||||
| private: | ||||
|     dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc; | ||||
|     size_t item_size_; | ||||
|     unsigned int channel_; | ||||
|     uint32_t channel_; | ||||
|     std::string role_; | ||||
|     unsigned int in_streams_; | ||||
|     unsigned int out_streams_; | ||||
|     uint32_t in_streams_; | ||||
|     uint32_t out_streams_; | ||||
|     bool d_track_pilot; | ||||
|     int* d_ca_codes; | ||||
|     int* d_data_codes; | ||||
|     int32_t* d_ca_codes; | ||||
|     int32_t* d_data_codes; | ||||
| }; | ||||
|  | ||||
| #endif  // GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_FPGA_H_ | ||||
|   | ||||
| @@ -756,7 +756,7 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars() | ||||
|                     double tmp_cp1 = 0.0; | ||||
|                     double tmp_cp2 = 0.0; | ||||
|                     double tmp_samples = 0.0; | ||||
|                     for (unsigned int k = 0; k < trk_parameters.smoother_length; k++) | ||||
|                     for (uint32_t k = 0; k < trk_parameters.smoother_length; k++) | ||||
|                         { | ||||
|                             tmp_cp1 += d_carr_ph_history.at(k).first; | ||||
|                             tmp_cp2 += d_carr_ph_history.at(trk_parameters.smoother_length * 2 - k - 1).first; | ||||
| @@ -786,7 +786,7 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars() | ||||
|                     double tmp_cp1 = 0.0; | ||||
|                     double tmp_cp2 = 0.0; | ||||
|                     double tmp_samples = 0.0; | ||||
|                     for (unsigned int k = 0; k < trk_parameters.smoother_length; k++) | ||||
|                     for (uint32_t k = 0; k < trk_parameters.smoother_length; k++) | ||||
|                         { | ||||
|                             tmp_cp1 += d_code_ph_history.at(k).first; | ||||
|                             tmp_cp2 += d_code_ph_history.at(trk_parameters.smoother_length * 2 - k - 1).first; | ||||
|   | ||||
| @@ -280,7 +280,7 @@ void fpga_multicorrelator_8sc::fpga_configure_tracking_gps_local_code(int32_t PR | ||||
|     d_map_base[PROG_MEMS_ADDR] = LOCAL_CODE_FPGA_CLEAR_ADDRESS_COUNTER; | ||||
|     for (k = 0; k < d_code_length_chips * d_code_samples_per_chip; k++) | ||||
|         { | ||||
|             if (d_ca_codes[((int(d_code_length_chips)) * d_code_samples_per_chip * (PRN - 1)) + k] == 1) | ||||
|             if (d_ca_codes[((int32_t(d_code_length_chips)) * d_code_samples_per_chip * (PRN - 1)) + k] == 1) | ||||
|                 { | ||||
|                     code_chip = 1; | ||||
|                 } | ||||
| @@ -298,7 +298,7 @@ void fpga_multicorrelator_8sc::fpga_configure_tracking_gps_local_code(int32_t PR | ||||
|             d_map_base[PROG_MEMS_ADDR] = LOCAL_CODE_FPGA_CLEAR_ADDRESS_COUNTER; | ||||
|             for (k = 0; k < d_code_length_chips * d_code_samples_per_chip; k++) | ||||
|                 { | ||||
|                     if (d_data_codes[((int(d_code_length_chips)) * d_code_samples_per_chip * (PRN - 1)) + k] == 1) | ||||
|                     if (d_data_codes[((int32_t(d_code_length_chips)) * d_code_samples_per_chip * (PRN - 1)) + k] == 1) | ||||
|                         { | ||||
|                             code_chip = 1; | ||||
|                         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Marc Majoral
					Marc Majoral