Merge remote-tracking branch 'origin/develop' into NR_RRC_harmonization_after_BWP
This commit is contained in:
@@ -613,21 +613,6 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
|
||||
for (int id=0; id<NUMBER_OF_NR_SRS_MAX; id++) {
|
||||
gNB->nr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
|
||||
gNB->nr_srs_info[id]->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t));
|
||||
gNB->nr_srs_info[id]->srs_generated_signal = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
gNB->nr_srs_info[id]->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
|
||||
gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
||||
gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
||||
gNB->nr_srs_info[id]->srs_estimated_channel_freq = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
||||
gNB->nr_srs_info[id]->srs_estimated_channel_time = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
||||
gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
||||
for (i=0;i<Prx;i++){
|
||||
gNB->nr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
gNB->nr_srs_info[id]->srs_estimated_channel_time[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
|
||||
generate_ul_reference_signal_sequences(SHRT_MAX);
|
||||
@@ -785,21 +770,6 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
free_and_zero(gNB->nr_csi_rs_info);
|
||||
|
||||
for (int id = 0; id < NUMBER_OF_NR_SRS_MAX; id++) {
|
||||
for (int i = 0; i < Prx; i++) {
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_received_signal[i]);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel[i]);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq[i]);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time[i]);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i]);
|
||||
}
|
||||
free_and_zero(gNB->nr_srs_info[id]->sc_list);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_generated_signal);
|
||||
free_and_zero(gNB->nr_srs_info[id]->noise_power);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_received_signal);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted);
|
||||
free_and_zero(gNB->nr_srs_info[id]);
|
||||
}
|
||||
|
||||
|
||||
@@ -377,22 +377,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
}
|
||||
|
||||
ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
|
||||
ue->nr_srs_info->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t));
|
||||
ue->nr_srs_info->srs_generated_signal = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) );
|
||||
ue->nr_srs_info->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
|
||||
ue->nr_srs_info->srs_received_signal = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->nr_srs_info->srs_ls_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->nr_srs_info->srs_estimated_channel_freq = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->nr_srs_info->srs_estimated_channel_time = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->nr_srs_info->srs_estimated_channel_time_shifted = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
ue->nr_srs_info->srs_ls_estimated_channel[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
ue->nr_srs_info->srs_estimated_channel_freq[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
ue->nr_srs_info->srs_estimated_channel_time[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
}
|
||||
|
||||
|
||||
// RACH
|
||||
prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
|
||||
@@ -520,21 +504,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
free_and_zero(ue->nr_csi_rs_info->csi_rs_estimated_channel_freq);
|
||||
free_and_zero(ue->nr_csi_rs_info);
|
||||
|
||||
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
||||
free_and_zero(ue->nr_srs_info->srs_received_signal[i]);
|
||||
free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel[i]);
|
||||
free_and_zero(ue->nr_srs_info->srs_estimated_channel_freq[i]);
|
||||
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time[i]);
|
||||
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted[i]);
|
||||
}
|
||||
free_and_zero(ue->nr_srs_info->sc_list);
|
||||
free_and_zero(ue->nr_srs_info->srs_generated_signal);
|
||||
free_and_zero(ue->nr_srs_info->noise_power);
|
||||
free_and_zero(ue->nr_srs_info->srs_received_signal);
|
||||
free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel);
|
||||
free_and_zero(ue->nr_srs_info->srs_estimated_channel_freq);
|
||||
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time);
|
||||
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted);
|
||||
free_and_zero(ue->nr_srs_info);
|
||||
|
||||
free_and_zero(ue->csiim_vars[gNB_id]);
|
||||
|
||||
@@ -41,10 +41,10 @@ extern int16_t *ul_ref_sigs_rx[30][2][34];
|
||||
|
||||
int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
L1_rxtx_proc_t *proc,
|
||||
LTE_eNB_ULSCH_t * ulsch,
|
||||
int32_t **ul_ch_estimates,
|
||||
int32_t **ul_ch_estimates_time,
|
||||
int32_t **rxdataF_ext,
|
||||
LTE_eNB_ULSCH_t * ulsch,
|
||||
int32_t **ul_ch_estimates,
|
||||
int32_t **ul_ch_estimates_time,
|
||||
int32_t **rxdataF_ext,
|
||||
module_id_t UE_id,
|
||||
unsigned char l,
|
||||
unsigned char Ns) {
|
||||
@@ -88,7 +88,7 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
uint16_t N_rb_alloc = ulsch->harq_processes[harq_pid]->nb_rb;
|
||||
int32_t tmp_estimates[N_rb_alloc*12] __attribute__((aligned(16)));
|
||||
int32_t tmp_estimates[N_rb_alloc*12] __attribute__((aligned(32)));
|
||||
Msc_RS = N_rb_alloc*12;
|
||||
cyclic_shift = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
|
||||
ulsch->harq_processes[harq_pid]->n_DMRS2 +
|
||||
@@ -334,14 +334,14 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
current_phase2 = cmin(abs(current_phase2),127);
|
||||
// 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((int16_t *) ul_ch1,
|
||||
&ru1[2*current_phase1],
|
||||
(int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],
|
||||
rotate_cpx_vector((c16_t *) ul_ch1,
|
||||
(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((int16_t *) ul_ch2,
|
||||
&ru2[2*current_phase2],
|
||||
(int16_t *) &tmp_estimates[0],
|
||||
rotate_cpx_vector((c16_t *) ul_ch2,
|
||||
(c16_t *)&ru2[2*current_phase2],
|
||||
(c16_t *) tmp_estimates,
|
||||
Msc_RS,
|
||||
15);
|
||||
// Combine the two rotated estimates
|
||||
@@ -657,14 +657,14 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
current_phase2 = cmin(abs(current_phase2),127);
|
||||
// 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((int16_t *) ul_ch1,
|
||||
&ru1[2*current_phase1],
|
||||
(int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],
|
||||
rotate_cpx_vector((c16_t *) ul_ch1,
|
||||
(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((int16_t *) ul_ch2,
|
||||
&ru2[2*current_phase2],
|
||||
(int16_t *) &tmp_estimates[0],
|
||||
rotate_cpx_vector((c16_t *) ul_ch2,
|
||||
(c16_t *) &ru2[2*current_phase2],
|
||||
(c16_t *) &tmp_estimates[0],
|
||||
Msc_RS,
|
||||
15);
|
||||
// Combine the two rotated estimates
|
||||
|
||||
@@ -1997,7 +1997,7 @@ int get_narrowband_index(int N_RB_UL,int rb) {
|
||||
void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe) {
|
||||
uint8_t harq_pid;
|
||||
//uint8_t UE_id;
|
||||
boolean_t new_ulsch = (find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST)==-1) ? TRUE : FALSE;
|
||||
const bool new_ulsch = find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST) == -1;
|
||||
//AssertFatal((UE_id=find_ulsch(ulsch_pdu->ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
|
||||
// "No existing/free UE ULSCH for rnti %x\n",ulsch_pdu->ulsch_pdu_rel8.rnti);
|
||||
LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id];
|
||||
@@ -2063,7 +2063,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu
|
||||
|
||||
if ((ulsch->harq_processes[harq_pid]->status == SCH_IDLE) ||
|
||||
(ulsch->harq_processes[harq_pid]->ndi != ulsch_pdu->ulsch_pdu_rel8.new_data_indication) ||
|
||||
(new_ulsch == TRUE)) {
|
||||
(new_ulsch == true)) {
|
||||
ulsch->harq_processes[harq_pid]->status = ACTIVE;
|
||||
ulsch->harq_processes[harq_pid]->TBS = ulsch_pdu->ulsch_pdu_rel8.size<<3;
|
||||
ulsch->harq_processes[harq_pid]->Msc_initial = 12*ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks;
|
||||
|
||||
@@ -509,7 +509,7 @@ typedef struct {
|
||||
/// Position of first CCE of the dci
|
||||
int firstCCE;
|
||||
/// flag to indicate that this is a RA response
|
||||
boolean_t ra_flag;
|
||||
bool ra_flag;
|
||||
/// rnti
|
||||
rnti_t rnti;
|
||||
/// Format
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,18 +46,18 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
|
||||
|
||||
|
||||
PHY_ofdm_mod(txdataF, // input
|
||||
txdata, // output
|
||||
frame_parms->ofdm_symbol_size,
|
||||
txdata, // output
|
||||
frame_parms->ofdm_symbol_size,
|
||||
|
||||
1, // number of symbols
|
||||
frame_parms->nb_prefix_samples0, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
1, // number of symbols
|
||||
frame_parms->nb_prefix_samples0, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
PHY_ofdm_mod(txdataF+frame_parms->ofdm_symbol_size, // input
|
||||
txdata+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0, // output
|
||||
frame_parms->ofdm_symbol_size,
|
||||
nsymb-1,
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
txdata+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0, // output
|
||||
frame_parms->ofdm_symbol_size,
|
||||
nsymb-1,
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
|
||||
|
||||
|
||||
@@ -341,14 +341,14 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ne
|
||||
}
|
||||
|
||||
void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
|
||||
int16_t* trxdata,
|
||||
int slot,
|
||||
int first_symbol,
|
||||
int nsymb,
|
||||
int length) {
|
||||
int16_t* trxdata,
|
||||
int slot,
|
||||
int first_symbol,
|
||||
int nsymb,
|
||||
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,14 +357,14 @@ 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(trxdata + (sidx * length * 2),
|
||||
&symbol_rotation[2 * (sidx + first_symbol + symb_offset)],
|
||||
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,25 +98,25 @@ 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;
|
||||
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[0])[symbol+symb_offset];
|
||||
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1];
|
||||
c16_t rot2 = frame_parms->symbol_rotation[0][symbol+symb_offset];
|
||||
rot2.i=-rot2.i;
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (ue->frame <100)
|
||||
printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset,
|
||||
symbol+symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]);
|
||||
symbol+symb_offset,rot2.r,rot2.i);
|
||||
#endif
|
||||
|
||||
rotate_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
||||
(int16_t*)&rot2,
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
||||
rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
||||
&rot2,
|
||||
(c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
||||
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,18 +214,18 @@ 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;
|
||||
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[0])[symbol + symb_offset];
|
||||
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1];
|
||||
c16_t rot2 = frame_parms->symbol_rotation[0][symbol + symb_offset];
|
||||
rot2.i=-rot2.i;
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (ue->frame <100)
|
||||
printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset,
|
||||
symbol+symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]);
|
||||
symbol+symb_offset,rot2.r,rot2.i);
|
||||
#endif
|
||||
|
||||
rotate_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
||||
(int16_t*)&rot2,
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
||||
rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
||||
&rot2,
|
||||
(c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
15);
|
||||
}
|
||||
@@ -310,19 +310,19 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
for (int symbol=first_symbol;symbol<nsymb;symbol++) {
|
||||
|
||||
uint32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[1])[symbol + symb_offset];
|
||||
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1];
|
||||
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]);
|
||||
rotate_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
|
||||
(int16_t*)&rot2,
|
||||
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
|
||||
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)],
|
||||
&rot2,
|
||||
(c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
|
||||
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,
|
||||
|
||||
@@ -67,6 +67,49 @@ int nr_est_timing_advance_pusch(PHY_VARS_gNB* gNB, int UE_id)
|
||||
return max_pos - sync_pos;
|
||||
}
|
||||
|
||||
int nr_est_timing_advance_srs(const NR_DL_FRAME_PARMS *frame_parms,
|
||||
const int32_t srs_estimated_channel_time[][frame_parms->ofdm_symbol_size]) {
|
||||
int timing_advance = 0;
|
||||
int max_val = 0;
|
||||
|
||||
for (int i = 0; i < frame_parms->ofdm_symbol_size; i++) {
|
||||
int temp = 0;
|
||||
for (int aa = 0; aa < frame_parms->nb_antennas_rx; aa++) {
|
||||
int Re = ((c16_t*)srs_estimated_channel_time[aa])[i].r;
|
||||
int Im = ((c16_t*)srs_estimated_channel_time[aa])[i].i;
|
||||
temp += (Re*Re/2) + (Im*Im/2);
|
||||
}
|
||||
if (temp > max_val) {
|
||||
timing_advance = i;
|
||||
max_val = temp;
|
||||
}
|
||||
}
|
||||
|
||||
if (timing_advance > frame_parms->ofdm_symbol_size/2) {
|
||||
timing_advance = timing_advance - frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
|
||||
// Scale the 16 factor in N_TA calculation in 38.213 section 4.2 according to the used FFT size
|
||||
const uint16_t bw_scaling = frame_parms->ofdm_symbol_size >> 7;
|
||||
|
||||
// do some integer rounding to improve TA accuracy
|
||||
int sync_pos_rounded;
|
||||
if (timing_advance > 0) {
|
||||
sync_pos_rounded = timing_advance + (bw_scaling >> 1) - 1;
|
||||
} else {
|
||||
sync_pos_rounded = timing_advance - (bw_scaling >> 1) + 1;
|
||||
}
|
||||
|
||||
int timing_advance_update = sync_pos_rounded / bw_scaling;
|
||||
|
||||
// put timing advance command in 0..63 range
|
||||
timing_advance_update += 31;
|
||||
|
||||
if (timing_advance_update < 0) timing_advance_update = 0;
|
||||
if (timing_advance_update > 63) timing_advance_update = 63;
|
||||
|
||||
return timing_advance_update;
|
||||
}
|
||||
|
||||
void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB) {
|
||||
|
||||
|
||||
@@ -854,7 +854,6 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
uint32_t nb_re_pusch)
|
||||
{
|
||||
//#define DEBUG_UL_PTRS 1
|
||||
int16_t *phase_per_symbol = NULL;
|
||||
int32_t *ptrs_re_symbol = NULL;
|
||||
int8_t ret = 0;
|
||||
|
||||
@@ -871,20 +870,20 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
uint8_t *ptrsReOffset = &rel15_ul->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset;
|
||||
/* loop over antennas */
|
||||
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
phase_per_symbol = (int16_t*)gNB->pusch_vars[ulsch_id]->ptrs_phase_per_slot[aarx];
|
||||
c16_t *phase_per_symbol = (c16_t*)gNB->pusch_vars[ulsch_id]->ptrs_phase_per_slot[aarx];
|
||||
ptrs_re_symbol = &gNB->pusch_vars[ulsch_id]->ptrs_re_per_slot;
|
||||
*ptrs_re_symbol = 0;
|
||||
phase_per_symbol[(2*symbol)+1] = 0; // Imag
|
||||
phase_per_symbol[symbol].i = 0;
|
||||
/* set DMRS estimates to 0 angle with magnitude 1 */
|
||||
if(is_dmrs_symbol(symbol,*dmrsSymbPos)) {
|
||||
/* set DMRS real estimation to 32767 */
|
||||
phase_per_symbol[2*symbol]=(int16_t)((1<<15)-1); // 32767
|
||||
phase_per_symbol[symbol].r=INT16_MAX; // 32767
|
||||
#ifdef DEBUG_UL_PTRS
|
||||
printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[2*symbol],phase_per_symbol[(2*symbol)+1]);
|
||||
printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[symbol].r,phase_per_symbol[symbol].i);
|
||||
#endif
|
||||
}
|
||||
else {// real ptrs value is set to 0
|
||||
phase_per_symbol[2*symbol] = 0; // Real
|
||||
phase_per_symbol[symbol].r = 0;
|
||||
}
|
||||
|
||||
if(symbol == *startSymbIndex) {
|
||||
@@ -909,7 +908,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
symbol,frame_parms->ofdm_symbol_size,
|
||||
(int16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(symbol * nb_re_pusch)],
|
||||
gNB->nr_gold_pusch_dmrs[rel15_ul->scid][nr_tti_rx][symbol],
|
||||
&phase_per_symbol[2* symbol],
|
||||
(int16_t*)&phase_per_symbol[symbol],
|
||||
ptrs_re_symbol);
|
||||
}
|
||||
/* For last OFDM symbol at each antenna perform interpolation and compensation for the slot*/
|
||||
@@ -919,7 +918,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
/*------------------------------------------------------------------------------------------------------- */
|
||||
/* If L-PTRS is > 0 then we need interpolation */
|
||||
if(*L_ptrs > 0) {
|
||||
ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, phase_per_symbol, *startSymbIndex, *nbSymb);
|
||||
ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, (int16_t*)phase_per_symbol, *startSymbIndex, *nbSymb);
|
||||
if(ret != 0) {
|
||||
LOG_W(PHY,"[PTRS] Compensation is skipped due to error in PTRS slot processing !!\n");
|
||||
}
|
||||
@@ -938,11 +937,11 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
/* Skip rotation if the slot processing is wrong */
|
||||
if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) {
|
||||
#ifdef DEBUG_UL_PTRS
|
||||
printf("[PHY][UL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[2* i],phase_per_symbol[(2* i) +1]);
|
||||
printf("[PHY][UL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[i].r,phase_per_symbol[i].i);
|
||||
#endif
|
||||
rotate_cpx_vector((int16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)],
|
||||
&phase_per_symbol[2* i],
|
||||
(int16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)],
|
||||
rotate_cpx_vector((c16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)],
|
||||
&phase_per_symbol[i],
|
||||
(c16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)],
|
||||
((*nb_rb) * NR_NB_SC_PER_RB), 15);
|
||||
}// if not DMRS Symbol
|
||||
}// symbol loop
|
||||
@@ -950,9 +949,9 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
}//Antenna loop
|
||||
}
|
||||
|
||||
uint32_t calc_power(uint16_t *x, uint32_t size) {
|
||||
uint64_t sum_x = 0;
|
||||
uint64_t sum_x2 = 0;
|
||||
uint32_t calc_power(const int16_t *x, const uint32_t size) {
|
||||
int64_t sum_x = 0;
|
||||
int64_t sum_x2 = 0;
|
||||
for(int k = 0; k<size; k++) {
|
||||
sum_x = sum_x + x[k];
|
||||
sum_x2 = sum_x2 + x[k]*x[k];
|
||||
@@ -960,28 +959,34 @@ uint32_t calc_power(uint16_t *x, uint32_t size) {
|
||||
return sum_x2/size - (sum_x/size)*(sum_x/size);
|
||||
}
|
||||
|
||||
int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_srs_pdu_t *srs_pdu,
|
||||
nr_srs_info_t *nr_srs_info,
|
||||
int32_t *srs_generated_signal,
|
||||
int32_t **srs_received_signal,
|
||||
int32_t **srs_estimated_channel_freq,
|
||||
int32_t **srs_estimated_channel_time,
|
||||
int32_t **srs_estimated_channel_time_shifted,
|
||||
uint32_t *noise_power) {
|
||||
int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
|
||||
const int frame,
|
||||
const int slot,
|
||||
const nfapi_nr_srs_pdu_t *srs_pdu,
|
||||
const nr_srs_info_t *nr_srs_info,
|
||||
const int32_t *srs_generated_signal,
|
||||
int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
|
||||
int32_t srs_ls_estimated_channel[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
|
||||
int32_t srs_estimated_channel_freq[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
|
||||
int32_t srs_estimated_channel_time[][gNB->frame_parms.ofdm_symbol_size],
|
||||
int32_t srs_estimated_channel_time_shifted[][gNB->frame_parms.ofdm_symbol_size],
|
||||
uint32_t *signal_power,
|
||||
uint32_t *noise_power_per_rb,
|
||||
uint32_t *noise_power,
|
||||
int8_t *snr_per_rb,
|
||||
int8_t *snr) {
|
||||
|
||||
if(nr_srs_info->sc_list_length == 0) {
|
||||
LOG_E(NR_PHY, "(%d.%d) nr_srs_info was not generated yet!\n", frame, slot);
|
||||
return -1;
|
||||
}
|
||||
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
int32_t **srs_ls_estimated_channel = nr_srs_info->srs_ls_estimated_channel;
|
||||
const NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
|
||||
uint16_t noise_real[frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length];
|
||||
uint16_t noise_imag[frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length];
|
||||
int16_t ch_real[frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length];
|
||||
int16_t ch_imag[frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length];
|
||||
int16_t noise_real[frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length];
|
||||
int16_t noise_imag[frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length];
|
||||
|
||||
int16_t ls_estimated[2];
|
||||
|
||||
@@ -994,11 +999,11 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
for(int sc_idx = 0; sc_idx < nr_srs_info->sc_list_length; sc_idx++) {
|
||||
|
||||
int16_t generated_real = srs_generated_signal[nr_srs_info->sc_list[sc_idx]] & 0xFFFF;
|
||||
int16_t generated_imag = (srs_generated_signal[nr_srs_info->sc_list[sc_idx]] >> 16) & 0xFFFF;
|
||||
int16_t generated_real = ((c16_t*)srs_generated_signal)[nr_srs_info->sc_list[sc_idx]].r;
|
||||
int16_t generated_imag = ((c16_t*)srs_generated_signal)[nr_srs_info->sc_list[sc_idx]].i;
|
||||
|
||||
int16_t received_real = srs_received_signal[ant][nr_srs_info->sc_list[sc_idx]] & 0xFFFF;
|
||||
int16_t received_imag = (srs_received_signal[ant][nr_srs_info->sc_list[sc_idx]] >> 16) & 0xFFFF;
|
||||
int16_t received_real = ((c16_t*)srs_received_signal[ant])[nr_srs_info->sc_list[sc_idx]].r;
|
||||
int16_t received_imag = ((c16_t*)srs_received_signal[ant])[nr_srs_info->sc_list[sc_idx]].i;
|
||||
|
||||
// We know that nr_srs_info->srs_generated_signal_bits bits are enough to represent the generated_real and generated_imag.
|
||||
// So we only need a nr_srs_info->srs_generated_signal_bits shift to ensure that the result fits into 16 bits.
|
||||
@@ -1069,8 +1074,10 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
// Compute noise
|
||||
for(int sc_idx = 0; sc_idx < nr_srs_info->sc_list_length; sc_idx++) {
|
||||
noise_real[ant*nr_srs_info->sc_list_length + sc_idx] = abs((int16_t)((srs_ls_estimated_channel[ant][nr_srs_info->sc_list[sc_idx]]-srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]) & 0xFFFF));
|
||||
noise_imag[ant*nr_srs_info->sc_list_length + sc_idx] = abs((int16_t)(((srs_ls_estimated_channel[ant][nr_srs_info->sc_list[sc_idx]]-srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]) >> 16) & 0xFFFF));
|
||||
ch_real[ant*nr_srs_info->sc_list_length + sc_idx] = ((c16_t*)srs_estimated_channel_freq[ant])[nr_srs_info->sc_list[sc_idx]].r;
|
||||
ch_imag[ant*nr_srs_info->sc_list_length + sc_idx] = ((c16_t*)srs_estimated_channel_freq[ant])[nr_srs_info->sc_list[sc_idx]].i;
|
||||
noise_real[ant*nr_srs_info->sc_list_length + sc_idx] = abs(((c16_t*)srs_ls_estimated_channel[ant])[nr_srs_info->sc_list[sc_idx]].r - ch_real[ant*nr_srs_info->sc_list_length + sc_idx]);
|
||||
noise_imag[ant*nr_srs_info->sc_list_length + sc_idx] = abs(((c16_t*)srs_ls_estimated_channel[ant])[nr_srs_info->sc_list[sc_idx]].i - ch_imag[ant*nr_srs_info->sc_list_length + sc_idx]);
|
||||
}
|
||||
|
||||
// Convert to time domain
|
||||
@@ -1087,11 +1094,74 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
(gNB->frame_parms.ofdm_symbol_size>>1)*sizeof(int32_t));
|
||||
}
|
||||
|
||||
// Compute signal power
|
||||
*signal_power = calc_power(ch_real,frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length)
|
||||
+ calc_power(ch_imag,frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length);
|
||||
|
||||
#ifdef SRS_DEBUG
|
||||
LOG_I(NR_PHY,"signal_power = %u\n", *signal_power);
|
||||
#endif
|
||||
|
||||
if (*signal_power == 0) {
|
||||
LOG_W(NR_PHY, "Received SRS signal power is 0\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Compute noise power
|
||||
|
||||
const uint8_t signal_power_bits = log2_approx(*signal_power);
|
||||
const uint8_t factor_bits = signal_power_bits < 32 ? 32 - signal_power_bits : 0; // 32 due to input of dB_fixed(uint32_t x)
|
||||
const int32_t factor_dB = dB_fixed(1<<factor_bits);
|
||||
|
||||
const uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12;
|
||||
const uint8_t srs_symbols_per_rb = srs_pdu->comb_size == 0 ? 6 : 3;
|
||||
const uint8_t n_noise_estimates = frame_parms->nb_antennas_rx*srs_symbols_per_rb;
|
||||
uint8_t count_estimates = 0;
|
||||
uint64_t sum_re = 0;
|
||||
uint64_t sum_re2 = 0;
|
||||
uint64_t sum_im = 0;
|
||||
uint64_t sum_im2 = 0;
|
||||
|
||||
for (int sc_idx = 0; sc_idx < nr_srs_info->sc_list_length; sc_idx++) {
|
||||
|
||||
int subcarrier0 = nr_srs_info->sc_list[sc_idx]-subcarrier_offset;
|
||||
if(subcarrier0 < 0) {
|
||||
subcarrier0 = subcarrier0 + frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
int rb = subcarrier0/NR_NB_SC_PER_RB;
|
||||
|
||||
for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) {
|
||||
|
||||
sum_re = sum_re + noise_real[ant*nr_srs_info->sc_list_length+sc_idx];
|
||||
sum_re2 = sum_re2 + noise_real[ant*nr_srs_info->sc_list_length+sc_idx]*noise_real[ant*nr_srs_info->sc_list_length+sc_idx];
|
||||
sum_im = sum_im + noise_imag[ant*nr_srs_info->sc_list_length+sc_idx];
|
||||
sum_im2 = sum_im2 + noise_imag[ant*nr_srs_info->sc_list_length+sc_idx]*noise_imag[ant*nr_srs_info->sc_list_length+sc_idx];
|
||||
|
||||
count_estimates++;
|
||||
if (count_estimates == n_noise_estimates) {
|
||||
noise_power_per_rb[rb] = sum_re2/n_noise_estimates - (sum_re/n_noise_estimates)*(sum_re/n_noise_estimates) +
|
||||
sum_im2/n_noise_estimates - (sum_im/n_noise_estimates)*(sum_im/n_noise_estimates);
|
||||
snr_per_rb[rb] = dB_fixed((int32_t)((*signal_power<<factor_bits)/noise_power_per_rb[rb])) - factor_dB;
|
||||
count_estimates = 0;
|
||||
sum_re = 0;
|
||||
sum_re2 = 0;
|
||||
sum_im = 0;
|
||||
sum_im2 = 0;
|
||||
|
||||
#ifdef SRS_DEBUG
|
||||
LOG_I(NR_PHY,"noise_power_per_rb[%i] = %i, snr_per_rb[%i] = %i dB\n", rb, noise_power_per_rb[rb], rb, snr_per_rb[rb]);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*noise_power = calc_power(noise_real,frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length)
|
||||
+ calc_power(noise_imag,frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length);
|
||||
|
||||
*snr = dB_fixed((int32_t)((*signal_power<<factor_bits)/(*noise_power))) - factor_dB;
|
||||
|
||||
#ifdef SRS_DEBUG
|
||||
uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12;
|
||||
uint8_t R = srs_pdu->comb_size == 0 ? 2 : 4;
|
||||
for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) {
|
||||
for(int sc_idx = 0; sc_idx < nr_srs_info->sc_list_length; sc_idx++) {
|
||||
@@ -1119,7 +1189,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
}
|
||||
}
|
||||
LOG_I(NR_PHY,"noise_power = %u\n", *noise_power);
|
||||
LOG_I(NR_PHY,"noise_power = %u, SNR = %i dB\n", *noise_power, *snr);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -55,6 +55,9 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
|
||||
|
||||
int nr_est_timing_advance_pusch(PHY_VARS_gNB* phy_vars_gNB, int UE_id);
|
||||
|
||||
int nr_est_timing_advance_srs(const NR_DL_FRAME_PARMS *frame_parms,
|
||||
const int32_t srs_estimated_channel_time[][frame_parms->ofdm_symbol_size]);
|
||||
|
||||
void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
nfapi_nr_pusch_pdu_t *rel15_ul,
|
||||
@@ -63,15 +66,20 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
unsigned char symbol,
|
||||
uint32_t nb_re_pusch);
|
||||
|
||||
int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_srs_pdu_t *srs_pdu,
|
||||
nr_srs_info_t *nr_srs_info,
|
||||
int32_t *srs_generated_signal,
|
||||
int32_t **srs_received_signal,
|
||||
int32_t **srs_estimated_channel_freq,
|
||||
int32_t **srs_estimated_channel_time,
|
||||
int32_t **srs_estimated_channel_time_shifted,
|
||||
uint32_t *noise_power);
|
||||
int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
|
||||
const int frame,
|
||||
const int slot,
|
||||
const nfapi_nr_srs_pdu_t *srs_pdu,
|
||||
const nr_srs_info_t *nr_srs_info,
|
||||
const int32_t *srs_generated_signal,
|
||||
int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
|
||||
int32_t srs_ls_estimated_channel[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
|
||||
int32_t srs_estimated_channel_freq[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)],
|
||||
int32_t srs_estimated_channel_time[][gNB->frame_parms.ofdm_symbol_size],
|
||||
int32_t srs_estimated_channel_time_shifted[][gNB->frame_parms.ofdm_symbol_size],
|
||||
uint32_t *signal_power,
|
||||
uint32_t *noise_power_per_rb,
|
||||
uint32_t *noise_power,
|
||||
int8_t *snr_per_rb,
|
||||
int8_t *snr);
|
||||
#endif
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
//#define DEBUG_PBCH
|
||||
//#define DEBUG_PBCH_ENCODING
|
||||
@@ -248,6 +249,9 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu,
|
||||
for (int i=0; i<NR_PBCH_PDU_BITS; i++)
|
||||
pbch->pbch_a |= ((pbch_pdu[i>>3]>>(7-(i&7)))&1)<<i;
|
||||
|
||||
// NSA to signal no coreset0
|
||||
const int ssb_sc_offset = get_softmodem_params()->sa ? config->ssb_table.ssb_subcarrier_offset.value : 31;
|
||||
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
for (int i=0; i<3; i++)
|
||||
printf("pbch_pdu[%d]: 0x%02x\n", i, pbch_pdu[i]);
|
||||
@@ -265,7 +269,7 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu,
|
||||
for (int i=0; i<3; i++)
|
||||
pbch->pbch_a |= ((ssb_index>>(5-i))&1)<<(29+i); // resp. 6th, 5th and 4th bits of ssb_index
|
||||
else
|
||||
pbch->pbch_a |= ((config->ssb_table.ssb_subcarrier_offset.value>>4)&1)<<29; //MSB of k_SSB (bit index 4)
|
||||
pbch->pbch_a |= ((ssb_sc_offset>>4)&1)<<29; //MSB of k_SSB (bit index 4)
|
||||
|
||||
LOG_D(PHY,"After extra byte: pbch_a = 0x%08x\n",pbch->pbch_a);
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB,
|
||||
int slot,
|
||||
nfapi_nr_srs_pdu_t *srs_pdu,
|
||||
nr_srs_info_t *nr_srs_info,
|
||||
int32_t **srs_received_signal);
|
||||
int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)]);
|
||||
|
||||
void init_prach_list(PHY_VARS_gNB *gNB);
|
||||
void init_prach_ru_list(RU_t *ru);
|
||||
|
||||
@@ -98,7 +98,7 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB,
|
||||
int slot,
|
||||
nfapi_nr_srs_pdu_t *srs_pdu,
|
||||
nr_srs_info_t *nr_srs_info,
|
||||
int32_t **srs_received_signal) {
|
||||
int32_t srs_received_signal[][gNB->frame_parms.ofdm_symbol_size*(1<<srs_pdu->num_symbols)]) {
|
||||
|
||||
if(nr_srs_info->sc_list_length == 0) {
|
||||
LOG_E(NR_PHY, "(%d.%d) nr_srs_info was not generated yet!\n", frame, slot);
|
||||
@@ -113,6 +113,7 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB,
|
||||
uint64_t symbol_offset = (n_symbols+l0)*frame_parms->ofdm_symbol_size;
|
||||
|
||||
int32_t *rx_signal;
|
||||
bool no_srs_signal = true;
|
||||
for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) {
|
||||
|
||||
memset(srs_received_signal[ant], 0, frame_parms->ofdm_symbol_size*sizeof(int32_t));
|
||||
@@ -121,6 +122,10 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB,
|
||||
for(int sc_idx = 0; sc_idx < nr_srs_info->sc_list_length; sc_idx++) {
|
||||
srs_received_signal[ant][nr_srs_info->sc_list[sc_idx]] = rx_signal[nr_srs_info->sc_list[sc_idx]];
|
||||
|
||||
if (rx_signal[nr_srs_info->sc_list[sc_idx]] != 0) {
|
||||
no_srs_signal = false;
|
||||
}
|
||||
|
||||
#ifdef SRS_DEBUG
|
||||
uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12;
|
||||
int subcarrier_log = nr_srs_info->sc_list[sc_idx]-subcarrier_offset;
|
||||
@@ -140,5 +145,11 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB,
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
if (no_srs_signal) {
|
||||
LOG_W(NR_PHY, "No SRS signal\n");
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1657,7 +1657,6 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
||||
RX_type_t rx_type)
|
||||
{
|
||||
//#define DEBUG_DL_PTRS 1
|
||||
int16_t *phase_per_symbol = NULL;
|
||||
int32_t *ptrs_re_symbol = NULL;
|
||||
int8_t ret = 0;
|
||||
/* harq specific variables */
|
||||
@@ -1701,20 +1700,20 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
/* loop over antennas */
|
||||
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
phase_per_symbol = (int16_t*)pdsch_vars[gNB_id]->ptrs_phase_per_slot[aarx];
|
||||
c16_t *phase_per_symbol = (c16_t*)pdsch_vars[gNB_id]->ptrs_phase_per_slot[aarx];
|
||||
ptrs_re_symbol = (int32_t*)pdsch_vars[gNB_id]->ptrs_re_per_slot[aarx];
|
||||
ptrs_re_symbol[symbol] = 0;
|
||||
phase_per_symbol[(2*symbol)+1] = 0; // Imag
|
||||
phase_per_symbol[symbol].i = 0; // Imag
|
||||
/* set DMRS estimates to 0 angle with magnitude 1 */
|
||||
if(is_dmrs_symbol(symbol,*dmrsSymbPos)) {
|
||||
/* set DMRS real estimation to 32767 */
|
||||
phase_per_symbol[2*symbol]=(int16_t)((1<<15)-1); // 32767
|
||||
phase_per_symbol[symbol].r=INT16_MAX; // 32767
|
||||
#ifdef DEBUG_DL_PTRS
|
||||
printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[2*symbol],phase_per_symbol[(2*symbol)+1]);
|
||||
printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[symbol].r,phase_per_symbol[symbol].i);
|
||||
#endif
|
||||
}
|
||||
else { // real ptrs value is set to 0
|
||||
phase_per_symbol[2*symbol] = 0; // Real
|
||||
phase_per_symbol[symbol].r = 0; // Real
|
||||
}
|
||||
|
||||
if(dlsch0_harq->status == ACTIVE) {
|
||||
@@ -1740,7 +1739,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
||||
symbol,frame_parms->ofdm_symbol_size,
|
||||
(int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(symbol * nb_re_pdsch)],
|
||||
ue->nr_gold_pdsch[gNB_id][nr_slot_rx][symbol][0],
|
||||
&phase_per_symbol[2* symbol],
|
||||
(int16_t*)&phase_per_symbol[symbol],
|
||||
&ptrs_re_symbol[symbol]);
|
||||
}
|
||||
}// HARQ 0
|
||||
@@ -1752,7 +1751,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
||||
/*------------------------------------------------------------------------------------------------------- */
|
||||
/* If L-PTRS is > 0 then we need interpolation */
|
||||
if(*L_ptrs > 0) {
|
||||
ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, phase_per_symbol, *startSymbIndex, *nbSymb);
|
||||
ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, (int16_t*)phase_per_symbol, *startSymbIndex, *nbSymb);
|
||||
if(ret != 0) {
|
||||
LOG_W(PHY,"[PTRS] Compensation is skipped due to error in PTRS slot processing !!\n");
|
||||
}
|
||||
@@ -1771,11 +1770,11 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
||||
/* Skip rotation if the slot processing is wrong */
|
||||
if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) {
|
||||
#ifdef DEBUG_DL_PTRS
|
||||
printf("[PHY][DL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[2* i],phase_per_symbol[(2* i) +1]);
|
||||
printf("[PHY][DL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[i].r,phase_per_symbol[i].i);
|
||||
#endif
|
||||
rotate_cpx_vector((int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
|
||||
&phase_per_symbol[2* i],
|
||||
(int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
|
||||
rotate_cpx_vector((c16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
|
||||
&phase_per_symbol[i],
|
||||
(c16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
|
||||
((*nb_rb) * NR_NB_SC_PER_RB), 15);
|
||||
}// if not DMRS Symbol
|
||||
}// symbol loop
|
||||
|
||||
@@ -342,7 +342,7 @@ typedef struct {
|
||||
/// Position of first CCE of the dci
|
||||
int firstCCE;
|
||||
/// flag to indicate that this is a RA response
|
||||
boolean_t ra_flag;
|
||||
bool ra_flag;
|
||||
/// rnti
|
||||
rnti_t rnti;
|
||||
/// rnti type
|
||||
|
||||
@@ -597,17 +597,15 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
|
||||
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
|
||||
for(ap = 0; ap < n_antenna_ports; ap++) {
|
||||
for (int s=0;s<NR_NUMBER_OF_SYMBOLS_PER_SLOT;s++){
|
||||
c16_t rot=((c16_t*)frame_parms->symbol_rotation[1])[s + symb_offset];
|
||||
LOG_D(PHY,"rotating txdataF symbol %d (%d) => (%d.%d)\n",
|
||||
s,
|
||||
s + symb_offset,
|
||||
rot.r, rot.i);
|
||||
|
||||
LOG_D(PHY,"In %s: rotating txdataF symbol %d (%d) => (%d.%d)\n",
|
||||
__FUNCTION__,
|
||||
s,
|
||||
s + symb_offset,
|
||||
frame_parms->symbol_rotation[1][2 * (s + symb_offset)],
|
||||
frame_parms->symbol_rotation[1][1 + (2 * (s + symb_offset))]);
|
||||
|
||||
rotate_cpx_vector((int16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
|
||||
&frame_parms->symbol_rotation[1][2 * (s + symb_offset)],
|
||||
(int16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
|
||||
rotate_cpx_vector((c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
|
||||
&rot,
|
||||
(c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
15);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ typedef struct OAIgraph {
|
||||
int h;
|
||||
int waterFallh;
|
||||
double *waterFallAvg;
|
||||
boolean_t initDone;
|
||||
bool initDone;
|
||||
int iteration;
|
||||
void (*funct) (struct OAIgraph *graph, calibData_t *);
|
||||
} OAIgraph_t;
|
||||
@@ -159,7 +159,7 @@ static void oai_xygraph_getbuff(OAIgraph_t *graph, float **x, float **y, int len
|
||||
*y=old_y;
|
||||
}
|
||||
|
||||
static void oai_xygraph(OAIgraph_t *graph, float *x, float *y, int len, int layer, boolean_t NoAutoScale) {
|
||||
static void oai_xygraph(OAIgraph_t *graph, float *x, float *y, int len, int layer, bool NoAutoScale) {
|
||||
fl_redraw_object(graph->graph);
|
||||
|
||||
if ( NoAutoScale && graph->iteration%NoAutoScale == 0) {
|
||||
|
||||
+25
-222
@@ -144,207 +144,10 @@ void multadd_real_four_symbols_vector_complex_scalar(int16_t *x,
|
||||
_m_empty();
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
int rotate_cpx_vector(int16_t *x,
|
||||
int16_t *alpha,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
uint16_t output_shift,
|
||||
uint8_t format)
|
||||
{
|
||||
// Multiply elementwise two complex vectors of N elements
|
||||
// x - input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dynamic of 15 bit maximum
|
||||
//
|
||||
// alpha - input 2 in the format |Re0 Im0|
|
||||
// We assume x2 with a dynamic of 15 bit maximum
|
||||
//
|
||||
// y - output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
//
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// output_shift - shift at output to return in Q1.15
|
||||
// format - 0 means alpha is in shuffled format, 1 means x is in shuffled format
|
||||
|
||||
uint32_t i; // loop counter
|
||||
|
||||
register __m128i m0,m1;
|
||||
|
||||
|
||||
|
||||
__m128i *x_128;
|
||||
__m128i *y_128;
|
||||
|
||||
|
||||
shift = _mm_cvtsi32_si128(output_shift);
|
||||
x_128 = (__m128i *)&x[0];
|
||||
|
||||
if (format==0) { // alpha is in shuffled format for complex multiply
|
||||
((int16_t *)&alpha_128)[0] = alpha[0];
|
||||
((int16_t *)&alpha_128)[1] = -alpha[1];
|
||||
((int16_t *)&alpha_128)[2] = alpha[1];
|
||||
((int16_t *)&alpha_128)[3] = alpha[0];
|
||||
((int16_t *)&alpha_128)[4] = alpha[0];
|
||||
((int16_t *)&alpha_128)[5] = -alpha[1];
|
||||
((int16_t *)&alpha_128)[6] = alpha[1];
|
||||
((int16_t *)&alpha_128)[7] = alpha[0];
|
||||
} else { // input is in shuffled format for complex multiply
|
||||
((int16_t *)&alpha_128)[0] = alpha[0];
|
||||
((int16_t *)&alpha_128)[1] = alpha[1];
|
||||
((int16_t *)&alpha_128)[2] = alpha[0];
|
||||
((int16_t *)&alpha_128)[3] = alpha[1];
|
||||
((int16_t *)&alpha_128)[4] = alpha[0];
|
||||
((int16_t *)&alpha_128)[5] = alpha[1];
|
||||
((int16_t *)&alpha_128)[6] = alpha[0];
|
||||
((int16_t *)&alpha_128)[7] = alpha[1];
|
||||
}
|
||||
|
||||
y_128 = (__m128i *)&y[0];
|
||||
|
||||
// _mm_empty();
|
||||
// return(0);
|
||||
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
|
||||
m0 = _mm_madd_epi16(x_128[0],alpha_128); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
m1=m0;
|
||||
m0 = _mm_packs_epi32(m1,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
y_128[0] = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
m0 = _mm_madd_epi16(x_128[1],alpha_128); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
m1 = m0;
|
||||
m1 = _mm_packs_epi32(m1,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
y_128[1] = _mm_unpacklo_epi32(m1,m1); // 1- pack in a 128 bit register [re im re im]
|
||||
m0 = _mm_madd_epi16(x_128[2],alpha_128); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
m1 = m0;
|
||||
m1 = _mm_packs_epi32(m1,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
y_128[2] = _mm_unpacklo_epi32(m1,m1); // 1- pack in a 128 bit register [re im re im]
|
||||
m0 = _mm_madd_epi16(x_128[3],alpha_128); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
m1 = m0;
|
||||
m1 = _mm_packs_epi32(m1,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
y_128[3] = _mm_unpacklo_epi32(m1,m1); // 1- pack in a 128 bit register [re im re im]
|
||||
if (format==1) { // Put output in proper format (Re,-Im,Im,Re), shuffle = (0,1,3,2) = 0x1e
|
||||
|
||||
y_128[0] = _mm_shufflelo_epi16(y_128[0],0x1e);
|
||||
y_128[0] = _mm_shufflehi_epi16(y_128[0],0x1e);
|
||||
((int16_t*)&y_128[0])[1] = -((int16_t*)&y_128[0])[1];
|
||||
((int16_t*)&y_128[0])[5] = -((int16_t*)&y_128[0])[5];
|
||||
y_128[1] = _mm_shufflelo_epi16(y_128[1],0x1e);
|
||||
y_128[1] = _mm_shufflehi_epi16(y_128[1],0x1e);
|
||||
((int16_t*)&y_128[1])[1] = -((int16_t*)&y_128[1])[1];
|
||||
((int16_t*)&y_128[1])[5] = -((int16_t*)&y_128[1])[5];
|
||||
y_128[2] = _mm_shufflelo_epi16(y_128[2],0x1e);
|
||||
y_128[2] = _mm_shufflehi_epi16(y_128[2],0x1e);
|
||||
((int16_t*)&y_128[2])[1] = -((int16_t*)&y_128[2])[1];
|
||||
((int16_t*)&y_128[2])[5] = -((int16_t*)&y_128[2])[5];
|
||||
y_128[3] = _mm_shufflelo_epi16(y_128[3],0x1e);
|
||||
y_128[3] = _mm_shufflehi_epi16(y_128[3],0x1e);
|
||||
((int16_t*)&y_128[3])[1] = -((int16_t*)&y_128[3])[1];
|
||||
((int16_t*)&y_128[3])[5] = -((int16_t*)&y_128[3])[5];
|
||||
}
|
||||
|
||||
|
||||
x_128+=4;
|
||||
y_128 +=4;
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int rotate_cpx_vector2(int16_t *x,
|
||||
int16_t *alpha,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
uint16_t output_shift,
|
||||
uint8_t format)
|
||||
{
|
||||
// Multiply elementwise two complex vectors of N elements
|
||||
// x - input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dynamic of 15 bit maximum
|
||||
//
|
||||
// alpha - input 2 in the format |Re0 Im0|
|
||||
// We assume x2 with a dynamic of 15 bit maximum
|
||||
//
|
||||
// y - output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
//
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// log2_amp - increase the output amplitude by a factor 2^log2_amp (default is 0)
|
||||
// WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
uint32_t i; // loop counter
|
||||
|
||||
register __m128i m0,m1;
|
||||
|
||||
|
||||
__m128i *x_128;
|
||||
__m128i *y_128;
|
||||
|
||||
|
||||
shift = _mm_cvtsi32_si128(output_shift);
|
||||
x_128 = (__m128i *)&x[0];
|
||||
|
||||
if (format==0) { // alpha is in shuffled format for complex multiply
|
||||
((int16_t *)&alpha_128)[0] = alpha[0];
|
||||
((int16_t *)&alpha_128)[1] = -alpha[1];
|
||||
((int16_t *)&alpha_128)[2] = alpha[1];
|
||||
((int16_t *)&alpha_128)[3] = alpha[0];
|
||||
((int16_t *)&alpha_128)[4] = alpha[0];
|
||||
((int16_t *)&alpha_128)[5] = -alpha[1];
|
||||
((int16_t *)&alpha_128)[6] = alpha[1];
|
||||
((int16_t *)&alpha_128)[7] = alpha[0];
|
||||
} else { // input is in shuffled format for complex multiply
|
||||
((int16_t *)&alpha_128)[0] = alpha[0];
|
||||
((int16_t *)&alpha_128)[1] = alpha[1];
|
||||
((int16_t *)&alpha_128)[2] = alpha[0];
|
||||
((int16_t *)&alpha_128)[3] = alpha[1];
|
||||
((int16_t *)&alpha_128)[4] = alpha[0];
|
||||
((int16_t *)&alpha_128)[5] = alpha[1];
|
||||
((int16_t *)&alpha_128)[6] = alpha[0];
|
||||
((int16_t *)&alpha_128)[7] = alpha[1];
|
||||
}
|
||||
|
||||
y_128 = (__m128i *)&y[0];
|
||||
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>1); i++) {
|
||||
|
||||
|
||||
m0 = _mm_madd_epi16(x_128[i],alpha_128); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
m1=m0;
|
||||
m1 = _mm_packs_epi32(m1,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
y_128[i] = _mm_unpacklo_epi32(m1,m1); // 1- pack in a 128 bit register [re im re im]
|
||||
if (format==1) { // Put output in proper format (Re,-Im,Im,Re), shuffle = (0,1,3,2) = 0x1e
|
||||
|
||||
y_128[i] = _mm_shufflelo_epi16(y_128[i],0x1e);
|
||||
y_128[i] = _mm_shufflehi_epi16(y_128[i],0x1e);
|
||||
((int16_t*)&y_128[i])[1] = -((int16_t*)&y_128[i])[1];
|
||||
((int16_t*)&y_128[i])[5] = -((int16_t*)&y_128[i])[5];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
|
||||
return(0);
|
||||
}
|
||||
*/
|
||||
|
||||
int rotate_cpx_vector(int16_t *x,
|
||||
int16_t *alpha,
|
||||
int16_t *y,
|
||||
#ifdef __AVX2__
|
||||
void rotate_cpx_vector(c16_t *x,
|
||||
c16_t *alpha,
|
||||
c16_t *y,
|
||||
uint32_t N,
|
||||
uint16_t output_shift)
|
||||
{
|
||||
@@ -372,28 +175,28 @@ int rotate_cpx_vector(int16_t *x,
|
||||
__m128i shift = _mm_cvtsi32_si128(output_shift);
|
||||
register simd_q15_t m0,m1,m2,m3;
|
||||
|
||||
((int16_t *)&alpha_128)[0] = alpha[0];
|
||||
((int16_t *)&alpha_128)[1] = -alpha[1];
|
||||
((int16_t *)&alpha_128)[2] = alpha[1];
|
||||
((int16_t *)&alpha_128)[3] = alpha[0];
|
||||
((int16_t *)&alpha_128)[4] = alpha[0];
|
||||
((int16_t *)&alpha_128)[5] = -alpha[1];
|
||||
((int16_t *)&alpha_128)[6] = alpha[1];
|
||||
((int16_t *)&alpha_128)[7] = alpha[0];
|
||||
((int16_t *)&alpha_128)[0] = alpha->r;
|
||||
((int16_t *)&alpha_128)[1] = -alpha->i;
|
||||
((int16_t *)&alpha_128)[2] = alpha->i;
|
||||
((int16_t *)&alpha_128)[3] = alpha->r;
|
||||
((int16_t *)&alpha_128)[4] = alpha->r;
|
||||
((int16_t *)&alpha_128)[5] = -alpha->i;
|
||||
((int16_t *)&alpha_128)[6] = alpha->i;
|
||||
((int16_t *)&alpha_128)[7] = alpha->r;
|
||||
#elif defined(__arm__)
|
||||
int32x4_t shift;
|
||||
int32x4_t ab_re0,ab_re1,ab_im0,ab_im1,re32,im32;
|
||||
int16_t reflip[8] __attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
int32x4x2_t xtmp;
|
||||
|
||||
((int16_t *)&alpha_128)[0] = alpha[0];
|
||||
((int16_t *)&alpha_128)[1] = alpha[1];
|
||||
((int16_t *)&alpha_128)[2] = alpha[0];
|
||||
((int16_t *)&alpha_128)[3] = alpha[1];
|
||||
((int16_t *)&alpha_128)[4] = alpha[0];
|
||||
((int16_t *)&alpha_128)[5] = alpha[1];
|
||||
((int16_t *)&alpha_128)[6] = alpha[0];
|
||||
((int16_t *)&alpha_128)[7] = alpha[1];
|
||||
((int16_t *)&alpha_128)[0] = alpha->r;
|
||||
((int16_t *)&alpha_128)[1] = alpha->i;
|
||||
((int16_t *)&alpha_128)[2] = alpha->r;
|
||||
((int16_t *)&alpha_128)[3] = alpha->i;
|
||||
((int16_t *)&alpha_128)[4] = alpha->r;
|
||||
((int16_t *)&alpha_128)[5] = alpha->i;
|
||||
((int16_t *)&alpha_128)[6] = alpha->r;
|
||||
((int16_t *)&alpha_128)[7] = alpha->i;
|
||||
int16x8_t bflip = vrev32q_s16(alpha_128);
|
||||
int16x8_t bconj = vmulq_s16(alpha_128,*(int16x8_t *)reflip);
|
||||
shift = vdupq_n_s32(-output_shift);
|
||||
@@ -439,9 +242,9 @@ int rotate_cpx_vector(int16_t *x,
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(0);
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
int mult_vector32_scalar(int16_t *x1,
|
||||
int x2,
|
||||
@@ -536,7 +339,7 @@ main ()
|
||||
int16_t input[256] __attribute__((aligned(16)));
|
||||
int16_t input2[256] __attribute__((aligned(16)));
|
||||
int16_t output[256] __attribute__((aligned(16)));
|
||||
int16_t alpha[2];
|
||||
c16_t alpha;
|
||||
|
||||
int i;
|
||||
|
||||
@@ -574,8 +377,8 @@ main ()
|
||||
input2[14] = 1000;
|
||||
input2[15] = 2000;
|
||||
|
||||
alpha[0]=32767;
|
||||
alpha[1]=0;
|
||||
alpha->r=32767;
|
||||
alpha->i=0;
|
||||
|
||||
//mult_cpx_vector(input,input2,output,L,0);
|
||||
rotate_cpx_vector_norep(input,alpha,input,L,15);
|
||||
|
||||
@@ -60,7 +60,7 @@ typedef struct OAIgraph {
|
||||
int h;
|
||||
int waterFallh;
|
||||
double *waterFallAvg;
|
||||
boolean_t initDone;
|
||||
bool initDone;
|
||||
int iteration;
|
||||
void (*gNBfunct) (struct OAIgraph *graph, scopeData_t *p, int UE_id);
|
||||
void (*nrUEfunct)(scopeGraphData_t **data, struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id);
|
||||
@@ -208,7 +208,7 @@ static void oai_xygraph_getbuff(OAIgraph_t *graph, float **x, float **y, int len
|
||||
*y=old_y;
|
||||
}
|
||||
|
||||
static void oai_xygraph(OAIgraph_t *graph, float *x, float *y, int len, int layer, boolean_t NoAutoScale) {
|
||||
static void oai_xygraph(OAIgraph_t *graph, float *x, float *y, int len, int layer, bool NoAutoScale) {
|
||||
fl_redraw_object(graph->graph);
|
||||
|
||||
if ( NoAutoScale && graph->iteration%NoAutoScale == 0) {
|
||||
|
||||
@@ -37,6 +37,7 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "common/utils/assertions.h"
|
||||
|
||||
#define CEILIDIV(a,b) ((a+b-1)/b)
|
||||
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
|
||||
@@ -104,15 +105,6 @@ void multadd_complex_vector_real_scalar(int16_t *x,
|
||||
uint8_t zero_flag,
|
||||
uint32_t N);
|
||||
|
||||
int rotate_cpx_vector(int16_t *x,
|
||||
int16_t *alpha,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
uint16_t output_shift);
|
||||
|
||||
|
||||
|
||||
|
||||
/*!\fn void init_fft(uint16_t size,uint8_t logsize,uint16_t *rev)
|
||||
\brief Initialize the FFT engine for a given size
|
||||
@param size Size of the FFT
|
||||
@@ -461,7 +453,7 @@ idft_size_idx_t get_idft(int ofdm_symbol_size)
|
||||
}
|
||||
|
||||
|
||||
/*!\fn int32_t rotate_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N,uint16_t output_shift)
|
||||
/*!\fn int32_t rotate_cpx_vector(c16_t *x,c16_t *alpha,c16_t *y,uint32_t N,uint16_t output_shift)
|
||||
This function performs componentwise multiplication of a vector with a complex scalar.
|
||||
@param x Vector input (Q1.15) in the format |Re0 Im0|,......,|Re(N-1) Im(N-1)|
|
||||
@param alpha Scalar input (Q1.15) in the format |Re0 Im0|
|
||||
@@ -471,11 +463,11 @@ This function performs componentwise multiplication of a vector with a complex s
|
||||
|
||||
The function implemented is : \f$\mathbf{y} = \alpha\mathbf{x}\f$
|
||||
*/
|
||||
int32_t rotate_cpx_vector(int16_t *x,
|
||||
int16_t *alpha,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
uint16_t output_shift);
|
||||
void rotate_cpx_vector(c16_t *x,
|
||||
c16_t *alpha,
|
||||
c16_t *y,
|
||||
uint32_t N,
|
||||
uint16_t output_shift);
|
||||
|
||||
|
||||
//cadd_sv.c
|
||||
|
||||
@@ -754,7 +754,7 @@ typedef struct {
|
||||
/// Position of first CCE of the dci
|
||||
int firstCCE;
|
||||
/// flag to indicate that this is a RA response
|
||||
boolean_t ra_flag;
|
||||
bool ra_flag;
|
||||
/// rnti
|
||||
rnti_t rnti;
|
||||
/// harq_pid
|
||||
@@ -775,7 +775,7 @@ typedef struct {
|
||||
/// Position of first CCE of the dci
|
||||
int firstCCE;
|
||||
/// flag to indicate that this is a RA response
|
||||
boolean_t ra_flag;
|
||||
bool ra_flag;
|
||||
/// rnti
|
||||
rnti_t rnti;
|
||||
/// Format
|
||||
@@ -806,7 +806,7 @@ typedef struct {
|
||||
/// Position of first CCE of the dci
|
||||
int firstCCE;
|
||||
/// flag to indicate that this is a RA response
|
||||
boolean_t ra_flag;
|
||||
bool ra_flag;
|
||||
/// rnti
|
||||
rnti_t rnti;
|
||||
/// Format
|
||||
|
||||
@@ -241,15 +241,9 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
uint16_t sc_list_length;
|
||||
uint16_t *sc_list;
|
||||
uint16_t sc_list[6*273];
|
||||
uint8_t srs_generated_signal_bits;
|
||||
int32_t *srs_generated_signal;
|
||||
int32_t **srs_received_signal;
|
||||
int32_t **srs_ls_estimated_channel;
|
||||
int32_t **srs_estimated_channel_freq;
|
||||
int32_t **srs_estimated_channel_time;
|
||||
int32_t **srs_estimated_channel_time_shifted;
|
||||
uint32_t *noise_power;
|
||||
int32_t srs_generated_signal[OFDM_SYMBOL_SIZE_SAMPLES_MAX * MAX_NUM_NR_SRS_SYMBOLS];
|
||||
} nr_srs_info_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -359,10 +353,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
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "intertask_interface.h"
|
||||
|
||||
//#define DEBUG_RXDATA
|
||||
//#define SRS_IND_DEBUG
|
||||
|
||||
uint8_t SSB_Table[38]={0,2,4,6,8,10,12,14,254,254,16,18,20,22,24,26,28,30,254,254,32,34,36,38,40,42,44,46,254,254,48,50,52,54,56,58,60,62};
|
||||
|
||||
@@ -72,8 +73,11 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
|
||||
ssb_start_symbol = ssb_start_symbol_abs % fp->symbols_per_slot; // start symbol wrt slot
|
||||
|
||||
// setting the first subcarrier
|
||||
fp->ssb_start_subcarrier = (12 * cfg->ssb_table.ssb_offset_point_a.value + ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset);
|
||||
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->ssb_table.ssb_offset_point_a.value,ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset);
|
||||
const int scs = cfg->ssb_config.scs_common.value;
|
||||
const int prb_offset = (fp->freq_range == nr_FR1) ? ssb_pdu.ssb_pdu_rel15.ssbOffsetPointA>>scs : ssb_pdu.ssb_pdu_rel15.ssbOffsetPointA>>(scs-2);
|
||||
const int sc_offset = (fp->freq_range == nr_FR1) ? ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset>>scs : ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset;
|
||||
fp->ssb_start_subcarrier = (12 * prb_offset + sc_offset);
|
||||
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier, prb_offset, sc_offset);
|
||||
|
||||
LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol);
|
||||
nr_generate_pss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
|
||||
@@ -621,10 +625,38 @@ void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
|
||||
}
|
||||
|
||||
int fill_srs_reported_symbol_list(nfapi_nr_srs_indication_reported_symbol_t *reported_symbol_list,
|
||||
const nfapi_nr_srs_pdu_t *srs_pdu,
|
||||
const int N_RB_UL,
|
||||
const int8_t *snr_per_rb,
|
||||
const int srs_est) {
|
||||
|
||||
reported_symbol_list->num_rbs = srs_bandwidth_config[srs_pdu->config_index][srs_pdu->bandwidth_index][0];
|
||||
|
||||
if (!reported_symbol_list->rb_list) {
|
||||
reported_symbol_list->rb_list = (nfapi_nr_srs_indication_reported_symbol_resource_block_t*) calloc(1, N_RB_UL*sizeof(nfapi_nr_srs_indication_reported_symbol_resource_block_t));
|
||||
}
|
||||
|
||||
for(int rb = 0; rb < reported_symbol_list->num_rbs; rb++) {
|
||||
if (srs_est<0) {
|
||||
reported_symbol_list->rb_list[rb].rb_snr = 0xFF;
|
||||
} else if (snr_per_rb[rb] < -64) {
|
||||
reported_symbol_list->rb_list[rb].rb_snr = 0;
|
||||
} else if (snr_per_rb[rb] > 63) {
|
||||
reported_symbol_list->rb_list[rb].rb_snr = 0xFE;
|
||||
} else {
|
||||
reported_symbol_list->rb_list[rb].rb_snr = (snr_per_rb[rb] + 64)<<1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
/* those variables to log T_GNB_PHY_PUCCH_PUSCH_IQ only when we try to decode */
|
||||
int pucch_decode_done = 0;
|
||||
int pusch_decode_done = 0;
|
||||
int pusch_DTX = 0;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,1);
|
||||
LOG_D(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d\n",frame_rx,slot_rx);
|
||||
@@ -764,7 +796,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
if (no_sig) {
|
||||
LOG_D(PHY, "PUSCH not detected in frame %d, slot %d\n", frame_rx, slot_rx);
|
||||
nr_fill_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid, 1,1);
|
||||
return 1;
|
||||
pusch_DTX++;
|
||||
continue;
|
||||
}
|
||||
gNB->pusch_vars[ULSCH_id]->ulsch_power_tot=0;
|
||||
gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot=0;
|
||||
@@ -788,7 +821,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
/* in case of phy_test mode, we still want to decode to measure execution time.
|
||||
Therefore, we don't yet call nr_fill_indication, it will be called later */
|
||||
nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 1,1);
|
||||
return 1;
|
||||
pusch_DTX++;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
LOG_D(PHY, "PUSCH detected in %d.%d (%d,%d,%d)\n",frame_rx,slot_rx,
|
||||
@@ -819,29 +853,88 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
|
||||
LOG_D(NR_PHY, "(%d.%d) gNB is waiting for SRS, id = %i\n", frame_rx, slot_rx, i);
|
||||
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu;
|
||||
uint8_t N_symb_SRS = 1<<srs_pdu->num_symbols;
|
||||
int32_t srs_received_signal[frame_parms->nb_antennas_rx][frame_parms->ofdm_symbol_size*N_symb_SRS];
|
||||
int32_t srs_ls_estimated_channel[frame_parms->nb_antennas_rx][frame_parms->ofdm_symbol_size*N_symb_SRS];
|
||||
int32_t srs_estimated_channel_freq[frame_parms->nb_antennas_rx][frame_parms->ofdm_symbol_size*N_symb_SRS];
|
||||
int32_t srs_estimated_channel_time[frame_parms->nb_antennas_rx][frame_parms->ofdm_symbol_size];
|
||||
int32_t srs_estimated_channel_time_shifted[frame_parms->nb_antennas_rx][frame_parms->ofdm_symbol_size];
|
||||
uint32_t noise_power_per_rb[srs_pdu->bwp_size];
|
||||
int8_t snr_per_rb[srs_pdu->bwp_size];
|
||||
uint32_t signal_power;
|
||||
uint32_t noise_power;
|
||||
int8_t snr;
|
||||
|
||||
// At least currently, the configuration is constant, so it is enough to generate the sequence just once.
|
||||
if(gNB->nr_srs_info[i]->sc_list_length == 0) {
|
||||
generate_srs_nr(srs_pdu, &gNB->frame_parms, gNB->nr_srs_info[i]->srs_generated_signal, gNB->nr_srs_info[i], AMP, frame_rx, slot_rx);
|
||||
generate_srs_nr(srs_pdu, frame_parms, gNB->nr_srs_info[i]->srs_generated_signal, gNB->nr_srs_info[i], AMP, frame_rx, slot_rx);
|
||||
}
|
||||
|
||||
nr_get_srs_signal(gNB,frame_rx,slot_rx,srs_pdu, gNB->nr_srs_info[i], gNB->nr_srs_info[i]->srs_received_signal);
|
||||
const int srs_est = nr_get_srs_signal(gNB,frame_rx,slot_rx, srs_pdu, gNB->nr_srs_info[i], srs_received_signal);
|
||||
|
||||
nr_srs_channel_estimation(gNB,frame_rx,slot_rx,srs_pdu,
|
||||
gNB->nr_srs_info[i],
|
||||
gNB->nr_srs_info[i]->srs_generated_signal,
|
||||
gNB->nr_srs_info[i]->srs_received_signal,
|
||||
gNB->nr_srs_info[i]->srs_estimated_channel_freq,
|
||||
gNB->nr_srs_info[i]->srs_estimated_channel_time,
|
||||
gNB->nr_srs_info[i]->srs_estimated_channel_time_shifted,
|
||||
gNB->nr_srs_info[i]->noise_power);
|
||||
if (srs_est >= 0) {
|
||||
nr_srs_channel_estimation(gNB,
|
||||
frame_rx,
|
||||
slot_rx,
|
||||
srs_pdu,
|
||||
gNB->nr_srs_info[i],
|
||||
gNB->nr_srs_info[i]->srs_generated_signal,
|
||||
srs_received_signal,
|
||||
srs_ls_estimated_channel,
|
||||
srs_estimated_channel_freq,
|
||||
srs_estimated_channel_time,
|
||||
srs_estimated_channel_time_shifted,
|
||||
&signal_power,
|
||||
noise_power_per_rb,
|
||||
&noise_power,
|
||||
snr_per_rb,
|
||||
&snr);
|
||||
}
|
||||
|
||||
T(T_GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(0), T_INT(0),
|
||||
T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_freq[0], gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t)));
|
||||
T_BUFFER(srs_estimated_channel_freq[0], frame_parms->ofdm_symbol_size*sizeof(int32_t)));
|
||||
|
||||
T(T_GNB_PHY_UL_TIME_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(0), T_INT(0),
|
||||
T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_time_shifted[0], gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t)));
|
||||
T_BUFFER(srs_estimated_channel_time_shifted[0], frame_parms->ofdm_symbol_size*sizeof(int32_t)));
|
||||
|
||||
const uint16_t num_srs = gNB->UL_INFO.srs_ind.number_of_pdus;
|
||||
gNB->UL_INFO.srs_ind.pdu_list = &gNB->srs_pdu_list[0];
|
||||
gNB->UL_INFO.srs_ind.sfn = frame_rx;
|
||||
gNB->UL_INFO.srs_ind.slot = slot_rx;
|
||||
gNB->srs_pdu_list[num_srs].handle = srs_pdu->handle;
|
||||
gNB->srs_pdu_list[num_srs].rnti = srs_pdu->rnti;
|
||||
gNB->srs_pdu_list[num_srs].timing_advance = srs_est >= 0 ? nr_est_timing_advance_srs(frame_parms,
|
||||
srs_estimated_channel_time) : 0xFFFF;
|
||||
gNB->srs_pdu_list[num_srs].num_symbols = 1<<srs_pdu->num_symbols;
|
||||
gNB->srs_pdu_list[num_srs].wide_band_snr = srs_est >= 0 ? (snr + 64)<<1 : 0xFF; // 0xFF will be set if this field is invalid
|
||||
gNB->srs_pdu_list[num_srs].num_reported_symbols = 1<<srs_pdu->num_symbols;
|
||||
if(!gNB->srs_pdu_list[num_srs].reported_symbol_list) {
|
||||
gNB->srs_pdu_list[num_srs].reported_symbol_list = (nfapi_nr_srs_indication_reported_symbol_t*) calloc(1, gNB->srs_pdu_list[num_srs].num_reported_symbols*sizeof(nfapi_nr_srs_indication_reported_symbol_t));
|
||||
}
|
||||
fill_srs_reported_symbol_list(&gNB->srs_pdu_list[num_srs].reported_symbol_list[0],
|
||||
srs_pdu,
|
||||
frame_parms->N_RB_UL,
|
||||
snr_per_rb,
|
||||
srs_est);
|
||||
|
||||
gNB->UL_INFO.srs_ind.number_of_pdus += 1;
|
||||
|
||||
#ifdef SRS_IND_DEBUG
|
||||
LOG_I(NR_PHY, "gNB->UL_INFO.srs_ind.sfn = %i\n", gNB->UL_INFO.srs_ind.sfn);
|
||||
LOG_I(NR_PHY, "gNB->UL_INFO.srs_ind.slot = %i\n", gNB->UL_INFO.srs_ind.slot);
|
||||
LOG_I(NR_PHY, "gNB->srs_pdu_list[%i].rnti = 0x%04x\n", num_srs, gNB->srs_pdu_list[num_srs].rnti);
|
||||
LOG_I(NR_PHY, "gNB->srs_pdu_list[%i].timing_advance = %i\n", num_srs, gNB->srs_pdu_list[num_srs].timing_advance);
|
||||
LOG_I(NR_PHY, "gNB->srs_pdu_list[%i].num_symbols = %i\n", num_srs, gNB->srs_pdu_list[num_srs].num_symbols);
|
||||
LOG_I(NR_PHY, "gNB->srs_pdu_list[%i].wide_band_snr = %i\n", num_srs, gNB->srs_pdu_list[num_srs].wide_band_snr);
|
||||
LOG_I(NR_PHY, "gNB->srs_pdu_list[%i].num_reported_symbols = %i\n", num_srs, gNB->srs_pdu_list[num_srs].num_reported_symbols);
|
||||
LOG_I(NR_PHY, "gNB->srs_pdu_list[%i].reported_symbol_list[0].num_rbs = %i\n", num_srs, gNB->srs_pdu_list[num_srs].reported_symbol_list[0].num_rbs);
|
||||
for(int rb = 0; rb < gNB->srs_pdu_list[num_srs].reported_symbol_list[0].num_rbs; rb++) {
|
||||
LOG_I(NR_PHY, "gNB->srs_pdu_list[%i].reported_symbol_list[0].rb_list[%3i].rb_snr = %i\n",
|
||||
num_srs, rb, gNB->srs_pdu_list[num_srs].reported_symbol_list[0].rb_list[rb].rb_snr);
|
||||
}
|
||||
#endif
|
||||
|
||||
srs->active = 0;
|
||||
}
|
||||
@@ -855,5 +948,5 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,0);
|
||||
return 0;
|
||||
return pusch_DTX;
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,
|
||||
is_pucch2_subframe = (is_ri_TXOp(ue,proc,eNB_id) && (ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex>0)) || is_pucch2_subframe;
|
||||
|
||||
// check ACK/SR transmission
|
||||
if(frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission == FALSE) {
|
||||
if(frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission == false) {
|
||||
if(is_SR_TXOp(ue,proc,eNB_id)) {
|
||||
uint32_t SR_payload = 0;
|
||||
|
||||
|
||||
@@ -67,7 +67,10 @@ openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1};
|
||||
|
||||
uint64_t get_softmodem_optmask(void) {return 0;}
|
||||
softmodem_params_t *get_softmodem_params(void) {return 0;}
|
||||
static softmodem_params_t softmodem_params;
|
||||
softmodem_params_t *get_softmodem_params(void) {
|
||||
return &softmodem_params;
|
||||
}
|
||||
|
||||
void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {}
|
||||
|
||||
@@ -174,6 +177,7 @@ int main(int argc, char **argv)
|
||||
int ssb_subcarrier_offset = 0;
|
||||
|
||||
channel_desc_t *gNB2UE;
|
||||
get_softmodem_params()->sa = 1;
|
||||
|
||||
//uint8_t extended_prefix_flag=0;
|
||||
//int8_t interf1=-21,interf2=-21;
|
||||
@@ -460,6 +464,7 @@ int main(int argc, char **argv)
|
||||
frame_parms->Nid_cell = Nid_cell;
|
||||
frame_parms->nushift = Nid_cell%4;
|
||||
frame_parms->ssb_type = nr_ssb_type_C;
|
||||
frame_parms->freq_range = mu<2 ? nr_FR1 : nr_FR2;
|
||||
|
||||
nr_phy_config_request_sim_pbchsim(gNB,N_RB_DL,N_RB_DL,mu,Nid_cell,SSB_positions);
|
||||
phy_init_nr_gNB(gNB,0,1);
|
||||
@@ -584,9 +589,12 @@ int main(int argc, char **argv)
|
||||
for (i=0; i<frame_parms->Lmax; i++) {
|
||||
if((SSB_positions >> i) & 0x01) {
|
||||
|
||||
const int sc_offset = frame_parms->freq_range == nr_FR1 ? ssb_subcarrier_offset<<mu : ssb_subcarrier_offset;
|
||||
const int prb_offset = frame_parms->freq_range == nr_FR1 ? gNB->gNB_config.ssb_table.ssb_offset_point_a.value<<mu : gNB->gNB_config.ssb_table.ssb_offset_point_a.value << (mu - 2);
|
||||
msgDataTx.ssb[i].ssb_pdu.ssb_pdu_rel15.bchPayload = 0x55dd33;
|
||||
msgDataTx.ssb[i].ssb_pdu.ssb_pdu_rel15.SsbBlockIndex = i;
|
||||
msgDataTx.ssb[i].ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset = ssb_subcarrier_offset;
|
||||
msgDataTx.ssb[i].ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset = sc_offset;
|
||||
msgDataTx.ssb[i].ssb_pdu.ssb_pdu_rel15.ssbOffsetPointA = prb_offset;
|
||||
|
||||
start_symbol = nr_get_ssb_start_symbol(frame_parms,i);
|
||||
int slot = start_symbol/14;
|
||||
|
||||
@@ -165,7 +165,7 @@ void common_pucch_configuration(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int pucch_in
|
||||
int test_pucch_basic_error(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
|
||||
{
|
||||
int v_return = 0;
|
||||
bool reset_harq = FALSE;
|
||||
bool reset_harq = false;
|
||||
|
||||
printf("%s", tst_separator);
|
||||
|
||||
@@ -175,7 +175,7 @@ int test_pucch_basic_error(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pr
|
||||
|
||||
common_pucch_configuration(ue, gNB_id, TST_PUCCH_COMMON_CONFIG_INDEX_KO);
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ int test_pucch_basic_error(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pr
|
||||
|
||||
printf("\n => Test : Error due to acknownlegment not set \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ int test_pucch_basic_error(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pr
|
||||
|
||||
printf("\n => Test : Error due to DAI not set \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ int test_pucch_basic_error(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pr
|
||||
|
||||
harq_status->vDAI_DL = NR_DL_MAX_DAI + 1;
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ int test_pucch_basic_error(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pr
|
||||
|
||||
harq_status->vDAI_DL = 0;
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ int test_pucch_basic_error(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pr
|
||||
|
||||
harq_status->send_harq_status = 1; /* ack ready to be send */
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ int test_pucch_basic_error(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pr
|
||||
|
||||
harq_status->vDAI_DL = 1;
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ int test_pucch_basic_error(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pr
|
||||
|
||||
printf("\n => Test : Error due to PUCCH format with multiple cells not already implemented \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ int test_pucch_basic_error(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pr
|
||||
int test_pucch_common_config_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
|
||||
{
|
||||
int v_return = 0;
|
||||
bool reset_harq = FALSE;
|
||||
bool reset_harq = false;
|
||||
|
||||
printf("%s", tst_separator);
|
||||
|
||||
@@ -273,7 +273,7 @@ int test_pucch_common_config_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_
|
||||
|
||||
printf("\n => Test : PUCCH format from common config in prach mode: one positive downlink ACKnowledgment \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ int test_pucch_common_config_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_
|
||||
|
||||
printf("\n => Test : PUCCH format from common config in prach mode: one negative downlink ACKnowledgment \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ int test_pucch_common_config_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_
|
||||
|
||||
printf("\n => Test : PUCCH format from common config in dedicated mode: two positive downlink ACKnowledgments \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ int test_pucch_common_config_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_
|
||||
|
||||
printf("\n => Test : PUCCH format from common config in dedicated mode: one positive and one negative downlink ACKnowledgments \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -320,22 +320,22 @@ int test_pucch_common_config_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_
|
||||
|
||||
printf("\n => Test : PUCCH format from common config in dedicated mode: two negative downlink ACKnowledgments \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
harq_status->ack = DL_ACK;
|
||||
reset_harq = TRUE;
|
||||
reset_harq = true;
|
||||
|
||||
printf("\n => Test : PUCCH format from common config in dedicated mode: no resource is found \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
printf("\n => Test : PUCCH format from common config in dedicated mode: no PUCCH after reset of pending harq ACKnowledgments \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ void init_pucch_dedicated_configuration(PHY_VARS_NR_UE *ue, uint8_t gNB_id)
|
||||
int i,j;
|
||||
|
||||
/* set cell group parameters which are supported */
|
||||
ue->cell_group_config.physicalCellGroupConfig.harq_ACK_SpatialBundlingPUCCH = FALSE;
|
||||
ue->cell_group_config.physicalCellGroupConfig.harq_ACK_SpatialBundlingPUCCH = false;
|
||||
ue->cell_group_config.physicalCellGroupConfig.pdsch_HARQ_ACK_Codebook = dynamic;
|
||||
|
||||
ue->PDSCH_ServingCellConfig.codeBlockGroupTransmission = NULL;
|
||||
@@ -554,7 +554,7 @@ int test_pucch_dedicated_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_id,
|
||||
#define TST_NB_STEP_SINGLE_TRANSPORT_BLOCK (4)
|
||||
|
||||
int v_return = 0;
|
||||
int reset_harq = FALSE;
|
||||
int reset_harq = false;
|
||||
int dl_harq_pid[TST_NB_STEP_SINGLE_TRANSPORT_BLOCK] = {TST_DL_HARQ_PID_FIRST, TST_DL_HARQ_PID_SECOND, TST_DL_HARQ_PID_THIRD, TST_DL_HARQ_PID_FOURTH };
|
||||
int pucch_resource_indicator[TST_NB_STEP_SINGLE_TRANSPORT_BLOCK][2] = { { 0, 4 }, { 1, 0 } , { 1, 3 } , { 5, 7 } };
|
||||
NR_UE_HARQ_STATUS_t *harq_status;
|
||||
@@ -575,7 +575,7 @@ int test_pucch_dedicated_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_id,
|
||||
|
||||
printf("\n => Test : PUCCH format from dedicated config : pucch resource indicator is invalid \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -595,14 +595,14 @@ int test_pucch_dedicated_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_id,
|
||||
|
||||
/* reset ack context on last test */
|
||||
if ((i == (TST_NB_STEP_SINGLE_TRANSPORT_BLOCK-1)) && (j == 1)) {
|
||||
reset_harq = TRUE;
|
||||
reset_harq = true;
|
||||
}
|
||||
|
||||
harq_status->pucch_resource_indicator = pucch_resource_indicator[i][j];
|
||||
|
||||
printf("\n => Test : PUCCH format from dedicated config with 1 transport block : with %d downlink ACKnowledgments and pucch resource indicator %d \n", i+1, pucch_resource_indicator[i][j]);
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
v_return = -1;
|
||||
}
|
||||
}
|
||||
@@ -627,11 +627,11 @@ int test_pucch_dedicated_single_transport_block(PHY_VARS_NR_UE *ue, int gNB_id,
|
||||
harq_status->pucch_resource_indicator = pucch_resource_indicator[i][0];
|
||||
}
|
||||
|
||||
reset_harq = TRUE;
|
||||
reset_harq = true;
|
||||
|
||||
printf("\n => Test : PUCCH format from dedicated config with 1 transport block and missed PDSCH : with %d downlink ACKnowledgments and pucch resource indicator %d \n", i+1, pucch_resource_indicator[3][0]);
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
@@ -659,7 +659,7 @@ int test_pucch_dedicated_two_transport_blocks(PHY_VARS_NR_UE *ue, int gNB_id, UE
|
||||
#define TST_NB_STEP_TWO_TRANSPORT_BLOCKS (4)
|
||||
|
||||
int v_return = 0;
|
||||
int reset_harq = FALSE;
|
||||
int reset_harq = false;
|
||||
int dl_harq_pid[TST_NB_STEP_TWO_TRANSPORT_BLOCKS] = {TST_DL_HARQ_PID_FIRST, TST_DL_HARQ_PID_SECOND, TST_DL_HARQ_PID_THIRD, TST_DL_HARQ_PID_FOURTH };
|
||||
int pucch_resource_indicator[TST_NB_STEP_TWO_TRANSPORT_BLOCKS][2] = { { 0, 1 }, { 3, 7 } , { 2 , 4 } , { 4 , 6 } };
|
||||
NR_UE_HARQ_STATUS_t *harq_status;
|
||||
@@ -694,7 +694,7 @@ int test_pucch_dedicated_two_transport_blocks(PHY_VARS_NR_UE *ue, int gNB_id, UE
|
||||
|
||||
/* reset ack context on last test */
|
||||
if ((i == (TST_NB_STEP_TWO_TRANSPORT_BLOCKS-1)) && (j == 1)) {
|
||||
reset_harq = TRUE;
|
||||
reset_harq = true;
|
||||
}
|
||||
|
||||
harq_status = &ue->dlsch[proc->thread_id][gNB_id][0]->harq_processes[dl_harq_pid[i]].harq_ack;
|
||||
@@ -703,7 +703,7 @@ int test_pucch_dedicated_two_transport_blocks(PHY_VARS_NR_UE *ue, int gNB_id, UE
|
||||
|
||||
printf("\n => Test : PUCCH format from dedicated config with 2 transport blocks : with %d downlink ACKnowledgments and pucch resource indicator %d \n", i+1, pucch_resource_indicator[i][j]);
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -714,7 +714,7 @@ int test_pucch_dedicated_two_transport_blocks(PHY_VARS_NR_UE *ue, int gNB_id, UE
|
||||
/* some transport blocks have been missed and they need to be nack by UE in order to be retransmitted by the network */
|
||||
/* here first and third block receptions have been missed */
|
||||
|
||||
reset_harq = TRUE;
|
||||
reset_harq = true;
|
||||
|
||||
for (int i = 1; i < TST_NB_STEP_TWO_TRANSPORT_BLOCKS; i = i + 1) {
|
||||
|
||||
@@ -743,7 +743,7 @@ int test_pucch_dedicated_two_transport_blocks(PHY_VARS_NR_UE *ue, int gNB_id, UE
|
||||
|
||||
printf("\n => Test : PUCCH format from dedicated config with 2 transport blocks and 1 missed PDSCH : with %d downlink ACKnowledgments and pucch resource indicator %d \n", 4, pucch_resource_indicator[3][0]);
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -775,7 +775,7 @@ int test_pucch_dedicated_two_transport_blocks(PHY_VARS_NR_UE *ue, int gNB_id, UE
|
||||
}
|
||||
}
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -907,7 +907,7 @@ int test_sr_alone_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *p
|
||||
|
||||
tst_scheduling_request_payload = 0;
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != FALSE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != false) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -916,7 +916,7 @@ int test_sr_alone_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *p
|
||||
|
||||
tst_scheduling_request_payload = 1;
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -929,7 +929,7 @@ int test_sr_alone_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *p
|
||||
|
||||
tst_scheduling_request_payload = 1;
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -958,7 +958,7 @@ int test_sr_alone_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *p
|
||||
int test_sr_ack_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
|
||||
{
|
||||
int v_return = 0;
|
||||
int reset_harq = 0;
|
||||
bool reset_harq = false;
|
||||
int sr_config_id = 0;
|
||||
int sr_resource_id = 0;
|
||||
int sr_offset = 0;
|
||||
@@ -988,7 +988,7 @@ int test_sr_ack_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pro
|
||||
|
||||
tst_scheduling_request_payload = 0; /* set sr payload */
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -997,7 +997,7 @@ int test_sr_ack_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pro
|
||||
|
||||
tst_scheduling_request_payload = 1; /* set sr payload */
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -1006,7 +1006,7 @@ int test_sr_ack_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pro
|
||||
|
||||
harq_status->pucch_resource_indicator = pucch_resource_indicator[1];
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -1027,7 +1027,7 @@ int test_sr_ack_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pro
|
||||
|
||||
tst_scheduling_request_payload = 1; /* set sr payload */
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -1035,9 +1035,9 @@ int test_sr_ack_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pro
|
||||
printf("\n => Test : PUCCH format from dedicated config with a positive scheduling request and two positive acks \n");
|
||||
|
||||
harq_status->pucch_resource_indicator = pucch_resource_indicator[1];
|
||||
reset_harq = TRUE;
|
||||
reset_harq = true;
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -1065,7 +1065,7 @@ int test_sr_ack_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *pro
|
||||
int test_csi_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
|
||||
{
|
||||
int v_return = 0;
|
||||
int reset_harq = FALSE;
|
||||
int reset_harq = false;
|
||||
int sr_config_id = 0;
|
||||
int sr_resource_id = 0;
|
||||
int sr_offset = 0;
|
||||
@@ -1079,7 +1079,7 @@ int test_csi_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
|
||||
|
||||
printf("\n => Test : PUCCH format from dedicated config with CSI alone \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -1102,7 +1102,7 @@ int test_csi_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
|
||||
|
||||
ue->pucch_config_dedicated_nr[gNB_id].formatConfig[2-1]->simultaneousHARQ_ACK_CSI = enable_feature; /* format 2 */
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -1115,9 +1115,9 @@ int test_csi_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
|
||||
|
||||
tst_scheduling_request_payload = 0; /* set sr payload */
|
||||
|
||||
reset_harq = TRUE;
|
||||
reset_harq = true;
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -1126,7 +1126,7 @@ int test_csi_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
|
||||
|
||||
harq_status->pucch_resource_indicator = pucch_resource_indicator[4];
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
@@ -1135,7 +1135,7 @@ int test_csi_dedicated(PHY_VARS_NR_UE *ue, int gNB_id, UE_nr_rxtx_proc_t *proc)
|
||||
|
||||
printf("\n => Test : PUCCH format from dedicated config with positive SR and CSI \n");
|
||||
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != TRUE) {
|
||||
if (pucch_procedures_ue_nr(ue, gNB_id, proc, reset_harq) != true) {
|
||||
printf("Test fail \n");
|
||||
v_return = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user