mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-21 09:34:53 +00:00
Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into fpga.
Use a generic tracking radio block class for the tracking code that uses the FPGA HW accelerators.
This commit is contained in:
@@ -33,15 +33,16 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
#include <new>
|
||||
#include <gnuradio/fft/fft.h>
|
||||
#include <volk/volk.h>
|
||||
#include <glog/logging.h>
|
||||
#include "gps_l1_ca_pcps_acquisition_fpga.h"
|
||||
|
||||
#include "configuration_interface.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include "gps_l1_ca_pcps_acquisition_fpga.h"
|
||||
#include "gps_sdr_signal_processing.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include <gnuradio/fft/fft.h>
|
||||
#include <glog/logging.h>
|
||||
#include <new>
|
||||
|
||||
|
||||
#define NUM_PRNs 32
|
||||
|
||||
@@ -70,10 +71,10 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
|
||||
unsigned int 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)));
|
||||
|
||||
// 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);
|
||||
unsigned int vector_length = nsamples_total * sampled_ms;
|
||||
unsigned int select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga",0);
|
||||
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);
|
||||
@@ -84,27 +85,27 @@ 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)
|
||||
|
||||
gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT
|
||||
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<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code
|
||||
std::complex<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code
|
||||
gr_complex* 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
|
||||
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<nsamples_total;s++)
|
||||
for (int s = code_length; s < nsamples_total; s++)
|
||||
{
|
||||
code[s] = 0;
|
||||
}
|
||||
int offset = 0;
|
||||
memcpy(fft_if->get_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
|
||||
memcpy(fft_if->get_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)
|
||||
{
|
||||
@@ -115,13 +116,12 @@ 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 (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<int>(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)),
|
||||
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)));
|
||||
|
||||
d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast<int>(floor(fft_codes_padded[i].real() * (pow(2, 7) - 1) / max)),
|
||||
static_cast<int>(floor(fft_codes_padded[i].imag() * (pow(2, 7) - 1) / max)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//acq_parameters
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
#ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_
|
||||
#define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_
|
||||
|
||||
#include <string>
|
||||
#include "acquisition_interface.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "pcps_acquisition_fpga.h"
|
||||
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <string>
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
@@ -144,8 +144,7 @@ private:
|
||||
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
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FPGA_H_ */
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
*/
|
||||
|
||||
#include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h"
|
||||
#include <sstream>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include "control_message_factory.h"
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include "control_message_factory.h"
|
||||
#include <sstream>
|
||||
|
||||
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::complex<f
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init()
|
||||
{
|
||||
d_gnss_synchro->Flag_valid_acquisition = false;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <matio.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
@@ -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<float>(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<float>(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;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#include <armadillo>
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/fft/fft.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <volk/volk.h>
|
||||
#include <string>
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -57,9 +57,9 @@
|
||||
#define GNSS_SDR_PCPS_ACQUISITION_FPGA_H_
|
||||
|
||||
|
||||
#include <gnuradio/block.h>
|
||||
#include "fpga_acquisition.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include <gnuradio/block.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -72,7 +72,7 @@ typedef struct
|
||||
int samples_per_code;
|
||||
unsigned int select_queue_Fpga;
|
||||
std::string device_name;
|
||||
lv_16sc_t *all_fft_codes; // memory that contains all the code ffts
|
||||
lv_16sc_t* all_fft_codes; // memory that contains all the code ffts
|
||||
|
||||
} pcpsconf_fpga_t;
|
||||
|
||||
|
||||
@@ -49,18 +49,18 @@
|
||||
*/
|
||||
|
||||
#include "pcps_opencl_acquisition_cc.h"
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#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 <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
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<float> *code)
|
||||
{
|
||||
if (d_opencl == 0)
|
||||
@@ -374,6 +380,7 @@ void pcps_opencl_acquisition_cc::set_local_code(std::complex<float> *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)))
|
||||
|
||||
@@ -51,14 +51,14 @@
|
||||
#ifndef GNSS_SDR_PCPS_OPENCL_ACQUISITION_CC_H_
|
||||
#define GNSS_SDR_PCPS_OPENCL_ACQUISITION_CC_H_
|
||||
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "gnss_synchro.h"
|
||||
#include "opencl/fft_internal.h"
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/gr_complex.h>
|
||||
#include <gnuradio/fft/fft.h>
|
||||
#include "opencl/fft_internal.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "opencl/cl.hpp"
|
||||
|
||||
@@ -33,32 +33,27 @@
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
// libraries used by the GIPO
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
// logging
|
||||
#include <glog/logging.h>
|
||||
|
||||
// GPS L1
|
||||
#include "GPS_L1_CA.h"
|
||||
|
||||
#include "fpga_acquisition.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "gps_sdr_signal_processing.h"
|
||||
#include <glog/logging.h>
|
||||
#include <fcntl.h> // libraries used by the GIPO
|
||||
#include <sys/mman.h> // libraries used by the GIPO
|
||||
|
||||
#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
|
||||
|
||||
#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()
|
||||
@@ -68,34 +63,36 @@ bool fpga_acquisition::init()
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool fpga_acquisition::set_local_code(unsigned int PRN)
|
||||
{
|
||||
// select the code with the chosen PRN
|
||||
fpga_acquisition::fpga_configure_acquisition_local_code(
|
||||
&d_all_fft_codes[d_nsamples_total * (PRN - 1)]);
|
||||
&d_all_fft_codes[d_nsamples_total * (PRN - 1)]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
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,
|
||||
lv_16sc_t *all_fft_codes)
|
||||
unsigned int nsamples,
|
||||
unsigned int doppler_max,
|
||||
unsigned int nsamples_total, long fs_in, long freq,
|
||||
unsigned int sampled_ms, unsigned select_queue,
|
||||
lv_16sc_t *all_fft_codes)
|
||||
{
|
||||
unsigned int vector_length = nsamples_total*sampled_ms;
|
||||
unsigned int vector_length = nsamples_total * sampled_ms;
|
||||
// initial values
|
||||
d_device_name = device_name;
|
||||
d_freq = freq;
|
||||
d_fs_in = fs_in;
|
||||
d_vector_length = vector_length;
|
||||
d_nsamples = nsamples; // number of samples not including padding
|
||||
d_nsamples = nsamples; // number of samples not including padding
|
||||
d_select_queue = select_queue;
|
||||
d_nsamples_total = nsamples_total;
|
||||
d_doppler_max = doppler_max;
|
||||
d_doppler_step = 0;
|
||||
d_fd = 0; // driver descriptor
|
||||
d_map_base = nullptr; // driver memory map
|
||||
d_fd = 0; // driver descriptor
|
||||
d_map_base = nullptr; // driver memory map
|
||||
d_all_fft_codes = all_fft_codes;
|
||||
|
||||
// open communication with HW accelerator
|
||||
@@ -104,9 +101,9 @@ fpga_acquisition::fpga_acquisition(std::string device_name,
|
||||
LOG(WARNING) << "Cannot open deviceio" << d_device_name;
|
||||
}
|
||||
d_map_base = reinterpret_cast<volatile unsigned *>(mmap(NULL, PAGE_SIZE,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0));
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0));
|
||||
|
||||
if (d_map_base == reinterpret_cast<void*>(-1))
|
||||
if (d_map_base == reinterpret_cast<void *>(-1))
|
||||
{
|
||||
LOG(WARNING) << "Cannot map the FPGA acquisition module into user memory";
|
||||
}
|
||||
@@ -121,23 +118,25 @@ fpga_acquisition::fpga_acquisition(std::string device_name,
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(INFO) << "Acquisition test register sanity check success !";
|
||||
LOG(INFO) << "Acquisition test register sanity check success!";
|
||||
}
|
||||
fpga_acquisition::reset_acquisition();
|
||||
DLOG(INFO) << "Acquisition FPGA class created";
|
||||
|
||||
}
|
||||
|
||||
|
||||
fpga_acquisition::~fpga_acquisition()
|
||||
{
|
||||
close_device();
|
||||
}
|
||||
|
||||
|
||||
bool fpga_acquisition::free()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
unsigned fpga_acquisition::fpga_acquisition_test_register(unsigned writeval)
|
||||
{
|
||||
unsigned readval;
|
||||
@@ -149,6 +148,7 @@ unsigned fpga_acquisition::fpga_acquisition_test_register(unsigned writeval)
|
||||
return readval;
|
||||
}
|
||||
|
||||
|
||||
void fpga_acquisition::fpga_configure_acquisition_local_code(lv_16sc_t fft_local_code[])
|
||||
{
|
||||
unsigned short local_code;
|
||||
@@ -161,19 +161,20 @@ void fpga_acquisition::fpga_configure_acquisition_local_code(lv_16sc_t fft_local
|
||||
{
|
||||
tmp = fft_local_code[k].real();
|
||||
tmp2 = fft_local_code[k].imag();
|
||||
local_code = (tmp & SELECT_LSB) | ((tmp2 * SHL_8_BITS) & SELECT_MSB); // put together the real part and the imaginary part
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void fpga_acquisition::run_acquisition(void)
|
||||
{
|
||||
// enable interrupts
|
||||
int reenable = 1;
|
||||
write(d_fd, reinterpret_cast<void*>(&reenable), sizeof(int));
|
||||
write(d_fd, reinterpret_cast<void *>(&reenable), sizeof(int));
|
||||
// launch the acquisition process
|
||||
d_map_base[6] = LAUNCH_ACQUISITION; // 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;
|
||||
@@ -186,14 +187,16 @@ void fpga_acquisition::run_acquisition(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void fpga_acquisition::configure_acquisition()
|
||||
{
|
||||
d_map_base[0] = d_select_queue;
|
||||
d_map_base[1] = d_vector_length;
|
||||
d_map_base[2] = d_nsamples;
|
||||
d_map_base[5] = (int) log2((float) d_vector_length); // log2 FFTlength
|
||||
d_map_base[5] = (int)log2((float)d_vector_length); // log2 FFTlength
|
||||
}
|
||||
|
||||
|
||||
void fpga_acquisition::set_phase_step(unsigned int doppler_index)
|
||||
{
|
||||
float phase_step_rad_real;
|
||||
@@ -212,13 +215,14 @@ 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 * 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
|
||||
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;
|
||||
}
|
||||
|
||||
void fpga_acquisition::read_acquisition_results(uint32_t* max_index,
|
||||
float* max_magnitude, unsigned *initial_sample, float *power_sum)
|
||||
|
||||
void fpga_acquisition::read_acquisition_results(uint32_t *max_index,
|
||||
float *max_magnitude, unsigned *initial_sample, float *power_sum)
|
||||
{
|
||||
unsigned readval = 0;
|
||||
readval = d_map_base[1];
|
||||
@@ -231,28 +235,31 @@ void fpga_acquisition::read_acquisition_results(uint32_t* max_index,
|
||||
*max_index = readval;
|
||||
}
|
||||
|
||||
|
||||
void fpga_acquisition::block_samples()
|
||||
{
|
||||
d_map_base[14] = 1; // block the samples
|
||||
d_map_base[14] = 1; // block the samples
|
||||
}
|
||||
|
||||
|
||||
void fpga_acquisition::unblock_samples()
|
||||
{
|
||||
d_map_base[14] = 0; // unblock the samples
|
||||
d_map_base[14] = 0; // unblock the samples
|
||||
}
|
||||
|
||||
|
||||
void fpga_acquisition::close_device()
|
||||
{
|
||||
unsigned * aux = const_cast<unsigned*>(d_map_base);
|
||||
if (munmap(static_cast<void*>(aux), PAGE_SIZE) == -1)
|
||||
unsigned *aux = const_cast<unsigned *>(d_map_base);
|
||||
if (munmap(static_cast<void *>(aux), PAGE_SIZE) == -1)
|
||||
{
|
||||
printf("Failed to unmap memory uio\n");
|
||||
}
|
||||
close(d_fd);
|
||||
}
|
||||
|
||||
|
||||
void fpga_acquisition::reset_acquisition(void)
|
||||
{
|
||||
d_map_base[6] = RESET_ACQUISITION; // 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
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
#ifndef GNSS_SDR_FPGA_ACQUISITION_H_
|
||||
#define GNSS_SDR_FPGA_ACQUISITION_H_
|
||||
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <gnuradio/fft/fft.h>
|
||||
#include <volk/volk.h>
|
||||
|
||||
/*!
|
||||
* \brief Class that implements carrier wipe-off and correlators.
|
||||
@@ -46,18 +46,20 @@ class fpga_acquisition
|
||||
{
|
||||
public:
|
||||
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,
|
||||
lv_16sc_t *all_fft_codes);
|
||||
~fpga_acquisition();bool init();bool set_local_code(
|
||||
unsigned int PRN);
|
||||
unsigned int nsamples,
|
||||
unsigned int doppler_max,
|
||||
unsigned int nsamples_total, long fs_in, long freq,
|
||||
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);
|
||||
void read_acquisition_results(uint32_t* max_index, float* max_magnitude,
|
||||
unsigned *initial_sample, float *power_sum);
|
||||
void read_acquisition_results(uint32_t *max_index, float *max_magnitude,
|
||||
unsigned *initial_sample, float *power_sum);
|
||||
void block_samples();
|
||||
void unblock_samples();
|
||||
|
||||
@@ -80,21 +82,20 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
long d_freq;
|
||||
long d_fs_in;
|
||||
gr::fft::fft_complex* d_fft_if; // function used to run the fft of the local codes
|
||||
gr::fft::fft_complex *d_fft_if; // function used to run the fft of the local codes
|
||||
// data related to the hardware module and the driver
|
||||
int d_fd; // driver descriptor
|
||||
volatile unsigned *d_map_base; // driver memory map
|
||||
lv_16sc_t *d_all_fft_codes; // memory that contains all the code ffts
|
||||
unsigned int d_vector_length; // number of samples incluing padding and number of ms
|
||||
unsigned int d_nsamples_total; // number of samples including padding
|
||||
unsigned int d_nsamples; // number of samples not including padding
|
||||
unsigned int d_select_queue; // queue selection
|
||||
std::string d_device_name; // HW device name
|
||||
unsigned int d_doppler_max; // max doppler
|
||||
unsigned int d_doppler_step; // doppler step
|
||||
int d_fd; // driver descriptor
|
||||
volatile unsigned *d_map_base; // driver memory map
|
||||
lv_16sc_t *d_all_fft_codes; // memory that contains all the code ffts
|
||||
unsigned int d_vector_length; // number of samples incluing padding and number of ms
|
||||
unsigned int d_nsamples_total; // number of samples including padding
|
||||
unsigned int d_nsamples; // number of samples not including padding
|
||||
unsigned int d_select_queue; // queue selection
|
||||
std::string d_device_name; // HW device name
|
||||
unsigned int d_doppler_max; // max doppler
|
||||
unsigned int d_doppler_step; // doppler step
|
||||
// FPGA private functions
|
||||
unsigned fpga_acquisition_test_register(unsigned writeval);
|
||||
void fpga_configure_acquisition_local_code(lv_16sc_t fft_local_code[]);
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "control_message_factory.h"
|
||||
#include <glog/logging.h>
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
ChannelFsm::ChannelFsm()
|
||||
{
|
||||
@@ -135,35 +136,41 @@ bool ChannelFsm::Event_failed_tracking_standby()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ChannelFsm::set_acquisition(std::shared_ptr<AcquisitionInterface> acquisition)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
acq_ = acquisition;
|
||||
}
|
||||
|
||||
|
||||
void ChannelFsm::set_tracking(std::shared_ptr<TrackingInterface> tracking)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
trk_ = tracking;
|
||||
}
|
||||
|
||||
|
||||
void ChannelFsm::set_queue(gr::msg_queue::sptr queue)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
queue_ = queue;
|
||||
}
|
||||
|
||||
|
||||
void ChannelFsm::set_channel(unsigned int channel)
|
||||
{
|
||||
std::lock_guard<std::mutex> 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<ControlMessageFactory> cmf(new ControlMessageFactory());
|
||||
@@ -183,6 +191,7 @@ void ChannelFsm::request_satellite()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ChannelFsm::notify_stop_tracking()
|
||||
{
|
||||
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
||||
|
||||
@@ -42,6 +42,7 @@ channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<Channe
|
||||
return channel_msg_receiver_cc_sptr(new channel_msg_receiver_cc(channel_fsm, repeat));
|
||||
}
|
||||
|
||||
|
||||
void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg)
|
||||
{
|
||||
bool result = false;
|
||||
@@ -50,10 +51,10 @@ void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg)
|
||||
long int message = pmt::to_long(msg);
|
||||
switch (message)
|
||||
{
|
||||
case 1: //positive acquisition
|
||||
case 1: // positive acquisition
|
||||
result = d_channel_fsm->Event_valid_acquisition();
|
||||
break;
|
||||
case 2: //negative acquisition
|
||||
case 2: // negative acquisition
|
||||
if (d_repeat == true)
|
||||
{
|
||||
result = d_channel_fsm->Event_failed_acquisition_repeat();
|
||||
|
||||
@@ -37,12 +37,15 @@ using google::LogMessage;
|
||||
|
||||
// Constructor
|
||||
ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configuration,
|
||||
std::shared_ptr<GNSSBlockInterface> data_type_adapt, std::shared_ptr<GNSSBlockInterface> in_filt,
|
||||
std::shared_ptr<GNSSBlockInterface> 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<GNSSBlockInterface> data_type_adapt,
|
||||
std::shared_ptr<GNSSBlockInterface> in_filt,
|
||||
std::shared_ptr<GNSSBlockInterface> 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)
|
||||
|
||||
@@ -37,12 +37,15 @@ using google::LogMessage;
|
||||
|
||||
// Constructor
|
||||
SignalConditioner::SignalConditioner(ConfigurationInterface *configuration,
|
||||
std::shared_ptr<GNSSBlockInterface> data_type_adapt, std::shared_ptr<GNSSBlockInterface> in_filt,
|
||||
std::shared_ptr<GNSSBlockInterface> 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<GNSSBlockInterface> data_type_adapt,
|
||||
std::shared_ptr<GNSSBlockInterface> in_filt,
|
||||
std::shared_ptr<GNSSBlockInterface> 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();
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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<gr::fft::fft_complex>(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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -19,80 +19,80 @@
|
||||
add_subdirectory(rtklib)
|
||||
|
||||
if(ENABLE_FPGA)
|
||||
set(GNSS_SPLIBS_SOURCES
|
||||
gps_l2c_signal.cc
|
||||
gps_l5_signal.cc
|
||||
galileo_e1_signal_processing.cc
|
||||
gnss_sdr_valve.cc
|
||||
gnss_sdr_sample_counter.cc
|
||||
gnss_sdr_time_counter.cc
|
||||
gnss_signal_processing.cc
|
||||
gps_sdr_signal_processing.cc
|
||||
glonass_l1_signal_processing.cc
|
||||
glonass_l2_signal_processing.cc
|
||||
pass_through.cc
|
||||
galileo_e5_signal_processing.cc
|
||||
complex_byte_to_float_x2.cc
|
||||
byte_x2_to_complex_byte.cc
|
||||
cshort_to_float_x2.cc
|
||||
short_x2_to_cshort.cc
|
||||
complex_float_to_complex_byte.cc
|
||||
conjugate_cc.cc
|
||||
conjugate_sc.cc
|
||||
conjugate_ic.cc
|
||||
set(GNSS_SPLIBS_SOURCES
|
||||
gps_l2c_signal.cc
|
||||
gps_l5_signal.cc
|
||||
galileo_e1_signal_processing.cc
|
||||
gnss_sdr_valve.cc
|
||||
gnss_sdr_sample_counter.cc
|
||||
gnss_sdr_time_counter.cc
|
||||
gnss_signal_processing.cc
|
||||
gps_sdr_signal_processing.cc
|
||||
glonass_l1_signal_processing.cc
|
||||
glonass_l2_signal_processing.cc
|
||||
pass_through.cc
|
||||
galileo_e5_signal_processing.cc
|
||||
complex_byte_to_float_x2.cc
|
||||
byte_x2_to_complex_byte.cc
|
||||
cshort_to_float_x2.cc
|
||||
short_x2_to_cshort.cc
|
||||
complex_float_to_complex_byte.cc
|
||||
conjugate_cc.cc
|
||||
conjugate_sc.cc
|
||||
conjugate_ic.cc
|
||||
)
|
||||
else(ENABLE_FPGA)
|
||||
set(GNSS_SPLIBS_SOURCES
|
||||
gps_l2c_signal.cc
|
||||
gps_l5_signal.cc
|
||||
galileo_e1_signal_processing.cc
|
||||
gnss_sdr_valve.cc
|
||||
gnss_sdr_sample_counter.cc
|
||||
gnss_signal_processing.cc
|
||||
gps_sdr_signal_processing.cc
|
||||
glonass_l1_signal_processing.cc
|
||||
glonass_l2_signal_processing.cc
|
||||
pass_through.cc
|
||||
galileo_e5_signal_processing.cc
|
||||
complex_byte_to_float_x2.cc
|
||||
byte_x2_to_complex_byte.cc
|
||||
cshort_to_float_x2.cc
|
||||
short_x2_to_cshort.cc
|
||||
complex_float_to_complex_byte.cc
|
||||
conjugate_cc.cc
|
||||
conjugate_sc.cc
|
||||
conjugate_ic.cc
|
||||
)
|
||||
set(GNSS_SPLIBS_SOURCES
|
||||
gps_l2c_signal.cc
|
||||
gps_l5_signal.cc
|
||||
galileo_e1_signal_processing.cc
|
||||
gnss_sdr_valve.cc
|
||||
gnss_sdr_sample_counter.cc
|
||||
gnss_signal_processing.cc
|
||||
gps_sdr_signal_processing.cc
|
||||
glonass_l1_signal_processing.cc
|
||||
glonass_l2_signal_processing.cc
|
||||
pass_through.cc
|
||||
galileo_e5_signal_processing.cc
|
||||
complex_byte_to_float_x2.cc
|
||||
byte_x2_to_complex_byte.cc
|
||||
cshort_to_float_x2.cc
|
||||
short_x2_to_cshort.cc
|
||||
complex_float_to_complex_byte.cc
|
||||
conjugate_cc.cc
|
||||
conjugate_sc.cc
|
||||
conjugate_ic.cc
|
||||
)
|
||||
endif(ENABLE_FPGA)
|
||||
|
||||
if(OPENCL_FOUND)
|
||||
set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES}
|
||||
opencl/fft_execute.cc # Needs OpenCL
|
||||
opencl/fft_setup.cc # Needs OpenCL
|
||||
opencl/fft_kernelstring.cc # Needs OpenCL
|
||||
)
|
||||
opencl/fft_execute.cc # Needs OpenCL
|
||||
opencl/fft_setup.cc # Needs OpenCL
|
||||
opencl/fft_kernelstring.cc # Needs OpenCL
|
||||
)
|
||||
endif(OPENCL_FOUND)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
||||
${GNURADIO_BLOCKS_INCLUDE_DIRS}
|
||||
${VOLK_INCLUDE_DIRS}
|
||||
${VOLK_GNSSSDR_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
||||
${GNURADIO_BLOCKS_INCLUDE_DIRS}
|
||||
${VOLK_INCLUDE_DIRS}
|
||||
${VOLK_GNSSSDR_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(OPENCL_FOUND)
|
||||
include_directories( ${OPENCL_INCLUDE_DIRS} )
|
||||
if(OS_IS_MACOSX)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL")
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL")
|
||||
else(OS_IS_MACOSX)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES})
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES})
|
||||
endif(OS_IS_MACOSX)
|
||||
endif(OPENCL_FOUND)
|
||||
|
||||
@@ -105,14 +105,14 @@ add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS})
|
||||
source_group(Headers FILES ${GNSS_SPLIBS_HEADERS})
|
||||
|
||||
target_link_libraries(gnss_sp_libs ${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${VOLK_LIBRARIES} ${ORC_LIBRARIES}
|
||||
${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${GNURADIO_FFT_LIBRARIES}
|
||||
${GNURADIO_FILTER_LIBRARIES}
|
||||
${OPT_LIBRARIES}
|
||||
gnss_rx
|
||||
${VOLK_LIBRARIES} ${ORC_LIBRARIES}
|
||||
${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${GNURADIO_FFT_LIBRARIES}
|
||||
${GNURADIO_FILTER_LIBRARIES}
|
||||
${OPT_LIBRARIES}
|
||||
gnss_rx
|
||||
)
|
||||
|
||||
if(NOT VOLK_GNSSSDR_FOUND)
|
||||
@@ -120,9 +120,9 @@ if(NOT VOLK_GNSSSDR_FOUND)
|
||||
endif(NOT VOLK_GNSSSDR_FOUND)
|
||||
|
||||
if(${GFLAGS_GREATER_20})
|
||||
add_definitions(-DGFLAGS_GREATER_2_0=1)
|
||||
add_definitions(-DGFLAGS_GREATER_2_0=1)
|
||||
endif(${GFLAGS_GREATER_20})
|
||||
|
||||
add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h)
|
||||
source_group(Headers FILES gnss_sdr_flags.h)
|
||||
target_link_libraries(gnss_sdr_flags ${GFlags_LIBS})
|
||||
target_link_libraries(gnss_sdr_flags ${GFlags_LIBS})
|
||||
|
||||
@@ -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).");
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ DECLARE_int32(doppler_step); //<! If defined, sets the frequency step in the se
|
||||
// Declare flags for tracking blocks
|
||||
DECLARE_int32(cn0_samples); //<! Number of correlator outputs used for CN0 estimation.
|
||||
DECLARE_int32(cn0_min); //<! Minimum valid CN0 (in dB-Hz).
|
||||
DECLARE_int32(max_lock_fail); //<! Number number of lock failures before dropping satellite.
|
||||
DECLARE_int32(max_lock_fail); //<! Maximum number of lock failures before dropping a satellite.
|
||||
DECLARE_double(carrier_lock_th); //<! Carrier lock threshold (in rad).
|
||||
DECLARE_double(dll_bw_hz); //<! Bandwidth of the DLL low pass filter, in Hz (overrides the configuration file).
|
||||
DECLARE_double(pll_bw_hz); //<! Bandwidth of the PLL low pass filter, in Hz (overrides the configuration file).
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
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)
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
if(DEFINED __INCLUDED_VOLK_ADD_TEST)
|
||||
return()
|
||||
@@ -176,20 +174,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 $<FOO:BAR> 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 "$<TARGET_FILE_DIR:${target}>")
|
||||
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 +201,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)
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
if(DEFINED __INCLUDED_VOLK_BOOST_CMAKE)
|
||||
return()
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
if(DEFINED __INCLUDED_VOLK_BUILD_TYPES_CMAKE)
|
||||
return()
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
INCLUDE(FindPkgConfig)
|
||||
PKG_CHECK_MODULES(PC_VOLK_GNSSSDR volk_gnsssdr)
|
||||
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(MAJOR_VERSION @VERSION_INFO_MAJOR_VERSION@)
|
||||
set(MINOR_VERSION @VERSION_INFO_MINOR_VERSION@)
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
if(DEFINED __INCLUDED_VOLK_PYTHON_CMAKE)
|
||||
return()
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
if(DEFINED __INCLUDED_VOLK_VERSION_CMAKE)
|
||||
return()
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
########################################################################
|
||||
# Toolchain file for building native on a ARM Cortex A8 w/ NEON
|
||||
# Usage: cmake -DCMAKE_TOOLCHAIN_FILE=<this file> <source directory>
|
||||
########################################################################
|
||||
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
|
||||
@@ -0,0 +1,25 @@
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
########################################################################
|
||||
# Toolchain file for building native on a ARM Cortex A8 w/ NEON
|
||||
# Usage: cmake -DCMAKE_TOOLCHAIN_FILE=<this file> <source directory>
|
||||
########################################################################
|
||||
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
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
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")
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
@@ -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 <windows.h> //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;
|
||||
}
|
||||
@@ -13,12 +13,24 @@
|
||||
</arch>
|
||||
|
||||
<arch name="neon">
|
||||
<flag compiler="gnu">-mfpu=neon</flag>
|
||||
<flag compiler="gnu">-funsafe-math-optimizations</flag>
|
||||
<alignment>16</alignment>
|
||||
<check name="has_neon"></check>
|
||||
</arch>
|
||||
|
||||
<arch name="neonv7">
|
||||
<flag compiler="gnu">-mfpu=neon</flag>
|
||||
<flag compiler="gnu">-funsafe-math-optimizations</flag>
|
||||
<alignment>16</alignment>
|
||||
<check name="has_neonv7"></check>
|
||||
</arch>
|
||||
|
||||
<arch name="neonv8">
|
||||
<flag compiler="gnu">-funsafe-math-optimizations</flag>
|
||||
<alignment>16</alignment>
|
||||
<check name="has_neonv8"></check>
|
||||
</arch>
|
||||
|
||||
<arch name="32">
|
||||
<flag compiler="gnu">-m32</flag>
|
||||
</arch>
|
||||
|
||||
@@ -5,7 +5,15 @@
|
||||
</machine>
|
||||
|
||||
<machine name="neon">
|
||||
<archs>generic neon softfp|hardfp orc|</archs>
|
||||
<archs>generic neon orc|</archs>
|
||||
</machine>
|
||||
|
||||
<machine name="neonv7">
|
||||
<archs>generic neon neonv7 softfp|hardfp orc|</archs>
|
||||
</machine>
|
||||
|
||||
<machine name="neonv8">
|
||||
<archs>generic neon neonv8</archs>
|
||||
</machine>
|
||||
|
||||
<!-- trailing | bar means generate without either for MSVC -->
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
//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 <arm_neon.h>
|
||||
//#include <volk_gnsssdr/volk_gnsssdr_neon_intrinsics.h>
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
//#include <volk_gnsssdr/volk_gnsssdr_neon_intrinsics.h>
|
||||
|
||||
@@ -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*/
|
||||
|
||||
@@ -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!
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
//
|
||||
//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 */
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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 */
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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 <arm_neon.h>
|
||||
|
||||
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 */
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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 <arm_neon.h>
|
||||
|
||||
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 <arm_neon.h>
|
||||
|
||||
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*/
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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 <arm_neon.h>
|
||||
|
||||
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 <arm_neon.h>
|
||||
|
||||
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*/
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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*/
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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 <arm_neon.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr_neon_intrinsics.h>
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr_neon_intrinsics.h>
|
||||
|
||||
@@ -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*/
|
||||
|
||||
@@ -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!
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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*/
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
/* 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 */
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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)
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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 */
|
||||
|
||||
@@ -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!
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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)
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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 */
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
|
||||
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*/
|
||||
|
||||
@@ -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 <arm_neon.h>
|
||||
/* 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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 <arm_neon.h>\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
|
||||
|
||||
@@ -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*/
|
||||
|
||||
@@ -128,12 +128,12 @@ static inline unsigned int get_avx2_enabled(void)
|
||||
#include <asm/hwcap.h>
|
||||
#include <linux/auxvec.h>
|
||||
#include <stdio.h>
|
||||
#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 <asm/hwcap.h>
|
||||
#include <linux/auxvec.h>
|
||||
#include <stdio.h>
|
||||
#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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -56,32 +56,41 @@ signal_make_generator_c(std::vector<std::string> signal1, std::vector<std::strin
|
||||
data_flag, noise_flag, fs_in, vector_length, BW_BB));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The private constructor
|
||||
*/
|
||||
signal_generator_c::signal_generator_c(std::vector<std::string> signal1, std::vector<std::string> system, const std::vector<unsigned int> &PRN,
|
||||
const std::vector<float> &CN0_dB, const std::vector<float> &doppler_Hz,
|
||||
const std::vector<unsigned int> &delay_chips, const std::vector<unsigned int> &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<float>(fs_in) / 2.0)
|
||||
signal_generator_c::signal_generator_c(std::vector<std::string> signal1,
|
||||
std::vector<std::string> system,
|
||||
const std::vector<unsigned int> &PRN,
|
||||
const std::vector<float> &CN0_dB,
|
||||
const std::vector<float> &doppler_Hz,
|
||||
const std::vector<unsigned int> &delay_chips,
|
||||
const std::vector<unsigned int> &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<float>(fs_in) / 2.0)
|
||||
{
|
||||
init();
|
||||
generate_codes();
|
||||
}
|
||||
|
||||
|
||||
void signal_generator_c::init()
|
||||
{
|
||||
work_counter_ = 0;
|
||||
|
||||
@@ -29,7 +29,7 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled")
|
||||
message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.")
|
||||
endif(NOT IIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS})
|
||||
@@ -38,12 +38,12 @@ endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
if(ENABLE_AD9361)
|
||||
find_package(libiio REQUIRED)
|
||||
if(NOT LIBIIO_FOUND)
|
||||
message(STATUS "gnuradio-iio not found, its installation is required.")
|
||||
message(STATUS "libiio not found, its installation is required.")
|
||||
message(STATUS "Please build and install the following projects:")
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled")
|
||||
message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.")
|
||||
endif(NOT LIBIIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS})
|
||||
|
||||
@@ -35,10 +35,8 @@
|
||||
#include "ad9361_manager.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "GPS_L2C.h"
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <glog/logging.h>
|
||||
#include <iostream>
|
||||
#include <iostream> // for cout, endl
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <iio/iio.h>
|
||||
@@ -47,10 +45,8 @@
|
||||
#endif
|
||||
|
||||
Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_stream, unsigned int out_stream,
|
||||
boost::shared_ptr<gr::msg_queue> queue) :
|
||||
role_(role), in_stream_(in_stream), out_stream_(out_stream),
|
||||
queue_(queue)
|
||||
std::string role, unsigned int in_stream, unsigned int out_stream,
|
||||
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
|
||||
{
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string default_dump_file = "./data/signal_source.dat";
|
||||
@@ -75,12 +71,12 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
|
||||
|
||||
enable_dds_lo_=configuration->property(role + ".enable_dds_lo", false);
|
||||
freq_rf_tx_hz_=configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ-GPS_L2_FREQ_HZ-1000);
|
||||
freq_dds_tx_hz_=configuration->property(role + ".freq_dds_tx_hz", 1000);
|
||||
scale_dds_dbfs_=configuration->property(role + ".scale_dds_dbfs", -3.0);
|
||||
phase_dds_deg_=configuration->property(role + ".phase_dds_deg", 0.0);
|
||||
tx_attenuation_db_=configuration->property(role + ".tx_attenuation_db", 0.0);
|
||||
enable_dds_lo_ = configuration->property(role + ".enable_dds_lo", false);
|
||||
freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ - GPS_L2_FREQ_HZ - 1000);
|
||||
freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", 1000);
|
||||
scale_dds_dbfs_ = configuration->property(role + ".scale_dds_dbfs", -3.0);
|
||||
phase_dds_deg_ = configuration->property(role + ".phase_dds_deg", 0.0);
|
||||
tx_attenuation_db_ = configuration->property(role + ".tx_attenuation_db", 0.0);
|
||||
|
||||
item_size_ = sizeof(gr_complex);
|
||||
|
||||
@@ -89,30 +85,30 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura
|
||||
std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl;
|
||||
|
||||
config_ad9361_rx_local(bandwidth_,
|
||||
sample_rate_,
|
||||
freq_,
|
||||
rf_port_select_,
|
||||
gain_mode_rx1_,
|
||||
gain_mode_rx2_,
|
||||
rf_gain_rx1_,
|
||||
rf_gain_rx2_);
|
||||
sample_rate_,
|
||||
freq_,
|
||||
rf_port_select_,
|
||||
gain_mode_rx1_,
|
||||
gain_mode_rx2_,
|
||||
rf_gain_rx1_,
|
||||
rf_gain_rx2_);
|
||||
|
||||
//LOCAL OSCILLATOR DDS GENERATOR FOR DUAL FREQUENCY OPERATION
|
||||
if (enable_dds_lo_==true)
|
||||
{
|
||||
config_ad9361_lo_local(bandwidth_,
|
||||
sample_rate_,
|
||||
freq_rf_tx_hz_,
|
||||
tx_attenuation_db_,
|
||||
freq_dds_tx_hz_,
|
||||
scale_dds_dbfs_);
|
||||
}
|
||||
if (enable_dds_lo_ == true)
|
||||
{
|
||||
config_ad9361_lo_local(bandwidth_,
|
||||
sample_rate_,
|
||||
freq_rf_tx_hz_,
|
||||
tx_attenuation_db_,
|
||||
freq_dds_tx_hz_,
|
||||
scale_dds_dbfs_);
|
||||
}
|
||||
|
||||
// turn switch to A/D position
|
||||
std::string default_device_name = "/dev/uio13";
|
||||
std::string device_name = configuration->property(role + ".devicename", default_device_name);
|
||||
int switch_position = configuration->property(role + ".switch_position", 0);
|
||||
switch_fpga = std::make_shared <fpga_switch>(device_name);
|
||||
switch_fpga = std::make_shared<fpga_switch>(device_name);
|
||||
switch_fpga->set_switch_position(switch_position);
|
||||
}
|
||||
|
||||
@@ -125,11 +121,11 @@ Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource()
|
||||
//if (rx0_q) { iio_channel_disable(rx0_q); }
|
||||
|
||||
if (enable_dds_lo_)
|
||||
{
|
||||
ad9361_disable_lo_local();
|
||||
}
|
||||
{
|
||||
ad9361_disable_lo_local();
|
||||
}
|
||||
|
||||
// std::cout<<"* AD9361 Destroying context\n";
|
||||
// std::cout<<"* AD9361 Destroying context\n";
|
||||
//if (ctx) { iio_context_destroy(ctx); }
|
||||
}
|
||||
|
||||
|
||||
@@ -34,21 +34,20 @@
|
||||
|
||||
#include "gnss_block_interface.h"
|
||||
#include "fpga_switch.h"
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include <string>
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
class Ad9361FpgaSignalSource: public GNSSBlockInterface
|
||||
class Ad9361FpgaSignalSource : public GNSSBlockInterface
|
||||
{
|
||||
public:
|
||||
Ad9361FpgaSignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_stream,
|
||||
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
|
||||
std::string role, unsigned int in_stream,
|
||||
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
virtual ~Ad9361FpgaSignalSource();
|
||||
~Ad9361FpgaSignalSource();
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
@@ -77,11 +76,11 @@ private:
|
||||
std::string role_;
|
||||
|
||||
// Front-end settings
|
||||
std::string uri_;//device direction
|
||||
unsigned long freq_; //frequency of local oscilator
|
||||
std::string uri_; // device direction
|
||||
unsigned long freq_; // frequency of local oscillator
|
||||
unsigned long sample_rate_;
|
||||
unsigned long bandwidth_;
|
||||
unsigned long buffer_size_; //reception buffer
|
||||
unsigned long buffer_size_; // reception buffer
|
||||
bool rx1_en_;
|
||||
bool rx2_en_;
|
||||
bool quadrature_;
|
||||
@@ -95,7 +94,7 @@ private:
|
||||
std::string filter_file_;
|
||||
bool filter_auto_;
|
||||
|
||||
//DDS configuration for LO generation for external mixer
|
||||
// DDS configuration for LO generation for external mixer
|
||||
bool enable_dds_lo_;
|
||||
unsigned long freq_rf_tx_hz_;
|
||||
unsigned long freq_dds_tx_hz_;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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<gr_complex *>(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<gr_complex *>(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;
|
||||
}
|
||||
|
||||
@@ -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<int>(data) < two_compl_thres)
|
||||
{
|
||||
res = static_cast<int>(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = static_cast<int>(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<int>(data) < two_compl_thres)
|
||||
{
|
||||
res = static_cast<int>(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = static_cast<int>(data) - adc_bits_two_pow;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -17,65 +17,68 @@
|
||||
#
|
||||
|
||||
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
find_package(iio REQUIRED)
|
||||
if(NOT IIO_FOUND)
|
||||
message(STATUS "gnuradio-iio not found, its installation is required.")
|
||||
message(STATUS "Please build and install the following projects:")
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled")
|
||||
endif(NOT IIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS})
|
||||
|
||||
find_package(iio REQUIRED)
|
||||
if(NOT IIO_FOUND)
|
||||
message(STATUS "gnuradio-iio not found, its installation is required.")
|
||||
message(STATUS "Please build and install the following projects:")
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled")
|
||||
endif(NOT IIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS})
|
||||
endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
|
||||
if(ENABLE_FMCOMMS2 OR ENABLE_AD9361)
|
||||
find_package(libiio REQUIRED)
|
||||
if(NOT LIBIIO_FOUND)
|
||||
message(STATUS "gnuradio-iio not found, its installation is required.")
|
||||
message(STATUS "Please build and install the following projects:")
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled")
|
||||
endif(NOT LIBIIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS})
|
||||
|
||||
###############################################
|
||||
# FMCOMMS2 based SDR Hardware
|
||||
###############################################
|
||||
if(IIO_FOUND)
|
||||
set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc)
|
||||
endif(IIO_FOUND)
|
||||
|
||||
find_package(libiio REQUIRED)
|
||||
if(NOT LIBIIO_FOUND)
|
||||
message(STATUS "libiio not found, its installation is required.")
|
||||
message(STATUS "Please build and install the following projects:")
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled")
|
||||
endif(NOT LIBIIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS})
|
||||
|
||||
###############################################
|
||||
# FMCOMMS2 based SDR Hardware
|
||||
###############################################
|
||||
if(LIBIIO_FOUND)
|
||||
set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc)
|
||||
set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h)
|
||||
endif(LIBIIO_FOUND)
|
||||
endif(ENABLE_FMCOMMS2 OR ENABLE_AD9361)
|
||||
|
||||
if(ENABLE_AD9361)
|
||||
set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc)
|
||||
endif(ENABLE_AD9361)
|
||||
|
||||
if(ENABLE_FPGA)
|
||||
SET(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc)
|
||||
endif(ENABLE_FPGA)
|
||||
if(ENABLE_FPGA OR ENABLE_AD9361)
|
||||
set(OPT_SIGNAL_SOURCE_LIB_SOURCES ${OPT_SIGNAL_SOURCE_LIB_SOURCES} fpga_switch.cc)
|
||||
set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_switch.h)
|
||||
endif(ENABLE_FPGA OR ENABLE_AD9361)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${OPT_DRIVER_INCLUDE_DIRS}
|
||||
)
|
||||
)
|
||||
|
||||
set (SIGNAL_SOURCE_LIB_SOURCES
|
||||
rtl_tcp_commands.cc
|
||||
rtl_tcp_dongle_info.cc
|
||||
${OPT_SIGNAL_SOURCE_LIB_SOURCES})
|
||||
set(SIGNAL_SOURCE_LIB_SOURCES
|
||||
rtl_tcp_commands.cc
|
||||
rtl_tcp_dongle_info.cc
|
||||
${OPT_SIGNAL_SOURCE_LIB_SOURCES}
|
||||
)
|
||||
|
||||
set(SIGNAL_SOURCE_LIB_HEADERS
|
||||
rtl_tcp_commands.h
|
||||
rtl_tcp_dongle_info.h
|
||||
${OPT_SIGNAL_SOURCE_LIB_HEADERS}
|
||||
)
|
||||
|
||||
file(GLOB SIGNAL_SOURCE_LIB_HEADERS "*.h")
|
||||
list(SORT SIGNAL_SOURCE_LIB_HEADERS)
|
||||
add_library(signal_source_lib ${SIGNAL_SOURCE_LIB_SOURCES} ${SIGNAL_SOURCE_LIB_HEADERS})
|
||||
source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS})
|
||||
|
||||
target_link_libraries(signal_source_lib ${OPT_LIBRARIES})
|
||||
|
||||
add_dependencies(signal_source_lib glog-${glog_RELEASE})
|
||||
|
||||
@@ -35,53 +35,33 @@
|
||||
*/
|
||||
|
||||
#include "fpga_switch.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
// FPGA stuff
|
||||
#include <new>
|
||||
|
||||
// libraries used by DMA test code and GIPO test code
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
// libraries used by DMA test code
|
||||
#include <sys/stat.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
// libraries used by GPIO test code
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
// logging
|
||||
#include <glog/logging.h>
|
||||
#include <fcntl.h> // for open, O_RDWR, O_SYNC
|
||||
#include <iostream> // for cout, endl
|
||||
#include <sys/mman.h> // for mmap
|
||||
|
||||
// string manipulation
|
||||
#include <string>
|
||||
|
||||
// constants
|
||||
#define PAGE_SIZE 0x10000
|
||||
#define TEST_REGISTER_TRACK_WRITEVAL 0x55AA
|
||||
const size_t PAGE_SIZE = 0x10000;
|
||||
const unsigned int TEST_REGISTER_TRACK_WRITEVAL = 0x55AA;
|
||||
|
||||
fpga_switch::fpga_switch(std::string device_name)
|
||||
{
|
||||
if ((d_device_descriptor = open(device_name.c_str(), O_RDWR | O_SYNC)) == -1)
|
||||
{
|
||||
LOG(WARNING) << "Cannot open deviceio" << device_name;
|
||||
printf("switch memory successfully mapped\n");
|
||||
}
|
||||
d_map_base = reinterpret_cast<volatile unsigned *>(mmap(NULL, PAGE_SIZE,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0));
|
||||
d_map_base = reinterpret_cast<volatile unsigned *>(mmap(nullptr, PAGE_SIZE,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0));
|
||||
|
||||
if (d_map_base == reinterpret_cast<void*>(-1))
|
||||
if (d_map_base == reinterpret_cast<void *>(-1))
|
||||
{
|
||||
LOG(WARNING) << "Cannot map the FPGA switch module into tracking memory";
|
||||
printf("could not map switch memory\n");
|
||||
std::cout << "Could not map switch memory." << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Switch memory successfully mapped." << std::endl;
|
||||
}
|
||||
|
||||
// sanity check : check test register
|
||||
@@ -100,18 +80,21 @@ fpga_switch::fpga_switch(std::string device_name)
|
||||
DLOG(INFO) << "Switch FPGA class created";
|
||||
}
|
||||
|
||||
|
||||
fpga_switch::~fpga_switch()
|
||||
{
|
||||
close_device();
|
||||
}
|
||||
|
||||
|
||||
void fpga_switch::set_switch_position(int switch_position)
|
||||
{
|
||||
d_map_base[0] = switch_position;
|
||||
}
|
||||
|
||||
|
||||
unsigned fpga_switch::fpga_switch_test_register(
|
||||
unsigned writeval)
|
||||
unsigned writeval)
|
||||
{
|
||||
unsigned readval;
|
||||
// write value to test register
|
||||
@@ -122,15 +105,14 @@ unsigned fpga_switch::fpga_switch_test_register(
|
||||
return readval;
|
||||
}
|
||||
|
||||
|
||||
void fpga_switch::close_device()
|
||||
{
|
||||
unsigned * aux = const_cast<unsigned*>(d_map_base);
|
||||
if (munmap(static_cast<void*>(aux), PAGE_SIZE) == -1)
|
||||
unsigned *aux = const_cast<unsigned *>(d_map_base);
|
||||
if (munmap(static_cast<void *>(aux), PAGE_SIZE) == -1)
|
||||
{
|
||||
printf("Failed to unmap memory uio\n");
|
||||
std::cout << "Failed to unmap memory uio" << std::endl;
|
||||
}
|
||||
|
||||
close(d_device_descriptor);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#ifndef GNSS_SDR_FPGA_SWITCH_H_
|
||||
#define GNSS_SDR_FPGA_SWITCH_H_
|
||||
|
||||
#include <gnuradio/block.h>
|
||||
#include <string>
|
||||
|
||||
#define MAX_LENGTH_DEVICEIO_NAME 50
|
||||
|
||||
@@ -47,15 +47,14 @@ public:
|
||||
fpga_switch(std::string device_name);
|
||||
~fpga_switch();
|
||||
void set_switch_position(int switch_position);
|
||||
|
||||
|
||||
private:
|
||||
int d_device_descriptor; // driver descriptor
|
||||
volatile unsigned *d_map_base; // driver memory map
|
||||
int d_device_descriptor; // driver descriptor
|
||||
volatile unsigned *d_map_base; // driver memory map
|
||||
|
||||
// private functions
|
||||
unsigned fpga_switch_test_register(unsigned writeval);
|
||||
void close_device(void);
|
||||
|
||||
void close_device(void);
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_FPGA_SWITCH_H_ */
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
@@ -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<int *>(calloc(max_states, sizeof(int)));
|
||||
out1 = static_cast<int *>(calloc(max_states, sizeof(int)));
|
||||
state0 = static_cast<int *>(calloc(max_states, sizeof(int)));
|
||||
state1 = static_cast<int *>(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<unsigned short int *>(this->d_preambles_bits), static_cast<unsigned short int *>(preambles_bits), GALILEO_INAV_PREAMBLE_LENGTH_BITS * sizeof(unsigned short int));
|
||||
|
||||
// preamble bits to sampled symbols
|
||||
d_preambles_symbols = static_cast<signed int *>(malloc(sizeof(signed int) * d_symbols_per_preamble));
|
||||
d_preambles_symbols = static_cast<int *>(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<int *>(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
out1 = static_cast<int *>(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
state0 = static_cast<int *>(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
state1 = static_cast<int *>(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<Galileo_Ephemeris> tmp_obj = std::make_shared<Galileo_Ephemeris>(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<Galileo_Iono> tmp_obj = std::make_shared<Galileo_Iono>(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<Galileo_Utc_Model> tmp_obj = std::make_shared<Galileo_Utc_Model>(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<Galileo_Almanac> tmp_obj = std::make_shared<Galileo_Almanac>(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;
|
||||
@@ -272,6 +259,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<std::string>(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 +489,3 @@ int galileo_e1b_telemetry_decoder_cc::general_work(int noutput_items __attribute
|
||||
//std::cout<<"GPS L1 TLM output on CH="<<this->d_channel << " SAMPLE STAMP="<<d_sample_counter/d_decimation_output_factor<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
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<std::string>(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -37,9 +37,11 @@
|
||||
#include "galileo_e5a_telemetry_decoder_cc.h"
|
||||
#include "control_message_factory.h"
|
||||
#include "convolutional.h"
|
||||
#include "display.h"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
|
||||
@@ -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<int *>(calloc(max_states, sizeof(int)));
|
||||
out1 = static_cast<int *>(calloc(max_states, sizeof(int)));
|
||||
state0 = static_cast<int *>(calloc(max_states, sizeof(int)));
|
||||
state1 = static_cast<int *>(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<Galileo_Ephemeris> tmp_obj = std::make_shared<Galileo_Ephemeris>(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<Galileo_Iono> tmp_obj = std::make_shared<Galileo_Iono>(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<Galileo_Utc_Model> tmp_obj = std::make_shared<Galileo_Utc_Model>(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<int *>(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
out1 = static_cast<int *>(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
state0 = static_cast<int *>(volk_gnsssdr_malloc(max_states * sizeof(int), volk_gnsssdr_get_alignment()));
|
||||
state1 = static_cast<int *>(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
|
||||
@@ -245,6 +229,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<std::string>(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 +510,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<std::string>(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_ */
|
||||
|
||||
@@ -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<Glonass_Gnav_Ephemeris> tmp_obj = std::make_shared<Glonass_Gnav_Ephemeris>(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<Glonass_Gnav_Utc_Model> tmp_obj = std::make_shared<Glonass_Gnav_Utc_Model>(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<Glonass_Gnav_Almanac> tmp_obj = std::make_shared<Glonass_Gnav_Almanac>(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;
|
||||
@@ -221,6 +224,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<std::string>(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 +446,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<std::string>(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,10 @@
|
||||
|
||||
|
||||
#include "glonass_l2_ca_telemetry_decoder_cc.h"
|
||||
#include "display.h"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
|
||||
|
||||
#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<Glonass_Gnav_Ephemeris> tmp_obj = std::make_shared<Glonass_Gnav_Ephemeris>(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<Glonass_Gnav_Utc_Model> tmp_obj = std::make_shared<Glonass_Gnav_Utc_Model>(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<Glonass_Gnav_Almanac> tmp_obj = std::make_shared<Glonass_Gnav_Almanac>(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;
|
||||
@@ -220,6 +224,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<std::string>(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 +446,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<std::string>(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,9 @@
|
||||
#include "gps_l1_ca_telemetry_decoder_cc.h"
|
||||
#include "control_message_factory.h"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
|
||||
|
||||
#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<signed int *>(malloc(sizeof(signed int) * GPS_CA_PREAMBLE_LENGTH_SYMBOLS));
|
||||
d_preambles_symbols = static_cast<int *>(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
|
||||
@@ -152,6 +151,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<std::string>(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 +448,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<std::string>(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<std::string>(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)
|
||||
{
|
||||
@@ -131,20 +166,20 @@ int gps_l2c_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
|
||||
{
|
||||
// get ephemeris object for this SV
|
||||
std::shared_ptr<Gps_CNAV_Ephemeris> tmp_obj = std::make_shared<Gps_CNAV_Ephemeris>(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<Gps_CNAV_Iono> tmp_obj = std::make_shared<Gps_CNAV_Iono>(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<Gps_CNAV_Utc_Model> tmp_obj = std::make_shared<Gps_CNAV_Utc_Model>(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));
|
||||
}
|
||||
|
||||
@@ -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<std::string>(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <bitset>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
@@ -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<std::string>(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)
|
||||
{
|
||||
@@ -181,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<Gps_CNAV_Ephemeris> tmp_obj = std::make_shared<Gps_CNAV_Ephemeris>(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<Gps_CNAV_Iono> tmp_obj = std::make_shared<Gps_CNAV_Iono>(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<Gps_CNAV_Utc_Model> tmp_obj = std::make_shared<Gps_CNAV_Utc_Model>(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));
|
||||
}
|
||||
|
||||
@@ -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<std::string>(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 <utility>
|
||||
#include <vector>
|
||||
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#include "cnav_msg.h"
|
||||
#include "edc.h"
|
||||
#include "bits.h"
|
||||
|
||||
@@ -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<Gnss_Synchro *>(output_items[0]); // Get the output buffer pointer
|
||||
const Gnss_Synchro *in = reinterpret_cast<const Gnss_Synchro *>(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<double>(in[0].Tracking_sample_counter) / static_cast<double>(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<double> 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<int> 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_candiate_int_t> msg_candidates;
|
||||
d_frame_detector.get_frame_candidates(bits, msg_candidates);
|
||||
|
||||
// verify checksum
|
||||
// and return the valid messages
|
||||
std::vector<msg_candiate_char_t> 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_Msg> sbas_raw_msgs;
|
||||
for (std::vector<msg_candiate_char_t>::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<double>(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<Sbas_Raw_Msg>::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_candiate_int_t> msg_candidates, std::vector<msg_candiate_char_t> &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<unsigned int>(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<Gnss_Synchro *>(output_items[0]); // Get the output buffer pointer
|
||||
const Gnss_Synchro *in = reinterpret_cast<const Gnss_Synchro *>(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<double>(in[0].Tracking_sample_counter) / static_cast<double>(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<double> 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<int> 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_candiate_int_t> msg_candidates;
|
||||
d_frame_detector.get_frame_candidates(bits, msg_candidates);
|
||||
|
||||
// verify checksum
|
||||
// and return the valid messages
|
||||
std::vector<msg_candiate_char_t> 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_Msg> sbas_raw_msgs;
|
||||
for (std::vector<msg_candiate_char_t>::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<double>(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<Sbas_Raw_Msg>::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
|
||||
}
|
||||
|
||||
@@ -39,13 +39,16 @@
|
||||
|
||||
|
||||
//************ GPS WORD TO SUBFRAME DECODER STATE MACHINE **********
|
||||
|
||||
struct Ev_gps_word_valid : sc::event<Ev_gps_word_valid>
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
struct Ev_gps_word_invalid : sc::event<Ev_gps_word_invalid>
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
struct Ev_gps_word_preamble : sc::event<Ev_gps_word_preamble>
|
||||
{
|
||||
};
|
||||
@@ -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());
|
||||
|
||||
@@ -35,7 +35,7 @@ set(TRACKING_ADAPTER_SOURCES
|
||||
gps_l2_m_dll_pll_tracking.cc
|
||||
glonass_l1_ca_dll_pll_tracking.cc
|
||||
glonass_l1_ca_dll_pll_c_aid_tracking.cc
|
||||
gps_l5i_dll_pll_tracking.cc
|
||||
gps_l5_dll_pll_tracking.cc
|
||||
glonass_l2_ca_dll_pll_tracking.cc
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking.cc
|
||||
${OPT_TRACKING_ADAPTERS}
|
||||
|
||||
@@ -102,6 +102,19 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
|
||||
trk_param.system = 'E';
|
||||
char sig_[3] = "1B";
|
||||
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)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user