GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
gps_l5_dll_pll_tracking_fpga.h
Go to the documentation of this file.
1 /*!
2  * \file gps_l5_dll_pll_tracking_fpga.h
3  * \brief Interface of an adapter of a DLL+PLL tracking loop block
4  * for GPS L5 to a TrackingInterface for the FPGA
5  * \author Marc Majoral, 2019. mmajoral(at)cttc.cat
6  * Javier Arribas, 2019. jarribas(at)cttc.es
7  *
8  * Code DLL + carrier PLL according to the algorithms described in:
9  * K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen,
10  * A Software-Defined GPS and Galileo Receiver. A Single-Frequency
11  * Approach, Birkhauser, 2007
12  *
13  * -----------------------------------------------------------------------------
14  *
15  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
16  * This file is part of GNSS-SDR.
17  *
18  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
19  * SPDX-License-Identifier: GPL-3.0-or-later
20  *
21  * -----------------------------------------------------------------------------
22  */
23 
24 #ifndef GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_FPGA_H
25 #define GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_FPGA_H
26 
28 #include "tracking_interface.h"
29 #include <string>
30 
31 /** \addtogroup Tracking
32  * \{ */
33 /** \addtogroup Tracking_adapters
34  * \{ */
35 
36 
38 
39 /*!
40  * \brief This class implements a code DLL + carrier PLL tracking loop
41  */
43 {
44 public:
45  /*!
46  * \brief Constructor
47  */
49  const ConfigurationInterface* configuration,
50  const std::string& role,
51  unsigned int in_streams,
52  unsigned int out_streams);
53 
54  /*!
55  * \brief Destructor
56  */
57  virtual ~GpsL5DllPllTrackingFpga();
58 
59  /*!
60  * \brief Role
61  */
62  inline std::string role() override
63  {
64  return role_;
65  }
66 
67  /*!
68  * \brief Returns "GPS_L5_DLL_PLL_Tracking_Fpga"
69  */
70  inline std::string implementation() override
71  {
72  return "GPS_L5_DLL_PLL_Tracking_Fpga";
73  }
74 
75  /*!
76  * \brief Returns size of lv_16sc_t
77  */
78  size_t item_size() override
79  {
80  return sizeof(int16_t);
81  }
82 
83  /*!
84  * \brief Connect
85  */
86  void connect(gr::top_block_sptr top_block) override;
87 
88  /*!
89  * \brief Disconnect
90  */
91  void disconnect(gr::top_block_sptr top_block) override;
92 
93  /*!
94  * \brief Get left block
95  */
96  gr::basic_block_sptr get_left_block() override;
97 
98  /*!
99  * \brief Get right block
100  */
101  gr::basic_block_sptr get_right_block() override;
102 
103  /*!
104  * \brief Set tracking channel unique ID
105  */
106  void set_channel(unsigned int channel) override;
107 
108  /*!
109  * \brief Set acquisition/tracking common Gnss_Synchro object pointer
110  * to efficiently exchange synchronization data between acquisition and tracking blocks
111  */
112  void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
113 
114  /*!
115  * \brief Start the tracking process in the FPGA
116  */
117  void start_tracking() override;
118 
119  /*!
120  * \brief Stop the tracking process in the FPGA
121  */
122  void stop_tracking() override;
123 
124 private:
125  const std::string default_device_name_GPS_L5_ = "multicorrelator_resampler_3_1_AXI"; // UIO device name
126 
127  static const uint32_t NUM_PRNs = 32; // total number of PRNs
128 
129  // the following flags are FPGA-specific and they are using arrange the values of the local code in the way the FPGA
130  // expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking.
131  static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000; // flag that enables WE (Write Enable) of the local code FPGA
132  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)
133 
134  dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc_sptr_;
135  std::string role_;
136  std::string device_name_;
137  int32_t* prn_codes_ptr_;
138  int32_t* data_codes_ptr_;
139  uint32_t channel_;
140  uint32_t num_prev_assigned_ch_;
141  uint32_t in_streams_;
142  uint32_t out_streams_;
143  bool track_pilot_;
144 };
145 
146 
147 /** \} */
148 /** \} */
149 #endif // GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_FPGA_H
size_t item_size() override
Returns size of lv_16sc_t.
gr::basic_block_sptr get_right_block() override
Get right block.
Implementation of a code DLL + carrier PLL tracking block using an FPGA.
void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) override
Set acquisition/tracking common Gnss_Synchro object pointer to efficiently exchange synchronization d...
GpsL5DllPllTrackingFpga(const ConfigurationInterface *configuration, const std::string &role, unsigned int in_streams, unsigned int out_streams)
Constructor.
void start_tracking() override
Start the tracking process in the FPGA.
void set_channel(unsigned int channel) override
Set tracking channel unique ID.
void connect(gr::top_block_sptr top_block) override
Connect.
std::string implementation() override
Returns "GPS_L5_DLL_PLL_Tracking_Fpga".
void stop_tracking() override
Stop the tracking process in the FPGA.
void disconnect(gr::top_block_sptr top_block) override
Disconnect.
This is the class that contains the information that is shared by the processing blocks.
Definition: gnss_synchro.h:38
This abstract class represents an interface to configuration parameters.
virtual ~GpsL5DllPllTrackingFpga()
Destructor.
This abstract class represents an interface to a tracking block.
std::string role() override
Role.
gr::basic_block_sptr get_left_block() override
Get left block.
This class implements a code DLL + carrier PLL tracking loop.
This class represents an interface to a tracking block.