mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-25 22:52:52 +00:00
used clang-format
This commit is contained in:
parent
9bfe37877e
commit
1d5ff14619
@ -44,12 +44,12 @@
|
|||||||
#include "in_memory_configuration.h"
|
#include "in_memory_configuration.h"
|
||||||
#include "test_flags.h"
|
#include "test_flags.h"
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
#include <cmath> // for abs, pow, floor
|
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <pmt/pmt.h>
|
#include <pmt/pmt.h>
|
||||||
#include <pthread.h>
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <cmath> // for abs, pow, floor
|
||||||
|
#include <pthread.h>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#ifdef GR_GREATER_38
|
#ifdef GR_GREATER_38
|
||||||
@ -98,7 +98,6 @@ public:
|
|||||||
static constexpr float DMA_SIGNAL_SCALING_FACTOR = (pow(2, DMA_BITS_PER_SAMPLE - 1) - 1) / MAX_SAMPLE_VALUE;
|
static constexpr float DMA_SIGNAL_SCALING_FACTOR = (pow(2, DMA_BITS_PER_SAMPLE - 1) - 1) / MAX_SAMPLE_VALUE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
GalileoE1PcpsAmbiguousAcquisitionTestFpga();
|
GalileoE1PcpsAmbiguousAcquisitionTestFpga();
|
||||||
~GalileoE1PcpsAmbiguousAcquisitionTestFpga() = default;
|
~GalileoE1PcpsAmbiguousAcquisitionTestFpga() = default;
|
||||||
|
|
||||||
@ -109,14 +108,11 @@ protected:
|
|||||||
unsigned int doppler_max;
|
unsigned int doppler_max;
|
||||||
unsigned int doppler_step;
|
unsigned int doppler_step;
|
||||||
unsigned int nsamples_to_transfer;
|
unsigned int nsamples_to_transfer;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GalileoE1PcpsAmbiguousAcquisitionTestFpga::GalileoE1PcpsAmbiguousAcquisitionTestFpga()
|
GalileoE1PcpsAmbiguousAcquisitionTestFpga::GalileoE1PcpsAmbiguousAcquisitionTestFpga()
|
||||||
{
|
{
|
||||||
|
|
||||||
config = std::make_shared<InMemoryConfiguration>();
|
config = std::make_shared<InMemoryConfiguration>();
|
||||||
|
|
||||||
doppler_max = 5000;
|
doppler_max = 5000;
|
||||||
@ -211,7 +207,6 @@ void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments)
|
|||||||
|
|
||||||
for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2)
|
for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2)
|
||||||
{
|
{
|
||||||
|
|
||||||
// channel 1 (queue 1) -> E5/L5
|
// channel 1 (queue 1) -> E5/L5
|
||||||
input_samples_dma[dma_index] = static_cast<int8_t>(input_samples[index0] * args->scaling_factor);
|
input_samples_dma[dma_index] = static_cast<int8_t>(input_samples[index0] * args->scaling_factor);
|
||||||
input_samples_dma[dma_index + 1] = static_cast<int8_t>(input_samples[index0 + 1] * args->scaling_factor);
|
input_samples_dma[dma_index + 1] = static_cast<int8_t>(input_samples[index0 + 1] * args->scaling_factor);
|
||||||
@ -220,7 +215,6 @@ void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments)
|
|||||||
input_samples_dma[dma_index + 3] = 0;
|
input_samples_dma[dma_index + 3] = 0;
|
||||||
|
|
||||||
dma_index += 4;
|
dma_index += 4;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (write(tx_fd, input_samples_dma.data(), nsamples_block_size * 2 * 2) != nsamples_block_size * 2 * 2)
|
if (write(tx_fd, input_samples_dma.data(), nsamples_block_size * 2 * 2) != nsamples_block_size * 2 * 2)
|
||||||
@ -238,7 +232,6 @@ void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments)
|
|||||||
{
|
{
|
||||||
file_completed = true;
|
file_completed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -263,7 +256,6 @@ void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void* handler_acquisition_galileo_e1_pcps_ambiguous_acq_test(void* arguments)
|
void* handler_acquisition_galileo_e1_pcps_ambiguous_acq_test(void* arguments)
|
||||||
{
|
{
|
||||||
// the acquisition is a blocking function so we have to
|
// the acquisition is a blocking function so we have to
|
||||||
@ -286,7 +278,6 @@ void* handler_acquisition_galileo_e1_pcps_ambiguous_acq_test(void* arguments)
|
|||||||
class ChannelFsm_galileo_e1_pcps_ambiguous_acq_test : public ChannelFsm
|
class ChannelFsm_galileo_e1_pcps_ambiguous_acq_test : public ChannelFsm
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool Event_valid_acquisition() override
|
bool Event_valid_acquisition() override
|
||||||
{
|
{
|
||||||
acquisition_successful = true;
|
acquisition_successful = true;
|
||||||
@ -318,16 +309,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool acquisition_successful;
|
bool acquisition_successful;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool GalileoE1PcpsAmbiguousAcquisitionTestFpga::acquire_signal()
|
bool GalileoE1PcpsAmbiguousAcquisitionTestFpga::acquire_signal()
|
||||||
{
|
{
|
||||||
|
|
||||||
pthread_t thread_DMA, thread_acquisition;
|
pthread_t thread_DMA, thread_acquisition;
|
||||||
|
|
||||||
// 1. Setup GNU Radio flowgraph (file_source -> Acquisition_10m)
|
// 1. Setup GNU Radio flowgraph (file_source -> Acquisition_10m)
|
||||||
@ -477,6 +464,4 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTestFpga, ValidationOfResults)
|
|||||||
|
|
||||||
EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)";
|
EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)";
|
||||||
EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
|
EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,10 +43,10 @@
|
|||||||
#include "in_memory_configuration.h"
|
#include "in_memory_configuration.h"
|
||||||
#include "test_flags.h"
|
#include "test_flags.h"
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
#include <cmath> // for abs, pow, floor
|
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <cmath> // for abs, pow, floor
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
@ -96,7 +96,6 @@ public:
|
|||||||
static constexpr float DMA_SIGNAL_SCALING_FACTOR = (pow(2, DMA_BITS_PER_SAMPLE - 1) - 1) / MAX_SAMPLE_VALUE;
|
static constexpr float DMA_SIGNAL_SCALING_FACTOR = (pow(2, DMA_BITS_PER_SAMPLE - 1) - 1) / MAX_SAMPLE_VALUE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
GpsL1CaPcpsAcquisitionTestFpga();
|
GpsL1CaPcpsAcquisitionTestFpga();
|
||||||
~GpsL1CaPcpsAcquisitionTestFpga() = default;
|
~GpsL1CaPcpsAcquisitionTestFpga() = default;
|
||||||
|
|
||||||
@ -107,14 +106,11 @@ protected:
|
|||||||
unsigned int doppler_max;
|
unsigned int doppler_max;
|
||||||
unsigned int doppler_step;
|
unsigned int doppler_step;
|
||||||
unsigned int nsamples_to_transfer;
|
unsigned int nsamples_to_transfer;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GpsL1CaPcpsAcquisitionTestFpga::GpsL1CaPcpsAcquisitionTestFpga()
|
GpsL1CaPcpsAcquisitionTestFpga::GpsL1CaPcpsAcquisitionTestFpga()
|
||||||
{
|
{
|
||||||
|
|
||||||
config = std::make_shared<InMemoryConfiguration>();
|
config = std::make_shared<InMemoryConfiguration>();
|
||||||
|
|
||||||
doppler_max = 5000;
|
doppler_max = 5000;
|
||||||
@ -209,7 +205,6 @@ void* handler_DMA_gps_l1_acq_test(void* arguments)
|
|||||||
|
|
||||||
for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2)
|
for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2)
|
||||||
{
|
{
|
||||||
|
|
||||||
// channel 1 (queue 1) -> E5/L5
|
// channel 1 (queue 1) -> E5/L5
|
||||||
input_samples_dma[dma_index] = static_cast<int8_t>(input_samples[index0] * args->scaling_factor);
|
input_samples_dma[dma_index] = static_cast<int8_t>(input_samples[index0] * args->scaling_factor);
|
||||||
input_samples_dma[dma_index + 1] = static_cast<int8_t>(input_samples[index0 + 1] * args->scaling_factor);
|
input_samples_dma[dma_index + 1] = static_cast<int8_t>(input_samples[index0 + 1] * args->scaling_factor);
|
||||||
@ -218,7 +213,6 @@ void* handler_DMA_gps_l1_acq_test(void* arguments)
|
|||||||
input_samples_dma[dma_index + 3] = 0;
|
input_samples_dma[dma_index + 3] = 0;
|
||||||
|
|
||||||
dma_index += 4;
|
dma_index += 4;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (write(tx_fd, input_samples_dma.data(), nsamples_block_size * 2 * 2) != nsamples_block_size * 2 * 2)
|
if (write(tx_fd, input_samples_dma.data(), nsamples_block_size * 2 * 2) != nsamples_block_size * 2 * 2)
|
||||||
@ -236,7 +230,6 @@ void* handler_DMA_gps_l1_acq_test(void* arguments)
|
|||||||
{
|
{
|
||||||
file_completed = true;
|
file_completed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -261,7 +254,6 @@ void* handler_DMA_gps_l1_acq_test(void* arguments)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void* handler_acquisition_gps_l1_acq_test(void* arguments)
|
void* handler_acquisition_gps_l1_acq_test(void* arguments)
|
||||||
{
|
{
|
||||||
// the acquisition is a blocking function so we have to
|
// the acquisition is a blocking function so we have to
|
||||||
@ -284,7 +276,6 @@ void* handler_acquisition_gps_l1_acq_test(void* arguments)
|
|||||||
class ChannelFsm_gps_l1_acq_test : public ChannelFsm
|
class ChannelFsm_gps_l1_acq_test : public ChannelFsm
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool Event_valid_acquisition() override
|
bool Event_valid_acquisition() override
|
||||||
{
|
{
|
||||||
acquisition_successful = true;
|
acquisition_successful = true;
|
||||||
@ -316,16 +307,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool acquisition_successful;
|
bool acquisition_successful;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool GpsL1CaPcpsAcquisitionTestFpga::acquire_signal()
|
bool GpsL1CaPcpsAcquisitionTestFpga::acquire_signal()
|
||||||
{
|
{
|
||||||
|
|
||||||
pthread_t thread_DMA, thread_acquisition;
|
pthread_t thread_DMA, thread_acquisition;
|
||||||
|
|
||||||
// 1. Setup GNU Radio flowgraph (file_source -> Acquisition_10m)
|
// 1. Setup GNU Radio flowgraph (file_source -> Acquisition_10m)
|
||||||
@ -475,6 +462,4 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults)
|
|||||||
|
|
||||||
EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)";
|
EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)";
|
||||||
EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
|
EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,7 +272,6 @@ public:
|
|||||||
|
|
||||||
static const int32_t TEST_OBS_SKIP_SAMPLES = 1024;
|
static const int32_t TEST_OBS_SKIP_SAMPLES = 1024;
|
||||||
static constexpr float DMA_SIGNAL_SCALING_FACTOR = 8.0;
|
static constexpr float DMA_SIGNAL_SCALING_FACTOR = 8.0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int HybridObservablesTestFpga::configure_generator()
|
int HybridObservablesTestFpga::configure_generator()
|
||||||
@ -431,7 +430,6 @@ void* handler_DMA_obs_test(void* arguments)
|
|||||||
|
|
||||||
for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2)
|
for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (args->freq_band == 0)
|
if (args->freq_band == 0)
|
||||||
{
|
{
|
||||||
// channel 1 (queue 1) -> E5/L5
|
// channel 1 (queue 1) -> E5/L5
|
||||||
@ -440,7 +438,6 @@ void* handler_DMA_obs_test(void* arguments)
|
|||||||
// channel 0 (queue 0) -> E1/L1
|
// channel 0 (queue 0) -> E1/L1
|
||||||
input_samples_dma[dma_index + 2] = static_cast<int8_t>(input_samples[index0] * args->scaling_factor);
|
input_samples_dma[dma_index + 2] = static_cast<int8_t>(input_samples[index0] * args->scaling_factor);
|
||||||
input_samples_dma[dma_index + 3] = static_cast<int8_t>(input_samples[index0 + 1] * args->scaling_factor);
|
input_samples_dma[dma_index + 3] = static_cast<int8_t>(input_samples[index0 + 1] * args->scaling_factor);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -453,7 +450,6 @@ void* handler_DMA_obs_test(void* arguments)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dma_index += 4;
|
dma_index += 4;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//std::cout << "DMA: sending nsamples_block_size = " << nsamples_block_size << " samples" << std::endl;
|
//std::cout << "DMA: sending nsamples_block_size = " << nsamples_block_size << " samples" << std::endl;
|
||||||
@ -472,7 +468,6 @@ void* handler_DMA_obs_test(void* arguments)
|
|||||||
{
|
{
|
||||||
file_completed = true;
|
file_completed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -497,10 +492,6 @@ void* handler_DMA_obs_test(void* arguments)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// When using the FPGA the acquisition class calls the states
|
// When using the FPGA the acquisition class calls the states
|
||||||
// of the channel finite state machine directly. This is done
|
// of the channel finite state machine directly. This is done
|
||||||
// in order to reduce the latency of the receiver when going
|
// in order to reduce the latency of the receiver when going
|
||||||
@ -513,7 +504,6 @@ void* handler_DMA_obs_test(void* arguments)
|
|||||||
class ChannelFsm_obs_test : public ChannelFsm
|
class ChannelFsm_obs_test : public ChannelFsm
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool Event_valid_acquisition() override
|
bool Event_valid_acquisition() override
|
||||||
{
|
{
|
||||||
acquisition_successful = true;
|
acquisition_successful = true;
|
||||||
@ -545,14 +535,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool acquisition_successful;
|
bool acquisition_successful;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool HybridObservablesTestFpga::acquire_signal()
|
bool HybridObservablesTestFpga::acquire_signal()
|
||||||
{
|
{
|
||||||
|
|
||||||
pthread_t thread_DMA, thread_acquisition;
|
pthread_t thread_DMA, thread_acquisition;
|
||||||
|
|
||||||
// 1. Setup GNU Radio flowgraph (file_source -> Acquisition_10m)
|
// 1. Setup GNU Radio flowgraph (file_source -> Acquisition_10m)
|
||||||
@ -597,7 +584,6 @@ bool HybridObservablesTestFpga::acquire_signal()
|
|||||||
acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
||||||
|
|
||||||
args.freq_band = 0; // frequency band on which the DMA has to transfer the samples
|
args.freq_band = 0; // frequency band on which the DMA has to transfer the samples
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking_Fpga")
|
else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking_Fpga")
|
||||||
{
|
{
|
||||||
@ -610,7 +596,6 @@ bool HybridObservablesTestFpga::acquire_signal()
|
|||||||
acquisition = std::make_shared<GalileoE1PcpsAmbiguousAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
acquisition = std::make_shared<GalileoE1PcpsAmbiguousAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
||||||
|
|
||||||
args.freq_band = 0; // frequency band on which the DMA has to transfer the samples
|
args.freq_band = 0; // frequency band on which the DMA has to transfer the samples
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_Fpga")
|
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_Fpga")
|
||||||
{
|
{
|
||||||
@ -623,7 +608,6 @@ bool HybridObservablesTestFpga::acquire_signal()
|
|||||||
acquisition = std::make_shared<GalileoE5aPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
acquisition = std::make_shared<GalileoE5aPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
||||||
|
|
||||||
args.freq_band = 1; // frequency band on which the DMA has to transfer the samples
|
args.freq_band = 1; // frequency band on which the DMA has to transfer the samples
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (implementation == "GPS_L5_DLL_PLL_Tracking_Fpga")
|
else if (implementation == "GPS_L5_DLL_PLL_Tracking_Fpga")
|
||||||
{
|
{
|
||||||
@ -636,7 +620,6 @@ bool HybridObservablesTestFpga::acquire_signal()
|
|||||||
acquisition = std::make_shared<GpsL5iPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
acquisition = std::make_shared<GpsL5iPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
||||||
|
|
||||||
args.freq_band = 1; // frequency band on which the DMA has to transfer the samples
|
args.freq_band = 1; // frequency band on which the DMA has to transfer the samples
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -696,7 +679,6 @@ bool HybridObservablesTestFpga::acquire_signal()
|
|||||||
|
|
||||||
for (unsigned int PRN = 1; PRN < MAX_PRN_IDX; PRN++)
|
for (unsigned int PRN = 1; PRN < MAX_PRN_IDX; PRN++)
|
||||||
{
|
{
|
||||||
|
|
||||||
tmp_gnss_synchro.PRN = PRN;
|
tmp_gnss_synchro.PRN = PRN;
|
||||||
|
|
||||||
channel_fsm_->Event_clear_test_result();
|
channel_fsm_->Event_clear_test_result();
|
||||||
@ -774,7 +756,6 @@ bool HybridObservablesTestFpga::acquire_signal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::cout.flush();
|
std::cout.flush();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "]" << std::endl;
|
std::cout << "]" << std::endl;
|
||||||
@ -1976,7 +1957,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
|
|||||||
std::string file;
|
std::string file;
|
||||||
|
|
||||||
ASSERT_NO_THROW({
|
ASSERT_NO_THROW({
|
||||||
|
|
||||||
if (!FLAGS_enable_external_signal_file)
|
if (!FLAGS_enable_external_signal_file)
|
||||||
{
|
{
|
||||||
file = "./" + filename_raw_data;
|
file = "./" + filename_raw_data;
|
||||||
@ -2100,7 +2080,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!FLAGS_duplicated_satellites_test)
|
if (!FLAGS_duplicated_satellites_test)
|
||||||
{
|
{
|
||||||
ASSERT_EQ(ReadRinexObs(&true_obs_vec, gnss_synchro_master), true)
|
ASSERT_EQ(ReadRinexObs(&true_obs_vec, gnss_synchro_master), true)
|
||||||
@ -2109,7 +2088,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// read measured values
|
// read measured values
|
||||||
Observables_Dump_Reader estimated_observables(tracking_ch_vec.size());
|
Observables_Dump_Reader estimated_observables(tracking_ch_vec.size());
|
||||||
ASSERT_NO_THROW({
|
ASSERT_NO_THROW({
|
||||||
@ -2377,6 +2355,5 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::cout << "Test completed in " << elapsed_seconds.count() << " [s]" << std::endl;
|
std::cout << "Test completed in " << elapsed_seconds.count() << " [s]" << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* -------------------------------------------------------------------------
|
* -------------------------------------------------------------------------
|
||||||
|
*
|
||||||
* Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
|
* Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
|
||||||
*
|
*
|
||||||
* GNSS-SDR is a software defined Global Navigation
|
* GNSS-SDR is a software defined Global Navigation
|
||||||
@ -61,9 +62,9 @@
|
|||||||
#include <gnuradio/top_block.h>
|
#include <gnuradio/top_block.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <pmt/pmt.h>
|
#include <pmt/pmt.h>
|
||||||
#include <pthread.h>
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <pthread.h>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -249,23 +250,18 @@ void* handler_DMA_trk_pull_in_test(void* arguments)
|
|||||||
|
|
||||||
for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2)
|
for (int index0 = 0; index0 < (nsamples_block_size * 2); index0 += 2)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (args->freq_band == 0)
|
if (args->freq_band == 0)
|
||||||
{
|
{
|
||||||
// channel 1 (queue 1) -> E5/L5
|
// channel 1 (queue 1) -> E5/L5
|
||||||
input_samples_dma[dma_index] = 0;
|
input_samples_dma[dma_index] = 0;
|
||||||
input_samples_dma[dma_index + 1] = 0;
|
input_samples_dma[dma_index + 1] = 0;
|
||||||
// channel 0 (queue 0) -> E1/L1
|
// channel 0 (queue 0) -> E1/L1
|
||||||
// input_samples_dma[dma_index + 2] = input_samples[index0];
|
|
||||||
// input_samples_dma[dma_index + 3] = input_samples[index0 + 1];
|
|
||||||
input_samples_dma[dma_index + 2] = static_cast<int8_t>(input_samples[index0] * args->scaling_factor);
|
input_samples_dma[dma_index + 2] = static_cast<int8_t>(input_samples[index0] * args->scaling_factor);
|
||||||
input_samples_dma[dma_index + 3] = static_cast<int8_t>(input_samples[index0 + 1] * args->scaling_factor);
|
input_samples_dma[dma_index + 3] = static_cast<int8_t>(input_samples[index0 + 1] * args->scaling_factor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// channel 1 (queue 1) -> E5/L5
|
// channel 1 (queue 1) -> E5/L5
|
||||||
// input_samples_dma[dma_index] = input_samples[index0];
|
|
||||||
// input_samples_dma[dma_index + 1] = input_samples[index0 + 1];
|
|
||||||
input_samples_dma[dma_index] = static_cast<int8_t>(input_samples[index0] * args->scaling_factor);
|
input_samples_dma[dma_index] = static_cast<int8_t>(input_samples[index0] * args->scaling_factor);
|
||||||
input_samples_dma[dma_index + 1] = static_cast<int8_t>(input_samples[index0 + 1] * args->scaling_factor);
|
input_samples_dma[dma_index + 1] = static_cast<int8_t>(input_samples[index0 + 1] * args->scaling_factor);
|
||||||
// channel 0 (queue 0) -> E1/L1
|
// channel 0 (queue 0) -> E1/L1
|
||||||
@ -274,7 +270,6 @@ void* handler_DMA_trk_pull_in_test(void* arguments)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dma_index += 4;
|
dma_index += 4;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (write(tx_fd, input_samples_dma.data(), nsamples_block_size * 2 * 2) != nsamples_block_size * 2 * 2)
|
if (write(tx_fd, input_samples_dma.data(), nsamples_block_size * 2 * 2) != nsamples_block_size * 2 * 2)
|
||||||
@ -292,7 +287,6 @@ void* handler_DMA_trk_pull_in_test(void* arguments)
|
|||||||
{
|
{
|
||||||
file_completed = true;
|
file_completed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -396,7 +390,6 @@ public:
|
|||||||
|
|
||||||
static const int32_t TEST_TRK_PULL_IN_TEST_SKIP_SAMPLES = 1024; //48
|
static const int32_t TEST_TRK_PULL_IN_TEST_SKIP_SAMPLES = 1024; //48
|
||||||
static constexpr float DMA_SIGNAL_SCALING_FACTOR = 8.0;
|
static constexpr float DMA_SIGNAL_SCALING_FACTOR = 8.0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int TrackingPullInTestFpga::configure_generator(double CN0_dBHz, int file_idx)
|
int TrackingPullInTestFpga::configure_generator(double CN0_dBHz, int file_idx)
|
||||||
@ -457,7 +450,6 @@ int TrackingPullInTestFpga::generate_signal()
|
|||||||
class ChannelFsm_trk_pull_in_test : public ChannelFsm
|
class ChannelFsm_trk_pull_in_test : public ChannelFsm
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool Event_valid_acquisition() override
|
bool Event_valid_acquisition() override
|
||||||
{
|
{
|
||||||
acquisition_successful = true;
|
acquisition_successful = true;
|
||||||
@ -489,9 +481,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool acquisition_successful;
|
bool acquisition_successful;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void TrackingPullInTestFpga::configure_receiver(
|
void TrackingPullInTestFpga::configure_receiver(
|
||||||
@ -583,7 +573,6 @@ void TrackingPullInTestFpga::configure_receiver(
|
|||||||
|
|
||||||
bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
|
bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
|
||||||
{
|
{
|
||||||
|
|
||||||
pthread_t thread_DMA, thread_acquisition;
|
pthread_t thread_DMA, thread_acquisition;
|
||||||
|
|
||||||
// fsm
|
// fsm
|
||||||
@ -625,7 +614,6 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
|
|||||||
acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
||||||
|
|
||||||
args.freq_band = 0; // frequency band on which the DMA has to transfer the samples
|
args.freq_band = 0; // frequency band on which the DMA has to transfer the samples
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking_Fpga")
|
else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking_Fpga")
|
||||||
{
|
{
|
||||||
@ -638,7 +626,6 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
|
|||||||
acquisition = std::make_shared<GalileoE1PcpsAmbiguousAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
acquisition = std::make_shared<GalileoE1PcpsAmbiguousAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
||||||
|
|
||||||
args.freq_band = 0; // frequency band on which the DMA has to transfer the samples
|
args.freq_band = 0; // frequency band on which the DMA has to transfer the samples
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_Fpga")
|
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_Fpga")
|
||||||
{
|
{
|
||||||
@ -651,7 +638,6 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
|
|||||||
acquisition = std::make_shared<GalileoE5aPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
acquisition = std::make_shared<GalileoE5aPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
||||||
|
|
||||||
args.freq_band = 1; // frequency band on which the DMA has to transfer the samples
|
args.freq_band = 1; // frequency band on which the DMA has to transfer the samples
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (implementation == "GPS_L5_DLL_PLL_Tracking_Fpga")
|
else if (implementation == "GPS_L5_DLL_PLL_Tracking_Fpga")
|
||||||
{
|
{
|
||||||
@ -664,7 +650,6 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
|
|||||||
acquisition = std::make_shared<GpsL5iPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
acquisition = std::make_shared<GpsL5iPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 0);
|
||||||
|
|
||||||
args.freq_band = 1; // frequency band on which the DMA has to transfer the samples
|
args.freq_band = 1; // frequency band on which the DMA has to transfer the samples
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -728,7 +713,6 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
|
|||||||
|
|
||||||
for (unsigned int PRN = 1; PRN < MAX_PRN_IDX; PRN++)
|
for (unsigned int PRN = 1; PRN < MAX_PRN_IDX; PRN++)
|
||||||
{
|
{
|
||||||
|
|
||||||
tmp_gnss_synchro.PRN = PRN;
|
tmp_gnss_synchro.PRN = PRN;
|
||||||
|
|
||||||
channel_fsm_->Event_clear_test_result();
|
channel_fsm_->Event_clear_test_result();
|
||||||
@ -810,7 +794,6 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::cout.flush();
|
std::cout.flush();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "]" << std::endl;
|
std::cout << "]" << std::endl;
|
||||||
@ -1010,7 +993,6 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults)
|
|||||||
acquisition->stop_acquisition(); // reset the whole system including the sample counters
|
acquisition->stop_acquisition(); // reset the whole system including the sample counters
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// create flowgraph
|
// create flowgraph
|
||||||
top_block = gr::make_top_block("Tracking test");
|
top_block = gr::make_top_block("Tracking test");
|
||||||
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1);
|
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", config->property("Tracking.implementation", std::string("undefined")), 1, 1);
|
||||||
@ -1043,8 +1025,6 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults)
|
|||||||
gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro));
|
gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro));
|
||||||
top_block->connect(tracking->get_right_block(), 0, sink, 0);
|
top_block->connect(tracking->get_right_block(), 0, sink, 0);
|
||||||
top_block->msg_connect(tracking->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
|
top_block->msg_connect(tracking->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
|
||||||
|
|
||||||
|
|
||||||
}) << "Failure connecting the blocks of tracking test.";
|
}) << "Failure connecting the blocks of tracking test.";
|
||||||
|
|
||||||
|
|
||||||
@ -1057,7 +1037,6 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults)
|
|||||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
top_block->start();
|
top_block->start();
|
||||||
|
|
||||||
|
|
||||||
@ -1338,8 +1317,5 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults)
|
|||||||
g4.savetops("trk_pull_in_grid_external_file");
|
g4.savetops("trk_pull_in_grid_external_file");
|
||||||
g4.savetopdf("trk_pull_in_grid_external_file", 12);
|
g4.savetopdf("trk_pull_in_grid_external_file", 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user