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