GNSS-SDR  0.0.13
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  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
15  *
16  * GNSS-SDR is a software defined Global Navigation
17  * Satellite Systems receiver
18  *
19  * This file is part of GNSS-SDR.
20  *
21  * SPDX-License-Identifier: GPL-3.0-or-later
22  *
23  * -----------------------------------------------------------------------------
24  */
25 
26 #ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H
27 #define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H
28 
30 #include "tracking_interface.h"
31 #include <string>
32 
34 
35 /*!
36  * \brief This class implements a code DLL + carrier PLL tracking loop
37  */
39 {
40 public:
41  /*!
42  * \brief Constructor
43  */
45  const ConfigurationInterface* configuration,
46  const std::string& role,
47  unsigned int in_streams,
48  unsigned int out_streams);
49 
50  /*!
51  * \brief Destructor
52  */
54 
55  /*!
56  * \brief Role
57  */
58  inline std::string role() override
59  {
60  return role_;
61  }
62 
63  /*!
64  * \brief Returns "GPS_L1_CA_DLL_PLL_Tracking_Fpga"
65  */
66  inline std::string implementation() override
67  {
68  return "GPS_L1_CA_DLL_PLL_Tracking_Fpga";
69  }
70 
71  /*!
72  * \brief Returns size of lv_16sc_t
73  */
74  size_t item_size() override
75  {
76  return sizeof(int16_t);
77  }
78 
79  /*!
80  * \brief Connect
81  */
82  void connect(gr::top_block_sptr top_block) override;
83 
84  /*!
85  * \brief Disconnect
86  */
87  void disconnect(gr::top_block_sptr top_block) override;
88 
89  /*!
90  * \brief Get left block
91  */
92  gr::basic_block_sptr get_left_block() override;
93 
94  /*!
95  * \brief Get right block
96  */
97  gr::basic_block_sptr get_right_block() override;
98 
99  /*!
100  * \brief Set tracking channel unique ID
101  */
102  void set_channel(unsigned int channel) override;
103 
104  /*!
105  * \brief Set acquisition/tracking common Gnss_Synchro object pointer
106  * to efficiently exchange synchronization data between acquisition and tracking blocks
107  */
108  void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
109 
110  /*!
111  * \brief Start the tracking process in the FPGA
112  */
113  void start_tracking() override;
114 
115  /*!
116  * \brief Stop the tracking process in the FPGA
117  */
118  void stop_tracking() override;
119 
120 private:
121  static const uint32_t NUM_PRNs = 32; // total number of PRNs
122  static const int32_t GPS_CA_BIT_DURATION_MS = 20;
123  // the following flag is FPGA-specific and they are using arrange the values of the local code in the way the FPGA
124  // expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking.
125  static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000; // flag that enables WE (Write Enable) of the local code FPGA
126 
127 
128  dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc;
129  uint32_t channel_;
130  std::string role_;
131  uint32_t in_streams_;
132  uint32_t out_streams_;
133  int32_t* d_ca_codes;
134 };
135 
136 #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:33
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.