fixing ssb_subcarrier_offset computation for odd N_PRB in gNB and UE
adding Nid_cell to nr_pbchsim
This commit is contained in:
@@ -387,7 +387,7 @@ void install_schedule_handlers(IF_Module_t *if_inst)
|
||||
|
||||
/// this function is a temporary addition for NR configuration
|
||||
|
||||
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu)
|
||||
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell)
|
||||
{
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
nfapi_nr_config_request_t *gNB_config = &gNB->gNB_config;
|
||||
@@ -403,6 +403,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu)
|
||||
gNB_config->sch_config.ssb_subcarrier_offset.value = 0;
|
||||
gNB_config->sch_config.n_ssb_crb.value = (N_RB_DL-20);
|
||||
gNB_config->sch_config.ssb_subcarrier_offset.value = 0;
|
||||
gNB_config->sch_config.physical_cell_id.value=Nid_cell;
|
||||
|
||||
|
||||
gNB->mac_enabled = 1;
|
||||
|
||||
@@ -656,6 +656,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
int eNB_id;
|
||||
int th_id;
|
||||
int n_ssb_crb=(fp->N_RB_DL-20);
|
||||
int k_ssb=0;
|
||||
abstraction_flag = 0;
|
||||
fp->nb_antennas_tx = 1;
|
||||
fp->nb_antennas_rx=1;
|
||||
@@ -664,7 +665,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx);
|
||||
//LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST);
|
||||
|
||||
nr_init_frame_parms_ue(fp,NR_MU_1,NORMAL,fp->N_RB_DL,n_ssb_crb,0);
|
||||
nr_init_frame_parms_ue(fp,NR_MU_1,NORMAL,fp->N_RB_DL,n_ssb_crb,k_ssb);
|
||||
phy_init_nr_top(ue);
|
||||
|
||||
// many memory allocation sizes are hard coded
|
||||
|
||||
@@ -195,10 +195,9 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||
int n_ssb_crb,
|
||||
int ssb_subcarrier_offset)
|
||||
{
|
||||
|
||||
/*n_ssb_crb and ssb_subcarrier_offset are given in 15kHz SCS*/
|
||||
nr_init_frame_parms0(fp,mu,Ncp,N_RB_DL);
|
||||
int start_rb = n_ssb_crb / (1<<mu);
|
||||
fp->ssb_start_subcarrier = 12 * start_rb + ssb_subcarrier_offset;
|
||||
fp->ssb_start_subcarrier = (12 * n_ssb_crb + ssb_subcarrier_offset)/(1<<mu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag);
|
||||
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms);
|
||||
int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char abstraction_flag);
|
||||
void nr_phy_config_request(NR_PHY_Config_t *gNB);
|
||||
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu);
|
||||
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell);
|
||||
void phy_free_nr_gNB(PHY_VARS_gNB *gNB);
|
||||
int l1_north_init_gNB(void);
|
||||
void init_nr_transport(PHY_VARS_gNB *gNB);
|
||||
|
||||
@@ -112,9 +112,8 @@ int nr_get_ssb_start_symbol(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *f
|
||||
|
||||
void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp)
|
||||
{
|
||||
int start_rb = cfg->sch_config.n_ssb_crb.value / (1<<cfg->subframe_config.numerology_index_mu.value);
|
||||
fp->ssb_start_subcarrier = 12 * start_rb + cfg->sch_config.ssb_subcarrier_offset.value;
|
||||
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,start_rb,cfg->sch_config.ssb_subcarrier_offset.value);
|
||||
fp->ssb_start_subcarrier = (12 * cfg->sch_config.n_ssb_crb.value + cfg->sch_config.ssb_subcarrier_offset.value)/(1<<cfg->subframe_config.numerology_index_mu.value);
|
||||
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->sch_config.n_ssb_crb.value,cfg->sch_config.ssb_subcarrier_offset.value);
|
||||
}
|
||||
|
||||
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
|
||||
|
||||
@@ -381,7 +381,7 @@ int main(int argc, char **argv) {
|
||||
frame_parms->nb_antennas_rx = n_rx;
|
||||
frame_parms->N_RB_DL = N_RB_DL;
|
||||
crcTableInit();
|
||||
nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_DL, mu);
|
||||
nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_DL, mu, Nid_cell);
|
||||
phy_init_nr_gNB(gNB, 0, 0);
|
||||
//init_eNB_afterRU();
|
||||
frame_length_complex_samples = frame_parms->samples_per_subframe;
|
||||
|
||||
@@ -357,7 +357,7 @@ int main(int argc, char **argv)
|
||||
frame_parms->N_RB_DL = N_RB_DL;
|
||||
frame_parms->N_RB_UL = N_RB_DL;
|
||||
|
||||
nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu);
|
||||
nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,Nid_cell);
|
||||
phy_init_nr_gNB(gNB,0,0);
|
||||
|
||||
double fs,bw;
|
||||
@@ -476,7 +476,7 @@ int main(int argc, char **argv)
|
||||
frame_length_complex_samples,
|
||||
input_fd) != frame_length_complex_samples) {
|
||||
printf("error reading from file\n");
|
||||
exit(-1);
|
||||
//exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user