mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +00:00 
			
		
		
		
	updated the handling of the scoped_lock mutex in the fpga tracking loops + used clang-format.
This commit is contained in:
		| @@ -50,7 +50,6 @@ class ConfigurationInterface; | |||||||
| class GalileoE1PcpsAmbiguousAcquisitionFpga : public AcquisitionInterface | class GalileoE1PcpsAmbiguousAcquisitionFpga : public AcquisitionInterface | ||||||
| { | { | ||||||
| public: | public: | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Constructor |      * \brief Constructor | ||||||
|      */ |      */ | ||||||
| @@ -184,7 +183,6 @@ public: | |||||||
|     void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; |     void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; | ||||||
|  |  | ||||||
| private: | private: | ||||||
|  |  | ||||||
|     // the following flags are FPGA-specific and they are using arrange the values of the fft of the local code in the way the FPGA |     // the following flags are FPGA-specific and they are using arrange the values of the fft of the local code in the way the FPGA | ||||||
|     // expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking. |     // expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking. | ||||||
|     static const uint32_t quant_bits_local_code = 16; |     static const uint32_t quant_bits_local_code = 16; | ||||||
|   | |||||||
| @@ -50,7 +50,6 @@ class ConfigurationInterface; | |||||||
| class GalileoE5aPcpsAcquisitionFpga : public AcquisitionInterface | class GalileoE5aPcpsAcquisitionFpga : public AcquisitionInterface | ||||||
| { | { | ||||||
| public: | public: | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Constructor |      * \brief Constructor | ||||||
|      */ |      */ | ||||||
| @@ -191,7 +190,6 @@ public: | |||||||
|     void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; |     void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; | ||||||
|  |  | ||||||
| private: | private: | ||||||
|  |  | ||||||
|     // the following flags are FPGA-specific and they are using arrange the values of the fft of the local code in the way the FPGA |     // the following flags are FPGA-specific and they are using arrange the values of the fft of the local code in the way the FPGA | ||||||
|     // expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking. |     // expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking. | ||||||
|     static const uint32_t quant_bits_local_code = 16; |     static const uint32_t quant_bits_local_code = 16; | ||||||
|   | |||||||
| @@ -52,7 +52,6 @@ class ConfigurationInterface; | |||||||
| class GpsL1CaPcpsAcquisitionFpga : public AcquisitionInterface | class GpsL1CaPcpsAcquisitionFpga : public AcquisitionInterface | ||||||
| { | { | ||||||
| public: | public: | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Constructor |      * \brief Constructor | ||||||
|      */ |      */ | ||||||
|   | |||||||
| @@ -50,7 +50,6 @@ class ConfigurationInterface; | |||||||
| class GpsL5iPcpsAcquisitionFpga : public AcquisitionInterface | class GpsL5iPcpsAcquisitionFpga : public AcquisitionInterface | ||||||
| { | { | ||||||
| public: | public: | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Constructor |      * \brief Constructor | ||||||
|      */ |      */ | ||||||
|   | |||||||
| @@ -175,7 +175,6 @@ void Fpga_Acquisition::run_acquisition(void) | |||||||
|             std::cout << "acquisition module Read failed to retrieve 4 bytes!" << std::endl; |             std::cout << "acquisition module Read failed to retrieve 4 bytes!" << std::endl; | ||||||
|             std::cout << "acquisition module Interrupt number " << irq_count << std::endl; |             std::cout << "acquisition module Interrupt number " << irq_count << std::endl; | ||||||
|         } |         } | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -45,7 +45,6 @@ | |||||||
| class Fpga_Acquisition | class Fpga_Acquisition | ||||||
| { | { | ||||||
| public: | public: | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
| 	 * \brief Constructor | 	 * \brief Constructor | ||||||
| 	 */ | 	 */ | ||||||
|   | |||||||
| @@ -46,7 +46,6 @@ | |||||||
| class Fpga_Switch | class Fpga_Switch | ||||||
| { | { | ||||||
| public: | public: | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
| 	 * \brief Constructor | 	 * \brief Constructor | ||||||
| 	 */ | 	 */ | ||||||
|   | |||||||
| @@ -51,7 +51,6 @@ class ConfigurationInterface; | |||||||
| class GalileoE1DllPllVemlTrackingFpga : public TrackingInterface | class GalileoE1DllPllVemlTrackingFpga : public TrackingInterface | ||||||
| { | { | ||||||
| public: | public: | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
|      * \brief Constructor |      * \brief Constructor | ||||||
|      */ |      */ | ||||||
| @@ -132,7 +131,6 @@ public: | |||||||
|     void stop_tracking() override; |     void stop_tracking() override; | ||||||
|  |  | ||||||
| private: | private: | ||||||
|  |  | ||||||
|     // the following flags are FPGA-specific and they are using arrange the values of the local code in the way the FPGA |     // the following flags are FPGA-specific and they are using arrange the values of the local code in the way the FPGA | ||||||
|     // expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking. |     // expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking. | ||||||
|     static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000;      // flag that enables WE (Write Enable) of the local code FPGA |     static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000;      // flag that enables WE (Write Enable) of the local code FPGA | ||||||
|   | |||||||
| @@ -123,7 +123,6 @@ public: | |||||||
|     void stop_tracking() override; |     void stop_tracking() override; | ||||||
|  |  | ||||||
| private: | private: | ||||||
|  |  | ||||||
|     // the following flags are FPGA-specific and they are using arrange the values of the local code in the way the FPGA |     // the following flags are FPGA-specific and they are using arrange the values of the local code in the way the FPGA | ||||||
|     // expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking. |     // expects. This arrangement is done in the initialisation to avoid consuming unnecessary clock cycles during tracking. | ||||||
|     static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000;      // flag that enables WE (Write Enable) of the local code FPGA |     static const int32_t LOCAL_CODE_FPGA_ENABLE_WRITE_MEMORY = 0x0C000000;      // flag that enables WE (Write Enable) of the local code FPGA | ||||||
|   | |||||||
| @@ -128,7 +128,6 @@ public: | |||||||
|     void stop_tracking() override; |     void stop_tracking() override; | ||||||
|  |  | ||||||
| private: | private: | ||||||
|  |  | ||||||
|     static const uint32_t NUM_PRNs = 32;  // total number of PRNs |     static const uint32_t NUM_PRNs = 32;  // total number of PRNs | ||||||
|     static const int32_t GPS_CA_BIT_DURATION_MS = 20; |     static const int32_t GPS_CA_BIT_DURATION_MS = 20; | ||||||
|     // the following flag is FPGA-specific and they are using arrange the values of the local code in the way the FPGA |     // the following flag is FPGA-specific and they are using arrange the values of the local code in the way the FPGA | ||||||
|   | |||||||
| @@ -1286,6 +1286,8 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() | |||||||
|  |  | ||||||
| void dll_pll_veml_tracking_fpga::set_channel(uint32_t channel) | void dll_pll_veml_tracking_fpga::set_channel(uint32_t channel) | ||||||
| { | { | ||||||
|  |     gr::thread::scoped_lock l(d_setlock); | ||||||
|  |  | ||||||
|     d_channel = channel; |     d_channel = channel; | ||||||
|     multicorrelator_fpga->set_channel(d_channel); |     multicorrelator_fpga->set_channel(d_channel); | ||||||
|     LOG(INFO) << "Tracking Channel set to " << d_channel; |     LOG(INFO) << "Tracking Channel set to " << d_channel; | ||||||
| @@ -1458,19 +1460,20 @@ void dll_pll_veml_tracking_fpga::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) | |||||||
|  |  | ||||||
|             d_cn0_smoother.reset(); |             d_cn0_smoother.reset(); | ||||||
|             d_carrier_lock_test_smoother.reset(); |             d_carrier_lock_test_smoother.reset(); | ||||||
|  |  | ||||||
|         } |         } | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void dll_pll_veml_tracking_fpga::stop_tracking() | void dll_pll_veml_tracking_fpga::stop_tracking() | ||||||
| { | { | ||||||
|  |     // interrupt the tracking loops | ||||||
|     d_stop_tracking = true; |     d_stop_tracking = true; | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void dll_pll_veml_tracking_fpga::reset(void) | void dll_pll_veml_tracking_fpga::reset(void) | ||||||
| { | { | ||||||
|  |     gr::thread::scoped_lock l(d_setlock); | ||||||
|     multicorrelator_fpga->unlock_channel(); |     multicorrelator_fpga->unlock_channel(); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -1480,6 +1483,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un | |||||||
|     gr_vector_const_void_star &input_items __attribute__((unused)), |     gr_vector_const_void_star &input_items __attribute__((unused)), | ||||||
|     gr_vector_void_star &output_items) |     gr_vector_void_star &output_items) | ||||||
| { | { | ||||||
|  |     gr::thread::scoped_lock l(d_setlock); | ||||||
|     auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]); |     auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]); | ||||||
|     Gnss_Synchro current_synchro_data = Gnss_Synchro(); |     Gnss_Synchro current_synchro_data = Gnss_Synchro(); | ||||||
|     current_synchro_data.Flag_valid_symbol_output = false; |     current_synchro_data.Flag_valid_symbol_output = false; | ||||||
|   | |||||||
| @@ -50,7 +50,6 @@ | |||||||
| class Fpga_Multicorrelator_8sc | class Fpga_Multicorrelator_8sc | ||||||
| { | { | ||||||
| public: | public: | ||||||
|  |  | ||||||
|     /*! |     /*! | ||||||
| 	 * \brief Constructor | 	 * \brief Constructor | ||||||
| 	 */ | 	 */ | ||||||
|   | |||||||
| @@ -29,6 +29,7 @@ | |||||||
|  * ------------------------------------------------------------------------- |  * ------------------------------------------------------------------------- | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
|  | #include "concurrent_queue.h" | ||||||
| #include "gnss_block_factory.h" | #include "gnss_block_factory.h" | ||||||
| #include "gnss_block_interface.h" | #include "gnss_block_interface.h" | ||||||
| #include "gnss_sdr_valve.h" | #include "gnss_sdr_valve.h" | ||||||
| @@ -41,7 +42,6 @@ | |||||||
| #include <gnuradio/blocks/file_source.h> | #include <gnuradio/blocks/file_source.h> | ||||||
| #include <gnuradio/blocks/null_sink.h> | #include <gnuradio/blocks/null_sink.h> | ||||||
| #include <gnuradio/blocks/throttle.h> | #include <gnuradio/blocks/throttle.h> | ||||||
| #include "concurrent_queue.h" |  | ||||||
| #include <gnuradio/top_block.h> | #include <gnuradio/top_block.h> | ||||||
| #include <gtest/gtest.h> | #include <gtest/gtest.h> | ||||||
| #include <chrono> | #include <chrono> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Marc Majoral
					Marc Majoral