Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into vtl_experimental

This commit is contained in:
Javier Arribas
2020-12-01 12:51:34 +01:00
45 changed files with 756 additions and 201 deletions
@@ -111,6 +111,13 @@ target_include_directories(tracking_adapters
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(ENABLE_FPGA)
target_link_libraries(tracking_adapters
PRIVATE
core_libs
)
endif()
if(ENABLE_CUDA)
if(CMAKE_VERSION VERSION_GREATER 3.11)
target_include_directories(tracking_adapters
@@ -30,6 +30,7 @@
#include "dll_pll_conf_fpga.h"
#include "galileo_e1_signal_replica.h"
#include "gnss_sdr_flags.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
#include <array>
@@ -63,15 +64,14 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga(
const std::array<char, 3> sig_{'1', 'B', '\0'};
std::memcpy(trk_params_fpga.signal, sig_.data(), 3);
// FPGA configuration parameters
// obtain the number of the first uio device corresponding to a HW accelerator in the FPGA
// that can be assigned to the tracking of the E1 signal
trk_params_fpga.dev_file_num = configuration->property(role + ".dev_file_num", 15);
// UIO device file
device_name = configuration->property(role + ".devicename", default_device_name);
// compute the number of tracking channels that have already been instantiated. The order in which
// GNSS-SDR instantiates the tracking channels i L1, L2, L5, E1, E5a
trk_params_fpga.num_prev_assigned_ch = configuration->property("Channels_1C.count", 0) +
configuration->property("Channels_2S.count", 0) +
configuration->property("Channels_L5.count", 0);
num_prev_assigned_ch = configuration->property("Channels_1C.count", 0) +
configuration->property("Channels_2S.count", 0) +
configuration->property("Channels_L5.count", 0);
// ################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 2;
@@ -184,7 +184,16 @@ void GalileoE1DllPllVemlTrackingFpga::start_tracking()
void GalileoE1DllPllVemlTrackingFpga::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_fpga_sc->set_channel(channel);
// UIO device file
std::string device_io_name;
// find the uio device file corresponding to the tracking multicorrelator
if (find_uio_dev_file_name(device_io_name, device_name, channel - num_prev_assigned_ch) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
tracking_fpga_sc->set_channel(channel, device_io_name);
}
@@ -126,11 +126,16 @@ public:
void stop_tracking() override;
private:
const std::string default_device_name = "multicorrelator_resampler_5_1_AXI"; // UIO device name
// the following flags are FPGA-specific and they are using arrange the values of the local code in the way the FPGA
// expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking.
static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000; // flag that enables WE (Write Enable) of the local code FPGA
static const int32_t LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT = 0x20000000; // flag that selects the writing of the pilot code in the FPGA (as opposed to the data code)
std::string device_name;
uint32_t num_prev_assigned_ch;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
uint32_t channel_;
std::string role_;
@@ -25,6 +25,7 @@
#include "dll_pll_conf_fpga.h"
#include "galileo_e5_signal_replica.h"
#include "gnss_sdr_flags.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
#include <array>
@@ -60,19 +61,18 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga(
d_data_codes = nullptr;
// FPGA configuration parameters
// obtain the number of the first uio device corresponding to a HW accelerator in the FPGA
// that can be assigned to the tracking of the E5a signal
trk_params_fpga.dev_file_num = configuration->property(role + ".dev_file_num", 27);
// UIO device file
device_name = configuration->property(role + ".devicename", default_device_name);
// compute the number of tracking channels that have already been instantiated. The order in which
// GNSS-SDR instantiates the tracking channels i L1, L2, L5, E1, E5a
// However E5a can use the same tracking HW accelerators as L5 (but not simultaneously).
// Therefore for the proper assignment of the FPGA tracking device file numbers to the E5a tracking channels,
// the number of channels that have already been assigned to L5 must not be substracted to this channel number,
// so they are not counted here.
trk_params_fpga.num_prev_assigned_ch = configuration->property("Channels_1C.count", 0) +
configuration->property("Channels_2S.count", 0) +
configuration->property("Channels_1B.count", 0);
num_prev_assigned_ch = configuration->property("Channels_1C.count", 0) +
configuration->property("Channels_2S.count", 0) +
configuration->property("Channels_1B.count", 0);
// ################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 1;
@@ -207,7 +207,16 @@ void GalileoE5aDllPllTrackingFpga::stop_tracking()
void GalileoE5aDllPllTrackingFpga::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_fpga_sc->set_channel(channel);
// UIO device file
std::string device_io_name;
// find the uio device file corresponding to the tracking multicorrelator
if (find_uio_dev_file_name(device_io_name, device_name, channel - num_prev_assigned_ch) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
tracking_fpga_sc->set_channel(channel, device_io_name);
}
@@ -119,11 +119,15 @@ public:
void stop_tracking() override;
private:
const std::string default_device_name = "multicorrelator_resampler_3_1_AXI"; // UIO device name
// the following flags are FPGA-specific and they are using arrange the values of the local code in the way the FPGA
// expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking.
static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000; // flag that enables WE (Write Enable) of the local code FPGA
static const int32_t LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT = 0x20000000; // flag that selects the writing of the pilot code in the FPGA (as opposed to the data code)
std::string device_name;
uint32_t num_prev_assigned_ch;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
uint32_t channel_;
@@ -30,6 +30,7 @@
#include "dll_pll_conf_fpga.h"
#include "gnss_sdr_flags.h"
#include "gps_sdr_signal_replica.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <array>
@@ -68,13 +69,12 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga(
const std::array<char, 3> sig_{'1', 'C', '\0'};
std::memcpy(trk_params_fpga.signal, sig_.data(), 3);
// FPGA configuration parameters
// obtain the number of the first uio device corresponding to a HW accelerator in the FPGA
// that can be assigned to the tracking of the L1 signal
trk_params_fpga.dev_file_num = configuration->property(role + ".dev_file_num", 3);
// UIO device file
device_name = configuration->property(role + ".devicename", default_device_name);
// compute the number of tracking channels that have already been instantiated. The order in which
// GNSS-SDR instantiates the tracking channels i L1, l2, L5, E1, E5a
trk_params_fpga.num_prev_assigned_ch = 0;
num_prev_assigned_ch = 0;
// ################# PRE-COMPUTE ALL THE CODES #################
d_ca_codes = static_cast<int32_t*>(volk_gnsssdr_malloc(static_cast<int32_t>(GPS_L1_CA_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int32_t), volk_gnsssdr_get_alignment()));
@@ -153,7 +153,17 @@ void GpsL1CaDllPllTrackingFpga::stop_tracking()
void GpsL1CaDllPllTrackingFpga::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_fpga_sc->set_channel(channel);
// UIO device file
std::string device_io_name;
// find the uio device file corresponding to the tracking multicorrelator
if (find_uio_dev_file_name(device_io_name, device_name, channel - num_prev_assigned_ch) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
tracking_fpga_sc->set_channel(channel, device_io_name);
}
@@ -124,12 +124,16 @@ public:
void stop_tracking() override;
private:
const std::string default_device_name = "multicorrelator_resampler_S00_AXI"; // UIO device name
static const uint32_t NUM_PRNs = 32; // total number of PRNs
static const int32_t GPS_CA_BIT_DURATION_MS = 20;
// the following flag is FPGA-specific and they are using arrange the values of the local code in the way the FPGA
// expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking.
static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000; // flag that enables WE (Write Enable) of the local code FPGA
std::string device_name;
uint32_t num_prev_assigned_ch;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
uint32_t channel_;
@@ -32,6 +32,7 @@
#include "gnss_sdr_flags.h"
#include "gnss_synchro.h"
#include "gps_l2c_signal_replica.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
#include <array>
@@ -66,12 +67,12 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga(
const std::array<char, 3> sig_{'2', 'S', '\0'};
std::memcpy(trk_params_fpga.signal, sig_.data(), 3);
// FPGA configuration parameters
// obtain the number of the first uio device file that is assigned to the FPGA L2 tracking multicorrelator HW accelerators
trk_params_fpga.dev_file_num = configuration->property(role + ".dev_file_num", 27);
// UIO device file
device_name = configuration->property(role + ".devicename", default_device_name);
// compute the number of tracking channels that have already been instantiated. The order in which
// GNSS-SDR instantiates the tracking channels i L1, L2, L5, E1, E5a
trk_params_fpga.num_prev_assigned_ch = configuration->property("Channels_1C.count", 0);
num_prev_assigned_ch = configuration->property("Channels_1C.count", 0);
volk_gnsssdr::vector<float> ca_codes_f(static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS), 0.0);
// ################# PRE-COMPUTE ALL THE CODES #################
@@ -130,7 +131,17 @@ void GpsL2MDllPllTrackingFpga::stop_tracking()
void GpsL2MDllPllTrackingFpga::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_fpga_sc->set_channel(channel);
// UIO device file
std::string device_io_name;
// find the uio device file corresponding to the tracking multicorrelator
if (find_uio_dev_file_name(device_io_name, device_name, channel - num_prev_assigned_ch) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
tracking_fpga_sc->set_channel(channel, device_io_name);
}
@@ -95,6 +95,11 @@ public:
void stop_tracking() override;
private:
const std::string default_device_name = "multicorrelator_resampler_S00_AXI"; // UIO device name
std::string device_name;
uint32_t num_prev_assigned_ch;
static const uint32_t NUM_PRNs = 32;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
unsigned int channel_;
@@ -32,6 +32,7 @@
#include "dll_pll_conf_fpga.h"
#include "gnss_sdr_flags.h"
#include "gps_l5_signal_replica.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <volk_gnsssdr/volk_gnsssdr_alloc.h>
#include <array>
@@ -65,14 +66,13 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga(
const std::array<char, 3> sig_{'L', '5', '\0'};
std::memcpy(trk_params_fpga.signal, sig_.data(), 3);
// FPGA configuration parameters
// obtain the number of the first uio device corresponding to a HW accelerator in the FPGA
// that can be assigned to the tracking of the L5 signal
trk_params_fpga.dev_file_num = configuration->property(role + ".dev_file_num", 27);
// UIO device file
device_name = configuration->property(role + ".devicename", default_device_name);
// compute the number of tracking channels that have already been instantiated. The order in which
// GNSS-SDR instantiates the tracking channels i L1, L2, L5, E1, E5a
trk_params_fpga.num_prev_assigned_ch = configuration->property("Channels_1C.count", 0) +
configuration->property("Channels_2S.count", 0);
num_prev_assigned_ch = configuration->property("Channels_1C.count", 0) +
configuration->property("Channels_2S.count", 0);
// ################# PRE-COMPUTE ALL THE CODES #################
uint32_t code_samples_per_chip = 1;
@@ -215,7 +215,17 @@ void GpsL5DllPllTrackingFpga::stop_tracking()
void GpsL5DllPllTrackingFpga::set_channel(unsigned int channel)
{
channel_ = channel;
tracking_fpga_sc->set_channel(channel);
// UIO device file
std::string device_io_name;
// find the uio device file corresponding to the tracking multicorrelator
if (find_uio_dev_file_name(device_io_name, device_name, channel - num_prev_assigned_ch) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
tracking_fpga_sc->set_channel(channel, device_io_name);
}
@@ -125,6 +125,8 @@ public:
void stop_tracking() override;
private:
const std::string default_device_name = "multicorrelator_resampler_3_1_AXI"; // UIO device name
static const uint32_t NUM_PRNs = 32; // total number of PRNs
// the following flags are FPGA-specific and they are using arrange the values of the local code in the way the FPGA
@@ -132,6 +134,9 @@ private:
static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000; // flag that enables WE (Write Enable) of the local code FPGA
static const int32_t LOCAL_CODE_FPGA_CORRELATOR_SELECT_COUNT = 0x20000000; // flag that selects the writing of the pilot code in the FPGA (as opposed to the data code)
std::string device_name;
uint32_t num_prev_assigned_ch;
dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
uint32_t channel_;
std::string role_;