22 #ifndef GNSS_SDR_FPGA_ACQUISITION_H 23 #define GNSS_SDR_FPGA_ACQUISITION_H 44 std::string device_name,
47 uint32_t nsamples_total,
49 uint32_t select_queue,
50 uint32_t *all_fft_codes,
51 uint32_t excludelimit);
66 void set_doppler_sweep(uint32_t num_sweeps, uint32_t doppler_step, int32_t doppler_min);
80 uint64_t *initial_sample,
82 uint32_t *doppler_index,
83 uint32_t *total_blk_exp);
91 d_doppler_max = doppler_max;
100 d_doppler_step = doppler_step;
145 static const uint32_t FPGA_PAGE_SIZE = 0x1000;
146 static const uint32_t LAUNCH_ACQUISITION = 1;
147 static const uint32_t RESET_ACQUISITION = 2;
148 static const uint32_t STOP_ACQUISITION = 4;
149 static const uint32_t TEST_REG_SANITY_CHECK = 0x55AA;
150 static const uint32_t LOCAL_CODE_CLEAR_MEM = 0x10000000;
151 static const uint32_t MEM_LOCAL_CODE_WR_ENABLE = 0x0C000000;
152 static const uint32_t POW_2_2 = 4;
153 static const uint32_t POW_2_31 = 2147483648;
155 static const uint32_t SELECT_LSBits = 0x0000FFFF;
156 static const uint32_t SELECT_MSBbits = 0xFFFF0000;
157 static const uint32_t SELECT_ALL_CODE_BITS = 0xFFFFFFFF;
158 static const uint32_t SHL_CODE_BITS = 65536;
161 void fpga_acquisition_test_register(
void);
162 void read_result_valid(uint32_t *result_valid);
164 std::string d_device_name;
169 volatile uint32_t *d_map_base;
170 uint32_t *d_all_fft_codes;
171 uint32_t d_vector_length;
172 uint32_t d_excludelimit;
173 uint32_t d_nsamples_total;
175 uint32_t d_select_queue;
176 uint32_t d_doppler_max;
177 uint32_t d_doppler_step;
184 #endif // GNSS_SDR_FPGA_ACQUISITION_H void set_doppler_step(uint32_t doppler_step)
Set Doppler steps for the grid search.
void close_device()
Close the device driver.
Class that implements carrier wipe-off and correlators.
~Fpga_Acquisition()=default
Destructor.
void reset_acquisition()
Reset the FPGA PL.
void set_block_exp(uint32_t total_block_exp)
Set the block exponent of the FFT in the FPGA.
void stop_acquisition()
stop the acquisition and the FPGA modules.
Fpga_Acquisition(std::string device_name, uint32_t nsamples, uint32_t doppler_max, uint32_t nsamples_total, int64_t fs_in, uint32_t select_queue, uint32_t *all_fft_codes, uint32_t excludelimit)
Constructor.
void open_device()
Open the device driver.
bool set_local_code(uint32_t PRN)
Select the code with the chosen PRN.
void run_acquisition()
Run the acquisition process in the FPGA.
void read_acquisition_results(uint32_t *max_index, float *firstpeak, float *secondpeak, uint64_t *initial_sample, float *power_sum, uint32_t *doppler_index, uint32_t *total_blk_exp)
Read the results of the acquisition process.
void configure_acquisition(void)
Write the acquisition parameters into the FPGA.
void set_doppler_sweep(uint32_t num_sweeps, uint32_t doppler_step, int32_t doppler_min)
Configure the doppler sweep parameters in the FPGA.
void set_doppler_max(uint32_t doppler_max)
Set maximum Doppler grid search.
void read_fpga_total_scale_factor(uint32_t *total_scale_factor, uint32_t *fw_scale_factor)
Read the scaling factor that has been used by the FFT-IFFT.
void write_local_code(void)
Write the PRN code in the FPGA.