Commit 3fb221d3 authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'enhancement-10-harmony' of...

Merge branch 'enhancement-10-harmony' of https://gitlab.eurecom.fr/oai/openairinterface5g into enhancement-10-harmony
parents bba649ac fd70527b
......@@ -121,7 +121,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
//int32_t rx_total_gain_eNB_dB = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
int i;
LOG_D(PHY,"[eNB%d] CCid %d Frame %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc.frame_tx);
LOG_D(PHY,"[eNB%d] CCid %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id);
frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
LOG_D(PHY,"prach_config_common.rootSequenceIndex = %d\n",frame_parms->prach_config_common.rootSequenceIndex );
......@@ -388,7 +388,7 @@ void phy_config_sib13_eNB(uint8_t Mod_id,int CC_id,int mbsfn_Area_idx,
LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
LOG_I(PHY,"[eNB%d] Frame %d: Applying MBSFN_Area_id %d for index %d\n",Mod_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc.frame_tx,mbsfn_AreaId_r9,mbsfn_Area_idx);
LOG_I(PHY,"[eNB%d] Applying MBSFN_Area_id %d for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
if (mbsfn_Area_idx == 0) {
frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
......@@ -409,7 +409,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
physicalConfigDedicated = eNB->physicalConfigDedicated[UE_id];
if (physicalConfigDedicated != NULL) {
LOG_I(PHY,"[eNB %d] Frame %d: Sent physicalConfigDedicated=%p for UE %d\n",eNB->Mod_id, eNB->proc.frame_tx,physicalConfigDedicated,UE_id);
LOG_I(PHY,"[eNB %d] Frame %d: Sent physicalConfigDedicated=%p for UE %d\n",eNB->Mod_id,physicalConfigDedicated,UE_id);
LOG_D(PHY,"------------------------------------------------------------------------\n");
if (physicalConfigDedicated->pdsch_ConfigDedicated) {
......@@ -644,7 +644,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
int8_t UE_id = find_ue(rnti,eNB);
if (UE_id == -1) {
LOG_E( PHY, "[eNB %"PRIu8"] Frame %d: find_ue() returns -1\n", Mod_id, eNB->proc.frame_tx );
LOG_E( PHY, "[eNB %"PRIu8"] Frame %d: find_ue() returns -1\n", Mod_id);
return;
}
......@@ -653,7 +653,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
eNB->physicalConfigDedicated[UE_id] = physicalConfigDedicated;
LOG_I(PHY,"phy_config_dedicated_eNB: physicalConfigDedicated=%p\n",physicalConfigDedicated);
} else {
LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, eNB->proc.frame_tx,UE_id);
LOG_E(PHY,"[eNB %d] Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, UE_id);
return;
}
......
......@@ -7078,6 +7078,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
}
int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
void *dci_pdu,
uint16_t rnti,
DCI_format_t dci_format,
......@@ -7095,7 +7096,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
ANFBmode_t AckNackFBMode = eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode;
LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id];
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
int subframe = eNB->proc.subframe_tx;
int subframe = proc->subframe_tx;
uint32_t cqi_req = 0;
uint32_t dai = 0;
......@@ -7116,7 +7117,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
harq_pid = subframe2harq_pid(frame_parms,
pdcch_alloc2ul_frame(frame_parms,
eNB->proc.frame_tx,
proc->frame_tx,
subframe),
pdcch_alloc2ul_subframe(frame_parms,subframe));
......@@ -7637,7 +7638,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, subframe %d : Programming PUSCH with n_DMRS2 %d (cshift %d)\n",
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift);
eNB->Mod_id,harq_pid,proc->frame_tx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift);
......
......@@ -1416,7 +1416,8 @@ void rx_phich(PHY_VARS_UE *ue,
}
void generate_phich_top(PHY_VARS_eNB *eNB,
int16_t amp,
eNB_rxtx_proc_t *proc,
int16_t amp,
uint8_t sect_id,
uint8_t abstraction_flag)
{
......@@ -1431,7 +1432,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
uint8_t pusch_subframe;
uint8_t UE_id;
uint32_t pusch_frame;
int subframe = eNB->proc.subframe_tx;
int subframe = proc->subframe_tx;
// compute Ngroup_PHICH (see formula at beginning of Section 6.9 in 36-211
......@@ -1443,7 +1444,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
if (frame_parms->Ncp == 1)
NSF_PHICH = 2;
pusch_frame = phich_frame2_pusch_frame(frame_parms,eNB->proc.frame_tx,subframe);
pusch_frame = phich_frame2_pusch_frame(frame_parms,proc->frame_tx,subframe);
pusch_subframe = phich_subframe2_pusch_subframe(frame_parms,subframe);
harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe);
......@@ -1452,7 +1453,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
if (ulsch[UE_id]->harq_processes[harq_pid]->phich_active == 1) {
LOG_D(PHY,"[eNB][PUSCH %d/%x] Frame %d subframe %d (pusch_subframe %d,pusch_frame %d) phich active %d\n",
harq_pid,ulsch[UE_id]->rnti,eNB->proc.frame_tx,subframe,pusch_subframe,pusch_frame,ulsch[UE_id]->harq_processes[harq_pid]->phich_active);
harq_pid,ulsch[UE_id]->rnti,proc->frame_tx,subframe,pusch_subframe,pusch_frame,ulsch[UE_id]->harq_processes[harq_pid]->phich_active);
ngroup_PHICH = (ulsch[UE_id]->harq_processes[harq_pid]->first_rb +
ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%Ngroup_PHICH;
......@@ -1466,7 +1467,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
nseq_PHICH = ((ulsch[UE_id]->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) +
ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH);
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n",
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,
eNB->Mod_id,harq_pid,proc->frame_tx,
subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,
ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK,
ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
......@@ -1474,7 +1475,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
if (ulsch[UE_id]->Msg3_active == 1) {
LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n",
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe,
eNB->Mod_id,harq_pid,proc->frame_tx,subframe,
UE_id,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK,
ulsch[UE_id]->harq_processes[harq_pid]->first_rb);
}
......@@ -1504,7 +1505,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
(ulsch[UE_id]->harq_processes[harq_pid]->rar_alloc == 0) ) {
if (ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK==0 ) {
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d : PHICH NACK / (no format0 DCI) Setting subframe_scheduling_flag\n",
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe);
eNB->Mod_id,harq_pid,proc->frame_tx,subframe);
ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
ulsch[UE_id]->harq_processes[harq_pid]->rvidx = rv_table[ulsch[UE_id]->harq_processes[harq_pid]->round&3];
ulsch[UE_id]->harq_processes[harq_pid]->O_RI = 0;
......@@ -1514,7 +1515,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
} else {
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d PHICH ACK (no format0 DCI) Clearing subframe_scheduling_flag, setting round to 0\n",
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe);
eNB->Mod_id,harq_pid,proc->frame_tx,subframe);
ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
ulsch[UE_id]->harq_processes[harq_pid]->round=0;
}
......
......@@ -42,6 +42,7 @@
int generate_mbsfn_pilot(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
int32_t **txdataF,
int16_t amp)
......@@ -49,7 +50,7 @@ int generate_mbsfn_pilot(PHY_VARS_eNB *eNB,
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
uint32_t subframe_offset,Nsymb,samples_per_symbol;
int subframe = eNB->proc.subframe_tx;
int subframe = proc->subframe_tx;
if (subframe<0 || subframe>= 10) {
......
......@@ -286,11 +286,11 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *ue,int mcs,int ndi,int rvidx,int eNB_id)
}
}
void generate_mch(PHY_VARS_eNB *eNB,uint8_t *a,int abstraction_flag)
void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a,int abstraction_flag)
{
int G;
int subframe = eNB->proc.subframe_tx;
int subframe = proc->subframe_tx;
if (abstraction_flag != 0) {
if (eNB_transport_info_TB_index[eNB->Mod_id][eNB->CC_id]!=0)
......@@ -312,9 +312,9 @@ void generate_mch(PHY_VARS_eNB *eNB,uint8_t *a,int abstraction_flag)
eNB->frame_parms.N_RB_DL,
eNB->dlsch_MCH->harq_processes[0]->rb_alloc,
get_Qm(eNB->dlsch_MCH->harq_processes[0]->mcs),1,
2,eNB->proc.frame_tx,subframe);
2,proc->frame_tx,subframe);
generate_mbsfn_pilot(eNB,
generate_mbsfn_pilot(eNB,proc,
eNB->common_vars.txdataF[0],
AMP);
......@@ -323,7 +323,7 @@ void generate_mch(PHY_VARS_eNB *eNB,uint8_t *a,int abstraction_flag)
&eNB->frame_parms,
1,
eNB->dlsch_MCH,
eNB->proc.frame_tx,
proc->frame_tx,
subframe,
&eNB->dlsch_rate_matching_stats,
&eNB->dlsch_turbo_encoding_stats,
......
......@@ -568,7 +568,7 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
uint32_t ulsch_round_attempts[4]= {0,0,0,0},ulsch_round_errors[4]= {0,0,0,0};
uint32_t dlsch_round_attempts[4]= {0,0,0,0},dlsch_round_errors[4]= {0,0,0,0};
uint32_t UE_id_mac, RRC_status;
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
if (eNB==NULL)
return 0;
......@@ -583,7 +583,7 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
for (eNB_id=0; eNB_id<number_of_cards_l; eNB_id++) {
len += sprintf(&buffer[len],"eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n",
eNB_id,number_of_cards_l,
eNB->proc.frame_tx,
proc->frame_tx,
eNB->rx_total_gain_dB,
eNB->measurements[eNB_id].n0_power_tot_dBm,
eNB->measurements[eNB_id].n0_power_dB[0],
......@@ -621,9 +621,9 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),eNB->proc.frame_tx+1);
len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),proc->frame_tx+1);
len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000));
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,eNB->proc.frame_tx+1);
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,proc->frame_tx+1);
//len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions);
//len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions);
//len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,eNB->check_for_total_transmissions);
......
......@@ -232,10 +232,11 @@ int mch_modulation(int32_t **txdataF,
@param abstraction_flag
*/
void generate_mch(PHY_VARS_eNB *phy_vars_eNB,uint8_t *a,int abstraction_flag);
void generate_mch(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,uint8_t *a,int abstraction_flag);
/** \brief This function generates the frequency-domain pilots (cell-specific downlink reference signals)
@param phy_vars_eNB Pointer to eNB variables
@param proc Pointer to RXn-TXnp4 proc information
@param mcs MCS for MBSFN
@param ndi new data indicator
@param rdvix
......@@ -299,7 +300,8 @@ int32_t generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB,
int first_pilot_only);
int32_t generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB,
int32_t **txdataF,
eNB_rxtx_proc_t *proc,
int32_t **txdataF,
int16_t amp);
int32_t generate_pss(int32_t **txdataF,
......@@ -1408,6 +1410,7 @@ int32_t generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
double sinr_eff_cqi_calc(PHY_VARS_UE *phy_vars_ue,
uint8_t eNB_id);
int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB,
eNB_rxtx_proc_t *proc,
void *dci_pdu,
rnti_t rnti,
DCI_format_t dci_format,
......@@ -1419,7 +1422,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB,
uint8_t use_srs);
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNb,uint8_t UE_id);
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,uint8_t UE_id);
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
......@@ -1474,12 +1477,14 @@ void generate_RIV_tables(void);
int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode);
void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
uint8_t eNB_id, // this is the effective sector id
eNB_rxtx_proc_t *proc,
uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id,
LTE_eNB_ULSCH_t **ulsch,
uint8_t cooperation_flag);
void rx_ulsch_emul(PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc,
uint8_t sect_id,
uint8_t UE_index);
......@@ -1518,6 +1523,7 @@ int32_t ulsch_encoding_emul(uint8_t *ulsch_buffer,
/*!
\brief Decoding of PUSCH/ACK/RI/ACK from 36-212.
@param phy_vars_eNB Pointer to eNB top-level descriptor
@param proc Pointer to RXTX proc variables
@param UE_id ID of UE transmitting this PUSCH
@param subframe Index of subframe for PUSCH
@param control_only_flag Receive PUSCH with control information only
......@@ -1526,6 +1532,7 @@ int32_t ulsch_encoding_emul(uint8_t *ulsch_buffer,
@returns 0 on success
*/
unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc,
uint8_t UE_id,
uint8_t control_only_flag,
uint8_t Nbundled,
......@@ -1536,6 +1543,7 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB,
uint16_t *crnti);
void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc,
int16_t amp,
uint8_t sect_id,
uint8_t abstraction_flag);
......@@ -1663,6 +1671,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
uint8_t pucch1_thres);
int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc,
uint8_t UE_index,
PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel,
......
......@@ -1064,6 +1064,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
int32_t rx_pucch_emul(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
uint8_t UE_index,
PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel,
......@@ -1072,7 +1073,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *eNB,
{
uint8_t UE_id;
uint16_t rnti;
int subframe = eNB->proc.subframe_rx;
int subframe = proc->subframe_rx;
uint8_t CC_id = eNB->CC_id;
rnti = eNB->ulsch[UE_index]->rnti;
......@@ -1095,7 +1096,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *eNB,
payload[0] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[0];
payload[1] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[1];
} else
LOG_E(PHY,"[eNB] Frame %d: Can't handle formats 2/2a/2b\n",eNB->proc.frame_rx);
LOG_E(PHY,"[eNB] Frame %d: Can't handle formats 2/2a/2b\n",proc->frame_rx);
if (PHY_vars_UE_g[UE_id][CC_id]->pucch_sel[subframe] == n1_pucch_sel)
return(99);
......
......@@ -218,7 +218,7 @@ uint8_t extract_cqi_crc(uint8_t *cqi,uint8_t CQI_LENGTH)
unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
uint8_t UE_id,
uint8_t control_only_flag,
uint8_t Nbundled,
......@@ -259,7 +259,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
int16_t cseq[6*14*1200];
int off;
int status[20];
int subframe = eNB->proc.subframe_rx;
int subframe = proc->subframe_rx;
LTE_UL_eNB_HARQ_t *ulsch_harq;
uint8_t (*tc)(int16_t *y,
......@@ -278,7 +278,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
time_stats_t *,
time_stats_t *);
harq_pid = subframe2harq_pid(frame_parms,eNB->proc.frame_rx,subframe);
harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,1);
......@@ -1501,18 +1501,18 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
#endif
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB,
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc,
uint8_t UE_index,
uint16_t *crnti)
{
uint8_t UE_id;
uint16_t rnti;
int subframe = eNB->proc.subframe_rx;
int subframe = proc->subframe_rx;
uint8_t harq_pid;
uint8_t CC_id = eNB->CC_id;
harq_pid = subframe2harq_pid(&eNB->frame_parms,eNB->proc.frame_rx,subframe);
harq_pid = subframe2harq_pid(&eNB->frame_parms,proc->frame_rx,subframe);
rnti = eNB->ulsch[UE_index]->rnti;
#ifdef DEBUG_PHY
......
......@@ -1577,6 +1577,7 @@ int32_t avgU[2];
int32_t avgU_0[2],avgU_1[2]; // For the Distributed Alamouti Scheme
void rx_ulsch(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id,
LTE_eNB_ULSCH_t **ulsch,
......@@ -1602,9 +1603,9 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
uint8_t Qm;
uint16_t rx_power_correction;
int16_t *llrp;
int subframe = eNB->proc.subframe_rx;
int subframe = proc->subframe_rx;
harq_pid = subframe2harq_pid(frame_parms,eNB->proc.frame_rx,subframe);
harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
Qm = get_Qm_ul(ulsch[UE_id]->harq_processes[harq_pid]->mcs);
#ifdef DEBUG_ULSCH
msg("rx_ulsch: eNB_id %d, harq_pid %d, nb_rb %d first_rb %d, cooperation %d\n",eNB_id,harq_pid,ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
......@@ -1885,24 +1886,25 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
}
void rx_ulsch_emul(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
uint8_t sect_id,
uint8_t UE_index)
{
msg("[PHY] EMUL eNB %d rx_ulsch_emul : subframe %d, sect_id %d, UE_index %d\n",eNB->Mod_id,eNB->proc.subframe_rx,sect_id,UE_index);
msg("[PHY] EMUL eNB %d rx_ulsch_emul : subframe %d, sect_id %d, UE_index %d\n",eNB->Mod_id,proc->subframe_rx,sect_id,UE_index);
eNB->pusch_vars[UE_index]->ulsch_power[0] = 31622; //=45dB;
eNB->pusch_vars[UE_index]->ulsch_power[1] = 31622; //=45dB;
}
void dump_ulsch(PHY_VARS_eNB *eNB,uint8_t UE_id)
void dump_ulsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t UE_id)
{
uint32_t nsymb = (eNB->frame_parms.Ncp == 0) ? 14 : 12;
uint8_t harq_pid;
int subframe = eNB->proc.subframe_rx;
int subframe = proc->subframe_rx;
harq_pid = subframe2harq_pid(&eNB->frame_parms,eNB->proc.frame_rx,subframe);
harq_pid = subframe2harq_pid(&eNB->frame_parms,proc->frame_rx,subframe);
printf("Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, mcs %d, Qm %d, N_symb %d\n", subframe,harq_pid,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs,get_Qm_ul(eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs),
......
......@@ -183,7 +183,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
float time[FRAME_LENGTH_COMPLEX_SAMPLES];
float time2[2048];
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
int frame = phy_vars_enb->proc.frame_tx;
int frame = phy_vars_enb->proc.proc_rxtx[0].frame_tx;
uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate;
int coded_bits_per_codeword = 0;
uint8_t harq_pid; // in TDD config 3 it is sf-2, i.e., can be 0,1,2
......
......@@ -178,6 +178,34 @@ typedef struct ral_threshold_phy_s {
} ral_threshold_phy_t;
#endif
/// Context data structure for RX/TX portion of subframe processing
typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
int subframe_rx;
/// frame to act upon for transmission
int frame_tx;
/// frame to act upon for reception
int frame_rx;
/// \brief Instance count for RXn-TXnp4 processing thread.
/// \internal This variable is protected by \ref mutex_rxtx.
int instance_cnt_rxtx;
/// pthread structure for RXn-TXnp4 processing thread
pthread_t pthread_rxtx;
/// pthread attributes for RXn-TXnp4 processing thread
pthread_attr_t attr_rxtx;
/// condition variable for tx processing thread
pthread_cond_t cond_rxtx;
/// mutex for RXn-TXnp4 processing thread
pthread_mutex_t mutex_rxtx;
/// scheduling parameters for RXn-TXnp4 thread
struct sched_param sched_param_rxtx;
} eNB_rxtx_proc_t;
/// Context data structure for eNB subframe processing
typedef struct {
/// Component Carrier index
......@@ -186,54 +214,37 @@ typedef struct {
int thread_index;
/// timestamp received from HW
openair0_timestamp timestamp_rx;
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
int subframe_rx;
/// subframe to act upon for PRACH
int subframe_prach;
/// frame to act upon for transmission
int frame_tx;
/// frame to act upon for reception
int frame_rx;
/// frame to act upon for PRACH
int frame_prach;
/// \brief Instance count for tx processing thread.
/// \internal This variable is protected by \ref mutex_tx.
int instance_cnt_tx;
/// \brief Instance count for rx processing thread.
/// \internal This variable is protected by \ref mutex_prach.
int instance_cnt_prach;
/// pthread structure for tx processing thread
pthread_t pthread_tx;
/// pthread structure for rx processing thread
pthread_t pthread_rx;
/// flag to indicate first RX acquisition
int first_rx;
/// pthread attributes for tx processing thread
pthread_attr_t attr_tx;
/// pthread attributes for rx processing thread
pthread_attr_t attr_rx;
/// pthread attributes for prach processing thread
pthread_attr_t attr_prach;
/// scheduling parameters for tx thread
struct sched_param sched_param_tx;
/// scheduling parameters for rx thread
struct sched_param sched_param_rx;
/// scheduling parameters for prach thread
struct sched_param sched_param_prach;
/// condition variable for tx processing thread
pthread_t pthread_prach;
/// condition variable for prach processing thread
pthread_cond_t cond_tx;
pthread_t pthread_prach;
/// condition variable for rx processing thread;
pthread_cond_t cond_prach;
/// mutex for tx processing thread
pthread_mutex_t mutex_tx;
/// mutex for tx processing thread
pthread_mutex_t mutex_prach;
/// set of scheduling variables RXn-TXnp4 threads
eNB_rxtx_proc_t proc_rxtx[2];
} eNB_proc_t;
//! \brief Number of eNB TX and RX threads.
......
......@@ -226,17 +226,19 @@ void phy_procedures_UE_S_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abst
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
@param phy_vars_rn pointer to the RN variables
*/
void phy_procedures_eNB_TX(PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
void phy_procedures_eNB_TX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,uint8_t abstraction_flag,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
/*! \brief Scheduling for eNB RX UE-specific procedures in normal subframes.
@param phy_vars_eNB Pointer to eNB variables on which to act
@param proc Pointer to RXn-TXnp4 proc information
@param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type);
void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,uint8_t abstraction_flag,relaying_type_t r_type);
/*! \brief Scheduling for eNB TX procedures in TDD S-subframes.
@param phy_vars_eNB Pointer to eNB variables on which to act
@param proc Pointer to RXn-TXnp4 proc information
@param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
......@@ -260,10 +262,11 @@ void phy_procedures_eNB_S_TX(PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag
@param abstraction_flag Indicator of PHY abstraction
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
*/
void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type);
void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,uint8_t abstraction_flag,relaying_type_t r_type);
/*! \brief Scheduling for eNB PRACH RX procedures
@param phy_vars_eNB Pointer to eNB variables on which to act
@param proc Pointer to RXn-TXnp4 proc information
@param abstraction_flag Indicator of PHY abstraction
*/
void prach_procedures(PHY_VARS_eNB *eNB,uint8_t abstraction_flag);
......@@ -393,10 +396,11 @@ uint8_t is_SR_TXOp(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
@param UE_id ID of UE which may be issuing the SR
@returns 1 if TXOp is active.
*/
uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id);
uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,uint8_t UE_id);
/*! \brief Gives the UL subframe corresponding to a PDDCH order in subframe n
@param frame_parms Pointer to DL frame parameters
@param proc Pointer to RXn-TXnp4 proc information
@param n subframe of PDCCH
@returns UL subframe corresponding to pdcch order
*/
......@@ -447,7 +451,8 @@ uint16_t get_n1_pucch(PHY_VARS_UE *phy_vars_ue,
/*! \brief This function retrives the resource (n1_pucch) corresponding to a PDSCH transmission in
subframe n-4 which is acknowledged in subframe n (for FDD) according to n1_pucch = Ncce + N1_pucch. For
TDD, this routine computes the procedure described in Section 10.1 of 36.213 (through tables 10.1-1,10.1-2)
@param phy_vars_eNB Pointer to UE variables
@param phy_vars_eNB Pointer to eNB variables
@param proc Pointer to RXn-TXnp4 proc information
@param eNB_id Index of eNB
@param subframe Index of subframe
@param b Pointer to PUCCH payload (b[0],b[1])
......@@ -457,6 +462,7 @@ TDD, this routine computes the procedure described in Section 10.1 of 36.213 (th
@param n1_pucch3 Pointer to n1_pucch3
*/
void get_n1_pucch_eNB(PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc,
uint8_t UE_id,
int16_t *n1_pucch0,
int16_t *n1_pucch1,
......@@ -467,6 +473,7 @@ void get_n1_pucch_eNB(PHY_VARS_eNB *phy_vars_eNB,
/*! \brief This function retrieves the harq_pid of the corresponding DLSCH process and updates the error statistics of the DLSCH based on the received ACK info from UE along with the round index. It also performs the fine-grain rate-adaptation based on the error statistics derived from the ACK/NAK process.
@param UE_id Local UE index on which to act
@param phy_vars_eNB Pointer to eNB variables on which to act
@param proc Pointer to RXn-TXnp4 proc information
@param pusch_flag Indication that feedback came from PUSCH
@param pucch_payload Resulting payload from pucch
@param pucch_sel Selection of n1_pucch0 or n1_pucch1 (TDD specific)
......@@ -474,6 +481,7 @@ void get_n1_pucch_eNB(PHY_VARS_eNB *phy_vars_eNB,
*/
void process_HARQ_feedback(uint8_t UE_id,
PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc,
uint8_t pusch_flag,
uint8_t *pucch_payload,
uint8_t pucch_sel,
......
This diff is collapsed.
This diff is collapsed.
......@@ -786,7 +786,7 @@ rrc_get_estimated_ue_distance(
const int CC_idP,
const uint8_t loc_typeP);
void fill_dci(DCI_PDU *DCI_pdu, PHY_VARS_eNB *phy_vars_eNB);
void fill_dci(DCI_PDU *DCI_pdu, PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc);
#endif
/** @}*/
......@@ -183,26 +183,10 @@ const char* eurecomFunctionsNames[] = {
"rt_sleep",
"trx_read",
"trx_write",
"eNB_thread_tx0",
"eNB_thread_rx0",
"eNB_thread_tx1",
"eNB_thread_rx1",
"eNB_thread_tx2",
"eNB_thread_rx2",
"eNB_thread_tx3",
"eNB_thread_rx3",
"eNB_thread_tx4",
"eNB_thread_rx4",
"eNB_thread_tx5",
"eNB_thread_rx5",
"eNB_thread_tx6",
"eNB_thread_rx6",
"eNB_thread_tx7",
"eNB_thread_rx7",
"eNB_thread_tx8",
"eNB_thread_rx8",
"eNB_thread_tx9",
"eNB_thread_rx9",
"eNB_thread_rxtx0",
"eNB_thread_rxtx1",
"eNB_thread_rx",
"eNB_thread_prach",
"ue_thread_tx",
"ue_thread_rx",
......
......@@ -157,26 +157,10 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_RT_SLEEP=0,
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ,
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX0,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX1,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX1,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX2,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX2,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX3,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX3,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX4,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX4,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX5,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX5,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX6,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX6,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX7,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX7,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX8,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX8,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX9,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX9,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX1,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_PRACH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_TX,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RX,
......
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