Commit 18d57dbb authored by khalidhamdy's avatar khalidhamdy

Merge branch 'RU-RAU-split' of...

Merge branch 'RU-RAU-split' of https://gitlab.eurecom.fr/raymond.knopp/openairinterface5g into RU-RAU-split
parents 3c2ee627 a8e8f14f
...@@ -1153,10 +1153,10 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -1153,10 +1153,10 @@ void rx_prach0(PHY_VARS_eNB *eNB,
#ifdef Rel14 #ifdef Rel14
int prach_ifft_cnt=0; int prach_ifft_cnt=0;
#endif #endif
//#ifdef PRACH_DEBUG #ifdef PRACH_DEBUG
int en,en0=0; int en0=0;
//#endif #endif
int en;
if (ru) { if (ru) {
fp = &ru->frame_parms; fp = &ru->frame_parms;
nb_rx = ru->nb_rx; nb_rx = ru->nb_rx;
...@@ -1209,12 +1209,14 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -1209,12 +1209,14 @@ void rx_prach0(PHY_VARS_eNB *eNB,
subframe = eNB->proc.subframe_prach_br; subframe = eNB->proc.subframe_prach_br;
prachF = eNB->prach_vars_br.prachF; prachF = eNB->prach_vars_br.prachF;
rxsigF = eNB->prach_vars_br.rxsigF; rxsigF = eNB->prach_vars_br.rxsigF;
#ifdef PRACH_DEBUG
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n", if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n",
br_flag,ce_level,frame,subframe, br_flag,ce_level,frame,subframe,
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level], fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],
prach_ConfigIndex,rootSequenceIndex, prach_ConfigIndex,rootSequenceIndex,
eNB->prach_vars_br.repetition_number[ce_level], eNB->prach_vars_br.repetition_number[ce_level],
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]); fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]);
#endif
} }
else else
#endif #endif
...@@ -1224,8 +1226,10 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -1224,8 +1226,10 @@ void rx_prach0(PHY_VARS_eNB *eNB,
subframe = eNB->proc.subframe_prach; subframe = eNB->proc.subframe_prach;
prachF = eNB->prach_vars.prachF; prachF = eNB->prach_vars.prachF;
rxsigF = eNB->prach_vars.rxsigF; rxsigF = eNB->prach_vars.rxsigF;
#ifdef PRACH_DEBUG
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n",
subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex); subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex);
#endif
} }
} }
else { else {
...@@ -1233,17 +1237,20 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -1233,17 +1237,20 @@ void rx_prach0(PHY_VARS_eNB *eNB,
if (br_flag == 1) { if (br_flag == 1) {
subframe = ru->proc.subframe_prach_br; subframe = ru->proc.subframe_prach_br;
rxsigF = ru->prach_rxsigF_br[ce_level]; rxsigF = ru->prach_rxsigF_br[ce_level];
#ifdef PRACH_DEBUG
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
br_flag,ce_level,frame,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex); br_flag,ce_level,frame,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex);
#endif
} }
else else
#endif #endif
{ {
subframe = ru->proc.subframe_prach; subframe = ru->proc.subframe_prach;
rxsigF = ru->prach_rxsigF; rxsigF = ru->prach_rxsigF;
#ifdef PRACH_DEBUG
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex); subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex);
#endif
} }
} }
...@@ -1253,9 +1260,9 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -1253,9 +1260,9 @@ void rx_prach0(PHY_VARS_eNB *eNB,
for (aa=0; aa<nb_rx; aa++) { for (aa=0; aa<nb_rx; aa++) {
if (ru->if_south == LOCAL_RF) { // set the time-domain signal if we have to use it in this node if (ru->if_south == LOCAL_RF) { // set the time-domain signal if we have to use it in this node
prach[aa] = (int16_t*)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset]; prach[aa] = (int16_t*)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset];
//#ifdef PRACH_DEBUG #ifdef PRACH_DEBUG
if ((frame&1023) < 20) LOG_I(PHY,"RU %d, br_flag %d ce_level %d frame %d subframe %d, : prach %p (energy %d)\n",ru->idx,br_flag,ce_level,frame,subframe,prach[aa],dB_fixed(en0=signal_energy(prach[aa],fp->samples_per_tti))); if ((frame&1023) < 20) LOG_I(PHY,"RU %d, br_flag %d ce_level %d frame %d subframe %d, : prach %p (energy %d)\n",ru->idx,br_flag,ce_level,frame,subframe,prach[aa],dB_fixed(en0=signal_energy(prach[aa],fp->samples_per_tti)));
//#endif #endif
} }
} }
...@@ -1465,25 +1472,13 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -1465,25 +1472,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
#endif #endif
send_IF4p5(ru, ru->proc.frame_prach, ru->proc.subframe_prach, IF4p5_PRACH); send_IF4p5(ru, ru->proc.frame_prach, ru->proc.subframe_prach, IF4p5_PRACH);
#if 0
if (dB_fixed(en0)>30) {
en = dB_fixed(signal_energy(&rxsigF[0][k],840));
// if (en>60)
printf("PRACH (if4p5), k %d, n_ra_prb %d: Frame %d, Subframe %d => %d dB\n",k,n_ra_prb,ru->proc.frame_rx,ru->proc.subframe_rx,en);
write_output("rxsigF.m","prach_rxF",rxsigF[0],12288,1,1);
exit(-1);
}
#endif
return; return;
} else if (eNB!=NULL) { } else if (eNB!=NULL) {
//#if 0
en = dB_fixed(signal_energy(&rxsigF[0][0],840)); en = dB_fixed(signal_energy(&rxsigF[0][0],840));
/*if (en>60)*/ #ifdef PRACH_DEBUG
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,eNB->proc.frame_rx,eNB->proc.subframe_rx,en); if ((en > 60)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,eNB->proc.frame_rx,eNB->proc.subframe_rx,en);
//#endif #endif
} }
...@@ -1519,8 +1514,9 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -1519,8 +1514,9 @@ void rx_prach0(PHY_VARS_eNB *eNB,
*max_preamble_energy=0; *max_preamble_energy=0;
for (preamble_index=0 ; preamble_index<64 ; preamble_index++) { for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
#ifdef PRACH_DEBUG
if (en>60) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",frame,subframe,preamble_index,br_flag); if (en>60) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",frame,subframe,preamble_index,br_flag);
#endif
if (restricted_set == 0) { if (restricted_set == 0) {
// This is the relative offset in the root sequence table (5.7.2-4 from 36.211) for the given preamble index // This is the relative offset in the root sequence table (5.7.2-4 from 36.211) for the given preamble index
preamble_offset = ((NCS==0)? preamble_index : (preamble_index/(N_ZC/NCS))); preamble_offset = ((NCS==0)? preamble_index : (preamble_index/(N_ZC/NCS)));
...@@ -1603,10 +1599,10 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -1603,10 +1599,10 @@ void rx_prach0(PHY_VARS_eNB *eNB,
} }
// Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex // Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex
//#ifdef PRACH_DEBUG #ifdef PRACH_DEBUG
if (en>60) LOG_I(PHY,"frame %d, subframe %d : preamble index %d: offset %d, preamble shift %d (br_flag %d, en %d)\n", if (en>60) LOG_I(PHY,"frame %d, subframe %d : preamble index %d: offset %d, preamble shift %d (br_flag %d, en %d)\n",
frame,subframe,preamble_index,preamble_offset,preamble_shift,br_flag,en); frame,subframe,preamble_index,preamble_offset,preamble_shift,br_flag,en);
//#endif #endif
log2_ifft_size = 10; log2_ifft_size = 10;
fft_size = 6144; fft_size = 6144;
...@@ -1667,25 +1663,6 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -1667,25 +1663,6 @@ void rx_prach0(PHY_VARS_eNB *eNB,
#endif #endif
// if (aa=1) write_output("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1); // if (aa=1) write_output("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
}// antennas_rx }// antennas_rx
#ifdef PRACH_DEBUG
if (en>40) {
k = (12*n_ra_prb) - 6*fp->N_RB_UL;
if (k<0) k+=fp->ofdm_symbol_size;
k*=12;
k+=13;
k*=2;
printf("Dumping prach, k = %d (n_ra_prb %d)\n",k,n_ra_prb);
write_output("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1);
write_output("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
write_output("Xu.m","xu",Xu,N_ZC,1,1);
write_output("prach_ifft0.m","prach_t0",prach_ifft[0][0],1024,1,1);
exit(-1);
}
#endif
} // new dft } // new dft
// check energy in nth time shift, for // check energy in nth time shift, for
...@@ -1695,26 +1672,58 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -1695,26 +1672,58 @@ void rx_prach0(PHY_VARS_eNB *eNB,
eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]))
#endif #endif
{ {
#ifdef PRACH_DEBUG
if (en>60) LOG_I(PHY,"frame %d, subframe %d: Checking for peak in time-domain (br_flag %d, en %d)\n",frame,subframe,br_flag,en); if (en>60) LOG_I(PHY,"frame %d, subframe %d: Checking for peak in time-domain (br_flag %d, en %d)\n",frame,subframe,br_flag,en);
#endif
preamble_shift2 = ((preamble_shift==0) ? 0 : ((preamble_shift<<log2_ifft_size)/N_ZC)); preamble_shift2 = ((preamble_shift==0) ? 0 : ((preamble_shift<<log2_ifft_size)/N_ZC));
for (i=0; i<NCS2; i++) { for (i=0; i<NCS2; i++) {
lev = (int32_t)prach_ifft[(preamble_shift2+i)<<1]; lev = (int32_t)prach_ifft[(preamble_shift2+i)];
levdB = dB_fixed_times10(lev); levdB = dB_fixed_times10(lev);
if (levdB>*max_preamble_energy) { if (levdB>*max_preamble_energy) {
*max_preamble_energy = levdB; *max_preamble_energy = levdB;
*max_preamble_delay = ((i*fft_size)>>log2_ifft_size)*update_TA/update_TA2; *max_preamble_delay = ((i*fft_size)>>log2_ifft_size)*update_TA/update_TA2;
*max_preamble = preamble_index; *max_preamble = preamble_index;
if (en>60) LOG_I(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d, en %d)\n",frame,subframe,*max_preamble_energy,*max_preamble_delay,*max_preamble,br_flag,en); //#ifdef PRACH_DEBUG
if ((en>60) && (br_flag==1)) LOG_I(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",frame,subframe,*max_preamble_energy,*max_preamble_delay,*max_preamble,br_flag,ce_level,levdB,lev);
//#endif
} }
} }
} }
}// preamble_index }// preamble_index
#ifdef PRACH_DEBUG
if (en>60) {
k = (12*n_ra_prb) - 6*fp->N_RB_UL;
if (k<0) k+=fp->ofdm_symbol_size;
k*=12;
k+=13;
k*=2;
if (br_flag == 0) {
/*
write_output("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1);
write_output("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
write_output("Xu.m","xu",Xu,N_ZC,1,1);
write_output("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);*/
}
else {
printf("Dumping prach (br_flag %d), k = %d (n_ra_prb %d)\n",br_flag,k,n_ra_prb);
write_output("rxsigF_br.m","prach_rxF_br",&rxsigF[0][0],12288,1,1);
write_output("prach_rxF_comp0_br.m","prach_rxF_comp0_br",prachF,1024,1,1);
write_output("Xu_br.m","xu_br",Xu,N_ZC,1,1);
write_output("prach_ifft0_br.m","prach_t0_br",prach_ifft,1024,1,1);
exit(-1);
}
}
#endif
if (eNB) stop_meas(&eNB->rx_prach); if (eNB) stop_meas(&eNB->rx_prach);
} }
......
...@@ -1018,7 +1018,15 @@ handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, ...@@ -1018,7 +1018,15 @@ handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
nfapi_ul_config_request_pdu_t *ul_config_pdu) { nfapi_ul_config_request_pdu_t *ul_config_pdu) {
nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8; nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8;
uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT;
uint16_t RIV_max;
uint16_t use_srs=0;
int8_t UE_id; int8_t UE_id;
LTE_eNB_ULSCH_t *ulsch;
LTE_UL_eNB_HARQ_t *ulsch_harq;
// check if we have received a dci for this ue and ulsch descriptor is configured // check if we have received a dci for this ue and ulsch descriptor is configured
if (ul_config_pdu == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { if (ul_config_pdu == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) {
...@@ -1026,6 +1034,80 @@ handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, ...@@ -1026,6 +1034,80 @@ handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
"No existing UE ULSCH for rnti %x\n",rel8->rnti); "No existing UE ULSCH for rnti %x\n",rel8->rnti);
AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0, AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0,
"ulsch for UE_id %d is not active\n",UE_id); "ulsch for UE_id %d is not active\n",UE_id);
LOG_I(PHY,"Applying UL config for UE %d, rnti %x\n",
UE_id,rel8->rnti);
/*
#ifdef Rel14
nfapi_ul_config_ulsch_pdu_rel13_t *rel13 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13;
int harq_pid = rel8->harq_process_number;
if (rel13->ue_type > 0) { // This is a BL/CE UE, retrieve PUSCH programming
ulsch = eNB->ulsch[UE_id];
ulsch_harq = ulsch->harq_processes[harq_pid];
switch (eNB->frame_parms.N_RB_DL) {
case 6:
RIV2nb_rb_LUT = &RIV2nb_rb_LUT6[0];
RIV2first_rb_LUT = &RIV2first_rb_LUT6[0];
RIV_max = RIV_max6;
break;
case 25:
RIV2nb_rb_LUT = &RIV2nb_rb_LUT25[0];
RIV2first_rb_LUT = &RIV2first_rb_LUT25[0];
RIV_max = RIV_max25;
break;
case 50:
RIV2nb_rb_LUT = &RIV2nb_rb_LUT50[0];
RIV2first_rb_LUT = &RIV2first_rb_LUT50[0];
RIV_max = RIV_max50;
break;
case 100:
RIV2nb_rb_LUT = &RIV2nb_rb_LUT100[0];
RIV2first_rb_LUT = &RIV2first_rb_LUT100[0];
RIV_max = RIV_max100;
break;
default:
DevParam(frame_parms->N_RB_DL, harq_pid, 0);
break;
}
ulsch_harq->first_rb = rel8->resource_block_start;
ulsch_harq->nb_rb = rel8->number_of_resource_blocks;
ulsch_harq->O_RI = 0;//1;
ulsch_harq->Or2 = 0;
ulsch_harq->Or1 = 0;
ulsch_harq->O_ACK = 0;//2;
ulsch->beta_offset_cqi_times8 = 18;
ulsch->beta_offset_ri_times8 = 10;
ulsch->beta_offset_harqack_times8 = 16;
ulsch->rnti = rel8->rnti;
ulsch->harq_mask = 1<<harq_pid;
if (ulsch_harq->round == 0) {
ulsch_harq->status = ACTIVE;
ulsch_harq->rvidx = 0;
//ulsch_harq->TBS = dlsch_tbs25[ulsch_harq->mcs][ulsch_harq->nb_rb-1];
ulsch_harq->TBS = TBStable[get_I_TBS_UL(ulsch_harq->mcs)][ulsch_harq->nb_rb-1];
ulsch_harq->Msc_initial = 12*ulsch_harq->nb_rb;
ulsch_harq->Nsymb_initial = 9;
ulsch_harq->round = 0;
} else {
ulsch_harq->rvidx = 0;
ulsch_harq->round++;
}
use_srs = is_srs_occasion_common(frame_parms,ulsch_harq->frame,ulsch_harq->subframe);
ulsch_harq->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1);
ulsch_harq->srs_active = use_srs;
}
#endif
*/
} }
else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) {
AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST))>=0, AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST))>=0,
...@@ -1151,7 +1233,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { ...@@ -1151,7 +1233,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1, dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1,
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data);
if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu
LOG_I(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n");
generate_eNB_ulsch_params_from_rar(eNB, generate_eNB_ulsch_params_from_rar(eNB,
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data, TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data,
frame, frame,
...@@ -1197,7 +1279,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { ...@@ -1197,7 +1279,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
for (i=0;i<number_ul_pdu;i++) { for (i=0;i<number_ul_pdu;i++) {
ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i]; ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i];
LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); LOG_I(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type);
AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE || AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE, ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE,
"Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type); "Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type);
...@@ -1889,10 +1971,16 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -1889,10 +1971,16 @@ void prach_procedures(PHY_VARS_eNB *eNB,
if (br_flag==1) { if (br_flag==1) {
subframe = eNB->proc.subframe_prach_br; subframe = eNB->proc.subframe_prach_br;
frame = eNB->proc.frame_prach_br; frame = eNB->proc.frame_prach_br;
pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.rach_ind_br.number_of_preambles=0;
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
} }
else else
#endif #endif
{ {
pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.rach_ind.number_of_preambles=0;
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
subframe = eNB->proc.subframe_prach; subframe = eNB->proc.subframe_prach;
frame = eNB->proc.frame_prach; frame = eNB->proc.frame_prach;
} }
...@@ -1905,6 +1993,8 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -1905,6 +1993,8 @@ void prach_procedures(PHY_VARS_eNB *eNB,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1);
for (i=0;i<eNB->num_RU;i++) { for (i=0;i<eNB->num_RU;i++) {
ru=eNB->RU_list[i]; ru=eNB->RU_list[i];
for (ru_aa=0,aa=0;ru_aa<ru->nb_rx;ru_aa++,aa++) { for (ru_aa=0,aa=0;ru_aa<ru->nb_rx;ru_aa++,aa++) {
...@@ -1918,8 +2008,6 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -1918,8 +2008,6 @@ void prach_procedures(PHY_VARS_eNB *eNB,
} }
} }
if ((frame&1023) < 20) LOG_I(PHY,"Frame %d, subframe %d: Running rx_prach (br_flag %d)\n",
frame,subframe,br_flag);
rx_prach(eNB, rx_prach(eNB,
eNB->RU_list[0], eNB->RU_list[0],
&max_preamble[0], &max_preamble[0],
...@@ -1932,13 +2020,13 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -1932,13 +2020,13 @@ void prach_procedures(PHY_VARS_eNB *eNB,
#endif #endif
); );
//#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d\n", LOG_I(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d\n",
frame,subframe, frame,subframe,
max_preamble[0], max_preamble[0],
max_preamble_energy[0], max_preamble_energy[0]/10,
max_preamble_delay[0]); max_preamble_delay[0]);
//#endif #endif
#ifdef Rel14 #ifdef Rel14
if (br_flag==1) { if (br_flag==1) {
...@@ -1949,12 +2037,18 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -1949,12 +2037,18 @@ void prach_procedures(PHY_VARS_eNB *eNB,
prach_mask = is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br); prach_mask = is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br);
eNB->UL_INFO.rach_ind_br.preamble_list = eNB->preamble_list_br; eNB->UL_INFO.rach_ind_br.preamble_list = eNB->preamble_list_br;
int ind=0;
int ce_level=0;
/* Save for later, it doesn't work
for (int ind=0,ce_level=0;ce_level<4;ce_level++) { for (int ind=0,ce_level=0;ce_level<4;ce_level++) {
if ((prach_mask&(1<<(1+ce_level)) > 0) && // prach is active and CE level has finished its repetitions
if ((eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[ce_level]==1)&&
(prach_mask&(1<<(1+ce_level)) > 0) && // prach is active and CE level has finished its repetitions
(eNB->prach_vars_br.repetition_number[ce_level]== (eNB->prach_vars_br.repetition_number[ce_level]==
eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) { eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) {
if (max_preamble_energy[ind] > 580) { */
if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0]==1){
if (max_preamble_energy[0] > 350) {
eNB->UL_INFO.rach_ind_br.number_of_preambles++; eNB->UL_INFO.rach_ind_br.number_of_preambles++;
eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind];// eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind];//
...@@ -1963,16 +2057,26 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -1963,16 +2057,26 @@ void prach_procedures(PHY_VARS_eNB *eNB,
eNB->preamble_list_br[ind].preamble_rel8.rnti = 1+subframe+(eNB->prach_vars_br.first_frame[ce_level]%40); eNB->preamble_list_br[ind].preamble_rel8.rnti = 1+subframe+(eNB->prach_vars_br.first_frame[ce_level]%40);
eNB->preamble_list_br[ind].instance_length = 0; //don't know exactly what this is eNB->preamble_list_br[ind].instance_length = 0; //don't know exactly what this is
eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type = 1+ce_level; // CE Level eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type = 1+ce_level; // CE Level
LOG_I(PHY,"Filling NFAPI indication for RACH %d CELevel %d (mask %x) : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n",
ind,
ce_level,
prach_mask,
eNB->preamble_list_br[ind].preamble_rel8.timing_advance,
eNB->preamble_list_br[ind].preamble_rel8.preamble,
eNB->preamble_list_br[ind].preamble_rel8.rnti,
eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type);
} }
/*
ind++; ind++;
} }
} // ce_level } */// ce_level
}
} }
else else
#endif #endif
{ {
if (max_preamble_energy[0] > 580) { if (max_preamble_energy[0] > 10000) {
LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n", LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
eNB->Mod_id, eNB->Mod_id,
...@@ -2003,9 +2107,14 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -2003,9 +2107,14 @@ void prach_procedures(PHY_VARS_eNB *eNB,
eNB->preamble_list[0].preamble_rel13.rach_resource_type = 0; eNB->preamble_list[0].preamble_rel13.rach_resource_type = 0;
eNB->preamble_list[0].instance_length = 0; //don't know exactly what this is eNB->preamble_list[0].instance_length = 0; //don't know exactly what this is
LOG_I(PHY,"Filling NFAPI indication for RACH : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n",
eNB->preamble_list[0].preamble_rel8.timing_advance,
eNB->preamble_list[0].preamble_rel8.preamble,
eNB->preamble_list[0].preamble_rel8.rnti,
eNB->preamble_list[0].preamble_rel13.rach_resource_type);
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
} }
} // max_preamble_energy > 580 } // max_preamble_energy > 350
} // else br_flag } // else br_flag
/* /*
mac_xface->initiate_ra_proc(eNB->Mod_id, mac_xface->initiate_ra_proc(eNB->Mod_id,
...@@ -2494,7 +2603,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const ...@@ -2494,7 +2603,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe); LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe);
#endif #endif
eNB->rb_mask_ul[0]=0; eNB->rb_mask_ul[0]=0;
eNB->rb_mask_ul[1]=0; eNB->rb_mask_ul[1]=0;
eNB->rb_mask_ul[2]=0; eNB->rb_mask_ul[2]=0;
......
...@@ -284,6 +284,14 @@ typedef struct RrcConfigurationReq_s { ...@@ -284,6 +284,14 @@ typedef struct RrcConfigurationReq_s {
long *sib2_mpdcch_pdsch_hoppingOffset_r13 [MAX_NUM_CCs]; long *sib2_mpdcch_pdsch_hoppingOffset_r13 [MAX_NUM_CCs];
long *pdsch_maxNumRepetitionCEmodeA_r13 [MAX_NUM_CCs];
long *pdsch_maxNumRepetitionCEmodeB_r13 [MAX_NUM_CCs];
long *pusch_maxNumRepetitionCEmodeA_r13 [MAX_NUM_CCs];
long *pusch_maxNumRepetitionCEmodeB_r13 [MAX_NUM_CCs];
long *pusch_HoppingOffset_v1310 [MAX_NUM_CCs];
#endif #endif
} RrcConfigurationReq; } RrcConfigurationReq;
......
This diff is collapsed.
...@@ -556,6 +556,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -556,6 +556,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
(int)radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx); (int)radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx);
RC.mac[Mod_idP]->common_channels[CC_idP].radioResourceConfigCommon = radioResourceConfigCommon; RC.mac[Mod_idP]->common_channels[CC_idP].radioResourceConfigCommon = radioResourceConfigCommon;
RC.mac[Mod_idP]->common_channels[CC_idP].radioResourceConfigCommon_BR = radioResourceConfigCommon_BR;
if (ul_CarrierFreq>0) RC.mac[Mod_idP]->common_channels[CC_idP].ul_CarrierFreq = ul_CarrierFreq; if (ul_CarrierFreq>0) RC.mac[Mod_idP]->common_channels[CC_idP].ul_CarrierFreq = ul_CarrierFreq;
if (ul_Bandwidth) RC.mac[Mod_idP]->common_channels[CC_idP].ul_Bandwidth = *ul_Bandwidth; if (ul_Bandwidth) RC.mac[Mod_idP]->common_channels[CC_idP].ul_Bandwidth = *ul_Bandwidth;
else RC.mac[Mod_idP]->common_channels[CC_idP].ul_Bandwidth = RC.mac[Mod_idP]->common_channels[CC_idP].mib->message.dl_Bandwidth; else RC.mac[Mod_idP]->common_channels[CC_idP].ul_Bandwidth = RC.mac[Mod_idP]->common_channels[CC_idP].mib->message.dl_Bandwidth;
......
...@@ -861,6 +861,12 @@ typedef struct { ...@@ -861,6 +861,12 @@ typedef struct {
int16_t timing_offset; int16_t timing_offset;
/// Timeout for RRC connection /// Timeout for RRC connection
int16_t RRC_timer; int16_t RRC_timer;
/// Msg3 first RB
uint8_t msg3_first_rb;
/// Msg3 number of RB
uint8_t msg3_nb_rb;
/// Msg3 MCS
uint8_t msg3_mcs;
/// Round of Msg3 HARQ /// Round of Msg3 HARQ
uint8_t msg3_round; uint8_t msg3_round;
/// TBS used for Msg4 /// TBS used for Msg4
......
...@@ -180,7 +180,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame ...@@ -180,7 +180,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame
#endif #endif
// LOG_I(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head); LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head);
start_meas(&RC.mac[module_idP]->eNB_scheduler); start_meas(&RC.mac[module_idP]->eNB_scheduler);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN);
......
This diff is collapsed.
...@@ -490,10 +490,9 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t ...@@ -490,10 +490,9 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t
struct PRACH_ConfigSIB_v1310 *ext4_prach = eNB->common_channels[CC_id].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; struct PRACH_ConfigSIB_v1310 *ext4_prach = eNB->common_channels[CC_id].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310;
EPDCCH_SetConfig_r11_t *epdcch_setconfig_r11= &eNB->UE_list.UE_template[CC_id][UE_id].physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0] ;
int T; int T;
EPDCCH_SetConfig_r11_t *epdcch_setconfig_r11;
switch (mpdcch_type) { switch (mpdcch_type) {
case TYPE0: case TYPE0:
...@@ -508,6 +507,7 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t ...@@ -508,6 +507,7 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t
case TYPE2: // RAR case TYPE2: // RAR
AssertFatal(ext4_prach->mpdcch_startSF_CSS_RA_r13!=NULL, AssertFatal(ext4_prach->mpdcch_startSF_CSS_RA_r13!=NULL,
"mpdcch_startSF_CSS_RA_r13 is null\n"); "mpdcch_startSF_CSS_RA_r13 is null\n");
AssertFatal(rmax>0,"rmax is 0!\b");
if (eNB->common_channels[CC_id].tdd_Config==NULL) //FDD if (eNB->common_channels[CC_id].tdd_Config==NULL) //FDD
T = rmax*startSF_fdd_RA_times2[ext4_prach->mpdcch_startSF_CSS_RA_r13->choice.fdd_r13]>>1; T = rmax*startSF_fdd_RA_times2[ext4_prach->mpdcch_startSF_CSS_RA_r13->choice.fdd_r13]>>1;
else //TDD else //TDD
...@@ -517,6 +517,9 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t ...@@ -517,6 +517,9 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t
AssertFatal(1==0,"MPDCCH Type 2A not handled yet\n"); AssertFatal(1==0,"MPDCCH Type 2A not handled yet\n");
break; break;
case TYPEUESPEC: case TYPEUESPEC:
epdcch_setconfig_r11= &eNB->UE_list.UE_template[CC_id][UE_id].physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0] ;
AssertFatal(epdcch_setconfig_r11 != NULL," epdcch_setconfig_r11 is null for UE specific \n"); AssertFatal(epdcch_setconfig_r11 != NULL," epdcch_setconfig_r11 is null for UE specific \n");
AssertFatal(epdcch_setconfig_r11->ext2 != NULL," ext2 doesn't exist in epdcch config ' \n"); AssertFatal(epdcch_setconfig_r11->ext2 != NULL," ext2 doesn't exist in epdcch config ' \n");
...@@ -530,6 +533,7 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t ...@@ -530,6 +533,7 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t
return(0); return(0);
} }
AssertFatal(T>0,"T is 0!\n");
if (((10*frameP) + subframeP)%T == 0) return(1); if (((10*frameP) + subframeP)%T == 0) return(1);
else return(0); else return(0);
......
...@@ -163,10 +163,10 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, ...@@ -163,10 +163,10 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
int N_NB_index; int N_NB_index;
AssertFatal(1==0,"RAR for BL/CE Still to be finished ...\n");
// Copy the Msg2 narrowband // Copy the Msg2 narrowband
RA_template->msg34_narrowband = RA_template->msg2_narrowband; RA_template->msg34_narrowband = RA_template->msg2_narrowband;
RA_template->msg3_first_rb = ce_level;
RA_template->msg3_nb_rb = 2;
if (ce_level<2) { //CE Level 0,1, CEmodeA if (ce_level<2) { //CE Level 0,1, CEmodeA
input_buffer_length =6; input_buffer_length =6;
...@@ -183,7 +183,7 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, ...@@ -183,7 +183,7 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
ULdelay = 0; ULdelay = 0;
cqireq = 0; cqireq = 0;
mpdcch_nb_index = 0; mpdcch_nb_index = 0;
rballoc = mac_computeRIV(6,1+ce_level,1); // one PRB only for UL Grant in position 1+ce_level within Narrowband rballoc = mac_computeRIV(6,RA_template->msg3_first_rb,RA_template->msg3_nb_rb); // one PRB only for UL Grant in position 1+ce_level within Narrowband
unsigned int buffer = 0; unsigned int buffer = 0;
buffer |= N_NB_index << (16 + (4 - N_NB_index)); buffer |= N_NB_index << (16 + (4 - N_NB_index));
buffer |= ((rballoc & 0xFF) << (12 + (4 - N_NB_index))); buffer |= ((rballoc & 0xFF) << (12 + (4 - N_NB_index)));
...@@ -204,8 +204,8 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, ...@@ -204,8 +204,8 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
rar[3] = (uint8_t)(RA_template->rnti>>8); rar[3] = (uint8_t)(RA_template->rnti>>8);
rar[4] = (uint8_t)(RA_template->rnti&0xff); rar[4] = (uint8_t)(RA_template->rnti&0xff);
} }
LOG_D(MAC,"[RAPROC] Frame %d Generating RAR BR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ce_level %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n", LOG_I(MAC,"[RAPROC] Frame %d Subframe %d : Generating RAR BR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ce_level %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n",
frameP, frameP,subframeP,
*(uint8_t*)rarh,rar[0],rar[1],rar[2],rar[3],rar[4],rar[5], *(uint8_t*)rarh,rar[0],rar[1],rar[2],rar[3],rar[4],rar[5],
ce_level, ce_level,
RA_template->rnti, RA_template->rnti,
......
...@@ -40,6 +40,7 @@ void handle_rach(UL_IND_t *UL_info) { ...@@ -40,6 +40,7 @@ void handle_rach(UL_IND_t *UL_info) {
"Got regular PRACH preamble, not BL/CE\n"); "Got regular PRACH preamble, not BL/CE\n");
LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc (CE_level %d)\n",UL_info->frame,UL_info->subframe, LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc (CE_level %d)\n",UL_info->frame,UL_info->subframe,
UL_info->rach_ind_br.preamble_list[i].preamble_rel13.rach_resource_type-1); UL_info->rach_ind_br.preamble_list[i].preamble_rel13.rach_resource_type-1);
UL_info->rach_ind_br.number_of_preambles=0;
initiate_ra_proc(UL_info->module_id, initiate_ra_proc(UL_info->module_id,
UL_info->CC_id, UL_info->CC_id,
UL_info->frame, UL_info->frame,
......
This diff is collapsed.
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