Merge remote-tracking branch 'origin/develop-SRS' into integration_2022_wk06_a
This commit is contained in:
@@ -195,6 +195,26 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
|
||||
nr_init_csi_rs(gNB, cfg->cell_config.phy_cell_id.value);
|
||||
|
||||
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]->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);
|
||||
|
||||
/* Generate low PAPR type 1 sequences for PUSCH DMRS, these are used if transform precoding is enabled. */
|
||||
generate_lowpapr_typ1_refsig_sequences(SHRT_MAX);
|
||||
|
||||
@@ -546,6 +566,12 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
|
||||
AssertFatal(gNB->pucch[i]!=NULL,"Can't initialize pucch %d \n", i);
|
||||
}
|
||||
|
||||
for (int i=0; i<NUMBER_OF_NR_SRS_MAX; i++) {
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffers for SRS %d/%d\n",i,NUMBER_OF_NR_SRS_MAX);
|
||||
gNB->srs[i] = new_gNB_srs();
|
||||
AssertFatal(gNB->srs[i]!=NULL,"Can't initialize srs %d \n", i);
|
||||
}
|
||||
|
||||
for (int i=0; i<gNB->number_of_nr_ulsch_max; i++) {
|
||||
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,gNB->number_of_nr_ulsch_max);
|
||||
|
||||
@@ -128,6 +128,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
NR_UE_COMMON *const common_vars = &ue->common_vars;
|
||||
NR_UE_PBCH **const pbch_vars = ue->pbch_vars;
|
||||
NR_UE_PRACH **const prach_vars = ue->prach_vars;
|
||||
NR_UE_SRS **const srs_vars = ue->srs_vars;
|
||||
|
||||
int i,j,k,l,slot,symb,q;
|
||||
int gNB_id;
|
||||
int th_id;
|
||||
@@ -310,6 +312,24 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
|
||||
prach_vars[gNB_id] = (NR_UE_PRACH *)malloc16_clear(sizeof(NR_UE_PRACH));
|
||||
pbch_vars[gNB_id] = (NR_UE_PBCH *)malloc16_clear(sizeof(NR_UE_PBCH));
|
||||
srs_vars[gNB_id] = (NR_UE_SRS *)malloc16_clear(sizeof(NR_UE_SRS));
|
||||
|
||||
srs_vars[gNB_id]->active = false;
|
||||
ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_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));
|
||||
}
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
|
||||
@@ -44,14 +44,13 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int16_t *d)
|
||||
{
|
||||
|
||||
uint32_t i;
|
||||
uint8_t reset;
|
||||
uint32_t x1=0, x2=0, s=0;
|
||||
uint8_t reset = 1;
|
||||
uint32_t x1 = 0; // x1 is set in lte_gold_generic
|
||||
uint32_t s = 0;
|
||||
|
||||
reset = 1;
|
||||
x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1
|
||||
uint32_t x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
for (uint32_t i=0; i<32; i++) {
|
||||
if ((i&0x1f)==0) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
//printf("lte_gold[%d]=%x\n",i,s);
|
||||
|
||||
@@ -36,10 +36,46 @@
|
||||
|
||||
//#define DEBUG_CH
|
||||
//#define DEBUG_PUSCH
|
||||
//#define SRS_DEBUG
|
||||
|
||||
#define NO_INTERP 1
|
||||
#define dBc(x,y) (dB_fixed(((int32_t)(x))*(x) + ((int32_t)(y))*(y)))
|
||||
|
||||
void freq2time(uint16_t ofdm_symbol_size,
|
||||
int16_t *freq_signal,
|
||||
int16_t *time_signal) {
|
||||
|
||||
switch (ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft(IDFT_128, freq_signal, time_signal, 1);
|
||||
break;
|
||||
case 256:
|
||||
idft(IDFT_256, freq_signal, time_signal, 1);
|
||||
break;
|
||||
case 512:
|
||||
idft(IDFT_512, freq_signal, time_signal, 1);
|
||||
break;
|
||||
case 1024:
|
||||
idft(IDFT_1024, freq_signal, time_signal, 1);
|
||||
break;
|
||||
case 1536:
|
||||
idft(IDFT_1536, freq_signal, time_signal, 1);
|
||||
break;
|
||||
case 2048:
|
||||
idft(IDFT_2048, freq_signal, time_signal, 1);
|
||||
break;
|
||||
case 4096:
|
||||
idft(IDFT_4096, freq_signal, time_signal, 1);
|
||||
break;
|
||||
case 8192:
|
||||
idft(IDFT_8192, freq_signal, time_signal, 1);
|
||||
break;
|
||||
default:
|
||||
idft(IDFT_512, freq_signal, time_signal, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
unsigned char Ns,
|
||||
unsigned short p,
|
||||
@@ -273,10 +309,10 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
|
||||
|
||||
//for (int i= 0; i<16; i++)
|
||||
//printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i));
|
||||
|
||||
|
||||
pil += 2;
|
||||
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
|
||||
@@ -898,63 +934,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
#endif
|
||||
|
||||
// Convert to time domain
|
||||
|
||||
switch (gNB->frame_parms.ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft(IDFT_128,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 256:
|
||||
idft(IDFT_256,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 512:
|
||||
idft(IDFT_512,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
idft(IDFT_1024,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
idft(IDFT_1536,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft(IDFT_2048,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 4096:
|
||||
idft(IDFT_4096,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
case 8192:
|
||||
idft(IDFT_8192,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
|
||||
default:
|
||||
idft(IDFT_512,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
1);
|
||||
break;
|
||||
}
|
||||
|
||||
freq2time(gNB->frame_parms.ofdm_symbol_size,
|
||||
(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx]);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
@@ -1091,3 +1073,178 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
}// last symbol check
|
||||
}//Antenna loop
|
||||
}
|
||||
|
||||
uint32_t calc_power(uint16_t *x, uint32_t size) {
|
||||
uint64_t sum_x = 0;
|
||||
uint64_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];
|
||||
}
|
||||
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) {
|
||||
|
||||
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;
|
||||
|
||||
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 ls_estimated[2];
|
||||
|
||||
for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) {
|
||||
|
||||
memset(srs_ls_estimated_channel[ant], 0, frame_parms->ofdm_symbol_size*(1<<srs_pdu->num_symbols)*sizeof(int32_t));
|
||||
memset(srs_estimated_channel_freq[ant], 0, frame_parms->ofdm_symbol_size*(1<<srs_pdu->num_symbols)*sizeof(int32_t));
|
||||
|
||||
int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[0]];
|
||||
|
||||
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 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;
|
||||
|
||||
// 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.
|
||||
ls_estimated[0] = (int16_t)(((int32_t)generated_real*received_real + (int32_t)generated_imag*received_imag)>>nr_srs_info->srs_generated_signal_bits);
|
||||
ls_estimated[1] = (int16_t)(((int32_t)generated_real*received_imag - (int32_t)generated_imag*received_real)>>nr_srs_info->srs_generated_signal_bits);
|
||||
srs_ls_estimated_channel[ant][nr_srs_info->sc_list[sc_idx]] = ls_estimated[0] + (((int32_t)ls_estimated[1] << 16) & 0xFFFF0000);
|
||||
|
||||
// Channel interpolation
|
||||
if(srs_pdu->comb_size == 0) {
|
||||
if(sc_idx == 0) { // First subcarrier case
|
||||
// filt8_start is {12288,8192,4096,0,0,0,0,0}
|
||||
multadd_real_vector_complex_scalar(filt8_start, ls_estimated, srs_estimated_channel16, 8);
|
||||
} else if(nr_srs_info->sc_list[sc_idx] < nr_srs_info->sc_list[sc_idx - 1]) { // Start of OFDM symbol case
|
||||
// filt8_start is {12288,8192,4096,0,0,0,0,0}
|
||||
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx + 2]] - sizeof(uint64_t);
|
||||
multadd_real_vector_complex_scalar(filt8_start, ls_estimated, srs_estimated_channel16, 8);
|
||||
} else if((sc_idx < (nr_srs_info->sc_list_length - 1) && nr_srs_info->sc_list[sc_idx + 1] < nr_srs_info->sc_list[sc_idx])
|
||||
|| (sc_idx == (nr_srs_info->sc_list_length - 1))) { // End of OFDM symbol or last subcarrier cases
|
||||
// filt8_end is {4096,8192,12288,16384,0,0,0,0}
|
||||
multadd_real_vector_complex_scalar(filt8_end, ls_estimated, srs_estimated_channel16, 8);
|
||||
} else if(sc_idx%2 == 1) { // 1st middle case
|
||||
// filt8_middle2 is {4096,8192,8192,8192,4096,0,0,0}
|
||||
multadd_real_vector_complex_scalar(filt8_middle2, ls_estimated, srs_estimated_channel16, 8);
|
||||
} else if(sc_idx%2 == 0) { // 2nd middle case
|
||||
// filt8_middle4 is {0,0,4096,8192,8192,8192,4096,0}
|
||||
multadd_real_vector_complex_scalar(filt8_middle4, ls_estimated, srs_estimated_channel16, 8);
|
||||
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]];
|
||||
}
|
||||
} else {
|
||||
if(sc_idx == 0) { // First subcarrier case
|
||||
// filt16_start is {12288,8192,8192,8192,4096,0,0,0,0,0,0,0,0,0,0,0}
|
||||
multadd_real_vector_complex_scalar(filt16_start, ls_estimated, srs_estimated_channel16, 16);
|
||||
} else if(nr_srs_info->sc_list[sc_idx] < nr_srs_info->sc_list[sc_idx - 1]) { // Start of OFDM symbol case
|
||||
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx + 1]] - sizeof(uint64_t);
|
||||
// filt16_start is {12288,8192,8192,8192,4096,0,0,0,0,0,0,0,0,0,0,0}
|
||||
multadd_real_vector_complex_scalar(filt16_start, ls_estimated, srs_estimated_channel16, 16);
|
||||
} else if((sc_idx < (nr_srs_info->sc_list_length - 1) && nr_srs_info->sc_list[sc_idx + 1] < nr_srs_info->sc_list[sc_idx])
|
||||
|| (sc_idx == (nr_srs_info->sc_list_length - 1))) { // End of OFDM symbol or last subcarrier cases
|
||||
// filt16_end is {4096,8192,8192,8192,12288,16384,16384,16384,0,0,0,0,0,0,0,0}
|
||||
multadd_real_vector_complex_scalar(filt16_end, ls_estimated, srs_estimated_channel16, 16);
|
||||
} else { // Middle case
|
||||
// filt16_middle4 is {4096,8192,8192,8192,8192,8192,8192,8192,4096,0,0,0,0,0,0,0}
|
||||
multadd_real_vector_complex_scalar(filt16_middle4, ls_estimated, srs_estimated_channel16, 16);
|
||||
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]];
|
||||
}
|
||||
}
|
||||
|
||||
#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;
|
||||
if(subcarrier_log < 0) {
|
||||
subcarrier_log = subcarrier_log + frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
if(sc_idx == 0) {
|
||||
LOG_I(NR_PHY,"______________________________ Rx antenna %i _______________________________\n", ant);
|
||||
}
|
||||
if(subcarrier_log%12 == 0) {
|
||||
LOG_I(NR_PHY,":::::::::::::::::::::::::::::::::::: %i ::::::::::::::::::::::::::::::::::::\n", subcarrier_log/12);
|
||||
LOG_I(NR_PHY,"\t __genRe________genIm__|____rxRe_________rxIm__|____lsRe________lsIm_\n");
|
||||
}
|
||||
LOG_I(NR_PHY,"(%4i) %6i\t%6i | %6i\t%6i | %6i\t%6i\n",
|
||||
subcarrier_log,
|
||||
generated_real, generated_imag,
|
||||
received_real, received_imag,
|
||||
ls_estimated[0], ls_estimated[1]);
|
||||
#endif
|
||||
}
|
||||
|
||||
// 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));
|
||||
}
|
||||
|
||||
// Convert to time domain
|
||||
freq2time(gNB->frame_parms.ofdm_symbol_size,
|
||||
(int16_t*) srs_estimated_channel_freq[ant],
|
||||
(int16_t*) srs_estimated_channel_time[ant]);
|
||||
|
||||
memcpy(&srs_estimated_channel_time_shifted[ant][0],
|
||||
&srs_estimated_channel_time[ant][gNB->frame_parms.ofdm_symbol_size>>1],
|
||||
(gNB->frame_parms.ofdm_symbol_size>>1)*sizeof(int32_t));
|
||||
|
||||
memcpy(&srs_estimated_channel_time_shifted[ant][gNB->frame_parms.ofdm_symbol_size>>1],
|
||||
&srs_estimated_channel_time[ant][0],
|
||||
(gNB->frame_parms.ofdm_symbol_size>>1)*sizeof(int32_t));
|
||||
}
|
||||
|
||||
*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);
|
||||
|
||||
#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++) {
|
||||
int subcarrier_log = nr_srs_info->sc_list[sc_idx]-subcarrier_offset;
|
||||
if(subcarrier_log < 0) {
|
||||
subcarrier_log = subcarrier_log + frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
if(sc_idx == 0) {
|
||||
LOG_I(NR_PHY,"______________________________ Rx antenna %i _______________________________\n", ant);
|
||||
}
|
||||
if(subcarrier_log%12 == 0) {
|
||||
LOG_I(NR_PHY,":::::::::::::::::::::::::::::::::::: %i ::::::::::::::::::::::::::::::::::::\n", subcarrier_log/12);
|
||||
LOG_I(NR_PHY,"\t __lsRe__________lsIm__|____intRe_______intIm__|____noiRe_______noiIm_\n");
|
||||
}
|
||||
for(int r = 0; r<R; r++) {
|
||||
LOG_I(NR_PHY,"(%4i) %6i\t%6i | %6i\t%6i | %6i\t%6i\n",
|
||||
subcarrier_log+r,
|
||||
(int16_t)(srs_ls_estimated_channel[ant][nr_srs_info->sc_list[sc_idx]+r]&0xFFFF),
|
||||
(int16_t)((srs_ls_estimated_channel[ant][nr_srs_info->sc_list[sc_idx]+r]>>16)&0xFFFF),
|
||||
(int16_t)(srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]+r]&0xFFFF),
|
||||
(int16_t)((srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]+r]>>16)&0xFFFF),
|
||||
noise_real[ant*nr_srs_info->sc_list_length+sc_idx],
|
||||
noise_imag[ant*nr_srs_info->sc_list_length+sc_idx]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
LOG_I(NR_PHY,"noise_power = %u\n", *noise_power);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -62,4 +62,16 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
|
||||
uint8_t nr_tti_rx,
|
||||
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);
|
||||
#endif
|
||||
|
||||
@@ -108,22 +108,22 @@ EXTERN const char phi_M_ZC_6[6*U_GROUP_NUMBER]
|
||||
#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H
|
||||
= {
|
||||
/* 0 1 2 3 4 5 */
|
||||
/* 0 */ -3, -1, 3, 3, -1, -3,
|
||||
/* 1 */ -3, 3, -1, -1, 3, -3,
|
||||
/* 2 */ -3, -3, -3, 3, 1, -3,
|
||||
/* 3 */ 1, 1, 1, 3, -1, -3,
|
||||
/* 4 */ 1, 1, 1, -3, -1, 3,
|
||||
/* 5 */ -3, 1, -1, -3, -3, -3,
|
||||
/* 6 */ -3, 1, 3, -3, -3, -3,
|
||||
/* 7 */ -3, -1, 1, -3, 1, -1,
|
||||
/* 8 */ -3, -1, -3, 1, -3, -3,
|
||||
/* 9 */ -3, -3, 1, -3, 3, -3,
|
||||
/* 0 */ -3, -1, 3, 3, -1, -3,
|
||||
/* 1 */ -3, 3, -1, -1, 3, -3,
|
||||
/* 2 */ -3, -3, -3, 3, 1, -3,
|
||||
/* 3 */ 1, 1, 1, 3, -1, -3,
|
||||
/* 4 */ 1, 1, 1, -3, -1, 3,
|
||||
/* 5 */ -3, 1, -1, -3, -3, -3,
|
||||
/* 6 */ -3, 1, 3, -3, -3, -3,
|
||||
/* 7 */ -3, -1, 1, -3, 1, -1,
|
||||
/* 8 */ -3, -1, -3, 1, -3, -3,
|
||||
/* 9 */ -3, -3, 1, -3, 3, -3,
|
||||
/* 10 */ -3, 1, 3, 1, -3, -3,
|
||||
/* 11 */ -3, -1, -3, 1, 1, -3,
|
||||
/* 12 */ 1, 1, 3, -1, -3, 3,
|
||||
/* 13 */ 1, 1, 3, 3, -1, 3,
|
||||
/* 14 */ 1, 1, 1, -3, 3, -1,
|
||||
/* 15 */ -1, 1, 1, -1, 3, -3,
|
||||
/* 15 */ 1, 1, 1, -1, 3, -3,
|
||||
/* 16 */ -3, -1, -1, -1, 3, -1,
|
||||
/* 17 */ -3, -3, -1, 1, -1, -3,
|
||||
/* 18 */ -3, -3, -3, 1, -3, -1,
|
||||
@@ -146,36 +146,36 @@ EXTERN const char phi_M_ZC_12[12*U_GROUP_NUMBER]
|
||||
#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H
|
||||
= {
|
||||
/* 0 1 2 3 4 5 6 7 8 9 10 11 */
|
||||
/* 0 */ 1, -1, 3, 1, 1, -1, -1, -1, 1, 3, -3, 1,
|
||||
/* 1 */ -1, -1, -1, -1, 1, -3, -1, 3, 3, -1, -3, 1,
|
||||
/* 2 */ -3, 1, -3, -3, -3, 3, -3, -1, 1, 1, 1, -3,
|
||||
/* 3 */ -3, 3, 1, 3, -3, 1, 1, 1, 1, 3, -3, 3,
|
||||
/* 4 */ -3, 1, 3, -1, -1, -3, -3, -1, -1, 3, 1, -3,
|
||||
/* 5 */ -1, 1, 1, -1, 1, 3, 3, -1, -1, -3, 1, -3,
|
||||
/* 6 */ -3, -3, -1, 3, 3, 3, -3, 3, -3, 1, -1, -3,
|
||||
/* 7 */ -3, 3, -3, 3, 3, -3, -1, -1, 3, 3, 1, -3,
|
||||
/* 8 */ -3, -1, -3, -1, -1, -3, 3, 3, -1, -1, 1, -3,
|
||||
/* 9 */ -3, 3, 3, 3, -1, -3, -3, -1, -3, 1, 3, -3,
|
||||
/* 10 */ 1, 3, -3, 1, 3, 3, 3, 1, -1, 1, -1, 3,
|
||||
/* 11 */ -1, -3, 3, -1, -3, -3, -3, -1, 1, -1, 1, -3,
|
||||
/* 12 */ 3, 1, 3, 1, 3, -3, -1, 1, 3, 1, -1, -3,
|
||||
/* 13 */ -3, -3, 3, 3, 3, -3, -1, 1, -3, 3, 1, -3,
|
||||
/* 14 */ -3, -1, 1, -3, 1, 3, 3, 3, -1, -3, 3, 3,
|
||||
/* 15 */ -3, -3, 3, 1, -3, -3, -3, -1, 3, -1, 1, 3,
|
||||
/* 16 */ -1, 1, 3, -3, 1, -1, 1, -1, -1, -3, 1, -1,
|
||||
/* 17 */ -3, -1, -1, 1, 3, 1, 1, -1, 1, -1, -3, 1,
|
||||
/* 18 */ -3, -1, 3, -3, -3, -1, -3, 1, -1, -3, 3, 3,
|
||||
/* 0 */ -3, 1, -3, -3, -3, 3, -3, -1, 1, 1, 1, -3,
|
||||
/* 1 */ -3, 3, 1, -3, 1, 3, -1, -1, 1, 3, 3, 3,
|
||||
/* 2 */ -3, 3, 3, 1, -3, 3, -1, 1, 3, -3, 3, -3,
|
||||
/* 3 */ -3, -3, -1, 3, 3, 3, -3, 3, -3, 1, -1, -3,
|
||||
/* 4 */ -3, -1, -1, 1, 3, 1, 1, -1, 1, -1, -3, 1,
|
||||
/* 5 */ -3, -3, 3, 1, -3, -3, -3, -1, 3, -1, 1, 3,
|
||||
/* 6 */ 1, -1, 3, -1, -1, -1, -3, -1, 1, 1, 1, -3,
|
||||
/* 7 */ -1, -3, 3, -1, -3, -3, -3, -1, 1, -1, 1, -3,
|
||||
/* 8 */ -3, -1, 3, 1, -3, -1, -3, 3, 1, 3, 3, 1,
|
||||
/* 9 */ -3, -1, -1, -3, -3, -1, -3, 3, 1, 3, -1, -3,
|
||||
/* 10 */ -3, 3, -3, 3, 3, -3, -1, -1, 3, 3, 1, -3,
|
||||
/* 11 */ -3, -1, -3, -1, -1, -3, 3, 3, -1, -1, 1, -3,
|
||||
/* 12 */ -3, -1, 3, -3, -3, -1, -3, 1, -1, -3, 3, 3,
|
||||
/* 13 */ -3, 1, -1, -1, 3, 3, -3, -1, -1, -3, -1, -3,
|
||||
/* 14 */ 1, 3, -3, 1, 3, 3, 3, 1, -1, 1, -1, 3,
|
||||
/* 15 */ -3, 1, 3, -1, -1, -3, -3, -1, -1, 3, 1, -3,
|
||||
/* 16 */ -1, -1, -1, -1, 1, -3, -1, 3, 3, -1, -3, 1,
|
||||
/* 17 */ -1, 1, 1, -1, 1, 3, 3, -1, -1, -3, 1, -3,
|
||||
/* 18 */ -3, 1, 3, 3, -1, -1, -3, 3, 3, -3, 3, -3,
|
||||
/* 19 */ -3, -3, 3, -3, -1, 3, 3, 3, -1, -3, 1, -3,
|
||||
/* 20 */ -3, 1, -1, -1, 3, 3, -3, -1, -1, -3, -1, -3,
|
||||
/* 21 */ -3, 1, 3, 3, -1, -1, -3, 3, 3, -3, 3, -3,
|
||||
/* 22 */ -3, -1, -1, -3, -3, -1, -3, 3, 1, 3, -1, -3,
|
||||
/* 23 */ -3, -1, 3, 1, -3, -1, -3, 3, 1, 3, 3, 1,
|
||||
/* 24 */ -3, 3, 3, 1, -3, 3, -1, 1, 3, -3, 3, -3,
|
||||
/* 25 */ 3, -1, -3, 3, -3, -1, 3, 3, 3, -3, -1, -3,
|
||||
/* 26 */ 1, -1, 3, -1, -1, -1, -3, -1, 1, 1, 1, -3,
|
||||
/* 27 */ -3, 3, 1, -3, 1, 3, -1, -1, 1, 3, 3, 3,
|
||||
/* 28 */ -3, 3, -3, 3, -3, -3, 3, -1, -1, 1, 3, -3,
|
||||
/* 29 */ -3, 3, 1, -1, 3, 3, -3, 1, -1, 1, -1, 1,
|
||||
/* 20 */ 3, 1, 3, 1, 3, -3, -1, 1, 3, 1, -1, -3,
|
||||
/* 21 */ -3, 3, 1, 3, -3, 1, 1, 1, 1, 3, -3, 3,
|
||||
/* 22 */ -3, 3, 3, 3, -1, -3, -3, -1, -3, 1, 3, -3,
|
||||
/* 23 */ 3, -1, -3, 3, -3, -1, 3, 3, 3, -3, -1, -3,
|
||||
/* 24 */ -3, -1, 1, -3, 1, 3, 3, 3, -1, -3, 3, 3,
|
||||
/* 25 */ -3, 3, 1, -1, 3, 3, -3, 1, -1, 1, -1, 1,
|
||||
/* 26 */ -1, 1, 3, -3, 1, -1, 1, -1, -1, -3, 1, -1,
|
||||
/* 27 */ -3, -3, 3, 3, 3, -3, -1, 1, -3, 3, 1, -3,
|
||||
/* 28 */ 1, -1, 3, 1, 1, -1, -1, -1, 1, 3, -3, 1,
|
||||
/* 29 */ -3, 3, -3, 3, -3, -3, 3, -1, -1, 1, 3, -3,
|
||||
}
|
||||
#endif
|
||||
;
|
||||
@@ -185,36 +185,36 @@ EXTERN const char phi_M_ZC_18[18*U_GROUP_NUMBER]
|
||||
#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H
|
||||
= {
|
||||
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 */
|
||||
/* 0 */ 3, -3, 3, -1, 1, 3, -3, -1, -3, -3, -1, -3, 3, 1, -1, 3, -3, 3,
|
||||
/* 1 */ 3, -3, 1, 1, 3, -1, 1, -1, -1, -3, 1, 1, -1, 3, 3, -3, 3, -1,
|
||||
/* 2 */ -3, 3, -1, -3, -1, -3, 1, 1, -3, -3, -1, -1, 3, -3, 1, 3, 1, 1,
|
||||
/* 3 */ 1, 1, -1, -1, -3, -1, 1, -3, -3, -3, 1, -3, -1, -1, 1, -1, 3, 1,
|
||||
/* 4 */ 1, 1, -3, 3, 3, 1, 3, -3, 3, -1, 1, 1, -1, 1, -3, -3, -1, 3,
|
||||
/* 5 */ -3, -3, 1, -3, 3, 3, 3, -1, 3, 1, 1, -3, -3, -3, 3, -3, -1, -1,
|
||||
/* 6 */ -1, 3, -1, -3, 3, 1, -3, -1, 3, -3, -1, -1, 1, 1, 1, -1, -1, -1,
|
||||
/* 7 */ -3, 1, -3, -3, 1, -3, -3, 3, 1, -3, -1, -3, -3, -3, -1, 1, 1, 3,
|
||||
/* 8 */ 1, -3, -1, -3, 3, 3, -1, -3, 1, -3, -3, -1, -3, -1, 1, 3, 3, 3,
|
||||
/* 9 */ -3, 3, 1, -1, -1, -1, -1, 1, -1, 3, 3, -3, -1, 1, 3, -1, 3, -1,
|
||||
/* 10 */ -3, -3, 1, -1, -1, 1, 1, -3, -1, 3, 3, 3, 3, -1, 3, 1, 3, 1,
|
||||
/* 11 */ -3, -3, 3, 3, -3, 1, 3, -1, -3, 1, -1, -3, 3, -3, -1, -1, -1, 3,
|
||||
/* 12 */ -3, -3, 3, 3, 3, 1, -3, 1, 3, 3, 1, -3, -3, 3, -1, -3, -1, 1,
|
||||
/* 13 */ -3, 3, -1, 1, 3, 1, -3, -1, 1, 1, -3, 1, 3, 3, -1, -3, -3, -3,
|
||||
/* 14 */ -3, 1, -3, -1, -1, 3, 1, -3, -3, -3, -1, -3, -3, 1, 1, 1, -1, -1,
|
||||
/* 15 */ -3, -3, 3, 3, 3, -1, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -1,
|
||||
/* 16 */ -3, -1, 3, 3, -1, 3, -1, -3, -1, 1, -1, -3, -1, -1, -1, 3, 3, 1,
|
||||
/* 17 */ -3, -1, -3, -1, -3, 1, 3, -3, -1, 3, 3, 3, 1, -1, -3, 3, -1, -3,
|
||||
/* 18 */ -3, 3, 1, -1, -1, 3, -3, -1, 1, 1, 1, 1, 1, -1, 3, -1, -3, -1,
|
||||
/* 19 */ 3, -1, -3, 1, -3, -3, -3, 3, 3, -1, 1, -3, -1, 3, 1, 1, 3, 3,
|
||||
/* 20 */ 3, 3, 3, -3, -1, -3, -1, 3, -1, 1, -1, -3, 1, -3, -3, -1, 3, 3,
|
||||
/* 21 */ 3, -1, 3, 1, -3, -3, -1, 1, -3, -3, 3, 3, 3, 1, 3, -3, 3, -3,
|
||||
/* 22 */ -3, 1, 1, -3, 1, 1, 3, -3, -1, -3, -1, 3, -3, 3, -1, -1, -1, -3,
|
||||
/* 23 */ -3, -1, -1, -3, 1, -3, 3, -1, -1, -3, 3, 3, -3, -1, 3, -1, -1, -1,
|
||||
/* 24 */ -3, -3, -3, 1, -3, 3, 1, 1, 3, -3, -3, 1, 3, -1, 3, -3, -3, 3,
|
||||
/* 25 */ 1, 1, -3, -3, -3, -3, 1, 3, -3, 3, 3, 1, -3, -1, 3, -1, -3, 1,
|
||||
/* 26 */ 3, -1, -1, 1, -3, -1, -3, -1, -3, -3, -1, -3, 1, 1, 1, -3, -3, 3,
|
||||
/* 27 */ 3, 1, -3, 1, -3, 3, 3, -1, -3, -3, -1, -3, -3, 3, -3, -1, 1, 3,
|
||||
/* 0 */ -1, 3, -1, -3, 3, 1, -3, -1, 3, -3, -1, -1, 1, 1, 1, -1, -1, -1,
|
||||
/* 1 */ 3, -3, 3, -1, 1, 3, -3, -1, -3, -3, -1, -3, 3, 1, -1, 3, -3, 3,
|
||||
/* 2 */ -3, 3, 1, -1, -1, 3, -3, -1, 1, 1, 1, 1, 1, -1, 3, -1, -3, -1,
|
||||
/* 3 */ -3, -3, 3, 3, 3, 1, -3, 1, 3, 3, 1, -3, -3, 3, -1, -3, -1, 1,
|
||||
/* 4 */ 1, 1, -1, -1, -3, -1, 1, -3, -3, -3, 1, -3, -1, -1, 1, -1, 3, 1,
|
||||
/* 5 */ 3, -3, 1, 1, 3, -1, 1, -1, -1, -3, 1, 1, -1, 3, 3, -3, 3, -1,
|
||||
/* 6 */ -3, 3, -1, 1, 3, 1, -3, -1, 1, 1, -3, 1, 3, 3, -1, -3, -3, -3,
|
||||
/* 7 */ 1, 1, -3, 3, 3, 1, 3, -3, 3, -1, 1, 1, -1, 1, -3, -3, -1, 3,
|
||||
/* 8 */ -3, 1, -3, -3, 1, -3, -3, 3, 1, -3, -1, -3, -3, -3, -1, 1, 1, 3,
|
||||
/* 9 */ 3, -1, 3, 1, -3, -3, -1, 1, -3, -3, 3, 3, 3, 1, 3, -3, 3, -3,
|
||||
/* 10 */ -3, -3, -3, 1, -3, 3, 1, 1, 3, -3, -3, 1, 3, -1, 3, -3, -3, 3,
|
||||
/* 11 */ -3, -3, 3, 3, 3, -1, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -1,
|
||||
/* 12 */ -3, -1, -3, -3, 1, 1, -1, -3, -1, -3, -1, -1, 3, 3, -1, 3, 1, 3,
|
||||
/* 13 */ 1, 1, -3, -3, -3, -3, 1, 3, -3, 3, 3, 1, -3, -1, 3, -1, -3, 1,
|
||||
/* 14 */ -3, 3, -1, -3, -1, -3, 1, 1, -3, -3, -1, -1, 3, -3, 1, 3, 1, 1,
|
||||
/* 15 */ 3, 1, -3, 1, -3, 3, 3, -1, -3, -3, -1, -3, -3, 3, -3, -1, 1, 3,
|
||||
/* 16 */ -3, -1, -3, -1, -3, 1, 3, -3, -1, 3, 3, 3, 1, -1, -3, 3, -1, -3,
|
||||
/* 17 */ -3, -1, 3, 3, -1, 3, -1, -3, -1, 1, -1, -3, -1, -1, -1, 3, 3, 1,
|
||||
/* 18 */ -3, 1, -3, -1, -1, 3, 1, -3, -3, -3, -1, -3, -3, 1, 1, 1, -1, -1,
|
||||
/* 19 */ 3, 3, 3, -3, -1, -3, -1, 3, -1, 1, -1, -3, 1, -3, -3, -1, 3, 3,
|
||||
/* 20 */ -3, 1, 1, -3, 1, 1, 3, -3, -1, -3, -1, 3, -3, 3, -1, -1, -1, -3,
|
||||
/* 21 */ 1, -3, -1, -3, 3, 3, -1, -3, 1, -3, -3, -1, -3, -1, 1, 3, 3, 3,
|
||||
/* 22 */ -3, -3, 1, -1, -1, 1, 1, -3, -1, 3, 3, 3, 3, -1, 3, 1, 3, 1,
|
||||
/* 23 */ 3, -1, -3, 1, -3, -3, -3, 3, 3, -1, 1, -3, -1, 3, 1, 1, 3, 3,
|
||||
/* 24 */ 3, -1, -1, 1, -3, -1, -3, -1, -3, -3, -1, -3, 1, 1, 1, -3, -3, 3,
|
||||
/* 25 */ -3, -3, 1, -3, 3, 3, 3, -1, 3, 1, 1, -3, -3, -3, 3, -3, -1, -1,
|
||||
/* 26 */ -3, -1, -1, -3, 1, -3, 3, -1, -1, -3, 3, 3, -3, -1, 3, -1, -1, -1,
|
||||
/* 27 */ -3, -3, 3, 3, -3, 1, 3, -1, -3, 1, -1, -3, 3, -3, -1, -1, -1, 3,
|
||||
/* 28 */ -1, -3, 1, -3, -3, -3, 1, 1, 3, 3, -3, 3, 3, -3, -1, 3, -3, 1,
|
||||
/* 29 */ -3, -1, -3, -3, 1, 1, -1, -3, -1, -3, -1, -1, 3, 3, -1, 3, 1, 3,
|
||||
/* 29 */ -3, 3, 1, -1, -1, -1, -1, 1, -1, 3, 3, -3, -1, 1, 3, -1, 3, -1,
|
||||
}
|
||||
#endif
|
||||
;
|
||||
@@ -224,36 +224,36 @@ EXTERN const char phi_M_ZC_24[24*U_GROUP_NUMBER]
|
||||
#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H
|
||||
= {
|
||||
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 */
|
||||
/* 0 */ -1, -3, 3, 1, 1, -3, 1, -3, -3, 1, -3, -1, -1, 3, -3, 3, 3, 3, -3, 1, 3, 3, -3, -3,
|
||||
/* 1 */ -1, -3, 3, -1, 3, 1, 3, -1, 1, -3, -1, -3, -1, 1, 3, -3, -1, -3, 3, 3, 3, -3, -3, -3,
|
||||
/* 2 */ -3, 3, 1, 3, -1, 1, -3, 1, -3, 1, -1, -3, -1, -3, -3, -3, -3, -1, -1, -1, 1, 1, -3, -3,
|
||||
/* 3 */ 3, -1, 3, -1, 1, -3, 1, 1, -3, -3, 3, -3, -1, -1, -1, -1, -1, -3, -3, -1, 1, 1, -3, -3,
|
||||
/* 4 */ 1, -3, 3, -1, -3, -1, 3, 3, 1, -1, 1, 1, 3, -3, -1, -3, -3, -3, -1, 3, -3, -1, -3, -3,
|
||||
/* 5 */ 3, -1, 1, -1, 3, -3, 1, 1, 3, -1, -3, 3, 1, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, -3,
|
||||
/* 6 */ -3, 3, -1, 3, 1, -1, -1, -1, 3, 3, 1, 1, 1, 3, 3, 1, -3, -3, -1, 1, -3, 1, 3, -3,
|
||||
/* 7 */ -3, -1, 1, -3, -3, 1, 1, -3, 3, -1, -1, -3, 1, 3, 1, -1, -3, -1, -3, 1, -3, -3, -3, -3,
|
||||
/* 8 */ -3, 1, -3, 1, -3, -3, 1, -3, 1, -3, -3, -3, -3, -3, 1, -3, -3, 1, 1, -3, 1, 1, -3, -3,
|
||||
/* 9 */ 3, -3, -3, -1, 3, 3, -3, -1, 3, 1, 1, 1, 3, -1, 3, -3, -1, 3, -1, 3, 1, -1, -3, -3,
|
||||
/* 10 */ -3, -3, -1, -1, -1, -3, 1, -1, -3, -1, 3, -3, 1, -3, 3, -3, 3, 3, 1, -1, -1, 1, -3, -3,
|
||||
/* 11 */ -3, -3, 3, 3, 1, -1, -1, -1, 1, -3, -1, 1, -1, 3, -3, -1, -3, -1, -1, 1, -3, 3, -1, -3,
|
||||
/* 12 */ -3, -3, 1, -1, 3, 3, -3, -1, 1, -1, -1, 1, 1, -1, -1, 3, -3, 1, -3, 1, -1, -1, -1, -3,
|
||||
/* 13 */ -3, 1, -3, 3, -1, -1, -1, -3, 3, 1, -1, -3, -1, 1, 3, -1, 1, -1, 1, -3, -3, -3, -3, -3,
|
||||
/* 14 */ -3, -3, -3, -1, 3, -3, 3, 1, 3, 1, -3, -1, -1, -3, 1, 1, 3, 1, -1, -3, 3, 1, 3, -3,
|
||||
/* 15 */ 1, 1, -1, -3, -1, 1, 1, -3, 1, -1, 1, -3, 3, -3, -3, 3, -1, -3, 1, 3, -3, 1, -3, -3,
|
||||
/* 16 */ -3, 3, -1, 3, -1, 3, 3, 1, 1, -3, 1, 3, -3, 3, -3, -3, -1, 1, 3, -3, -1, -1, -3, -3,
|
||||
/* 17 */ -1, -3, -3, 1, -1, -1, -3, 1, 3, -1, -3, -1, -1, -3, 1, 1, 3, 1, -3, -1, -1, 3, -3, -3,
|
||||
/* 18 */ -3, 1, -3, 1, -3, 1, 1, 3, 1, -3, -3, -1, 1, 3, -1, -3, 3, 1, -1, -3, -3, -3, -3, -3,
|
||||
/* 19 */ 3, -3, 3, -1, -3, 1, 3, 1, -1, -1, -3, -1, 3, -3, 3, -1, -1, 3, 3, -3, -3, 3, -3, -3,
|
||||
/* 20 */ -1, 3, -3, -3, -1, 3, -1, -1, 1, 3, 1, 3, -1, -1, -3, 1, 3, 1, -1, -3, 1, -1, -3, -3,
|
||||
/* 21 */ -3, 1, -3, -1, -1, 3, 1, 3, -3, 1, -1, 3, 3, -1, -3, 3, -3, -1, -1, -3, -3, -3, 3, -3,
|
||||
/* 22 */ -3, -1, -1, -3, 1, -3, -3, -1, -1, 3, -1, 1, -1, 3, 1, -3, -1, 3, 1, 1, -1, -1, -3, -3,
|
||||
/* 23 */ -3, 1, -3, 3, -3, 1, -3, 3, 1, -1, -3, -1, -3, -3, -3, -3, 1, 3, -1, 1, 3, 3, 3, -3,
|
||||
/* 24 */ -3, -1, 1, -3, -1, -1, 1, 1, 1, 3, 3, -1, 1, -1, 1, -1, -1, -3, -3, -3, 3, 1, -1, -3,
|
||||
/* 25 */ 3, -3, -1, 1, 3, -1, -1, -3, -1, 3, -1, -3, -1, -3, 3, -1, 3, 1, 1, -3, 3, -3, -3, -3,
|
||||
/* 26 */ -3, 1, 3, -1, 1, -1, 3, -3, 3, -1, -3, -1, -3, 3, -1, -1, -1, -3, -1, -1, -3, 3, 3, -3,
|
||||
/* 27 */ -3, 3, -1, -3, -1, -1, -1, 3, -1, -1, 3, -3, -1, 3, -3, 3, -3, -1, 3, 1, 1, -1, -3, -3,
|
||||
/* 28 */ -3, 1, -1, -3, -3, -1, 1, -3, -1, -3, 1, 1, -1, 1, 1, 3, 3, 3, -1, 1, -1, 1, -1, -3,
|
||||
/* 29 */ -1, 3, -1, -1, 3, 3, -1, -1, -1, 3, -1, -3, 1, 3, 1, 1, -3, -3, -3, -1, -3, -1, -3, -3,
|
||||
/* 0 */ -1, -3, 3, -1, 3, 1, 3, -1, 1, -3, -1, -3, -1, 1, 3, -3, -1, -3, 3, 3, 3, -3, -3, -3,
|
||||
/* 1 */ -1, -3, 3, 1, 1, -3, 1, -3, -3, 1, -3, -1, -1, 3, -3, 3, 3, 3, -3, 1, 3, 3, -3, -3,
|
||||
/* 2 */ -1, -3, -3, 1, -1, -1, -3, 1, 3, -1, -3, -1, -1, -3, 1, 1, 3, 1, -3, -1, -1, 3, -3, -3,
|
||||
/* 3 */ 1, -3, 3, -1, -3, -1, 3, 3, 1, -1, 1, 1, 3, -3, -1, -3, -3, -3, -1, 3, -3, -1, -3, -3,
|
||||
/* 4 */ -1, 3, -3, -3, -1, 3, -1, -1, 1, 3, 1, 3, -1, -1, -3, 1, 3, 1, -1, -3, 1, -1, -3, -3,
|
||||
/* 5 */ -3, -1, 1, -3, -3, 1, 1, -3, 3, -1, -1, -3, 1, 3, 1, -1, -3, -1, -3, 1, -3, -3, -3, -3,
|
||||
/* 6 */ -3, 3, 1, 3, -1, 1, -3, 1, -3, 1, -1, -3, -1, -3, -3, -3, -3, -1, -1, -1, 1, 1, -3, -3,
|
||||
/* 7 */ -3, 1, 3, -1, 1, -1, 3, -3, 3, -1, -3, -1, -3, 3, -1, -1, -1, -3, -1, -1, -3, 3, 3, -3,
|
||||
/* 8 */ -3, 1, -3, 3, -1, -1, -1, -3, 3, 1, -1, -3, -1, 1, 3, -1, 1, -1, 1, -3, -3, -3, -3, -3,
|
||||
/* 9 */ 1, 1, -1, -3, -1, 1, 1, -3, 1, -1, 1, -3, 3, -3, -3, 3, -1, -3, 1, 3, -3, 1, -3, -3,
|
||||
/* 10 */ -3, -3, -3, -1, 3, -3, 3, 1, 3, 1, -3, -1, -1, -3, 1, 1, 3, 1, -1, -3, 3, 1, 3, -3,
|
||||
/* 11 */ -3, 3, -1, 3, 1, -1, -1, -1, 3, 3, 1, 1, 1, 3, 3, 1, -3, -3, -1, 1, -3, 1, 3, -3,
|
||||
/* 12 */ 3, -3, 3, -1, -3, 1, 3, 1, -1, -1, -3, -1, 3, -3, 3, -1, -1, 3, 3, -3, -3, 3, -3, -3,
|
||||
/* 13 */ -3, 3, -1, 3, -1, 3, 3, 1, 1, -3, 1, 3, -3, 3, -3, -3, -1, 1, 3, -3, -1, -1, -3, -3,
|
||||
/* 14 */ -3, 1, -3, -1, -1, 3, 1, 3, -3, 1, -1, 3, 3, -1, -3, 3, -3, -1, -1, -3, -3, -3, 3, -3,
|
||||
/* 15 */ -3, -1, -1, -3, 1, -3, -3, -1, -1, 3, -1, 1, -1, 3, 1, -3, -1, 3, 1, 1, -1, -1, -3, -3,
|
||||
/* 16 */ -3, -3, 1, -1, 3, 3, -3, -1, 1, -1, -1, 1, 1, -1, -1, 3, -3, 1, -3, 1, -1, -1, -1, -3,
|
||||
/* 17 */ 3, -1, 3, -1, 1, -3, 1, 1, -3, -3, 3, -3, -1, -1, -1, -1, -1, -3, -3, -1, 1, 1, -3, -3,
|
||||
/* 18 */ 3, 1, -3, 1, -3, -3, 1, -3, 1, -3, -3, -3, -3, -3, 1, -3, -3, 1, 1, -3, 1, 1, -3, -3,
|
||||
/* 19 */ -3, -3, 3, 3, 1, -1, -1, -1, 1, -3, -1, 1, -1, 3, -3, -1, -3, -1, -1, 1, -3, 3, -1, -3,
|
||||
/* 20 */ -3, -3, -1, -1, -1, -3, 1, -1, -3, -1, 3, -3, 1, -3, 3, -3, 3, 3, 1, -1, -1, 1, -3, -3,
|
||||
/* 21 */ 3, -1, 1, -1, 3, -3, 1, 1, 3, -1, -3, 3, 1, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, -3,
|
||||
/* 22 */ -3, 1, -3, 3, -3, 1, -3, 3, 1, -1, -3, -1, -3, -3, -3, -3, 1, 3, -1, 1, 3, 3, 3, -3,
|
||||
/* 23 */ -3, -1, 1, -3, -1, -1, 1, 1, 1, 3, 3, -1, 1, -1, 1, -1, -1, -3, -3, -3, 3, 1, -1, -3,
|
||||
/* 24 */ -3, 3, -1, -3, -1, -1, -1, 3, -1, -1, 3, -3, -1, 3, -3, 3, -3, -1, 3, 1, 1, -1, -3, -3,
|
||||
/* 25 */ -3, 1, -1, -3, -3, -1, 1, -3, -1, -3, 1, 1, -1, 1, 1, 3, 3, 3, -1, 1, -1, 1, -1, -3,
|
||||
/* 26 */ -1, 3, -1, -1, 3, 3, -1, -1, -1, 3, -1, -3, 1, 3, 1, 1, -3, -3, -3, -1, -3, -1, -3, -3,
|
||||
/* 27 */ 3, -3, -3, -1, 3, 3, -3, -1, 3, 1, 1, 1, 3, -1, 3, -3, -1, 3, -1, 3, 1, -1, -3, -3,
|
||||
/* 28 */ -3, 1, -3, 1, -3, 1, 1, 3, 1, -3, -3, -1, 1, 3, -1, -3, 3, 1, -1, -3, -3, -3, -3, -3,
|
||||
/* 29 */ 3, -3, -1, 1, 3, -1, -1, -3, -1, 3, -1, -3, -1, -3, 3, -1, 3, 1, 1, -3, 3, -3, -3, -3,
|
||||
}
|
||||
#endif
|
||||
;
|
||||
|
||||
@@ -307,6 +307,24 @@ int nr_find_pucch(uint16_t rnti,
|
||||
int slot,
|
||||
PHY_VARS_gNB *gNB);
|
||||
|
||||
NR_gNB_SRS_t *new_gNB_srs(void);
|
||||
|
||||
int nr_find_srs(uint16_t rnti,
|
||||
int frame,
|
||||
int slot,
|
||||
PHY_VARS_gNB *gNB);
|
||||
|
||||
void nr_fill_srs(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_srs_pdu_t *srs_pdu);
|
||||
|
||||
int nr_get_srs_signal(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_received_signal);
|
||||
|
||||
void init_prach_list(PHY_VARS_gNB *gNB);
|
||||
void init_prach_ru_list(RU_t *ru);
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/NR_TRANSPORT/srs_rx.c
|
||||
* \brief Top-level routines for getting the SRS physical channel
|
||||
* \date 2021
|
||||
* \version 1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "PHY/impl_defs_nr.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include <openair1/PHY/CODING/nrSmallBlock/nr_small_block_defs.h>
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
//#define SRS_DEBUG
|
||||
|
||||
NR_gNB_SRS_t *new_gNB_srs(void){
|
||||
NR_gNB_SRS_t *srs;
|
||||
srs = (NR_gNB_SRS_t *)malloc16(sizeof(NR_gNB_SRS_t));
|
||||
srs->active = 0;
|
||||
return (srs);
|
||||
}
|
||||
|
||||
int nr_find_srs(uint16_t rnti,
|
||||
int frame,
|
||||
int slot,
|
||||
PHY_VARS_gNB *gNB) {
|
||||
|
||||
AssertFatal(gNB!=NULL,"gNB is null\n");
|
||||
int index = -1;
|
||||
|
||||
for (int i=0; i<NUMBER_OF_NR_SRS_MAX; i++) {
|
||||
AssertFatal(gNB->srs[i]!=NULL,"gNB->srs[%d] is null\n",i);
|
||||
if ((gNB->srs[i]->active>0) &&
|
||||
(gNB->srs[i]->srs_pdu.rnti==rnti) &&
|
||||
(gNB->srs[i]->frame==frame) &&
|
||||
(gNB->srs[i]->slot==slot)) return(i);
|
||||
else if ((gNB->srs[i]->active == 0) && (index==-1)) index=i;
|
||||
}
|
||||
|
||||
if (index==-1)
|
||||
LOG_E(MAC,"SRS list is full\n");
|
||||
|
||||
return(index);
|
||||
}
|
||||
|
||||
void nr_fill_srs(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_srs_pdu_t *srs_pdu) {
|
||||
|
||||
int id = nr_find_srs(srs_pdu->rnti,frame,slot,gNB);
|
||||
AssertFatal( (id>=0) && (id<NUMBER_OF_NR_SRS_MAX),
|
||||
"invalid id found for srs !!! rnti %04x id %d\n",srs_pdu->rnti,id);
|
||||
|
||||
NR_gNB_SRS_t *srs = gNB->srs[id];
|
||||
srs->frame = frame;
|
||||
srs->slot = slot;
|
||||
srs->active = 1;
|
||||
memcpy((void*)&srs->srs_pdu, (void*)srs_pdu, sizeof(nfapi_nr_srs_pdu_t));
|
||||
}
|
||||
|
||||
int nr_get_srs_signal(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_received_signal) {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
int32_t **rxdataF = gNB->common_vars.rxdataF;
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
|
||||
uint16_t n_symbols = (slot&3)*frame_parms->symbols_per_slot; // number of symbols until this slot
|
||||
uint8_t l0 = frame_parms->symbols_per_slot - 1 - srs_pdu->time_start_position; // starting symbol in this slot
|
||||
uint64_t symbol_offset = (n_symbols+l0)*frame_parms->ofdm_symbol_size;
|
||||
|
||||
int32_t *rx_signal;
|
||||
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));
|
||||
rx_signal = &rxdataF[ant][symbol_offset];
|
||||
|
||||
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]];
|
||||
|
||||
#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;
|
||||
if(subcarrier_log < 0) {
|
||||
subcarrier_log = subcarrier_log + frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
if(sc_idx == 0) {
|
||||
LOG_I(NR_PHY,"________ Rx antenna %i ________\n", ant);
|
||||
}
|
||||
if(subcarrier_log%12 == 0) {
|
||||
LOG_I(NR_PHY,"::::::::::::: %i :::::::::::::\n", subcarrier_log/12);
|
||||
}
|
||||
LOG_I(NR_PHY,"(%i) \t%i\t%i\n",
|
||||
subcarrier_log,
|
||||
(int16_t)(srs_received_signal[ant][nr_srs_info->sc_list[sc_idx]]&0xFFFF),
|
||||
(int16_t)((srs_received_signal[ant][nr_srs_info->sc_list[sc_idx]]>>16)&0xFFFF));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -260,3 +260,26 @@ short filt8_avlip5[8] = {
|
||||
|
||||
short filt8_avlip6[8] = {
|
||||
13653,15019,16384,16384,16384,16384,16384,16384};
|
||||
|
||||
// Comb size 2
|
||||
short filt8_start[8] = {
|
||||
12288,8192,4096,0,0,0,0,0};
|
||||
|
||||
short filt8_middle2[8] = {
|
||||
4096,8192,8192,8192,4096,0,0,0};
|
||||
|
||||
short filt8_middle4[8] = {
|
||||
0,0,4096,8192,8192,8192,4096,0};
|
||||
|
||||
short filt8_end[8] = {
|
||||
4096,8192,12288,16384,0,0,0,0};
|
||||
|
||||
// Comb size 4
|
||||
short filt16_start[16] = {
|
||||
12288,8192,8192,8192,4096,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16_middle4[16] = {
|
||||
4096,8192,8192,8192,8192,8192,8192,8192,4096,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16_end[16] = {
|
||||
4096,8192,8192,8192,12288,16384,16384,16384,0,0,0,0,0,0,0,0};
|
||||
@@ -182,4 +182,15 @@ extern short filt8_avlip4[8];
|
||||
extern short filt8_avlip5[8];
|
||||
|
||||
extern short filt8_avlip6[8];
|
||||
|
||||
/*Comb size 2*/
|
||||
extern short filt8_start[8];
|
||||
extern short filt8_middle2[8];
|
||||
extern short filt8_middle4[8];
|
||||
extern short filt8_end[8];
|
||||
|
||||
/*Comb size 4*/
|
||||
extern short filt16_start[16];
|
||||
extern short filt16_middle4[16];
|
||||
extern short filt16_end[16];
|
||||
#endif
|
||||
|
||||
@@ -32,9 +32,6 @@
|
||||
#include "PHY/phy_extern_nr_ue.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "nr_transport_proto_ue.h"
|
||||
//#include "SCHED/defs.h"
|
||||
//#include "PHY/defs.h"
|
||||
//#include "extern.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "T.h"
|
||||
#include "openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h"
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#undef DEFINE_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H
|
||||
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
//#include "extern.h"
|
||||
#include "PHY/NR_REFSIG/ss_pbch_nr.h"
|
||||
#include "PHY/NR_REFSIG/dmrs_nr.h"
|
||||
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
|
||||
@@ -47,11 +46,13 @@
|
||||
#include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h"
|
||||
#undef DEFINE_VARIABLES_SRS_MODULATION_NR_H
|
||||
|
||||
//#define SRS_DEBUG
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : generate_srs
|
||||
*
|
||||
* PARAMETERS : pointer to resource set
|
||||
* PARAMETERS : pointer to srs config pdu
|
||||
* pointer to transmit buffer
|
||||
* amplitude scaling for this physical signal
|
||||
* slot number of transmission
|
||||
@@ -73,84 +74,94 @@
|
||||
* - no antenna switching*
|
||||
*
|
||||
*********************************************************************/
|
||||
int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *txptr,
|
||||
int16_t amp,
|
||||
UE_nr_rxtx_proc_t *proc)
|
||||
int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *txptr,
|
||||
nr_srs_info_t *nr_srs_info,
|
||||
int16_t amp,
|
||||
int frame_number,
|
||||
int slot_number)
|
||||
{
|
||||
uint8_t n_SRS_cs_max;
|
||||
uint8_t u, v_nu;
|
||||
uint8_t u;
|
||||
uint8_t v_nu;
|
||||
uint32_t f_gh = 0;
|
||||
SRS_Resource_t *p_SRS_Resource;
|
||||
int frame_number = proc->frame_tx;
|
||||
int slot_number = proc->nr_slot_tx;
|
||||
uint16_t n_SRS, n_SRS_cs_i;
|
||||
uint16_t n_SRS;
|
||||
uint16_t n_SRS_cs_i;
|
||||
double alpha_i;
|
||||
uint8_t K_TC_p;
|
||||
uint16_t n_b[B_SRS_NUMBER], F_b, subcarrier;
|
||||
uint8_t N_b, k_0_overbar_p;
|
||||
uint16_t n_b[B_SRS_NUMBER];
|
||||
uint16_t F_b;
|
||||
uint16_t subcarrier;
|
||||
uint8_t N_b;
|
||||
uint8_t k_0_overbar_p;
|
||||
|
||||
if (p_srs_resource_set->p_srs_ResourceList[0] == NULL) {
|
||||
LOG_E(PHY,"generate_srs: No resource associated with the SRS resource set!\n");
|
||||
return (-1);
|
||||
}
|
||||
else {
|
||||
if (p_srs_resource_set->number_srs_Resource <= MAX_NR_OF_SRS_RESOURCES_PER_SET) {
|
||||
p_SRS_Resource = p_srs_resource_set->p_srs_ResourceList[0];
|
||||
}
|
||||
else {
|
||||
LOG_E(PHY,"generate_srs: resource number of this resource set %d exceeds maximum supported value %d!\n", p_srs_resource_set->number_srs_Resource, MAX_NR_OF_SRS_RESOURCES_PER_SET);
|
||||
return (-1);
|
||||
}
|
||||
// get parameters from srs_config_pdu
|
||||
uint8_t B_SRS = srs_config_pdu->bandwidth_index;
|
||||
uint8_t C_SRS = srs_config_pdu->config_index;
|
||||
uint8_t b_hop = srs_config_pdu->frequency_hopping;
|
||||
uint8_t K_TC = 2<<srs_config_pdu->comb_size;
|
||||
uint8_t K_TC_overbar = srs_config_pdu->comb_offset; // FFS_TODO_NR is this parameter for K_TC_overbar ??
|
||||
uint8_t n_SRS_cs = srs_config_pdu->cyclic_shift;
|
||||
uint8_t n_ID_SRS = srs_config_pdu->sequence_id;
|
||||
uint8_t n_shift = srs_config_pdu->frequency_position; // it adjusts the SRS allocation to align with the common resource block grid in multiples of four
|
||||
uint8_t n_RRC = srs_config_pdu->frequency_shift;
|
||||
uint8_t groupOrSequenceHopping = srs_config_pdu->group_or_sequence_hopping;
|
||||
uint8_t l_offset = srs_config_pdu->time_start_position;
|
||||
uint16_t T_SRS = srs_config_pdu->t_srs;
|
||||
uint16_t T_offset = srs_config_pdu->t_offset; // FFS_TODO_NR to check interface with RRC
|
||||
uint8_t R = 1<<srs_config_pdu->num_repetitions;
|
||||
uint8_t N_ap = 1<<srs_config_pdu->num_ant_ports; // antenna port for transmission
|
||||
uint8_t N_symb_SRS = 1<<srs_config_pdu->num_symbols; // consecutive OFDM symbols
|
||||
uint8_t l0 = frame_parms->symbols_per_slot - 1 - l_offset; // starting position in the time domain
|
||||
uint8_t k_0_p; // frequency domain starting position
|
||||
|
||||
uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_config_pdu->bwp_start*N_SC_RB;
|
||||
|
||||
if(nr_srs_info) {
|
||||
nr_srs_info->sc_list_length = 0;
|
||||
nr_srs_info->srs_generated_signal_bits = log2_approx(amp);
|
||||
}
|
||||
|
||||
if (p_srs_resource_set->resourceType != periodic) {
|
||||
LOG_E(PHY,"generate_srs: only SRS periodic is supported up to now!\n");
|
||||
return (-1);
|
||||
}
|
||||
/* get parameters from SRS resource configuration */
|
||||
uint8_t B_SRS = p_SRS_Resource->freqHopping_b_SRS;
|
||||
uint8_t C_SRS = p_SRS_Resource->freqHopping_c_SRS;
|
||||
uint8_t b_hop = p_SRS_Resource->freqHopping_b_hop;
|
||||
uint8_t K_TC = p_SRS_Resource->transmissionComb;
|
||||
uint8_t K_TC_overbar = p_SRS_Resource->combOffset; /* FFS_TODO_NR is this parameter for K_TC_overbar ?? */
|
||||
uint8_t n_SRS_cs = p_SRS_Resource->cyclicShift;
|
||||
uint8_t n_ID_SRS = p_SRS_Resource->sequenceId;
|
||||
uint8_t n_shift = p_SRS_Resource->freqDomainPosition; /* it adjusts the SRS allocation to align with the common resource block grid in multiples of four */
|
||||
uint8_t n_RRC = p_SRS_Resource->freqDomainShift;
|
||||
uint8_t groupOrSequenceHopping = p_SRS_Resource->groupOrSequenceHopping;
|
||||
|
||||
uint8_t l_offset = p_SRS_Resource->resourceMapping_startPosition;
|
||||
|
||||
uint16_t T_SRS = srs_period[p_SRS_Resource->SRS_Periodicity];
|
||||
uint16_t T_offset = p_SRS_Resource->SRS_Offset;; /* FFS_TODO_NR to check interface with RRC */
|
||||
uint8_t R = p_SRS_Resource->resourceMapping_repetitionFactor;
|
||||
|
||||
/* TS 38.211 6.4.1.4.1 SRS resource */
|
||||
uint8_t N_ap = (uint8_t)p_SRS_Resource->nrof_SrsPorts; /* antenna port for transmission */
|
||||
uint8_t N_symb_SRS = p_SRS_Resource->resourceMapping_nrofSymbols; /* consecutive OFDM symbols */
|
||||
uint8_t l0 = N_SYMB_SLOT - 1 - l_offset; /* starting position in the time domain */
|
||||
uint8_t k_0_p; /* frequency domain starting position */
|
||||
#ifdef SRS_DEBUG
|
||||
LOG_I(NR_PHY,"Frame = %i, slot = %i\n", frame_number, slot_number);
|
||||
LOG_I(NR_PHY,"B_SRS = %i\n", B_SRS);
|
||||
LOG_I(NR_PHY,"C_SRS = %i\n", C_SRS);
|
||||
LOG_I(NR_PHY,"b_hop = %i\n", b_hop);
|
||||
LOG_I(NR_PHY,"K_TC = %i\n", K_TC);
|
||||
LOG_I(NR_PHY,"K_TC_overbar = %i\n", K_TC_overbar);
|
||||
LOG_I(NR_PHY,"n_SRS_cs = %i\n", n_SRS_cs);
|
||||
LOG_I(NR_PHY,"n_ID_SRS = %i\n", n_ID_SRS);
|
||||
LOG_I(NR_PHY,"n_shift = %i\n", n_shift);
|
||||
LOG_I(NR_PHY,"n_RRC = %i\n", n_RRC);
|
||||
LOG_I(NR_PHY,"groupOrSequenceHopping = %i\n", groupOrSequenceHopping);
|
||||
LOG_I(NR_PHY,"l_offset = %i\n", l_offset);
|
||||
LOG_I(NR_PHY,"T_SRS = %i\n", T_SRS);
|
||||
LOG_I(NR_PHY,"T_offset = %i\n", T_offset);
|
||||
LOG_I(NR_PHY,"R = %i\n", R);
|
||||
LOG_I(NR_PHY,"N_ap = %i\n", N_ap);
|
||||
LOG_I(NR_PHY,"N_symb_SRS = %i\n", N_symb_SRS);
|
||||
LOG_I(NR_PHY,"l0 = %i\n", l0);
|
||||
#endif
|
||||
|
||||
if (N_ap != port1) {
|
||||
LOG_E(PHY, "generate_srs: this number of antenna ports %d is not yet supported!\n", N_ap);
|
||||
LOG_E(NR_PHY, "generate_srs: this number of antenna ports %d is not yet supported!\n", N_ap);
|
||||
return (-1);
|
||||
}
|
||||
if (N_symb_SRS != 1) {
|
||||
LOG_E(PHY, "generate_srs: this number of srs symbol %d is not yet supported!\n", N_symb_SRS);
|
||||
LOG_E(NR_PHY, "generate_srs: this number of srs symbol %d is not yet supported!\n", N_symb_SRS);
|
||||
return (-1);
|
||||
}
|
||||
if (groupOrSequenceHopping != neitherHopping) {
|
||||
LOG_E(PHY, "generate_srs: sequence hopping is not yet supported!\n");
|
||||
LOG_E(NR_PHY, "generate_srs: sequence hopping is not yet supported!\n");
|
||||
return (-1);
|
||||
}
|
||||
if (R == 0) {
|
||||
LOG_E(PHY, "generate_srs: this parameter repetition factor %d is not consistent !\n", R);
|
||||
LOG_E(NR_PHY, "generate_srs: this parameter repetition factor %d is not consistent !\n", R);
|
||||
return (-1);
|
||||
}
|
||||
else if (R > N_symb_SRS) {
|
||||
LOG_E(PHY, "generate_srs: R %d can not be greater than N_symb_SRS %d !\n", R, N_symb_SRS);
|
||||
LOG_E(NR_PHY, "generate_srs: R %d can not be greater than N_symb_SRS %d !\n", R, N_symb_SRS);
|
||||
return (-1);
|
||||
}
|
||||
/* see 38211 6.4.1.4.2 Sequence generation */
|
||||
@@ -163,15 +174,15 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
// delta = 1; /* delta = log2(K_TC) */
|
||||
}
|
||||
else {
|
||||
LOG_E(PHY, "generate_srs: SRS unknown value for K_TC %d !\n", K_TC);
|
||||
LOG_E(NR_PHY, "generate_srs: SRS unknown value for K_TC %d !\n", K_TC);
|
||||
return (-1);
|
||||
}
|
||||
if (n_SRS_cs >= n_SRS_cs_max) {
|
||||
LOG_E(PHY, "generate_srs: inconsistent parameter n_SRS_cs %d >= n_SRS_cs_max %d !\n", n_SRS_cs, n_SRS_cs_max);
|
||||
LOG_E(NR_PHY, "generate_srs: inconsistent parameter n_SRS_cs %d >= n_SRS_cs_max %d !\n", n_SRS_cs, n_SRS_cs_max);
|
||||
return (-1);
|
||||
}
|
||||
if (T_SRS == 0) {
|
||||
LOG_E(PHY, "generate_srs: inconsistent parameter T_SRS %d can not be equal to zero !\n", T_SRS);
|
||||
LOG_E(NR_PHY, "generate_srs: inconsistent parameter T_SRS %d can not be equal to zero !\n", T_SRS);
|
||||
return (-1);
|
||||
}
|
||||
else
|
||||
@@ -180,7 +191,7 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
while (srs_periodicity[index] != T_SRS) {
|
||||
index++;
|
||||
if (index == SRS_PERIODICITY) {
|
||||
LOG_E(PHY, "generate_srs: inconsistent parameter T_SRS %d not specified !\n", T_SRS);
|
||||
LOG_E(NR_PHY, "generate_srs: inconsistent parameter T_SRS %d not specified !\n", T_SRS);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -202,10 +213,9 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
/* A UE may be configured to transmit an SRS resource on adjacent symbols within the last six symbols of a slot, */
|
||||
/* where all antenna ports of the SRS resource are mapped to each symbol of the resource */
|
||||
|
||||
|
||||
uint8_t l = p_index;
|
||||
if (l >= N_symb_SRS) {
|
||||
LOG_E(PHY, "generate_srs: number of antenna ports %d and number of srs symbols %d are different !\n", N_ap, N_symb_SRS);
|
||||
LOG_E(NR_PHY, "generate_srs: number of antenna ports %d and number of srs symbols %d are different !\n", N_ap, N_symb_SRS);
|
||||
}
|
||||
|
||||
switch(groupOrSequenceHopping) {
|
||||
@@ -247,7 +257,7 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
}
|
||||
default:
|
||||
{
|
||||
LOG_E(PHY, "generate_srs: unknown hopping setting %d !\n", groupOrSequenceHopping);
|
||||
LOG_E(NR_PHY, "generate_srs: unknown hopping setting %d !\n", groupOrSequenceHopping);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -274,7 +284,7 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
N_b = 1;
|
||||
}
|
||||
/* periodicity and offset */
|
||||
if (p_srs_resource_set->resourceType == aperiodic) {
|
||||
if (srs_config_pdu->resource_type == aperiodic) {
|
||||
n_SRS = l/R;
|
||||
}
|
||||
else {
|
||||
@@ -315,7 +325,7 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
k_0_p += K_TC * M_sc_b_SRS * n_b[b];
|
||||
}
|
||||
|
||||
subcarrier = (frame_parms->first_carrier_offset) + k_0_p;
|
||||
subcarrier = subcarrier_offset + k_0_p;
|
||||
if (subcarrier>frame_parms->ofdm_symbol_size) {
|
||||
subcarrier -= frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
@@ -327,7 +337,7 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
}
|
||||
|
||||
if (ul_allocated_re[M_sc_b_SRS_index] != M_sc_b_SRS) {
|
||||
LOG_E(PHY, "generate_srs: srs uplink allocation %d can not be found! \n", M_sc_b_SRS);
|
||||
LOG_E(NR_PHY, "generate_srs: srs uplink allocation %d can not be found! \n", M_sc_b_SRS);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -363,13 +373,31 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
|
||||
txptr[subcarrier] = (real_amp & 0xFFFF) + ((imag_amp<<16)&0xFFFF0000);
|
||||
|
||||
if(nr_srs_info) {
|
||||
nr_srs_info->sc_list[nr_srs_info->sc_list_length] = subcarrier;
|
||||
nr_srs_info->sc_list_length++;
|
||||
}
|
||||
|
||||
#ifdef SRS_DEBUG
|
||||
int subcarrier_log = subcarrier-subcarrier_offset;
|
||||
if(subcarrier_log < 0) {
|
||||
subcarrier_log = subcarrier_log + frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
if( subcarrier_log%12 == 0 ) {
|
||||
LOG_I(NR_PHY,"------------ %d ------------\n", subcarrier_log/12);
|
||||
}
|
||||
LOG_I(NR_PHY,"(%d) \t%i\t%i\n", subcarrier_log, (int16_t)(real_amp&0xFFFF), (int16_t)(imag_amp&0xFFFF));
|
||||
#endif
|
||||
|
||||
subcarrier += (K_TC); /* subcarrier increment */
|
||||
|
||||
if (subcarrier >= frame_parms->ofdm_symbol_size)
|
||||
if (subcarrier >= frame_parms->ofdm_symbol_size) {
|
||||
subcarrier=subcarrier-frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
|
||||
}
|
||||
/* process next symbol */
|
||||
txptr = txptr + frame_parms->ofdm_symbol_size;
|
||||
//txptr = txptr + frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
|
||||
return (0);
|
||||
@@ -377,40 +405,7 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : is_srs_period_nr
|
||||
*
|
||||
* PARAMETERS : pointer to resource set
|
||||
* pointer to transmit buffer
|
||||
* amplitude scaling for this physical signal
|
||||
* slot number of transmission
|
||||
* RETURN : 0 if it is a valid slot for transmitting srs
|
||||
* -1 if srs should not be transmitted
|
||||
*
|
||||
* DESCRIPTION : for periodic,
|
||||
*
|
||||
*********************************************************************/
|
||||
int is_srs_period_nr(SRS_Resource_t *p_SRS_Resource, NR_DL_FRAME_PARMS *frame_parms, int frame_tx, int slot_tx)
|
||||
{
|
||||
uint16_t T_SRS = srs_period[p_SRS_Resource->SRS_Periodicity];
|
||||
uint16_t T_offset = p_SRS_Resource->SRS_Offset; /* FFS_TODO_NR to check interface */
|
||||
|
||||
if (T_offset > T_SRS) {
|
||||
LOG_E(PHY,"is_srs_occasion_nr: T_offset %d is greater than T_SRS %d!\n", T_offset, T_SRS);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
int16_t N_slot_frame = frame_parms->slots_per_frame;
|
||||
if ((N_slot_frame*frame_tx + slot_tx - T_offset)%T_SRS == 0) {
|
||||
return (0);
|
||||
}
|
||||
else {
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : ue_srs_procedure_nr
|
||||
* NAME : ue_srs_procedures_nr
|
||||
*
|
||||
* PARAMETERS : pointer to ue context
|
||||
* pointer to rxtx context*
|
||||
@@ -422,54 +417,51 @@ int is_srs_period_nr(SRS_Resource_t *p_SRS_Resource, NR_DL_FRAME_PARMS *frame_pa
|
||||
* send srs according to current configuration
|
||||
*
|
||||
*********************************************************************/
|
||||
int ue_srs_procedure_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t eNB_id)
|
||||
int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id)
|
||||
{
|
||||
|
||||
if(!ue->srs_vars[0]->active) {
|
||||
return -1;
|
||||
}
|
||||
ue->srs_vars[0]->active = false;
|
||||
|
||||
nfapi_nr_srs_pdu_t *srs_config_pdu = (nfapi_nr_srs_pdu_t*)&ue->srs_vars[0]->srs_config_pdu;
|
||||
|
||||
#ifdef SRS_DEBUG
|
||||
LOG_I(NR_PHY,"Frame = %i, slot = %i\n", proc->frame_tx, proc->nr_slot_tx);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->rnti = 0x%04x\n", srs_config_pdu->rnti);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->handle = %u\n", srs_config_pdu->handle);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->bwp_size = %u\n", srs_config_pdu->bwp_size);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->bwp_start = %u\n", srs_config_pdu->bwp_start);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->subcarrier_spacing = %u\n", srs_config_pdu->subcarrier_spacing);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->cyclic_prefix = %u (0: Normal; 1: Extended)\n", srs_config_pdu->cyclic_prefix);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->num_ant_ports = %u (0 = 1 port, 1 = 2 ports, 2 = 4 ports)\n", srs_config_pdu->num_ant_ports);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->num_symbols = %u (0 = 1 symbol, 1 = 2 symbols, 2 = 4 symbols)\n", srs_config_pdu->num_symbols);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->num_repetitions = %u (0 = 1, 1 = 2, 2 = 4)\n", srs_config_pdu->num_repetitions);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->time_start_position = %u\n", srs_config_pdu->time_start_position);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->config_index = %u\n", srs_config_pdu->config_index);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->sequence_id = %u\n", srs_config_pdu->sequence_id);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->bandwidth_index = %u\n", srs_config_pdu->bandwidth_index);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->comb_size = %u (0 = comb size 2, 1 = comb size 4, 2 = comb size 8)\n", srs_config_pdu->comb_size);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->comb_offset = %u\n", srs_config_pdu->comb_offset);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->cyclic_shift = %u\n", srs_config_pdu->cyclic_shift);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->frequency_position = %u\n", srs_config_pdu->frequency_position);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->frequency_shift = %u\n", srs_config_pdu->frequency_shift);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->frequency_hopping = %u\n", srs_config_pdu->frequency_hopping);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->group_or_sequence_hopping = %u (0 = No hopping, 1 = Group hopping groupOrSequenceHopping, 2 = Sequence hopping)\n", srs_config_pdu->group_or_sequence_hopping);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->resource_type = %u (0: aperiodic, 1: semi-persistent, 2: periodic)\n", srs_config_pdu->resource_type);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->t_srs = %u\n", srs_config_pdu->t_srs);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->t_offset = %u\n", srs_config_pdu->t_offset);
|
||||
#endif
|
||||
|
||||
NR_DL_FRAME_PARMS *frame_parms = &(ue->frame_parms);
|
||||
SRS_NR *p_srs_nr = &(ue->frame_parms.srs_nr);
|
||||
SRS_ResourceSet_t *p_srs_resource_set = frame_parms->srs_nr.p_SRS_ResourceSetList[p_srs_nr->active_srs_Resource_Set];
|
||||
int generate_srs = 0;
|
||||
uint16_t symbol_offset = (frame_parms->symbols_per_slot - 1 - srs_config_pdu->time_start_position)*frame_parms->ofdm_symbol_size;
|
||||
|
||||
/* is there any resource set which has been configurated ? */
|
||||
if (p_srs_nr->number_srs_Resource_Set != 0) {
|
||||
|
||||
/* what is the current active resource set ? */
|
||||
if (p_srs_nr->active_srs_Resource_Set > MAX_NR_OF_SRS_RESOURCE_SET) {
|
||||
LOG_W(PHY,"phy_procedures_UE_TX: srs active %d greater than maximum %d!\n", p_srs_nr->active_srs_Resource_Set, MAX_NR_OF_SRS_RESOURCE_SET);
|
||||
}
|
||||
else {
|
||||
/* SRS resource set configurated ? */
|
||||
if (p_srs_resource_set != NULL) {
|
||||
|
||||
SRS_Resource_t *p_srs_resource = frame_parms->srs_nr.p_SRS_ResourceSetList[p_srs_nr->active_srs_Resource_Set]->p_srs_ResourceList[0];
|
||||
|
||||
/* SRS resource configurated ? */
|
||||
if (p_srs_resource != NULL) {
|
||||
if (p_srs_resource_set->resourceType == periodic) {
|
||||
if (is_srs_period_nr(p_srs_resource, frame_parms, proc->frame_tx, proc->nr_slot_tx) == 0) {
|
||||
generate_srs = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG_W(PHY,"phy_procedures_UE_TX: no configurated srs resource!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (generate_srs == 1) {
|
||||
int16_t txptr = AMP;
|
||||
uint16_t nsymb = (ue->frame_parms.Ncp==0) ? 14:12;
|
||||
uint16_t symbol_offset = (int)ue->frame_parms.ofdm_symbol_size*((proc->nr_slot_tx*nsymb)+(nsymb-1));
|
||||
if (generate_srs_nr(p_srs_resource_set, frame_parms, &ue->common_vars.txdataF[eNB_id][symbol_offset], txptr, proc) == 0) {
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return (-1);
|
||||
if (generate_srs_nr(srs_config_pdu, frame_parms, &ue->common_vars.txdataF[gNB_id][symbol_offset], ue->nr_srs_info,
|
||||
AMP, proc->frame_tx, proc->nr_slot_tx) == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -136,15 +136,19 @@ EXTERN const uint16_t srs_periodicity[SRS_PERIODICITY]
|
||||
/** \brief This function generates the sounding reference symbol (SRS) for the uplink according to 38.211 6.4.1.4 Sounding reference signal
|
||||
@param frame_parms NR DL Frame parameters
|
||||
@param txdataF pointer to the frequency domain TX signal
|
||||
@param nr_srs_info pointer to the srs info structure
|
||||
@param amp amplitude of generated signal
|
||||
@param proc pointer to the transmit parameters
|
||||
@param frame_number frame number
|
||||
@param slot_number slot number
|
||||
@returns 0 on success -1 on error with message */
|
||||
|
||||
int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *txptr,
|
||||
int16_t amp,
|
||||
UE_nr_rxtx_proc_t *proc);
|
||||
int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *txptr,
|
||||
nr_srs_info_t *nr_srs_info,
|
||||
int16_t amp,
|
||||
int frame_number,
|
||||
int slot_number);
|
||||
|
||||
/** \brief This function checks for periodic srs if srs should be transmitted in this slot
|
||||
* @param p_SRS_Resource pointer to active resource
|
||||
@@ -155,13 +159,14 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
int is_srs_period_nr(SRS_Resource_t *p_SRS_Resource,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
int frame_tx, int slot_tx);
|
||||
|
||||
/** \brief This function processes srs configuration
|
||||
* @param ue context
|
||||
@param rxtx context
|
||||
@param current eNB identifier
|
||||
@param current gNB_id identifier
|
||||
@returns 0 if srs is transmitted -1 otherwise */
|
||||
|
||||
int ue_srs_procedure_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t eNB_id);
|
||||
int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id);
|
||||
|
||||
#undef EXTERN
|
||||
#undef INIT_VARIABLES_SRS_MODULATION_NR_H
|
||||
|
||||
@@ -397,6 +397,16 @@ typedef struct {
|
||||
nfapi_nr_pucch_pdu_t pucch_pdu;
|
||||
} NR_gNB_PUCCH_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t active;
|
||||
/// Frame where current SRS pdu was received
|
||||
uint32_t frame;
|
||||
/// Slot where current SRS pdu was received
|
||||
uint32_t slot;
|
||||
/// ULSCH PDU
|
||||
nfapi_nr_srs_pdu_t srs_pdu;
|
||||
} NR_gNB_SRS_t;
|
||||
|
||||
typedef struct {
|
||||
/// \brief Pointers (dynamic) to the received data in the time domain.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
@@ -757,6 +767,7 @@ typedef struct PHY_VARS_gNB_s {
|
||||
NR_gNB_PRACH prach_vars;
|
||||
NR_gNB_PUSCH *pusch_vars[NUMBER_OF_NR_ULSCH_MAX];
|
||||
NR_gNB_PUCCH_t *pucch[NUMBER_OF_NR_PUCCH_MAX];
|
||||
NR_gNB_SRS_t *srs[NUMBER_OF_NR_SRS_MAX];
|
||||
NR_gNB_PDCCH_t pdcch_pdu[NUMBER_OF_NR_PDCCH_MAX];
|
||||
NR_gNB_UL_PDCCH_t ul_pdcch_pdu[NUMBER_OF_NR_PDCCH_MAX];
|
||||
NR_gNB_DLSCH_t *dlsch[NUMBER_OF_NR_DLSCH_MAX][2]; // Nusers times two spatial streams
|
||||
@@ -770,6 +781,9 @@ typedef struct PHY_VARS_gNB_s {
|
||||
NR_gNB_UCI_STATS_t uci_stats[NUMBER_OF_NR_UCI_STATS_MAX];
|
||||
t_nrPolar_params *uci_polarParams;
|
||||
|
||||
/// SRS variables
|
||||
nr_srs_info_t *nr_srs_info[NUMBER_OF_NR_SRS_MAX];
|
||||
|
||||
uint8_t pbch_configured;
|
||||
char gNB_generate_rar;
|
||||
|
||||
|
||||
@@ -706,6 +706,11 @@ typedef struct {
|
||||
fapi_nr_ul_config_prach_pdu prach_pdu;
|
||||
} NR_UE_PRACH;
|
||||
|
||||
typedef struct {
|
||||
bool active;
|
||||
fapi_nr_ul_config_srs_pdu srs_config_pdu;
|
||||
} NR_UE_SRS;
|
||||
|
||||
// structure used for multiple SSB detection
|
||||
typedef struct NR_UE_SSB {
|
||||
uint8_t i_ssb; // i_ssb between 0 and 7 (it corresponds to ssb_index only for Lmax=4,8)
|
||||
@@ -815,6 +820,7 @@ typedef struct {
|
||||
NR_UE_PBCH *pbch_vars[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PDCCH *pdcch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_SRS *srs_vars[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PUSCH *pusch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PUCCH *pucch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_DLSCH_t *dlsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_CODEWORDS]; // two RxTx Threads
|
||||
@@ -967,6 +973,8 @@ typedef struct {
|
||||
/// PUSCH contention-based access vars
|
||||
PUSCH_CA_CONFIG_DEDICATED pusch_ca_config_dedicated[NUMBER_OF_eNB_MAX]; // lola
|
||||
|
||||
/// SRS variables
|
||||
nr_srs_info_t *nr_srs_info;
|
||||
|
||||
//#if defined(UPGRADE_RAT_NR)
|
||||
#if 1
|
||||
|
||||
@@ -107,6 +107,8 @@
|
||||
#define MAX_NUM_NR_ULSCH_SEGMENTS 34
|
||||
#define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056)
|
||||
|
||||
#define MAX_NUM_NR_SRS_SYMBOLS 4
|
||||
|
||||
#define MAX_NUM_NR_CHANNEL_BITS (14*273*12*8) // 14 symbols, 273 RB
|
||||
#define MAX_NUM_NR_RE (14*273*12)
|
||||
#define NR_RX_NB_TH 1
|
||||
@@ -249,6 +251,19 @@ typedef struct {
|
||||
uint8_t init_msg1;
|
||||
} NR_PRACH_RESOURCES_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t sc_list_length;
|
||||
uint16_t sc_list[6 * NR_MAX_NB_RB];
|
||||
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;
|
||||
} nr_srs_info_t;
|
||||
|
||||
typedef struct NR_DL_FRAME_PARMS NR_DL_FRAME_PARMS;
|
||||
|
||||
typedef uint32_t (*get_samples_per_slot_t)(int slot, NR_DL_FRAME_PARMS* fp);
|
||||
|
||||
@@ -211,10 +211,10 @@ typedef enum {
|
||||
srs_sl2560 = 16
|
||||
} SRS_Periodicity_t;
|
||||
|
||||
#define NB_SRS_PERIOD (17)
|
||||
#define NB_SRS_PERIOD (18)
|
||||
|
||||
static const uint16_t srs_period[NB_SRS_PERIOD]
|
||||
= { 1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 160, 320, 640, 1280, 2560}
|
||||
= { 0, 1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 160, 320, 640, 1280, 2560}
|
||||
;
|
||||
|
||||
/// SRS_Resource of SRS_Config information element from 38.331 RRC specifications
|
||||
|
||||
@@ -227,6 +227,10 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
nr_fill_prach(gNB, UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
|
||||
if (gNB->RU_list[0]->if_south == LOCAL_RF) nr_fill_prach_ru(gNB->RU_list[0], UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nr_fill_srs(gNB,UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].srs_pdu);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,19 +19,13 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "sched_nr.h"
|
||||
#include "PHY/NR_REFSIG/dmrs_nr.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dci.h"
|
||||
#include "PHY/NR_ESTIMATION/nr_ul_estimation.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/pucch_nr.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "sched_nr.h"
|
||||
#include "SCHED/sched_common_extern.h"
|
||||
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h"
|
||||
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
|
||||
#include "fapi_nr_l1.h"
|
||||
@@ -39,6 +33,7 @@
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/MODULATION/nr_modulation.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h"
|
||||
#include "T.h"
|
||||
#include "executables/nr-softmodem.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
@@ -183,7 +178,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
|
||||
|
||||
for (int i=0;i<NUMBER_OF_NR_CSIRS_MAX;i++){
|
||||
NR_gNB_CSIRS_t *csirs = &msgTx->csirs_pdu[i];
|
||||
if ((csirs->active == 1)) {
|
||||
if (csirs->active == 1) {
|
||||
LOG_D(PHY, "CSI-RS generation started in frame %d.%d\n",frame,slot);
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params = csirs->csirs_pdu.csi_rs_pdu_rel15;
|
||||
nr_generate_csi_rs(gNB, AMP, csi_params, gNB->gNB_config.cell_config.phy_cell_id.value, slot);
|
||||
@@ -205,17 +200,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
if ((cfg->subframe_config.duplex_mode.value == TDD) &&
|
||||
((nr_slot_select(fp,frame,slot)&NR_DOWNLINK_SLOT)==SF_DL)) return;
|
||||
|
||||
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1);
|
||||
|
||||
*/
|
||||
|
||||
void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
|
||||
ldpcDecode_t *rdata = (ldpcDecode_t*) NotifiedFifoData(req);
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq;
|
||||
@@ -601,6 +585,20 @@ void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0;i<NUMBER_OF_NR_SRS_MAX;i++) {
|
||||
NR_gNB_SRS_t *srs = gNB->srs[i];
|
||||
if (srs) {
|
||||
if ((srs->active == 1) && (srs->frame == frame_rx) && (srs->slot == slot_rx)) {
|
||||
nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu;
|
||||
for(int symbol = 0; symbol<(1<<srs_pdu->num_symbols); symbol++) {
|
||||
for(rb = srs_pdu->bwp_start; rb < (srs_pdu->bwp_start+srs_pdu->bwp_size); rb++) {
|
||||
gNB->rb_mask_ul[gNB->frame_parms.symbols_per_slot-srs_pdu->time_start_position-1+symbol][rb>>5] |= 1<<(rb&31);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
@@ -808,6 +806,43 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0;i<NUMBER_OF_NR_SRS_MAX;i++) {
|
||||
NR_gNB_SRS_t *srs = gNB->srs[i];
|
||||
if (srs) {
|
||||
if ((srs->active == 1) && (srs->frame == frame_rx) && (srs->slot == slot_rx)) {
|
||||
|
||||
LOG_D(NR_PHY, "(%d.%d) gNB is waiting for SRS, id = %i\n", frame_rx, slot_rx, i);
|
||||
|
||||
nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu;
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
nr_get_srs_signal(gNB,frame_rx,slot_rx,srs_pdu, gNB->nr_srs_info[i], 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);
|
||||
|
||||
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(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)));
|
||||
|
||||
srs->active = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stop_meas(&gNB->phy_proc_rx);
|
||||
// figure out a better way to choose slot_rx, 19 is ok for a particular TDD configuration with 30kHz SCS
|
||||
if ((frame_rx&127) == 0 && slot_rx==19) {
|
||||
|
||||
@@ -358,31 +358,12 @@ int16_t nr_pucch_power_cntl(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t s
|
||||
*/
|
||||
void nr_pusch_power_cntl(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t j, uint8_t abstraction_flag);
|
||||
|
||||
/*! \brief This function implements the power control mechanism for SRS from 36.213.
|
||||
@param phy_vars_ue PHY variables
|
||||
@param proc Pointer to proc descriptor
|
||||
@param eNB_id Index of eNB
|
||||
@param j index of type of PUSCH (SPS, Normal, Msg3)
|
||||
@returns Transmit power
|
||||
*/
|
||||
void nr_srs_power_cntl(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t *pnb_rb_srs, uint8_t abstraction_flag);
|
||||
|
||||
void nr_get_cqipmiri_params(PHY_VARS_NR_UE *ue,uint8_t eNB_id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void nr_dump_dlsch(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
|
||||
void nr_dump_dlsch_SI(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
||||
void nr_dump_dlsch_ra(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
||||
|
||||
|
||||
int nr_is_srs_occasion_common(NR_DL_FRAME_PARMS *frame_parms,int frame_tx,int subframe_tx);
|
||||
|
||||
void nr_compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
|
||||
|
||||
void set_tx_harq_id(NR_UE_ULSCH_t *ulsch, int harq_pid, int slot_tx);
|
||||
int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx);
|
||||
|
||||
|
||||
@@ -336,6 +336,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
/* PUCCH */
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_config_pdu;
|
||||
LOG_D(PHY, "%d.%d ul B ul_config %p t %d pdu_done %d number_pdus %d\n", scheduled_response->frame, slot, ul_config, pdu_type, pdu_done, ul_config->number_pdus);
|
||||
/* SRS */
|
||||
fapi_nr_ul_config_srs_pdu *srs_config_pdu;
|
||||
|
||||
switch (pdu_type){
|
||||
|
||||
@@ -411,6 +413,15 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
LOG_D(PHY, "%d.%d ul A ul_config %p t %d pdu_done %d number_pdus %d\n", scheduled_response->frame, slot, ul_config, pdu_type, pdu_done, ul_config->number_pdus);
|
||||
break;
|
||||
|
||||
case (FAPI_NR_UL_CONFIG_TYPE_SRS):
|
||||
// srs config pdu
|
||||
srs_config_pdu = &ul_config->ul_config_list[i].srs_config_pdu;
|
||||
memcpy((void*)&(PHY_vars_UE_g[module_id][cc_id]->srs_vars[gNB_id]->srs_config_pdu), (void*)srs_config_pdu, sizeof(fapi_nr_ul_config_srs_pdu));
|
||||
PHY_vars_UE_g[module_id][cc_id]->srs_vars[gNB_id]->active = true;
|
||||
ul_config->ul_config_list[i].pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more
|
||||
pdu_done++;
|
||||
break;
|
||||
|
||||
default:
|
||||
ul_config->ul_config_list[i].pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more
|
||||
pdu_done++; // count the no of pdu processed
|
||||
|
||||
@@ -38,15 +38,12 @@
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "PHY/phy_extern_nr_ue.h"
|
||||
#include "PHY/MODULATION/modulation_UE.h"
|
||||
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||
#include "SCHED_NR_UE/defs.h"
|
||||
#include "SCHED_NR_UE/pucch_uci_ue_nr.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h"
|
||||
#include "SCHED_NR/extern.h"
|
||||
#include "SCHED_NR_UE/phy_sch_processing_time.h"
|
||||
#include "PHY/NR_UE_ESTIMATION/nr_estimation.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dci.h"
|
||||
#ifdef EMOS
|
||||
#include "SCHED/phy_procedures_emos.h"
|
||||
#endif
|
||||
@@ -60,6 +57,7 @@
|
||||
//#define NR_PDCCH_SCHED_DEBUG
|
||||
//#define NR_PUCCH_SCHED
|
||||
//#define NR_PUCCH_SCHED_DEBUG
|
||||
//#define NR_PDSCH_DEBUG
|
||||
|
||||
#ifndef PUCCH
|
||||
#define PUCCH
|
||||
@@ -284,16 +282,17 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
|
||||
|
||||
LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
|
||||
|
||||
|
||||
start_meas(&ue->phy_proc_tx);
|
||||
|
||||
if (ue->UE_mode[gNB_id] <= PUSCH){
|
||||
|
||||
for (uint8_t harq_pid = 0; harq_pid < ue->ulsch[proc->thread_id][gNB_id][0]->number_harq_processes_for_pusch; harq_pid++) {
|
||||
if (ue->ulsch[proc->thread_id][gNB_id][0]->harq_processes[harq_pid]->status == ACTIVE)
|
||||
nr_ue_ulsch_procedures(ue, harq_pid, frame_tx, slot_tx, proc->thread_id, gNB_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (ue->UE_mode[gNB_id] == PUSCH) {
|
||||
ue_srs_procedures_nr(ue, proc, gNB_id);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
|
||||
@@ -1948,7 +1947,6 @@ stop_meas(&ue->phy_proc_rx[proc->thread_id]);
|
||||
if (cpumeas(CPUMEAS_GETSTATE))
|
||||
LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0));
|
||||
|
||||
|
||||
//#endif //pdsch
|
||||
|
||||
LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_slot_rx);
|
||||
|
||||
@@ -777,7 +777,7 @@ int main(int argc, char **argv)
|
||||
|
||||
prepare_scd(scd);
|
||||
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 6, 0, 0, 0);
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 6, 0, 0, 0, 0);
|
||||
|
||||
/* RRC parameter validation for secondaryCellGroup */
|
||||
fix_scd(scd);
|
||||
|
||||
@@ -720,7 +720,7 @@ int main(int argc, char **argv)
|
||||
|
||||
prepare_scd(scd);
|
||||
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0);
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0, 0);
|
||||
|
||||
// xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup);
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ int test_srs_periodicity(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc)
|
||||
for (int slot_tx = 0; slot_tx < frame_parms->slots_per_frame; slot_tx++) {
|
||||
proc->frame_tx = frame_tx;
|
||||
proc->nr_slot_tx = slot_tx;
|
||||
if (ue_srs_procedure_nr( ue, proc, 0) == 0) {
|
||||
if (ue_srs_procedures_nr( ue, proc, 0) == 0) {
|
||||
printf("test_srs_periodicity srs at frame %d slot %d \n", frame_tx, slot_tx);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user