Commit 0518ced8 authored by frtabu's avatar frtabu

dft/idft in shared lib

parents 4649034b 296494ea
...@@ -1373,7 +1373,7 @@ set(PHY_SRC_COMMON ...@@ -1373,7 +1373,7 @@ set(PHY_SRC_COMMON
${OPENAIR1_DIR}/PHY/INIT/lte_parms.c ${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c ${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c ${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
# ${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c ${OPENAIR1_DIR}/PHY/TOOLS/dfts_load.c
${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c ${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c ${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c
${OPENAIR1_DIR}/PHY/TOOLS/cmult_vv.c ${OPENAIR1_DIR}/PHY/TOOLS/cmult_vv.c
......
...@@ -38,7 +38,7 @@ int phy_init_RU(RU_t *ru) { ...@@ -38,7 +38,7 @@ int phy_init_RU(RU_t *ru) {
LTE_DL_FRAME_PARMS *fp = ru->frame_parms; LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
RU_CALIBRATION *calibration = &ru->calibration; RU_CALIBRATION *calibration = &ru->calibration;
int i,j,p,re; int i,j,p,re;
init_dfts(); //load_dftslib();
LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d\n",ru_if_types[ru->if_south],ru->nb_tx); LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d\n",ru_if_types[ru->if_south],ru->nb_tx);
if (ru->is_slave == 1) { if (ru->is_slave == 1) {
...@@ -76,7 +76,7 @@ int phy_init_RU(RU_t *ru) { ...@@ -76,7 +76,7 @@ int phy_init_RU(RU_t *ru) {
} }
if (ru->function != NGFI_RRU_IF5) { // we need to do RX/TX RU processing if (ru->function != NGFI_RRU_IF5) { // we need to do RX/TX RU processing
init_dfts(); load_dftslib();
init_7_5KHz(); init_7_5KHz();
LOG_I(PHY,"nb_tx %d\n",ru->nb_tx); LOG_I(PHY,"nb_tx %d\n",ru->nb_tx);
ru->common.rxdata_7_5kHz = (int32_t **)malloc16(ru->nb_rx*sizeof(int32_t *) ); ru->common.rxdata_7_5kHz = (int32_t **)malloc16(ru->nb_rx*sizeof(int32_t *) );
......
...@@ -625,7 +625,7 @@ int init_lte_ue_signal(PHY_VARS_UE *ue, ...@@ -625,7 +625,7 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
int th_id; int th_id;
LOG_D(PHY,"Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx); LOG_D(PHY,"Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx);
crcTableInit(); crcTableInit();
init_dfts(); load_dftslib();
init_frame_parms(&ue->frame_parms,1); init_frame_parms(&ue->frame_parms,1);
lte_sync_time_init(&ue->frame_parms); lte_sync_time_init(&ue->frame_parms);
init_lte_top(&ue->frame_parms); init_lte_top(&ue->frame_parms);
......
...@@ -96,7 +96,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, ...@@ -96,7 +96,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
while(gNB->configured == 0) usleep(10000); while(gNB->configured == 0) usleep(10000);
init_dfts(); load_dftslib();
/* /*
LOG_I(PHY,"[gNB %"PRIu8"] Initializing DL_FRAME_PARMS : N_RB_DL %"PRIu8", PHICH Resource %d, PHICH Duration %d nb_antennas_tx:%u nb_antennas_rx:%u PRACH[rootSequenceIndex:%u prach_Config_enabled:%u configIndex:%u highSpeed:%u zeroCorrelationZoneConfig:%u freqOffset:%u]\n", LOG_I(PHY,"[gNB %"PRIu8"] Initializing DL_FRAME_PARMS : N_RB_DL %"PRIu8", PHICH Resource %d, PHICH Duration %d nb_antennas_tx:%u nb_antennas_rx:%u PRACH[rootSequenceIndex:%u prach_Config_enabled:%u configIndex:%u highSpeed:%u zeroCorrelationZoneConfig:%u freqOffset:%u]\n",
gNB->Mod_id, gNB->Mod_id,
...@@ -112,7 +112,6 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, ...@@ -112,7 +112,6 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
);*/ );*/
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_gNB][MOD %02"PRIu8"][]\n", gNB->Mod_id); LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_gNB][MOD %02"PRIu8"][]\n", gNB->Mod_id);
crcTableInit(); crcTableInit();
init_dfts();
load_nrLDPClib(); load_nrLDPClib();
// PBCH DMRS gold sequences generation // PBCH DMRS gold sequences generation
nr_init_pbch_dmrs(gNB); nr_init_pbch_dmrs(gNB);
......
...@@ -988,7 +988,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue, ...@@ -988,7 +988,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,
void phy_init_nr_top(PHY_VARS_NR_UE *ue) { void phy_init_nr_top(PHY_VARS_NR_UE *ue) {
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
crcTableInit(); crcTableInit();
init_dfts(); load_dftslib();
init_context_synchro_nr(frame_parms); init_context_synchro_nr(frame_parms);
generate_ul_reference_signal_sequences(SHRT_MAX); generate_ul_reference_signal_sequences(SHRT_MAX);
// Polar encoder init for PBCH // Polar encoder init for PBCH
......
...@@ -657,35 +657,35 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, ...@@ -657,35 +657,35 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
} }
} }
void (*idft)(int16_t *,int16_t *, int); idft_size_idx_t idftsizeidx;
switch (ue->frame_parms.ofdm_symbol_size) { switch (ue->frame_parms.ofdm_symbol_size) {
case 128: case 128:
idft = idft128; idftsizeidx = IDFT_128;
break; break;
case 256: case 256:
idft = idft256; idftsizeidx = IDFT_256;
break; break;
case 512: case 512:
idft = idft512; idftsizeidx = IDFT_512;
break; break;
case 1024: case 1024:
idft = idft1024; idftsizeidx = IDFT_1024;
break; break;
case 1536: case 1536:
idft = idft1536; idftsizeidx = IDFT_1536;
break; break;
case 2048: case 2048:
idft = idft2048; idftsizeidx = IDFT_2048;
break; break;
default: default:
idft = idft512; idftsizeidx = IDFT_512;
break; break;
} }
...@@ -695,7 +695,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, ...@@ -695,7 +695,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) { for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx]) { if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx]) {
//LOG_I(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d \n", Ns, ue->current_thread_id[Ns>>1], l); //LOG_I(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d \n", Ns, ue->current_thread_id[Ns>>1], l);
idft((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8], idft(idftsizeidx,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1); (int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
} }
} }
......
...@@ -724,31 +724,31 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue, ...@@ -724,31 +724,31 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa]) { if (ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa]) {
switch (ue->frame_parms.N_RB_DL) { switch (ue->frame_parms.N_RB_DL) {
case 6: case 6:
idft128((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8], idft(IDFT_128,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa], (int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa],
1); 1);
break; break;
case 25: case 25:
idft512((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8], idft(IDFT_512,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa], (int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa],
1); 1);
break; break;
case 50: case 50:
idft1024((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8], idft(IDFT_1024,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa], (int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa],
1); 1);
break; break;
case 75: case 75:
idft1536((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8], idft(IDFT_1536,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa], (int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa],
1); 1);
break; break;
case 100: case 100:
idft2048((int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8], idft(IDFT_2048,(int16_t *) &ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_offset][aa][8],
(int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa], (int16_t *) ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_offset][aa],
1); 1);
break; break;
......
...@@ -80,7 +80,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) ...@@ -80,7 +80,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
while (1) { while (1) {
//compute frequency-domain representation of 6144-sample chunk //compute frequency-domain representation of 6144-sample chunk
dft6144((int16_t *)rxp, dft(DFT_6144,(int16_t *)rxp,
sp,1); sp,1);
...@@ -267,7 +267,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) ...@@ -267,7 +267,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
} }
// ifft, accumulate energy over two half-frames // ifft, accumulate energy over two half-frames
idft256((int16_t*)autocorr0,(int16_t*)tmp_t,1); idft(IDFT_256,(int16_t*)autocorr0,(int16_t*)tmp_t,1);
/* /*
if (i==12288) { if (i==12288) {
sprintf(fname,"corr256F_%d.m",abs(f)); sprintf(fname,"corr256F_%d.m",abs(f));
...@@ -285,12 +285,12 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) ...@@ -285,12 +285,12 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
for (re=0; re<(256/4); re++) for (re=0; re<(256/4); re++)
autocorr0_t[re] = _mm_add_epi32(autocorr0_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re])); autocorr0_t[re] = _mm_add_epi32(autocorr0_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
idft256((int16_t*)autocorr1,(int16_t*)tmp_t,1); idft(IDFT_256,(int16_t*)autocorr1,(int16_t*)tmp_t,1);
for (re=0; re<(256/4); re++) for (re=0; re<(256/4); re++)
autocorr1_t[re] = _mm_add_epi32(autocorr1_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re])); autocorr1_t[re] = _mm_add_epi32(autocorr1_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
idft256((int16_t*)autocorr2,(int16_t*)tmp_t,1); idft(IDFT_256,(int16_t*)autocorr2,(int16_t*)tmp_t,1);
for (re=0; re<(256/4); re++) for (re=0; re<(256/4); re++)
autocorr2_t[re] = _mm_add_epi32(autocorr2_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re])); autocorr2_t[re] = _mm_add_epi32(autocorr2_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
......
...@@ -338,11 +338,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -338,11 +338,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
switch (ue->frame_parms.N_RB_UL) { switch (ue->frame_parms.N_RB_UL) {
case 6: case 6:
if (prach_fmt == 4) { if (prach_fmt == 4) {
idft256(prachF,prach2,1); idft(IDFT_256,prachF,prach2,1);
memmove( prach, prach+512, Ncp<<2 ); memmove( prach, prach+512, Ncp<<2 );
prach_len = 256+Ncp; prach_len = 256+Ncp;
} else { } else {
idft1536(prachF,prach2,1); idft(IDFT_1536,prachF,prach2,1);
memmove( prach, prach+3072, Ncp<<2 ); memmove( prach, prach+3072, Ncp<<2 );
prach_len = 1536+Ncp; prach_len = 1536+Ncp;
...@@ -356,12 +356,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -356,12 +356,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
case 15: case 15:
if (prach_fmt == 4) { if (prach_fmt == 4) {
idft512(prachF,prach2,1); idft(IDFT_512,prachF,prach2,1);
//TODO: account for repeated format in dft output //TODO: account for repeated format in dft output
memmove( prach, prach+1024, Ncp<<2 ); memmove( prach, prach+1024, Ncp<<2 );
prach_len = 512+Ncp; prach_len = 512+Ncp;
} else { } else {
idft3072(prachF,prach2,1); idft(IDFT_3072,prachF,prach2,1);
memmove( prach, prach+6144, Ncp<<2 ); memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp; prach_len = 3072+Ncp;
...@@ -376,11 +376,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -376,11 +376,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
case 25: case 25:
default: default:
if (prach_fmt == 4) { if (prach_fmt == 4) {
idft1024(prachF,prach2,1); idft(IDFT_1024,prachF,prach2,1);
memmove( prach, prach+2048, Ncp<<2 ); memmove( prach, prach+2048, Ncp<<2 );
prach_len = 1024+Ncp; prach_len = 1024+Ncp;
} else { } else {
idft6144(prachF,prach2,1); idft(IDFT_6144,prachF,prach2,1);
/*for (i=0;i<6144*2;i++) /*for (i=0;i<6144*2;i++)
prach2[i]<<=1;*/ prach2[i]<<=1;*/
memmove( prach, prach+12288, Ncp<<2 ); memmove( prach, prach+12288, Ncp<<2 );
...@@ -396,11 +396,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -396,11 +396,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
case 50: case 50:
if (prach_fmt == 4) { if (prach_fmt == 4) {
idft2048(prachF,prach2,1); idft(IDFT_2048,prachF,prach2,1);
memmove( prach, prach+4096, Ncp<<2 ); memmove( prach, prach+4096, Ncp<<2 );
prach_len = 2048+Ncp; prach_len = 2048+Ncp;
} else { } else {
idft12288(prachF,prach2,1); idft(IDFT_12288,prachF,prach2,1);
memmove( prach, prach+24576, Ncp<<2 ); memmove( prach, prach+24576, Ncp<<2 );
prach_len = 12288+Ncp; prach_len = 12288+Ncp;
...@@ -414,12 +414,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -414,12 +414,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
case 75: case 75:
if (prach_fmt == 4) { if (prach_fmt == 4) {
idft3072(prachF,prach2,1); idft(IDFT_3072,prachF,prach2,1);
//TODO: account for repeated format in dft output //TODO: account for repeated format in dft output
memmove( prach, prach+6144, Ncp<<2 ); memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp; prach_len = 3072+Ncp;
} else { } else {
idft18432(prachF,prach2,1); idft(IDFT_18432,prachF,prach2,1);
memmove( prach, prach+36864, Ncp<<2 ); memmove( prach, prach+36864, Ncp<<2 );
prach_len = 18432+Ncp; prach_len = 18432+Ncp;
...@@ -434,11 +434,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -434,11 +434,11 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
case 100: case 100:
if (ue->frame_parms.threequarter_fs == 0) { if (ue->frame_parms.threequarter_fs == 0) {
if (prach_fmt == 4) { if (prach_fmt == 4) {
idft4096(prachF,prach2,1); idft(IDFT_4096,prachF,prach2,1);
memmove( prach, prach+8192, Ncp<<2 ); memmove( prach, prach+8192, Ncp<<2 );
prach_len = 4096+Ncp; prach_len = 4096+Ncp;
} else { } else {
idft24576(prachF,prach2,1); idft(IDFT_24576,prachF,prach2,1);
memmove( prach, prach+49152, Ncp<<2 ); memmove( prach, prach+49152, Ncp<<2 );
prach_len = 24576+Ncp; prach_len = 24576+Ncp;
...@@ -449,12 +449,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 ...@@ -449,12 +449,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
} }
} else { } else {
if (prach_fmt == 4) { if (prach_fmt == 4) {
idft3072(prachF,prach2,1); idft(IDFT_3072,prachF,prach2,1);
//TODO: account for repeated format in dft output //TODO: account for repeated format in dft output
memmove( prach, prach+6144, Ncp<<2 ); memmove( prach, prach+6144, Ncp<<2 );
prach_len = 3072+Ncp; prach_len = 3072+Ncp;
} else { } else {
idft18432(prachF,prach2,1); idft(IDFT_18432,prachF,prach2,1);
memmove( prach, prach+36864, Ncp<<2 ); memmove( prach, prach+36864, Ncp<<2 );
prach_len = 18432+Ncp; prach_len = 18432+Ncp;
printf("Generated prach for 100 PRB, 3/4 sampling\n"); printf("Generated prach for 100 PRB, 3/4 sampling\n");
......
...@@ -242,7 +242,7 @@ void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH) ...@@ -242,7 +242,7 @@ void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH)
switch (Msc_PUSCH) { switch (Msc_PUSCH) {
case 12: case 12:
dft12((int16_t *)dft_in0, (int16_t *)dft_out0); dft(DFT_12,(int16_t *)dft_in0, (int16_t *)dft_out0,0);
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
norm128 = _mm_set1_epi16(9459); norm128 = _mm_set1_epi16(9459);
...@@ -260,135 +260,135 @@ void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH) ...@@ -260,135 +260,135 @@ void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH)
break; break;
case 24: case 24:
dft24((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_24,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 36: case 36:
dft36((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_36,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 48: case 48:
dft48((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_48,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 60: case 60:
dft60((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_60,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 72: case 72:
dft72((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_72,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 96: case 96:
dft96((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_96,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 108: case 108:
dft108((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_108,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 120: case 120:
dft120((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_120,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 144: case 144:
dft144((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_144,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 180: case 180:
dft180((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_180,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 192: case 192:
dft192((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_192,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 216: case 216:
dft216((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_216,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 240: case 240:
dft240((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_240,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 288: case 288:
dft288((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_288,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 300: case 300:
dft300((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_300,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 324: case 324:
dft324((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_324,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 360: case 360:
dft360((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_360,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 384: case 384:
dft384((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_384,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 432: case 432:
dft432((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_432,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 480: case 480:
dft480((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_480,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 540: case 540:
dft540((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_540,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 576: case 576:
dft576((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_576,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 600: case 600:
dft600((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_600,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 648: case 648:
dft648((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_648,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 720: case 720:
dft720((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_720,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 768: case 768:
dft768((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_768,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 864: case 864:
dft864((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_864,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 900: case 900:
dft900((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_900,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 960: case 960:
dft960((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_960,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 972: case 972:
dft972((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_960,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 1080: case 1080:
dft1080((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_1080,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 1152: case 1152:
dft1152((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_1152,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
case 1200: case 1200:
dft1200((int16_t*)dft_in0, (int16_t*)dft_out0, 1); dft(DFT_1200,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
break; break;
} }
......
...@@ -49,36 +49,36 @@ int slot_fep(PHY_VARS_UE *ue, ...@@ -49,36 +49,36 @@ int slot_fep(PHY_VARS_UE *ue,
unsigned char harq_pid = dlsch_ue[0]->current_harq_pid; unsigned char harq_pid = dlsch_ue[0]->current_harq_pid;
LTE_DL_UE_HARQ_t *dlsch0_harq = dlsch_ue[0]->harq_processes[harq_pid]; LTE_DL_UE_HARQ_t *dlsch0_harq = dlsch_ue[0]->harq_processes[harq_pid];
int uespec_pilot[9][1200];*/ int uespec_pilot[9][1200];*/
void (*dft)(int16_t *,int16_t *, int); dft_size_idx_t dftsizeidx;
int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
switch (frame_parms->ofdm_symbol_size) { switch (frame_parms->ofdm_symbol_size) {
case 128: case 128:
dft = dft128; dftsizeidx = DFT_128;
break; break;
case 256: case 256:
dft = dft256; dftsizeidx = DFT_256;
break; break;
case 512: case 512:
dft = dft512; dftsizeidx = DFT_512;
break; break;
case 1024: case 1024:
dft = dft1024; dftsizeidx = DFT_1024;
break; break;
case 1536: case 1536:
dft = dft1536; dftsizeidx = DFT_1536;
break; break;
case 2048: case 2048:
dft = dft2048; dftsizeidx = DFT_2048;
break; break;
default: default:
dft = dft512; dftsizeidx = DFT_512;
break; break;
} }
...@@ -118,13 +118,13 @@ int slot_fep(PHY_VARS_UE *ue, ...@@ -118,13 +118,13 @@ int slot_fep(PHY_VARS_UE *ue,
memcpy((void *)tmp_dft_in, memcpy((void *)tmp_dft_in,
(void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples], (void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples],
frame_parms->ofdm_symbol_size*sizeof(int)); frame_parms->ofdm_symbol_size*sizeof(int));
dft((int16_t *)tmp_dft_in, dft(dftsizeidx,(int16_t *)tmp_dft_in,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} else { // use dft input from RX buffer directly } else { // use dft input from RX buffer directly
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
start_meas(&ue->rx_dft_stats); start_meas(&ue->rx_dft_stats);
#endif #endif
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
stop_meas(&ue->rx_dft_stats); stop_meas(&ue->rx_dft_stats);
...@@ -153,10 +153,10 @@ int slot_fep(PHY_VARS_UE *ue, ...@@ -153,10 +153,10 @@ int slot_fep(PHY_VARS_UE *ue,
memcpy((void *)tmp_dft_in, memcpy((void *)tmp_dft_in,
(void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], (void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
frame_parms->ofdm_symbol_size*sizeof(int)); frame_parms->ofdm_symbol_size*sizeof(int));
dft((int16_t *)tmp_dft_in, dft(dftsizeidx,(int16_t *)tmp_dft_in,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} else { // use dft input from RX buffer directly } else { // use dft input from RX buffer directly
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} }
...@@ -247,36 +247,36 @@ int front_end_fft(PHY_VARS_UE *ue, ...@@ -247,36 +247,36 @@ int front_end_fft(PHY_VARS_UE *ue,
unsigned char harq_pid = dlsch_ue[0]->current_harq_pid; unsigned char harq_pid = dlsch_ue[0]->current_harq_pid;
LTE_DL_UE_HARQ_t *dlsch0_harq = dlsch_ue[0]->harq_processes[harq_pid]; LTE_DL_UE_HARQ_t *dlsch0_harq = dlsch_ue[0]->harq_processes[harq_pid];
int uespec_pilot[9][1200];*/ int uespec_pilot[9][1200];*/
void (*dft)(int16_t *,int16_t *, int); dft_size_idx_t dftsizeidx;
int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
switch (frame_parms->ofdm_symbol_size) { switch (frame_parms->ofdm_symbol_size) {
case 128: case 128:
dft = dft128; dftsizeidx = DFT_128;
break; break;
case 256: case 256:
dft = dft256; dftsizeidx = DFT_256;
break; break;
case 512: case 512:
dft = dft512; dftsizeidx = DFT_512;
break; break;
case 1024: case 1024:
dft = dft1024; dftsizeidx = DFT_1024;
break; break;
case 1536: case 1536:
dft = dft1536; dftsizeidx = DFT_1536;
break; break;
case 2048: case 2048:
dft = dft2048; dftsizeidx = DFT_2048;
break; break;
default: default:
dft = dft512; dftsizeidx = DFT_512;
break; break;
} }
...@@ -319,11 +319,11 @@ int front_end_fft(PHY_VARS_UE *ue, ...@@ -319,11 +319,11 @@ int front_end_fft(PHY_VARS_UE *ue,
memcpy((void *)tmp_dft_in, memcpy((void *)tmp_dft_in,
(void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples], (void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples],
frame_parms->ofdm_symbol_size*sizeof(int)); frame_parms->ofdm_symbol_size*sizeof(int));
dft((int16_t *)tmp_dft_in, dft(dftsizeidx,(int16_t *)tmp_dft_in,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} else { // use dft input from RX buffer directly } else { // use dft input from RX buffer directly
start_meas(&ue->rx_dft_stats); start_meas(&ue->rx_dft_stats);
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
(int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
stop_meas(&ue->rx_dft_stats); stop_meas(&ue->rx_dft_stats);
} }
...@@ -349,10 +349,10 @@ int front_end_fft(PHY_VARS_UE *ue, ...@@ -349,10 +349,10 @@ int front_end_fft(PHY_VARS_UE *ue,
memcpy((void *)tmp_dft_in, memcpy((void *)tmp_dft_in,
(void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], (void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
frame_parms->ofdm_symbol_size*sizeof(int)); frame_parms->ofdm_symbol_size*sizeof(int));
dft((int16_t *)tmp_dft_in, dft(dftsizeidx,(int16_t *)tmp_dft_in,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} else { // use dft input from RX buffer directly } else { // use dft input from RX buffer directly
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples], dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
(int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[threadId].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} }
......
...@@ -42,35 +42,35 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue, ...@@ -42,35 +42,35 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue,
unsigned int subframe_offset; unsigned int subframe_offset;
// int i; // int i;
unsigned int frame_length_samples = frame_parms->samples_per_tti * 10; unsigned int frame_length_samples = frame_parms->samples_per_tti * 10;
void (*dft)(int16_t *,int16_t *, int); dft_size_idx_t dftsizeidx;
switch (frame_parms->ofdm_symbol_size) { switch (frame_parms->ofdm_symbol_size) {
case 128: case 128:
dft = dft128; dftsizeidx = DFT_128;
break; break;
case 256: case 256:
dft = dft256; dftsizeidx = DFT_256;
break; break;
case 512: case 512:
dft = dft512; dftsizeidx = DFT_512;
break; break;
case 1024: case 1024:
dft = dft1024; dftsizeidx = DFT_1024;
break; break;
case 1536: case 1536:
dft = dft1536; dftsizeidx = DFT_1536;
break; break;
case 2048: case 2048:
dft = dft2048; dftsizeidx = DFT_2048;
break; break;
default: default:
dft = dft512; dftsizeidx = DFT_512;
break; break;
} }
...@@ -110,7 +110,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue, ...@@ -110,7 +110,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue,
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
start_meas(&ue->rx_dft_stats); start_meas(&ue->rx_dft_stats);
#endif #endif
dft((int16_t *)&common_vars->rxdata[aa][(sample_offset + dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(sample_offset +
nb_prefix_samples0 + nb_prefix_samples0 +
subframe_offset - subframe_offset -
SOFFSET) % frame_length_samples], SOFFSET) % frame_length_samples],
...@@ -131,7 +131,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue, ...@@ -131,7 +131,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue,
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
start_meas(&ue->rx_dft_stats); start_meas(&ue->rx_dft_stats);
#endif #endif
dft((int16_t *)&common_vars->rxdata[aa][(sample_offset + dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(sample_offset +
(frame_parms->ofdm_symbol_size+nb_prefix_samples0+nb_prefix_samples) + (frame_parms->ofdm_symbol_size+nb_prefix_samples0+nb_prefix_samples) +
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1) + (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1) +
subframe_offset- subframe_offset-
...@@ -208,43 +208,43 @@ int slot_fep_mbsfn_khz_1dot25(PHY_VARS_UE *ue, ...@@ -208,43 +208,43 @@ int slot_fep_mbsfn_khz_1dot25(PHY_VARS_UE *ue,
int ofdm_symbol_size; int ofdm_symbol_size;
unsigned int subframe_offset; unsigned int subframe_offset;
unsigned int frame_length_samples = frame_parms->samples_per_tti * 10; unsigned int frame_length_samples = frame_parms->samples_per_tti * 10;
void (*dft)(int16_t *,int16_t *, int); dft_size_idx_t dftsizeidx;
AssertFatal(frame_parms->frame_type == FDD, "Frame is TDD!\n"); AssertFatal(frame_parms->frame_type == FDD, "Frame is TDD!\n");
switch (frame_parms->ofdm_symbol_size) { switch (frame_parms->ofdm_symbol_size) {
case 128: case 128:
dft = dft1536; dftsizeidx = DFT_1536;
ofdm_symbol_size=1536; ofdm_symbol_size=1536;
nb_prefix_samples=384; nb_prefix_samples=384;
break; break;
case 256: case 256:
AssertFatal(1==0,"FeMBMS dft3072 not implemented\n"); AssertFatal(1==0,"FeMBMS dft3072 not implemented\n");
dft = dft3072; dftsizeidx = DFT_3072;
ofdm_symbol_size=3072; ofdm_symbol_size=3072;
nb_prefix_samples=768; nb_prefix_samples=768;
break; break;
case 512: case 512:
dft = dft6144; dftsizeidx = DFT_6144;
nb_prefix_samples=1536; nb_prefix_samples=1536;
ofdm_symbol_size=6144; ofdm_symbol_size=6144;
break; break;
case 1024: case 1024:
dft = dft12288; dftsizeidx = DFT_12288;
nb_prefix_samples=3072; nb_prefix_samples=3072;
ofdm_symbol_size=12288; ofdm_symbol_size=12288;
break; break;
case 1536: case 1536:
dft = dft18432; dftsizeidx = DFT_18432;
nb_prefix_samples=4608; nb_prefix_samples=4608;
ofdm_symbol_size=18432; ofdm_symbol_size=18432;
break; break;
case 2048: case 2048:
dft = dft24576; dftsizeidx = DFT_24576;
nb_prefix_samples=6144; nb_prefix_samples=6144;
ofdm_symbol_size=24576; ofdm_symbol_size=24576;
break; break;
...@@ -265,7 +265,7 @@ int slot_fep_mbsfn_khz_1dot25(PHY_VARS_UE *ue, ...@@ -265,7 +265,7 @@ int slot_fep_mbsfn_khz_1dot25(PHY_VARS_UE *ue,
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
start_meas(&ue->rx_dft_stats); start_meas(&ue->rx_dft_stats);
#endif #endif
dft((int16_t *)&common_vars->rxdata[aa][(sample_offset + dft(dftsizeidx,(int16_t *)&common_vars->rxdata[aa][(sample_offset +
nb_prefix_samples + nb_prefix_samples +
subframe_offset - subframe_offset -
SOFFSET) % frame_length_samples], SOFFSET) % frame_length_samples],
......
...@@ -237,44 +237,44 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue, ...@@ -237,44 +237,44 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
unsigned int rx_offset; unsigned int rx_offset;
void (*dft)(int16_t *,int16_t *, int); dft_size_idx_t dftsize;
int tmp_dft_in[8192] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs int tmp_dft_in[8192] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
switch (frame_parms->ofdm_symbol_size) { switch (frame_parms->ofdm_symbol_size) {
case 128: case 128:
dft = dft128; dftsize = DFT_128;
break; break;
case 256: case 256:
dft = dft256; dftsize = DFT_256;
break; break;
case 512: case 512:
dft = dft512; dftsize = DFT_512;
break; break;
case 1024: case 1024:
dft = dft1024; dftsize = DFT_1024;
break; break;
case 1536: case 1536:
dft = dft1536; dftsize = DFT_1536;
break; break;
case 2048: case 2048:
dft = dft2048; dftsize = DFT_2048;
break; break;
case 3072: case 3072:
dft = dft3072; dftsize = DFT_3072;
break; break;
case 4096: case 4096:
dft = dft4096; dftsize = DFT_4096;
break; break;
case 8192: case 8192:
dft = dft8192; dftsize = DFT_8192;
break; break;
default: default:
...@@ -330,14 +330,15 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue, ...@@ -330,14 +330,15 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
memcpy((void *)tmp_dft_in, memcpy((void *)tmp_dft_in,
(void *) &common_vars->rxdata[aa][rx_offset], (void *) &common_vars->rxdata[aa][rx_offset],
frame_parms->ofdm_symbol_size*sizeof(int)); frame_parms->ofdm_symbol_size*sizeof(int));
dft((int16_t *)tmp_dft_in, dft(dftsize,(int16_t *)tmp_dft_in,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} else { // use dft input from RX buffer directly } else { // use dft input from RX buffer directly
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
start_meas(&ue->rx_dft_stats); start_meas(&ue->rx_dft_stats);
#endif #endif
dft((int16_t *) &common_vars->rxdata[aa][rx_offset],
dft(dftsize,(int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
stop_meas(&ue->rx_dft_stats); stop_meas(&ue->rx_dft_stats);
...@@ -358,11 +359,10 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue, ...@@ -358,11 +359,10 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
memcpy((void *)tmp_dft_in, memcpy((void *)tmp_dft_in,
(void *) &common_vars->rxdata[aa][rx_offset], (void *) &common_vars->rxdata[aa][rx_offset],
frame_parms->ofdm_symbol_size*sizeof(int)); frame_parms->ofdm_symbol_size*sizeof(int));
dft((int16_t *)tmp_dft_in, dft(dftsize,(int16_t *)tmp_dft_in,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} else { // use dft input from RX buffer directly } else { // use dft input from RX buffer directly
dft(dftsize,(int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
dft((int16_t *) &common_vars->rxdata[aa][rx_offset],
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} }
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
......
...@@ -430,55 +430,55 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -430,55 +430,55 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
switch (gNB->frame_parms.ofdm_symbol_size) { switch (gNB->frame_parms.ofdm_symbol_size) {
case 128: case 128:
idft128((int16_t*) &ul_ch_estimates[aarx][symbol_offset], idft(IDFT_128,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
(int16_t*) ul_ch_estimates_time[aarx], (int16_t*) ul_ch_estimates_time[aarx],
1); 1);
break; break;
case 256: case 256:
idft256((int16_t*) &ul_ch_estimates[aarx][symbol_offset], idft(IDFT_256,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
(int16_t*) ul_ch_estimates_time[aarx], (int16_t*) ul_ch_estimates_time[aarx],
1); 1);
break; break;
case 512: case 512:
idft512((int16_t*) &ul_ch_estimates[aarx][symbol_offset], idft(IDFT_512,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
(int16_t*) ul_ch_estimates_time[aarx], (int16_t*) ul_ch_estimates_time[aarx],
1); 1);
break; break;
case 1024: case 1024:
idft1024((int16_t*) &ul_ch_estimates[aarx][symbol_offset], idft(IDFT_1024,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
(int16_t*) ul_ch_estimates_time[aarx], (int16_t*) ul_ch_estimates_time[aarx],
1); 1);
break; break;
case 1536: case 1536:
idft1536((int16_t*) &ul_ch_estimates[aarx][symbol_offset], idft(IDFT_1536,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
(int16_t*) ul_ch_estimates_time[aarx], (int16_t*) ul_ch_estimates_time[aarx],
1); 1);
break; break;
case 2048: case 2048:
idft2048((int16_t*) &ul_ch_estimates[aarx][symbol_offset], idft(IDFT_2048,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
(int16_t*) ul_ch_estimates_time[aarx], (int16_t*) ul_ch_estimates_time[aarx],
1); 1);
break; break;
case 4096: case 4096:
idft4096((int16_t*) &ul_ch_estimates[aarx][symbol_offset], idft(IDFT_4096,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
(int16_t*) ul_ch_estimates_time[aarx], (int16_t*) ul_ch_estimates_time[aarx],
1); 1);
break; break;
case 8192: case 8192:
idft8192((int16_t*) &ul_ch_estimates[aarx][symbol_offset], idft(IDFT_8192,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
(int16_t*) ul_ch_estimates_time[aarx], (int16_t*) ul_ch_estimates_time[aarx],
1); 1);
break; break;
default: default:
idft512((int16_t*) &ul_ch_estimates[aarx][symbol_offset], idft(IDFT_512,(int16_t*) &ul_ch_estimates[aarx][symbol_offset],
(int16_t*) ul_ch_estimates_time[aarx], (int16_t*) ul_ch_estimates_time[aarx],
1); 1);
break; break;
......
...@@ -127,8 +127,8 @@ time_stats_t generic_time[TIME_LAST]; ...@@ -127,8 +127,8 @@ time_stats_t generic_time[TIME_LAST];
/************** FUNCTION ******************************************/ /************** FUNCTION ******************************************/
void *get_idft(int ofdm_symbol_size); idft_size_idx_t get_idft(int ofdm_symbol_size);
void *get_dft(int ofdm_symbol_size); dft_size_idx_t get_dft(int ofdm_symbol_size);
void init_context_synchro_nr(NR_DL_FRAME_PARMS *frame_parms_ue); void init_context_synchro_nr(NR_DL_FRAME_PARMS *frame_parms_ue);
void free_context_synchro_nr(void); void free_context_synchro_nr(void);
void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue); void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue);
......
...@@ -175,39 +175,39 @@ void rx_nr_prach_ru(RU_t *ru, ...@@ -175,39 +175,39 @@ void rx_nr_prach_ru(RU_t *ru,
//50 MHz @ 61.44 Ms/s //50 MHz @ 61.44 Ms/s
prach2 = prach[aa] + (Ncp<<2); prach2 = prach[aa] + (Ncp<<2);
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2)
dft49152(prach2,rxsigF[aa],1); dft(DFT_49152,prach2,rxsigF[aa],1);
if (prach_fmt == 1 || prach_fmt == 2) { if (prach_fmt == 1 || prach_fmt == 2) {
dft49152(prach2+98304,rxsigF[aa]+98304,1); dft(DFT_49152,prach2+98304,rxsigF[aa]+98304,1);
reps++; reps++;
} }
if (prach_fmt == 2) { if (prach_fmt == 2) {
dft49152(prach2+(98304*2),rxsigF[aa]+(98304*2),1); dft(DFT_49152,prach2+(98304*2),rxsigF[aa]+(98304*2),1);
dft49152(prach2+(98304*3),rxsigF[aa]+(98304*3),1); dft(DFT_49152,prach2+(98304*3),rxsigF[aa]+(98304*3),1);
reps+=2; reps+=2;
} }
if (prach_fmt == 3) { if (prach_fmt == 3) {
for (int i=0;i<4;i++) dft12288(prach2+(i*12288*2),rxsigF[aa]+(i*12288*2),1); for (int i=0;i<4;i++) dft(DFT_12288,prach2+(i*12288*2),rxsigF[aa]+(i*12288*2),1);
reps=4; reps=4;
} }
if (prach_fmt >3) { if (prach_fmt >3) {
dft2048(prach2,rxsigF[aa],1); dft(DFT_2048,prach2,rxsigF[aa],1);
if (prach_fmt != 0xc0) { if (prach_fmt != 0xc0) {
dft2048(prach2+4096,rxsigF[aa]+4096,1); dft(DFT_2048,prach2+4096,rxsigF[aa]+4096,1);
reps++; reps++;
} }
} }
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) { if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
dft2048(prach2+4096*2,rxsigF[aa]+4096*2,1); dft(DFT_2048,prach2+4096*2,rxsigF[aa]+4096*2,1);
dft2048(prach2+4096*3,rxsigF[aa]+4096*3,1); dft(DFT_2048,prach2+4096*3,rxsigF[aa]+4096*3,1);
reps+=2; reps+=2;
} }
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) { if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
dft2048(prach2+4096*4,rxsigF[aa]+4096*4,1); dft(DFT_2048,prach2+4096*4,rxsigF[aa]+4096*4,1);
dft2048(prach2+4096*5,rxsigF[aa]+4096*5,1); dft(DFT_2048,prach2+4096*5,rxsigF[aa]+4096*5,1);
reps+=2; reps+=2;
} }
if (prach_fmt == 0xc2) { if (prach_fmt == 0xc2) {
for (int i=6;i<11;i++) dft2048(prach2+(3072*i),rxsigF[aa]+(3072*i),1); for (int i=6;i<11;i++) dft(DFT_2048,prach2+(3072*i),rxsigF[aa]+(3072*i),1);
reps+=6; reps+=6;
} }
} else { } else {
...@@ -215,41 +215,41 @@ void rx_nr_prach_ru(RU_t *ru, ...@@ -215,41 +215,41 @@ void rx_nr_prach_ru(RU_t *ru,
prach2 = prach[aa] + (3*Ncp); prach2 = prach[aa] + (3*Ncp);
AssertFatal(fp->N_RB_UL <= 107,"cannot do 108..136 PRBs with 3/4 sampling\n"); AssertFatal(fp->N_RB_UL <= 107,"cannot do 108..136 PRBs with 3/4 sampling\n");
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) { if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) {
dft36864(prach2,rxsigF[aa],1); dft(DFT_36864,prach2,rxsigF[aa],1);
reps++; reps++;
} }
if (prach_fmt == 1 || prach_fmt == 2) { if (prach_fmt == 1 || prach_fmt == 2) {
dft36864(prach2+73728,rxsigF[aa]+73728,1); dft(DFT_36864,prach2+73728,rxsigF[aa]+73728,1);
reps++; reps++;
} }
if (prach_fmt == 2) { if (prach_fmt == 2) {
dft36864(prach2+(98304*2),rxsigF[aa]+(98304*2),1); dft(DFT_36864,prach2+(98304*2),rxsigF[aa]+(98304*2),1);
dft36864(prach2+(98304*3),rxsigF[aa]+(98304*3),1); dft(DFT_36864,prach2+(98304*3),rxsigF[aa]+(98304*3),1);
reps+=2; reps+=2;
} }
if (prach_fmt == 3) { if (prach_fmt == 3) {
for (int i=0;i<4;i++) dft9216(prach2+(i*9216*2),rxsigF[aa]+(i*9216*2),1); for (int i=0;i<4;i++) dft(DFT_9216,prach2+(i*9216*2),rxsigF[aa]+(i*9216*2),1);
reps=4; reps=4;
} }
if (prach_fmt >3) { if (prach_fmt >3) {
dft1536(prach2,rxsigF[aa],1); dft(DFT_1536,prach2,rxsigF[aa],1);
if (prach_fmt != 0xc0) { if (prach_fmt != 0xc0) {
dft1536(prach2+3072,rxsigF[aa]+3072,1); dft(DFT_1536,prach2+3072,rxsigF[aa]+3072,1);
reps++; reps++;
} }
} }
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) { if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
dft1536(prach2+3072*2,rxsigF[aa]+3072*2,1); dft(DFT_1536,prach2+3072*2,rxsigF[aa]+3072*2,1);
dft1536(prach2+3072*3,rxsigF[aa]+3072*3,1); dft(DFT_1536,prach2+3072*3,rxsigF[aa]+3072*3,1);
reps+=2; reps+=2;
} }
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) { if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
dft1536(prach2+3072*4,rxsigF[aa]+3072*4,1); dft(DFT_1536,prach2+3072*4,rxsigF[aa]+3072*4,1);
dft1536(prach2+3072*5,rxsigF[aa]+3072*5,1); dft(DFT_1536,prach2+3072*5,rxsigF[aa]+3072*5,1);
reps+=2; reps+=2;
} }
if (prach_fmt == 0xc2) { if (prach_fmt == 0xc2) {
for (int i=6;i<11;i++) dft1536(prach2+(3072*i),rxsigF[aa]+(3072*i),1); for (int i=6;i<11;i++) dft(DFT_1536,prach2+(3072*i),rxsigF[aa]+(3072*i),1);
reps+=6; reps+=6;
} }
} }
...@@ -260,41 +260,41 @@ void rx_nr_prach_ru(RU_t *ru, ...@@ -260,41 +260,41 @@ void rx_nr_prach_ru(RU_t *ru,
dftlen=98304; dftlen=98304;
//80,90,100 MHz @ 61.44 Ms/s //80,90,100 MHz @ 61.44 Ms/s
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2)
dft98304(prach2,rxsigF[aa],1); dft(DFT_98304,prach2,rxsigF[aa],1);
if (prach_fmt == 1 || prach_fmt == 2) { if (prach_fmt == 1 || prach_fmt == 2) {
dft98304(prach2+196608,rxsigF[aa]+196608,1); dft(DFT_98304,prach2+196608,rxsigF[aa]+196608,1);
reps++; reps++;
} }
if (prach_fmt == 1 || prach_fmt == 2) { if (prach_fmt == 1 || prach_fmt == 2) {
dft98304(prach2+196608,rxsigF[aa]+196608,1); dft(DFT_98304,prach2+196608,rxsigF[aa]+196608,1);
dft98304(prach2+(196608*2),rxsigF[aa]+(196608*2),1); dft(DFT_98304,prach2+(196608*2),rxsigF[aa]+(196608*2),1);
reps+=2; reps+=2;
} }
if (prach_fmt == 3) { if (prach_fmt == 3) {
dft24576(prach2+(2*49152),rxsigF[aa]+(2*49152),1); dft(DFT_24576,prach2+(2*49152),rxsigF[aa]+(2*49152),1);
reps=4; reps=4;
dftlen=24576; dftlen=24576;
} }
if (prach_fmt >3) { if (prach_fmt >3) {
dftlen=4096; dftlen=4096;
dft4096(prach2,rxsigF[aa],1); dft(DFT_4096,prach2,rxsigF[aa],1);
if (prach_fmt != 0xc0) { if (prach_fmt != 0xc0) {
dft4096(prach2+8192,rxsigF[aa]+8192,1); dft(DFT_4096,prach2+8192,rxsigF[aa]+8192,1);
reps++; reps++;
} }
} }
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) { if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
dft4096(prach2+8192*2,rxsigF[aa]+8192*2,1); dft(DFT_4096,prach2+8192*2,rxsigF[aa]+8192*2,1);
dft4096(prach2+8192*3,rxsigF[aa]+8192*3,1); dft(DFT_4096,prach2+8192*3,rxsigF[aa]+8192*3,1);
reps+=2; reps+=2;
} }
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) { if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
dft4096(prach2+8192*4,rxsigF[aa]+8192*4,1); dft(DFT_4096,prach2+8192*4,rxsigF[aa]+8192*4,1);
dft4096(prach2+8192*5,rxsigF[aa]+8192*5,1); dft(DFT_4096,prach2+8192*5,rxsigF[aa]+8192*5,1);
reps+=2; reps+=2;
} }
if (prach_fmt == 0xc2) { if (prach_fmt == 0xc2) {
for (int i=6;i<11;i++) dft4096(prach2+(8192*i),rxsigF[aa]+(8192*i),1); for (int i=6;i<11;i++) dft(DFT_4096,prach2+(8192*i),rxsigF[aa]+(8192*i),1);
reps+=6; reps+=6;
} }
} else { } else {
...@@ -303,39 +303,39 @@ void rx_nr_prach_ru(RU_t *ru, ...@@ -303,39 +303,39 @@ void rx_nr_prach_ru(RU_t *ru,
// 80 MHz @ 46.08 Ms/s // 80 MHz @ 46.08 Ms/s
dftlen=73728; dftlen=73728;
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) { if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) {
dft73728(prach2,rxsigF[aa],1); dft(DFT_73728,prach2,rxsigF[aa],1);
reps++; reps++;
} }
if (prach_fmt == 1 || prach_fmt == 2) { if (prach_fmt == 1 || prach_fmt == 2) {
dft73728(prach2+(2*73728),rxsigF[aa]+(2*73728),1); dft(DFT_73728,prach2+(2*73728),rxsigF[aa]+(2*73728),1);
reps++; reps++;
} }
if (prach_fmt == 3) { if (prach_fmt == 3) {
dft73728(prach2+(4*73728),rxsigF[aa]+(4*73728),1); dft(DFT_73728,prach2+(4*73728),rxsigF[aa]+(4*73728),1);
reps=4; reps=4;
dftlen=18432; dftlen=18432;
} }
if (prach_fmt >3) { if (prach_fmt >3) {
dftlen=3072; dftlen=3072;
dft3072(prach2,rxsigF[aa],1); dft(DFT_3072,prach2,rxsigF[aa],1);
if (prach_fmt != 0xc0) { if (prach_fmt != 0xc0) {
dft3072(prach2+6144,rxsigF[aa]+6144,1); dft(DFT_3072,prach2+6144,rxsigF[aa]+6144,1);
reps++; reps++;
} }
} }
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) { if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
dft3072(prach2+6144*2,rxsigF[aa]+6144*2,1); dft(DFT_3072,prach2+6144*2,rxsigF[aa]+6144*2,1);
dft3072(prach2+6144*3,rxsigF[aa]+6144*3,1); dft(DFT_3072,prach2+6144*3,rxsigF[aa]+6144*3,1);
reps+=2; reps+=2;
} }
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) { if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
dft3072(prach2+6144*4,rxsigF[aa]+6144*4,1); dft(DFT_3072,prach2+6144*4,rxsigF[aa]+6144*4,1);
dft3072(prach2+6144*5,rxsigF[aa]+6144*5,1); dft(DFT_3072,prach2+6144*5,rxsigF[aa]+6144*5,1);
reps+=2; reps+=2;
} }
if (prach_fmt == 0xc2) { if (prach_fmt == 0xc2) {
for (int i=6;i<11;i++) dft3072(prach2+(6144*i),rxsigF[aa]+(6144*i),1); for (int i=6;i<11;i++) dft(DFT_3072,prach2+(6144*i),rxsigF[aa]+(6144*i),1);
reps+=6; reps+=6;
} }
} }
...@@ -590,12 +590,12 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -590,12 +590,12 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
// Now do IFFT of size 1024 (N_ZC=839) or 256 (N_ZC=139) // Now do IFFT of size 1024 (N_ZC=839) or 256 (N_ZC=139)
if (N_ZC == 839) { if (N_ZC == 839) {
log2_ifft_size = 10; log2_ifft_size = 10;
idft1024(prachF,prach_ifft_tmp,1); idft(IDFT_1024,prachF,prach_ifft_tmp,1);
// compute energy and accumulate over receive antennas // compute energy and accumulate over receive antennas
for (i=0;i<2048;i++) for (i=0;i<2048;i++)
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[i<<1] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>10; prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[i<<1] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>10;
} else { } else {
idft256(prachF,prach_ifft_tmp,1); idft(IDFT_256,prachF,prach_ifft_tmp,1);
log2_ifft_size = 8; log2_ifft_size = 8;
// compute energy and accumulate over receive antennas and repetitions for BR // compute energy and accumulate over receive antennas and repetitions for BR
for (i=0;i<256;i++) for (i=0;i<256;i++)
......
...@@ -44,7 +44,7 @@ void nr_idft(uint32_t *z, uint32_t Msc_PUSCH) ...@@ -44,7 +44,7 @@ void nr_idft(uint32_t *z, uint32_t Msc_PUSCH)
switch (Msc_PUSCH) { switch (Msc_PUSCH) {
case 12: case 12:
dft12((int16_t *)idft_in0, (int16_t *)idft_out0); dft(DFT_12,(int16_t *)idft_in0, (int16_t *)idft_out0,0);
#if defined(__x86_64__)||defined(__i386__) #if defined(__x86_64__)||defined(__i386__)
norm128 = _mm_set1_epi16(9459); norm128 = _mm_set1_epi16(9459);
...@@ -63,135 +63,135 @@ void nr_idft(uint32_t *z, uint32_t Msc_PUSCH) ...@@ -63,135 +63,135 @@ void nr_idft(uint32_t *z, uint32_t Msc_PUSCH)
break; break;
case 24: case 24:
dft24(idft_in0, idft_out0, 1); dft(DFT_24,idft_in0, idft_out0, 1);
break; break;
case 36: case 36:
dft36(idft_in0, idft_out0, 1); dft(DFT_36,idft_in0, idft_out0, 1);
break; break;
case 48: case 48:
dft48(idft_in0, idft_out0, 1); dft(DFT_48,idft_in0, idft_out0, 1);
break; break;
case 60: case 60:
dft60(idft_in0, idft_out0, 1); dft(DFT_60,idft_in0, idft_out0, 1);
break; break;
case 72: case 72:
dft72(idft_in0, idft_out0, 1); dft(DFT_72,idft_in0, idft_out0, 1);
break; break;
case 96: case 96:
dft96(idft_in0, idft_out0, 1); dft(DFT_96,idft_in0, idft_out0, 1);
break; break;
case 108: case 108:
dft108(idft_in0, idft_out0, 1); dft(DFT_108,idft_in0, idft_out0, 1);
break; break;
case 120: case 120:
dft120(idft_in0, idft_out0, 1); dft(DFT_120,idft_in0, idft_out0, 1);
break; break;
case 144: case 144:
dft144(idft_in0, idft_out0, 1); dft(DFT_144,idft_in0, idft_out0, 1);
break; break;
case 180: case 180:
dft180(idft_in0, idft_out0, 1); dft(DFT_180,idft_in0, idft_out0, 1);
break; break;
case 192: case 192:
dft192(idft_in0, idft_out0, 1); dft(DFT_192,idft_in0, idft_out0, 1);
break; break;
case 216: case 216:
dft216(idft_in0, idft_out0, 1); dft(DFT_216,idft_in0, idft_out0, 1);
break; break;
case 240: case 240:
dft240(idft_in0, idft_out0, 1); dft(DFT_240,idft_in0, idft_out0, 1);
break; break;
case 288: case 288:
dft288(idft_in0, idft_out0, 1); dft(DFT_288,idft_in0, idft_out0, 1);
break; break;
case 300: case 300:
dft300(idft_in0, idft_out0, 1); dft(DFT_300,idft_in0, idft_out0, 1);
break; break;
case 324: case 324:
dft324((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_324,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 360: case 360:
dft360((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_360,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 384: case 384:
dft384((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_384,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 432: case 432:
dft432((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_432,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 480: case 480:
dft480((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_480,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 540: case 540:
dft540((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_540,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 576: case 576:
dft576((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_576,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 600: case 600:
dft600((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_600,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 648: case 648:
dft648((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_648,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 720: case 720:
dft720((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_720,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 768: case 768:
dft768((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_768,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 864: case 864:
dft864((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_864,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 900: case 900:
dft900((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_900,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 960: case 960:
dft960((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_960,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 972: case 972:
dft972((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_972,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 1080: case 1080:
dft1080((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_1080,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 1152: case 1152:
dft1152((int16_t*)idft_in0, (int16_t*)idft_out0, 1); dft(DFT_1152,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
break; break;
case 1200: case 1200:
dft1200(idft_in0, idft_out0, 1); dft(DFT_1200,idft_in0, idft_out0, 1);
break; break;
default: default:
......
...@@ -405,39 +405,39 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -405,39 +405,39 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
} }
void (*idft)(int16_t *,int16_t *, int); idft_size_idx_t idftsizeidx;
switch (ue->frame_parms.ofdm_symbol_size) { switch (ue->frame_parms.ofdm_symbol_size) {
case 128: case 128:
idft = idft128; idftsizeidx = IDFT_128;
break; break;
case 256: case 256:
idft = idft256; idftsizeidx = IDFT_256;
break; break;
case 512: case 512:
idft = idft512; idftsizeidx = IDFT_512;
break; break;
case 1024: case 1024:
idft = idft1024; idftsizeidx = IDFT_1024;
break; break;
case 1536: case 1536:
idft = idft1536; idftsizeidx = IDFT_1536;
break; break;
case 2048: case 2048:
idft = idft2048; idftsizeidx = IDFT_2048;
break; break;
case 3072: case 3072:
idft = idft3072; idftsizeidx = IDFT_3072;
break; break;
case 4096: case 4096:
idft = idft4096; idftsizeidx = IDFT_4096;
break; break;
default: default:
...@@ -453,7 +453,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -453,7 +453,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
if (ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p<<1)+aarx]) if (ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p<<1)+aarx])
{ {
LOG_D(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d ch_offset %d\n", Ns, ue->current_thread_id[Ns], symbol, ch_offset); LOG_D(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d ch_offset %d\n", Ns, ue->current_thread_id[Ns], symbol, ch_offset);
idft((int16_t*) &ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p<<1)+aarx][ch_offset], idft(idftsizeidx,
(int16_t*) &ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p<<1)+aarx][ch_offset],
(int16_t*) ue->pbch_vars[eNB_offset]->dl_ch_estimates_time[(p<<1)+aarx],1); (int16_t*) ue->pbch_vars[eNB_offset]->dl_ch_estimates_time[(p<<1)+aarx],1);
} }
} }
......
This diff is collapsed.
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
* *
* PARAMETERS : size of ofdm symbol * PARAMETERS : size of ofdm symbol
* *
* RETURN : function idft * RETURN : index pointing to the dft func in the dft library
* *
* DESCRIPTION : get idft function depending of ofdm size * DESCRIPTION : get idft function depending of ofdm size
* *
...@@ -60,45 +60,45 @@ ...@@ -60,45 +60,45 @@
//#define DBG_PSS_NR //#define DBG_PSS_NR
void *get_idft(int ofdm_symbol_size) idft_size_idx_t get_idft(int ofdm_symbol_size)
{ {
void (*idft)(int16_t *,int16_t *, int);
switch (ofdm_symbol_size) { switch (ofdm_symbol_size) {
case 128: case 128:
idft = idft128; return IDFT_128;
break; break;
case 256: case 256:
idft = idft256; return IDFT_256;
break; break;
case 512: case 512:
idft = idft512; return IDFT_512;
break; break;
case 1024: case 1024:
idft = idft1024; return IDFT_1024;
break; break;
case 1536: case 1536:
idft = idft1536; return IDFT_1536;
break; break;
case 2048: case 2048:
idft = idft2048; return IDFT_2048;
break; break;
case 3072: case 3072:
idft = idft3072; return IDFT_3072;
break; break;
case 4096: case 4096:
idft = idft4096; return IDFT_4096;
break; break;
case 8192: case 8192:
idft = idft8192; return IDFT_8192;
break; break;
default: default:
...@@ -106,7 +106,7 @@ void *get_idft(int ofdm_symbol_size) ...@@ -106,7 +106,7 @@ void *get_idft(int ofdm_symbol_size)
assert(0); assert(0);
break; break;
} }
return idft; return IDFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function
} }
/******************************************************************* /*******************************************************************
...@@ -121,41 +121,41 @@ void *get_idft(int ofdm_symbol_size) ...@@ -121,41 +121,41 @@ void *get_idft(int ofdm_symbol_size)
* *
*********************************************************************/ *********************************************************************/
void *get_dft(int ofdm_symbol_size) dft_size_idx_t get_dft(int ofdm_symbol_size)
{ {
void (*dft)(int16_t *,int16_t *, int);
switch (ofdm_symbol_size) { switch (ofdm_symbol_size) {
case 128: case 128:
dft = dft128; return DFT_128;
break; break;
case 256: case 256:
dft = dft256; return DFT_256;
break; break;
case 512: case 512:
dft = dft512; return DFT_512;
break; break;
case 1024: case 1024:
dft = dft1024; return DFT_1024;
break; break;
case 1536: case 1536:
dft = dft1536; return DFT_1536;
break; break;
case 2048: case 2048:
dft = dft2048; return DFT_2048;
break; break;
case 4096: case 4096:
dft = dft4096; return DFT_4096;
break; break;
case 8192: case 8192:
dft = dft8192; return DFT_8192;
break; break;
default: default:
...@@ -163,7 +163,7 @@ void *get_dft(int ofdm_symbol_size) ...@@ -163,7 +163,7 @@ void *get_dft(int ofdm_symbol_size)
assert(0); assert(0);
break; break;
} }
return dft; return DFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function;
} }
/******************************************************************* /*******************************************************************
...@@ -191,7 +191,7 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2) ...@@ -191,7 +191,7 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
unsigned int size = length * IQ_SIZE; /* i & q */ unsigned int size = length * IQ_SIZE; /* i & q */
int16_t *primary_synchro = primary_synchro_nr[N_ID_2]; /* pss in complex with alternatively i then q */ int16_t *primary_synchro = primary_synchro_nr[N_ID_2]; /* pss in complex with alternatively i then q */
int16_t *primary_synchro2 = primary_synchro_nr2[N_ID_2]; /* pss in complex with alternatively i then q */ int16_t *primary_synchro2 = primary_synchro_nr2[N_ID_2]; /* pss in complex with alternatively i then q */
void (*idft)(int16_t *,int16_t *, int);
#define INITIAL_PSS_NR (7) #define INITIAL_PSS_NR (7)
const int x_initial[INITIAL_PSS_NR] = {0, 1, 1 , 0, 1, 1, 1}; const int x_initial[INITIAL_PSS_NR] = {0, 1, 1 , 0, 1, 1, 1};
...@@ -282,9 +282,10 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2) ...@@ -282,9 +282,10 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
/* IFFT will give temporal signal of Pss */ /* IFFT will give temporal signal of Pss */
idft = get_idft(length);
idft(synchroF_tmp, /* complex input */
idft((int16_t)get_idft(length),
synchroF_tmp, /* complex input */
synchro_tmp, /* complex output */ synchro_tmp, /* complex output */
1); /* scaling factor */ 1); /* scaling factor */
...@@ -312,6 +313,7 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2) ...@@ -312,6 +313,7 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
#endif #endif
#if 0 #if 0
/* it allows checking that process of idft on a signal and then dft gives same signal with limited errors */ /* it allows checking that process of idft on a signal and then dft gives same signal with limited errors */
...@@ -323,10 +325,11 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2) ...@@ -323,10 +325,11 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
bzero(synchroF_tmp, size); bzero(synchroF_tmp, size);
void (*dft)(int16_t *,int16_t *, int) = get_dft(length);
/* get pss in the time domain by applying an inverse FFT */ /* get pss in the time domain by applying an inverse FFT */
dft(synchro_tmp, /* complex input */ dft((int16_t)get_dft(length),
synchro_tmp, /* complex input */
synchroF_tmp, /* complex output */ synchroF_tmp, /* complex output */
1); /* scaling factor */ 1); /* scaling factor */
......
...@@ -182,7 +182,7 @@ void insert_sss_nr(int16_t *sss_time, ...@@ -182,7 +182,7 @@ void insert_sss_nr(int16_t *sss_time,
} }
/* get sss in the frequency domain by applying an inverse FFT */ /* get sss in the frequency domain by applying an inverse FFT */
idft2048(synchroF_tmp, /* complex input */ idft(IDFT_2048,synchroF_tmp, /* complex input */
synchro_tmp, /* complex output */ synchro_tmp, /* complex output */
1); /* scaling factor */ 1); /* scaling factor */
......
/*
* 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 openair1/PHY/CODING/coding_nr_load.c
* \brief: load library implementing coding/decoding algorithms
* \author Francois TABURET
* \date 2020
* \version 0.1
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
#define _GNU_SOURCE
#include <sys/types.h>
#include <stdlib.h>
#include <malloc.h>
#include "assertions.h"
#include "common/utils/LOG/log.h"
#define OAIDFTS_LOADER
#include "tools_defs.h"
#include "common/config/config_userapi.h"
#include "common/utils/load_module_shlib.h"
/* function description array, to be used when loading the dfts/idfts lib */
static loader_shlibfunc_t shlib_fdesc[2];
static char *arg[64]={"phytest","-O","cmdlineonly::dbgl0"};
int load_dftslib(void) {
char *ptr = (char*)config_get_if();
if ( ptr==NULL ) {// phy simulators, config module possibly not loaded
load_configmodule(3,(char **)arg,CONFIG_ENABLECMDLINEONLY) ;
logInit();
}
shlib_fdesc[0].fname = "dft";
shlib_fdesc[1].fname = "idft";
int ret=load_module_shlib("dfts",shlib_fdesc,sizeof(shlib_fdesc)/sizeof(loader_shlibfunc_t),NULL);
AssertFatal( (ret >= 0),"Error loading dftsc decoder");
dft = (dftfunc_t)shlib_fdesc[0].fptr;
idft = (idftfunc_t)shlib_fdesc[1].fptr;
return 0;
}
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#ifndef M_PI #ifndef M_PI
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif #endif
#define OAIDFTS #define OAIDFTS_MAIN
#ifndef MR_MAIN #ifndef MR_MAIN
#include "PHY/defs_common.h" #include "PHY/defs_common.h"
#include "PHY/impl_defs_top.h" #include "PHY/impl_defs_top.h"
...@@ -5697,12 +5697,12 @@ void dft6144(int16_t *input, int16_t *output,unsigned char scale) ...@@ -5697,12 +5697,12 @@ void dft6144(int16_t *input, int16_t *output,unsigned char scale)
int16_t twa9216[6144] __attribute__((aligned(32))); int16_t twa9216[6144] __attribute__((aligned(32)));
int16_t twb9216[6144] __attribute__((aligned(32))); int16_t twb9216[6144] __attribute__((aligned(32)));
// 3072 x 3 // 3072 x 3
void dft9216(int16_t *input, int16_t *output,int scale) { void dft9216(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n"); AssertFatal(1==0,"Need to do this ..\n");
} }
void idft9216(int16_t *input, int16_t *output,int scale) { void idft9216(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n"); AssertFatal(1==0,"Need to do this ..\n");
} }
...@@ -6059,11 +6059,11 @@ void idft24576(int16_t *input, int16_t *output,unsigned char scale) ...@@ -6059,11 +6059,11 @@ void idft24576(int16_t *input, int16_t *output,unsigned char scale)
int16_t twa36864[24576] __attribute__((aligned(32))); int16_t twa36864[24576] __attribute__((aligned(32)));
int16_t twb36884[24576] __attribute__((aligned(32))); int16_t twb36884[24576] __attribute__((aligned(32)));
// 12288 x 3 // 12288 x 3
void dft36864(int16_t *input, int16_t *output,int scale) { void dft36864(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n"); AssertFatal(1==0,"Need to do this ..\n");
} }
void idft36864(int16_t *input, int16_t *output,int scale) { void idft36864(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n"); AssertFatal(1==0,"Need to do this ..\n");
} }
...@@ -6071,12 +6071,12 @@ void idft36864(int16_t *input, int16_t *output,int scale) { ...@@ -6071,12 +6071,12 @@ void idft36864(int16_t *input, int16_t *output,int scale) {
int16_t twa49152[32768] __attribute__((aligned(32))); int16_t twa49152[32768] __attribute__((aligned(32)));
int16_t twb49152[32768] __attribute__((aligned(32))); int16_t twb49152[32768] __attribute__((aligned(32)));
// 16384 x 3 // 16384 x 3
void dft49152(int16_t *input, int16_t *output,int scale) { void dft49152(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n"); AssertFatal(1==0,"Need to do this ..\n");
} }
void idft49152(int16_t *input, int16_t *output,int scale) { void idft49152(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n"); AssertFatal(1==0,"Need to do this ..\n");
} }
...@@ -6084,12 +6084,12 @@ void idft49152(int16_t *input, int16_t *output,int scale) { ...@@ -6084,12 +6084,12 @@ void idft49152(int16_t *input, int16_t *output,int scale) {
int16_t twa73728[49152] __attribute__((aligned(32))); int16_t twa73728[49152] __attribute__((aligned(32)));
int16_t twb73728[49152] __attribute__((aligned(32))); int16_t twb73728[49152] __attribute__((aligned(32)));
// 24576 x 3 // 24576 x 3
void dft73728(int16_t *input, int16_t *output,int scale) { void dft73728(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n"); AssertFatal(1==0,"Need to do this ..\n");
} }
void idft73728(int16_t *input, int16_t *output,int scale) { void idft73728(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n"); AssertFatal(1==0,"Need to do this ..\n");
} }
...@@ -6098,12 +6098,12 @@ void idft73728(int16_t *input, int16_t *output,int scale) { ...@@ -6098,12 +6098,12 @@ void idft73728(int16_t *input, int16_t *output,int scale) {
int16_t twa98304[49152] __attribute__((aligned(32))); int16_t twa98304[49152] __attribute__((aligned(32)));
int16_t twb98304[49152] __attribute__((aligned(32))); int16_t twb98304[49152] __attribute__((aligned(32)));
// 32768 x 3 // 32768 x 3
void dft98304(int16_t *input, int16_t *output,int scale) { void dft98304(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n"); AssertFatal(1==0,"Need to do this ..\n");
} }
void idft98304(int16_t *input, int16_t *output,int scale) { void idft98304(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n"); AssertFatal(1==0,"Need to do this ..\n");
} }
...@@ -8593,8 +8593,6 @@ void dft1200(int16_t *x,int16_t *y,unsigned char scale_flag) ...@@ -8593,8 +8593,6 @@ void dft1200(int16_t *x,int16_t *y,unsigned char scale_flag)
} }
//#define round trunc
void init_rad4(int N,int16_t *tw) { void init_rad4(int N,int16_t *tw) {
int16_t *twa = tw; int16_t *twa = tw;
...@@ -8716,7 +8714,7 @@ void init_rad5_rep(int N,int16_t *twa,int16_t *twb,int16_t *twc,int16_t *twd) { ...@@ -8716,7 +8714,7 @@ void init_rad5_rep(int N,int16_t *twa,int16_t *twb,int16_t *twc,int16_t *twd) {
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
/* dft library entry points: */ /* dft library entry points: */
void init_dfts(void) int dfts_autoinit(void)
{ {
init_rad4(1024,tw1024); init_rad4(1024,tw1024);
init_rad2(2048,tw2048); init_rad2(2048,tw2048);
...@@ -8763,10 +8761,12 @@ void init_dfts(void) ...@@ -8763,10 +8761,12 @@ void init_dfts(void)
init_rad3_rep(1080,twa1080,twb1080); init_rad3_rep(1080,twa1080,twb1080);
init_rad4_rep(1152,twa1152,twb1152,twc1152); init_rad4_rep(1152,twa1152,twb1152,twc1152);
init_rad4_rep(1200,twa1200,twb1200,twc1200); init_rad4_rep(1200,twa1200,twb1200,twc1200);
return 0;
} }
void dft(uint8_t sizeidx, int16_t *sigF,int16_t *sig,unsigned char scale_flag){ void dft(uint8_t sizeidx, int16_t *sigF,int16_t *sig,unsigned char scale_flag){
AssertFatal((sizeidx>=0 && sizeidx<(int)DFT_SIZE_IDXTABLESIZE),"Invalid dft size index %i\n",sizeidx); AssertFatal((sizeidx>=0 && sizeidx<(int)DFT_SIZE_IDXTABLESIZE),"Invalid dft size index %i\n",sizeidx);
dft_ftab[sizeidx](sigF,sig,scale_flag); dft_ftab[sizeidx](sigF,sig,scale_flag);
...@@ -8779,7 +8779,6 @@ void idft(uint8_t sizeidx, int16_t *sigF,int16_t *sig,unsigned char scale_flag){ ...@@ -8779,7 +8779,6 @@ void idft(uint8_t sizeidx, int16_t *sigF,int16_t *sig,unsigned char scale_flag){
/*---------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------*/
#ifdef MR_MAIN #ifdef MR_MAIN
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
...@@ -8949,12 +8948,12 @@ int main(int argc, char**argv) ...@@ -8949,12 +8948,12 @@ int main(int argc, char**argv)
#ifdef __AVX2__ #ifdef __AVX2__
simd256_q15_t x[4096],x2[4096],y[4096],tw0,tw1,tw2,tw3; simd256_q15_t x[4096],x2[4096],y[4096],tw0,tw1,tw2,tw3;
#else #else
simd_q15_t x[8192],x2[8192],y[8192],tw0,tw1,tw2,tw3; simd_q15_t x[8192],y[8192],tw0,tw1,tw2,tw3;
#endif #endif
int i; int i;
simd_q15_t *x128=(simd_q15_t*)x,*y128=(simd_q15_t*)y; simd_q15_t *x128=(simd_q15_t*)x,*y128=(simd_q15_t*)y;
init_dfts(); dfts_autoinit();
set_taus_seed(0); set_taus_seed(0);
opp_enabled = 1; opp_enabled = 1;
......
...@@ -36,6 +36,8 @@ extern "C" { ...@@ -36,6 +36,8 @@ extern "C" {
#include <stdint.h> #include <stdint.h>
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
struct complex { struct complex {
double x; double x;
...@@ -186,7 +188,7 @@ This function performs optimized fixed-point radix-2 FFT/IFFT. ...@@ -186,7 +188,7 @@ This function performs optimized fixed-point radix-2 FFT/IFFT.
#ifdef OAIDFTS #ifdef OAIDFTS_MAIN
typedef void(*adftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag); typedef void(*adftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag);
typedef void(*aidftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag); typedef void(*aidftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag);
...@@ -195,15 +197,18 @@ void dft24(int16_t *x,int16_t *y,uint8_t scale_flag); ...@@ -195,15 +197,18 @@ void dft24(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft36(int16_t *x,int16_t *y,uint8_t scale_flag); void dft36(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft48(int16_t *x,int16_t *y,uint8_t scale_flag); void dft48(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft60(int16_t *x,int16_t *y,uint8_t scale_flag); void dft60(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft64(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft72(int16_t *x,int16_t *y,uint8_t scale_flag); void dft72(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft96(int16_t *x,int16_t *y,uint8_t scale_flag); void dft96(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft108(int16_t *x,int16_t *y,uint8_t scale_flag); void dft108(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft120(int16_t *x,int16_t *y,uint8_t scale_flag); void dft120(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft128(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft144(int16_t *x,int16_t *y,uint8_t scale_flag); void dft144(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft180(int16_t *x,int16_t *y,uint8_t scale_flag); void dft180(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft192(int16_t *x,int16_t *y,uint8_t scale_flag); void dft192(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft216(int16_t *x,int16_t *y,uint8_t scale_flag); void dft216(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft240(int16_t *x,int16_t *y,uint8_t scale_flag); void dft240(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft256(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft288(int16_t *x,int16_t *y,uint8_t scale_flag); void dft288(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft300(int16_t *x,int16_t *y,uint8_t scale_flag); void dft300(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft324(int16_t *x,int16_t *y,uint8_t scale_flag); void dft324(int16_t *x,int16_t *y,uint8_t scale_flag);
...@@ -211,6 +216,7 @@ void dft360(int16_t *x,int16_t *y,uint8_t scale_flag); ...@@ -211,6 +216,7 @@ void dft360(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft384(int16_t *x,int16_t *y,uint8_t scale_flag); void dft384(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft432(int16_t *x,int16_t *y,uint8_t scale_flag); void dft432(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft480(int16_t *x,int16_t *y,uint8_t scale_flag); void dft480(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft512(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft540(int16_t *x,int16_t *y,uint8_t scale_flag); void dft540(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft576(int16_t *x,int16_t *y,uint8_t scale_flag); void dft576(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft600(int16_t *x,int16_t *y,uint8_t scale_flag); void dft600(int16_t *x,int16_t *y,uint8_t scale_flag);
...@@ -221,208 +227,100 @@ void dft864(int16_t *x,int16_t *y,uint8_t scale_flag); ...@@ -221,208 +227,100 @@ void dft864(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft900(int16_t *x,int16_t *y,uint8_t scale_flag); void dft900(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft960(int16_t *x,int16_t *y,uint8_t scale_flag); void dft960(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft972(int16_t *x,int16_t *y,uint8_t scale_flag); void dft972(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1024(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1080(int16_t *x,int16_t *y,uint8_t scale_flag); void dft1080(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1152(int16_t *x,int16_t *y,uint8_t scale_flag); void dft1152(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1200(int16_t *x,int16_t *y,uint8_t scale_flag); void dft1200(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1536(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft64(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft128(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft256(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft512(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1024(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft2048(int16_t *x,int16_t *y,uint8_t scale_flag); void dft2048(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft3072(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft4096(int16_t *x,int16_t *y,uint8_t scale_flag); void dft4096(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft6144(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft8192(int16_t *x,int16_t *y,uint8_t scale_flag); void dft8192(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft9216(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft12288(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft18432(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft24576(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft36864(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft49152(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft73728(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft98304(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft64(int16_t *x,int16_t *y,uint8_t scale_flag); void idft64(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft128(int16_t *x,int16_t *y,uint8_t scale_flag); void idft128(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft256(int16_t *x,int16_t *y,uint8_t scale_flag); void idft256(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft512(int16_t *x,int16_t *y,uint8_t scale_flag); void idft512(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft1024(int16_t *x,int16_t *y,uint8_t scale_flag); void idft1024(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft1536(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft2048(int16_t *x,int16_t *y,uint8_t scale_flag); void idft2048(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft3072(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft4096(int16_t *x,int16_t *y,uint8_t scale_flag); void idft4096(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft8192(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft1536(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft6144(int16_t *sigF,int16_t *sig,uint8_t scale_flag); void idft6144(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft8192(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft9216(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft12288(int16_t *sigF,int16_t *sig,uint8_t scale_flag); void idft12288(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft18432(int16_t *sigF,int16_t *sig,uint8_t scale_flag); void idft18432(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft3072(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft24576(int16_t *sigF,int16_t *sig,uint8_t scale_flag); void idft24576(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft36864(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft49152(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft73728(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft98304(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft1536(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft3072(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft6144(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft12288(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft18432(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft24576(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
#else #else
typedef void(*dftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag); typedef void(*dftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag);
typedef void(*idftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag); typedef void(*idftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag);
extern dftfunc_t dft; # ifdef OAIDFTS_LOADER
extern idftfunc_t idft; dftfunc_t dft;
idftfunc_t idft;
# else
extern dftfunc_t dft;
extern idftfunc_t idft;
extern int load_dftslib(void);
# endif
#endif #endif
typedef enum DFT_size_idx { typedef enum DFT_size_idx {
DFT_12, DFT_12, DFT_24, DFT_36, DFT_48, DFT_60, DFT_72, DFT_96,
DFT_24, DFT_108, DFT_120, DFT_128, DFT_144, DFT_180, DFT_192, DFT_216, DFT_240,
DFT_36, DFT_256, DFT_288, DFT_300, DFT_324, DFT_360, DFT_384, DFT_432, DFT_480,
DFT_48, DFT_512, DFT_540, DFT_576, DFT_600, DFT_648, DFT_720, DFT_768, DFT_864,
DFT_60, DFT_900, DFT_960, DFT_972, DFT_1024, DFT_1080, DFT_1152, DFT_1200, DFT_1536,
DFT_72, DFT_2048, DFT_3072, DFT_4096, DFT_6144, DFT_8192, DFT_9216, DFT_12288, DFT_18432,
DFT_96, DFT_24576, DFT_36864, DFT_49152, DFT_73728, DFT_98304,
DFT_108, DFT_SIZE_IDXTABLESIZE
DFT_120,
DFT_128,
DFT_144,
DFT_180,
DFT_192,
DFT_216,
DFT_240,
DFT_256,
DFT_288,
DFT_300,
DFT_324,
DFT_360,
DFT_384,
DFT_432,
DFT_480,
DFT_512,
DFT_540,
DFT_576,
DFT_600,
DFT_648,
DFT_720,
DFT_768,
DFT_864,
DFT_900,
DFT_960,
DFT_972,
DFT_1024,
DFT_1080,
DFT_1152,
DFT_1200,
DFT_1536,
DFT_2048,
DFT_3072,
DFT_4096,
DFT_6144,
DFT_8192,
DFT_12288,
DFT_18432,
DFT_24576,
DFT_SIZE_IDXTABLESIZE,
} dft_size_idx_t; } dft_size_idx_t;
#ifdef OAIDFTS #ifdef OAIDFTS_MAIN
adftfunc_t dft_ftab[]={ adftfunc_t dft_ftab[]={
dft12, dft12, dft24, dft36, dft48, dft60, dft72, dft96,
dft24, dft108, dft120, dft128, dft144, dft180, dft192, dft216, dft240,
dft36, dft256, dft288, dft300, dft324, dft360, dft384, dft432, dft480,
dft48, dft512, dft540, dft576, dft600, dft648, dft720, dft768, dft864,
dft60, dft900, dft960, dft972, dft1024, dft1080, dft1152, dft1200, dft1536,
dft72, dft2048, dft3072, dft4096, dft6144, dft8192, dft9216, dft12288, dft18432,
dft96, dft24576, dft36864, dft49152, dft73728, dft98304
dft108,
dft120,
dft128,
dft144,
dft180,
dft192,
dft216,
dft240,
dft256,
dft288,
dft300,
dft324,
dft360,
dft384,
dft432,
dft480,
dft512,
dft540,
dft576,
dft600,
dft648,
dft720,
dft768,
dft864,
dft900,
dft960,
dft972,
dft1024,
dft1080,
dft1152,
dft1200,
dft1536,
dft2048,
dft3072,
dft4096,
dft6144,
dft8192,
dft12288,
dft18432,
dft24576,
}; };
#endif #endif
typedef enum idft_size_idx { typedef enum idft_size_idx {
IDFT_128, IDFT_128, IDFT_256, IDFT_512, IDFT_1024, IDFT_1536, IDFT_2048, IDFT_3072, IDFT_4096,
IDFT_256, IDFT_6144, IDFT_8192, IDFT_9216, IDFT_12288, IDFT_18432, IDFT_24576, IDFT_36864, IDFT_49152,
IDFT_288, IDFT_73728, IDFT_98304,
IDFT_300, IDFT_SIZE_IDXTABLESIZE
IDFT_324,
IDFT_360,
IDFT_384,
IDFT_432,
IDFT_480,
IDFT_512,
IDFT_1024,
IDFT_1536,
IDFT_2048,
IDFT_3072,
IDFT_4096,
IDFT_6144,
IDFT_8192,
IDFT_12288,
IDFT_18432,
IDFT_24576,
IDFT_SIZE_IDXTABLESIZE,
} idft_size_idx_t; } idft_size_idx_t;
#ifdef OAIDFTS #ifdef OAIDFTS_MAIN
aidftfunc_t idft_ftab[]={ aidftfunc_t idft_ftab[]={
idft128, idft128, idft256, idft512, idft1024, idft1536, idft2048, idft3072, idft4096,
idft256, idft6144, idft8192, idft9216, idft12288, idft18432, idft24576, idft36864, idft49152,
idft512, idft73728, idft98304
idft1024,
idft1536,
idft2048,
idft3072,
idft4096,
idft6144,
idft8192,
idft12288,
idft18432,
idft24576,
}; };
#endif #endif
void dft49152(int16_t *sigF,int16_t *sig,int scale);
void idft49152(int16_t *sigF,int16_t *sig,int scale);
void dft9216(int16_t *sigF,int16_t *sig,int scale);
void idft9216(int16_t *sigF,int16_t *sig,int scale);
void dft36864(int16_t *sigF,int16_t *sig,int scale);
void idft36864(int16_t *sigF,int16_t *sig,int scale);
void dft98304(int16_t *sigF,int16_t *sig,int scale);
void idft98304(int16_t *sigF,int16_t *sig,int scale);
void dft73728(int16_t *sigF,int16_t *sig,int scale);
void idft73728(int16_t *sigF,int16_t *sig,int scale);
/*!\fn int32_t rotate_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N,uint16_t output_shift) /*!\fn int32_t rotate_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N,uint16_t output_shift)
This function performs componentwise multiplication of a vector with a complex scalar. This function performs componentwise multiplication of a vector with a complex scalar.
......
...@@ -1917,6 +1917,7 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in ...@@ -1917,6 +1917,7 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in
nr_extract_dci_info(mac,dci->dci_format,dci->payloadSize,dci->rnti,(uint64_t *)dci->payloadBits,&dci_pdu_rel15); nr_extract_dci_info(mac,dci->dci_format,dci->payloadSize,dci->rnti,(uint64_t *)dci->payloadBits,&dci_pdu_rel15);
nr_ue_process_dci(module_id, cc_id, gNB_index, &dci_pdu_rel15, dci->rnti, dci->dci_format); nr_ue_process_dci(module_id, cc_id, gNB_index, &dci_pdu_rel15, dci->rnti, dci->dci_format);
return 0;
} }
int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, nr_dci_pdu_rel15_t *dci, uint16_t rnti, uint32_t dci_format){ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, nr_dci_pdu_rel15_t *dci, uint16_t rnti, uint32_t dci_format){
......
...@@ -570,8 +570,8 @@ void do_PHYSICALCELLGROUP(uint8_t Mod_id, ...@@ -570,8 +570,8 @@ void do_PHYSICALCELLGROUP(uint8_t Mod_id,
void do_SpCellConfig(gNB_RRC_INST *rrc, void do_SpCellConfig(gNB_RRC_INST *rrc,
struct NR_SpCellConfig *spconfig){ struct NR_SpCellConfig *spconfig){
gNB_RrcConfigurationReq *common_configuration; //gNB_RrcConfigurationReq *common_configuration;
common_configuration = CALLOC(1,sizeof(gNB_RrcConfigurationReq)); //common_configuration = CALLOC(1,sizeof(gNB_RrcConfigurationReq));
//Fill servingcellconfigcommon config value //Fill servingcellconfigcommon config value
//Fill common config to structure //Fill common config to structure
// rrc->configuration = common_configuration; // rrc->configuration = common_configuration;
......
...@@ -1691,11 +1691,11 @@ int x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK( x2ap_eNB_instance_t *in ...@@ -1691,11 +1691,11 @@ int x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK( x2ap_eNB_instance_t *in
// Currently hardcoded (dummy) values filling the fields of SgNB_addition_request message. To be substituted // Currently hardcoded (dummy) values filling the fields of SgNB_addition_request message. To be substituted
// with values coming from RRC. // with values coming from RRC.
uint16_t nRencryptionAlgorithms = 0; //uint16_t nRencryptionAlgorithms = 0;
uint16_t nRintegrityProtectionAlgorithms = 0; //uint16_t nRintegrityProtectionAlgorithms = 0;
uint8_t SgNBSecurityKey[32] = { 0 }; //uint8_t SgNBSecurityKey[32] = { 0 };
int uEaggregateMaximumBitRateDownlink = 100000000; //int uEaggregateMaximumBitRateDownlink = 100000000;
int uEaggregateMaximumBitRateUplink = 100000000; //int uEaggregateMaximumBitRateUplink = 100000000;
int e_rabs_admitted_tobeadded = 1; int e_rabs_admitted_tobeadded = 1;
int e_RAB_ID = 1; int e_RAB_ID = 1;
long int pDCPatSgNB = X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present; long int pDCPatSgNB = X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present;
......
...@@ -1773,7 +1773,7 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance, ...@@ -1773,7 +1773,7 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
X2AP_MeNBtoSgNBContainer_t *container = &ie->value.choice.MeNBtoSgNBContainer; X2AP_MeNBtoSgNBContainer_t *container = &ie->value.choice.MeNBtoSgNBContainer;
if (ie->value.choice.MeNBtoSgNBContainer.size > 8192 ) // TODO: this is the size of rrc_buffer in struct x2ap_handover_req_s if (container->size > 8192 ) // TODO: this is the size of rrc_buffer in struct x2ap_handover_req_s
{ printf("%s:%d: fatal: buffer too big\n", __FILE__, __LINE__); abort(); } { printf("%s:%d: fatal: buffer too big\n", __FILE__, __LINE__); abort(); }
memcpy(X2AP_ENDC_SGNB_ADDITION_REQ(msg).rrc_buffer, ie->value.choice.MeNBtoSgNBContainer.buf, ie->value.choice.MeNBtoSgNBContainer.size); memcpy(X2AP_ENDC_SGNB_ADDITION_REQ(msg).rrc_buffer, ie->value.choice.MeNBtoSgNBContainer.buf, ie->value.choice.MeNBtoSgNBContainer.size);
...@@ -1943,7 +1943,6 @@ int x2ap_gNB_handle_ENDC_sGNB_reconfiguration_complete (instance_t instance, ...@@ -1943,7 +1943,6 @@ int x2ap_gNB_handle_ENDC_sGNB_reconfiguration_complete (instance_t instance,
x2ap_eNB_instance_t *instance_p; x2ap_eNB_instance_t *instance_p;
x2ap_eNB_data_t *x2ap_eNB_data; x2ap_eNB_data_t *x2ap_eNB_data;
MessageDef *msg; MessageDef *msg;
int ue_id;
DevAssert (pdu != NULL); DevAssert (pdu != NULL);
x2SgNBReconfigurationComplete = &pdu->choice.initiatingMessage.value.choice.SgNBReconfigurationComplete; x2SgNBReconfigurationComplete = &pdu->choice.initiatingMessage.value.choice.SgNBReconfigurationComplete;
......
...@@ -589,7 +589,7 @@ static void *UE_thread_synch(void *arg) ...@@ -589,7 +589,7 @@ static void *UE_thread_synch(void *arg)
LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode); LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
if (initial_sync( UE, UE->mode ) == 0) { if (initial_sync( UE, UE->mode ) == 0) {
LOG_I( HW, "Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %d (DL %u, UL %u), UE_scan_carrier %d\n", LOG_I( HW, "Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %d (DL %lu, UL %lu), UE_scan_carrier %d\n",
(UE->rx_offset<<1) / UE->frame_parms.samples_per_tti, (UE->rx_offset<<1) / UE->frame_parms.samples_per_tti,
freq_offset, freq_offset,
UE->rx_total_gain_dB, UE->rx_total_gain_dB,
...@@ -714,7 +714,7 @@ static void *UE_thread_synch(void *arg) ...@@ -714,7 +714,7 @@ static void *UE_thread_synch(void *arg)
} }
} }
LOG_I(PHY, "[initial_sync] trying carrier off %d Hz, rxgain %d (DL %u, UL %u)\n", LOG_I(PHY, "[initial_sync] trying carrier off %d Hz, rxgain %d (DL %lu, UL %lu)\n",
freq_offset, freq_offset,
UE->rx_total_gain_dB, UE->rx_total_gain_dB,
downlink_frequency[0][0]+freq_offset, downlink_frequency[0][0]+freq_offset,
...@@ -2071,7 +2071,7 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, ...@@ -2071,7 +2071,7 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue,
txdata = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t *) ); txdata = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t *) );
for (i=0; i<frame_parms->nb_antennas_rx; i++) { for (i=0; i<frame_parms->nb_antennas_rx; i++) {
LOG_I(PHY, "Mapping UE CC_id %d, rx_ant %d, freq %u on card %d, chain %d\n", LOG_I(PHY, "Mapping UE CC_id %d, rx_ant %d, freq %lu on card %d, chain %d\n",
CC_id, i, downlink_frequency[CC_id][i], phy_vars_ue[CC_id]->rf_map.card, (phy_vars_ue[CC_id]->rf_map.chain)+i ); CC_id, i, downlink_frequency[CC_id][i], phy_vars_ue[CC_id]->rf_map.card, (phy_vars_ue[CC_id]->rf_map.chain)+i );
free( phy_vars_ue[CC_id]->common_vars.rxdata[i] ); free( phy_vars_ue[CC_id]->common_vars.rxdata[i] );
rxdata[i] = (int32_t *)malloc16_clear( 307200*sizeof(int32_t) ); rxdata[i] = (int32_t *)malloc16_clear( 307200*sizeof(int32_t) );
...@@ -2079,7 +2079,7 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, ...@@ -2079,7 +2079,7 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue,
} }
for (i=0; i<frame_parms->nb_antennas_tx; i++) { for (i=0; i<frame_parms->nb_antennas_tx; i++) {
LOG_I(PHY, "Mapping UE CC_id %d, tx_ant %d, freq %u on card %d, chain %d\n", LOG_I(PHY, "Mapping UE CC_id %d, tx_ant %d, freq %lu on card %d, chain %d\n",
CC_id, i, downlink_frequency[CC_id][i], phy_vars_ue[CC_id]->rf_map.card, (phy_vars_ue[CC_id]->rf_map.chain)+i ); CC_id, i, downlink_frequency[CC_id][i], phy_vars_ue[CC_id]->rf_map.card, (phy_vars_ue[CC_id]->rf_map.chain)+i );
free( phy_vars_ue[CC_id]->common_vars.txdata[i] ); free( phy_vars_ue[CC_id]->common_vars.txdata[i] );
txdata[i] = (int32_t *)malloc16_clear( 307200*sizeof(int32_t) ); txdata[i] = (int32_t *)malloc16_clear( 307200*sizeof(int32_t) );
......
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