GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
fmcomms5_signal_source_fpga.h
Go to the documentation of this file.
1/*!
2 * \file fmcomms5_signal_source_fpga.h
3 * \brief Signal source for the Analog Devices FMCOMMS5 directly connected
4 * to the FPGA accelerators.
5 * This source implements only the AD9361 control. It is NOT compatible with
6 * conventional SDR acquisition and tracking blocks.
7 * Please use the fmcomms2 source if conventional SDR acquisition and tracking
8 * is selected in the configuration file.
9 *
10 * -----------------------------------------------------------------------------
11 *
12 * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
13 * This file is part of GNSS-SDR.
14 *
15 * Copyright (C) 2010-2024 (see AUTHORS file for a list of contributors)
16 * SPDX-License-Identifier: GPL-3.0-or-later
17 *
18 * -----------------------------------------------------------------------------
19 */
20
21#ifndef GNSS_SDR_FMCOMMS5_SIGNAL_SOURCE_FPGA_H
22#define GNSS_SDR_FMCOMMS5_SIGNAL_SOURCE_FPGA_H
23
24#include "concurrent_queue.h"
25#include "fpga_buffer_monitor.h"
27#include "fpga_switch.h"
29#include "signal_source_base.h"
30#include <pmt/pmt.h>
31#include <cstdint>
32#include <memory>
33#include <mutex>
34#include <string>
35#include <thread>
36
37
38/** \addtogroup Signal_Source
39 * \{ */
40/** \addtogroup Signal_Source_adapters
41 * \{ */
42
43
45
46class Fmcomms5SignalSourceFPGA : public SignalSourceBase
47{
48public:
49 Fmcomms5SignalSourceFPGA(const ConfigurationInterface *configuration,
50 const std::string &role, unsigned int in_stream,
51 unsigned int out_stream, Concurrent_Queue<pmt::pmt_t> *queue);
52
53 ~Fmcomms5SignalSourceFPGA();
54
55 inline size_t item_size() override
56 {
57 return item_size_;
58 }
59
60 void connect(gr::top_block_sptr top_block) override;
61 void disconnect(gr::top_block_sptr top_block) override;
62 gr::basic_block_sptr get_left_block() override;
63 gr::basic_block_sptr get_right_block() override;
64
65private:
66 const std::string default_dump_filename = std::string("FPGA_buffer_monitor_dump.dat");
67 const std::string default_rf_port_select = std::string("A_BALANCED");
68 const std::string default_gain_mode = std::string("slow_attack");
69 const double default_manual_gain_rx1 = 64.0;
70 const double default_manual_gain_rx2 = 64.0;
71 const uint64_t default_bandwidth = 12500000;
72
73 // perform dynamic bit selection every 500 ms by default
74 const uint32_t Gain_control_period_ms = 500;
75 // check buffer overflow and perform buffer monitoring every 1s by default
76 const uint32_t buffer_monitor_period_ms = 1000;
77 // buffer overflow and buffer monitoring initial delay
78 const uint32_t buffer_monitoring_initial_delay_ms = 2000;
79 const int32_t switch_to_real_time_mode = 2;
80
81 void run_dynamic_bit_selection_process();
82 void run_buffer_monitor_process();
83
84 mutable std::mutex dynamic_bit_selection_mutex;
85 mutable std::mutex buffer_monitor_mutex;
86
87 std::thread thread_dynamic_bit_selection;
88 std::thread thread_buffer_monitor;
89
90 std::shared_ptr<Fpga_Switch> switch_fpga;
91 std::shared_ptr<Fpga_dynamic_bit_selection> dynamic_bit_selection_fpga;
92 std::shared_ptr<Fpga_buffer_monitor> buffer_monitor_fpga;
93
94 std::string gain_mode_rx1_;
95 std::string gain_mode_rx2_;
96 std::string rf_port_select_;
97 std::string filter_file_;
98 std::string filter_source_;
99 std::string filter_filename_;
100
101 double rf_gain_rx1_;
102 double rf_gain_rx2_;
103
104 uint64_t freq0_; // frequency of local oscillator for ADRV9361-A
105 uint64_t freq1_; // frequency of local oscillator for ADRV9361-B
106 uint64_t sample_rate_;
107 uint64_t bandwidth_;
108
109 float Fpass_;
110 float Fstop_;
111 uint32_t in_stream_;
112 uint32_t out_stream_;
113
114 size_t item_size_;
115
116 bool quadrature_;
117 bool rf_dc_;
118 bool bb_dc_;
119 bool rx1_enable_;
120 bool rx2_enable_;
121 bool enable_dynamic_bit_selection_;
122 bool enable_ovf_check_buffer_monitor_active_;
123 bool dump_;
124 bool rf_shutdown_;
125};
126
127
128/** \} */
129/** \} */
130#endif // GNSS_SDR_FMCOMMS5_SIGNAL_SOURCE_FPGA_H
This class implements a thread-safe std::queue.
This abstract class represents an interface to configuration parameters.
SignalSourceBase(ConfigurationInterface const *configuration, std::string role, std::string impl)
Constructor.
Interface of a thread-safe std::queue.
Check receiver buffer overflow and monitor the status of the receiver buffers.
Dynamic bit selection in the received signal.
Switch that connects the HW accelerator queues to the analog front end or the DMA.
This interface represents a GNSS block.
Header file of the base class to signal_source GNSS blocks.