Commit 1a04ebaa authored by francescomani's avatar francescomani

cleanup of gNB PHY procedures and removal of global PBCH structure

parent d04a83ea
This diff is collapsed.
...@@ -72,33 +72,30 @@ int nr_generate_sss(c16_t *txdataF, ...@@ -72,33 +72,30 @@ int nr_generate_sss(c16_t *txdataF,
NR_DL_FRAME_PARMS *frame_parms); NR_DL_FRAME_PARMS *frame_parms);
/*! /*!
\fn int nr_generate_pbch_dmrs \fn void nr_generate_pbch_dmrs
\brief Generation of the DMRS for the PBCH \brief Generation of the DMRS for the PBCH
@param @param
@returns 0 on success
*/ */
int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs, void nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs,
c16_t *txdataF, c16_t *txdataF,
int16_t amp, int16_t amp,
uint8_t ssb_start_symbol, uint8_t ssb_start_symbol,
nfapi_nr_config_request_scf_t *config, nfapi_nr_config_request_scf_t *config,
NR_DL_FRAME_PARMS *frame_parms); NR_DL_FRAME_PARMS *frame_parms);
/*! /*!
\fn int nr_generate_pbch \fn void nr_generate_pbch
\brief Generation of the PBCH \brief Generation of the PBCH
@param @param
@returns 0 on success
*/ */
int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, void nr_generate_pbch(PHY_VARS_gNB *gNB,
uint8_t *interleaver, const nfapi_nr_dl_tti_ssb_pdu *ssb_pdu,
c16_t *txdataF, c16_t *txdataF,
int16_t amp, uint8_t ssb_start_symbol,
uint8_t ssb_start_symbol, uint8_t n_hf,
uint8_t n_hf, int sfn,
int sfn, nfapi_nr_config_request_scf_t *config,
nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms);
NR_DL_FRAME_PARMS *frame_parms);
/*! /*!
\fn int nr_generate_pbch \fn int nr_generate_pbch
...@@ -107,6 +104,7 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, ...@@ -107,6 +104,7 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu,
@returns the bit index of the output @returns the bit index of the output
*/ */
void nr_init_pbch_interleaver(uint8_t *interleaver); void nr_init_pbch_interleaver(uint8_t *interleaver);
uint32_t nr_pbch_extra_byte_generation(int sfn, int n_hf, int ssb_index, int ssb_sc_offset, int Lmax);
NR_gNB_DLSCH_t new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint16_t N_RB); NR_gNB_DLSCH_t new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint16_t N_RB);
......
...@@ -53,13 +53,6 @@ typedef struct { ...@@ -53,13 +53,6 @@ typedef struct {
int lut[MAX_PUCCH0_NID][160][14]; int lut[MAX_PUCCH0_NID][160][14];
} NR_gNB_PUCCH0_LUT_t; } NR_gNB_PUCCH0_LUT_t;
typedef struct {
uint32_t pbch_a;
uint32_t pbch_a_interleaved;
uint32_t pbch_a_prime;
uint32_t pbch_e[NR_POLAR_PBCH_E_DWORD];
} NR_gNB_PBCH;
typedef struct { typedef struct {
/// Nfapi DLSCH PDU /// Nfapi DLSCH PDU
nfapi_nr_dl_tti_pdsch_pdu pdsch_pdu; nfapi_nr_dl_tti_pdsch_pdu pdsch_pdu;
...@@ -469,7 +462,6 @@ typedef struct PHY_VARS_gNB_s { ...@@ -469,7 +462,6 @@ typedef struct PHY_VARS_gNB_s {
int max_nb_pdsch; int max_nb_pdsch;
int max_nb_pusch; int max_nb_pusch;
NR_gNB_PBCH pbch;
NR_gNB_COMMON common_vars; NR_gNB_COMMON common_vars;
NR_gNB_PRACH prach_vars; NR_gNB_PRACH prach_vars;
NR_gNB_PRS prs_vars; NR_gNB_PRS prs_vars;
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
extern uint8_t nfapi_mode; extern uint8_t nfapi_mode;
void nr_common_signal_procedures(PHY_VARS_gNB *gNB,int frame,int slot, nfapi_nr_dl_tti_ssb_pdu ssb_pdu) void nr_common_signal_procedures(PHY_VARS_gNB *gNB, int frame,int slot, nfapi_nr_dl_tti_ssb_pdu ssb_pdu)
{ {
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
...@@ -135,10 +135,9 @@ void nr_common_signal_procedures(PHY_VARS_gNB *gNB,int frame,int slot, nfapi_nr_ ...@@ -135,10 +135,9 @@ void nr_common_signal_procedures(PHY_VARS_gNB *gNB,int frame,int slot, nfapi_nr_
gNB->common_vars.beam_id[0][slot*fp->symbols_per_slot+j] = cfg->ssb_table.ssb_beam_id_list[ssb_index].beam_id.value; gNB->common_vars.beam_id[0][slot*fp->symbols_per_slot+j] = cfg->ssb_table.ssb_beam_id_list[ssb_index].beam_id.value;
} }
nr_generate_pbch(&ssb_pdu, nr_generate_pbch(gNB,
gNB->nr_pbch_interleaver, &ssb_pdu,
&txdataF[0][txdataF_offset], &txdataF[0][txdataF_offset],
gNB->TX_AMP,
ssb_start_symbol, ssb_start_symbol,
n_hf, n_hf,
frame, frame,
......
...@@ -204,6 +204,7 @@ int main(int argc, char **argv) ...@@ -204,6 +204,7 @@ int main(int argc, char **argv)
channel_desc_t *gNB2UE; channel_desc_t *gNB2UE;
get_softmodem_params()->sa = 1; get_softmodem_params()->sa = 1;
get_softmodem_params()->usim_test = 1;
//uint8_t extended_prefix_flag=0; //uint8_t extended_prefix_flag=0;
//int8_t interf1=-21,interf2=-21; //int8_t interf1=-21,interf2=-21;
...@@ -230,7 +231,7 @@ int main(int argc, char **argv) ...@@ -230,7 +231,7 @@ int main(int argc, char **argv)
int frame_length_complex_samples_no_prefix; int frame_length_complex_samples_no_prefix;
NR_DL_FRAME_PARMS *frame_parms; NR_DL_FRAME_PARMS *frame_parms;
int ret, payload_ret=0; int ret;
int run_initial_sync=0; int run_initial_sync=0;
int loglvl=OAILOG_WARNING; int loglvl=OAILOG_WARNING;
...@@ -835,17 +836,15 @@ int main(int argc, char **argv) ...@@ -835,17 +836,15 @@ int main(int argc, char **argv)
rxdataF); rxdataF);
if (ret == 0) { if (ret == 0) {
// UE->rx_ind.rx_indication_body->mib_pdu.ssb_index; //not yet detected automatically uint32_t xtra_byte = nr_pbch_extra_byte_generation(frame,
// UE->rx_ind.rx_indication_body->mib_pdu.ssb_length; //Lmax, not yet detected automatically n_hf,
uint8_t gNB_xtra_byte = 0; ssb_index,
for (int i = 0; i < 8; i++) gNB->gNB_config.ssb_table.ssb_subcarrier_offset.value,
gNB_xtra_byte |= ((gNB->pbch.pbch_a >> (31 - i)) & 1) << (7 - i); frame_parms->Lmax);
int payload_ret = (result.xtra_byte == xtra_byte);
payload_ret = (result.xtra_byte == gNB_xtra_byte); nfapi_nr_dl_tti_ssb_pdu_rel15_t *pdu = &msgDataTx.ssb[ssb_index].ssb_pdu.ssb_pdu_rel15;
for (i = 0; i < 3; i++) { for (int i = 0; i < 3; i++)
payload_ret += payload_ret += (result.decoded_output[i] == ((pdu->bchPayload >> (8 * i)) & 0xff));
(result.decoded_output[i] == ((msgDataTx.ssb[ssb_index].ssb_pdu.ssb_pdu_rel15.bchPayload >> (8 * i)) & 0xff));
}
// printf("ret %d\n", payload_ret); // printf("ret %d\n", payload_ret);
if (payload_ret != 4) if (payload_ret != 4)
n_errors_payload++; n_errors_payload++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment