1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-13 13:47:15 +00:00

The sample counter, the Acquisition and the Switch determine the uio device file that is assigned to them using the hardware accelerator device name in the FPGA

This commit is contained in:
Marc Majoral
2020-11-26 17:07:15 +01:00
parent 15c1f907bf
commit a53109c718
22 changed files with 294 additions and 32 deletions

View File

@@ -129,6 +129,10 @@ if(ENABLE_FPGA)
Volk::volk
Volkgnsssdr::volkgnsssdr
)
target_include_directories(acquisition_adapters
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/libs
)
endif()
target_include_directories(acquisition_adapters

View File

@@ -24,6 +24,7 @@
#include "galileo_e1_signal_replica.h"
#include "gnss_sdr_flags.h"
#include "gnss_sdr_make_unique.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <gnuradio/fft/fft.h> // for fft_complex
#include <gnuradio/gr_complex.h> // for gr_complex
@@ -77,11 +78,19 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
float nbits = ceilf(log2f(static_cast<float>(code_length) * 2.0F));
uint32_t nsamples_total = pow(2, nbits);
uint32_t select_queue_Fpga = configuration->property(role + ".select_queue_Fpga", 0);
acq_parameters.select_queue_Fpga = select_queue_Fpga;
std::string default_device_name = "/dev/uio0";
// UIO device file
std::string device_io_name;
std::string device_name = configuration->property(role + ".devicename", default_device_name);
acq_parameters.device_name = device_name;
// find the uio device file corresponding to the GNSS reset module
if (find_uio_dev_file_name(device_io_name, device_name, 0) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
acq_parameters.device_name = device_io_name;
acq_parameters.samples_per_code = nsamples_total;
acq_parameters.excludelimit = static_cast<unsigned int>(1 + ceil((1.0 / GALILEO_E1_CODE_CHIP_RATE_CPS) * static_cast<float>(fs_in)));

View File

@@ -183,6 +183,8 @@ public:
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private:
const std::string default_device_name = "acquisition_S00_AXI"; // UIO device name
// the following flags are FPGA-specific and they are using arrange the values of the fft 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 uint32_t quant_bits_local_code = 16;

View File

@@ -24,6 +24,7 @@
#include "galileo_e5_signal_replica.h"
#include "gnss_sdr_flags.h"
#include "gnss_sdr_make_unique.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <gnuradio/fft/fft.h> // for fft_complex
#include <gnuradio/gr_complex.h> // for gr_complex
@@ -80,11 +81,19 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(
uint32_t nsamples_total = pow(2, nbits);
uint32_t select_queue_Fpga = configuration->property(role + ".select_queue_Fpga", 1);
acq_parameters.select_queue_Fpga = select_queue_Fpga;
std::string default_device_name = "/dev/uio0";
std::string device_name = configuration->property(role + ".devicename", default_device_name);
acq_parameters.device_name = device_name;
acq_parameters.samples_per_code = nsamples_total;
// UIO device file
std::string device_io_name;
std::string device_name = configuration->property(role + ".devicename", default_device_name);
// find the uio device file corresponding to the GNSS reset module
if (find_uio_dev_file_name(device_io_name, device_name, 0) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
acq_parameters.device_name = device_io_name;
acq_parameters.samples_per_code = nsamples_total;
acq_parameters.excludelimit = static_cast<unsigned int>(1 + ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_CPS) * static_cast<float>(fs_in)));
// compute all the GALILEO E5 PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time

View File

@@ -191,6 +191,8 @@ public:
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private:
const std::string default_device_name = "acquisition_S00_AXI"; // UIO device name
// the following flags are FPGA-specific and they are using arrange the values of the fft 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 uint32_t quant_bits_local_code = 16;

View File

@@ -24,6 +24,7 @@
#include "configuration_interface.h"
#include "galileo_e5_signal_replica.h"
#include "gnss_sdr_flags.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <gnuradio/fft/fft.h> // for fft_complex
#include <gnuradio/gr_complex.h> // for gr_complex
@@ -79,11 +80,19 @@ GalileoE5bPcpsAcquisitionFpga::GalileoE5bPcpsAcquisitionFpga(const Configuration
uint32_t nsamples_total = pow(2, nbits);
uint32_t select_queue_Fpga = configuration->property(role + ".select_queue_Fpga", 1);
acq_parameters.select_queue_Fpga = select_queue_Fpga;
std::string default_device_name = "/dev/uio0";
std::string device_name = configuration->property(role + ".devicename", default_device_name);
acq_parameters.device_name = device_name;
acq_parameters.samples_per_code = nsamples_total;
// UIO device file
std::string device_io_name;
std::string device_name = configuration->property(role + ".devicename", default_device_name);
// find the uio device file corresponding to the GNSS reset module
if (find_uio_dev_file_name(device_io_name, device_name, 0) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
acq_parameters.device_name = device_io_name;
acq_parameters.samples_per_code = nsamples_total;
acq_parameters.excludelimit = static_cast<unsigned int>(1 + ceil((1.0 / GALILEO_E5B_CODE_CHIP_RATE_CPS) * static_cast<float>(fs_in)));
// compute all the GALILEO E5b PRN Codes (this is done only once in the class constructor in order to avoid re-computing the PRN codes every time

View File

@@ -190,6 +190,9 @@ public:
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private:
const std::string default_device_name = "acquisition_S00_AXI"; // UIO device name
// the following flags are FPGA-specific and they are using arrange the values of the fft 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 uint32_t quant_bits_local_code = 16;

View File

@@ -27,6 +27,7 @@
#include "gnss_sdr_flags.h"
#include "gnss_sdr_make_unique.h"
#include "gps_sdr_signal_replica.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <gnuradio/fft/fft.h>
#include <gnuradio/gr_complex.h> // for gr_complex
@@ -72,9 +73,18 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
uint32_t nsamples_total = pow(2, nbits);
uint32_t select_queue_Fpga = configuration->property(role + ".select_queue_Fpga", 0);
acq_parameters.select_queue_Fpga = select_queue_Fpga;
std::string default_device_name = "/dev/uio0";
// UIO device file
std::string device_io_name;
std::string device_name = configuration->property(role + ".devicename", default_device_name);
acq_parameters.device_name = device_name;
// find the uio device file corresponding to the GNSS reset module
if (find_uio_dev_file_name(device_io_name, device_name, 0) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
acq_parameters.device_name = device_io_name;
acq_parameters.samples_per_code = nsamples_total;
acq_parameters.excludelimit = static_cast<unsigned int>(1 + ceil(GPS_L1_CA_CHIP_PERIOD_S * static_cast<float>(fs_in)));

View File

@@ -187,6 +187,8 @@ public:
private:
static const uint32_t NUM_PRNs = 32;
const std::string default_device_name = "acquisition_S00_AXI"; // UIO device name
// the following flags are FPGA-specific and they are using arrange the values of the fft 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 uint32_t quant_bits_local_code = 16;

View File

@@ -27,6 +27,7 @@
#include "gnss_sdr_make_unique.h"
#include "gnss_synchro.h"
#include "gps_l2c_signal_replica.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <gnuradio/fft/fft.h> // for fft_complex
#include <gnuradio/gr_complex.h> // for gr_complex
@@ -70,11 +71,19 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
unsigned int nsamples_total = pow(2, nbits);
unsigned int select_queue_Fpga = configuration->property(role + ".select_queue_Fpga", 0);
acq_parameters.select_queue_Fpga = select_queue_Fpga;
std::string default_device_name = "/dev/uio0";
std::string device_name = configuration->property(role + ".devicename", default_device_name);
acq_parameters.device_name = device_name;
acq_parameters.samples_per_code = nsamples_total;
// UIO device file
std::string device_io_name;
std::string device_name = configuration->property(role + ".devicename", default_device_name);
// find the uio device file corresponding to the GNSS reset module
if (find_uio_dev_file_name(device_io_name, device_name, 0) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
acq_parameters.device_name = device_io_name;
acq_parameters.samples_per_code = nsamples_total;
acq_parameters.downsampling_factor = configuration->property(role + ".downsampling_factor", 1.0);
acq_parameters.total_block_exp = configuration->property(role + ".total_block_exp", 14);
acq_parameters.excludelimit = static_cast<uint32_t>(std::round(static_cast<double>(fs_in_) / GPS_L2_M_CODE_RATE_CPS));

View File

@@ -151,6 +151,8 @@ public:
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
private:
const std::string default_device_name = "acquisition_S00_AXI"; // UIO device name
static const uint32_t NUM_PRNs = 32;
static const uint32_t QUANT_BITS_LOCAL_CODE = 16;
static const uint32_t SELECT_LSBits = 0x0000FFFF; // Select the 10 LSbits out of a 20-bit word

View File

@@ -27,6 +27,7 @@
#include "gnss_sdr_flags.h"
#include "gnss_sdr_make_unique.h"
#include "gps_l5_signal_replica.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <gnuradio/fft/fft.h> // for fft_complex
#include <gnuradio/gr_complex.h> // for gr_complex
@@ -76,11 +77,19 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
uint32_t nsamples_total = pow(2, nbits);
uint32_t select_queue_Fpga = configuration->property(role + ".select_queue_Fpga", 1);
acq_parameters.select_queue_Fpga = select_queue_Fpga;
std::string default_device_name = "/dev/uio0";
std::string device_name = configuration->property(role + ".devicename", default_device_name);
acq_parameters.device_name = device_name;
acq_parameters.samples_per_code = nsamples_total;
// UIO device file
std::string device_io_name;
std::string device_name = configuration->property(role + ".devicename", default_device_name);
// find the uio device file corresponding to the GNSS reset module
if (find_uio_dev_file_name(device_io_name, device_name, 0) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
acq_parameters.device_name = device_io_name;
acq_parameters.samples_per_code = nsamples_total;
acq_parameters.excludelimit = static_cast<unsigned int>(1 + ceil((1.0 / GPS_L5I_CODE_RATE_CPS) * static_cast<float>(fs_in)));
// compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time

View File

@@ -187,6 +187,8 @@ public:
private:
static const uint32_t NUM_PRNs = 32;
const std::string default_device_name = "acquisition_S00_AXI"; // UIO device name
// the following flags are FPGA-specific and they are using arrange the values of the fft 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 uint32_t quant_bits_local_code = 16;

View File

@@ -146,6 +146,13 @@ target_include_directories(signal_source_adapters
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(ENABLE_FPGA)
target_include_directories(signal_source_adapters
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/libs
)
endif()
target_link_libraries(signal_source_adapters
PUBLIC
Boost::headers

View File

@@ -28,6 +28,7 @@
#include "ad9361_manager.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <iio.h>
#include <algorithm> // for max
@@ -90,9 +91,17 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con
rf_shutdown_ = configuration->property(role + ".rf_shutdown", FLAGS_rf_shutdown);
// turn switch to A/D position
const std::string default_device_name("/dev/uio1");
const std::string device_name = configuration->property(role + ".devicename", default_device_name);
// Switch UIO device file
std::string device_io_name;
std::string device_name = configuration->property(role + ".devicename", default_device_name);
// find the uio device file corresponding to the GNSS reset module
if (find_uio_dev_file_name(device_io_name, device_name, 0) < 0)
{
std::cout << "Cannot find the FPGA uio device file corresponding to device name " << device_name << std::endl;
throw std::exception();
}
switch_position = configuration->property(role + ".switch_position", 0);
if (switch_position != 0 && switch_position != 2)
{
@@ -101,7 +110,7 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con
switch_position = 0;
}
switch_fpga = std::make_shared<Fpga_Switch>(device_name);
switch_fpga = std::make_shared<Fpga_Switch>(device_io_name);
switch_fpga->set_switch_position(switch_position);
item_size_ = sizeof(gr_complex);

View File

@@ -76,6 +76,8 @@ public:
gr::basic_block_sptr get_right_block() override;
private:
const std::string default_device_name = "AXIS_Switch_v1_0_0"; // Switch UIO device name
// perform dynamic bit selection every 500 ms by default
static const uint32_t Gain_control_period_ms = 500;

View File

@@ -109,6 +109,14 @@ target_include_directories(tracking_adapters
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(ENABLE_FPGA)
target_include_directories(tracking_adapters
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/libs
)
endif()
if(ENABLE_CUDA)
if(CMAKE_VERSION VERSION_GREATER 3.11)
target_include_directories(tracking_adapters