2018-08-01 13:55:40 +00:00
|
|
|
/*!
|
2019-03-06 20:54:39 +00:00
|
|
|
* \file gps_l2_m_pcps_acquisition_fpga.h
|
|
|
|
* \brief Adapts an FPGA-offloaded PCPS acquisition block
|
|
|
|
* to an AcquisitionInterface for GPS L2 M signals
|
2018-08-01 13:55:40 +00:00
|
|
|
* \authors <ul>
|
2019-03-06 20:54:39 +00:00
|
|
|
* <li> Javier Arribas, 2019. jarribas(at)cttc.es
|
2018-08-01 13:55:40 +00:00
|
|
|
* </ul>
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2018-08-01 13:55:40 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2018-08-01 13:55:40 +00:00
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2018-08-01 13:55:40 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2018-08-01 13:55:40 +00:00
|
|
|
*/
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_FPGA_H
|
|
|
|
#define GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_FPGA_H
|
2018-08-01 13:55:40 +00:00
|
|
|
|
2019-03-20 14:13:17 +00:00
|
|
|
#include "channel_fsm.h"
|
2018-08-01 13:55:40 +00:00
|
|
|
#include "pcps_acquisition_fpga.h"
|
2019-03-06 20:54:39 +00:00
|
|
|
#include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
|
|
|
|
#include <cstddef> // for size_t
|
2019-06-30 02:47:15 +00:00
|
|
|
#include <memory> // for weak_ptr
|
2019-03-06 20:54:39 +00:00
|
|
|
#include <string> // for string
|
2019-06-30 02:47:15 +00:00
|
|
|
#include <vector>
|
2018-08-01 13:55:40 +00:00
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup Acquisition
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup Acq_adapters
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
2019-03-06 12:49:14 +00:00
|
|
|
class Gnss_Synchro;
|
2018-08-01 13:55:40 +00:00
|
|
|
class ConfigurationInterface;
|
|
|
|
|
|
|
|
/*!
|
2019-03-06 20:54:39 +00:00
|
|
|
* \brief This class adapts a PCPS acquisition block off-loaded on an FPGA
|
|
|
|
* to an AcquisitionInterface for GPS L2 M signals
|
2018-08-01 13:55:40 +00:00
|
|
|
*/
|
|
|
|
class GpsL2MPcpsAcquisitionFpga : public AcquisitionInterface
|
|
|
|
{
|
|
|
|
public:
|
2020-06-29 07:07:41 +00:00
|
|
|
GpsL2MPcpsAcquisitionFpga(
|
|
|
|
const ConfigurationInterface* configuration,
|
2018-12-02 04:29:11 +00:00
|
|
|
const std::string& role,
|
|
|
|
unsigned int in_streams,
|
2018-08-01 13:55:40 +00:00
|
|
|
unsigned int out_streams);
|
|
|
|
|
2019-07-21 17:32:52 +00:00
|
|
|
~GpsL2MPcpsAcquisitionFpga() = default;
|
2018-08-01 13:55:40 +00:00
|
|
|
|
|
|
|
inline std::string role() override
|
|
|
|
{
|
|
|
|
return role_;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
2019-03-06 20:54:39 +00:00
|
|
|
* \brief Returns "GPS_L2_M_PCPS_Acquisition_Fpga"
|
2018-08-01 13:55:40 +00:00
|
|
|
*/
|
|
|
|
inline std::string implementation() override
|
|
|
|
{
|
2019-03-06 20:54:39 +00:00
|
|
|
return "GPS_L2_M_PCPS_Acquisition_Fpga";
|
2018-08-01 13:55:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline size_t item_size() override
|
|
|
|
{
|
2020-02-11 11:56:33 +00:00
|
|
|
return sizeof(float);
|
2018-08-01 13:55:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void connect(gr::top_block_sptr top_block) override;
|
|
|
|
void disconnect(gr::top_block_sptr top_block) override;
|
|
|
|
gr::basic_block_sptr get_left_block() override;
|
|
|
|
gr::basic_block_sptr get_right_block() override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
|
|
|
|
* to efficiently exchange synchronization data between acquisition and
|
2019-03-06 20:54:39 +00:00
|
|
|
* tracking blocks
|
2018-08-01 13:55:40 +00:00
|
|
|
*/
|
|
|
|
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set acquisition channel unique ID
|
|
|
|
*/
|
2019-03-20 14:44:59 +00:00
|
|
|
inline void set_channel(unsigned int channel) override
|
2019-03-20 14:13:17 +00:00
|
|
|
{
|
|
|
|
channel_ = channel;
|
|
|
|
acquisition_fpga_->set_channel(channel_);
|
|
|
|
}
|
2018-08-01 13:55:40 +00:00
|
|
|
|
2019-03-20 14:13:17 +00:00
|
|
|
/*!
|
2019-06-30 02:47:15 +00:00
|
|
|
* \brief Set channel fsm associated to this acquisition instance
|
|
|
|
*/
|
2019-04-09 15:39:48 +00:00
|
|
|
inline void set_channel_fsm(std::weak_ptr<ChannelFsm> channel_fsm) override
|
2019-03-20 14:13:17 +00:00
|
|
|
{
|
|
|
|
channel_fsm_ = channel_fsm;
|
|
|
|
acquisition_fpga_->set_channel_fsm(channel_fsm);
|
|
|
|
}
|
2019-03-20 17:00:37 +00:00
|
|
|
|
2018-08-01 13:55:40 +00:00
|
|
|
/*!
|
|
|
|
* \brief Set statistics threshold of PCPS algorithm
|
|
|
|
*/
|
|
|
|
void set_threshold(float threshold) override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set maximum Doppler off grid search
|
|
|
|
*/
|
|
|
|
void set_doppler_max(unsigned int doppler_max) override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Set Doppler steps for the grid search
|
|
|
|
*/
|
|
|
|
void set_doppler_step(unsigned int doppler_step) override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Initializes acquisition algorithm.
|
|
|
|
*/
|
|
|
|
void init() override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Sets local code for GPS L2/M PCPS acquisition algorithm.
|
|
|
|
*/
|
|
|
|
void set_local_code() override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns the maximum peak of grid search
|
|
|
|
*/
|
|
|
|
signed int mag() override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Restart acquisition algorithm
|
|
|
|
*/
|
|
|
|
void reset() override;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief If state = 1, it forces the block to start acquiring from the first sample
|
|
|
|
*/
|
2018-08-11 10:56:52 +00:00
|
|
|
void set_state(int state) override;
|
2018-08-01 13:55:40 +00:00
|
|
|
|
2018-10-28 10:07:53 +00:00
|
|
|
/*!
|
|
|
|
* \brief Stop running acquisition
|
|
|
|
*/
|
|
|
|
void stop_acquisition() override;
|
|
|
|
|
2018-12-05 15:50:32 +00:00
|
|
|
void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{};
|
|
|
|
|
2018-08-01 13:55:40 +00:00
|
|
|
private:
|
2020-11-27 11:04:27 +00:00
|
|
|
const std::string acquisition_device_name = "acquisition_S00_AXI"; // UIO device name
|
2020-11-26 16:07:15 +00:00
|
|
|
|
2019-07-23 13:20:59 +00:00
|
|
|
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
|
|
|
|
static const uint32_t SELECT_MSBbits = 0xFFFF0000; // Select the 10 MSbits out of a 20-bit word
|
|
|
|
static const uint32_t SELECT_ALL_CODE_BITS = 0xFFFFFFFF; // Select a 20 bit word
|
|
|
|
static const uint32_t SHL_CODE_BITS = 65536; // shift left by 10 bits
|
|
|
|
|
2018-08-01 13:55:40 +00:00
|
|
|
pcps_acquisition_fpga_sptr acquisition_fpga_;
|
2020-06-25 00:50:07 +00:00
|
|
|
std::vector<uint32_t> d_all_fft_codes_; // memory that contains all the code ffts
|
2019-04-09 15:39:48 +00:00
|
|
|
std::weak_ptr<ChannelFsm> channel_fsm_;
|
2020-06-25 00:50:07 +00:00
|
|
|
Gnss_Synchro* gnss_synchro_;
|
|
|
|
std::string item_type_;
|
|
|
|
std::string dump_filename_;
|
|
|
|
std::string role_;
|
|
|
|
int64_t fs_in_;
|
2018-08-01 13:55:40 +00:00
|
|
|
float threshold_;
|
2020-06-25 00:50:07 +00:00
|
|
|
unsigned int channel_;
|
2018-08-01 13:55:40 +00:00
|
|
|
unsigned int doppler_max_;
|
|
|
|
unsigned int doppler_step_;
|
|
|
|
unsigned int in_streams_;
|
|
|
|
unsigned int out_streams_;
|
|
|
|
};
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
|
|
|
|
/** \} */
|
|
|
|
/** \} */
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_FPGA_H
|