Commit df1cffbc authored by laurent's avatar laurent

fix bug introduced by avx2 rotate_cpx change to c16_t

parent 5894bcac
......@@ -197,8 +197,8 @@ check_warnings() {
#argument:
# $1: log file
check_errors() {
#we look for 'warning:' in the compilation log file
error_count=`grep "error:" "$1" | wc -l`
#we look for 'error:' in the compilation log file
error_count=`grep -c "error:" "$1"`
if [ $error_count -gt 0 ]; then
echo_error "ERROR: $error_count error. See $1"
fi
......
......@@ -341,7 +341,7 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
15);
rotate_cpx_vector((c16_t *) ul_ch2,
(c16_t *)&ru2[2*current_phase2],
(c16_t *) &tmp_estimates[0],
(c16_t *) tmp_estimates,
Msc_RS,
15);
// Combine the two rotated estimates
......@@ -658,12 +658,12 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
// msg("sym: %d, current_phase1: %d, ru: %d + j%d, current_phase2: %d, ru: %d + j%d\n",k,current_phase1,ru1[2*current_phase1],ru1[2*current_phase1+1],current_phase2,ru2[2*current_phase2],ru2[2*current_phase2+1]);
// rotate channel estimates by estimated phase
rotate_cpx_vector((c16_t *) ul_ch1,
(c16_t *)&ru1[2*current_phase1],
(c16_t *) &ru1[2*current_phase1],
(c16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],
Msc_RS,
15);
rotate_cpx_vector((c16_t *) ul_ch2,
(c16_t *)&ru2[2*current_phase2],
(c16_t *) &ru2[2*current_phase2],
(c16_t *) &tmp_estimates[0],
Msc_RS,
15);
......
......@@ -618,20 +618,20 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) {
double f0 = f[ll];
double Ncpm1 = Ncp0;
int16_t *symbol_rotation = fp->symbol_rotation[ll];
c16_t *symbol_rotation = fp->symbol_rotation[ll];
double tl = 0;
double poff = 2 * M_PI * ((Ncp0 * Tc)) * f0;
double exp_re = cos(poff);
double exp_im = sin(-poff);
symbol_rotation[0] = (int16_t)floor(exp_re * 32767);
symbol_rotation[1] = (int16_t)floor(exp_im * 32767);
symbol_rotation[0].r = (int16_t)floor(exp_re * 32767);
symbol_rotation[0].i = (int16_t)floor(exp_im * 32767);
LOG_I(PHY, "Doing symbol rotation calculation for gNB TX/RX, f0 %f Hz, Nsymb %d\n", f0, nsymb);
LOG_I(PHY, "Symbol rotation %d/%d => (%d,%d)\n",
0,
nsymb,
symbol_rotation[0],
symbol_rotation[1]);
symbol_rotation[0].r,
symbol_rotation[0].i);
for (int l = 1; l < nsymb; l++) {
......@@ -646,15 +646,15 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) {
poff = 2 * M_PI * (tl + (Ncp * Tc)) * f0;
exp_re = cos(poff);
exp_im = sin(-poff);
symbol_rotation[l<<1] = (int16_t)floor(exp_re * 32767);
symbol_rotation[1 + (l<<1)] = (int16_t)floor(exp_im * 32767);
symbol_rotation[l].r = (int16_t)floor(exp_re * 32767);
symbol_rotation[l].i = (int16_t)floor(exp_im * 32767);
LOG_I(PHY, "Symbol rotation %d/%d => tl %f (%d,%d) (%f)\n",
l,
nsymb,
tl,
symbol_rotation[l<<1],
symbol_rotation[1 + (l<<1)],
symbol_rotation[l].r,
symbol_rotation[l].i,
(poff / 2 / M_PI) - floor(poff / 2 / M_PI));
Ncpm1 = Ncp;
......@@ -670,13 +670,13 @@ void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp)
double poff = -i * 2.0 * M_PI * sample_offset / fp->ofdm_symbol_size;
double exp_re = cos(poff);
double exp_im = sin(-poff);
fp->timeshift_symbol_rotation[i*2] = (int16_t)round(exp_re * 32767);
fp->timeshift_symbol_rotation[i*2+1] = (int16_t)round(exp_im * 32767);
fp->timeshift_symbol_rotation[i].r = (int16_t)round(exp_re * 32767);
fp->timeshift_symbol_rotation[i].i = (int16_t)round(exp_im * 32767);
if (i < 10)
LOG_I(PHY,"Timeshift symbol rotation %d => (%d,%d) %f\n",i,
fp->timeshift_symbol_rotation[i*2],
fp->timeshift_symbol_rotation[i*2+1],
fp->timeshift_symbol_rotation[i].r,
fp->timeshift_symbol_rotation[i].i,
poff);
}
}
......
......@@ -348,7 +348,7 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
int length) {
int symb_offset = (slot%fp->slots_per_subframe)*fp->symbols_per_slot;
int16_t *symbol_rotation = fp->symbol_rotation[0];
c16_t *symbol_rotation = fp->symbol_rotation[0];
for (int sidx=0;sidx<nsymb;sidx++) {
......@@ -357,12 +357,12 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
slot,
sidx + first_symbol + symb_offset,
length,
symbol_rotation[2 * (sidx + first_symbol + symb_offset)],
symbol_rotation[1 + 2 * (sidx + first_symbol + symb_offset)]);
symbol_rotation[sidx + first_symbol + symb_offset].r,
symbol_rotation[sidx + first_symbol + symb_offset].i);
rotate_cpx_vector((c16_t*)trxdata + (sidx * length * 2),
(c16_t*)&symbol_rotation[2 * (sidx + first_symbol + symb_offset)],
(c16_t*) trxdata + (sidx * length * 2),
rotate_cpx_vector(((c16_t*) trxdata) + sidx * length,
symbol_rotation + sidx + first_symbol + symb_offset,
((c16_t*) trxdata) + sidx * length,
length,
15);
}
......
......@@ -98,7 +98,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
stop_meas(&ue->rx_dft_stats);
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
c16_t rot2 = ((c16_t*)frame_parms->symbol_rotation[0])[symbol+symb_offset];
c16_t rot2 = frame_parms->symbol_rotation[0][symbol+symb_offset];
rot2.i=-rot2.i;
#ifdef DEBUG_FEP
......@@ -113,10 +113,10 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
frame_parms->ofdm_symbol_size,
15);
int16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
multadd_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
shift_rot,
(int16_t *)shift_rot,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
1,
frame_parms->ofdm_symbol_size,
......@@ -214,7 +214,7 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
stop_meas(&ue->rx_dft_stats);
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
c16_t rot2 = ((c16_t*)frame_parms->symbol_rotation[0])[symbol + symb_offset];
c16_t rot2 = frame_parms->symbol_rotation[0][symbol + symb_offset];
rot2.i=-rot2.i;
#ifdef DEBUG_FEP
......@@ -310,7 +310,7 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
for (int symbol=first_symbol;symbol<nsymb;symbol++) {
c16_t rot2 = ((c16_t*)frame_parms->symbol_rotation[1])[symbol + symb_offset];
c16_t rot2 = frame_parms->symbol_rotation[1][symbol + symb_offset];
rot2.i=-rot2.i;
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,rot2.r,rot2.i);
rotate_cpx_vector((c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
......@@ -319,10 +319,10 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
length,
15);
int16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
shift_rot,
(int16_t *)shift_rot,
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
1,
length,
......
......@@ -359,10 +359,10 @@ struct NR_DL_FRAME_PARMS {
lte_prefix_type_t Ncp;
/// sequence which is computed based on carrier frequency and numerology to rotate/derotate each OFDM symbol according to Section 5.3 in 38.211
/// First dimension is for the direction of the link (0 DL, 1 UL)
int16_t symbol_rotation[2][224*2];
c16_t symbol_rotation[2][224];
/// sequence used to compensate the phase rotation due to timeshifted OFDM symbols
/// First dimenstion is for different CP lengths
int16_t timeshift_symbol_rotation[4096*2] __attribute__ ((aligned (16)));
c16_t timeshift_symbol_rotation[4096*2] __attribute__ ((aligned (16)));
/// shift of pilot position in one RB
uint8_t nushift;
/// SRS configuration from TS 38.331 RRC
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment