Commit e198a742 authored by knopp's avatar knopp

updated unitary simulations and corrected bugs in threading and scheduling of L1 procedures.

parent 2b6c7a52
......@@ -31,7 +31,7 @@
#include "PHY/defs.h"
#ifdef OPENAIR_LTE
#include "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
......@@ -41,18 +41,6 @@
#ifdef Rel10
#include "SCellToAddMod-r10.h"
#endif
#else
/**
\fn int phy_init(unsigned char nb_antennas_tx)
\brief Allocate and Initialize the PHY variables after receiving static configuration
@param nb_antennas_tx Number of TX antennas
*/
int phy_init(unsigned char nb_antennas_tx);
#endif
#ifdef OPENAIR_LTE
/** @addtogroup _PHY_STRUCTURES_
* @{
*/
......@@ -325,17 +313,28 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
int CC_id);
#endif
#endif
/*! !\fn void phy_cleanup(void)
\brief Cleanup the PHY variables*/
void phy_cleanup(void);
#ifdef OPENAIR_LTE
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
#endif
void lte_param_init(unsigned char N_tx,
unsigned char N_rx,
unsigned char transmission_mode,
uint8_t extended_prefix_flag,
frame_t frame_type,
uint16_t Nid_cell,
uint8_t tdd_config,
uint8_t N_RB_DL,
uint8_t threequarter_fs,
uint8_t osf,
uint32_t perfect_ce);
/** @} */
#endif
......
......@@ -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[0].frame_tx);
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);
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[0].frame_tx,mbsfn_AreaId_r9,mbsfn_Area_idx);
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);
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[0].frame_tx,physicalConfigDedicated,UE_id);
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_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[0].frame_tx );
LOG_E( PHY, "[eNB %"PRIu8"] Frame %d: find_ue() returns -1\n", Mod_id, eNB->proc.frame_tx );
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[0].frame_tx,UE_id);
LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, eNB->proc.frame_tx,UE_id);
return;
}
......
......@@ -9,8 +9,8 @@
#include "PHY/defs.h"
#include "PHY/extern.h"
extern PHY_VARS_eNB *PHY_vars_eNB;
extern PHY_VARS_UE *PHY_vars_UE;
extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE;
void lte_param_init(unsigned char N_tx,
unsigned char N_rx,
......@@ -30,8 +30,8 @@ void lte_param_init(unsigned char N_tx,
printf("Start lte_param_init\n");
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
eNB = malloc(sizeof(PHY_VARS_eNB));
UE = malloc(sizeof(PHY_VARS_UE));
//PHY_config = malloc(sizeof(PHY_CONFIG));
mac_xface = malloc(sizeof(MAC_xface));
......@@ -39,7 +39,7 @@ void lte_param_init(unsigned char N_tx,
randominit(0);
set_taus_seed(0);
frame_parms = &(PHY_vars_eNB->frame_parms);
frame_parms = &(eNB->frame_parms);
frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
frame_parms->N_RB_UL = N_RB_DL;
......@@ -66,40 +66,40 @@ void lte_param_init(unsigned char N_tx,
// phy_init_top(frame_parms); //allocation
PHY_vars_UE->is_secondary_ue = 0;
PHY_vars_UE->frame_parms = *frame_parms;
PHY_vars_eNB->frame_parms = *frame_parms;
UE->is_secondary_ue = 0;
UE->frame_parms = *frame_parms;
eNB->frame_parms = *frame_parms;
phy_init_lte_top(frame_parms);
dump_frame_parms(frame_parms);
PHY_vars_UE->measurements.n_adj_cells=0;
PHY_vars_UE->measurements.adj_cell_id[0] = Nid_cell+1;
PHY_vars_UE->measurements.adj_cell_id[1] = Nid_cell+2;
UE->measurements.n_adj_cells=0;
UE->measurements.adj_cell_id[0] = Nid_cell+1;
UE->measurements.adj_cell_id[1] = Nid_cell+2;
for (i=0; i<3; i++)
lte_gold(frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
lte_gold(frame_parms,UE->lte_gold_table[i],Nid_cell+i);
phy_init_lte_ue(PHY_vars_UE,1,0);
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
phy_init_lte_ue(UE,1,0);
phy_init_lte_eNB(eNB,0,0,0);
generate_pcfich_reg_mapping(&PHY_vars_UE->frame_parms);
generate_phich_reg_mapping(&PHY_vars_UE->frame_parms);
generate_pcfich_reg_mapping(&UE->frame_parms);
generate_phich_reg_mapping(&UE->frame_parms);
// DL power control init
if (transmission_mode == 1) {
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_eNB->frame_parms).pdsch_config_common).p_b = 0;
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_UE->frame_parms).pdsch_config_common).p_b = 0;
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((eNB->frame_parms).pdsch_config_common).p_b = 0;
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((UE->frame_parms).pdsch_config_common).p_b = 0;
} else { // rho_a = rhob
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_eNB->frame_parms).pdsch_config_common).p_b = 1;
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_UE->frame_parms).pdsch_config_common).p_b = 1;
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((eNB->frame_parms).pdsch_config_common).p_b = 1;
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((UE->frame_parms).pdsch_config_common).p_b = 1;
}
PHY_vars_UE->perfect_ce = perfect_ce;
UE->perfect_ce = perfect_ce;
printf("Done lte_param_init\n");
......
......@@ -219,7 +219,6 @@ void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue,
int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
module_id_t eNB_id,
module_id_t UE_id,
uint8_t subframe,
uint8_t l,
uint8_t Ns,
uint8_t cooperation_flag);
......@@ -242,7 +241,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
unsigned char number_of_cards,
short coef);
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id,uint8_t subframe);
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id);
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
int subframe,
......
......@@ -195,7 +195,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
}
int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id,uint8_t thread_id)
int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id)
{
static int first_run=1;
static int max_pos_fil2=0;
......@@ -236,7 +236,7 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id,uint8_t thread_
max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15;
#ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc[thread_id].frame_rx,max_pos,max_pos_fil2,sync_pos);
LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc.frame_rx,max_pos,max_pos_fil2,sync_pos);
#endif //DEBUG_PHY
return(max_pos_fil2-sync_pos);
......
......@@ -55,7 +55,6 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
uint8_t eNB_id,
uint8_t UE_id,
uint8_t thread_id,
unsigned char l,
unsigned char Ns,
uint8_t cooperation_flag)
......@@ -68,8 +67,8 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
int32_t **ul_ch_estimates_0= pusch_vars->drs_ch_estimates_0[eNB_id];
int32_t **ul_ch_estimates_1= pusch_vars->drs_ch_estimates_1[eNB_id];
int32_t **rxdataF_ext= pusch_vars->rxdataF_ext[eNB_id];
int subframe = eNB->proc[thread_id].subframe_rx;
uint8_t harq_pid = subframe2harq_pid(frame_parms,eNB->proc[thread_id].frame_rx,subframe);
int subframe = eNB->proc.subframe_rx;
uint8_t harq_pid = subframe2harq_pid(frame_parms,eNB->proc.frame_rx,subframe);
int16_t delta_phase = 0;
int16_t *ru1 = ru_90;
int16_t *ru2 = ru_90;
......
......@@ -2,7 +2,7 @@
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
OpenAirInterface is free software: you can redistrirbute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
......@@ -7077,12 +7077,11 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
}
int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
void *dci_pdu,
uint16_t rnti,
uint8_t thread_id,
DCI_format_t dci_format,
uint8_t UE_id,
PHY_VARS_eNB *eNB,
uint16_t si_rnti,
uint16_t ra_rnti,
uint16_t p_rnti,
......@@ -7096,7 +7095,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
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[thread_id].subframe_tx;
int subframe = eNB->proc.subframe_tx;
uint32_t cqi_req = 0;
uint32_t dai = 0;
......@@ -7117,11 +7116,10 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
harq_pid = subframe2harq_pid(frame_parms,
pdcch_alloc2ul_frame(frame_parms,
eNB->proc[thread_id].frame_tx,
eNB->proc.frame_tx,
subframe),
pdcch_alloc2ul_subframe(frame_parms,subframe));
// printf("eNB: thread_id %d, subframe %d, frame_tx %d\n",thread_id,subframe,eNB->proc[thread_id].frame_tx);
switch (frame_parms->N_RB_DL) {
case 6:
......@@ -7639,7 +7637,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
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[thread_id].frame_tx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift);
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift);
......
......@@ -1416,7 +1416,6 @@ void rx_phich(PHY_VARS_UE *ue,
}
void generate_phich_top(PHY_VARS_eNB *eNB,
unsigned char thread_id,
int16_t amp,
uint8_t sect_id,
uint8_t abstraction_flag)
......@@ -1432,7 +1431,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[thread_id].subframe_tx;
int subframe = eNB->proc.subframe_tx;
// compute Ngroup_PHICH (see formula at beginning of Section 6.9 in 36-211
......@@ -1444,7 +1443,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[thread_id].frame_tx,subframe);
pusch_frame = phich_frame2_pusch_frame(frame_parms,eNB->proc.frame_tx,subframe);
pusch_subframe = phich_subframe2_pusch_subframe(frame_parms,subframe);
harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe);
......@@ -1453,7 +1452,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[thread_id].frame_tx,subframe,pusch_subframe,pusch_frame,ulsch[UE_id]->harq_processes[harq_pid]->phich_active);
harq_pid,ulsch[UE_id]->rnti,eNB->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;
......@@ -1467,7 +1466,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[thread_id].frame_tx,
eNB->Mod_id,harq_pid,eNB->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,
......@@ -1475,7 +1474,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[thread_id].frame_tx,subframe,
eNB->Mod_id,harq_pid,eNB->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);
}
......@@ -1505,7 +1504,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[thread_id].frame_tx,subframe);
eNB->Mod_id,harq_pid,eNB->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;
......@@ -1515,7 +1514,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[thread_id].frame_tx,subframe);
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe);
ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
ulsch[UE_id]->harq_processes[harq_pid]->round=0;
}
......
......@@ -43,13 +43,13 @@
int generate_mbsfn_pilot(PHY_VARS_eNB *eNB,
int32_t **txdataF,
int16_t amp,
uint16_t subframe)
int16_t amp)
{
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
uint32_t subframe_offset,Nsymb,samples_per_symbol;
int subframe = eNB->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,int thread_id,uint8_t *a,int abstraction_flag)
void generate_mch(PHY_VARS_eNB *eNB,uint8_t *a,int abstraction_flag)
{
int G;
int subframe = eNB->proc[thread_id].subframe_tx;
int subframe = eNB->proc.subframe_tx;
if (abstraction_flag != 0) {
if (eNB_transport_info_TB_index[eNB->Mod_id][eNB->CC_id]!=0)
......@@ -312,18 +312,18 @@ void generate_mch(PHY_VARS_eNB *eNB,int thread_id,uint8_t *a,int abstraction_fla
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[thread_id].frame_tx,subframe);
2,eNB->proc.frame_tx,subframe);
generate_mbsfn_pilot(eNB,
eNB->common_vars.txdataF[0],
AMP,
subframe);
AMP);
if (dlsch_encoding(a,
&eNB->frame_parms,
1,
eNB->dlsch_MCH,
eNB->proc[thread_id].frame_tx,
eNB->proc.frame_tx,
subframe,
&eNB->dlsch_rate_matching_stats,
&eNB->dlsch_turbo_encoding_stats,
......
......@@ -1056,7 +1056,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
//__m128i mmtmpX0,mmtmpX1,mmtmpX2,mmtmpX3;
void rx_prach(PHY_VARS_eNB *eNB,
uint8_t subframe,
uint16_t *preamble_energy_list,
uint16_t *preamble_delay_list,
uint16_t Nf,
......@@ -1065,7 +1064,7 @@ void rx_prach(PHY_VARS_eNB *eNB,
int i;
lte_frame_type_t frame_type = eNB->frame_parms.frame_type;
int subframe = eNB->proc.subframe_rx;
uint16_t rootSequenceIndex = eNB->frame_parms.prach_config_common.rootSequenceIndex;
uint8_t prach_ConfigIndex = eNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
uint8_t Ncs_config = eNB->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
......
......@@ -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[0].frame_tx,
eNB->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[0].frame_tx+1);
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 throughput %d kbps ",(eNB->total_dlsch_bitrate/1000));
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,eNB->proc[0].frame_tx+1);
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,eNB->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);
......
......@@ -228,12 +228,11 @@ int mch_modulation(int32_t **txdataF,
/** \brief Top-level generation function for eNB TX of MBSFN
@param phy_vars_eNB Pointer to eNB variables
@param subframe Subframe for PMCH
@param a Pointer to transport block
@param abstraction_flag
*/
void generate_mch(PHY_VARS_eNB *phy_vars_eNB,int subframe,uint8_t *a,int abstraction_flag);
void generate_mch(PHY_VARS_eNB *phy_vars_eNB,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
......@@ -301,8 +300,7 @@ int32_t generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB,
int32_t generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB,
int32_t **txdataF,
int16_t amp,
uint16_t subframe);
int16_t amp);
int32_t generate_pss(int32_t **txdataF,
int16_t amp,
......@@ -1409,27 +1407,26 @@ int32_t generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
uint8_t eNB_id);
double sinr_eff_cqi_calc(PHY_VARS_UE *phy_vars_ue,
uint8_t eNB_id);
int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB,
void *dci_pdu,
rnti_t rnti,
uint8_t subframe,
DCI_format_t dci_format,
DCI_format_t dci_format,
uint8_t UE_id,
PHY_VARS_eNB *PHY_vars_eNB,
uint16_t si_rnti,
uint16_t si_rnti,
uint16_t ra_rnti,
uint16_t p_rnti,
uint16_t cba_rnti,
uint8_t use_srs);
#ifdef USER_MODE
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNb,uint8_t subframe, uint8_t UE_id);
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNb,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);
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round);
#endif
int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci);
......@@ -1477,14 +1474,12 @@ 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,
uint32_t subframe,
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,
uint8_t subframe,
uint8_t sect_id,
uint8_t UE_index);
......@@ -1532,18 +1527,15 @@ int32_t ulsch_encoding_emul(uint8_t *ulsch_buffer,
*/
unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
uint8_t UE_id,
uint8_t subframe,
uint8_t control_only_flag,
uint8_t Nbundled,
uint8_t llr8_flag);
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t subframe,
uint8_t UE_index,
uint16_t *crnti);
void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
uint8_t subframe,
int16_t amp,
uint8_t sect_id,
uint8_t abstraction_flag);
......@@ -1671,11 +1663,11 @@ 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,
uint8_t UE_index,
PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel,
uint8_t *payload,
uint8_t subframe);
uint8_t UE_index,
PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel,
uint8_t *payload);
/*!
......@@ -1702,7 +1694,6 @@ int32_t generate_prach(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,
/*!
\brief Process PRACH waveform
@param phy_vars_eNB Pointer to eNB top-level descriptor
@param subframe subframe index to operate on
@param preamble_energy_list List of energies for each candidate preamble
@param preamble_delay_list List of delays for each candidate preamble
@param Nf System frame number
......@@ -1710,7 +1701,7 @@ int32_t generate_prach(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,
@returns 0 on success
*/
void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_energy_list, uint16_t *preamble_delay_list, uint16_t Nf, uint8_t tdd_mapindex);
void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint16_t *preamble_energy_list, uint16_t *preamble_delay_list, uint16_t Nf, uint8_t tdd_mapindex);
/*!
\brief Helper for MAC, returns number of available PRACH in TDD for a particular configuration index
......
......@@ -1067,12 +1067,12 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *eNB,
uint8_t UE_index,
PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel,
uint8_t *payload,
uint8_t thread_id)
uint8_t *payload)
{
uint8_t UE_id;
uint16_t rnti;
int subframe = eNB->proc[thread_id].subframe_rx;
int subframe = eNB->proc.subframe_rx;
uint8_t CC_id = eNB->CC_id;
rnti = eNB->ulsch[UE_index]->rnti;
......@@ -1095,7 +1095,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[thread_id].frame_rx);
LOG_E(PHY,"[eNB] Frame %d: Can't handle formats 2/2a/2b\n",eNB->proc.frame_rx);
if (PHY_vars_UE_g[UE_id][CC_id]->pucch_sel[subframe] == n1_pucch_sel)
return(99);
......
......@@ -70,35 +70,35 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch)
if (ulsch) {
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch %p\n",ulsch);
printf("Freeing ulsch %p\n",ulsch);
#endif
for (i=0; i<8; i++) {
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch process %d\n",i);
printf("Freeing ulsch process %d\n",i);
#endif
if (ulsch->harq_processes[i]) {
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch process %d (%p)\n",i,ulsch->harq_processes[i]);
printf("Freeing ulsch process %d (%p)\n",i,ulsch->harq_processes[i]);
#endif
if (ulsch->harq_processes[i]->b) {
free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES);
ulsch->harq_processes[i]->b = NULL;
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch process %d b (%p)\n",i,ulsch->harq_processes[i]->b);
printf("Freeing ulsch process %d b (%p)\n",i,ulsch->harq_processes[i]->b);
#endif
}
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch process %d c (%p)\n",i,ulsch->harq_processes[i]->c);
printf("Freeing ulsch process %d c (%p)\n",i,ulsch->harq_processes[i]->c);
#endif
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch process %d c[%d] (%p)\n",i,r,ulsch->harq_processes[i]->c[r]);
printf("Freeing ulsch process %d c[%d] (%p)\n",i,r,ulsch->harq_processes[i]->c[r]);
#endif
if (ulsch->harq_processes[i]->c[r]) {
......@@ -302,7 +302,7 @@ uint32_t ulsch_encoding(uint8_t *a,
ulsch->harq_processes[harq_pid]->control_only = 0;
#ifdef DEBUG_ULSCH_CODING
msg("[PHY][UE] ULSCH coding : A %d, Qm %d, mcs %d, harq_pid %d, round %d, RV %d\n",
printf("[PHY][UE] ULSCH coding : A %d, Qm %d, mcs %d, harq_pid %d, round %d, RV %d\n",
ulsch->harq_processes[harq_pid]->TBS,
Q_m,
ulsch->harq_processes[harq_pid]->mcs,
......@@ -311,16 +311,16 @@ uint32_t ulsch_encoding(uint8_t *a,
ulsch->harq_processes[harq_pid]->rvidx);
for (i=0; i<ulsch->harq_processes[harq_pid]->O_ACK; i++)
msg("ulsch_coding: o_ACK[%d] %d\n",i,ulsch->o_ACK[i]);
printf("ulsch_coding: o_ACK[%d] %d\n",i,ulsch->o_ACK[i]);
for (i=0; i<ulsch->O_RI; i++)
msg("ulsch_coding: o_RI[%d] %d\n",i,ulsch->o_RI[i]);
printf("ulsch_coding: o_RI[%d] %d\n",i,ulsch->o_RI[i]);
msg("ulsch_coding: O=%d\n",ulsch->O);
printf("ulsch_coding: O=%d\n",ulsch->O);
for (i=0; i<1+((8+ulsch->O)/8); i++) {
// ulsch->o[i] = i;
msg("ulsch_coding: O[%d] %d\n",i,ulsch->o[i]);
printf("ulsch_coding: O[%d] %d\n",i,ulsch->o[i]);
}
if ((tmode != 4))
......@@ -380,20 +380,20 @@ uint32_t ulsch_encoding(uint8_t *a,
#ifdef DEBUG_ULSCH_CODING
msg("Generating Code Segment %d (%d bits)\n",r,Kr);
printf("Generating Code Segment %d (%d bits)\n",r,Kr);
// generate codewords
msg("bits_per_codeword (Kr)= %d\n",Kr);
msg("N_RB = %d\n",ulsch->harq_processes[harq_pid]->nb_rb);
msg("Ncp %d\n",frame_parms->Ncp);
msg("Qm %d\n",Q_m);
printf("bits_per_codeword (Kr)= %d\n",Kr);
printf("N_RB = %d\n