From a25ce40d5457b1a4245b86252f1378d750cf127f Mon Sep 17 00:00:00 2001 From: Marc Majoral Date: Thu, 6 May 2021 20:38:22 +0200 Subject: [PATCH 1/2] added a signal in the FPGA to stop the receiver modules. --- .../galileo_e1_pcps_ambiguous_acquisition_fpga.cc | 4 ++-- .../adapters/galileo_e5a_pcps_acquisition_fpga.cc | 4 ++-- .../adapters/gps_l1_ca_pcps_acquisition_fpga.cc | 4 ++-- .../adapters/gps_l2_m_pcps_acquisition_fpga.cc | 2 ++ .../adapters/gps_l5i_pcps_acquisition_fpga.cc | 4 ++-- .../gnuradio_blocks/pcps_acquisition_fpga.cc | 8 ++++++++ .../gnuradio_blocks/pcps_acquisition_fpga.h | 5 +++++ src/algorithms/acquisition/libs/fpga_acquisition.cc | 8 ++++++-- src/algorithms/acquisition/libs/fpga_acquisition.h | 10 ++++++++-- 9 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index 30c096a63..59ebe3309 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -189,8 +189,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( void GalileoE1PcpsAmbiguousAcquisitionFpga::stop_acquisition() { - // this command causes the SW to reset the HW. - acquisition_fpga_->reset_acquisition(); + // stop the acquisition and the other FPGA modules. + acquisition_fpga_->stop_acquisition(); } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc index 62461494f..ca26fba62 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -192,8 +192,8 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga( void GalileoE5aPcpsAcquisitionFpga::stop_acquisition() { - // this command causes the SW to reset the HW. - acquisition_fpga_->reset_acquisition(); + // stop the acquisition and the other FPGA modules. + acquisition_fpga_->stop_acquisition(); } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index 8117920c7..5362f78bc 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -168,8 +168,8 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( void GpsL1CaPcpsAcquisitionFpga::stop_acquisition() { - // this command causes the SW to reset the HW. - acquisition_fpga_->reset_acquisition(); + // stop the acquisition and the other FPGA modules. + acquisition_fpga_->stop_acquisition(); } diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc index 464959a74..b3d0d117d 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc @@ -158,6 +158,8 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( void GpsL2MPcpsAcquisitionFpga::stop_acquisition() { + // stop the acquisition and the other FPGA modules. + acquisition_fpga_->stop_acquisition(); } diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc index e287a8fd1..fe9a7a605 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -170,8 +170,8 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( void GpsL5iPcpsAcquisitionFpga::stop_acquisition() { - // this command causes the SW to reset the HW. - acquisition_fpga_->reset_acquisition(); + // stop the acquisition and the other FPGA modules. + acquisition_fpga_->stop_acquisition(); } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc index 07629d80e..e1f8949e1 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -301,3 +301,11 @@ void pcps_acquisition_fpga::reset_acquisition() d_acquisition_fpga->reset_acquisition(); d_acquisition_fpga->close_device(); } + +void pcps_acquisition_fpga::stop_acquisition() +{ + // this function stops the acquisition and the other FPGA Modules. + d_acquisition_fpga->open_device(); + d_acquisition_fpga->stop_acquisition(); + d_acquisition_fpga->close_device(); +} diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h index aeebc27c9..3b3e534ee 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.h @@ -189,6 +189,11 @@ public: */ void reset_acquisition(); + /*! + * \brief stop the acquisition and the other FPGA modules. + */ + void stop_acquisition(); + private: friend pcps_acquisition_fpga_sptr pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_); explicit pcps_acquisition_fpga(pcpsconf_fpga_t conf_); diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.cc b/src/algorithms/acquisition/libs/fpga_acquisition.cc index ab1439567..e198b32aa 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.cc +++ b/src/algorithms/acquisition/libs/fpga_acquisition.cc @@ -240,11 +240,15 @@ void Fpga_Acquisition::close_device() void Fpga_Acquisition::reset_acquisition() { - // printf("============ resetting the hw now from the acquisition ==============="); - d_map_base[8] = RESET_ACQUISITION; // writing a 2 to d_map_base[8] resets the acquisition. This causes a reset of all + d_map_base[8] = RESET_ACQUISITION; // setting bit 2 of d_map_base[8] resets the acquisition. This causes a reset of all // the FPGA HW modules including the multicorrelators } +void Fpga_Acquisition::stop_acquisition() +{ + d_map_base[8] = STOP_ACQUISITION; // setting bit 3 of d_map_base[8] stops the acquisition module. This stops all + // the FPGA HW modules including the multicorrelators +} // this function is only used for the unit tests void Fpga_Acquisition::read_fpga_total_scale_factor(uint32_t *total_scale_factor, uint32_t *fw_scale_factor) diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.h b/src/algorithms/acquisition/libs/fpga_acquisition.h index 7b5453f0c..3b6aa792c 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.h +++ b/src/algorithms/acquisition/libs/fpga_acquisition.h @@ -105,6 +105,11 @@ public: */ void reset_acquisition(); + /*! + * \brief stop the acquisition and the FPGA modules. + */ + void stop_acquisition(); + /*! * \brief Read the scaling factor that has been used by the FFT-IFFT */ @@ -138,8 +143,9 @@ public: private: // FPGA register parameters static const uint32_t PAGE_SIZE_DEFAULT = 0x10000; // default page size for the multicorrelator memory map - static const uint32_t RESET_ACQUISITION = 2; // command to reset the multicorrelator - static const uint32_t LAUNCH_ACQUISITION = 1; // command to launch the multicorrelator + static const uint32_t RESET_ACQUISITION = 2; // command to reset the acquisition and the FPGA Modules + static const uint32_t STOP_ACQUISITION = 4; // command to stop the acquisition and the FPGA modules + static const uint32_t LAUNCH_ACQUISITION = 1; // command to launch the acquisition process static const uint32_t TEST_REG_SANITY_CHECK = 0x55AA; // value to check the presence of the test register (to detect the hw) static const uint32_t LOCAL_CODE_CLEAR_MEM = 0x10000000; // command to clear the internal memory of the multicorrelator static const uint32_t MEM_LOCAL_CODE_WR_ENABLE = 0x0C000000; // command to enable the ENA and WR pins of the internal memory of the multicorrelator From 8b21572331c02fba3365440bb07f2943326d67c4 Mon Sep 17 00:00:00 2001 From: Marc Majoral Date: Thu, 6 May 2021 20:48:41 +0200 Subject: [PATCH 2/2] code cleaning --- src/algorithms/acquisition/libs/fpga_acquisition.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.h b/src/algorithms/acquisition/libs/fpga_acquisition.h index 3b6aa792c..d9d2b31ba 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.h +++ b/src/algorithms/acquisition/libs/fpga_acquisition.h @@ -143,9 +143,9 @@ public: private: // FPGA register parameters static const uint32_t PAGE_SIZE_DEFAULT = 0x10000; // default page size for the multicorrelator memory map + static const uint32_t LAUNCH_ACQUISITION = 1; // command to launch the acquisition process static const uint32_t RESET_ACQUISITION = 2; // command to reset the acquisition and the FPGA Modules static const uint32_t STOP_ACQUISITION = 4; // command to stop the acquisition and the FPGA modules - static const uint32_t LAUNCH_ACQUISITION = 1; // command to launch the acquisition process static const uint32_t TEST_REG_SANITY_CHECK = 0x55AA; // value to check the presence of the test register (to detect the hw) static const uint32_t LOCAL_CODE_CLEAR_MEM = 0x10000000; // command to clear the internal memory of the multicorrelator static const uint32_t MEM_LOCAL_CODE_WR_ENABLE = 0x0C000000; // command to enable the ENA and WR pins of the internal memory of the multicorrelator