Commit 63dda4aa authored by wujing's avatar wujing

cut down the usage of memory when using rcc and rru

parent 6e0c30af
...@@ -45,6 +45,7 @@ uint8_t dmrs1_tab[8] = {0,2,3,4,6,8,9,10}; ...@@ -45,6 +45,7 @@ uint8_t dmrs1_tab[8] = {0,2,3,4,6,8,9,10};
int N_RB_DL_array[6] = {6,15,25,50,75,100}; int N_RB_DL_array[6] = {6,15,25,50,75,100};
extern uint8_t nfapi_mode;
int l1_north_init_eNB() { int l1_north_init_eNB() {
int i,j; int i,j;
...@@ -776,7 +777,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -776,7 +777,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
if(nfapi_mode !=2){
common_vars->rxdata = (int32_t **)NULL; common_vars->rxdata = (int32_t **)NULL;
common_vars->txdataF = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t*)); common_vars->txdataF = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t*));
common_vars->rxdataF = (int32_t **)malloc16(64*sizeof(int32_t*)); common_vars->rxdataF = (int32_t **)malloc16(64*sizeof(int32_t*));
...@@ -878,7 +879,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -878,7 +879,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++)
eNB->UE_stats_ptr[UE_id] = &eNB->UE_stats[UE_id]; eNB->UE_stats_ptr[UE_id] = &eNB->UE_stats[UE_id];
}
eNB->pdsch_config_dedicated->p_a = dB0; //defaul value until overwritten by RRCConnectionReconfiguration eNB->pdsch_config_dedicated->p_a = dB0; //defaul value until overwritten by RRCConnectionReconfiguration
......
...@@ -724,7 +724,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -724,7 +724,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe); harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe);
// clear DCI allocation maps for new subframe // clear DCI allocation maps for new subframe
if(nfapi_mode !=2)
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
if (eNB->ulsch[i]) { if (eNB->ulsch[i]) {
ulsch_harq = eNB->ulsch[i]->harq_processes[harq_pid]; ulsch_harq = eNB->ulsch[i]->harq_processes[harq_pid];
...@@ -738,8 +738,10 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -738,8 +738,10 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
//LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type); //LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
switch (dl_config_pdu->pdu_type) { switch (dl_config_pdu->pdu_type) {
case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE:
if(nfapi_mode !=2)
handle_nfapi_dci_dl_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu); handle_nfapi_dci_dl_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu);
eNB->pdcch_vars[NFAPI_SFNSF2SF(DL_req->sfn_sf)&1].num_dci++; eNB->pdcch_vars[NFAPI_SFNSF2SF(DL_req->sfn_sf)&1].num_dci++;
//LOG_E(PHY,"Incremented num_dci:%d but already set??? dl_config:num_dci:%d\n", eNB->pdcch_vars[subframe&1].num_dci, number_dci); //LOG_E(PHY,"Incremented num_dci:%d but already set??? dl_config:num_dci:%d\n", eNB->pdcch_vars[subframe&1].num_dci, number_dci);
do_oai=1; do_oai=1;
break; break;
...@@ -753,7 +755,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -753,7 +755,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
//LOG_D(PHY,"%s() NFAPI_DL_CONFIG_BCH_PDU_TYPE TX:%d/%d RX:%d/%d TXREQ:%d/%d\n", //LOG_D(PHY,"%s() NFAPI_DL_CONFIG_BCH_PDU_TYPE TX:%d/%d RX:%d/%d TXREQ:%d/%d\n",
//__FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->frame_rx, proc->subframe_rx, NFAPI_SFNSF2SFN(TX_req->sfn_sf), NFAPI_SFNSF2SF(TX_req->sfn_sf)); //__FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->frame_rx, proc->subframe_rx, NFAPI_SFNSF2SFN(TX_req->sfn_sf), NFAPI_SFNSF2SF(TX_req->sfn_sf));
if(nfapi_mode !=2)
handle_nfapi_bch_pdu(eNB,proc,dl_config_pdu, handle_nfapi_bch_pdu(eNB,proc,dl_config_pdu,
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index].segments[0].segment_data); TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index].segments[0].segment_data);
break; break;
...@@ -787,6 +789,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -787,6 +789,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
dlsch_pdu_rel8->transport_blocks); dlsch_pdu_rel8->transport_blocks);
if (1)//sdu != NULL) if (1)//sdu != NULL)
{ {
if(nfapi_mode !=2)
handle_nfapi_dlsch_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu, dlsch_pdu_rel8->transport_blocks-1, sdu); handle_nfapi_dlsch_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu, dlsch_pdu_rel8->transport_blocks-1, sdu);
} }
else else
...@@ -826,6 +829,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -826,6 +829,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
break; break;
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE:
if(nfapi_mode !=2)
handle_nfapi_mpdcch_pdu(eNB,proc,dl_config_pdu); handle_nfapi_mpdcch_pdu(eNB,proc,dl_config_pdu);
eNB->mpdcch_vars[subframe&1].num_dci++; eNB->mpdcch_vars[subframe&1].num_dci++;
break; break;
...@@ -847,6 +851,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -847,6 +851,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_pdcch_symbols=0; eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_pdcch_symbols=0;
} }
if(nfapi_mode !=2)
for (i=0;i<number_hi_dci0_pdu;i++) { for (i=0;i<number_hi_dci0_pdu;i++) {
hi_dci0_req_pdu = &HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list[i]; hi_dci0_req_pdu = &HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list[i];
......
...@@ -286,7 +286,7 @@ void RCconfig_L1(void) { ...@@ -286,7 +286,7 @@ void RCconfig_L1(void) {
LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_inst=1 this is because phy_init_RU() uses that to index and not RC.num_eNB - why the 2 similar variables?\n", __FUNCTION__); LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_inst=1 this is because phy_init_RU() uses that to index and not RC.num_eNB - why the 2 similar variables?\n", __FUNCTION__);
LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_CC[0]=%d for init_eNB_afterRU()\n", __FUNCTION__, RC.nb_CC[0]); LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_CC[0]=%d for init_eNB_afterRU()\n", __FUNCTION__, RC.nb_CC[0]);
LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_macrlc_inst:%d because used by mac_top_init_eNB()\n", __FUNCTION__, RC.nb_macrlc_inst); LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_macrlc_inst:%d because used by mac_top_init_eNB()\n", __FUNCTION__, RC.nb_macrlc_inst);
mac_top_init_eNB(); //mac_top_init_eNB();
configure_nfapi_pnf(RC.eNB[j][0]->eth_params_n.remote_addr, RC.eNB[j][0]->eth_params_n.remote_portc, RC.eNB[j][0]->eth_params_n.my_addr, RC.eNB[j][0]->eth_params_n.my_portd, configure_nfapi_pnf(RC.eNB[j][0]->eth_params_n.remote_addr, RC.eNB[j][0]->eth_params_n.remote_portc, RC.eNB[j][0]->eth_params_n.my_addr, RC.eNB[j][0]->eth_params_n.my_portd,
RC.eNB[j][0]->eth_params_n .remote_portd); RC.eNB[j][0]->eth_params_n .remote_portd);
} else { // other midhaul } else { // other midhaul
......
...@@ -519,7 +519,10 @@ void UL_indication(UL_IND_t *UL_info) ...@@ -519,7 +519,10 @@ void UL_indication(UL_IND_t *UL_info)
int CC_id = UL_info->CC_id; int CC_id = UL_info->CC_id;
Sched_Rsp_t *sched_info = &Sched_INFO[module_id][CC_id]; Sched_Rsp_t *sched_info = &Sched_INFO[module_id][CC_id];
IF_Module_t *ifi = if_inst[module_id]; IF_Module_t *ifi = if_inst[module_id];
eNB_MAC_INST *mac = RC.mac[module_id]; eNB_MAC_INST *mac = NULL; // = RC.mac[module_id];
if (nfapi_mode != 1)
mac = RC.mac[module_id];
LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n", LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n",
UL_info->frame,UL_info->subframe, UL_info->frame,UL_info->subframe,
...@@ -545,6 +548,7 @@ void UL_indication(UL_IND_t *UL_info) ...@@ -545,6 +548,7 @@ void UL_indication(UL_IND_t *UL_info)
// clear DL/UL info for new scheduling round // clear DL/UL info for new scheduling round
if (nfapi_mode != 1)
clear_nfapi_information(RC.mac[module_id],CC_id, clear_nfapi_information(RC.mac[module_id],CC_id,
UL_info->frame,UL_info->subframe); UL_info->frame,UL_info->subframe);
...@@ -557,11 +561,13 @@ void UL_indication(UL_IND_t *UL_info) ...@@ -557,11 +561,13 @@ void UL_indication(UL_IND_t *UL_info)
handle_harq(UL_info); handle_harq(UL_info);
// clear HI prior to handling ULSCH // clear HI prior to handling ULSCH
if (nfapi_mode != 1){
uint8_t sf_ahead_dl = ul_subframe2_k_phich(&mac->common_channels[CC_id] , UL_info->subframe); uint8_t sf_ahead_dl = ul_subframe2_k_phich(&mac->common_channels[CC_id] , UL_info->subframe);
if(sf_ahead_dl!=255){ if(sf_ahead_dl!=255){
mac->HI_DCI0_req[CC_id][(UL_info->subframe+sf_ahead_dl)%10].hi_dci0_request_body.number_of_hi = 0; mac->HI_DCI0_req[CC_id][(UL_info->subframe+sf_ahead_dl)%10].hi_dci0_request_body.number_of_hi = 0;
LOG_D(MAC,"current (%d,%d) clear HI_DCI0_req[0][%d]\n",UL_info->frame,UL_info->subframe,(UL_info->subframe+sf_ahead_dl)%10); LOG_D(MAC,"current (%d,%d) clear HI_DCI0_req[0][%d]\n",UL_info->frame,UL_info->subframe,(UL_info->subframe+sf_ahead_dl)%10);
} }
}
handle_ulsch(UL_info); handle_ulsch(UL_info);
......
...@@ -416,7 +416,8 @@ static void* L1_thread( void* param ) { ...@@ -416,7 +416,8 @@ static void* L1_thread( void* param ) {
if (rxtx(eNB,proc,thread_name) < 0) break; if (rxtx(eNB,proc,thread_name) < 0) break;
} }
if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) phy_procedures_eNB_TX(eNB, proc, 1); //if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) phy_procedures_eNB_TX(eNB, proc, 1);
if((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT)&& (nfapi_mode != 2)) phy_procedures_eNB_TX(eNB, proc, 1);
if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break; if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break;
if (nfapi_mode!=2){ if (nfapi_mode!=2){
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB); if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB);
...@@ -949,10 +950,13 @@ void init_eNB_proc(int inst) { ...@@ -949,10 +950,13 @@ void init_eNB_proc(int inst) {
pthread_create( &L1_proc->pthread, attr0, L1_thread, L1_proc); pthread_create( &L1_proc->pthread, attr0, L1_thread, L1_proc);
pthread_create( &L1_proc_tx->pthread, attr1, L1_thread, L1_proc_tx); pthread_create( &L1_proc_tx->pthread, attr1, L1_thread, L1_proc_tx);
} }
if(nfapi_mode != 2){
pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, eNB ); pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, eNB );
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB ); pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB );
#endif #endif
}
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach); AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
...@@ -1114,7 +1118,7 @@ void init_transport(PHY_VARS_eNB *eNB) { ...@@ -1114,7 +1118,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
int j; int j;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
LOG_I(PHY, "Initialise transport\n"); LOG_I(PHY, "Initialise transport\n");
if(nfapi_mode !=2){
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
LOG_D(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i); LOG_D(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i);
...@@ -1157,6 +1161,7 @@ void init_transport(PHY_VARS_eNB *eNB) { ...@@ -1157,6 +1161,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
LOG_D(PHY,"eNB %d.%d : RA %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_ra); LOG_D(PHY,"eNB %d.%d : RA %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_ra);
eNB->dlsch_MCH = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL, 0, fp); eNB->dlsch_MCH = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL, 0, fp);
LOG_D(PHY,"eNB %d.%d : MCH %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_MCH); LOG_D(PHY,"eNB %d.%d : MCH %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_MCH);
}
eNB->rx_total_gain_dB=130; eNB->rx_total_gain_dB=130;
for(i=0; i<NUMBER_OF_UE_MAX; i++) for(i=0; i<NUMBER_OF_UE_MAX; i++)
......
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