Commit bd88e8b4 authored by WEI-TAI CHEN's avatar WEI-TAI CHEN

Amend L1 instant to nr

parent 84f238fd
......@@ -43,21 +43,21 @@ int l1_north_init_gNB() {
int i,j;
if (RC.nb_L1_inst > 0 && RC.nb_L1_CC != NULL && RC.gNB != NULL)
if (RC.nb_nr_L1_inst > 0 && RC.nb_nr_L1_CC != NULL && RC.gNB != NULL)
{
AssertFatal(RC.nb_L1_inst>0,"nb_L1_inst=%d\n",RC.nb_L1_inst);
AssertFatal(RC.nb_L1_CC!=NULL,"nb_L1_CC is null\n");
AssertFatal(RC.nb_nr_L1_inst>0,"nb_L1_inst=%d\n",RC.nb_nr_L1_inst);
AssertFatal(RC.nb_nr_L1_CC!=NULL,"nb_L1_CC is null\n");
AssertFatal(RC.gNB!=NULL,"RC.gNB is null\n");
LOG_I(PHY,"%s() RC.nb_L1_inst:%d\n", __FUNCTION__, RC.nb_L1_inst);
LOG_I(PHY,"%s() RC.nb_nr_L1_inst:%d\n", __FUNCTION__, RC.nb_nr_L1_inst);
for (i=0;i<RC.nb_L1_inst;i++) {
for (i=0;i<RC.nb_nr_L1_inst;i++) {
AssertFatal(RC.gNB[i]!=NULL,"RC.gNB[%d] is null\n",i);
AssertFatal(RC.nb_L1_CC[i]>0,"RC.nb_L1_CC[%d]=%d\n",i,RC.nb_L1_CC[i]);
AssertFatal(RC.nb_nr_L1_CC[i]>0,"RC.nb_nr_L1_CC[%d]=%d\n",i,RC.nb_nr_L1_CC[i]);
LOG_I(PHY,"%s() RC.nb_L1_CC[%d]:%d\n", __FUNCTION__, i, RC.nb_L1_CC[i]);
LOG_I(PHY,"%s() RC.nb_nr_L1_CC[%d]:%d\n", __FUNCTION__, i, RC.nb_nr_L1_CC[i]);
for (j=0;j<RC.nb_L1_CC[i];j++) {
for (j=0;j<RC.nb_nr_L1_CC[i];j++) {
AssertFatal(RC.gNB[i][j]!=NULL,"RC.gNB[%d][%d] is null\n",i,j);
if ((RC.gNB[i][j]->if_inst = NR_IF_Module_init(i))<0) return(-1);
......@@ -71,7 +71,7 @@ int l1_north_init_gNB() {
}
else
{
LOG_I(PHY,"%s() Not installing PHY callbacks - RC.nb_L1_inst:%d RC.nb_L1_CC:%p RC.gNB:%p\n", __FUNCTION__, RC.nb_L1_inst, RC.nb_L1_CC, RC.gNB);
LOG_I(PHY,"%s() Not installing PHY callbacks - RC.nb_nr_L1_inst:%d RC.nb_nr_L1_CC:%p RC.gNB:%p\n", __FUNCTION__, RC.nb_nr_L1_inst, RC.nb_nr_L1_CC, RC.gNB);
}
return(0);
}
......
......@@ -100,12 +100,12 @@ int nr_phy_init_RU(RU_t *ru) {
LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,ru->prach_rxsigF[i]);
}
AssertFatal(RC.nb_L1_inst <= NUMBER_OF_eNB_MAX,"gNB instances %d > %d\n",
RC.nb_L1_inst,NUMBER_OF_eNB_MAX);
AssertFatal(RC.nb_nr_L1_inst <= NUMBER_OF_eNB_MAX,"gNB instances %d > %d\n",
RC.nb_nr_L1_inst,NUMBER_OF_gNB_MAX);
LOG_E(PHY,"[INIT] %s() RC.nb_L1_inst:%d \n", __FUNCTION__, RC.nb_L1_inst);
LOG_E(PHY,"[INIT] %s() RC.nb_nr_L1_inst:%d \n", __FUNCTION__, RC.nb_nr_L1_inst);
for (i=0; i<RC.nb_L1_inst; i++) {
for (i=0; i<RC.nb_nr_L1_inst; i++) {
for (p=0;p<15;p++) {
LOG_D(PHY,"[INIT] %s() nb_antenna_ports_eNB:%d \n", __FUNCTION__, ru->gNB_list[i]->gNB_config.rf_config.tx_antenna_ports.value);
if (p<ru->gNB_list[i]->gNB_config.rf_config.tx_antenna_ports.value || p==5) {
......@@ -178,7 +178,7 @@ void nr_phy_free_RU(RU_t *ru)
free_and_zero(ru->prach_rxsigF);
/* ru->prach_rxsigF_br is not allocated -> don't free */
for (i = 0; i < RC.nb_L1_inst; i++) {
for (i = 0; i < RC.nb_nr_L1_inst; i++) {
for (p = 0; p < 15; p++) {
if (p < ru->gNB_list[i]->gNB_config.rf_config.tx_antenna_ports.value || p == 5) {
for (j=0; j<ru->nb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]);
......
......@@ -30,7 +30,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
NR_DL_FRAME_PARMS *frame_parms)
{
int N_RB = config->rf_config.dl_carrierBandwidth.value;
int N_RB = config->rf_config.dl_channel_bandwidth.value;
int Ncp = config->subframe_config.dl_prefix_type.value;
int mu = config->subframe_config.numerology_index_mu.value;
......
......@@ -143,9 +143,9 @@ void *gNB_app_task(void *args_p)
RCconfig_nr_macrlc();
LOG_I(PHY, "%s() RC.nb_L1_inst:%d\n", __FUNCTION__, RC.nb_L1_inst);
LOG_I(PHY, "%s() RC.nb_nr_L1_inst:%d\n", __FUNCTION__, RC.nb_nr_L1_inst);
if (RC.nb_L1_inst>0) AssertFatal(l1_north_init_gNB()==0,"could not initialize L1 north interface\n");
if (RC.nb_nr_L1_inst>0) AssertFatal(l1_north_init_gNB()==0,"could not initialize L1 north interface\n");
AssertFatal (gnb_nb <= RC.nb_nr_inst,
"Number of gNB is greater than gNB defined in configuration file (%d/%d)!",
......
......@@ -907,7 +907,7 @@ void init_gNB(int single_thread_flag,int wait_for_sync) {
int inst;
PHY_VARS_gNB *gNB;
LOG_I(PHY,"[nr-softmodem.c] gNB structure about to allocated RC.nb_L1_inst:%d RC.nb_L1_CC[0]:%d\n",RC.nb_L1_inst,RC.nb_L1_CC[0]);
LOG_I(PHY,"[nr-softmodem.c] gNB structure about to allocated RC.nb_nr_L1_inst:%d RC.nb_L1_CC[0]:%d\n",RC.nb_nr_L1_inst,RC.nb_L1_CC[0]);
if (RC.gNB == NULL) RC.gNB = (PHY_VARS_gNB***) malloc(RC.nb_nr_L1_inst*sizeof(PHY_VARS_gNB **));
LOG_I(PHY,"[lte-softmodem.c] gNB structure RC.gNB allocated\n");
......
......@@ -2119,11 +2119,11 @@ void init_RU(char *rf_config_file) {
// read in configuration file)
printf("configuring RU from file\n");
RCconfig_RU();
LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_L1_inst,RC.nb_RU,get_nprocs());
LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_nr_L1_inst,RC.nb_RU,get_nprocs());
if (RC.nb_CC != 0)
for (i=0;i<RC.nb_L1_inst;i++)
for (CC_id=0;CC_id<RC.nb_CC[i];CC_id++) RC.gNB[i][CC_id]->num_RU=0;
if (RC.nb_nr_CC != 0)
for (i=0;i<RC.nb_nr_L1_inst;i++)
for (CC_id=0;CC_id<RC.nb_nr_CC[i];CC_id++) RC.gNB[i][CC_id]->num_RU=0;
LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU);
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
......@@ -2236,7 +2236,7 @@ void RCconfig_RU(void) {
printf("Creating RC.ru[%d]:%p\n", j, RC.ru[j]);
RC.ru[j]->if_timing = synch_to_ext_device;
if (RC.nb_L1_inst >0)
if (RC.nb_nr_L1_inst >0)
RC.ru[j]->num_gNB = RUParamList.paramarray[j][RU_ENB_LIST_IDX].numelt;
else
RC.ru[j]->num_gNB = 0;
......
......@@ -731,14 +731,14 @@ void wait_gNBs(void) {
while (waiting==1) {
printf("Waiting for gNB L1 instances to all get configured ... sleeping 50ms (nb_L1_inst %d)\n",RC.nb_L1_inst);
printf("Waiting for gNB L1 instances to all get configured ... sleeping 50ms (nb_nr_sL1_inst %d)\n",RC.nb_nr_L1_inst);
usleep(50*1000);
waiting=0;
for (i=0;i<RC.nb_L1_inst;i++) {
for (i=0;i<RC.nb_nr_L1_inst;i++) {
printf("RC.nb_L1_CC[%d]:%d\n", i, RC.nb_L1_CC[i]);
printf("RC.nb_nr_L1_CC[%d]:%d\n", i, RC.nb_L1_CC[i]);
for (j=0;j<RC.nb_L1_CC[i];j++) {
for (j=0;j<RC.nb_nr_L1_CC[i];j++) {
if (RC.gNB[i][j]->configured==0) {
waiting=1;
break;
......@@ -1062,7 +1062,7 @@ int main( int argc, char **argv )
/* Start the agent. If it is turned off in the configuration, it won't start */
RCconfig_nr_flexran();
for (i = 0; i < RC.nb_L1_inst; i++) {
for (i = 0; i < RC.nb_nr_L1_inst; i++) {
flexran_agent_start(i);
}
......@@ -1151,7 +1151,7 @@ int main( int argc, char **argv )
number_of_cards = 1;
printf("RC.nb_nr_L1_inst:%d\n", RC.nb_nr_L1_inst);
if (RC.nb_L1_inst > 0) {
if (RC.nb_nr_L1_inst > 0) {
printf("Initializing gNB threads single_thread_flag:%d wait_for_sync:%d\n", single_thread_flag,wait_for_sync);
init_gNB(single_thread_flag,wait_for_sync);
}
......
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