1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-10-27 05:27:40 +00:00

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

View File

@@ -75,8 +75,6 @@ Dll_Pll_Conf_Fpga::Dll_Pll_Conf_Fpga()
signal[1] = 'C';
signal[2] = '\0';
device_name = "/dev/uio";
dev_file_num = 3;
num_prev_assigned_ch = 0;
code_length_chips = 0U;
code_samples_per_chip = 0U;
ca_codes = nullptr;

View File

@@ -68,8 +68,6 @@ public:
uint32_t bit_synchronization_time_limit_s;
uint32_t vector_length;
uint32_t smoother_length;
uint32_t dev_file_num;
uint32_t num_prev_assigned_ch;
uint32_t code_length_chips;
uint32_t code_samples_per_chip;
uint32_t extend_fpga_integration_periods;

View File

@@ -50,9 +50,6 @@ const float PHASE_CARR_MAX_DIV_PI = 683565275.5764316; // 2^(31)/pi
const float TWO_PI = 6.283185307179586;
Fpga_Multicorrelator_8sc::Fpga_Multicorrelator_8sc(int32_t n_correlators,
const std::string &device_name,
uint32_t dev_file_num,
uint32_t num_prev_assigned_ch,
int32_t *ca_codes,
int32_t *data_codes,
uint32_t code_length_chips,
@@ -60,10 +57,6 @@ Fpga_Multicorrelator_8sc::Fpga_Multicorrelator_8sc(int32_t n_correlators,
uint32_t code_samples_per_chip)
{
d_n_correlators = n_correlators;
d_device_name = device_name;
d_dev_file_num = dev_file_num;
d_num_prev_assigned_ch = num_prev_assigned_ch;
d_track_pilot = track_pilot;
d_device_descriptor = 0;
d_map_base = nullptr;
@@ -91,7 +84,6 @@ Fpga_Multicorrelator_8sc::Fpga_Multicorrelator_8sc(int32_t n_correlators,
d_rem_carr_phase_rad_int = 0;
d_phase_step_rad_int = 0;
d_initial_sample_counter = 0;
d_channel = 0;
d_correlator_length_samples = 0;
d_code_phase_step_chips_num = 0;
d_code_length_chips = code_length_chips;
@@ -203,28 +195,11 @@ bool Fpga_Multicorrelator_8sc::free()
}
void Fpga_Multicorrelator_8sc::set_channel(uint32_t channel)
void Fpga_Multicorrelator_8sc::open_channel(std::string device_io_name, uint32_t channel)
{
char device_io_name[max_length_deviceio_name] = ""; // driver io name
d_channel = channel;
// open the device corresponding to the assigned channel
std::string mergedname;
std::stringstream devicebasetemp;
uint32_t numdevice = d_dev_file_num + d_channel - d_num_prev_assigned_ch;
devicebasetemp << numdevice;
mergedname = d_device_name + devicebasetemp.str();
if (mergedname.size() > max_length_deviceio_name)
{
mergedname = mergedname.substr(0, max_length_deviceio_name);
}
mergedname.copy(device_io_name, mergedname.size() + 1);
device_io_name[mergedname.size()] = '\0';
std::cout << "trk device_io_name = " << device_io_name << '\n';
if ((d_device_descriptor = open(device_io_name, O_RDWR | O_SYNC)) == -1)
if ((d_device_descriptor = open(device_io_name.c_str(), O_RDWR | O_SYNC)) == -1)
{
LOG(WARNING) << "Cannot open deviceio" << device_io_name;
std::cout << "Cannot open deviceio" << device_io_name << '\n';
@@ -235,7 +210,7 @@ void Fpga_Multicorrelator_8sc::set_channel(uint32_t channel)
if (d_map_base == reinterpret_cast<void *>(-1))
{
LOG(WARNING) << "Cannot map the FPGA tracking module "
<< d_channel << "into user memory";
<< channel << "into user memory";
std::cout << "Cannot map deviceio" << device_io_name << '\n';
}

View File

@@ -47,9 +47,6 @@ public:
* \brief Constructor
*/
Fpga_Multicorrelator_8sc(int32_t n_correlators,
const std::string &device_name,
uint32_t dev_file_num,
uint32_t num_prev_assigned_ch,
int32_t *ca_codes,
int32_t *data_codes,
uint32_t code_length_chips,
@@ -95,9 +92,9 @@ public:
bool free();
/*!
* \brief Set channel number and open the FPGA device driver
* \brief Open the FPGA device driver
*/
void set_channel(uint32_t channel);
void open_channel(std::string device_io_name, uint32_t channel);
/*!
* \brief Set the initial sample number where the tracking process begins
@@ -193,7 +190,6 @@ private:
static const uint32_t enable_secondary_code = 2; // bit 1 of drop_samples_reg_addr
static const uint32_t init_secondary_code_addresses = 4; // bit 2 of drop_samples_reg_addr
static const uint32_t page_size = 0x10000;
static const uint32_t max_length_deviceio_name = 50;
static const uint32_t max_code_resampler_counter = 1 << 31; // 2^(number of bits of precision of the code resampler)
static const uint32_t local_code_fpga_clear_address_counter = 0x10000000;
static const uint32_t test_register_track_writeval = 0x55AA;
@@ -237,7 +233,6 @@ private:
volatile uint32_t *d_map_base; // driver memory map
// configuration data received from the interface
uint32_t d_channel; // channel number
uint32_t d_correlator_length_samples;
uint32_t d_code_samples_per_chip;
@@ -247,11 +242,6 @@ private:
int32_t d_phase_step_rad_int;
int32_t d_carrier_phase_rate_step_rad_int;
// driver
std::string d_device_name;
uint32_t d_dev_file_num;
uint32_t d_num_prev_assigned_ch;
// PRN codes
int32_t *d_ca_codes;
int32_t *d_data_codes;