taking sib1 detection out of initial sync

This commit is contained in:
francescomani
2023-07-27 11:11:09 +02:00
parent f65ce8c4fa
commit 44bc3e7cce
20 changed files with 152 additions and 371 deletions
+2 -103
View File
@@ -101,7 +101,7 @@ void free_list(NR_UE_SSB *node) {
}
int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_initial_symbol, nr_phy_data_t *phy_data, c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP])
int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_initial_symbol, c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP])
{
NR_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
int ret =-1;
@@ -163,7 +163,6 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini
frame_parms,
temp_ptr->i_ssb,
SISO,
phy_data,
&result,
rxdataF);
@@ -213,9 +212,6 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
int ret=-1;
int rx_power=0; //aarx,
nr_phy_data_t phy_data = {0};
NR_UE_PDCCH_CONFIG *phy_pdcch_config = &phy_data.phy_pdcch_config;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INITIAL_UE_SYNC, VCD_FUNCTION_IN);
@@ -317,7 +313,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
if (ret==0) { //we got sss channel
nr_gold_pbch(ue);
ret = nr_pbch_detection(proc, ue, 1, &phy_data, rxdataF); // start pbch detection at first symbol after pss
ret = nr_pbch_detection(proc, ue, 1, rxdataF); // start pbch detection at first symbol after pss
}
if (ret == 0) {
@@ -464,103 +460,6 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
#endif
}
if (ue->target_Nid_cell != -1) {
return ret;
}
// if stand alone and sync on ssb do sib1 detection as part of initial sync
if (sa == 1 && ret == 0) {
nr_ue_dlsch_init(phy_data.dlsch, 1, ue->max_ldpc_iterations);
bool dec = false;
proc->gNB_id = 0; //FIXME
// Hold the channel estimates in frequency domain.
int32_t pdcch_est_size = ((((fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH))+15)/16)*16);
__attribute__ ((aligned(16))) int32_t pdcch_dl_ch_estimates[4*fp->nb_antennas_rx][pdcch_est_size];
for(int n_ss = 0; n_ss < phy_pdcch_config->nb_search_space; n_ss++) {
proc->nr_slot_rx = phy_pdcch_config->slot; // setting PDCCH slot to proc
uint8_t nb_symb_pdcch = phy_pdcch_config->pdcch_config[n_ss].coreset.duration;
int start_symb = phy_pdcch_config->pdcch_config[n_ss].coreset.StartSymbolIndex;
for (uint16_t l=start_symb; l<start_symb+nb_symb_pdcch; l++) {
nr_slot_fep_init_sync(ue,
proc,
l, // the UE PHY has no notion of the symbols to be monitored in the search space
frame_id * fp->samples_per_frame + phy_pdcch_config->sfn * fp->samples_per_frame + ue->rx_offset,
true,
rxdataF,
link_type_dl);
nr_pdcch_channel_estimation(ue,
proc,
l,
&phy_pdcch_config->pdcch_config[n_ss].coreset,
fp->first_carrier_offset,
phy_pdcch_config->pdcch_config[n_ss].BWPStart,
pdcch_est_size,
pdcch_dl_ch_estimates,
rxdataF);
}
int dci_cnt = nr_ue_pdcch_procedures(ue, proc, pdcch_est_size, pdcch_dl_ch_estimates, &phy_data, n_ss, rxdataF);
if (dci_cnt>0){
NR_UE_DLSCH_t *dlsch = phy_data.dlsch;
if (dlsch[0].active == 1) {
uint16_t nb_symb_sch = dlsch->dlsch_config.number_symbols;
uint16_t start_symb_sch = dlsch->dlsch_config.start_symbol;
for (uint16_t m=start_symb_sch;m<(nb_symb_sch+start_symb_sch) ; m++){
nr_slot_fep_init_sync(ue,
proc,
m,
frame_id * fp->samples_per_frame + phy_pdcch_config->sfn * fp->samples_per_frame + ue->rx_offset,
true,
rxdataF,
link_type_dl);
}
uint8_t nb_re_dmrs;
if (dlsch[0].dlsch_config.dmrsConfigType == NFAPI_NR_DMRS_TYPE1) {
nb_re_dmrs = 6*dlsch[0].dlsch_config.n_dmrs_cdm_groups;
}
else {
nb_re_dmrs = 4*dlsch[0].dlsch_config.n_dmrs_cdm_groups;
}
uint16_t dmrs_len = get_num_dmrs(dlsch[0].dlsch_config.dlDmrsSymbPos);
const uint32_t rx_llr_size = nr_get_G(dlsch[0].dlsch_config.number_rbs,
dlsch[0].dlsch_config.number_symbols,
nb_re_dmrs,
dmrs_len,
dlsch[0].dlsch_config.qamModOrder,
dlsch[0].Nl);
int16_t* llr[2];
int16_t* layer_llr[NR_MAX_NB_LAYERS];
llr[0] = (int16_t *)malloc16_clear(rx_llr_size*sizeof(int16_t));
int ret = nr_ue_pdsch_procedures(ue,
proc,
phy_data.dlsch,
llr,
rxdataF);
if (ret >= 0)
dec = nr_ue_dlsch_procedures(ue,
proc,
phy_data.dlsch,
llr);
// deactivate dlsch once dlsch proc is done
dlsch[0].active = 0;
free(llr[0]);
for (int i=0; i<NR_MAX_NB_LAYERS; i++)
free(layer_llr[i]);
}
}
}
if (dec == false) // sib1 not decoded
ret = -1;
}
// exit_fun("debug exit");
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INITIAL_UE_SYNC, VCD_FUNCTION_OUT);
return ret;
+2 -9
View File
@@ -389,7 +389,6 @@ int nr_rx_pbch(PHY_VARS_NR_UE *ue,
NR_DL_FRAME_PARMS *frame_parms,
uint8_t i_ssb,
MIMO_mode_t mimo_mode,
nr_phy_data_t *phy_data,
fapiPbch_t *result,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP])
{
@@ -515,7 +514,7 @@ int nr_rx_pbch(PHY_VARS_NR_UE *ue,
uint16_t number_pdus = 1;
if(decoderState) {
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, phy_data);
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, NULL);
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, ue, NULL, NULL, number_pdus, proc, NULL, NULL);
if (ue->if_inst && ue->if_inst->dl_indication)
ue->if_inst->dl_indication(&dl_indication);
@@ -569,12 +568,6 @@ int nr_rx_pbch(PHY_VARS_NR_UE *ue,
if (frame_parms->half_frame_bit)
ue->symbol_offset += (frame_parms->slots_per_frame>>1)*frame_parms->symbols_per_slot;
uint8_t frame_number_4lsb = 0;
for (int i=0; i<4; i++)
frame_number_4lsb |= ((result->xtra_byte>>i)&1)<<(3-i);
proc->decoded_frame_rx = frame_number_4lsb;
#ifdef DEBUG_PBCH
printf("xtra_byte %x payload %x\n", xtra_byte, payload);
@@ -585,7 +578,7 @@ int nr_rx_pbch(PHY_VARS_NR_UE *ue,
#endif
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, phy_data);
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, NULL);
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, ue, NULL, NULL, number_pdus, proc, (void *)result, NULL);
if (ue->if_inst && ue->if_inst->dl_indication)
@@ -291,14 +291,12 @@ int nr_rx_pbch(PHY_VARS_NR_UE *ue,
NR_DL_FRAME_PARMS *frame_parms,
uint8_t i_ssb,
MIMO_mode_t mimo_mode,
nr_phy_data_t *phy_data,
fapiPbch_t* result,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]);
int nr_pbch_detection(UE_nr_rxtx_proc_t *proc,
PHY_VARS_NR_UE *ue,
int pbch_initial_symbol,
nr_phy_data_t *phy_data,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]);
-2
View File
@@ -665,8 +665,6 @@ typedef struct {
int frame_tx;
/// frame to act upon for reception
int frame_rx;
int frame_number_4lsb;
int decoded_frame_rx;
} UE_nr_rxtx_proc_t;
typedef struct nr_phy_data_tx_s {
+1 -3
View File
@@ -361,7 +361,6 @@ static int nr_ue_pbch_procedures(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
int estimateSz,
struct complex16 dl_ch_estimates[][estimateSz],
nr_phy_data_t *phy_data,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]) {
int ret = 0;
@@ -382,7 +381,6 @@ static int nr_ue_pbch_procedures(PHY_VARS_NR_UE *ue,
&ue->frame_parms,
(ue->frame_parms.ssb_index)&7,
SISO,
phy_data,
&result,
rxdataF);
@@ -904,7 +902,7 @@ void pbch_pdcch_processing(PHY_VARS_NR_UE *ue,
if(ssb_index == fp->ssb_index) {
LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx);
const int pbchSuccess = nr_ue_pbch_procedures(ue, proc, estimateSz, dl_ch_estimates, phy_data, rxdataF);
const int pbchSuccess = nr_ue_pbch_procedures(ue, proc, estimateSz, dl_ch_estimates, rxdataF);
if (ue->no_timing_correction==0 && pbchSuccess == 0) {
LOG_D(PHY,"start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction);
-2
View File
@@ -782,7 +782,6 @@ int main(int argc, char **argv)
}
else {
UE_nr_rxtx_proc_t proc={0};
nr_phy_data_t phy_data={0};
UE->rx_offset=0;
uint8_t ssb_index = 0;
@@ -814,7 +813,6 @@ int main(int argc, char **argv)
frame_parms,
ssb_index%8,
SISO,
&phy_data,
&result,
rxdataF);