very big merge with merged develop, basic test done
This commit is contained in:
+17
-53
@@ -61,7 +61,6 @@ void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,
|
||||
proc->subframe_tx, idx, pdcch_vars->num_dci);
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
|
||||
void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,
|
||||
L1_rxtx_proc_t *proc,
|
||||
@@ -77,7 +76,6 @@ void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,
|
||||
fill_mdci_and_dlsch(eNB,proc,&mpdcch_vars->mdci_alloc[mpdcch_vars->num_dci],pdu);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc,
|
||||
nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) {
|
||||
@@ -139,6 +137,14 @@ void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
|
||||
// adjust transmit amplitude here based on NFAPI info
|
||||
}
|
||||
|
||||
extern uint32_t localRIV2alloc_LUT6[32];
|
||||
extern uint32_t localRIV2alloc_LUT25[512];
|
||||
extern uint32_t localRIV2alloc_LUT50_0[1600];
|
||||
extern uint32_t localRIV2alloc_LUT50_1[1600];
|
||||
extern uint32_t localRIV2alloc_LUT100_0[6000];
|
||||
extern uint32_t localRIV2alloc_LUT100_1[6000];
|
||||
extern uint32_t localRIV2alloc_LUT100_2[6000];
|
||||
extern uint32_t localRIV2alloc_LUT100_3[6000];
|
||||
|
||||
void handle_nfapi_mch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc,
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu,
|
||||
@@ -187,28 +193,13 @@ void handle_nfapi_mch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_
|
||||
dlsch->active = 1;
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
extern uint32_t localRIV2alloc_LUT6[32];
|
||||
extern uint32_t localRIV2alloc_LUT25[512];
|
||||
extern uint32_t localRIV2alloc_LUT50_0[1600];
|
||||
extern uint32_t localRIV2alloc_LUT50_1[1600];
|
||||
extern uint32_t localRIV2alloc_LUT100_0[6000];
|
||||
extern uint32_t localRIV2alloc_LUT100_1[6000];
|
||||
extern uint32_t localRIV2alloc_LUT100_2[6000];
|
||||
extern uint32_t localRIV2alloc_LUT100_3[6000];
|
||||
#endif
|
||||
|
||||
void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc,
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu,
|
||||
uint8_t codeword_index,
|
||||
uint8_t *sdu) {
|
||||
nfapi_dl_config_dlsch_pdu_rel8_t *rel8 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
nfapi_dl_config_dlsch_pdu_rel10_t *rel10 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10;
|
||||
#endif
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
nfapi_dl_config_dlsch_pdu_rel13_t *rel13 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13;
|
||||
#endif
|
||||
LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL;
|
||||
LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL;
|
||||
int UE_id;
|
||||
@@ -227,11 +218,9 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
//AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
|
||||
dlsch0 = eNB->dlsch[UE_id][0];
|
||||
dlsch1 = eNB->dlsch[UE_id][1];
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
|
||||
|
||||
if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[proc->frame_tx%2][proc->subframe_tx] = 0;
|
||||
|
||||
#endif
|
||||
harq_pid = dlsch0->harq_ids[proc->frame_tx%2][proc->subframe_tx];
|
||||
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
|
||||
@@ -268,13 +257,13 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
|
||||
dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols;
|
||||
|
||||
if (dlsch0_harq->DLround==0) { //get pointer to SDU if this a new SDU
|
||||
if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU
|
||||
if(sdu == NULL) {
|
||||
LOG_E(PHY,
|
||||
"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d dlsch0_harq[round:%d SFN/SF:%d%d pdu:%p mcs:%d ndi:%d pdschstart:%d]\n",
|
||||
frame,subframe,
|
||||
proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid,
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index,dlsch0_harq->DLround,dlsch0_harq->frame,dlsch0_harq->subframe,dlsch0_harq->pdu,dlsch0_harq->mcs,dlsch0_harq->ndi,dlsch0_harq->pdsch_start);
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe,dlsch0_harq->pdu,dlsch0_harq->mcs,dlsch0_harq->ndi,dlsch0_harq->pdsch_start);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -289,11 +278,10 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
else dlsch1_harq->pdu = sdu;
|
||||
} else {
|
||||
if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d, subframe %d]: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n",
|
||||
frame,subframe,proc->frame_tx,proc->subframe_tx,dlsch0_harq->DLround,
|
||||
frame,subframe,proc->frame_tx,proc->subframe_tx,dlsch0_harq->round,
|
||||
rel8->rnti,UE_id,harq_pid);
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0_harq->sib1_br_flag=0;
|
||||
#else
|
||||
@@ -369,42 +357,31 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
dlsch0_harq->Nl = 1;
|
||||
dlsch0_harq->mimo_mode = (eNB->frame_parms.nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI;
|
||||
dlsch0_harq->dl_power_off = 1;
|
||||
dlsch0_harq->DLround = 0;
|
||||
dlsch0_harq->round = 0;
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
dlsch0_harq->TBS = rel8->length<<3;
|
||||
dlsch0_harq->Qm = rel8->modulation;
|
||||
dlsch0_harq->codeword = 0;
|
||||
dlsch0_harq->pdsch_start = rel10->pdsch_start;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
|
||||
AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
|
||||
dlsch0 = eNB->dlsch[UE_id][0];
|
||||
dlsch1 = eNB->dlsch[UE_id][1];
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
dlsch0->sib1_br_flag=0;
|
||||
dlsch0->i0 = 0xFFFF;
|
||||
#endif
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
LOG_D(PHY,"dlsch->i0:%04x dlsch0_harq[pdsch_start:%d nb_rb:%d vrb_type:%d rvidx:%d Nl:%d mimo_mode:%d dl_power_off:%d round:%d status:%d TBS:%d Qm:%d codeword:%d rb_alloc:%d] rel8[length:%d]\n",
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0_harq->i0,
|
||||
#else
|
||||
dlsch0->i0,
|
||||
#endif
|
||||
dlsch0_harq->pdsch_start, dlsch0_harq->nb_rb, dlsch0_harq->vrb_type, dlsch0_harq->rvidx, dlsch0_harq->Nl, dlsch0_harq->mimo_mode, dlsch0_harq->dl_power_off, dlsch0_harq->DLround, dlsch0_harq->status,
|
||||
dlsch0_harq->pdsch_start, dlsch0_harq->nb_rb, dlsch0_harq->vrb_type, dlsch0_harq->rvidx, dlsch0_harq->Nl, dlsch0_harq->mimo_mode, dlsch0_harq->dl_power_off, dlsch0_harq->round, dlsch0_harq->status,
|
||||
dlsch0_harq->TBS, dlsch0_harq->Qm, dlsch0_harq->codeword, dlsch0_harq->rb_alloc[0],
|
||||
rel8->length
|
||||
);
|
||||
#else
|
||||
LOG_D(PHY,"dlsch0_harq[pdsch_start:%d nb_rb:%d vrb_type:%d rvidx:%d Nl:%d mimo_mode:%d dl_power_off:%d round:%d status:%d TBS:%d Qm:%d codeword:%d rb_alloc:%d] rel8[length:%d]\n",
|
||||
dlsch0_harq->pdsch_start, dlsch0_harq->nb_rb, dlsch0_harq->vrb_type, dlsch0_harq->rvidx, dlsch0_harq->Nl, dlsch0_harq->mimo_mode, dlsch0_harq->dl_power_off, dlsch0_harq->DLround, dlsch0_harq->status,
|
||||
dlsch0_harq->TBS, dlsch0_harq->Qm, dlsch0_harq->codeword, dlsch0_harq->rb_alloc[0],
|
||||
rel8->length
|
||||
);
|
||||
#endif
|
||||
|
||||
dlsch0->active = 1;
|
||||
harq_pid = dlsch0->harq_ids[frame%2][proc->subframe_tx];
|
||||
dlsch0->harq_mask |= (1<<harq_pid);
|
||||
@@ -425,15 +402,12 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off);
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
|
||||
if (rel13->ue_type>0)
|
||||
dlsch0_harq->pdsch_start = rel10->pdsch_start;
|
||||
else
|
||||
#endif
|
||||
dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols;
|
||||
|
||||
if (dlsch0_harq->DLround==0) { //get pointer to SDU if this a new SDU
|
||||
if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU
|
||||
AssertFatal(sdu!=NULL,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d\n",
|
||||
proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid,
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index);
|
||||
@@ -445,7 +419,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
else dlsch1_harq->pdu = sdu;
|
||||
} else {
|
||||
if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n",
|
||||
proc->frame_tx,proc->subframe_tx,dlsch0_harq->DLround,
|
||||
proc->frame_tx,proc->subframe_tx,dlsch0_harq->round,
|
||||
rel8->rnti,UE_id,harq_pid);
|
||||
}
|
||||
}
|
||||
@@ -631,11 +605,9 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,
|
||||
uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_pdu.sr_information.sr_information_rel8.pucch_index;
|
||||
uci->srs_active = srs_active;
|
||||
uci->active = 1;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uci->ue_type = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel13.ue_type;
|
||||
uci->empty_symbols = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel13.empty_symbols;
|
||||
uci->total_repetitions = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel13.total_number_of_repetitions;
|
||||
#endif
|
||||
LOG_D(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n",
|
||||
uci->rnti,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
@@ -658,11 +630,9 @@ void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_
|
||||
uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_harq_pdu.sr_information.sr_information_rel8.pucch_index;
|
||||
uci->srs_active = srs_active;
|
||||
uci->active = 1;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uci->ue_type = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel13.ue_type;
|
||||
uci->empty_symbols = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel13.empty_symbols;
|
||||
uci->total_repetitions = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel13.total_number_of_repetitions;
|
||||
#endif
|
||||
handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_sr_harq_pdu.harq_information);
|
||||
}
|
||||
|
||||
@@ -679,11 +649,9 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu
|
||||
uci->type = HARQ;
|
||||
uci->srs_active = srs_active;
|
||||
uci->num_antenna_ports = ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel11.num_ant_ports;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uci->ue_type = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.ue_type;
|
||||
uci->empty_symbols = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.empty_symbols;
|
||||
uci->total_repetitions = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.total_number_of_repetitions;
|
||||
#endif
|
||||
handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_harq_pdu.harq_information);
|
||||
uci->active=1;
|
||||
}
|
||||
@@ -817,9 +785,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
|
||||
eNB->pdcch_vars[subframe&1].num_pdcch_symbols = number_pdcch_ofdm_symbols;
|
||||
eNB->pdcch_vars[subframe&1].num_dci = 0;
|
||||
eNB->phich_vars[subframe&1].num_hi = 0;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
eNB->mpdcch_vars[subframe&1].num_dci = 0;
|
||||
#endif
|
||||
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d\n",
|
||||
frame,subframe,
|
||||
NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),number_dl_pdu,
|
||||
@@ -974,7 +940,6 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
|
||||
case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE:
|
||||
// handle_nfapi_epdcch_pdu(eNB,dl_config_pdu);
|
||||
break;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
|
||||
case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE:
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF)
|
||||
@@ -982,7 +947,6 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
|
||||
|
||||
eNB->mpdcch_vars[subframe&1].num_dci++;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -752,9 +752,9 @@ int subframe_num(LTE_DL_FRAME_PARMS *frame_parms){
|
||||
}
|
||||
}
|
||||
|
||||
lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,unsigned char subframe)
|
||||
lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char subframe)
|
||||
{
|
||||
|
||||
// if FDD return dummy value
|
||||
if (frame_parms->frame_type == FDD)
|
||||
return(SF_DL);
|
||||
@@ -820,6 +820,7 @@ lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AssertFatal(1==0,"subframe %d Unsupported TDD configuration %d\n",subframe,frame_parms->tdd_config);
|
||||
return(255);
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "fapi_l1.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include <common/utils/system.h>
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "assertions.h"
|
||||
@@ -131,15 +132,12 @@ void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
|
||||
}
|
||||
#else
|
||||
void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
MCH_PDU *mch_pduP=NULL;
|
||||
// uint8_t sync_area=255;
|
||||
#endif
|
||||
int subframe = proc->subframe_tx;
|
||||
AssertFatal (1 == 1, "pmch not tested for the moment, exiting\n");
|
||||
// This is DL-Cell spec pilots in Control region
|
||||
generate_pilots_slot (eNB, eNB->common_vars.txdataF, AMP, subframe << 1, 1);
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
// if mcch is active, send regardless of the node type: eNB or RN
|
||||
// when mcch is active, MAC sched does not allow MCCH and MTCH multiplexing
|
||||
@@ -170,8 +168,6 @@ void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
|
||||
} else {
|
||||
LOG_D (PHY, "[eNB/RN] Frame %d subframe %d: MCH not generated \n", proc->frame_tx, subframe);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -257,8 +253,8 @@ bool dlsch_procedures(PHY_VARS_eNB *eNB,
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
|
||||
if (dlsch->rnti != 0xffff) {//frame < 200) {
|
||||
LOG_D(PHY,
|
||||
"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH (type %d) with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n",
|
||||
LOG_D(PHY,
|
||||
"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH (type %d) with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n",
|
||||
eNB->Mod_id, dlsch->rnti,harq_pid,
|
||||
frame, subframe, dlsch->ue_type,dlsch_harq->TBS/8, dlsch_harq->pdsch_start,
|
||||
get_G(fp,
|
||||
@@ -276,16 +272,16 @@ bool dlsch_procedures(PHY_VARS_eNB *eNB,
|
||||
dlsch_harq->TBS,
|
||||
pmi2hex_2Ar1(dlsch_harq->pmi_alloc),
|
||||
dlsch_harq->rvidx,
|
||||
dlsch_harq->DLround);
|
||||
dlsch_harq->round);
|
||||
}
|
||||
|
||||
if (ue_stats) ue_stats->dlsch_sliding_cnt++;
|
||||
|
||||
if (dlsch_harq->DLround == 0) {
|
||||
if (dlsch_harq->round == 0) {
|
||||
if (ue_stats)
|
||||
ue_stats->dlsch_trials[harq_pid][0]++;
|
||||
} else {
|
||||
ue_stats->dlsch_trials[harq_pid][dlsch_harq->DLround]++;
|
||||
ue_stats->dlsch_trials[harq_pid][dlsch_harq->round]++;
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
#ifdef DEBUG_DLSCH
|
||||
LOG_D (PHY, "[eNB] This DLSCH is a retransmission\n");
|
||||
@@ -295,14 +291,15 @@ bool dlsch_procedures(PHY_VARS_eNB *eNB,
|
||||
|
||||
if (dlsch->rnti!=0xffff)
|
||||
LOG_D(PHY,"Generating DLSCH/PDSCH pdu:%p pdsch_start:%d frame:%d subframe:%d nb_rb:%d rb_alloc:%d Qm:%d Nl:%d round:%d\n",
|
||||
dlsch_harq->pdu,dlsch_harq->pdsch_start,frame,subframe,dlsch_harq->nb_rb,dlsch_harq->rb_alloc[0],
|
||||
dlsch_harq->Qm,dlsch_harq->Nl,dlsch_harq->DLround);
|
||||
|
||||
dlsch_harq->pdu,dlsch_harq->pdsch_start,frame,subframe,dlsch_harq->nb_rb,dlsch_harq->rb_alloc[0],
|
||||
dlsch_harq->Qm,dlsch_harq->Nl,dlsch_harq->round);
|
||||
|
||||
// 36-212
|
||||
if (NFAPI_MODE==NFAPI_MONOLITHIC || NFAPI_MODE==NFAPI_MODE_PNF) { // monolthic OR PNF - do not need turbo encoding on VNF
|
||||
if (dlsch_harq->pdu==NULL) {
|
||||
LOG_E(PHY,"dlsch_harq->pdu == NULL SFN/SF:%04d%d dlsch[rnti:%x] dlsch_harq[pdu:%p pdsch_start:%d Qm:%d Nl:%d round:%d nb_rb:%d rb_alloc[0]:%d]\n", frame,subframe,dlsch->rnti, dlsch_harq->pdu,
|
||||
dlsch_harq->pdsch_start,dlsch_harq->Qm,dlsch_harq->Nl,dlsch_harq->DLround,dlsch_harq->nb_rb,dlsch_harq->rb_alloc[0]);
|
||||
dlsch_harq->pdsch_start,dlsch_harq->Qm,dlsch_harq->Nl,dlsch_harq->round,dlsch_harq->nb_rb,dlsch_harq->rb_alloc[0]);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -334,15 +331,17 @@ bool dlsch_procedures(PHY_VARS_eNB *eNB,
|
||||
if(eNB->dlsch_encoding_stats.p_time>500*3000 && opp_enabled == 1) {
|
||||
print_meas_now(&eNB->dlsch_encoding_stats,"total coding",stderr);
|
||||
}
|
||||
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch->active[subframe] = 0;
|
||||
#else
|
||||
dlsch->active = 0;
|
||||
#endif
|
||||
dlsch_harq->DLround++;
|
||||
LOG_D(PHY,"Generated DLSCH dlsch_harq[round:%d]\n",dlsch_harq->DLround);
|
||||
dlsch_harq->round++;
|
||||
LOG_D(PHY,"Generated DLSCH dlsch_harq[round:%d]\n",dlsch_harq->round);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -358,33 +357,32 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
|
||||
// 36-211
|
||||
start_meas(&eNB->dlsch_scrambling_stats);
|
||||
dlsch_scrambling(fp,
|
||||
0,
|
||||
dlsch,
|
||||
harq_pid,
|
||||
get_G(fp,
|
||||
dlsch_harq->nb_rb,
|
||||
dlsch_harq->rb_alloc,
|
||||
dlsch_harq->Qm,
|
||||
dlsch_harq->Nl,
|
||||
dlsch_harq->pdsch_start,
|
||||
frame,subframe,
|
||||
0),
|
||||
0,
|
||||
frame,
|
||||
subframe<<1);
|
||||
0,
|
||||
dlsch,
|
||||
harq_pid,
|
||||
get_G(fp,
|
||||
dlsch_harq->nb_rb,
|
||||
dlsch_harq->rb_alloc,
|
||||
dlsch_harq->Qm,
|
||||
dlsch_harq->Nl,
|
||||
dlsch_harq->pdsch_start,
|
||||
frame,subframe,
|
||||
0),
|
||||
0,
|
||||
frame,
|
||||
subframe<<1);
|
||||
stop_meas(&eNB->dlsch_scrambling_stats);
|
||||
start_meas(&eNB->dlsch_modulation_stats);
|
||||
dlsch_modulation(eNB,
|
||||
eNB->common_vars.txdataF,
|
||||
AMP,
|
||||
frame,
|
||||
subframe,
|
||||
dlsch_harq->pdsch_start,
|
||||
dlsch,
|
||||
dlsch->ue_type==0 ? dlsch1 : (LTE_eNB_DLSCH_t *)NULL);
|
||||
eNB->common_vars.txdataF,
|
||||
AMP,
|
||||
frame,
|
||||
subframe,
|
||||
dlsch_harq->pdsch_start,
|
||||
dlsch,
|
||||
dlsch->ue_type==0 ? dlsch1 : (LTE_eNB_DLSCH_t *)NULL);
|
||||
stop_meas(&eNB->dlsch_modulation_stats);
|
||||
|
||||
LOG_D(PHY,"Generated PDSCH dlsch_harq[round:%d]\n",dlsch_harq->DLround);
|
||||
LOG_D(PHY,"Generated PDSCH dlsch_harq[round:%d]\n",dlsch_harq->round);
|
||||
}
|
||||
|
||||
|
||||
@@ -399,9 +397,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
int16_t UE_id=0;
|
||||
uint8_t num_pdcch_symbols=0;
|
||||
uint8_t num_dci=0;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uint8_t num_mdci = 0;
|
||||
#endif
|
||||
uint8_t ul_subframe;
|
||||
uint32_t ul_frame;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
@@ -445,11 +441,9 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
// (subframe_select(fp,ul_subframe)==SF_UL)) { // This means that there is a potential UL subframe that will be scheduled here
|
||||
if (ul_subframe < 10) { // This means that there is a potential UL subframe that will be scheduled here
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
|
||||
if (eNB->ulsch[i] && eNB->ulsch[i]->ue_type >0) harq_pid = 0;
|
||||
else
|
||||
#endif
|
||||
|
||||
else
|
||||
harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe);
|
||||
|
||||
if (eNB->ulsch[i]) {
|
||||
@@ -484,7 +478,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,num_pdcch_symbols);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME (VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO, (frame * 10) + subframe);
|
||||
|
||||
if (num_pdcch_symbols == 0){
|
||||
if (num_pdcch_symbols == 0) {
|
||||
LOG_E(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8") num_pdcch_symbols:%d\n",eNB->Mod_id,frame, subframe, num_dci, num_pdcch_symbols);
|
||||
return;
|
||||
}
|
||||
@@ -503,15 +497,12 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
fp,
|
||||
eNB->common_vars.txdataF,
|
||||
subframe);
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
num_mdci = eNB->mpdcch_vars[subframe &1].num_dci;
|
||||
|
||||
if (num_mdci > 0) {
|
||||
LOG_D (PHY, "[eNB %" PRIu8 "] Frame %d, subframe %d: Calling generate_mdci_top (mpdcch) (num_dci %" PRIu8 ")\n", eNB->Mod_id, frame, subframe, num_mdci);
|
||||
generate_mdci_top (eNB, frame, subframe, AMP, eNB->common_vars.txdataF);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
if (do_meas==1) stop_meas(&eNB->dlsch_common_and_dci);
|
||||
@@ -536,13 +527,10 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
) {
|
||||
// get harq_pid
|
||||
harq_pid = dlsch0->harq_ids[frame%2][subframe];
|
||||
//AssertFatal(harq_pid>=0,"harq_pid is negative\n");
|
||||
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
//AssertFatal(harq_pid>=0,"harq_pid is negative\n");
|
||||
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
|
||||
if (dlsch0->ue_type==0)
|
||||
#endif
|
||||
LOG_E(PHY,"harq_pid:%d corrupt must be 0-7 UE_id:%d frame:%d subframe:%d rnti:%x [ %1d.%1d.%1d.%1d.%1d.%1d.%1d.%1d\n", harq_pid,UE_id,frame,subframe,dlsch0->rnti,
|
||||
dlsch0->harq_ids[frame%2][0],
|
||||
dlsch0->harq_ids[frame%2][1],
|
||||
@@ -553,18 +541,18 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
dlsch0->harq_ids[frame%2][6],
|
||||
dlsch0->harq_ids[frame%2][7]);
|
||||
} else {
|
||||
if (dlsch_procedures(eNB,
|
||||
proc,
|
||||
harq_pid,
|
||||
dlsch0,
|
||||
&eNB->UE_stats[(uint32_t)UE_id])) {
|
||||
// if we generate dlsch, we must generate pdsch
|
||||
pdsch_procedures(eNB,
|
||||
proc,
|
||||
harq_pid,
|
||||
dlsch0,
|
||||
dlsch1);
|
||||
}
|
||||
if (dlsch_procedures(eNB,
|
||||
proc,
|
||||
harq_pid,
|
||||
dlsch0,
|
||||
&eNB->UE_stats[(uint32_t)UE_id])) {
|
||||
// if we generate dlsch, we must generate pdsch
|
||||
pdsch_procedures(eNB,
|
||||
proc,
|
||||
harq_pid,
|
||||
dlsch0,
|
||||
dlsch1);
|
||||
}
|
||||
}
|
||||
} else if ((dlsch0)&&(dlsch0->rnti>0)&&
|
||||
#ifdef PHY_TX_THREAD
|
||||
@@ -676,7 +664,6 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
subframe,
|
||||
uci->type,
|
||||
i);
|
||||
|
||||
uci->active = 0;
|
||||
|
||||
// Null out PUCCH PRBs for noise measurement
|
||||
@@ -684,24 +671,30 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
case 6:
|
||||
eNB->rb_mask_ul[0] |= (0x1 | (1 << 5)); // position 5
|
||||
break;
|
||||
|
||||
case 15:
|
||||
eNB->rb_mask_ul[0] |= (0x1 | (1 << 14)); // position 14
|
||||
break;
|
||||
|
||||
case 25:
|
||||
eNB->rb_mask_ul[0] |= (0x1 | (1 << 24)); // position 24
|
||||
break;
|
||||
|
||||
case 50:
|
||||
eNB->rb_mask_ul[0] |= 0x1;
|
||||
eNB->rb_mask_ul[1] |= (1 << 17); // position 49 (49-32)
|
||||
break;
|
||||
|
||||
case 75:
|
||||
eNB->rb_mask_ul[0] |= 0x1;
|
||||
eNB->rb_mask_ul[2] |= (1 << 10); // position 74 (74-64)
|
||||
break;
|
||||
|
||||
case 100:
|
||||
eNB->rb_mask_ul[0] |= 0x1;
|
||||
eNB->rb_mask_ul[3] |= (1 << 3); // position 99 (99-96)
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"Unknown number for N_RB_UL %d\n", fp->N_RB_UL);
|
||||
break;
|
||||
@@ -722,10 +715,8 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
&SR_payload,
|
||||
frame,
|
||||
subframe,
|
||||
pucch1_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
pucch1_thres,
|
||||
uci->ue_type
|
||||
);
|
||||
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (uci.type %d SR n1pucch is %d)\n",
|
||||
eNB->Mod_id,
|
||||
@@ -764,10 +755,8 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
pucch1ab_thres,
|
||||
uci->ue_type
|
||||
);
|
||||
|
||||
//dump_ulsch(eNB,frame,subframe,0,0); exit(-1);
|
||||
@@ -788,10 +777,8 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
pucch1ab_thres,
|
||||
uci->ue_type
|
||||
);
|
||||
}
|
||||
|
||||
@@ -818,10 +805,8 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
pucch1ab_thres,
|
||||
uci->ue_type
|
||||
);
|
||||
|
||||
if (uci->type==HARQ_SR && metric[0] > metric_SR) SR_payload = 0;
|
||||
@@ -838,10 +823,8 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
pucch1ab_thres,
|
||||
uci->ue_type
|
||||
);
|
||||
}
|
||||
|
||||
@@ -856,10 +839,8 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
metric[0] = rx_pucch (eNB, pucch_format1b, i, uci->n_pucch_1_0_sr[0], 0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0], frame, subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
pucch1ab_thres,
|
||||
uci->ue_type
|
||||
);
|
||||
} else { //using assigned pucch resources
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
@@ -872,10 +853,8 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
metric[res] = rx_pucch (eNB, uci->pucch_fmt, i, uci->n_pucch_1[res][0], 0, // n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[res], frame, subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
pucch1ab_thres,
|
||||
uci->ue_type
|
||||
);
|
||||
|
||||
for (res=0; res<uci->num_pucch_resources; res++)
|
||||
@@ -888,10 +867,8 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
pucch_b0b1[res],
|
||||
frame,
|
||||
subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
pucch1ab_thres,
|
||||
uci->ue_type
|
||||
);
|
||||
}
|
||||
|
||||
@@ -900,6 +877,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
uci->rnti,uci->type,SR_payload,frame,subframe,pucch_b0b1[0][0],pucch_b0b1[0][1],pucch_b0b1[1][0],pucch_b0b1[1][1]);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (SR_payload == 1) { // this implements Table 7.3.1 from 36.213
|
||||
if (pucch_b0b1[0][0] == 4) { // there isn't a likely transmission
|
||||
harq_ack[0] = 4; // DTX
|
||||
@@ -1171,7 +1149,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
|
||||
if (eNB->first_sr[uci->ue_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
|
||||
eNB->first_sr[uci->ue_id] = 0;
|
||||
eNB->dlsch[uci->ue_id][0]->harq_processes[0]->DLround = 0;
|
||||
eNB->dlsch[uci->ue_id][0]->harq_processes[0]->round = 0;
|
||||
eNB->dlsch[uci->ue_id][0]->harq_processes[0]->status = SCH_IDLE;
|
||||
LOG_D (PHY, "[eNB %d][SR %x] Frame %d subframe %d First SR\n", eNB->Mod_id, eNB->ulsch[uci->ue_id]->rnti, frame, subframe);
|
||||
}
|
||||
@@ -1357,21 +1335,72 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern int oai_exit;
|
||||
|
||||
extern void *td_thread (void *);
|
||||
|
||||
void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) {
|
||||
void init_td_thread(PHY_VARS_eNB *eNB) {
|
||||
/*
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
proc->tdp.eNB = eNB;
|
||||
proc->instance_cnt_td = -1;
|
||||
threadCreate(&proc->pthread_td, td_thread, (void *)&proc->tdp, "TD", -1, OAI_PRIORITY_RT);
|
||||
*/
|
||||
}
|
||||
|
||||
void kill_td_thread(PHY_VARS_eNB *eNB) {
|
||||
/*
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
proc->instance_cnt_td = 0;
|
||||
pthread_cond_signal(&proc->cond_td);
|
||||
pthread_join(proc->pthread_td, NULL);
|
||||
pthread_mutex_destroy( &proc->mutex_td );
|
||||
pthread_cond_destroy( &proc->cond_td );
|
||||
*/
|
||||
}
|
||||
|
||||
extern void *te_thread (void *);
|
||||
|
||||
void init_te_thread(PHY_VARS_eNB *eNB) {
|
||||
/*
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
|
||||
for(int i=0; i<3 ; i++) {
|
||||
proc->tep[i].eNB = eNB;
|
||||
proc->tep[i].instance_cnt_te = -1;
|
||||
LOG_I(PHY,"Creating te_thread %d\n",i);
|
||||
char txt[128];
|
||||
sprintf(txt,"TE_%d", i);
|
||||
threadCreate(&proc->tep[i].pthread_te, te_thread, (void *)&proc->tep[i], txt, -1, OAI_PRIORITY_RT);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void kill_te_thread(PHY_VARS_eNB *eNB) {
|
||||
/*
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
|
||||
for(int i=0; i<3 ; i++) {
|
||||
proc->tep[i].instance_cnt_te = 0;
|
||||
pthread_cond_signal(&proc->tep[i].cond_te);
|
||||
pthread_join(proc->tep[i].pthread_te, NULL);
|
||||
pthread_mutex_destroy( &proc->tep[i].mutex_te);
|
||||
pthread_cond_destroy( &proc->tep[i].cond_te);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void fill_rx_indication(PHY_VARS_eNB *eNB,
|
||||
int UE_id,
|
||||
int frame,
|
||||
int subframe) {
|
||||
nfapi_rx_indication_pdu_t *pdu;
|
||||
int timing_advance_update;
|
||||
int sync_pos;
|
||||
uint32_t harq_pid;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
|
||||
if (eNB->ulsch[UE_id]->ue_type > 0) harq_pid = 0;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
else {
|
||||
harq_pid = subframe2harq_pid (&eNB->frame_parms,
|
||||
frame, subframe);
|
||||
}
|
||||
@@ -1469,31 +1498,27 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
|
||||
int harq_pid;
|
||||
int subframe_tx;
|
||||
int frame_tx;
|
||||
|
||||
AssertFatal(UE_id != -1, "No existing dlsch context\n");
|
||||
AssertFatal(UE_id < NUMBER_OF_UE_MAX, "Returned UE_id %d >= %d (NUMBER_OF_UE_MAX)\n", UE_id, NUMBER_OF_UE_MAX);
|
||||
|
||||
dlsch0 = eNB->dlsch[UE_id][0];
|
||||
dlsch1 = eNB->dlsch[UE_id][1];
|
||||
|
||||
if (eNB->frame_parms.frame_type == FDD) {
|
||||
subframe_tx = (subframe + 6) % 10;
|
||||
frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms,
|
||||
frame,
|
||||
subframe,
|
||||
subframe_tx);
|
||||
|
||||
frame,
|
||||
subframe,
|
||||
subframe_tx);
|
||||
harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx];
|
||||
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
|
||||
LOG_E(PHY,"illegal harq_pid %d %s:%d\n", harq_pid, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
|
||||
AssertFatal(dlsch0_harq != NULL, "dlsch0_harq is null\n");
|
||||
|
||||
#if T_TRACER
|
||||
|
||||
if (after_rounds != -1) {
|
||||
@@ -1514,11 +1539,10 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
|
||||
|
||||
#endif
|
||||
|
||||
if (dlsch0_harq->DLround >= after_rounds) {
|
||||
if (dlsch0_harq->round >= after_rounds) {
|
||||
dlsch0_harq->status = SCH_IDLE;
|
||||
dlsch0->harq_mask &= ~(1 << harq_pid);
|
||||
}
|
||||
|
||||
} else {
|
||||
/* Release all processes in the bundle that was acked, based on mask */
|
||||
/* This is at most 4 for multiplexing and 9 for bundling/special bundling */
|
||||
@@ -1526,13 +1550,12 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
|
||||
|
||||
for (int m=0; m < M; m++) {
|
||||
subframe_tx = ul_ACK_subframe2_dl_subframe(&eNB->frame_parms,
|
||||
subframe,
|
||||
m);
|
||||
|
||||
subframe,
|
||||
m);
|
||||
frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms,
|
||||
frame,
|
||||
subframe,
|
||||
subframe_tx);
|
||||
frame,
|
||||
subframe,
|
||||
subframe_tx);
|
||||
|
||||
if (((1 << m) & mask) > 0) {
|
||||
harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx];
|
||||
@@ -1541,12 +1564,12 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
|
||||
LOG_E(PHY,"illegal harq_pid %d %s:%d\n", harq_pid, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
|
||||
AssertFatal(dlsch0_harq != NULL, "Dlsch0_harq is null\n");
|
||||
|
||||
#if T_TRACER
|
||||
|
||||
if (after_rounds != -1) {
|
||||
T(T_ENB_PHY_DLSCH_UE_NACK,
|
||||
T_INT(0),
|
||||
@@ -1562,8 +1585,10 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
|
||||
T_INT(dlsch0->rnti),
|
||||
T_INT(harq_pid));
|
||||
}
|
||||
|
||||
#endif
|
||||
if (dlsch0_harq->DLround >= after_rounds) {
|
||||
|
||||
if (dlsch0_harq->round >= after_rounds) {
|
||||
dlsch0_harq->status = SCH_IDLE;
|
||||
|
||||
if ((dlsch1_harq == NULL) || ((dlsch1_harq != NULL) && (dlsch1_harq->status == SCH_IDLE))) {
|
||||
@@ -1576,7 +1601,7 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
|
||||
static void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subframe,uint16_t mask, int is_ack) {
|
||||
/*
|
||||
/*
|
||||
* Maximum number of DL transmissions = 4.
|
||||
* TODO: get the value from configuration.
|
||||
* If is_ack is true then we release immediately. The value -1 can be used for that.
|
||||
@@ -1981,43 +2006,50 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 0 );
|
||||
}
|
||||
|
||||
void release_rnti_of_phy(module_id_t mod_id){
|
||||
int i,j;
|
||||
int CC_id;
|
||||
rnti_t rnti;
|
||||
PHY_VARS_eNB *eNB_PHY = NULL;
|
||||
LTE_eNB_ULSCH_t *ulsch = NULL;
|
||||
LTE_eNB_DLSCH_t *dlsch = NULL;
|
||||
for(i = 0; i< release_rntis.number_of_TLVs;i++){
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
eNB_PHY = RC.eNB[mod_id][CC_id];
|
||||
rnti = release_rntis.ue_release_request_TLVs_list[i].rnti;
|
||||
for (j=0; j<NUMBER_OF_UE_MAX; j++) {
|
||||
ulsch = eNB_PHY->ulsch[j];
|
||||
if((ulsch != NULL) && (ulsch->rnti == rnti)){
|
||||
LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
|
||||
clean_eNb_ulsch(ulsch);
|
||||
}
|
||||
void release_rnti_of_phy(module_id_t mod_id) {
|
||||
int i,j;
|
||||
int CC_id;
|
||||
rnti_t rnti;
|
||||
PHY_VARS_eNB *eNB_PHY = NULL;
|
||||
LTE_eNB_ULSCH_t *ulsch = NULL;
|
||||
LTE_eNB_DLSCH_t *dlsch = NULL;
|
||||
|
||||
dlsch = eNB_PHY->dlsch[j][0];
|
||||
if((dlsch != NULL) && (dlsch->rnti == rnti)){
|
||||
LOG_I(PHY, "clean_eNb_dlsch dlsch[%d] UE %x \n", j, rnti);
|
||||
clean_eNb_dlsch(dlsch);
|
||||
}
|
||||
}
|
||||
ulsch = eNB_PHY->ulsch[j];
|
||||
if((ulsch != NULL) && (ulsch->rnti == rnti)){
|
||||
LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
|
||||
clean_eNb_ulsch(ulsch);
|
||||
}
|
||||
for(j=0; j<NUMBER_OF_UCI_VARS_MAX; j++) {
|
||||
if(eNB_PHY->uci_vars[j].rnti == rnti){
|
||||
LOG_I(PHY, "clean eNb uci_vars[%d] UE %x \n",j, rnti);
|
||||
memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
|
||||
}
|
||||
for(i = 0; i< release_rntis.number_of_TLVs; i++) {
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
eNB_PHY = RC.eNB[mod_id][CC_id];
|
||||
rnti = release_rntis.ue_release_request_TLVs_list[i].rnti;
|
||||
|
||||
}
|
||||
for (j=0; j<NUMBER_OF_UE_MAX; j++) {
|
||||
ulsch = eNB_PHY->ulsch[j];
|
||||
|
||||
if((ulsch != NULL) && (ulsch->rnti == rnti)) {
|
||||
LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
|
||||
clean_eNb_ulsch(ulsch);
|
||||
}
|
||||
|
||||
dlsch = eNB_PHY->dlsch[j][0];
|
||||
|
||||
if((dlsch != NULL) && (dlsch->rnti == rnti)) {
|
||||
LOG_I(PHY, "clean_eNb_dlsch dlsch[%d] UE %x \n", j, rnti);
|
||||
clean_eNb_dlsch(dlsch);
|
||||
}
|
||||
}
|
||||
|
||||
ulsch = eNB_PHY->ulsch[j];
|
||||
|
||||
if((ulsch != NULL) && (ulsch->rnti == rnti)) {
|
||||
LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
|
||||
clean_eNb_ulsch(ulsch);
|
||||
}
|
||||
|
||||
for(j=0; j<NUMBER_OF_UCI_VARS_MAX; j++) {
|
||||
if(eNB_PHY->uci_vars[j].rnti == rnti) {
|
||||
LOG_I(PHY, "clean eNb uci_vars[%d] UE %x \n",j, rnti);
|
||||
memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
|
||||
}
|
||||
}
|
||||
}
|
||||
memset(&release_rntis, 0, sizeof(nfapi_ue_release_request_body_t));
|
||||
}
|
||||
|
||||
memset(&release_rntis, 0, sizeof(nfapi_ue_release_request_body_t));
|
||||
}
|
||||
|
||||
@@ -54,31 +54,23 @@
|
||||
extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
|
||||
|
||||
void prach_procedures(PHY_VARS_eNB *eNB,
|
||||
L1_rxtx_proc_t *proc
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,
|
||||
int br_flag
|
||||
#endif
|
||||
) {
|
||||
int br_flag ) {
|
||||
uint16_t max_preamble[4],max_preamble_energy[4],max_preamble_delay[4],avg_preamble_energy[4];
|
||||
uint16_t i;
|
||||
int frame,subframe;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
|
||||
if (br_flag==1) {
|
||||
subframe = proc->subframe_prach_br;
|
||||
frame = proc->frame_prach_br;
|
||||
subframe = eNB->proc.subframe_prach_br;
|
||||
frame = eNB->proc.frame_prach_br;
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
eNB->UL_INFO.rach_ind_br.rach_indication_body.number_of_preambles=0;
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles=0;
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
subframe = proc->subframe_prach;
|
||||
frame = proc->frame_prach;
|
||||
subframe = eNB->proc.subframe_prach;
|
||||
frame = eNB->proc.frame_prach;
|
||||
}
|
||||
|
||||
RU_t *ru;
|
||||
@@ -91,29 +83,22 @@ void prach_procedures(PHY_VARS_eNB *eNB,
|
||||
|
||||
for (ru_aa=0,aa=0; ru_aa<ru->nb_rx; ru_aa++,aa++) {
|
||||
eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[i]->prach_rxsigF[ru_aa];
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int ce_level;
|
||||
|
||||
if (br_flag==1)
|
||||
for (ce_level=0; ce_level<4; ce_level++) eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[i]->prach_rxsigF_br[ce_level][ru_aa];
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// run PRACH detection for CE-level 0 only for now when br_flag is set
|
||||
rx_prach(eNB,
|
||||
proc,
|
||||
eNB->RU_list[0],
|
||||
&max_preamble[0],
|
||||
&max_preamble_energy[0],
|
||||
&max_preamble_delay[0],
|
||||
&avg_preamble_energy[0],
|
||||
&avg_preamble_energy[0],
|
||||
frame,
|
||||
0
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,br_flag
|
||||
#endif
|
||||
0,br_flag
|
||||
);
|
||||
LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : BR %d Most likely preamble %d, energy %d dB delay %d (prach_energy counter %d), threshold %d, I0 %d\n",
|
||||
frame,subframe,br_flag,
|
||||
@@ -121,13 +106,12 @@ void prach_procedures(PHY_VARS_eNB *eNB,
|
||||
max_preamble_energy[0]/10,
|
||||
max_preamble_delay[0],
|
||||
eNB->prach_energy_counter,
|
||||
eNB->measurements.prach_I0+eNB->prach_DTX_threshold,
|
||||
eNB->measurements.prach_I0);
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
eNB->measurements.prach_I0+eNB->prach_DTX_threshold,
|
||||
eNB->measurements.prach_I0);
|
||||
|
||||
if (br_flag==1) {
|
||||
int prach_mask;
|
||||
prach_mask = is_prach_subframe (&eNB->frame_parms, proc->frame_prach_br, 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.rach_indication_body.preamble_list = eNB->preamble_list_br;
|
||||
int ind = 0;
|
||||
int ce_level = 0;
|
||||
@@ -163,9 +147,7 @@ void prach_procedures(PHY_VARS_eNB *eNB,
|
||||
ind++;
|
||||
}
|
||||
} */// ce_level
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
if ((eNB->prach_energy_counter == 100) &&
|
||||
(max_preamble_energy[0] > eNB->measurements.prach_I0+eNB->prach_DTX_threshold)) {
|
||||
LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
|
||||
|
||||
+504
-165
@@ -57,90 +57,94 @@
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
|
||||
#include "assertions.h"
|
||||
#include "common/utils/system.h"
|
||||
#include "msc.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "targets/RT/USER/rt_wrapper.h"
|
||||
|
||||
extern int oai_exit;
|
||||
|
||||
|
||||
|
||||
void feptx0(RU_t *ru, L1_rxtx_proc_t *proc, int slot) {
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
void feptx0(RU_t *ru,
|
||||
int slot)
|
||||
{
|
||||
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
|
||||
//int dummy_tx_b[7680*2] __attribute__((aligned(32)));
|
||||
|
||||
unsigned int aa,slot_offset;
|
||||
int slot_sizeF = (fp->ofdm_symbol_size)*
|
||||
((fp->Ncp==1) ? 6 : 7);
|
||||
int subframe = proc->subframe_tx;
|
||||
|
||||
unsigned int aa, slot_offset;
|
||||
int slot_sizeF = (fp->ofdm_symbol_size) * ((fp->Ncp==1) ? 6 : 7);
|
||||
int subframe = ru->proc.tti_tx;
|
||||
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+slot , 1 );
|
||||
|
||||
slot_offset = subframe*fp->samples_per_tti + (slot*(fp->samples_per_tti>>1));
|
||||
slot_offset = slot*(fp->samples_per_tti>>1); //slot_offset = subframe*fp->samples_per_tti + (slot*(fp->samples_per_tti>>1));
|
||||
|
||||
//LOG_D(PHY,"SFN/SF:RU:TX:%d/%d Generating slot %d\n",ru->proc.frame_tx, ru->proc.subframe_tx,slot);
|
||||
//LOG_D(PHY,"SFN/SF:RU:TX:%d/%d Generating slot %d\n",ru->proc.frame_tx, ru->proc.tti_tx,slot);
|
||||
|
||||
for (aa=0; aa<ru->nb_tx; aa++) {
|
||||
if (fp->Ncp == EXTENDED) PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot*slot_sizeF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
6,
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
else {
|
||||
if(is_pmch_subframe(ru->proc.frame_tx,subframe,fp)){
|
||||
if(slot==0){//just use one slot chance
|
||||
normal_prefix_mod(&ru->common.txdataF_BF[aa][slot*slot_sizeF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
2,
|
||||
fp);
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot*slot_sizeF+fp->ofdm_symbol_size*2],
|
||||
(int*)&ru->common.txdata[aa][slot_offset+((fp->ofdm_symbol_size>>2)*2+fp->ofdm_symbol_size*2)],
|
||||
fp->ofdm_symbol_size,
|
||||
10,
|
||||
fp->ofdm_symbol_size>>2,
|
||||
CYCLIC_PREFIX);
|
||||
LOG_D(PHY,"SFN/SF:RU:TX:%d/%d Generating slot %d F(%d) t(%d) IS PMCH(%d)\n",ru->proc.frame_tx, ru->proc.subframe_tx,slot,slot*slot_sizeF+fp->ofdm_symbol_size*2,slot_offset+((fp->ofdm_symbol_size>>2)*2+fp->ofdm_symbol_size*2),is_pmch_subframe(ru->proc.frame_tx,subframe,fp));
|
||||
}
|
||||
}else{
|
||||
/* AssertFatal(ru->generate_dmrs_sync==1 && (fp->frame_type != TDD || ru->is_slave == 1),
|
||||
"ru->generate_dmrs_sync should not be set, frame_type %d, is_slave %d\n",
|
||||
fp->frame_type,ru->is_slave);
|
||||
*/
|
||||
if (fp->Ncp == EXTENDED) {
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
6,
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
} else {
|
||||
if(is_pmch_subframe(ru->proc.frame_tx,subframe,fp)){
|
||||
if ((slot&1) == 0) {//just use one slot chance
|
||||
normal_prefix_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
2,
|
||||
fp);
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF+fp->ofdm_symbol_size*2],
|
||||
(int*)&ru->common.txdata[aa][slot_offset+((fp->ofdm_symbol_size>>2)*2+fp->ofdm_symbol_size*2)],
|
||||
fp->ofdm_symbol_size,
|
||||
10,
|
||||
fp->ofdm_symbol_size>>2,
|
||||
CYCLIC_PREFIX);
|
||||
LOG_D(PHY,"SFN/SF:RU:TX:%d/%d Generating slot %d F(%d) t(%d) IS PMCH(%d)\n",
|
||||
ru->proc.frame_tx,
|
||||
ru->proc.tti_tx,
|
||||
slot,
|
||||
slot*slot_sizeF+fp->ofdm_symbol_size*2,
|
||||
slot_offset+((fp->ofdm_symbol_size>>2)*2+fp->ofdm_symbol_size*2),
|
||||
is_pmch_subframe(ru->proc.frame_tx,subframe,fp));
|
||||
}
|
||||
} else {
|
||||
/* AssertFatal(ru->generate_dmrs_sync==1 && (fp->frame_type != TDD || ru->is_slave == 1),
|
||||
"ru->generate_dmrs_sync should not be set, frame_type %d, is_slave %d\n",
|
||||
fp->frame_type,ru->is_slave);
|
||||
*/
|
||||
int num_symb = 7;
|
||||
|
||||
if (subframe_select(fp,subframe) == SF_S) num_symb=fp->dl_symbols_in_S_subframe+1;
|
||||
|
||||
if (subframe_select(fp,subframe) == SF_S)
|
||||
num_symb = fp->dl_symbols_in_S_subframe+1;
|
||||
|
||||
if (ru->generate_dmrs_sync == 1 && slot == 0 && subframe == 1 && aa==0) {
|
||||
//int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32)));
|
||||
//int32_t *dmrsp[2] ={dmrs,NULL}; //{&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL};
|
||||
|
||||
generate_drs_pusch((PHY_VARS_UE *)NULL,
|
||||
(UE_rxtx_proc_t*)NULL,
|
||||
fp,
|
||||
ru->common.txdataF_BF,
|
||||
0,
|
||||
AMP,
|
||||
0,
|
||||
0,
|
||||
fp->N_RB_DL,
|
||||
aa);
|
||||
//int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32)));
|
||||
//int32_t *dmrsp[2] ={dmrs,NULL}; //{&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL};
|
||||
|
||||
generate_drs_pusch((PHY_VARS_UE *)NULL,
|
||||
(UE_rxtx_proc_t*)NULL,
|
||||
fp,
|
||||
ru->common.txdataF_BF,
|
||||
0,
|
||||
AMP,
|
||||
0,
|
||||
0,
|
||||
fp->N_RB_DL,
|
||||
aa);
|
||||
}
|
||||
normal_prefix_mod(&ru->common.txdataF_BF[aa][slot*slot_sizeF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
num_symb,
|
||||
fp);
|
||||
}
|
||||
}
|
||||
normal_prefix_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
num_symb,
|
||||
fp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
len = fp->samples_per_tti>>1;
|
||||
|
||||
|
||||
if ((slot_offset+len)>(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti)) {
|
||||
tx_offset = (int)slot_offset;
|
||||
@@ -172,29 +176,122 @@ void feptx0(RU_t *ru, L1_rxtx_proc_t *proc, int slot) {
|
||||
tx_offset = (int)slot_offset+i-ru->N_TA_offset/2;
|
||||
if (tx_offset<0)
|
||||
tx_offset += LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti;
|
||||
|
||||
|
||||
if (tx_offset>=(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti))
|
||||
tx_offset -= LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti;
|
||||
|
||||
|
||||
ru->common.txdata[aa][tx_offset] = 0x00000000;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+slot , 0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(slot&1), 0);
|
||||
}
|
||||
|
||||
void feptx_ofdm(RU_t *ru, L1_rxtx_proc_t* proc) {
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp=&ru->frame_parms;
|
||||
|
||||
unsigned int aa,slot_offset, slot_offset_F;
|
||||
static void *feptx_thread(void *param)
|
||||
{
|
||||
RU_t *ru = (RU_t *)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
LOG_I(PHY,"thread feptx created \n");
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
if (wait_on_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"feptx thread")<0) break;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+1 , 1 );
|
||||
|
||||
if (oai_exit) break;
|
||||
//stop_meas(&ru->ofdm_mod_wakeup_stats);
|
||||
feptx0(ru,proc->slot_feptx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+1 , 0 );
|
||||
|
||||
if (release_thread(&proc->mutex_feptx,&proc->instance_cnt_feptx,"feptx thread")<0) break;
|
||||
|
||||
if (pthread_cond_signal(&proc->cond_feptx) != 0) {
|
||||
printf("[eNB] ERROR pthread_cond_signal for feptx thread exit\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return NULL;
|
||||
}
|
||||
/*if(opp_enabled == 1 && ru->ofdm_mod_wakeup_stats.p_time>30*3000){
|
||||
print_meas_now(&ru->ofdm_mod_wakeup_stats,"fep wakeup",stderr);
|
||||
printf("delay in fep wakeup in frame_tx: %d subframe_rx: %d \n",proc->frame_tx,proc->tti_tx);
|
||||
}*/
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
void feptx_ofdm_2thread(RU_t *ru,
|
||||
int frame,
|
||||
int subframe)
|
||||
{
|
||||
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
struct timespec wait;
|
||||
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
start_meas(&ru->ofdm_mod_stats);
|
||||
|
||||
if (subframe_select(fp,subframe) == SF_UL) return;
|
||||
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
|
||||
|
||||
if (subframe_select(fp,subframe)==SF_DL) {
|
||||
// If this is not an S-subframe
|
||||
if (pthread_mutex_timedlock(&proc->mutex_feptx,&wait) != 0) {
|
||||
printf("[RU] ERROR pthread_mutex_lock for feptx thread (IC %d)\n", proc->instance_cnt_feptx);
|
||||
exit_fun( "error locking mutex_feptx" );
|
||||
return;
|
||||
}
|
||||
|
||||
if (proc->instance_cnt_feptx==0) {
|
||||
printf("[RU] FEPtx thread busy\n");
|
||||
exit_fun("FEPtx thread busy");
|
||||
pthread_mutex_unlock( &proc->mutex_feptx );
|
||||
return;
|
||||
}
|
||||
|
||||
proc->slot_feptx=1+(subframe<<1);
|
||||
++proc->instance_cnt_feptx;
|
||||
|
||||
|
||||
if (pthread_cond_signal(&proc->cond_feptx) != 0) {
|
||||
printf("[RU] ERROR pthread_cond_signal for feptx thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return;
|
||||
}
|
||||
//start_meas(&ru->ofdm_mod_wakeup_stats);
|
||||
|
||||
pthread_mutex_unlock( &proc->mutex_feptx );
|
||||
}
|
||||
|
||||
// call first slot in this thread
|
||||
feptx0(ru,(subframe<<1));
|
||||
start_meas(&ru->ofdm_mod_wait_stats);
|
||||
wait_on_busy_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"feptx thread");
|
||||
stop_meas(&ru->ofdm_mod_wait_stats);
|
||||
/*if(opp_enabled == 1 && ru->ofdm_mod_wait_stats.p_time>30*3000){
|
||||
print_meas_now(&ru->ofdm_mod_wait_stats,"fep wakeup",stderr);
|
||||
printf("delay in feptx wait on condition in frame_rx: %d subframe_rx: %d \n", proc->frame_tx, proc->tti_tx);
|
||||
}*/
|
||||
|
||||
stop_meas(&ru->ofdm_mod_stats);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+ru->idx , 0 );
|
||||
}
|
||||
|
||||
|
||||
void feptx_ofdm(RU_t *ru,
|
||||
int frame,
|
||||
int subframe)
|
||||
{
|
||||
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
|
||||
unsigned int aa, slot_offset, slot_offset_F;
|
||||
int dummy_tx_b[7680*4] __attribute__((aligned(32)));
|
||||
int i,j, tx_offset;
|
||||
int slot_sizeF = (fp->ofdm_symbol_size)*
|
||||
((fp->Ncp==1) ? 6 : 7);
|
||||
int i, j, tx_offset;
|
||||
int slot_sizeF = (fp->ofdm_symbol_size) * ((fp->Ncp==1) ? 6 : 7);
|
||||
int len,len2;
|
||||
int16_t *txdata;
|
||||
int subframe = proc->subframe_tx;
|
||||
|
||||
// int CC_id = ru->proc.CC_id;
|
||||
|
||||
@@ -203,8 +300,8 @@ void feptx_ofdm(RU_t *ru, L1_rxtx_proc_t* proc) {
|
||||
|
||||
slot_offset = subframe*fp->samples_per_tti;
|
||||
|
||||
if ((subframe_select(fp,subframe)==SF_DL)||
|
||||
((subframe_select(fp,subframe)==SF_S))) {
|
||||
if ((subframe_select(fp,subframe)==SF_DL)|| ((subframe_select(fp,subframe)==SF_S)))
|
||||
{
|
||||
// LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot);
|
||||
|
||||
start_meas(&ru->ofdm_mod_stats);
|
||||
@@ -224,7 +321,7 @@ void feptx_ofdm(RU_t *ru, L1_rxtx_proc_t* proc) {
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
} else {
|
||||
if(is_pmch_subframe(ru->proc.frame_tx,subframe,fp)/*subframe==1*/){
|
||||
if(is_pmch_subframe(frame,subframe,fp)/*subframe==1*/){
|
||||
normal_prefix_mod(&ru->common.txdataF_BF[aa][0],
|
||||
dummy_tx_b,
|
||||
2,
|
||||
@@ -240,7 +337,7 @@ void feptx_ofdm(RU_t *ru, L1_rxtx_proc_t* proc) {
|
||||
dummy_tx_b,
|
||||
7,
|
||||
fp);
|
||||
// if S-subframe generate first slot only
|
||||
// if S-subframe generate first slot only
|
||||
if (subframe_select(fp,subframe) == SF_DL)
|
||||
normal_prefix_mod(&ru->common.txdataF_BF[aa][slot_offset_F+slot_sizeF],
|
||||
dummy_tx_b+(fp->samples_per_tti>>1),
|
||||
@@ -328,32 +425,25 @@ void feptx_ofdm(RU_t *ru, L1_rxtx_proc_t* proc) {
|
||||
// }
|
||||
|
||||
stop_meas(&ru->ofdm_mod_stats);
|
||||
LOG_D(PHY,"feptx_ofdm (TXPATH): subframe %d: txp (time %p) %d dB, txp (freq) %d dB\n",
|
||||
subframe,txdata,dB_fixed(signal_energy((int32_t*)txdata,fp->samples_per_tti)),
|
||||
LOG_D(PHY,"feptx_ofdm (TXPATH): frame %d, subframe %d: txp (time %p) %d dB, txp (freq) %d dB\n",
|
||||
frame,subframe,txdata,dB_fixed(signal_energy((int32_t*)txdata,fp->samples_per_tti)),
|
||||
dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[aa],2*slot_sizeF)));
|
||||
}
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+ru->idx , 0 );
|
||||
}
|
||||
|
||||
void feptx_prec(RU_t *ru, L1_rxtx_proc_t * proc) {
|
||||
|
||||
int l,i,aa,p;
|
||||
int subframe = proc->subframe_tx;
|
||||
PHY_VARS_eNB **eNB_list = ru->eNB_list,*eNB;
|
||||
LTE_DL_FRAME_PARMS *fp;
|
||||
|
||||
/* fdragon
|
||||
void feptx_prec(RU_t *ru,
|
||||
int frame,
|
||||
int subframe)
|
||||
{
|
||||
int l,i,aa;
|
||||
PHY_VARS_eNB **eNB_list = ru->eNB_list,*eNB;
|
||||
PHY_VARS_eNB **eNB_list = ru->eNB_list, *eNB;
|
||||
LTE_DL_FRAME_PARMS *fp;
|
||||
int32_t ***bw;
|
||||
int subframe = ru->proc.subframe_tx;
|
||||
*/
|
||||
|
||||
|
||||
if (ru->num_eNB == 1) {
|
||||
|
||||
if (ru->num_eNB == 1)
|
||||
{
|
||||
eNB = eNB_list[0];
|
||||
fp = &eNB->frame_parms;
|
||||
LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[subframe&1];
|
||||
@@ -364,42 +454,42 @@ void feptx_prec(RU_t *ru, L1_rxtx_proc_t * proc) {
|
||||
|
||||
for (aa=0;aa<ru->nb_tx;aa++) {
|
||||
memset(ru->common.txdataF_BF[aa],0,sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
|
||||
for (p=0;p<NB_ANTENNA_PORTS_ENB;p++) {
|
||||
if (ru->do_precoding == 0) {
|
||||
if (p==0)
|
||||
memcpy((void*)ru->common.txdataF_BF[aa],
|
||||
(void*)&eNB->common_vars.txdataF[aa][subframe*fp->symbols_per_tti*fp->ofdm_symbol_size],
|
||||
sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
|
||||
} else {
|
||||
if (p<fp->nb_antenna_ports_eNB) {
|
||||
// For the moment this does nothing different than below, except ignore antenna ports 5,7,8.
|
||||
for (l=0;l<pdcch_vars->num_pdcch_symbols;l++)
|
||||
beam_precoding(eNB->common_vars.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
subframe,
|
||||
fp,
|
||||
ru->beam_weights,
|
||||
l,
|
||||
aa,
|
||||
p,
|
||||
eNB->Mod_id);
|
||||
} //if (p<fp->nb_antenna_ports_eNB)
|
||||
for (int p=0;p<NB_ANTENNA_PORTS_ENB;p++) {
|
||||
if (ru->do_precoding == 0) {
|
||||
if (p==0)
|
||||
memcpy((void*)ru->common.txdataF_BF[aa],
|
||||
(void*)&eNB->common_vars.txdataF[aa][subframe*fp->symbols_per_tti*fp->ofdm_symbol_size],
|
||||
sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
|
||||
} else {
|
||||
if (p<fp->nb_antenna_ports_eNB) {
|
||||
// For the moment this does nothing different than below, except ignore antenna ports 5,7,8.
|
||||
for (l=0;l<pdcch_vars->num_pdcch_symbols;l++)
|
||||
beam_precoding(eNB->common_vars.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
subframe,
|
||||
fp,
|
||||
ru->beam_weights,
|
||||
l,
|
||||
aa,
|
||||
p,
|
||||
eNB->Mod_id);
|
||||
} //if (p<fp->nb_antenna_ports_eNB)
|
||||
|
||||
// PDSCH region
|
||||
if (p<fp->nb_antenna_ports_eNB || p==5 || p==7 || p==8) {
|
||||
for (l=pdcch_vars->num_pdcch_symbols;l<fp->symbols_per_tti;l++) {
|
||||
beam_precoding(eNB->common_vars.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
subframe,
|
||||
fp,
|
||||
ru->beam_weights,
|
||||
l,
|
||||
aa,
|
||||
p,
|
||||
eNB->Mod_id);
|
||||
} // for (l=pdcch_vars ....)
|
||||
} // if (p<fp->nb_antenna_ports_eNB) ...
|
||||
} // ru->do_precoding!=0
|
||||
// PDSCH region
|
||||
if (p<fp->nb_antenna_ports_eNB || p==5 || p==7 || p==8) {
|
||||
for (l=pdcch_vars->num_pdcch_symbols;l<fp->symbols_per_tti;l++) {
|
||||
beam_precoding(eNB->common_vars.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
subframe,
|
||||
fp,
|
||||
ru->beam_weights,
|
||||
l,
|
||||
aa,
|
||||
p,
|
||||
eNB->Mod_id);
|
||||
} // for (l=pdcch_vars ....)
|
||||
} // if (p<fp->nb_antenna_ports_eNB) ...
|
||||
} // ru->do_precoding!=0
|
||||
} // for (p=0...)
|
||||
} // for (aa=0 ...)
|
||||
|
||||
@@ -414,70 +504,319 @@ void feptx_prec(RU_t *ru, L1_rxtx_proc_t * proc) {
|
||||
fp = &eNB->frame_parms;
|
||||
|
||||
for (l=0;l<fp->symbols_per_tti;l++) {
|
||||
for (aa=0;aa<ru->nb_tx;aa++) {
|
||||
beam_precoding(eNB->common_vars.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
subframe,
|
||||
fp,
|
||||
ru->beam_weights,
|
||||
subframe<<1,
|
||||
l,
|
||||
aa,
|
||||
eNB->Mod_id);
|
||||
}
|
||||
for (aa=0;aa<ru->nb_tx;aa++) {
|
||||
beam_precoding(eNB->common_vars.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
subframe,
|
||||
fp,
|
||||
ru->beam_weights,
|
||||
subframe<<1,
|
||||
l,
|
||||
aa,
|
||||
eNB->Mod_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void fep0(RU_t *ru,L1_rxtx_proc_t *proc, int slot) {
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
int l;
|
||||
void fep0(RU_t *ru,
|
||||
int slot)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
|
||||
|
||||
//printf("fep0: slot %d\n",slot);
|
||||
//printf("fep0: slot %d\n",slot);
|
||||
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+slot, 1);
|
||||
remove_7_5_kHz(ru,(slot&1)+(proc->subframe_rx<<1));
|
||||
for (l=0; l<fp->symbols_per_tti/2; l++) {
|
||||
remove_7_5_kHz(ru,(slot&1)+(proc->tti_rx<<1));
|
||||
for (int l=0; l<fp->symbols_per_tti/2; l++) {
|
||||
slot_fep_ul(ru,
|
||||
l,
|
||||
(slot&1),
|
||||
0
|
||||
);
|
||||
l,
|
||||
(slot&1),
|
||||
0);
|
||||
}
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+slot, 0);
|
||||
}
|
||||
|
||||
void fep_full(RU_t *ru, L1_rxtx_proc_t *proc) {
|
||||
|
||||
static void *fep_thread(void *param)
|
||||
{
|
||||
RU_t *ru = (RU_t *)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
if (wait_on_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
|
||||
if (oai_exit) break;
|
||||
//stop_meas(&ru->ofdm_demod_wakeup_stats);
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 1 );
|
||||
fep0(ru,0);
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 0 );
|
||||
if (release_thread(&proc->mutex_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
|
||||
|
||||
if (pthread_cond_signal(&proc->cond_fep) != 0) {
|
||||
printf("[eNB] ERROR pthread_cond_signal for fep thread exit\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return NULL;
|
||||
}
|
||||
/*if(opp_enabled == 1 && ru->ofdm_demod_wakeup_stats.p_time>30*3000){
|
||||
print_meas_now(&ru->ofdm_demod_wakeup_stats,"fep wakeup",stderr);
|
||||
printf("delay in fep wakeup in frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->subframe_rx);
|
||||
}*/
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
void init_feptx_thread(RU_t *ru,
|
||||
pthread_attr_t *attr_feptx)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
proc->instance_cnt_feptx = -1;
|
||||
|
||||
pthread_mutex_init( &proc->mutex_feptx, NULL);
|
||||
pthread_cond_init( &proc->cond_feptx, NULL);
|
||||
|
||||
threadCreate(&proc->pthread_feptx, feptx_thread, (void*)ru, "feptx", -1, OAI_PRIORITY_RT);
|
||||
}
|
||||
|
||||
|
||||
void init_fep_thread(RU_t *ru,
|
||||
pthread_attr_t *attr_fep)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
proc->instance_cnt_fep = -1;
|
||||
|
||||
pthread_mutex_init( &proc->mutex_fep, NULL);
|
||||
pthread_cond_init( &proc->cond_fep, NULL);
|
||||
|
||||
threadCreate(&proc->pthread_fep, fep_thread, (void*)ru, "fep", -1, OAI_PRIORITY_RT);
|
||||
}
|
||||
|
||||
|
||||
extern void kill_fep_thread(RU_t *ru)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
pthread_mutex_lock( &proc->mutex_fep );
|
||||
proc->instance_cnt_fep = 0;
|
||||
pthread_cond_signal(&proc->cond_fep);
|
||||
pthread_mutex_unlock( &proc->mutex_fep );
|
||||
LOG_D(PHY, "Joining pthread_fep\n");
|
||||
pthread_join(proc->pthread_fep, NULL);
|
||||
pthread_mutex_destroy( &proc->mutex_fep );
|
||||
pthread_cond_destroy( &proc->cond_fep );
|
||||
}
|
||||
|
||||
|
||||
extern void kill_feptx_thread(RU_t *ru)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
pthread_mutex_lock( &proc->mutex_feptx );
|
||||
proc->instance_cnt_feptx = 0;
|
||||
pthread_cond_signal(&proc->cond_feptx);
|
||||
pthread_mutex_unlock( &proc->mutex_feptx );
|
||||
LOG_D(PHY, "Joining pthread_feptx\n");
|
||||
pthread_join(proc->pthread_feptx, NULL);
|
||||
pthread_mutex_destroy( &proc->mutex_feptx );
|
||||
pthread_cond_destroy( &proc->cond_feptx );
|
||||
}
|
||||
|
||||
|
||||
void ru_fep_full_2thread(RU_t *ru,
|
||||
int subframe)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
//PHY_VARS_eNB *eNB = RC.eNB[0][0];
|
||||
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
|
||||
RU_CALIBRATION *calibration = &ru->calibration;
|
||||
RRU_CONFIG_msg_t rru_config_msg;
|
||||
int check_sync_pos;
|
||||
|
||||
struct timespec wait;
|
||||
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe) != SF_UL)) return;
|
||||
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
|
||||
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+ru->idx, 1 );
|
||||
start_meas(&ru->ofdm_demod_stats);
|
||||
|
||||
if (pthread_mutex_timedlock(&proc->mutex_fep,&wait) != 0) {
|
||||
printf("[RU] ERROR pthread_mutex_lock for fep thread (IC %d)\n", proc->instance_cnt_fep);
|
||||
exit_fun( "error locking mutex_fep" );
|
||||
return;
|
||||
}
|
||||
|
||||
if (proc->instance_cnt_fep==0) {
|
||||
printf("[RU] FEP thread busy\n");
|
||||
exit_fun("FEP thread busy");
|
||||
pthread_mutex_unlock( &proc->mutex_fep );
|
||||
return;
|
||||
}
|
||||
|
||||
++proc->instance_cnt_fep;
|
||||
|
||||
if (pthread_cond_signal(&proc->cond_fep) != 0) {
|
||||
printf("[RU] ERROR pthread_cond_signal for fep thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return;
|
||||
}
|
||||
//start_meas(&ru->ofdm_demod_wakeup_stats);
|
||||
|
||||
pthread_mutex_unlock( &proc->mutex_fep );
|
||||
|
||||
// call second slot in this symbol
|
||||
fep0(ru,1);
|
||||
|
||||
start_meas(&ru->ofdm_demod_wait_stats);
|
||||
wait_on_busy_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"fep thread");
|
||||
stop_meas(&ru->ofdm_demod_wait_stats);
|
||||
if(opp_enabled == 1 && ru->ofdm_demod_wakeup_stats.p_time>30*3000){
|
||||
print_meas_now(&ru->ofdm_demod_wakeup_stats,"fep wakeup",stderr);
|
||||
printf("delay in fep wait on condition in frame_rx: %d subframe_rx: %d \n", proc->frame_rx, proc->tti_rx);
|
||||
}
|
||||
|
||||
if (proc->tti_rx/*proc->subframe_rx*/==1 && ru->is_slave==1/* && ru->state == RU_CHECK_SYNC*/)
|
||||
{
|
||||
//LOG_I(PHY,"Running check synchronization procedure for frame %d\n", proc->frame_rx);
|
||||
ulsch_extract_rbs_single(ru->common.rxdataF,
|
||||
calibration->rxdataF_ext,
|
||||
0,
|
||||
fp->N_RB_DL,
|
||||
3%(fp->symbols_per_tti/2),// l = symbol within slot
|
||||
3/(fp->symbols_per_tti/2),// Ns = slot number
|
||||
fp);
|
||||
|
||||
/*lte_ul_channel_estimation((PHY_VARS_eNB *)NULL,
|
||||
proc,
|
||||
ru->idx,
|
||||
3%(fp->symbols_per_tti/2),
|
||||
3/(fp->symbols_per_tti/2));
|
||||
*/
|
||||
lte_ul_channel_estimation_RRU(fp,
|
||||
calibration->drs_ch_estimates,
|
||||
calibration->drs_ch_estimates_time,
|
||||
calibration->rxdataF_ext,
|
||||
fp->N_RB_DL, //N_rb_alloc,
|
||||
proc->frame_rx,
|
||||
proc->tti_rx,//proc->subframe_rx,
|
||||
0,//u = 0..29
|
||||
0,//v = 0,1
|
||||
/*eNB->ulsch[ru->idx]->cyclicShift,cyclic_shift,0..7*/0,
|
||||
3,//l,
|
||||
0,//interpolate,
|
||||
0 /*eNB->ulsch[ru->idx]->rnti rnti or ru->ulsch[eNB_id]->rnti*/);
|
||||
|
||||
check_sync_pos = lte_est_timing_advance_pusch((PHY_VARS_eNB *)NULL, ru->idx);
|
||||
if (ru->state == RU_CHECK_SYNC) {
|
||||
if ((check_sync_pos >= 0 && check_sync_pos<8) || (check_sync_pos < 0 && check_sync_pos>-8)) {
|
||||
LOG_I(PHY,"~~~~~~~~~~~ check_sync_pos %d, frame %d, cnt %d\n",check_sync_pos,proc->frame_rx,ru->wait_check);
|
||||
ru->wait_check++;
|
||||
}
|
||||
|
||||
if (ru->wait_check==20) {
|
||||
ru->state = RU_RUN;
|
||||
ru->wait_check = 0;
|
||||
// Send RRU_sync_ok
|
||||
rru_config_msg.type = RRU_sync_ok;
|
||||
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t); // TODO: set to correct msg len
|
||||
LOG_I(PHY,"Sending RRU_sync_ok to RAU\n");
|
||||
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),"Failed to send msg to RAU %d\n",ru->idx);
|
||||
//LOG_I(PHY,"~~~~~~~~~ RU_RUN\n");
|
||||
/*LOG_M("dmrs_time.m","dmrstime",calibration->drs_ch_estimates_time[0], (fp->ofdm_symbol_size),1,1);
|
||||
LOG_M("rxdataF_ext.m","rxdataFext",&calibration->rxdataF_ext[0][36*fp->N_RB_DL], 12*(fp->N_RB_DL),1,1);
|
||||
LOG_M("drs_seq0.m","drsseq0",ul_ref_sigs_rx[0][0][23],600,1,1);
|
||||
LOG_M("rxdata.m","rxdata",&ru->common.rxdata[0][0], fp->samples_per_tti*2,1,1);
|
||||
exit(-1);*/
|
||||
}
|
||||
} else if (ru->state == RU_RUN) {
|
||||
// check for synchronization error
|
||||
if (check_sync_pos >= 8 || check_sync_pos<=-8) {
|
||||
LOG_E(PHY,"~~~~~~~~~~~~~~ check_sync_pos %d, frame %d ---> LOST SYNC-EXIT\n", check_sync_pos, proc->frame_rx);
|
||||
LOG_M("rxdata.m","rxdata",&ru->common.rxdata[0][0], fp->samples_per_tti*2,1,1);
|
||||
exit(-1);
|
||||
}
|
||||
} else {
|
||||
AssertFatal(1==0,"Should not get here\n");
|
||||
}
|
||||
}
|
||||
|
||||
stop_meas(&ru->ofdm_demod_stats);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+ru->idx, 0 );
|
||||
}
|
||||
|
||||
|
||||
void fep_full(RU_t *ru,
|
||||
int subframe)
|
||||
{
|
||||
int l;
|
||||
LTE_DL_FRAME_PARMS *fp=&ru->frame_parms;
|
||||
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
|
||||
|
||||
if ((fp->frame_type == TDD) &&
|
||||
(subframe_select(fp,proc->subframe_rx) != SF_UL)) return;
|
||||
(subframe_select(fp,subframe) != SF_UL)) return;
|
||||
|
||||
start_meas(&ru->ofdm_demod_stats);
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+ru->idx, 1 );
|
||||
|
||||
remove_7_5_kHz(ru,proc->subframe_rx<<1);
|
||||
remove_7_5_kHz(ru,1+(proc->subframe_rx<<1));
|
||||
remove_7_5_kHz(ru,subframe<<1);
|
||||
remove_7_5_kHz(ru,1+(subframe<<1));
|
||||
|
||||
for (l=0; l<fp->symbols_per_tti/2; l++) {
|
||||
slot_fep_ul(ru,
|
||||
l,
|
||||
0,
|
||||
0
|
||||
);
|
||||
l,
|
||||
0,
|
||||
0);
|
||||
slot_fep_ul(ru,
|
||||
l,
|
||||
1,
|
||||
0
|
||||
);
|
||||
l,
|
||||
1,
|
||||
0);
|
||||
}
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+ru->idx, 0 );
|
||||
stop_meas(&ru->ofdm_demod_stats);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void do_prach_ru(RU_t *ru)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
|
||||
|
||||
// check if we have to detect PRACH first
|
||||
if (is_prach_subframe(fp,proc->frame_prach,proc->subframe_prach)>0) {
|
||||
//accept some delay in processing - up to 5ms
|
||||
int i;
|
||||
for (i = 0; i < 10 && proc->instance_cnt_prach == 0; i++) {
|
||||
LOG_W(PHY,"Frame %d Subframe %d, PRACH thread busy (IC %d)!!\n", proc->frame_prach,proc->subframe_prach,
|
||||
proc->instance_cnt_prach);
|
||||
usleep(500);
|
||||
}
|
||||
if (proc->instance_cnt_prach == 0) {
|
||||
exit_fun( "PRACH thread busy" );
|
||||
return;
|
||||
}
|
||||
|
||||
// wake up thread for PRACH RX
|
||||
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
|
||||
LOG_E( PHY, "ERROR pthread_mutex_lock for PRACH thread (IC %d)\n", proc->instance_cnt_prach );
|
||||
exit_fun( "error locking mutex_prach" );
|
||||
return;
|
||||
}
|
||||
|
||||
++proc->instance_cnt_prach;
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&proc->cond_prach) != 0) {
|
||||
LOG_E( PHY, "ERROR pthread_cond_signal for PRACH thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &proc->mutex_prach );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,12 +127,8 @@ void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,L1_rxtx_proc_t *proc);
|
||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||
@param br_flag indicator for eMTC PRACH
|
||||
*/
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void prach_procedures(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc,
|
||||
void prach_procedures(PHY_VARS_eNB *eNB,
|
||||
int br_flag);
|
||||
#else
|
||||
void prach_procedures(PHY_VARS_eNB *eNB);
|
||||
#endif
|
||||
|
||||
/*! \brief Function to compute timing of Msg3 transmission on UL-SCH (first UE transmission in RA procedure). This implements the timing in paragraph a) from Section 6.1.1 in 36.213 (p. 17 in version 8.6). Used by eNB upon transmission of random-access response (RA_RNTI) to program corresponding ULSCH reception procedure. Used by UE upon reception of random-access response (RA_RNTI) to program corresponding ULSCH transmission procedure. This does not support the UL_delay field in RAR (always assumed to be 0).
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@@ -197,7 +193,7 @@ int8_t find_ue_ulsch(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
|
||||
|
||||
void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc);
|
||||
|
||||
LTE_eNB_UE_stats* get_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti);
|
||||
LTE_eNB_UE_stats *get_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti);
|
||||
|
||||
/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index. Same as subframe_select, except that it uses the Mod_id and is provided as a service to the MAC scheduler.
|
||||
@param Mod_id Index of eNB
|
||||
|
||||
Reference in New Issue
Block a user