1. Fixed pbchsim build failure due to prs source file dependacy
2. Fixed GPS time assert in gNB_scheduler_uci.c
This commit is contained in:
@@ -141,7 +141,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
NR_DL_FRAME_PARMS *const fp = &ue->frame_parms;
|
||||
NR_UE_COMMON *const common_vars = &ue->common_vars;
|
||||
NR_UE_PBCH **const pbch_vars = ue->pbch_vars;
|
||||
NR_UE_PRS **const prs_vars = ue->prs_vars;
|
||||
NR_UE_PRACH **const prach_vars = ue->prach_vars;
|
||||
NR_UE_CSI_IM **const csiim_vars = ue->csiim_vars;
|
||||
NR_UE_CSI_RS **const csirs_vars = ue->csirs_vars;
|
||||
@@ -191,55 +190,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// PRS vars
|
||||
for(int idx = 0; idx < NR_MAX_PRS_COMB_SIZE; idx++)
|
||||
{
|
||||
prs_vars[idx] = (NR_UE_PRS *)malloc16_clear(sizeof(NR_UE_PRS));
|
||||
for(int k = 0; k < NR_MAX_PRS_RESOURCES_PER_SET; k++)
|
||||
{
|
||||
// PRS channel estimates
|
||||
prs_vars[idx]->prs_resource[k].prs_ch_estimates = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
prs_vars[idx]->prs_resource[k].prs_ch_estimates_time = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time!=NULL)), "NR UE init: PRS channel estimates malloc failed for gNB_id %d\n", idx);
|
||||
prs_vars[idx]->prs_resource[k].prs_meas = (prs_meas_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(prs_meas_t *) );
|
||||
AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas!=NULL), "NR UE init: PRS measurements malloc failed for gNB_id %d\n", idx);
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
prs_vars[idx]->prs_resource[k].prs_ch_estimates[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates[i]!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed for rx_ant %d\n", i);
|
||||
prs_vars[idx]->prs_resource[k].prs_meas[i] = (prs_meas_t *)malloc16_clear(sizeof(prs_meas_t) );
|
||||
AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas[i]!=NULL), "NR UE init: PRS measurements malloc failed for rx_ant %d\n", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
// load the config file params
|
||||
RCconfig_nrUE_prs(ue);
|
||||
|
||||
//PRS sequence init
|
||||
ue->nr_gold_prs = (uint32_t *****)malloc16(ue->prs_active_gNBs*sizeof(uint32_t ****));
|
||||
uint32_t *****prs = ue->nr_gold_prs;
|
||||
AssertFatal(prs!=NULL, "NR UE init: positioning reference signal malloc failed\n");
|
||||
for (int gnb = 0; gnb < ue->prs_active_gNBs; gnb++) {
|
||||
prs[gnb] = (uint32_t ****)malloc16(ue->prs_vars[gnb]->NumPRSResources*sizeof(uint32_t ***));
|
||||
AssertFatal(prs[gnb]!=NULL, "NR UE init: positioning reference signal for gnb %d - malloc failed\n", gnb);
|
||||
|
||||
for (int rsc = 0; rsc < ue->prs_vars[gnb]->NumPRSResources; rsc++) {
|
||||
prs[gnb][rsc] = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
|
||||
AssertFatal(prs[gnb][rsc]!=NULL, "NR UE init: positioning reference signal for gnb %d rsc %d- malloc failed\n", gnb, rsc);
|
||||
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
prs[gnb][rsc][slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
|
||||
AssertFatal(prs[gnb][rsc][slot]!=NULL, "NR UE init: positioning reference signal for gnb %d rsc %d slot %d - malloc failed\n", gnb, rsc, slot);
|
||||
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
prs[gnb][rsc][slot][symb] = (uint32_t *)malloc16(NR_MAX_PRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
|
||||
AssertFatal(prs[gnb][rsc][slot][symb]!=NULL, "NR UE init: positioning reference signal for gnb %d rsc %d slot %d symbol %d - malloc failed\n", gnb, rsc, slot, symb);
|
||||
} // for symb
|
||||
} // for slot
|
||||
} // for rsc
|
||||
} // for gnb
|
||||
init_nr_gold_prs(ue);
|
||||
|
||||
/////////////////////////PUSCH DMRS init/////////////////////////
|
||||
///////////
|
||||
|
||||
@@ -8,11 +8,6 @@
|
||||
//#define DEBUG_PRS_MAP
|
||||
|
||||
extern short nr_qpsk_mod_table[8];
|
||||
int k_prime_table[4][12] = {
|
||||
{0,1,0,1,0,1,0,1,0,1,0,1},
|
||||
{0,2,1,3,0,2,1,3,0,2,1,3},
|
||||
{0,3,1,4,2,5,0,3,1,4,2,5},
|
||||
{0,6,3,9,1,7,4,10,2,8,5,11}};
|
||||
|
||||
int nr_generate_prs(uint32_t **nr_gold_prs,
|
||||
int32_t *txdataF,
|
||||
@@ -22,10 +17,10 @@ int nr_generate_prs(uint32_t **nr_gold_prs,
|
||||
NR_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
|
||||
int k_prime = 0, k = 0;
|
||||
int k_prime = 0, k = 0, idx;
|
||||
int16_t mod_prs[NR_MAX_PRS_LENGTH<<1];
|
||||
uint8_t idx;
|
||||
|
||||
int16_t k_prime_table[K_PRIME_TABLE_ROW_SIZE][K_PRIME_TABLE_COL_SIZE] = PRS_K_PRIME_TABLE;
|
||||
|
||||
// PRS resource mapping with combsize=k which means PRS symbols exist in every k-th subcarrier in frequency domain
|
||||
// According to ts138.211 sec.7.4.1.7.2
|
||||
for (int l = prs_data->SymbolStart; l < prs_data->SymbolStart + prs_data->NumPRSSymbols; l++) {
|
||||
|
||||
@@ -40,11 +40,6 @@
|
||||
//#define DEBUG_PRS_PRINTS
|
||||
#define IDFT_INTERPOL_FACTOR 1
|
||||
extern short nr_qpsk_mod_table[8];
|
||||
int k_prime_table[4][12] = {
|
||||
{0,1,0,1,0,1,0,1,0,1,0,1},
|
||||
{0,2,1,3,0,2,1,3,0,2,1,3},
|
||||
{0,3,1,4,2,5,0,3,1,4,2,5},
|
||||
{0,6,3,9,1,7,4,10,2,8,5,11}};
|
||||
|
||||
static inline int abs32(int x)
|
||||
{
|
||||
@@ -85,6 +80,7 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
|
||||
int16_t num_pilots = (12/prs_cfg->CombSize)*prs_cfg->NumRB;
|
||||
int16_t start_offset = (IDFT_INTERPOL_FACTOR-1)*frame_params->ofdm_symbol_size>>1;
|
||||
|
||||
int16_t k_prime_table[K_PRIME_TABLE_ROW_SIZE][K_PRIME_TABLE_COL_SIZE] = PRS_K_PRIME_TABLE;
|
||||
for(int l = prs_cfg->SymbolStart; l < prs_cfg->SymbolStart+prs_cfg->NumPRSSymbols; l++)
|
||||
{
|
||||
int symInd = l-prs_cfg->SymbolStart;
|
||||
|
||||
@@ -418,6 +418,14 @@ typedef struct {
|
||||
int32_t reserved;
|
||||
} prs_meas_t;
|
||||
|
||||
// rel16 prs k_prime table as per ts138.211 sec.7.4.1.7.2
|
||||
#define K_PRIME_TABLE_ROW_SIZE 4
|
||||
#define K_PRIME_TABLE_COL_SIZE 12
|
||||
#define PRS_K_PRIME_TABLE { {0,1,0,1,0,1,0,1,0,1,0,1}, \
|
||||
{0,2,1,3,0,2,1,3,0,2,1,3}, \
|
||||
{0,3,1,4,2,5,0,3,1,4,2,5}, \
|
||||
{0,6,3,9,1,7,4,10,2,8,5,11} };
|
||||
|
||||
#define KHz (1000UL)
|
||||
#define MHz (1000*KHz)
|
||||
|
||||
|
||||
@@ -160,7 +160,6 @@ int main(int argc, char **argv)
|
||||
int **txdata;
|
||||
double **s_re,**s_im,**r_re,**r_im;
|
||||
//double iqim = 0.0;
|
||||
double DS_TDL = .03;
|
||||
double ip =0.0;
|
||||
//unsigned char pbch_pdu[6];
|
||||
// int sync_pos, sync_pos_slot;
|
||||
@@ -274,21 +273,6 @@ int main(int argc, char **argv)
|
||||
case 'G':
|
||||
channel_model=ETU;
|
||||
break;
|
||||
|
||||
case 'H':
|
||||
channel_model = TDL_C;
|
||||
DS_TDL = .030; // 30 ns
|
||||
break;
|
||||
|
||||
case 'I':
|
||||
channel_model = TDL_C;
|
||||
DS_TDL = .3; // 300ns
|
||||
break;
|
||||
|
||||
case 'J':
|
||||
channel_model=TDL_D;
|
||||
DS_TDL = .03;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Unsupported channel model! Exiting.\n");
|
||||
@@ -545,8 +529,10 @@ int main(int argc, char **argv)
|
||||
channel_model,
|
||||
fs,
|
||||
bw,
|
||||
DS_TDL,
|
||||
0, 0, 0, 0);
|
||||
300e-9,
|
||||
0,
|
||||
0,
|
||||
0, 0);
|
||||
|
||||
if (gNB2UE==NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
@@ -689,16 +675,6 @@ int main(int argc, char **argv)
|
||||
frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples);
|
||||
printf("txlev %d (%f)\n",txlev,10*log10(txlev));*/
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
for (i=0; i<frame_length_complex_samples; i++) {
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
|
||||
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
|
||||
}
|
||||
}
|
||||
=======
|
||||
>>>>>>> origin/develop
|
||||
|
||||
for (SNR=snr0; SNR<snr1; SNR+=.2) {
|
||||
|
||||
@@ -707,19 +683,6 @@ int main(int argc, char **argv)
|
||||
|
||||
for (trial=0; trial<n_trials; trial++) {
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (channel_model != AWGN) {
|
||||
// multipath channel
|
||||
multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0,0);
|
||||
}
|
||||
else {
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
memcpy(r_re[aa],s_re[aa],frame_length_complex_samples*sizeof(double));
|
||||
memcpy(r_im[aa],s_im[aa],frame_length_complex_samples*sizeof(double));
|
||||
}
|
||||
}
|
||||
|
||||
=======
|
||||
for (i=0; i<frame_length_complex_samples; i++) {
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
|
||||
@@ -730,7 +693,6 @@ int main(int argc, char **argv)
|
||||
// multipath channel
|
||||
//multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0);
|
||||
|
||||
>>>>>>> origin/develop
|
||||
//AWGN
|
||||
sigma2_dB = 20*log10((double)AMP/4)-SNR;
|
||||
sigma2 = pow(10,sigma2_dB/10);
|
||||
@@ -786,44 +748,18 @@ int main(int argc, char **argv)
|
||||
while (!((SSB_positions >> ssb_index) & 0x01)) ssb_index++; // to select the first transmitted ssb
|
||||
UE->symbol_offset = nr_get_ssb_start_symbol(frame_parms,ssb_index);
|
||||
|
||||
int ssb_slot = (UE->symbol_offset/14)+(n_hf*(frame_parms->slots_per_frame>>1));
|
||||
|
||||
for(int j = 0; j < frame_parms->symbols_per_slot; j++)
|
||||
{
|
||||
int ssb_slot = (UE->symbol_offset/14)+(n_hf*(frame_parms->slots_per_frame>>1));
|
||||
for (int i=UE->symbol_offset+1; i<UE->symbol_offset+4; i++) {
|
||||
nr_slot_fep(UE,
|
||||
&proc,
|
||||
j%frame_parms->symbols_per_slot,
|
||||
i%frame_parms->symbols_per_slot,
|
||||
ssb_slot);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
for (int i=UE->symbol_offset+1; i<UE->symbol_offset+4; i++) {
|
||||
nr_pbch_channel_estimation(UE,&proc,0,ssb_slot,i%frame_parms->symbols_per_slot,i-(UE->symbol_offset+1),ssb_index%8,n_hf);
|
||||
}
|
||||
|
||||
UE->prs_cfg.PRSResourceSetPeriod[0]=40; // PRS resource slot period
|
||||
UE->prs_cfg.PRSResourceSetPeriod[1]=0; // resource slot offset
|
||||
UE->prs_cfg.SymbolStart=7;
|
||||
UE->prs_cfg.NumPRSSymbols=4;
|
||||
UE->prs_cfg.NumRB=frame_parms->N_RB_DL;
|
||||
UE->prs_cfg.RBOffset=0;
|
||||
UE->prs_cfg.CombSize=2;
|
||||
UE->prs_cfg.REOffset=0;
|
||||
UE->prs_cfg.PRSResourceOffset=0;
|
||||
UE->prs_cfg.PRSResourceRepetition=1;
|
||||
UE->prs_cfg.PRSResourceTimeGap=1;
|
||||
UE->prs_cfg.NPRSID=0;
|
||||
|
||||
//PRS channel estimation
|
||||
nr_prs_channel_estimation(UE,&proc,frame_parms);
|
||||
|
||||
=======
|
||||
nr_pbch_channel_estimation(UE,estimateSz, dl_ch_estimates, dl_ch_estimates_time, &proc,
|
||||
0,ssb_slot,i%frame_parms->symbols_per_slot,i-(UE->symbol_offset+1),ssb_index%8,n_hf);
|
||||
|
||||
}
|
||||
fapiPbch_t result;
|
||||
>>>>>>> origin/develop
|
||||
ret = nr_rx_pbch(UE,
|
||||
&proc,
|
||||
estimateSz, dl_ch_estimates,
|
||||
|
||||
Reference in New Issue
Block a user