Commit 95dad65c authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/nr_rotation_optimization' into integration_2022_wk35b

parents c8718819 622e14ad
......@@ -205,7 +205,7 @@ L1s = (
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
prach_dtx_threshold = 120;
prach_dtx_threshold = 200;
pucch0_dtx_threshold = 150;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
......
......@@ -237,7 +237,7 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
prach_dtx_threshold = 120;
prach_dtx_threshold = 200;
# pucch0_dtx_threshold = 150;
}
);
......
......@@ -218,6 +218,7 @@ L1s = (
num_cc = 1;
tr_n_preference = "local_mac";
pusch_proc_threads = 8;
prach_dtx_threshold = 200;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
);
......
......@@ -221,8 +221,7 @@ void rx_func(void *param) {
gNB->common_vars.rxdataF[aa],
slot_rx,
0,
gNB->frame_parms.Ncp==EXTENDED?12:14,
gNB->frame_parms.ofdm_symbol_size);
gNB->frame_parms.Ncp==EXTENDED?12:14);
}
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx);
}
......
......@@ -112,8 +112,7 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
int16_t* txdata,
int slot,
int first_symbol,
int nsymb,
int length);
int nsymb);
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp);
......@@ -123,8 +122,7 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
int32_t *rxdataF,
int slot,
int first_symbol,
int nsymb,
int length);
int nsymb);
/*! \brief Perform NR precoding. TS 38.211 V15.4.0 subclause 6.3.1.5
@param[in] datatx_F_precoding, Pointer to n_layers*re data array
......
......@@ -341,30 +341,41 @@ 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,
int16_t* txdataF,
int slot,
int first_symbol,
int nsymb,
int length) {
int nsymb)
{
int symb_offset = (slot%fp->slots_per_subframe)*fp->symbols_per_slot;
c16_t *symbol_rotation = fp->symbol_rotation[0];
c16_t *symbol_rotation = fp->symbol_rotation[0] + symb_offset;
for (int sidx=0;sidx<nsymb;sidx++) {
for (int sidx = first_symbol; sidx < first_symbol + nsymb; sidx++) {
c16_t *this_rotation = symbol_rotation + sidx;
c16_t *this_symbol = ((c16_t*) txdataF) + sidx * fp->ofdm_symbol_size;
LOG_D(PHY,"Rotating symbol %d, slot %d, symbol_subframe_index %d, length %d (%d,%d)\n",
first_symbol + sidx,
LOG_D(PHY,"Rotating symbol %d, slot %d, symbol_subframe_index %d (%d,%d)\n",
sidx,
slot,
sidx + first_symbol + symb_offset,
length,
symbol_rotation[sidx + first_symbol + symb_offset].r,
symbol_rotation[sidx + first_symbol + symb_offset].i);
rotate_cpx_vector(((c16_t*) trxdata) + sidx * length,
symbol_rotation + sidx + first_symbol + symb_offset,
((c16_t*) trxdata) + sidx * length,
length,
15);
sidx + symb_offset,
this_rotation->r,
this_rotation->i);
if (fp->N_RB_DL & 1) {
rotate_cpx_vector(this_symbol, this_rotation, this_symbol,
(fp->N_RB_DL + 1) * 6, 15);
rotate_cpx_vector(this_symbol + fp->first_carrier_offset - 6,
this_rotation,
this_symbol + fp->first_carrier_offset - 6,
(fp->N_RB_DL + 1) * 6, 15);
} else {
rotate_cpx_vector(this_symbol, this_rotation, this_symbol,
fp->N_RB_DL * 6, 15);
rotate_cpx_vector(this_symbol + fp->first_carrier_offset,
this_rotation,
this_symbol + fp->first_carrier_offset,
fp->N_RB_DL * 6, 15);
}
}
}
......@@ -107,20 +107,36 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
symbol+symb_offset,rot2.r,rot2.i);
#endif
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);
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],
(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,
15);
c16_t *this_symbol = (c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol];
if (frame_parms->N_RB_DL & 1) {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
(frame_parms->N_RB_DL + 1) * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6,
&rot2,
this_symbol + frame_parms->first_carrier_offset - 6,
(frame_parms->N_RB_DL + 1) * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, (frame_parms->N_RB_DL + 1) * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset - 6),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
1, (frame_parms->N_RB_DL + 1) * 6, 15);
} else {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
frame_parms->N_RB_DL * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset,
&rot2,
this_symbol + frame_parms->first_carrier_offset,
frame_parms->N_RB_DL * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, frame_parms->N_RB_DL * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset),
1, frame_parms->N_RB_DL * 6, 15);
}
}
#ifdef DEBUG_FEP
......@@ -223,11 +239,8 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
symbol+symb_offset,rot2.r,rot2.i);
#endif
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);
c16_t *this_symbol = (c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol];
rotate_cpx_vector(this_symbol, &rot2, this_symbol, frame_parms->ofdm_symbol_size, 15);
}
#ifdef DEBUG_FEP
......@@ -301,10 +314,8 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
int32_t *rxdataF,
int slot,
int first_symbol,
int nsymb,
int length) {
int nsymb)
{
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
int soffset = (slot&3)*frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
......@@ -313,19 +324,36 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
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);
c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
(int16_t *)shift_rot,
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
1,
length,
15);
c16_t *this_symbol = (c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)];
if (frame_parms->N_RB_UL & 1) {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
(frame_parms->N_RB_UL + 1) * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6,
&rot2,
this_symbol + frame_parms->first_carrier_offset - 6,
(frame_parms->N_RB_UL + 1) * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, (frame_parms->N_RB_UL+1) * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset - 6),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
1, (frame_parms->N_RB_UL+1) * 6, 15);
} else {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
frame_parms->N_RB_UL * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset,
&rot2,
this_symbol + frame_parms->first_carrier_offset,
frame_parms->N_RB_UL * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, frame_parms->N_RB_UL * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset),
1, frame_parms->N_RB_UL * 6, 15);
}
}
}
......@@ -597,17 +597,28 @@ 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];
c16_t *this_symbol = (c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s];
c16_t rot=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);
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);
if (frame_parms->N_RB_UL & 1) {
rotate_cpx_vector(this_symbol, &rot, this_symbol,
(frame_parms->N_RB_UL + 1) * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6,
&rot,
this_symbol + frame_parms->first_carrier_offset - 6,
(frame_parms->N_RB_UL + 1) * 6, 15);
} else {
rotate_cpx_vector(this_symbol, &rot, this_symbol,
frame_parms->N_RB_UL * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset,
&rot,
this_symbol + frame_parms->first_carrier_offset,
frame_parms->N_RB_UL * 6, 15);
}
}
}
......
......@@ -181,7 +181,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
//apply the OFDM symbol rotation here
for (aa=0; aa<cfg->carrier_config.num_tx_ant.value; aa++) {
apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size);
apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0);
......
......@@ -606,6 +606,12 @@ int main(int argc, char **argv)
for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) {
if (cyclic_prefix_type == 1) {
apply_nr_rotation(frame_parms,
(int16_t*)gNB->common_vars.txdataF[aa],
slot,
0,
12);
PHY_ofdm_mod(gNB->common_vars.txdataF[aa],
&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
frame_parms->ofdm_symbol_size,
......@@ -613,10 +619,17 @@ int main(int argc, char **argv)
frame_parms->nb_prefix_samples,
CYCLIC_PREFIX);
} else {
apply_nr_rotation(frame_parms,
(int16_t*)gNB->common_vars.txdataF[aa],
slot,
0,
14);
/*nr_normal_prefix_mod(gNB->common_vars.txdataF[aa],
&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
14,
frame_parms);*/
PHY_ofdm_mod(gNB->common_vars.txdataF[aa],
(int*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
frame_parms->ofdm_symbol_size,
......@@ -624,26 +637,12 @@ int main(int argc, char **argv)
frame_parms->nb_prefix_samples0,
CYCLIC_PREFIX);
apply_nr_rotation(frame_parms,
(int16_t*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
slot,
0,
1,
frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples0);
PHY_ofdm_mod(&gNB->common_vars.txdataF[aa][frame_parms->ofdm_symbol_size],
(int*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)+frame_parms->nb_prefix_samples0+frame_parms->ofdm_symbol_size],
frame_parms->ofdm_symbol_size,
13,
frame_parms->nb_prefix_samples,
CYCLIC_PREFIX);
apply_nr_rotation(frame_parms,
(int16_t*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)+frame_parms->nb_prefix_samples0+frame_parms->ofdm_symbol_size],
slot,
1,
13,
frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples);
}
}
}
......
......@@ -1401,8 +1401,7 @@ int main(int argc, char **argv)
gNB->common_vars.rxdataF[aa],
slot,
0,
gNB->frame_parms.Ncp == EXTENDED ? 12 : 14,
gNB->frame_parms.ofdm_symbol_size);
gNB->frame_parms.Ncp == EXTENDED ? 12 : 14);
}
ul_proc_error = phy_procedures_gNB_uespec_RX(gNB, frame, slot);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment