diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc index ab1fb6947..2d45be9ee 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test_fpga.cc @@ -29,36 +29,45 @@ * ------------------------------------------------------------------------- */ +#include "Galileo_E1.h" +#include "acquisition_dump_reader.h" #include "concurrent_queue.h" #include "fpga_switch.h" +#include "galileo_e1_pcps_ambiguous_acquisition_fpga.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "gnss_sdr_valve.h" +#include "gnss_signal.h" #include "gnss_synchro.h" -#include "galileo_e1_pcps_ambiguous_acquisition_fpga.h" -//#include "gps_l1_ca_pcps_acquisition_fpga.h" #include "in_memory_configuration.h" +#include "test_flags.h" #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include // for abs, pow, floor -#include // for O_WRONLY -#include +#include +#include +#include +#include +#include #include -#include // for pthread stuff + #ifdef GR_GREATER_38 #include #else #include #endif +#if HAS_STD_FILESYSTEM +#if HAS_STD_FILESYSTEM_EXPERIMENTAL +#include +namespace fs = std::experimental::filesystem; +#else +#include +namespace fs = std::filesystem; +#endif +#else +#include +namespace fs = boost::filesystem; +#endif + struct DMA_handler_args_galileo_e1_pcps_ambiguous_acq_test { std::string file; @@ -89,11 +98,8 @@ protected: void init(); - gr::top_block_sptr top_block; - std::shared_ptr factory; std::shared_ptr config; - Gnss_Synchro gnss_synchro; - size_t item_size; + unsigned int doppler_max; unsigned int doppler_step; unsigned int nsamples_to_transfer; @@ -104,17 +110,15 @@ protected: GalileoE1PcpsAmbiguousAcquisitionTestFpga::GalileoE1PcpsAmbiguousAcquisitionTestFpga() { - factory = std::make_shared(); + config = std::make_shared(); - item_size = sizeof(gr_complex); - gnss_synchro = Gnss_Synchro(); + doppler_max = 5000; doppler_step = 100; } void* handler_DMA_galileo_e1_pcps_ambiguous_acq_test(void* arguments) { - //const float MAX_SAMPLE_VALUE = 0.097781330347061; const float MAX_SAMPLE_VALUE = 0.096257761120796; const int DMA_BITS_PER_SAMPLE = 8; const float DMA_SCALING_FACTOR = (pow(2, DMA_BITS_PER_SAMPLE - 1) - 1) / MAX_SAMPLE_VALUE; @@ -349,7 +353,6 @@ bool GalileoE1PcpsAmbiguousAcquisitionTestFpga::acquire_signal() std::shared_ptr acquisition; -// std::string System_and_Signal; std::string signal; struct DMA_handler_args_galileo_e1_pcps_ambiguous_acq_test args; struct acquisition_handler_args_galileo_e1_pcps_ambiguous_acq_test args_acq; @@ -439,11 +442,6 @@ bool GalileoE1PcpsAmbiguousAcquisitionTestFpga::acquire_signal() void GalileoE1PcpsAmbiguousAcquisitionTestFpga::init() { - gnss_synchro.Channel_ID = 0; - gnss_synchro.System = 'E'; - std::string signal = "1B"; - signal.copy(gnss_synchro.Signal, 2, 0); - gnss_synchro.PRN = 1; config->set_property("GNSS-SDR.internal_fs_sps", "4000000"); config->set_property("Acquisition.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition_Fpga"); config->set_property("Acquisition.threshold", "0.00001"); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc index 304ad03d2..df2472d50 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc @@ -29,35 +29,43 @@ * ------------------------------------------------------------------------- */ +#include "GPS_L1_CA.h" +#include "acquisition_dump_reader.h" #include "concurrent_queue.h" #include "fpga_switch.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "gnss_sdr_valve.h" #include "gnss_synchro.h" #include "gps_l1_ca_pcps_acquisition_fpga.h" #include "in_memory_configuration.h" +#include "test_flags.h" #include -#include -#include -#include -#include -#include -#include +#include // for abs, pow, floor +#include #include #include -#include -#include // for abs, pow, floor -#include // for O_WRONLY -#include +#include #include -#include // for pthread stuff + #ifdef GR_GREATER_38 #include #else #include #endif +#if HAS_STD_FILESYSTEM +#if HAS_STD_FILESYSTEM_EXPERIMENTAL +#include +namespace fs = std::experimental::filesystem; +#else +#include +namespace fs = std::filesystem; +#endif +#else +#include +namespace fs = boost::filesystem; +#endif + struct DMA_handler_args_gps_l1_acq_test { std::string file; @@ -88,11 +96,8 @@ protected: void init(); - gr::top_block_sptr top_block; - std::shared_ptr factory; std::shared_ptr config; - Gnss_Synchro gnss_synchro; - size_t item_size; + unsigned int doppler_max; unsigned int doppler_step; unsigned int nsamples_to_transfer; @@ -103,10 +108,9 @@ protected: GpsL1CaPcpsAcquisitionTestFpga::GpsL1CaPcpsAcquisitionTestFpga() { - factory = std::make_shared(); + config = std::make_shared(); - item_size = sizeof(gr_complex); - gnss_synchro = Gnss_Synchro(); + doppler_max = 5000; doppler_step = 100; } @@ -435,11 +439,6 @@ bool GpsL1CaPcpsAcquisitionTestFpga::acquire_signal() void GpsL1CaPcpsAcquisitionTestFpga::init() { - gnss_synchro.Channel_ID = 0; - gnss_synchro.System = 'G'; - std::string signal = "1C"; - signal.copy(gnss_synchro.Signal, 2, 0); - gnss_synchro.PRN = 1; config->set_property("GNSS-SDR.internal_fs_sps", "4000000"); config->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Acquisition_Fpga"); config->set_property("Acquisition.threshold", "0.00001"); diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc index 2b846ac78..3cb1a81e0 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc @@ -30,43 +30,23 @@ * ------------------------------------------------------------------------- */ - - - -#include "gnss_sdr_fpga_sample_counter.h" -#include "gps_l1_ca_dll_pll_tracking_fpga.h" -#include "fpga_switch.h" - - - - - - -// threads -#include // for pthread stuff - - - #include "GPS_L1_CA.h" -#include "GPS_L2C.h" #include "GPS_L5.h" #include "Galileo_E1.h" #include "Galileo_E5a.h" #include "acquisition_msg_rx.h" -#include "galileo_e1_pcps_ambiguous_acquisition.h" -#include "galileo_e5a_noncoherent_iq_acquisition_caf.h" -#include "galileo_e5a_pcps_acquisition.h" -#include "glonass_l1_ca_pcps_acquisition.h" -#include "glonass_l2_ca_pcps_acquisition.h" +#include "fpga_switch.h" +#include "galileo_e1_pcps_ambiguous_acquisition_fpga.h" +#include "galileo_e5a_pcps_acquisition_fpga.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" #include "gnss_satellite.h" #include "gnss_sdr_sample_counter.h" #include "gnss_synchro.h" #include "gnuplot_i.h" -#include "gps_l1_ca_pcps_acquisition.h" -#include "gps_l2_m_pcps_acquisition.h" -#include "gps_l5i_pcps_acquisition.h" +#include "gps_l1_ca_dll_pll_tracking_fpga.h" +#include "gps_l1_ca_pcps_acquisition_fpga.h" +#include "gps_l5i_pcps_acquisition_fpga.h" #include "hybrid_observables.h" #include "in_memory_configuration.h" #include "observable_tests_flags.h" @@ -97,6 +77,7 @@ #include #include #include +#include #include #include #ifdef GR_GREATER_38 @@ -760,9 +741,6 @@ bool HybridObservablesTestFpga::acquire_signal() // wait to give time for the acquisition thread to set up the acquisition HW accelerator in the FPGA usleep(1000000); -// args.skip_used_samples = 0; -// args.nsamples_tx = nsamples_to_transfer + TEST_OBS_SKIP_SAMPLES; - // create DMA child process if (pthread_create(&thread_DMA, nullptr, handler_DMA_obs_test, reinterpret_cast(&args)) < 0) { @@ -781,11 +759,6 @@ bool HybridObservablesTestFpga::acquire_signal() { std::cout << " " << PRN << " "; -// tmp_gnss_synchro.Acq_doppler_hz = tmp_gnss_synchro.Acq_doppler_hz; -// tmp_gnss_synchro.Acq_delay_samples = tmp_gnss_synchro.Acq_delay_samples; -// //tmp_gnss_synchro.Acq_samplestamp_samples = 0; // do not take into account the filter internal state initialisation -// tmp_gnss_synchro.Acq_samplestamp_samples = tmp_gnss_synchro.Acq_samplestamp_samples; // delay due to the downsampling filter in the acquisition - gnss_synchro_vec.push_back(tmp_gnss_synchro); } else @@ -2019,7 +1992,6 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) top_block->connect(observables->get_right_block(), n, null_sink_vec.at(n), 0); } // connect sample counter and timmer to the last channel in observables block (extra channel) - // top_block->connect(samp_counter, 0, observables->get_left_block(), tracking_ch_vec.size()); top_block->connect(ch_out_fpga_sample_counter, 0, observables->get_left_block(), tracking_ch_vec.size()); // extra port for the sample counter pulse }) << "Failure connecting the blocks."; @@ -2063,28 +2035,9 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) }) << "Failure connecting tracking to the top_block."; } -// // send some samples to allow the receiver to exit the tracking loops -// args.file = file; -// args.nsamples_tx = baseband_sampling_freq * 1; // 1 s -// args.skip_used_samples = baseband_sampling_freq * FLAGS_duration; -// if (pthread_create(&thread_DMA, nullptr, handler_DMA_obs_test, reinterpret_cast(&args)) < 0) -// { -// std::cout << "ERROR cannot create DMA Process" << std::endl; -// } - - - // wait for the child DMA process to finish -// pthread_join(thread_DMA, nullptr); - - //std::this_thread::sleep_for(std::chrono::milliseconds(500)); - - // reset the HW in order to produce an interrupt to the tracking - // modules that are in a waiting state acquisition->stop_acquisition(); -// // stop the top block -// top_block->stop(); EXPECT_NO_THROW({ end = std::chrono::system_clock::now(); elapsed_seconds = end - start; diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index f740271a2..fa9f4085b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -31,13 +31,20 @@ */ #include "GPS_L1_CA.h" +//#include "GPS_L2C.h" +#include "GPS_L5.h" +#include "Galileo_E1.h" +#include "Galileo_E5a.h" #include "acquisition_msg_rx.h" +#include "concurrent_queue.h" #include "galileo_e1_pcps_ambiguous_acquisition_fpga.h" -#include "galileo_e5a_noncoherent_iq_acquisition_caf.h" -#include "galileo_e5a_pcps_acquisition.h" +//#include "galileo_e5a_noncoherent_iq_acquisition_caf.h" #include "galileo_e5a_pcps_acquisition_fpga.h" #include "gnss_block_factory.h" +#include "gnuplot_i.h" #include "gps_l1_ca_pcps_acquisition_fpga.h" +//#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" +//#include "gps_l2_m_pcps_acquisition.h" #include "gps_l5i_pcps_acquisition_fpga.h" #include "in_memory_configuration.h" #include "signal_generator_flags.h" @@ -52,13 +59,22 @@ #include #include #include +#include #include #include +#include +#include #include -#include +#include #include #include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif + #if HAS_STD_FILESYSTEM #if HAS_STD_FILESYSTEM_EXPERIMENTAL #include @@ -72,12 +88,6 @@ namespace fs = std::filesystem; namespace fs = boost::filesystem; #endif -// threads -#include // for open, O_RDWR, O_SYNC -#include // for cout, endl -#include // for pthread stuff -#include // for mmap - // ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER ######### class TrackingPullInTest_msg_rx_Fpga; @@ -492,7 +502,6 @@ void TrackingPullInTestFpga::configure_receiver( config->set_property("Tracking.dump", "true"); config->set_property("Tracking.dump_filename", "./tracking_ch_"); config->set_property("Tracking.implementation", implementation); - //config->set_property("Tracking.item_type", "gr_complex"); config->set_property("Tracking.pll_bw_hz", std::to_string(PLL_wide_bw_hz)); config->set_property("Tracking.dll_bw_hz", std::to_string(DLL_wide_bw_hz)); config->set_property("Tracking.extend_correlation_symbols", std::to_string(extend_correlation_symbols)); @@ -937,8 +946,6 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) << " Acquisition SampleStamp is " << acq_samplestamp_map.find(FLAGS_test_satellite_PRN)->second << std::endl; } - // create the msg queue for valve - //queue = std::make_shared>(); long long int acq_to_trk_delay_samples = ceil(static_cast(FLAGS_fs_gen_sps) * FLAGS_acq_to_trk_delay_s);