1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-26 12:04:55 +00:00

declared the 64-bit variables as long long ints instead of long ints in the FPGA related files.

Variables declared as long ints are interpreted as 32-bit variables in the ARM architecture and 64-bit variables in the X86-64 architecture.
This commit is contained in:
Marc Majoral
2018-08-10 16:42:53 +02:00
parent b1524a3afe
commit f14ad930d5
8 changed files with 32 additions and 29 deletions

View File

@@ -223,7 +223,7 @@ void pcps_acquisition_fpga::set_active(bool active)
// no CFAR algorithm in the FPGA
<< ", use_CFAR_algorithm_flag: false";
unsigned long int initial_sample;
unsigned long long int initial_sample;
float input_power_all = 0.0;
float input_power_computed = 0.0;
@@ -325,11 +325,11 @@ void pcps_acquisition_fpga::set_active(bool active)
if (d_test_statistics > d_threshold)
{
d_active = false;
printf("##### d_test_statistics = %f\n", d_test_statistics);
printf("##### debug_d_max_absolute =%f\n",debug_d_max_absolute);
printf("##### debug_d_input_power_absolute =%f\n",debug_d_input_power_absolute);
printf("##### initial_sample = %lu\n",initial_sample);
printf("##### debug_doppler_index = %d\n",debug_doppler_index);
// printf("##### d_test_statistics = %f\n", d_test_statistics);
// printf("##### debug_d_max_absolute =%f\n",debug_d_max_absolute);
// printf("##### debug_d_input_power_absolute =%f\n",debug_d_input_power_absolute);
// printf("##### initial_sample = %llu\n",initial_sample);
// printf("##### debug_doppler_index = %d\n",debug_doppler_index);
send_positive_acquisition();
d_state = 0; // Positive acquisition
}

View File

@@ -115,7 +115,7 @@ private:
unsigned int d_doppler_step;
unsigned int d_fft_size;
unsigned int d_num_doppler_bins;
unsigned long int d_sample_counter;
unsigned long long int d_sample_counter;
Gnss_Synchro* d_gnss_synchro;
std::shared_ptr<fpga_acquisition> acquisition_fpga;

View File

@@ -369,18 +369,20 @@ void fpga_acquisition::set_phase_step(unsigned int doppler_index)
void fpga_acquisition::read_acquisition_results(uint32_t *max_index,
float *max_magnitude, unsigned long int *initial_sample, float *power_sum, unsigned *doppler_index)
float *max_magnitude, unsigned long long int *initial_sample, float *power_sum, unsigned *doppler_index)
{
unsigned long int initial_sample_tmp;
unsigned long long int initial_sample_tmp = 0;
unsigned readval = 0;
unsigned long int readval_long = 0;
unsigned long long int readval_long = 0;
unsigned long long int readval_long_shifted = 0;
readval = d_map_base[1];
initial_sample_tmp = readval;
//*initial_sample = readval;
//printf("read initial sample dmap 1 = %d\n", readval);
readval_long = d_map_base[2];
initial_sample_tmp = initial_sample_tmp + (readval_long * (2^32));
readval_long_shifted = readval_long << 32; // 2^32
initial_sample_tmp = initial_sample_tmp + readval_long_shifted; // 2^32
//printf("----------------------------------------------------------------> acq initial sample TOTAL = %llu\n", initial_sample_tmp);
*initial_sample = initial_sample_tmp;
readval = d_map_base[6];
*max_magnitude = static_cast<float>(readval);

View File

@@ -61,7 +61,7 @@ public:
void run_acquisition(void);
void set_phase_step(unsigned int doppler_index);
void read_acquisition_results(uint32_t *max_index, float *max_magnitude,
unsigned long int *initial_sample, float *power_sum, unsigned *doppler_index);
unsigned long long int *initial_sample, float *power_sum, unsigned *doppler_index);
void block_samples();
void unblock_samples();