Merge remote-tracking branch 'develop' into NR_DL_MIMO
This commit is contained in:
+48
-12
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "executables/nr-softmodem-common.h"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
@@ -45,10 +46,42 @@
|
||||
|
||||
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
|
||||
|
||||
/*
|
||||
extern uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn);
|
||||
extern openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
*/
|
||||
static
|
||||
uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex)
|
||||
{
|
||||
const uint64_t dl_freq_khz = downlink_frequency / 1000;
|
||||
const int32_t delta_duplex_khz = delta_duplex / 1000;
|
||||
|
||||
uint64_t center_freq_diff_khz = 999999999999999999; // 2^64
|
||||
uint16_t current_band = 0;
|
||||
|
||||
for (int ind = 0; ind < nr_bandtable_size; ind++) {
|
||||
|
||||
LOG_D(PHY, "Scanning band %d, dl_min %"PRIu64", ul_min %"PRIu64"\n", nr_bandtable[ind].band, nr_bandtable[ind].dl_min, nr_bandtable[ind].ul_min);
|
||||
|
||||
if (dl_freq_khz < nr_bandtable[ind].dl_min || dl_freq_khz > nr_bandtable[ind].dl_max)
|
||||
continue;
|
||||
|
||||
int32_t current_offset_khz = nr_bandtable[ind].ul_min - nr_bandtable[ind].dl_min;
|
||||
|
||||
if (current_offset_khz != delta_duplex_khz)
|
||||
continue;
|
||||
|
||||
uint64_t center_frequency_khz = (nr_bandtable[ind].dl_max + nr_bandtable[ind].dl_min) / 2;
|
||||
|
||||
if (abs(dl_freq_khz - center_frequency_khz) < center_freq_diff_khz){
|
||||
current_band = nr_bandtable[ind].band;
|
||||
center_freq_diff_khz = abs(dl_freq_khz - center_frequency_khz);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(PHY, "DL frequency %"PRIu64": band %d, UL frequency %"PRIu64"\n",
|
||||
downlink_frequency, current_band, downlink_frequency+delta_duplex);
|
||||
|
||||
AssertFatal(current_band != 0, "Can't find EUTRA band for frequency %"PRIu64" and duplex_spacing %u\n", downlink_frequency, delta_duplex);
|
||||
|
||||
return current_band;
|
||||
}
|
||||
|
||||
int l1_north_init_gNB() {
|
||||
|
||||
@@ -381,6 +414,13 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Adding nr_schedule_handler
|
||||
void install_nr_schedule_handlers(NR_IF_Module_t *if_inst)
|
||||
{
|
||||
if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||
if_inst->NR_Schedule_response = nr_schedule_response;
|
||||
}
|
||||
/*
|
||||
void install_schedule_handlers(IF_Module_t *if_inst)
|
||||
{
|
||||
@@ -448,7 +488,6 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
|
||||
uint8_t short_sequence, num_sequences, rootSequenceIndex, fd_occasion;
|
||||
NR_DL_FRAME_PARMS *fp = &RC.gNB[Mod_id]->frame_parms;
|
||||
nfapi_nr_config_request_scf_t *gNB_config = &RC.gNB[Mod_id]->gNB_config;
|
||||
int32_t dlul_offset = 0;
|
||||
|
||||
memcpy((void*)gNB_config,phy_config->cfg,sizeof(*phy_config->cfg));
|
||||
RC.gNB[Mod_id]->mac_enabled = 1;
|
||||
@@ -459,13 +498,9 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
|
||||
uint64_t ul_bw_khz = (12*gNB_config->carrier_config.ul_grid_size[gNB_config->ssb_config.scs_common.value].value)*(15<<gNB_config->ssb_config.scs_common.value);
|
||||
fp->ul_CarrierFreq = ((ul_bw_khz>>1) + gNB_config->carrier_config.uplink_frequency.value)*1000 ;
|
||||
|
||||
fp->nr_band = *RC.nrmac[Mod_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
int32_t dlul_offset = fp->ul_CarrierFreq - fp->dl_CarrierFreq;
|
||||
fp->nr_band = get_band(fp->dl_CarrierFreq, dlul_offset);
|
||||
|
||||
get_delta_duplex(fp->nr_band, gNB_config->ssb_config.scs_common.value, &dlul_offset);
|
||||
dlul_offset *= 1000;
|
||||
|
||||
AssertFatal(fp->ul_CarrierFreq == (fp->dl_CarrierFreq + dlul_offset), "Disagreement in uplink frequency for band %d: ul_CarrierFreq = %lu Hz vs expected %lu Hz\n", fp->nr_band, fp->ul_CarrierFreq, fp->dl_CarrierFreq + dlul_offset);
|
||||
|
||||
LOG_I(PHY, "DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %d Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, fp->nr_band, dlul_offset);
|
||||
|
||||
fp->threequarter_fs = openair0_cfg[0].threequarter_fs;
|
||||
@@ -494,11 +529,12 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
|
||||
// }
|
||||
RC.gNB[Mod_id]->configured = 1;
|
||||
|
||||
init_symbol_rotation(fp,fp->dl_CarrierFreq);
|
||||
init_symbol_rotation(fp);
|
||||
|
||||
LOG_I(PHY,"gNB %d configured\n",Mod_id);
|
||||
}
|
||||
|
||||
|
||||
void init_nr_transport(PHY_VARS_gNB *gNB) {
|
||||
int i;
|
||||
int j;
|
||||
|
||||
@@ -335,7 +335,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
}
|
||||
|
||||
|
||||
@@ -350,7 +349,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
ue->pdsch_vars[th_id][gNB_id]->rho[idx] = (int32_t *)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -357,9 +357,8 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||
fp->N_RB_UL = config->carrier_config.ul_grid_size[fp->numerology_index];
|
||||
fp->N_RB_DL = config->carrier_config.dl_grid_size[fp->numerology_index];
|
||||
|
||||
int32_t uplink_frequency_offset = 0;
|
||||
get_delta_duplex(fp->nr_band, fp->numerology_index, &uplink_frequency_offset);
|
||||
get_frame_type(fp->nr_band, fp->numerology_index, &fp->frame_type);
|
||||
fp->frame_type = get_frame_type(fp->nr_band, fp->numerology_index);
|
||||
int32_t uplink_frequency_offset = get_delta_duplex(fp->nr_band, fp->numerology_index);
|
||||
uplink_frequency_offset *= 1000;
|
||||
|
||||
LOG_I(PHY, "Initializing frame parms: DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %d Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, fp->nr_band, uplink_frequency_offset);
|
||||
|
||||
@@ -418,10 +418,10 @@ void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
|
||||
|
||||
void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH)
|
||||
{
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i dft_in128[1][1200], dft_out128[1][1200];
|
||||
#if defined(__x86_64__) || +defined(__i386__)
|
||||
__m128i dft_in128[1][3240], dft_out128[1][3240];
|
||||
#elif defined(__arm__)
|
||||
int16x8_t dft_in128[1][1200], dft_out128[1][1200];
|
||||
int16x8_t dft_in128[1][3240], dft_out128[1][3240];
|
||||
#endif
|
||||
uint32_t *dft_in0 = (uint32_t*)dft_in128[0], *dft_out0 = (uint32_t*)dft_out128[0];
|
||||
|
||||
@@ -433,8 +433,10 @@ void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH)
|
||||
int16x8_t norm128;
|
||||
#endif
|
||||
|
||||
for (i = 0, ip = 0; i < Msc_PUSCH; i++, ip+=4) {
|
||||
dft_in0[ip] = d[i];
|
||||
if ((Msc_PUSCH % 1536) > 0) {
|
||||
for (i = 0, ip = 0; i < Msc_PUSCH; i++, ip+=4) {
|
||||
dft_in0[ip] = d[i];
|
||||
}
|
||||
}
|
||||
|
||||
switch (Msc_PUSCH) {
|
||||
@@ -573,7 +575,7 @@ void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH)
|
||||
break;
|
||||
|
||||
case 972:
|
||||
dft(DFT_960,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_972,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1080:
|
||||
@@ -587,44 +589,159 @@ void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH)
|
||||
case 1200:
|
||||
dft(DFT_1200,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1296:
|
||||
dft(DFT_1296,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1440:
|
||||
dft(DFT_1440,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1500:
|
||||
dft(DFT_1500,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
//dft(DFT_1536,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_1536,(int16_t*)d, (int16_t*)z, 1);
|
||||
break;
|
||||
|
||||
case 1620:
|
||||
dft(DFT_1620,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1728:
|
||||
dft(DFT_1728,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1800:
|
||||
dft(DFT_1800,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1920:
|
||||
dft(DFT_1920,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1944:
|
||||
dft(DFT_1944,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2160:
|
||||
dft(DFT_2160,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2304:
|
||||
dft(DFT_2304,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2400:
|
||||
dft(DFT_2400,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2592:
|
||||
dft(DFT_2592,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2700:
|
||||
dft(DFT_2700,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2880:
|
||||
dft(DFT_2880,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2916:
|
||||
dft(DFT_2916,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 3000:
|
||||
dft(DFT_3000,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
case 3072:
|
||||
//dft(DFT_3072,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
dft(DFT_3072,(int16_t*)d, (int16_t*)z, 1);
|
||||
break;
|
||||
|
||||
case 3240:
|
||||
dft(DFT_3240,(int16_t*)dft_in0, (int16_t*)dft_out0, 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
// should not be reached
|
||||
LOG_E( PHY, "Unsupported Msc_PUSCH value of %"PRIu16"\n", Msc_PUSCH );
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
for (i = 0, ip = 0; i < Msc_PUSCH; i++, ip+=4) {
|
||||
z[i] = dft_out0[ip];
|
||||
|
||||
if ((Msc_PUSCH % 1536) > 0) {
|
||||
for (i = 0, ip = 0; i < Msc_PUSCH; i++, ip+=4)
|
||||
z[i] = dft_out0[ip];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq)
|
||||
{
|
||||
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) {
|
||||
|
||||
uint64_t dl_CarrierFreq = fp->dl_CarrierFreq;
|
||||
uint64_t ul_CarrierFreq = fp->ul_CarrierFreq;
|
||||
double f[2] = {(double)dl_CarrierFreq, (double)ul_CarrierFreq};
|
||||
|
||||
const int nsymb = fp->symbols_per_slot * fp->slots_per_frame/10;
|
||||
const double Tc=(1/480e3/4096);
|
||||
const double Nu=2048*64*(1/(float)(1<<fp->numerology_index));
|
||||
const double f0= (double)CarrierFreq;
|
||||
const double Ncp0=16*64 + (144*64*(1/(float)(1<<fp->numerology_index)));
|
||||
const double Ncp1=(144*64*(1/(float)(1<<fp->numerology_index)));
|
||||
double tl=0,poff,exp_re,exp_im;
|
||||
double Ncp,Ncpm1=Ncp0;
|
||||
|
||||
poff = 2*M_PI*((Ncp0*Tc))*f0;
|
||||
exp_re = cos(poff);
|
||||
exp_im = sin(-poff);
|
||||
fp->symbol_rotation[0]=(int16_t)floor(exp_re*32767);
|
||||
fp->symbol_rotation[1]=(int16_t)floor(exp_im*32767);
|
||||
LOG_I(PHY,"Doing symbol rotation calculation for gNB TX/RX, f0 %f Hz, Nsymb %d\n",f0,nsymb);
|
||||
LOG_I(PHY,"Symbol rotation %d/%d => (%d,%d)\n",0,nsymb,fp->symbol_rotation[0],fp->symbol_rotation[1]);
|
||||
for (uint8_t ll = 0; ll < 2; ll++){
|
||||
|
||||
for (int l=1; l<nsymb; l++) {
|
||||
if (l==(7*(1<<fp->numerology_index))) Ncp=Ncp0;
|
||||
else Ncp=Ncp1;
|
||||
tl += (Nu+Ncpm1)*Tc;
|
||||
poff = 2*M_PI*(tl + (Ncp*Tc))*f0;
|
||||
exp_re = cos(poff);
|
||||
exp_im = sin(-poff);
|
||||
fp->symbol_rotation[l<<1]=(int16_t)floor(exp_re*32767);
|
||||
fp->symbol_rotation[1+(l<<1)]=(int16_t)floor(exp_im*32767);
|
||||
LOG_I(PHY,"Symbol rotation %d/%d => tl %f (%d,%d) (%f)\n", l, nsymb, tl, fp->symbol_rotation[l<<1], fp->symbol_rotation[1+(l<<1)], (poff/2/M_PI)-floor(poff/2/M_PI));
|
||||
Ncpm1=Ncp;
|
||||
double f0 = f[ll];
|
||||
double Ncpm1 = Ncp0;
|
||||
int16_t *symbol_rotation = fp->symbol_rotation[ll];
|
||||
|
||||
double tl = 0;
|
||||
double poff = 2 * M_PI * ((Ncp0 * Tc)) * f0;
|
||||
double exp_re = cos(poff);
|
||||
double exp_im = sin(-poff);
|
||||
symbol_rotation[0] = (int16_t)floor(exp_re * 32767);
|
||||
symbol_rotation[1] = (int16_t)floor(exp_im * 32767);
|
||||
LOG_I(PHY, "Doing symbol rotation calculation for gNB TX/RX, f0 %f Hz, Nsymb %d\n", f0, nsymb);
|
||||
LOG_I(PHY, "Symbol rotation %d/%d => (%d,%d)\n",
|
||||
0,
|
||||
nsymb,
|
||||
symbol_rotation[0],
|
||||
symbol_rotation[1]);
|
||||
|
||||
for (int l = 1; l < nsymb; l++) {
|
||||
|
||||
double Ncp;
|
||||
if (l == (7 * (1 << fp->numerology_index))) {
|
||||
Ncp = Ncp0;
|
||||
} else {
|
||||
Ncp = Ncp1;
|
||||
}
|
||||
|
||||
tl += (Nu + Ncpm1) * Tc;
|
||||
poff = 2 * M_PI * (tl + (Ncp * Tc)) * f0;
|
||||
exp_re = cos(poff);
|
||||
exp_im = sin(-poff);
|
||||
symbol_rotation[l<<1] = (int16_t)floor(exp_re * 32767);
|
||||
symbol_rotation[1 + (l<<1)] = (int16_t)floor(exp_im * 32767);
|
||||
|
||||
LOG_I(PHY, "Symbol rotation %d/%d => tl %f (%d,%d) (%f)\n",
|
||||
l,
|
||||
nsymb,
|
||||
tl,
|
||||
symbol_rotation[l<<1],
|
||||
symbol_rotation[1 + (l<<1)],
|
||||
(poff / 2 / M_PI) - floor(poff / 2 / M_PI));
|
||||
|
||||
Ncpm1 = Ncp;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
|
||||
int nsymb,
|
||||
int length);
|
||||
|
||||
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq);
|
||||
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp);
|
||||
|
||||
void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *rxdataF,
|
||||
|
||||
@@ -306,15 +306,23 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
|
||||
int length) {
|
||||
int symb_offset = (slot%fp->slots_per_subframe)*fp->symbols_per_slot;
|
||||
|
||||
int16_t *symbol_rotation = fp->symbol_rotation[0];
|
||||
|
||||
for (int sidx=0;sidx<nsymb;sidx++) {
|
||||
|
||||
LOG_D(PHY,"Rotating symbol %d, slot %d, symbol_subframe_index %d, length %d (%d,%d)\n",
|
||||
first_symbol+sidx,slot,sidx+first_symbol+symb_offset,length,
|
||||
fp->symbol_rotation[2*(sidx+first_symbol+symb_offset)],fp->symbol_rotation[1+2*(sidx+first_symbol+symb_offset)]);
|
||||
rotate_cpx_vector(trxdata+(sidx*length*2),
|
||||
&fp->symbol_rotation[2*(sidx+first_symbol+symb_offset)],
|
||||
trxdata+(sidx*length*2),
|
||||
length,
|
||||
15);
|
||||
first_symbol + sidx,
|
||||
slot,
|
||||
sidx + first_symbol + symb_offset,
|
||||
length,
|
||||
symbol_rotation[2 * (sidx + first_symbol + symb_offset)],
|
||||
symbol_rotation[1 + 2 * (sidx + first_symbol + symb_offset)]);
|
||||
|
||||
rotate_cpx_vector(trxdata + (sidx * length * 2),
|
||||
&symbol_rotation[2 * (sidx + first_symbol + symb_offset)],
|
||||
trxdata + (sidx * length * 2),
|
||||
length,
|
||||
15);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||
#endif
|
||||
|
||||
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
|
||||
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation)[symbol+symb_offset];
|
||||
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[0])[symbol + symb_offset];
|
||||
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1];
|
||||
rotate_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
||||
(int16_t*)&rot2,
|
||||
@@ -386,7 +386,7 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
|
||||
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation)[symbol+symb_offset];
|
||||
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[0])[symbol + symb_offset];
|
||||
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1];
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
@@ -513,7 +513,7 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
for (int symbol=0;symbol<nsymb;symbol++) {
|
||||
|
||||
uint32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation)[symbol+symb_offset];
|
||||
uint32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[1])[symbol + symb_offset];
|
||||
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1];
|
||||
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]);
|
||||
rotate_cpx_vector((int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
|
||||
|
||||
@@ -61,8 +61,6 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
debug_ch_est = fopen("debug_ch_est.txt","w");
|
||||
#endif
|
||||
|
||||
//uint16_t Nid_cell = (eNB_offset == 0) ? gNB->frame_parms.Nid_cell : gNB->measurements.adj_cell_id[eNB_offset-1];
|
||||
|
||||
uint8_t nushift;
|
||||
int **ul_ch_estimates = gNB->pusch_vars[ul_id]->ul_ch_estimates;
|
||||
int **rxdataF = gNB->common_vars.rxdataF;
|
||||
@@ -79,12 +77,17 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
uint16_t nb_rb_pusch = pusch_pdu->rb_size;
|
||||
|
||||
/*
|
||||
#ifdef DEBUG_CH
|
||||
printf("PUSCH Channel Estimation : ch_offset %d, symbol_offset %d OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d symbol %d\n", ,ch_offset,symbol_offset,gNB->frame_parms.ofdm_symbol_size,
|
||||
gNB->frame_parms.Ncp,l,Ns,k, symbol);
|
||||
LOG_D(PHY, "In %s: ch_offset %d, symbol_offset %d OFDM size %d, Ns = %d, k = %d symbol %d\n",
|
||||
__FUNCTION__,
|
||||
ch_offset,
|
||||
symbol_offset,
|
||||
gNB->frame_parms.ofdm_symbol_size,
|
||||
Ns,
|
||||
k,
|
||||
symbol);
|
||||
#endif
|
||||
*/
|
||||
|
||||
switch (nushift) {
|
||||
case 0:
|
||||
fl = filt8_l0;
|
||||
@@ -124,9 +127,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
//------------------generate DMRS------------------//
|
||||
|
||||
if (pusch_pdu->transform_precoding == transform_precoder_disabled)
|
||||
if (pusch_pdu->transform_precoding == transform_precoder_disabled) {
|
||||
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], 1000, 0, nb_rb_pusch, pusch_pdu->rb_start*NR_NB_SC_PER_RB, pusch_pdu->dmrs_config_type);
|
||||
|
||||
}
|
||||
else { // if transform precoding or SC-FDMA is enabled in Uplink
|
||||
|
||||
// NR_SC_FDMA supports type1 DMRS so only 6 DMRS REs per RB possible
|
||||
@@ -151,13 +154,19 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
//------------------------------------------------//
|
||||
|
||||
|
||||
|
||||
#ifdef DEBUG_PUSCH
|
||||
for (int i=0;i<(6*nb_rb_pusch);i++)
|
||||
printf("%d+j*(%d)\n",((int16_t*)pilot)[2*i],((int16_t*)pilot)[1+(2*i)]);
|
||||
for (int i = 0; i < (6 * nb_rb_pusch); i++) {
|
||||
LOG_I(PHY, "In %s: %d + j*(%d)\n",
|
||||
__FUNCTION__,
|
||||
((int16_t*)pilot)[2 * i],
|
||||
((int16_t*)pilot)[1 + (2 * i)]);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (aarx=0; aarx<gNB->frame_parms.nb_antennas_rx; aarx++) {
|
||||
|
||||
re_offset = k; /* Initializing the Resource element offset for each Rx antenna */
|
||||
|
||||
pil = (int16_t *)&pilot[0];
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)];
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
|
||||
@@ -166,11 +175,11 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
memset(ul_ch,0,4*(gNB->frame_parms.ofdm_symbol_size));
|
||||
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("symbol_offset %d, nushift %d\n",symbol_offset,nushift);
|
||||
printf("ch est pilot addr %p RB_DL %d\n",&pilot[0], gNB->frame_parms.N_RB_UL);
|
||||
printf("bwp_start_subcarrier %d, k %d, first_carrier %d, nb_rb_pusch %d\n",bwp_start_subcarrier,k,gNB->frame_parms.first_carrier_offset,nb_rb_pusch);
|
||||
printf("rxF addr %p p %d\n", rxF,p);
|
||||
printf("ul_ch addr %p nushift %d\n",ul_ch,nushift);
|
||||
LOG_I(PHY, "In %s symbol_offset %d, nushift %d\n", __FUNCTION__, symbol_offset, nushift);
|
||||
LOG_I(PHY, "In %s ch est pilot addr %p, N_RB_UL %d\n", __FUNCTION__, &pilot[0], gNB->frame_parms.N_RB_UL);
|
||||
LOG_I(PHY, "In %s bwp_start_subcarrier %d, k %d, first_carrier %d, nb_rb_pusch %d\n", __FUNCTION__, bwp_start_subcarrier, k, gNB->frame_parms.first_carrier_offset, nb_rb_pusch);
|
||||
LOG_I(PHY, "In %s rxF addr %p p %d\n", __FUNCTION__, rxF, p);
|
||||
LOG_I(PHY, "In %s ul_ch addr %p nushift %d\n", __FUNCTION__, ul_ch, nushift);
|
||||
#endif
|
||||
//if ((gNB->frame_parms.N_RB_UL&1)==0) {
|
||||
|
||||
@@ -181,9 +190,18 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("ch 0 %d\n",((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1]));
|
||||
printf("pilot 0 : rxF - > (%d,%d) (%d) ch -> (%d,%d) (%d), pil -> (%d,%d) \n",rxF[0],rxF[1],dBc(rxF[0],rxF[1]),ch[0],ch[1],dBc(ch[0],ch[1]),pil[0],pil[1]);
|
||||
printf("data 0 : rxF - > (%d,%d) (%d)\n",rxF[2],rxF[3],dBc(rxF[2],rxF[3]));
|
||||
LOG_I(PHY, "In %s ch 0 %d\n", __FUNCTION__, ((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1]));
|
||||
LOG_I(PHY, "In %s pilot 0 : rxF - > (%d,%d) (%d) ch -> (%d,%d) (%d), pil -> (%d,%d) \n",
|
||||
__FUNCTION__,
|
||||
rxF[0],
|
||||
rxF[1],
|
||||
dBc(rxF[0],rxF[1]),
|
||||
ch[0],
|
||||
ch[1],
|
||||
dBc(ch[0],ch[1]),
|
||||
pil[0],
|
||||
pil[1]);
|
||||
LOG_I(PHY, "In %s data 0 : rxF - > (%d,%d) (%d)\n", __FUNCTION__, rxF[2], rxF[3], dBc(rxF[2],rxF[3]));
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(fl,
|
||||
@@ -200,9 +218,23 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("pilot 1 : rxF - > (%d,%d) (%d) ch -> (%d,%d) (%d), pil -> (%d,%d) \n",rxF[0],rxF[1],dBc(rxF[0],rxF[1]),ch[0],ch[1],dBc(ch[0],ch[1]),pil[0],pil[1]);
|
||||
printf("data 1 : rxF - > (%d,%d) (%d)\n",rxF[2],rxF[3],dBc(rxF[2],rxF[3]));
|
||||
LOG_I(PHY, "In %s pilot 1 : rxF - > (%d,%d) (%d) ch -> (%d,%d) (%d), pil -> (%d,%d) \n",
|
||||
__FUNCTION__,
|
||||
rxF[0],
|
||||
rxF[1],
|
||||
dBc(rxF[0],rxF[1]),
|
||||
ch[0],
|
||||
ch[1],
|
||||
dBc(ch[0],ch[1]),
|
||||
pil[0],
|
||||
pil[1]);
|
||||
LOG_I(PHY, "In %s data 1 : rxF - > (%d,%d) (%d)\n",
|
||||
__FUNCTION__,
|
||||
rxF[2],
|
||||
rxF[3],
|
||||
dBc(rxF[2],rxF[3]));
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(fml,
|
||||
ch,
|
||||
ul_ch,
|
||||
@@ -216,9 +248,23 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("pilot 2 : rxF - > (%d,%d) (%d) ch -> (%d,%d) (%d), pil -> (%d,%d) \n",rxF[0],rxF[1],dBc(rxF[0],rxF[1]),ch[0],ch[1],dBc(ch[0],ch[1]),pil[0],pil[1]);
|
||||
printf("data 2 : rxF - > (%d,%d) (%d)\n",rxF[2],rxF[3],dBc(rxF[2],rxF[3]));
|
||||
LOG_I(PHY, "In %s pilot 2 : rxF - > (%d,%d) (%d) ch -> (%d,%d) (%d), pil -> (%d,%d) \n",
|
||||
__FUNCTION__,
|
||||
rxF[0],
|
||||
rxF[1],
|
||||
dBc(rxF[0],rxF[1]),
|
||||
ch[0],
|
||||
ch[1],
|
||||
dBc(ch[0],ch[1]),
|
||||
pil[0],
|
||||
pil[1]);
|
||||
LOG_I(PHY, "In %s data 2 : rxF - > (%d,%d) (%d)\n",
|
||||
__FUNCTION__,
|
||||
rxF[2],
|
||||
rxF[3],
|
||||
dBc(rxF[2],rxF[3]));
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(fmm,
|
||||
ch,
|
||||
ul_ch,
|
||||
|
||||
@@ -40,9 +40,9 @@
|
||||
#include "PHY/defs_gNB.h"
|
||||
|
||||
/*Table 7.4.1.1.2-1/2 from 38.211 */
|
||||
int wf1[8][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,1}};
|
||||
int wf1[8][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}};
|
||||
int wt1[8][2] = {{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1}};
|
||||
int wf2[12][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,1},{1,1},{1,-1},{1,1},{1,1}};
|
||||
int wf2[12][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}};
|
||||
int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1}};
|
||||
|
||||
// complex conjugate of mod table
|
||||
|
||||
@@ -51,7 +51,7 @@ void init_byte2m64(void) {
|
||||
((int16_t*)&byte2m64_re[s])[0],((int16_t*)&byte2m64_im[s])[0],
|
||||
((int16_t*)&byte2m64_re[s])[1],((int16_t*)&byte2m64_im[s])[1],
|
||||
((int16_t*)&byte2m64_re[s])[2],((int16_t*)&byte2m64_im[s])[2],
|
||||
((int16_t*)&byte2m64_re[s])[3],((int16_t*)&byte2m64_im[s])[3]);
|
||||
((int16_t*)&byte2m64_re[s])[3],((int16_t*)&byte2m64_im[s])[3]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,19 +148,18 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
|
||||
uint16_t n_dmrs;
|
||||
if (rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1) {
|
||||
nb_re_dmrs = 6*rel15->numDmrsCdmGrpsNoData;
|
||||
n_dmrs = ((rel15->rbSize+rel15->rbStart)*6)<<1;
|
||||
}
|
||||
else {
|
||||
nb_re_dmrs = 4*rel15->numDmrsCdmGrpsNoData;
|
||||
n_dmrs = ((rel15->rbSize+rel15->rbStart)*4)<<1;
|
||||
}
|
||||
n_dmrs = (rel15->rbSize+rel15->rbStart)*nb_re_dmrs;
|
||||
|
||||
uint16_t dmrs_symbol_map = rel15->dlDmrsSymbPos;//single DMRS: 010000100 Double DMRS 110001100
|
||||
uint8_t dmrs_len = get_num_dmrs(rel15->dlDmrsSymbPos);
|
||||
uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->nrOfLayers;
|
||||
uint8_t Qm = rel15->qamModOrder[0];
|
||||
uint32_t encoded_length = nb_re*Qm;
|
||||
int16_t mod_dmrs[14][n_dmrs] __attribute__ ((aligned(16)));
|
||||
int16_t mod_dmrs[14][n_dmrs<<1] __attribute__ ((aligned(16)));
|
||||
|
||||
/* PTRS */
|
||||
uint16_t beta_ptrs = 1;
|
||||
@@ -269,10 +268,10 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
|
||||
/// DMRS QPSK modulation
|
||||
for (int l=rel15->StartSymbolIndex; l<rel15->StartSymbolIndex+rel15->NrOfSymbols; l++) {
|
||||
if (rel15->dlDmrsSymbPos & (1 << l)) {
|
||||
nr_modulation(pdsch_dmrs[l][0], n_dmrs, DMRS_MOD_ORDER, mod_dmrs[l]); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
|
||||
nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs[l]); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
|
||||
|
||||
#ifdef DEBUG_DLSCH
|
||||
printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l, n_dmrs>>1, dmrs_Type);
|
||||
printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l, n_dmrs, dmrs_Type);
|
||||
for (int i=0; i<n_dmrs>>4; i++) {
|
||||
for (int j=0; j<8; j++) {
|
||||
printf("%d %d\t", mod_dmrs[l][((i<<3)+j)<<1], mod_dmrs[l][(((i<<3)+j)<<1)+1]);
|
||||
|
||||
@@ -16,10 +16,10 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
|
||||
{
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i idft_in128[1][1200], idft_out128[1][1200];
|
||||
__m128i idft_in128[1][3240], idft_out128[1][3240];
|
||||
__m128i norm128;
|
||||
#elif defined(__arm__)
|
||||
int16x8_t idft_in128[1][1200], idft_out128[1][1200];
|
||||
int16x8_t idft_in128[1][3240], idft_out128[1][3240];
|
||||
int16x8_t norm128;
|
||||
#endif
|
||||
int16_t *idft_in0 = (int16_t*)idft_in128[0], *idft_out0 = (int16_t*)idft_out128[0];
|
||||
@@ -28,20 +28,19 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
|
||||
|
||||
LOG_T(PHY,"Doing lte_idft for Msc_PUSCH %d\n",Msc_PUSCH);
|
||||
|
||||
// conjugate input
|
||||
for (i = 0; i < (Msc_PUSCH>>2); i++) {
|
||||
if ((Msc_PUSCH % 1536) > 0) {
|
||||
// conjugate input
|
||||
for (i = 0; i < (Msc_PUSCH>>2); i++) {
|
||||
#if defined(__x86_64__)||defined(__i386__)
|
||||
*&(((__m128i*)z)[i]) = _mm_sign_epi16(*&(((__m128i*)z)[i]), *(__m128i*)&conjugate2[0]);
|
||||
*&(((__m128i*)z)[i]) = _mm_sign_epi16(*&(((__m128i*)z)[i]), *(__m128i*)&conjugate2[0]);
|
||||
#elif defined(__arm__)
|
||||
*&(((int16x8_t*)z)[i]) = vmulq_s16(*&(((int16x8_t*)z)[i]), *(int16x8_t*)&conjugate2[0]);
|
||||
*&(((int16x8_t*)z)[i]) = vmulq_s16(*&(((int16x8_t*)z)[i]), *(int16x8_t*)&conjugate2[0]);
|
||||
#endif
|
||||
}
|
||||
for (i = 0, ip = 0; i < Msc_PUSCH; i++, ip+=4)
|
||||
((uint32_t*)idft_in0)[ip+0] = z[i];
|
||||
}
|
||||
|
||||
for (i=0,ip=0; i<Msc_PUSCH; i++, ip+=4) {
|
||||
((int32_t*)idft_in0)[ip+0] = z[i];
|
||||
}
|
||||
|
||||
|
||||
switch (Msc_PUSCH) {
|
||||
case 12:
|
||||
dft(DFT_12,(int16_t *)idft_in0, (int16_t *)idft_out0,0);
|
||||
@@ -194,25 +193,102 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
|
||||
dft(DFT_1200,idft_in0, idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1296:
|
||||
dft(DFT_1296,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1440:
|
||||
dft(DFT_1440,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1500:
|
||||
dft(DFT_1500,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
//dft(DFT_1536,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
idft(IDFT_1536,(int16_t*)z, (int16_t*)z, 1);
|
||||
break;
|
||||
|
||||
case 1620:
|
||||
dft(DFT_1620,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1728:
|
||||
dft(DFT_1728,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1800:
|
||||
dft(DFT_1800,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1920:
|
||||
dft(DFT_1920,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 1944:
|
||||
dft(DFT_1944,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2160:
|
||||
dft(DFT_2160,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2304:
|
||||
dft(DFT_2304,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2400:
|
||||
dft(DFT_2400,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2592:
|
||||
dft(DFT_2592,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2700:
|
||||
dft(DFT_2700,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2880:
|
||||
dft(DFT_2880,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 2916:
|
||||
dft(DFT_2916,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 3000:
|
||||
dft(DFT_3000,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
case 3072:
|
||||
//dft(DFT_3072,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
idft(IDFT_3072,(int16_t*)z, (int16_t*)z, 1);
|
||||
break;
|
||||
|
||||
case 3240:
|
||||
dft(DFT_3240,(int16_t*)idft_in0, (int16_t*)idft_out0, 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
// should not be reached
|
||||
LOG_E( PHY, "Unsupported Msc_PUSCH value of %"PRIu16"\n", Msc_PUSCH );
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Msc_PUSCH % 1536) > 0) {
|
||||
for (i = 0, ip = 0; i < Msc_PUSCH; i++, ip+=4)
|
||||
z[i] = ((uint32_t*)idft_out0)[ip];
|
||||
|
||||
|
||||
for (i = 0, ip = 0; i < Msc_PUSCH; i++, ip+=4) {
|
||||
z[i] = ((int32_t*)idft_out0)[ip];
|
||||
}
|
||||
|
||||
// conjugate output
|
||||
for (i = 0; i < (Msc_PUSCH>>2); i++) {
|
||||
// conjugate output
|
||||
for (i = 0; i < (Msc_PUSCH>>2); i++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
((__m128i*)z)[i] = _mm_sign_epi16(((__m128i*)z)[i], *(__m128i*)&conjugate2[0]);
|
||||
((__m128i*)z)[i] = _mm_sign_epi16(((__m128i*)z)[i], *(__m128i*)&conjugate2[0]);
|
||||
#elif defined(__arm__)
|
||||
*&(((int16x8_t*)z)[i]) = vmulq_s16(*&(((int16x8_t*)z)[i]), *(int16x8_t*)&conjugate2[0]);
|
||||
*&(((int16x8_t*)z)[i]) = vmulq_s16(*&(((int16x8_t*)z)[i]), *(int16x8_t*)&conjugate2[0]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
@@ -222,6 +298,7 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
|
||||
|
||||
}
|
||||
|
||||
|
||||
void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
NR_gNB_PUSCH *pusch_vars,
|
||||
unsigned char symbol,
|
||||
|
||||
@@ -158,7 +158,6 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
|
||||
if ((reg % reg_bundle_size_L) == 0) r++;
|
||||
}
|
||||
|
||||
|
||||
// Get cce_list indices by reg_idx in ascending order
|
||||
int f_bundle_j_list_id = 0;
|
||||
int f_bundle_j_list_ord[NR_MAX_PDCCH_AGG_LEVEL] = {};
|
||||
@@ -175,7 +174,6 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(int reg=0; reg<((coreset_nbr_rb*coreset_time_dur)); reg++) {
|
||||
|
||||
f_reg = (f_bundle_j_list_ord[reg/6]*reg_bundle_size_L)+(reg%reg_bundle_size_L);
|
||||
|
||||
@@ -975,8 +975,8 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
|
||||
//rho[aarx][nb_aatx*nb_aatx] = [cov(H_aarx_0,H_aarx_0) cov(H_aarx_0,H_aarx_1)
|
||||
// cov(H_aarx_1,H_aarx_0) cov(H_aarx_1,H_aarx_1)], aarx=0,...,nb_antennas_rx-1
|
||||
|
||||
int avg_rho_re[frame_parms->nb_antennas_rx][nb_aatx];
|
||||
int avg_rho_im[frame_parms->nb_antennas_rx][nb_aatx];
|
||||
int avg_rho_re[frame_parms->nb_antennas_rx][nb_aatx*nb_aatx];
|
||||
int avg_rho_im[frame_parms->nb_antennas_rx][nb_aatx*nb_aatx];
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
@@ -1085,7 +1085,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
|
||||
//measurements->rx_correlation[0][0][aarx] = signal_energy(&rho[aarx][aatx*nb_aatx+atx][symbol*nb_rb*12],rb*12);
|
||||
avg_rho_re[aarx][aatx*nb_aatx+atx] = 16*avg_rho_re[aarx][aatx*nb_aatx+atx]/(nb_rb*12);
|
||||
avg_rho_im[aarx][aatx*nb_aatx+atx] = 16*avg_rho_im[aarx][aatx*nb_aatx+atx]/(nb_rb*12);
|
||||
printf("rho[rx]%d tx%d tx%d = Re: %d Im: %d\n",aarx, aatx,atx, avg_rho_re[aatx*nb_aatx+atx], avg_rho_im[aatx*nb_aatx+atx]);
|
||||
printf("rho[rx]%d tx%d tx%d = Re: %d Im: %d\n",aarx, aatx,atx, avg_rho_re[aarx][aatx*nb_aatx+atx], avg_rho_im[aarx][aatx*nb_aatx+atx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2247,7 +2247,7 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
|
||||
}
|
||||
|
||||
void nr_dlsch_detection_mrc(int **rxdataF_comp,
|
||||
int **rho,
|
||||
int ***rho,
|
||||
int **dl_ch_mag,
|
||||
int **dl_ch_magb,
|
||||
short n_tx,
|
||||
|
||||
@@ -891,7 +891,7 @@ void nr_dlsch_channel_level_median(int **dl_ch_estimates_ext,
|
||||
int start_point);
|
||||
|
||||
void nr_dlsch_detection_mrc(int **rxdataF_comp,
|
||||
int **rho,
|
||||
int ***rho,
|
||||
int **dl_ch_mag,
|
||||
int **dl_ch_magb,
|
||||
short n_tx,
|
||||
|
||||
@@ -105,6 +105,8 @@ typedef struct {
|
||||
uint8_t O_ACK;
|
||||
/// Index of current HARQ round for this ULSCH
|
||||
uint8_t round;
|
||||
/// Last Ndi for this harq process
|
||||
uint8_t ndi;
|
||||
/// pointer to pdu from MAC interface (TS 36.212 V15.4.0, Sec 5.1 p. 8)
|
||||
unsigned char *a;
|
||||
/// Pointer to the payload + CRC
|
||||
|
||||
@@ -78,13 +78,15 @@ void nr_rf_card_config(openair0_config_t *openair0_cfg,
|
||||
|
||||
openair0_cfg->autocal[i] = 1;
|
||||
|
||||
LOG_I(PHY, "HW: Configuring channel %d (rf_chain %d): setting tx_gain %f, rx_gain %f, tx_freq %f Hz, rx_freq %f Hz\n",
|
||||
i,
|
||||
rf_chain,
|
||||
openair0_cfg->tx_gain[i],
|
||||
openair0_cfg->rx_gain[i],
|
||||
openair0_cfg->tx_freq[i],
|
||||
openair0_cfg->rx_freq[i]);
|
||||
if (i < openair0_cfg->rx_num_channels) {
|
||||
LOG_I(PHY, "HW: Configuring channel %d (rf_chain %d): setting tx_gain %f, rx_gain %f, tx_freq %f Hz, rx_freq %f Hz\n",
|
||||
i,
|
||||
rf_chain,
|
||||
openair0_cfg->tx_gain[i],
|
||||
openair0_cfg->rx_gain[i],
|
||||
openair0_cfg->tx_freq[i],
|
||||
openair0_cfg->rx_freq[i]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,6 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL,
|
||||
for (i=0; i<number_of_harq_pids; i++) {
|
||||
ulsch->harq_processes[i]->round=0;
|
||||
}
|
||||
|
||||
return(ulsch);
|
||||
}
|
||||
}
|
||||
@@ -257,7 +256,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
Ilbrm = 0;
|
||||
Tbslbrm = 950984; //max tbs
|
||||
Coderate = 0.0;
|
||||
harq_process->round = nr_rv_round_map_ue[harq_process->pusch_pdu.pusch_data.rv_index];
|
||||
|
||||
///////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -267,8 +265,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
LOG_D(PHY,"ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->pusch_pdu.nrOfLayers);
|
||||
LOG_D(PHY,"ulsch coding A %d G %d mod_order %d\n", A,G, mod_order);
|
||||
|
||||
// if (harq_process->Ndi == 1) { // this is a new packet
|
||||
if (harq_process->round == 0) { // this is a new packet
|
||||
if (harq_process->ndi != harq_process->pusch_pdu.pusch_data.new_data_indicator) { // this is a new packet
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("encoding thinks this is a new packet \n");
|
||||
#endif
|
||||
@@ -415,7 +412,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
|
||||
///////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
harq_process->ndi = harq_process->pusch_pdu.pusch_data.new_data_indicator;
|
||||
}
|
||||
F = harq_process->F;
|
||||
Kr = harq_process->K;
|
||||
|
||||
@@ -496,13 +496,19 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
|
||||
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
|
||||
for(ap = 0; ap < Nl; ap++) {
|
||||
for (int s=0;s<NR_NUMBER_OF_SYMBOLS_PER_SLOT;s++){
|
||||
LOG_D(PHY,"rotating txdataF symbol %d (%d) => (%d.%d)\n",
|
||||
s,s+symb_offset,frame_parms->symbol_rotation[2*(s+symb_offset)],frame_parms->symbol_rotation[1+(2*(s+symb_offset))]);
|
||||
rotate_cpx_vector((int16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size*s],
|
||||
&frame_parms->symbol_rotation[2*(s+symb_offset)],
|
||||
(int16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size*s],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
15);
|
||||
|
||||
LOG_D(PHY,"In %s: rotating txdataF symbol %d (%d) => (%d.%d)\n",
|
||||
__FUNCTION__,
|
||||
s,
|
||||
s + symb_offset,
|
||||
frame_parms->symbol_rotation[1][2 * (s + symb_offset)],
|
||||
frame_parms->symbol_rotation[1][1 + (2 * (s + symb_offset))]);
|
||||
|
||||
rotate_cpx_vector((int16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
|
||||
&frame_parms->symbol_rotation[1][2 * (s + symb_offset)],
|
||||
(int16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
15);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -225,6 +225,8 @@ static void oai_xygraph(OAIgraph_t *graph, float *x, float *y, int len, int laye
|
||||
}
|
||||
|
||||
static void genericWaterFall (OAIgraph_t *graph, scopeSample_t *values, const int datasize, const int divisions, const char *label) {
|
||||
if ( values == NULL )
|
||||
return;
|
||||
fl_winset(FL_ObjWin(graph->graph));
|
||||
const int samplesPerPixel=datasize/graph->w;
|
||||
int displayPart=graph->waterFallh-ScaleZone;
|
||||
@@ -280,30 +282,6 @@ static void genericWaterFall (OAIgraph_t *graph, scopeSample_t *values, const in
|
||||
graph->iteration++;
|
||||
}
|
||||
|
||||
static void genericLogPowerPerAntena(OAIgraph_t *graph, const int nb_ant, const scopeSample_t **data, const int len) {
|
||||
float *values, *time;
|
||||
oai_xygraph_getbuff(graph, &time, &values, len, 0);
|
||||
|
||||
for (int ant=0; ant<nb_ant; ant++) {
|
||||
if (data[ant] != NULL) {
|
||||
float *values, *time;
|
||||
oai_xygraph_getbuff(graph, &time, &values, len, ant);
|
||||
|
||||
for (int i=0; i<len; i+=8) {
|
||||
float *vals=values+i;
|
||||
const scopeSample_t *in=&(data[ant][i]);
|
||||
|
||||
// TRY AUTOMATIC simd BY GCC
|
||||
for (int k=0; k<8; k++ ) {
|
||||
vals[k] = 10*log10(1.0+SquaredNorm(in[k]));
|
||||
}
|
||||
}
|
||||
|
||||
oai_xygraph(graph,time,values, len, ant, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void genericPowerPerAntena(OAIgraph_t *graph, const int nb_ant, const scopeSample_t **data, const int len) {
|
||||
float *values, *time;
|
||||
oai_xygraph_getbuff(graph, &time, &values, len, 0);
|
||||
|
||||
@@ -5952,8 +5952,6 @@ void idft32768(int16_t *x,int16_t *y,unsigned char scale)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
int16_t twa1536[1024],twb1536[1024];
|
||||
|
||||
// 512 x 3
|
||||
@@ -9471,6 +9469,919 @@ void dft1200(int16_t *x,int16_t *y,unsigned char scale_flag)
|
||||
|
||||
}
|
||||
|
||||
|
||||
static int16_t twa1296[431*2*4];
|
||||
static int16_t twb1296[431*2*4];
|
||||
|
||||
void dft1296(int16_t *x,int16_t *y,unsigned char scale_flag) //432 * 3
|
||||
{
|
||||
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa1296[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb1296[0];
|
||||
simd_q15_t x2128[1296];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[1296];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<432; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+432] = x128[j+1];
|
||||
x2128[i+864] = x128[j+2];
|
||||
}
|
||||
|
||||
dft432((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft432((int16_t *)(x2128+432),(int16_t *)(ytmp128+432),1);
|
||||
dft432((int16_t *)(x2128+864),(int16_t *)(ytmp128+864),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+432,ytmp128+864,y128,y128+432,y128+864);
|
||||
|
||||
for (i=1,j=0; i<432; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+432+i,
|
||||
ytmp128+864+i,
|
||||
y128+i,
|
||||
y128+432+i,
|
||||
y128+864+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<1296; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
|
||||
static int16_t twa1440[479*2*4];
|
||||
static int16_t twb1440[479*2*4];
|
||||
|
||||
void dft1440(int16_t *x,int16_t *y,unsigned char scale_flag) // 480 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa1440[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb1440[0];
|
||||
simd_q15_t x2128[1440];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[1440];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<480; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+480] = x128[j+1];
|
||||
x2128[i+960] = x128[j+2];
|
||||
}
|
||||
|
||||
dft480((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft480((int16_t *)(x2128+480),(int16_t *)(ytmp128+480),1);
|
||||
dft480((int16_t *)(x2128+960),(int16_t *)(ytmp128+960),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+480,ytmp128+960,y128,y128+480,y128+960);
|
||||
|
||||
for (i=1,j=0; i<480; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+480+i,
|
||||
ytmp128+960+i,
|
||||
y128+i,
|
||||
y128+480+i,
|
||||
y128+960+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<1440; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa1500[2392]__attribute__((aligned(32)));
|
||||
static int16_t twb1500[2392]__attribute__((aligned(32)));
|
||||
static int16_t twc1500[2392]__attribute__((aligned(32)));
|
||||
static int16_t twd1500[2392]__attribute__((aligned(32)));
|
||||
|
||||
void dft1500(int16_t *x,int16_t *y,unsigned char scale_flag)
|
||||
{
|
||||
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa1500[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb1500[0];
|
||||
simd_q15_t *twc128=(simd_q15_t *)&twc1500[0];
|
||||
simd_q15_t *twd128=(simd_q15_t *)&twd1500[0];
|
||||
simd_q15_t x2128[1500];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[1500];//=&ytmp128array2[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<300; i++,j+=5) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+300] = x128[j+1];
|
||||
x2128[i+600] = x128[j+2];
|
||||
x2128[i+900] = x128[j+3];
|
||||
x2128[i+1200] = x128[j+4];
|
||||
}
|
||||
|
||||
dft300((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft300((int16_t *)(x2128+300),(int16_t *)(ytmp128+300),1);
|
||||
dft300((int16_t *)(x2128+600),(int16_t *)(ytmp128+600),1);
|
||||
dft300((int16_t *)(x2128+900),(int16_t *)(ytmp128+900),1);
|
||||
dft300((int16_t *)(x2128+1200),(int16_t *)(ytmp128+1200),1);
|
||||
|
||||
bfly5_tw1(ytmp128,ytmp128+300,ytmp128+600,ytmp128+900,ytmp128+1200,y128,y128+300,y128+600,y128+900,y128+1200);
|
||||
|
||||
for (i=1,j=0; i<300; i++,j++) {
|
||||
bfly5(ytmp128+i,
|
||||
ytmp128+300+i,
|
||||
ytmp128+600+i,
|
||||
ytmp128+900+i,
|
||||
ytmp128+1200+i,
|
||||
y128+i,
|
||||
y128+300+i,
|
||||
y128+600+i,
|
||||
y128+900+i,
|
||||
y128+1200+i,
|
||||
twa128+j,
|
||||
twb128+j,
|
||||
twc128+j,
|
||||
twd128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[15]);
|
||||
|
||||
for (i=0; i<1500; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
}
|
||||
|
||||
static int16_t twa1620[539*2*4];
|
||||
static int16_t twb1620[539*2*4];
|
||||
|
||||
void dft1620(int16_t *x,int16_t *y,unsigned char scale_flag) // 540 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa1620[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb1620[0];
|
||||
simd_q15_t x2128[1620];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[1620];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<540; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+540] = x128[j+1];
|
||||
x2128[i+1080] = x128[j+2];
|
||||
}
|
||||
|
||||
dft540((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft540((int16_t *)(x2128+540),(int16_t *)(ytmp128+540),1);
|
||||
dft540((int16_t *)(x2128+1080),(int16_t *)(ytmp128+1080),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+540,ytmp128+1080,y128,y128+540,y128+1080);
|
||||
|
||||
for (i=1,j=0; i<540; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+540+i,
|
||||
ytmp128+1080+i,
|
||||
y128+i,
|
||||
y128+540+i,
|
||||
y128+1080+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<1620; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa1728[575*2*4];
|
||||
static int16_t twb1728[575*2*4];
|
||||
|
||||
void dft1728(int16_t *x,int16_t *y,unsigned char scale_flag) // 576 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa1728[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb1728[0];
|
||||
simd_q15_t x2128[1728];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[1728];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<576; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+576] = x128[j+1];
|
||||
x2128[i+1152] = x128[j+2];
|
||||
}
|
||||
|
||||
dft576((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft576((int16_t *)(x2128+576),(int16_t *)(ytmp128+576),1);
|
||||
dft576((int16_t *)(x2128+1152),(int16_t *)(ytmp128+1152),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+576,ytmp128+1152,y128,y128+576,y128+1152);
|
||||
|
||||
for (i=1,j=0; i<576; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+576+i,
|
||||
ytmp128+1152+i,
|
||||
y128+i,
|
||||
y128+576+i,
|
||||
y128+1152+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<1728; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa1800[599*2*4];
|
||||
static int16_t twb1800[599*2*4];
|
||||
|
||||
void dft1800(int16_t *x,int16_t *y,unsigned char scale_flag) // 600 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa1800[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb1800[0];
|
||||
simd_q15_t x2128[1800];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[1800];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<600; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+600] = x128[j+1];
|
||||
x2128[i+1200] = x128[j+2];
|
||||
}
|
||||
|
||||
dft600((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft600((int16_t *)(x2128+600),(int16_t *)(ytmp128+600),1);
|
||||
dft600((int16_t *)(x2128+1200),(int16_t *)(ytmp128+1200),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+600,ytmp128+1200,y128,y128+600,y128+1200);
|
||||
|
||||
for (i=1,j=0; i<600; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+600+i,
|
||||
ytmp128+1200+i,
|
||||
y128+i,
|
||||
y128+600+i,
|
||||
y128+1200+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<1800; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa1920[479*2*4];
|
||||
static int16_t twb1920[479*2*4];
|
||||
static int16_t twc1920[479*2*4];
|
||||
|
||||
void dft1920(int16_t *x,int16_t *y,unsigned char scale_flag) // 480 x 4
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa1920[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb1920[0];
|
||||
simd_q15_t *twc128=(simd_q15_t *)&twc1920[0];
|
||||
simd_q15_t x2128[1920];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[1920];//=&ytmp128array2[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<480; i++,j+=4) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+480] = x128[j+1];
|
||||
x2128[i+960] = x128[j+2];
|
||||
x2128[i+1440] = x128[j+3];
|
||||
}
|
||||
|
||||
dft480((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft480((int16_t *)(x2128+480),(int16_t *)(ytmp128+480),1);
|
||||
dft480((int16_t *)(x2128+960),(int16_t *)(ytmp128+960),1);
|
||||
dft480((int16_t *)(x2128+1440),(int16_t *)(ytmp128+1440),1);
|
||||
|
||||
bfly4_tw1(ytmp128,ytmp128+480,ytmp128+960,ytmp128+1440,y128,y128+480,y128+960,y128+1440);
|
||||
|
||||
for (i=1,j=0; i<480; i++,j++) {
|
||||
bfly4(ytmp128+i,
|
||||
ytmp128+480+i,
|
||||
ytmp128+960+i,
|
||||
ytmp128+1440+i,
|
||||
y128+i,
|
||||
y128+480+i,
|
||||
y128+960+i,
|
||||
y128+1440+i,
|
||||
twa128+j,
|
||||
twb128+j,
|
||||
twc128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[13]);
|
||||
for (i=0; i<1920; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa1944[647*2*4];
|
||||
static int16_t twb1944[647*2*4];
|
||||
|
||||
void dft1944(int16_t *x,int16_t *y,unsigned char scale_flag) // 648 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa1944[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb1944[0];
|
||||
simd_q15_t x2128[1944];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[1944];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<648; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+648] = x128[j+1];
|
||||
x2128[i+1296] = x128[j+2];
|
||||
}
|
||||
|
||||
dft648((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft648((int16_t *)(x2128+648),(int16_t *)(ytmp128+648),1);
|
||||
dft648((int16_t *)(x2128+1296),(int16_t *)(ytmp128+1296),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+648,ytmp128+1296,y128,y128+648,y128+1296);
|
||||
|
||||
for (i=1,j=0; i<648; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+648+i,
|
||||
ytmp128+1296+i,
|
||||
y128+i,
|
||||
y128+648+i,
|
||||
y128+1296+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<1944; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa2160[719*2*4];
|
||||
static int16_t twb2160[719*2*4];
|
||||
|
||||
void dft2160(int16_t *x,int16_t *y,unsigned char scale_flag) // 720 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa2160[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb2160[0];
|
||||
simd_q15_t x2128[2160];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[2160];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<720; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+720] = x128[j+1];
|
||||
x2128[i+1440] = x128[j+2];
|
||||
}
|
||||
|
||||
dft720((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft720((int16_t *)(x2128+720),(int16_t *)(ytmp128+720),1);
|
||||
dft720((int16_t *)(x2128+1440),(int16_t *)(ytmp128+1440),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+720,ytmp128+1440,y128,y128+720,y128+1440);
|
||||
|
||||
for (i=1,j=0; i<720; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+720+i,
|
||||
ytmp128+1440+i,
|
||||
y128+i,
|
||||
y128+720+i,
|
||||
y128+1440+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<2160; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa2304[767*2*4];
|
||||
static int16_t twb2304[767*2*4];
|
||||
|
||||
void dft2304(int16_t *x,int16_t *y,unsigned char scale_flag) // 768 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa2304[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb2304[0];
|
||||
simd_q15_t x2128[2304];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[2304];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<768; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+768] = x128[j+1];
|
||||
x2128[i+1536] = x128[j+2];
|
||||
}
|
||||
|
||||
dft768((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft768((int16_t *)(x2128+768),(int16_t *)(ytmp128+768),1);
|
||||
dft768((int16_t *)(x2128+1536),(int16_t *)(ytmp128+1536),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+768,ytmp128+1536,y128,y128+768,y128+1536);
|
||||
|
||||
for (i=1,j=0; i<768; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+768+i,
|
||||
ytmp128+1536+i,
|
||||
y128+i,
|
||||
y128+768+i,
|
||||
y128+1536+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<2304; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa2400[599*2*4];
|
||||
static int16_t twb2400[599*2*4];
|
||||
static int16_t twc2400[599*2*4];
|
||||
|
||||
void dft2400(int16_t *x,int16_t *y,unsigned char scale_flag) // 600 x 4
|
||||
{
|
||||
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa2400[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb2400[0];
|
||||
simd_q15_t *twc128=(simd_q15_t *)&twc2400[0];
|
||||
simd_q15_t x2128[2400];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[2400];//=&ytmp128array2[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<600; i++,j+=4) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+600] = x128[j+1];
|
||||
x2128[i+1200] = x128[j+2];
|
||||
x2128[i+1800] = x128[j+3];
|
||||
}
|
||||
|
||||
dft600((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft600((int16_t *)(x2128+600),(int16_t *)(ytmp128+600),1);
|
||||
dft600((int16_t *)(x2128+1200),(int16_t *)(ytmp128+1200),1);
|
||||
dft600((int16_t *)(x2128+1800),(int16_t *)(ytmp128+1800),1);
|
||||
|
||||
bfly4_tw1(ytmp128,ytmp128+600,ytmp128+1200,ytmp128+1800,y128,y128+600,y128+1200,y128+1800);
|
||||
|
||||
for (i=1,j=0; i<600; i++,j++) {
|
||||
bfly4(ytmp128+i,
|
||||
ytmp128+600+i,
|
||||
ytmp128+1200+i,
|
||||
ytmp128+1800+i,
|
||||
y128+i,
|
||||
y128+600+i,
|
||||
y128+1200+i,
|
||||
y128+1800+i,
|
||||
twa128+j,
|
||||
twb128+j,
|
||||
twc128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[13]);
|
||||
for (i=0; i<2400; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa2592[863*2*4];
|
||||
static int16_t twb2592[863*2*4];
|
||||
|
||||
void dft2592(int16_t *x,int16_t *y,unsigned char scale_flag) // 864 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa2592[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb2592[0];
|
||||
simd_q15_t x2128[2592];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[2592];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<864; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+864] = x128[j+1];
|
||||
x2128[i+1728] = x128[j+2];
|
||||
}
|
||||
|
||||
dft864((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft864((int16_t *)(x2128+864),(int16_t *)(ytmp128+864),1);
|
||||
dft864((int16_t *)(x2128+1728),(int16_t *)(ytmp128+1728),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+864,ytmp128+1728,y128,y128+864,y128+1728);
|
||||
|
||||
for (i=1,j=0; i<864; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+864+i,
|
||||
ytmp128+1728+i,
|
||||
y128+i,
|
||||
y128+864+i,
|
||||
y128+1728+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<2592; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa2700[899*2*4];
|
||||
static int16_t twb2700[899*2*4];
|
||||
|
||||
void dft2700(int16_t *x,int16_t *y,unsigned char scale_flag) // 900 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa2700[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb2700[0];
|
||||
simd_q15_t x2128[2700];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[2700];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<900; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+900] = x128[j+1];
|
||||
x2128[i+1800] = x128[j+2];
|
||||
}
|
||||
|
||||
dft900((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft900((int16_t *)(x2128+900),(int16_t *)(ytmp128+900),1);
|
||||
dft900((int16_t *)(x2128+1800),(int16_t *)(ytmp128+1800),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+900,ytmp128+1800,y128,y128+900,y128+1800);
|
||||
|
||||
for (i=1,j=0; i<900; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+900+i,
|
||||
ytmp128+1800+i,
|
||||
y128+i,
|
||||
y128+900+i,
|
||||
y128+1800+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<2700; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa2880[959*2*4];
|
||||
static int16_t twb2880[959*2*4];
|
||||
|
||||
void dft2880(int16_t *x,int16_t *y,unsigned char scale_flag) // 960 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa2880[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb2880[0];
|
||||
simd_q15_t x2128[2880];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[2880];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<960; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+960] = x128[j+1];
|
||||
x2128[i+1920] = x128[j+2];
|
||||
}
|
||||
|
||||
dft960((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft960((int16_t *)(x2128+960),(int16_t *)(ytmp128+960),1);
|
||||
dft960((int16_t *)(x2128+1920),(int16_t *)(ytmp128+1920),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+960,ytmp128+1920,y128,y128+960,y128+1920);
|
||||
|
||||
for (i=1,j=0; i<960; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+960+i,
|
||||
ytmp128+1920+i,
|
||||
y128+i,
|
||||
y128+960+i,
|
||||
y128+1920+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<2880; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa2916[971*2*4];
|
||||
static int16_t twb2916[971*2*4];
|
||||
|
||||
void dft2916(int16_t *x,int16_t *y,unsigned char scale_flag) // 972 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa2916[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb2916[0];
|
||||
simd_q15_t x2128[2916];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[2916];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<972; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+972] = x128[j+1];
|
||||
x2128[i+1944] = x128[j+2];
|
||||
}
|
||||
|
||||
dft972((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft972((int16_t *)(x2128+972),(int16_t *)(ytmp128+972),1);
|
||||
dft972((int16_t *)(x2128+1944),(int16_t *)(ytmp128+1944),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+972,ytmp128+1944,y128,y128+972,y128+1944);
|
||||
|
||||
for (i=1,j=0; i<972; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+972+i,
|
||||
ytmp128+1944+i,
|
||||
y128+i,
|
||||
y128+972+i,
|
||||
y128+1944+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<2916; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
static int16_t twa3000[599*8]__attribute__((aligned(32)));
|
||||
static int16_t twb3000[599*8]__attribute__((aligned(32)));
|
||||
static int16_t twc3000[599*8]__attribute__((aligned(32)));
|
||||
static int16_t twd3000[599*8]__attribute__((aligned(32)));
|
||||
|
||||
void dft3000(int16_t *x,int16_t *y,unsigned char scale_flag) // 600 * 5
|
||||
{
|
||||
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa3000[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb3000[0];
|
||||
simd_q15_t *twc128=(simd_q15_t *)&twc3000[0];
|
||||
simd_q15_t *twd128=(simd_q15_t *)&twd3000[0];
|
||||
simd_q15_t x2128[3000];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[3000];//=&ytmp128array2[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<600; i++,j+=5) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+600] = x128[j+1];
|
||||
x2128[i+1200] = x128[j+2];
|
||||
x2128[i+1800] = x128[j+3];
|
||||
x2128[i+2400] = x128[j+4];
|
||||
}
|
||||
|
||||
dft600((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft600((int16_t *)(x2128+600),(int16_t *)(ytmp128+600),1);
|
||||
dft600((int16_t *)(x2128+1200),(int16_t *)(ytmp128+1200),1);
|
||||
dft600((int16_t *)(x2128+1800),(int16_t *)(ytmp128+1800),1);
|
||||
dft600((int16_t *)(x2128+2400),(int16_t *)(ytmp128+2400),1);
|
||||
|
||||
bfly5_tw1(ytmp128,ytmp128+600,ytmp128+1200,ytmp128+1800,ytmp128+2400,y128,y128+600,y128+1200,y128+1800,y128+2400);
|
||||
|
||||
for (i=1,j=0; i<600; i++,j++) {
|
||||
bfly5(ytmp128+i,
|
||||
ytmp128+600+i,
|
||||
ytmp128+1200+i,
|
||||
ytmp128+1800+i,
|
||||
ytmp128+2400+i,
|
||||
y128+i,
|
||||
y128+600+i,
|
||||
y128+1200+i,
|
||||
y128+1800+i,
|
||||
y128+2400+i,
|
||||
twa128+j,
|
||||
twb128+j,
|
||||
twc128+j,
|
||||
twd128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[15]);
|
||||
|
||||
for (i=0; i<3000; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
}
|
||||
|
||||
static int16_t twa3240[1079*2*4];
|
||||
static int16_t twb3240[1079*2*4];
|
||||
|
||||
void dft3240(int16_t *x,int16_t *y,unsigned char scale_flag) // 1080 x 3
|
||||
{
|
||||
int i,j;
|
||||
simd_q15_t *x128=(simd_q15_t *)x;
|
||||
simd_q15_t *y128=(simd_q15_t *)y;
|
||||
simd_q15_t *twa128=(simd_q15_t *)&twa3240[0];
|
||||
simd_q15_t *twb128=(simd_q15_t *)&twb3240[0];
|
||||
simd_q15_t x2128[3240];// = (simd_q15_t *)&x2128array[0];
|
||||
simd_q15_t ytmp128[3240];//=&ytmp128array3[0];
|
||||
|
||||
|
||||
|
||||
for (i=0,j=0; i<1080; i++,j+=3) {
|
||||
x2128[i] = x128[j];
|
||||
x2128[i+1080] = x128[j+1];
|
||||
x2128[i+2160] = x128[j+2];
|
||||
}
|
||||
|
||||
dft1080((int16_t *)x2128,(int16_t *)ytmp128,1);
|
||||
dft1080((int16_t *)(x2128+1080),(int16_t *)(ytmp128+1080),1);
|
||||
dft1080((int16_t *)(x2128+2160),(int16_t *)(ytmp128+2160),1);
|
||||
|
||||
bfly3_tw1(ytmp128,ytmp128+1080,ytmp128+2160,y128,y128+1080,y128+2160);
|
||||
|
||||
for (i=1,j=0; i<1080; i++,j++) {
|
||||
bfly3(ytmp128+i,
|
||||
ytmp128+1080+i,
|
||||
ytmp128+2160+i,
|
||||
y128+i,
|
||||
y128+1080+i,
|
||||
y128+2160+i,
|
||||
twa128+j,
|
||||
twb128+j);
|
||||
}
|
||||
|
||||
if (scale_flag==1) {
|
||||
norm128 = set1_int16(dft_norm_table[14]);
|
||||
|
||||
for (i=0; i<3240; i++) {
|
||||
y128[i] = mulhi_int16(y128[i],norm128);
|
||||
}
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
};
|
||||
|
||||
void init_rad4(int N,int16_t *tw) {
|
||||
|
||||
int16_t *twa = tw;
|
||||
@@ -9492,7 +10403,7 @@ void init_rad4_rep(int N,int16_t *twa,int16_t *twb,int16_t *twc) {
|
||||
int i,j;
|
||||
|
||||
for (i=1;i<(N/4);i++) {
|
||||
twa[0] = (int16_t)round(32767.0*cos(2*M_PI*i/N));
|
||||
twa[0] = (int16_t)round(32767.0*cos(2*M_PI*i/N));
|
||||
twa[1] = -(int16_t)round(32767.0*sin(2*M_PI*i/N));
|
||||
twb[0] = (int16_t)round(32767.0*cos(2*M_PI*2*i/N));
|
||||
twb[1] = -(int16_t)round(32767.0*sin(2*M_PI*2*i/N));
|
||||
@@ -9525,7 +10436,7 @@ void init_rad2_rep(int N,int16_t *twa) {
|
||||
int i,j;
|
||||
|
||||
for (i=1;i<(N/2);i++) {
|
||||
twa[0] = (int16_t)round(32767.0*cos(2*M_PI*i/N));
|
||||
twa[0] = (int16_t)round(32767.0*cos(2*M_PI*i/N));
|
||||
twa[1] = -(int16_t)round(32767.0*sin(2*M_PI*i/N));
|
||||
for (j=1;j<4;j++) {
|
||||
((int32_t*)twa)[j]=((int32_t*)twa)[0];
|
||||
@@ -9551,7 +10462,7 @@ void init_rad3_rep(int N,int16_t *twa,int16_t *twb) {
|
||||
int i,j;
|
||||
|
||||
for (i=1;i<(N/3);i++) {
|
||||
twa[0] = (int16_t)round(32767.0*cos(2*M_PI*i/N));
|
||||
twa[0] = (int16_t)round(32767.0*cos(2*M_PI*i/N));
|
||||
twa[1] = -(int16_t)round(32767.0*sin(2*M_PI*i/N));
|
||||
twb[0] = (int16_t)round(32767.0*cos(2*M_PI*2*i/N));
|
||||
twb[1] = -(int16_t)round(32767.0*sin(2*M_PI*2*i/N));
|
||||
@@ -9569,7 +10480,7 @@ void init_rad5_rep(int N,int16_t *twa,int16_t *twb,int16_t *twc,int16_t *twd) {
|
||||
int i,j;
|
||||
|
||||
for (i=1;i<(N/5);i++) {
|
||||
twa[0] = (int16_t)round(32767.0*cos(2*M_PI*i/N));
|
||||
twa[0] = (int16_t)round(32767.0*cos(2*M_PI*i/N));
|
||||
twa[1] = -(int16_t)round(32767.0*sin(2*M_PI*i/N));
|
||||
twb[0] = (int16_t)round(32767.0*cos(2*M_PI*2*i/N));
|
||||
twb[1] = -(int16_t)round(32767.0*sin(2*M_PI*2*i/N));
|
||||
@@ -9586,7 +10497,7 @@ void init_rad5_rep(int N,int16_t *twa,int16_t *twb,int16_t *twc,int16_t *twd) {
|
||||
twa+=8;
|
||||
twb+=8;
|
||||
twc+=8;
|
||||
twd+=8;
|
||||
twd+=8;
|
||||
}
|
||||
}
|
||||
/*----------------------------------------------------------------*/
|
||||
@@ -9600,7 +10511,7 @@ int dfts_autoinit(void)
|
||||
init_rad2(8192,tw8192);
|
||||
init_rad4(16384,tw16384);
|
||||
init_rad2(32768,tw32768);
|
||||
|
||||
|
||||
init_rad3(1536,twa1536,twb1536);
|
||||
init_rad3(3072,twa3072,twb3072);
|
||||
init_rad3(6144,twa6144,twb6144);
|
||||
@@ -9645,6 +10556,24 @@ int dfts_autoinit(void)
|
||||
init_rad3_rep(1080,twa1080,twb1080);
|
||||
init_rad4_rep(1152,twa1152,twb1152,twc1152);
|
||||
init_rad4_rep(1200,twa1200,twb1200,twc1200);
|
||||
init_rad3_rep(1296,twa1296,twb1296);
|
||||
init_rad3_rep(1440,twa1440,twb1440);
|
||||
init_rad5_rep(1500,twa1500,twb1500,twc1500,twd1500);
|
||||
init_rad3_rep(1620,twa1620,twb1620);
|
||||
init_rad3_rep(1728,twa1728,twb1728);
|
||||
init_rad3_rep(1800,twa1800,twb1800);
|
||||
init_rad4_rep(1920,twa1920,twb1920, twc1920);
|
||||
init_rad3_rep(1944,twa1944,twb1944);
|
||||
init_rad3_rep(2160,twa2160,twb2160);
|
||||
init_rad3_rep(2304,twa2304,twb2304);
|
||||
init_rad4_rep(2400,twa2400,twb2400,twc2400);
|
||||
init_rad3_rep(2592,twa2592,twb2592);
|
||||
init_rad3_rep(2700,twa2700,twb2700);
|
||||
init_rad3_rep(2880,twa2880,twb2880);
|
||||
init_rad3_rep(2916,twa2916,twb2916);
|
||||
init_rad5_rep(3000,twa3000,twb3000,twc3000,twd3000);
|
||||
init_rad3_rep(3240,twa3240,twb3240);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -226,9 +226,26 @@ 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 dft1152(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1200(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1296(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1440(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1500(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1536(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void dft1620(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1728(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1800(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1920(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft1944(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft2048(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft2160(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft2304(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft2400(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft2592(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft2700(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft2880(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft2916(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft3000(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
void dft3072(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
|
||||
void dft3240(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);
|
||||
@@ -283,21 +300,25 @@ typedef enum DFT_size_idx {
|
||||
DFT_108, 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_9216, DFT_12288, DFT_18432,
|
||||
DFT_24576, DFT_36864, DFT_49152, DFT_73728, DFT_98304,
|
||||
DFT_900, DFT_960, DFT_972, DFT_1024, DFT_1080, DFT_1152, DFT_1200, DFT_1296,
|
||||
DFT_1440, DFT_1500, DFT_1536, DFT_1620, DFT_1728, DFT_1800, DFT_1920, DFT_1944,
|
||||
DFT_2048, DFT_2160, DFT_2304, DFT_2400, DFT_2592, DFT_2700, DFT_2880, DFT_2916,
|
||||
DFT_3000, DFT_3072, DFT_3240, DFT_4096, DFT_6144, DFT_8192, DFT_9216, DFT_12288,
|
||||
DFT_18432, DFT_24576, DFT_36864, DFT_49152, DFT_73728, DFT_98304,
|
||||
DFT_SIZE_IDXTABLESIZE
|
||||
} dft_size_idx_t;
|
||||
|
||||
#ifdef OAIDFTS_MAIN
|
||||
adftfunc_t dft_ftab[]={
|
||||
dft12, dft24, dft36, dft48, dft60, dft72, dft96,
|
||||
dft108, dft120, dft128, dft144, dft180, dft192, dft216, dft240,
|
||||
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, dft9216, dft12288, dft18432,
|
||||
dft24576, dft36864, dft49152, dft73728, dft98304
|
||||
dft900, dft960, dft972, dft1024, dft1080, dft1152, dft1200, dft1296,
|
||||
dft1440, dft1500, dft1536, dft1620, dft1728, dft1800, dft1920, dft1944,
|
||||
dft2048, dft2160, dft2304, dft2400, dft2592, dft2700, dft2880, dft2916,
|
||||
dft3000, dft3072, dft3240, dft4096, dft6144, dft8192, dft9216, dft12288,
|
||||
dft18432, dft24576, dft36864, dft49152, dft73728, dft98304
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -309,9 +330,9 @@ typedef enum idft_size_idx {
|
||||
} idft_size_idx_t;
|
||||
#ifdef OAIDFTS_MAIN
|
||||
aidftfunc_t idft_ftab[]={
|
||||
idft128, idft256, idft512, idft1024, idft1536, idft2048, idft3072, idft4096,
|
||||
idft6144, idft8192, idft9216, idft12288, idft18432, idft24576, idft36864, idft49152,
|
||||
idft73728, idft98304
|
||||
idft128, idft256, idft512, idft1024, idft1536, idft2048, idft3072, idft4096,
|
||||
idft6144, idft8192, idft9216, idft12288, idft18432, idft24576, idft36864, idft49152,
|
||||
idft73728, idft98304
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -741,4 +741,10 @@ typedef struct RRU_config_s {
|
||||
MBSFN_config_t MBSFN_config[8];
|
||||
} RRU_config_t;
|
||||
|
||||
typedef struct processingData_RU {
|
||||
int frame_tx;
|
||||
int slot_tx;
|
||||
openair0_timestamp timestamp_tx;
|
||||
RU_t *ru;
|
||||
} processingData_RU_t;
|
||||
#endif //__PHY_DEFS_RU__H__
|
||||
|
||||
@@ -832,6 +832,9 @@ typedef struct PHY_VARS_gNB_s {
|
||||
time_stats_t ulsch_freq_offset_estimation_stats;
|
||||
*/
|
||||
notifiedFIFO_t *respDecode;
|
||||
notifiedFIFO_t *resp_L1;
|
||||
notifiedFIFO_t *resp_L1_tx;
|
||||
notifiedFIFO_t *resp_RU_tx;
|
||||
tpool_t *threadPool;
|
||||
int nbDecode;
|
||||
uint8_t pusch_proc_threads;
|
||||
@@ -873,4 +876,13 @@ union ldpcReqUnion {
|
||||
uint64_t p;
|
||||
};
|
||||
|
||||
typedef struct processingData_L1 {
|
||||
int frame_rx;
|
||||
int frame_tx;
|
||||
int slot_rx;
|
||||
int slot_tx;
|
||||
openair0_timestamp timestamp_tx;
|
||||
PHY_VARS_gNB *gNB;
|
||||
} processingData_L1_t;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -335,9 +335,7 @@ typedef struct {
|
||||
/// \brief Cross-correlation Matrix of the gNB Tx channel signals.
|
||||
/// - first index: aatx*n_rx+aarx for all aatx=[0..n_tx[ and aarx=[0..nb_rx[
|
||||
/// - second index: symbol [0..]
|
||||
int32_t **rho;
|
||||
/// never used... always send dl_ch_rho_ext instead...
|
||||
int32_t **rho_i;
|
||||
int32_t ***rho;
|
||||
/// \brief Pointers to llr vectors (2 TBs).
|
||||
/// - first index: ? [0..1] (hard coded)
|
||||
/// - second index: ? [0..1179743] (hard coded)
|
||||
|
||||
@@ -327,7 +327,8 @@ struct NR_DL_FRAME_PARMS {
|
||||
/// Cyclic Prefix for DL (0=Normal CP, 1=Extended CP)
|
||||
lte_prefix_type_t Ncp;
|
||||
/// sequence which is computed based on carrier frequency and numerology to rotate/derotate each OFDM symbol according to Section 5.3 in 38.211
|
||||
int16_t symbol_rotation[224*2];
|
||||
/// First dimension is for the direction of the link (0 DL, 1 UL)
|
||||
int16_t symbol_rotation[2][224*2];
|
||||
/// shift of pilot position in one RB
|
||||
uint8_t nushift;
|
||||
/// SRS configuration from TS 38.331 RRC
|
||||
@@ -368,20 +369,4 @@ struct NR_DL_FRAME_PARMS {
|
||||
#define KHz (1000UL)
|
||||
#define MHz (1000*KHz)
|
||||
|
||||
typedef struct nr_bandentry_s {
|
||||
int16_t band;
|
||||
uint64_t ul_min;
|
||||
uint64_t ul_max;
|
||||
uint64_t dl_min;
|
||||
uint64_t dl_max;
|
||||
uint64_t step_size;
|
||||
uint64_t N_OFFs_DL;
|
||||
uint8_t deltaf_raster;
|
||||
} nr_bandentry_t;
|
||||
|
||||
typedef struct nr_band_info_s {
|
||||
int nbands;
|
||||
nr_bandentry_t band_info[100];
|
||||
} nr_band_info_t;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
//Dummy NR defs to avoid linking errors
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h"
|
||||
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
|
||||
#include "openair1/PHY/LTE_TRANSPORT/transport_common.h"
|
||||
|
||||
void handle_nfapi_nr_pdcch_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame, int slot,
|
||||
nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu){}
|
||||
|
||||
void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu){}
|
||||
|
||||
int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type){return 0;}
|
||||
void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
|
||||
uint8_t *sdu){
|
||||
}
|
||||
int l1_north_init_gNB(void){return 0;}
|
||||
|
||||
uint8_t slot_ahead=6;
|
||||
//uint8_t nfapi_mode=0;
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id) {return NULL;}
|
||||
|
||||
void handle_nfapi_nr_ul_dci_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame, int slot,
|
||||
nfapi_nr_ul_dci_request_pdus_t *ul_dci_request_pdu){}
|
||||
void nr_fill_ulsch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_pusch_pdu_t *ulsch_pdu){}
|
||||
void nr_fill_pucch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu){}
|
||||
void nr_fill_prach(PHY_VARS_gNB *gNB,
|
||||
int SFN,
|
||||
int Slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu){}
|
||||
void nr_fill_prach_ru(RU_t *ru,
|
||||
int SFN,
|
||||
int Slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu){}
|
||||
|
||||
void nr_phy_config_request(NR_PHY_Config_t *gNB){}
|
||||
|
||||
void install_nr_schedule_handlers(NR_IF_Module_t *if_inst){}
|
||||
|
||||
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp){}
|
||||
@@ -0,0 +1,52 @@
|
||||
//Dummy NR defs to avoid linking errors
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h"
|
||||
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
|
||||
#include "openair1/PHY/LTE_TRANSPORT/transport_common.h"
|
||||
|
||||
void handle_nfapi_nr_pdcch_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame, int slot,
|
||||
nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu){}
|
||||
|
||||
void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu){}
|
||||
|
||||
int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type){return 0;}
|
||||
void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
|
||||
uint8_t *sdu){
|
||||
}
|
||||
int l1_north_init_gNB(void){return 0;}
|
||||
|
||||
uint8_t slot_ahead=6;
|
||||
//uint8_t nfapi_mode=0;
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id) {return NULL;}
|
||||
|
||||
void handle_nfapi_nr_ul_dci_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame, int slot,
|
||||
nfapi_nr_ul_dci_request_pdus_t *ul_dci_request_pdu){}
|
||||
void nr_fill_ulsch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_pusch_pdu_t *ulsch_pdu){}
|
||||
void nr_fill_pucch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu){}
|
||||
void nr_fill_prach(PHY_VARS_gNB *gNB,
|
||||
int SFN,
|
||||
int Slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu){}
|
||||
void nr_fill_prach_ru(RU_t *ru,
|
||||
int SFN,
|
||||
int Slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu){}
|
||||
|
||||
void nr_phy_config_request(NR_PHY_Config_t *gNB){}
|
||||
|
||||
void install_nr_schedule_handlers(NR_IF_Module_t *if_inst){}
|
||||
|
||||
//void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp){}
|
||||
|
||||
|
||||
@@ -33,6 +33,12 @@
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dci.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
extern int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req);
|
||||
extern int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req);
|
||||
extern int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req);
|
||||
extern int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req);
|
||||
|
||||
|
||||
extern uint8_t nfapi_mode;
|
||||
@@ -126,7 +132,7 @@ void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
}
|
||||
|
||||
void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
|
||||
|
||||
PHY_VARS_gNB *gNB;
|
||||
// copy data from L2 interface into L1 structures
|
||||
module_id_t Mod_id = Sched_INFO->module_id;
|
||||
@@ -169,6 +175,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
case NFAPI_NR_DL_TTI_SSB_PDU_TYPE:
|
||||
gNB->pbch_configured=1;
|
||||
|
||||
if(NFAPI_MODE != NFAPI_MODE_VNF)
|
||||
handle_nr_nfapi_ssb_pdu(gNB,frame,slot,
|
||||
dl_tti_pdu);
|
||||
|
||||
@@ -176,7 +183,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
|
||||
case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE:
|
||||
AssertFatal(pdcch_received == 0, "pdcch_received is not 0, we can only handle one PDCCH PDU per slot\n");
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot);
|
||||
if(NFAPI_MODE != NFAPI_MODE_VNF)
|
||||
handle_nfapi_nr_pdcch_pdu(gNB,
|
||||
frame, slot,
|
||||
&dl_tti_pdu->pdcch_pdu);
|
||||
@@ -193,33 +200,61 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
AssertFatal(TX_req->pdu_list[pduIndex].num_TLV == 1, "TX_req->pdu_list[%d].num_TLV %d != 1\n",
|
||||
pduIndex,TX_req->pdu_list[pduIndex].num_TLV);
|
||||
uint8_t *sdu = (uint8_t *)TX_req->pdu_list[pduIndex].TLVs[0].value.direct;
|
||||
if(NFAPI_MODE != NFAPI_MODE_VNF)
|
||||
handle_nr_nfapi_pdsch_pdu(gNB,frame,slot,&dl_tti_pdu->pdsch_pdu, sdu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if (UL_tti_req!=NULL) memcpy(&gNB->UL_tti_req,UL_tti_req,sizeof(nfapi_nr_ul_tti_request_t));
|
||||
if(NFAPI_MODE != NFAPI_MODE_VNF)
|
||||
for (int i=0;i<number_ul_dci_pdu;i++) {
|
||||
handle_nfapi_nr_ul_dci_pdu(gNB, frame, slot, &UL_dci_req->ul_dci_pdu_list[i]);
|
||||
}
|
||||
|
||||
if(NFAPI_MODE != NFAPI_MODE_VNF)
|
||||
for (int i = 0; i < number_ul_tti_pdu; i++) {
|
||||
switch (UL_tti_req->pdus_list[i].pdu_type) {
|
||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUSCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nr_fill_ulsch(gNB,UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pusch_pdu);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUCCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nr_fill_pucch(gNB,UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pucch_pdu);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PRACH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nfapi_nr_prach_pdu_t *prach_pdu = &UL_tti_req->pdus_list[i].prach_pdu;
|
||||
nr_fill_prach(gNB, UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
|
||||
if (gNB->RU_list[0]->if_south == LOCAL_RF) nr_fill_prach_ru(gNB->RU_list[0], UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(NFAPI_MODE != NFAPI_MONOLITHIC && number_ul_tti_pdu>0)
|
||||
{
|
||||
oai_nfapi_ul_tti_req(UL_tti_req);
|
||||
}
|
||||
|
||||
for (int i=0;i<number_ul_dci_pdu;i++) {
|
||||
handle_nfapi_nr_ul_dci_pdu(gNB, frame, slot, &UL_dci_req->ul_dci_pdu_list[i]);
|
||||
if (NFAPI_MODE != NFAPI_MONOLITHIC && Sched_INFO->UL_dci_req->numPdus!=0)
|
||||
{
|
||||
oai_nfapi_ul_dci_req(Sched_INFO->UL_dci_req);
|
||||
}
|
||||
|
||||
if (NFAPI_MODE != NFAPI_MONOLITHIC)
|
||||
{
|
||||
if(Sched_INFO->DL_req->dl_tti_request_body.nPDUs>0)
|
||||
{
|
||||
Sched_INFO->DL_req->SFN = frame;
|
||||
Sched_INFO->DL_req->Slot = slot;
|
||||
oai_nfapi_dl_tti_req(Sched_INFO->DL_req);
|
||||
}
|
||||
if (Sched_INFO->TX_req->Number_of_PDUs > 0)
|
||||
{
|
||||
oai_nfapi_tx_data_req(Sched_INFO->TX_req);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < number_ul_tti_pdu; i++) {
|
||||
switch (UL_tti_req->pdus_list[i].pdu_type) {
|
||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUSCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nr_fill_ulsch(gNB,UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pusch_pdu);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUCCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nr_fill_pucch(gNB,UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pucch_pdu);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PRACH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nfapi_nr_prach_pdu_t *prach_pdu = &UL_tti_req->pdus_list[i].prach_pdu;
|
||||
nr_fill_prach(gNB, UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
|
||||
if (gNB->RU_list[0]->if_south == LOCAL_RF) nr_fill_prach_ru(gNB->RU_list[0], UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,11 @@
|
||||
#include "nfapi_nr_interface.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
|
||||
// added
|
||||
void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame,int slot,
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu);
|
||||
|
||||
void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO);
|
||||
|
||||
void handle_nfapi_nr_pdcch_pdu(PHY_VARS_gNB *gNB,
|
||||
@@ -48,3 +53,8 @@ void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
|
||||
|
||||
void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t harq_pid, uint8_t crc_flag);
|
||||
//added
|
||||
|
||||
void handle_nfapi_nr_ul_dci_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame, int slot,
|
||||
nfapi_nr_ul_dci_request_pdus_t *ul_dci_request_pdu);
|
||||
|
||||
@@ -161,7 +161,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,1);
|
||||
if (nfapi_mode == 0 || nfapi_mode == 1) {
|
||||
if (NFAPI_MODE == NFAPI_MONOLITHIC || NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||
if ((!(frame%ssb_frame_periodicity))) // generate SSB only for given frames according to SSB periodicity
|
||||
nr_common_signal_procedures(gNB,frame, slot);
|
||||
}
|
||||
@@ -544,6 +544,9 @@ void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
}
|
||||
|
||||
void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
/* those variables to log T_GNB_PHY_PUCCH_PUSCH_IQ only when we try to decode */
|
||||
int pucch_decode_done = 0;
|
||||
int pusch_decode_done = 0;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,1);
|
||||
LOG_D(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d\n",frame_rx,slot_rx);
|
||||
@@ -553,6 +556,11 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
|
||||
gNB_I0_measurements(gNB);
|
||||
|
||||
// measure enegry in SS=10 L=4, nb_rb = 18, first_rb = 0 (corresponds to msg3)
|
||||
int offset = 10*gNB->frame_parms.ofdm_symbol_size + gNB->frame_parms.first_carrier_offset;
|
||||
int power_rxF = signal_energy_nodc(&gNB->common_vars.rxdataF[0][offset],12*18);
|
||||
LOG_D(PHY,"frame %d, slot %d: UL signal energy %d\n",frame_rx,slot_rx,power_rxF);
|
||||
|
||||
for (int i=0;i<NUMBER_OF_NR_PUCCH_MAX;i++){
|
||||
NR_gNB_PUCCH_t *pucch = gNB->pucch[i];
|
||||
if (pucch) {
|
||||
@@ -560,6 +568,8 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
(pucch->frame == frame_rx) &&
|
||||
(pucch->slot == slot_rx) ) {
|
||||
|
||||
pucch_decode_done = 1;
|
||||
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu = &pucch->pucch_pdu;
|
||||
uint16_t num_ucis;
|
||||
switch (pucch_pdu->format_type) {
|
||||
@@ -648,6 +658,8 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
}
|
||||
#endif
|
||||
|
||||
pusch_decode_done = 1;
|
||||
|
||||
uint8_t symbol_start = ulsch_harq->ulsch_pdu.start_symbol_index;
|
||||
uint8_t symbol_end = symbol_start + ulsch_harq->ulsch_pdu.nr_of_symbols;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RX_PUSCH,1);
|
||||
@@ -675,5 +687,9 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
// figure out a better way to choose slot_rx, 19 is ok for a particular TDD configuration with 30kHz SCS
|
||||
if ((frame_rx&127) == 0 && slot_rx==19) dump_pusch_stats(gNB);
|
||||
|
||||
if (pucch_decode_done || pusch_decode_done) {
|
||||
T(T_GNB_PHY_PUCCH_PUSCH_IQ, T_INT(frame_rx), T_INT(slot_rx), T_BUFFER(&gNB->common_vars.rxdataF[0][0], gNB->frame_parms.symbols_per_slot * gNB->frame_parms.ofdm_symbol_size * 4));
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,0);
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, u
|
||||
|
||||
/* 38.321 5.4.2.1 2> if the uplink grant was received on PDCCH for the C-RNTI and the HARQ buffer of the identified process is empty */
|
||||
if ((ulsch->harq_processes[harq_pid]->first_tx == 1) && (rnti_type == _C_RNTI_)) { /* no transmission yet on this process so consider its harq buffer as empty */
|
||||
ulsch->harq_processes[harq_pid]->first_tx = 0;
|
||||
ulsch->harq_processes[harq_pid]->first_tx = 0;
|
||||
ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator = ndi; /* store first value of ndi */
|
||||
ulsch->harq_processes[harq_pid]->round = 0;
|
||||
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
|
||||
|
||||
@@ -132,6 +132,7 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
}
|
||||
|
||||
switch (pdu_type){
|
||||
case FAPI_NR_RX_PDU_TYPE_SIB:
|
||||
case FAPI_NR_RX_PDU_TYPE_DLSCH:
|
||||
case FAPI_NR_RX_PDU_TYPE_RAR:
|
||||
harq_pid = dlsch0->current_harq_pid;
|
||||
@@ -238,33 +239,15 @@ void ue_ta_procedures(PHY_VARS_NR_UE *ue, int slot_tx, int frame_tx){
|
||||
int factor_mu = 1 << numerology;
|
||||
uint16_t bw_scaling = get_bw_scaling(bwp_ul_NB_RB);
|
||||
|
||||
LOG_D(PHY, "In %s: applying timing advance -- frame %d -- slot %d -- UE_mode %d\n", __FUNCTION__, frame_tx, slot_tx, ue->UE_mode[gNB_id]);
|
||||
ue->timing_advance += (ul_time_alignment->ta_command - 31) * bw_scaling / factor_mu;
|
||||
|
||||
if (ue->UE_mode[gNB_id] == RA_RESPONSE){
|
||||
|
||||
ue->timing_advance = ul_time_alignment->ta_command * bw_scaling / factor_mu;
|
||||
|
||||
LOG_D(PHY, "In %s: [UE %d] [%d.%d] Received (RAR) timing advance command %d new value is %u \n",
|
||||
__FUNCTION__,
|
||||
ue->Mod_id,
|
||||
frame_tx,
|
||||
slot_tx,
|
||||
ul_time_alignment->ta_command,
|
||||
ue->timing_advance);
|
||||
|
||||
} else if (ue->UE_mode[gNB_id] == PUSCH){
|
||||
|
||||
ue->timing_advance += (ul_time_alignment->ta_command - 31) * bw_scaling / factor_mu;
|
||||
|
||||
LOG_D(PHY, "In %s: [UE %d] [%d.%d] Got timing advance command %u from MAC, new value is %d\n",
|
||||
__FUNCTION__,
|
||||
ue->Mod_id,
|
||||
frame_tx,
|
||||
slot_tx,
|
||||
ul_time_alignment->ta_command,
|
||||
ue->timing_advance);
|
||||
|
||||
}
|
||||
LOG_I(PHY, "In %s: [UE %d] [%d.%d] Got timing advance command %u from MAC, new value is %d\n",
|
||||
__FUNCTION__,
|
||||
ue->Mod_id,
|
||||
frame_tx,
|
||||
slot_tx,
|
||||
ul_time_alignment->ta_command,
|
||||
ue->timing_advance);
|
||||
|
||||
ul_time_alignment->ta_frame = -1;
|
||||
ul_time_alignment->ta_slot = -1;
|
||||
@@ -1188,7 +1171,8 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, eNB_id, ue, dlsch0, number_pdus);
|
||||
break;
|
||||
case SI_PDSCH:
|
||||
rx_ind.rx_indication_body[0].pdu_type = FAPI_NR_RX_PDU_TYPE_SIB;
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, eNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, eNB_id, ue, dlsch0, number_pdus);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -56,7 +56,7 @@ UE_nr_rxtx_proc_t proc;
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
double cpuf;
|
||||
uint8_t nfapi_mode = 0;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3};
|
||||
|
||||
@@ -79,9 +79,9 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
double cpuf;
|
||||
|
||||
int sf_ahead=4 ;
|
||||
int sl_ahead=0;
|
||||
uint8_t nfapi_mode = 0;
|
||||
uint16_t sf_ahead=4 ;
|
||||
uint16_t sl_ahead=0;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
|
||||
// dummy functions
|
||||
@@ -97,6 +97,21 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB_index)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
|
||||
const int CC_id,
|
||||
const uint8_t gNB_id,
|
||||
const frame_t frameP,
|
||||
const rb_id_t Srb_id,
|
||||
uint8_t *buffer_pP)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
rrc_data_ind(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
@@ -151,6 +166,12 @@ nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nr_derive_key(int alg_type, uint8_t alg_id,
|
||||
const uint8_t key[32], uint8_t **out)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void config_common(int Mod_idP,
|
||||
int pdsch_AntennaPorts,
|
||||
int pusch_AntennaPorts,
|
||||
@@ -173,9 +194,12 @@ int is_x2ap_enabled(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t nr_rrc_ue_decode_NR_SIB1_Message(module_id_t module_id, uint8_t gNB_index, uint8_t *const bufferP, const uint8_t buffer_len) {
|
||||
return 0;
|
||||
}
|
||||
//nFAPI P7 dummy functions
|
||||
|
||||
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); }
|
||||
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req){ return(0); }
|
||||
int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req){ return(0); }
|
||||
int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req){ return(0); }
|
||||
|
||||
// needed for some functions
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
@@ -236,7 +260,10 @@ int main(int argc, char **argv)
|
||||
int i,aa;//,l;
|
||||
double sigma2, sigma2_dB=10, SNR, snr0=-2.0, snr1=2.0;
|
||||
uint8_t snr1set=0;
|
||||
float roundStats[50];
|
||||
double roundStats[500] = {0};
|
||||
double blerStats[500] = {0};
|
||||
double berStats[500] = {0};
|
||||
double snrStats[500] = {0};
|
||||
float effRate;
|
||||
//float psnr;
|
||||
float eff_tp_check = 0.7;
|
||||
@@ -1122,7 +1149,9 @@ int main(int argc, char **argv)
|
||||
if (UE_harq_process->harq_ack.ack==1) effRate += ((float)TBS)/round;
|
||||
} // noise trials
|
||||
|
||||
blerStats[snrRun] = (float) n_errors / (float) n_trials;
|
||||
roundStats[snrRun]/=((float)n_trials);
|
||||
berStats[snrRun] = (double)errors_scrambling/available_bits/n_trials;
|
||||
effRate /= n_trials;
|
||||
printf("*****************************************\n");
|
||||
printf("SNR %f, (false positive %f)\n", SNR,
|
||||
@@ -1130,7 +1159,7 @@ int main(int argc, char **argv)
|
||||
printf("*****************************************\n");
|
||||
printf("\n");
|
||||
dump_pdsch_stats(gNB);
|
||||
printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n", SNR, n_errors, n_trials,roundStats[snrRun],(double)errors_scrambling/available_bits/n_trials,effRate,effRate/TBS*100,TBS);
|
||||
printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, BLER %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n", SNR, n_errors, n_trials,roundStats[snrRun],berStats[snrRun],blerStats[snrRun],effRate,effRate/TBS*100,TBS);
|
||||
printf("\n");
|
||||
|
||||
if (print_perf==1) {
|
||||
@@ -1195,15 +1224,19 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
|
||||
//if ((float)n_errors/(float)n_trials <= target_error_rate) {
|
||||
if (effRate > (eff_tp_check*TBS)) {
|
||||
printf("PDSCH test OK\n");
|
||||
break;
|
||||
}
|
||||
|
||||
snrStats[snrRun] = SNR;
|
||||
snrRun++;
|
||||
} // NSR
|
||||
|
||||
LOG_M("dlsimStats.m","SNR",snrStats,snrRun,1,7);
|
||||
LOG_MM("dlsimStats.m","BLER",blerStats,snrRun,1,7);
|
||||
LOG_MM("dlsimStats.m","BER",berStats,snrRun,1,7);
|
||||
LOG_MM("dlsimStats.m","rounds",roundStats,snrRun,1,7);
|
||||
/*if (n_trials>1) {
|
||||
printf("HARQ stats:\nSNR\tRounds\n");
|
||||
psnr = snr0;
|
||||
|
||||
@@ -2,9 +2,16 @@ int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { re
|
||||
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
|
||||
//int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
|
||||
//int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) { return(0); }
|
||||
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); }
|
||||
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req){ return(0); }
|
||||
int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req){ return(0); }
|
||||
int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req){ return(0); }
|
||||
int32_t get_uldl_offset(int nr_bandP) { return(0); }
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id) {return(NULL);}
|
||||
nfapi_mode_t nfapi_mod;
|
||||
nfapi_mode_t nfapi_getmode(void) {
|
||||
return nfapi_mod;
|
||||
}
|
||||
int dummy_nr_ue_dl_indication(nr_downlink_indication_t *dl_info) { return(0); }
|
||||
int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); }
|
||||
void nr_fill_dl_indication(nr_downlink_indication_t *dl_ind,
|
||||
|
||||
@@ -2,7 +2,10 @@ int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { re
|
||||
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
|
||||
//int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) { return(0); }
|
||||
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); }
|
||||
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req){ return(0); }
|
||||
int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req){ return(0); }
|
||||
int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req){ return(0); }
|
||||
int32_t get_uldl_offset(int nr_bandP) { return(0); }
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id) {return(NULL);}
|
||||
int dummy_nr_ue_dl_indication(nr_downlink_indication_t *dl_info) { return(0); }
|
||||
|
||||
@@ -55,19 +55,6 @@ signed char quantize(double D, double x, unsigned char B) {
|
||||
return ((char) qxd);
|
||||
}
|
||||
|
||||
|
||||
int8_t
|
||||
mac_rrc_data_req_ue(
|
||||
const module_id_t Mod_idP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const rb_id_t Srb_id,
|
||||
const uint8_t Nb_tb,
|
||||
uint8_t *const buffer_pP,
|
||||
const mac_enb_index_t eNB_indexP,
|
||||
const uint8_t mbsfn_sync_area
|
||||
) { return(0);}
|
||||
|
||||
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {return(0);}
|
||||
//NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);}
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
|
||||
@@ -239,6 +226,7 @@ ngap_gNB_config_t ngap_config;
|
||||
uint32_t ngap_generate_gNB_id(void) {return 0;}
|
||||
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) { return;}
|
||||
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port) { return;}
|
||||
|
||||
void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) { return;}
|
||||
void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port) { return;}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -56,7 +56,7 @@ RAN_CONTEXT_t RC;
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
double cpuf;
|
||||
uint8_t nfapi_mode = 0;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
// needed for some functions
|
||||
@@ -111,7 +111,7 @@ void nr_phy_config_request_sim_pbchsim(PHY_VARS_gNB *gNB,
|
||||
|
||||
nr_init_frame_parms(gNB_config, fp);
|
||||
|
||||
init_symbol_rotation(fp,fp->dl_CarrierFreq);
|
||||
init_symbol_rotation(fp);
|
||||
|
||||
gNB->configured = 1;
|
||||
LOG_I(PHY,"gNB configured\n");
|
||||
@@ -540,7 +540,7 @@ int main(int argc, char **argv)
|
||||
if (input_fd==NULL) {
|
||||
gNB->pbch_configured = 1;
|
||||
|
||||
gNB->ssb_pdu.ssb_pdu_rel15.bchPayload = 0;
|
||||
gNB->ssb_pdu.ssb_pdu_rel15.bchPayload = 0x55dd33;
|
||||
|
||||
for (int slot=0;slot<frame_parms->slots_per_frame;slot++) {
|
||||
for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++)
|
||||
@@ -718,9 +718,9 @@ int main(int argc, char **argv)
|
||||
|
||||
payload_ret = (UE->pbch_vars[0]->xtra_byte == gNB_xtra_byte);
|
||||
for (i=0;i<3;i++){
|
||||
payload_ret += (UE->pbch_vars[0]->decoded_output[i] == (gNB->ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)));
|
||||
payload_ret += (UE->pbch_vars[0]->decoded_output[i] == ((gNB->ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)) & 0xff));
|
||||
}
|
||||
//printf("xtra byte gNB: 0x%02x UE: 0x%02x\n",gNB_xtra_byte, UE->rx_ind.rx_indication_body->mib_pdu.additional_bits);
|
||||
//printf("xtra byte gNB: 0x%02x UE: 0x%02x\n",gNB_xtra_byte, UE->pbch_vars[0]->xtra_byte);
|
||||
//printf("ret %d\n", payload_ret);
|
||||
if (payload_ret!=4)
|
||||
n_errors_payload++;
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "OCG_vars.h"
|
||||
#include <openair2/LAYER2/MAC/mac_vars.h>
|
||||
#include <openair2/RRC/LTE/rrc_vars.h>
|
||||
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
|
||||
|
||||
#define NR_PRACH_DEBUG 1
|
||||
@@ -62,14 +63,18 @@ RU_t *ru;
|
||||
double cpuf;
|
||||
extern uint16_t prach_root_sequence_map0_3[838];
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
uint8_t nfapi_mode=0;
|
||||
int sl_ahead = 0;
|
||||
//uint8_t nfapi_mode=0;
|
||||
uint16_t sl_ahead = 0;
|
||||
|
||||
//void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
|
||||
/* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */
|
||||
uint64_t get_softmodem_optmask(void) {return 0;}
|
||||
softmodem_params_t *get_softmodem_params(void) {return 0;}
|
||||
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); }
|
||||
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req){ return(0); }
|
||||
int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req){ return(0); }
|
||||
int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req){ return(0); }
|
||||
|
||||
void
|
||||
rrc_data_ind(
|
||||
@@ -127,13 +132,30 @@ nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index, const int8_t channel, const uint8_t* pduP, const sdu_size_t pdu_len) {return 0;}
|
||||
|
||||
void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB_index)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
|
||||
const int CC_id,
|
||||
const uint8_t gNB_id,
|
||||
const frame_t frameP,
|
||||
const rb_id_t Srb_id,
|
||||
uint8_t *buffer_pP)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Dummy function to avoid linking error at compilation of nr-prachsim
|
||||
int is_x2ap_enabled(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t nr_rrc_ue_decode_NR_SIB1_Message(module_id_t module_id, uint8_t gNB_index, uint8_t *const bufferP, const uint8_t buffer_len) {
|
||||
int nr_derive_key(int alg_type, uint8_t alg_id,
|
||||
const uint8_t key[32], uint8_t **out)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
double cpuf;
|
||||
uint8_t nfapi_mode = 0;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3};
|
||||
uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3};
|
||||
|
||||
@@ -60,7 +60,7 @@ uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3};
|
||||
uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3};
|
||||
|
||||
double cpuf;
|
||||
uint8_t nfapi_mode = 0;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
// needed for some functions
|
||||
|
||||
@@ -75,10 +75,11 @@ PHY_VARS_NR_UE *UE;
|
||||
RAN_CONTEXT_t RC;
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
int sf_ahead=4 ;
|
||||
int sl_ahead=0;
|
||||
uint16_t sf_ahead=4 ;
|
||||
int slot_ahead=6 ;
|
||||
uint16_t sl_ahead=0;
|
||||
double cpuf;
|
||||
uint8_t nfapi_mode = 0;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
|
||||
|
||||
@@ -154,7 +155,31 @@ int is_x2ap_enabled(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t nr_rrc_ue_decode_NR_SIB1_Message(module_id_t module_id, uint8_t gNB_index, uint8_t *const bufferP, const uint8_t buffer_len) {
|
||||
void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB_index)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
|
||||
const int CC_id,
|
||||
const uint8_t gNB_id,
|
||||
const frame_t frameP,
|
||||
const rb_id_t Srb_id,
|
||||
uint8_t *buffer_pP)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//nFAPI P7 dummy functions
|
||||
|
||||
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); }
|
||||
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req){ return(0); }
|
||||
int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req){ return(0); }
|
||||
int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req){ return(0); }
|
||||
|
||||
int nr_derive_key(int alg_type, uint8_t alg_id,
|
||||
const uint8_t key[32], uint8_t **out)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +142,10 @@ void thread_top_init(char *thread_name,
|
||||
|
||||
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0);}
|
||||
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
|
||||
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); }
|
||||
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req){ return(0); }
|
||||
int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req){ return(0); }
|
||||
int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req){ return(0); }
|
||||
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user