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 @@ ...@@ -31,7 +31,7 @@
#include "PHY/defs.h" #include "PHY/defs.h"
#ifdef OPENAIR_LTE
#include "SystemInformationBlockType2.h" #include "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h" //#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h" #include "RadioResourceConfigDedicated.h"
...@@ -41,18 +41,6 @@ ...@@ -41,18 +41,6 @@
#ifdef Rel10 #ifdef Rel10
#include "SCellToAddMod-r10.h" #include "SCellToAddMod-r10.h"
#endif #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_ /** @addtogroup _PHY_STRUCTURES_
* @{ * @{
*/ */
...@@ -325,17 +313,28 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id, ...@@ -325,17 +313,28 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
int CC_id); int CC_id);
#endif #endif
#endif
/*! !\fn void phy_cleanup(void) /*! !\fn void phy_cleanup(void)
\brief Cleanup the PHY variables*/ \brief Cleanup the PHY variables*/
void phy_cleanup(void); void phy_cleanup(void);
#ifdef OPENAIR_LTE
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf); int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms); 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 #endif
......
...@@ -121,7 +121,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id, ...@@ -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; //int32_t rx_total_gain_eNB_dB = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
int i; 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; 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 ); 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, ...@@ -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; 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) { if (mbsfn_Area_idx == 0) {
frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9; frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
...@@ -409,7 +409,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB) ...@@ -409,7 +409,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
physicalConfigDedicated = eNB->physicalConfigDedicated[UE_id]; physicalConfigDedicated = eNB->physicalConfigDedicated[UE_id];
if (physicalConfigDedicated != NULL) { 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"); LOG_D(PHY,"------------------------------------------------------------------------\n");
if (physicalConfigDedicated->pdsch_ConfigDedicated) { if (physicalConfigDedicated->pdsch_ConfigDedicated) {
...@@ -644,7 +644,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id, ...@@ -644,7 +644,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
int8_t UE_id = find_ue(rnti,eNB); int8_t UE_id = find_ue(rnti,eNB);
if (UE_id == -1) { 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; return;
} }
...@@ -653,7 +653,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id, ...@@ -653,7 +653,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
eNB->physicalConfigDedicated[UE_id] = physicalConfigDedicated; eNB->physicalConfigDedicated[UE_id] = physicalConfigDedicated;
LOG_I(PHY,"phy_config_dedicated_eNB: physicalConfigDedicated=%p\n",physicalConfigDedicated); LOG_I(PHY,"phy_config_dedicated_eNB: physicalConfigDedicated=%p\n",physicalConfigDedicated);
} else { } 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; return;
} }
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#include "PHY/defs.h" #include "PHY/defs.h"
#include "PHY/extern.h" #include "PHY/extern.h"
extern PHY_VARS_eNB *PHY_vars_eNB; extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *PHY_vars_UE; extern PHY_VARS_UE *UE;
void lte_param_init(unsigned char N_tx, void lte_param_init(unsigned char N_tx,
unsigned char N_rx, unsigned char N_rx,
...@@ -30,8 +30,8 @@ void lte_param_init(unsigned char N_tx, ...@@ -30,8 +30,8 @@ void lte_param_init(unsigned char N_tx,
printf("Start lte_param_init\n"); printf("Start lte_param_init\n");
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB)); eNB = malloc(sizeof(PHY_VARS_eNB));
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); UE = malloc(sizeof(PHY_VARS_UE));
//PHY_config = malloc(sizeof(PHY_CONFIG)); //PHY_config = malloc(sizeof(PHY_CONFIG));
mac_xface = malloc(sizeof(MAC_xface)); mac_xface = malloc(sizeof(MAC_xface));
...@@ -39,7 +39,7 @@ void lte_param_init(unsigned char N_tx, ...@@ -39,7 +39,7 @@ void lte_param_init(unsigned char N_tx,
randominit(0); randominit(0);
set_taus_seed(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_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
frame_parms->N_RB_UL = N_RB_DL; frame_parms->N_RB_UL = N_RB_DL;
...@@ -66,40 +66,40 @@ void lte_param_init(unsigned char N_tx, ...@@ -66,40 +66,40 @@ void lte_param_init(unsigned char N_tx,
// phy_init_top(frame_parms); //allocation // phy_init_top(frame_parms); //allocation
PHY_vars_UE->is_secondary_ue = 0; UE->is_secondary_ue = 0;
PHY_vars_UE->frame_parms = *frame_parms; UE->frame_parms = *frame_parms;
PHY_vars_eNB->frame_parms = *frame_parms; eNB->frame_parms = *frame_parms;
phy_init_lte_top(frame_parms); phy_init_lte_top(frame_parms);
dump_frame_parms(frame_parms); dump_frame_parms(frame_parms);
PHY_vars_UE->measurements.n_adj_cells=0; UE->measurements.n_adj_cells=0;
PHY_vars_UE->measurements.adj_cell_id[0] = Nid_cell+1; UE->measurements.adj_cell_id[0] = Nid_cell+1;
PHY_vars_UE->measurements.adj_cell_id[1] = Nid_cell+2; UE->measurements.adj_cell_id[1] = Nid_cell+2;
for (i=0; i<3; i++) 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_ue(UE,1,0);
phy_init_lte_eNB(PHY_vars_eNB,0,0,0); phy_init_lte_eNB(eNB,0,0,0);
generate_pcfich_reg_mapping(&PHY_vars_UE->frame_parms); generate_pcfich_reg_mapping(&UE->frame_parms);
generate_phich_reg_mapping(&PHY_vars_UE->frame_parms); generate_phich_reg_mapping(&UE->frame_parms);
// DL power control init // DL power control init
if (transmission_mode == 1) { if (transmission_mode == 1) {
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_eNB->frame_parms).pdsch_config_common).p_b = 0; ((eNB->frame_parms).pdsch_config_common).p_b = 0;
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_UE->frame_parms).pdsch_config_common).p_b = 0; ((UE->frame_parms).pdsch_config_common).p_b = 0;
} else { // rho_a = rhob } else { // rho_a = rhob
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_eNB->frame_parms).pdsch_config_common).p_b = 1; ((eNB->frame_parms).pdsch_config_common).p_b = 1;
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_UE->frame_parms).pdsch_config_common).p_b = 1; ((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"); printf("Done lte_param_init\n");
......
...@@ -219,7 +219,6 @@ void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, ...@@ -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, int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
module_id_t eNB_id, module_id_t eNB_id,
module_id_t UE_id, module_id_t UE_id,
uint8_t subframe,
uint8_t l, uint8_t l,
uint8_t Ns, uint8_t Ns,
uint8_t cooperation_flag); uint8_t cooperation_flag);
...@@ -242,7 +241,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -242,7 +241,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
unsigned char number_of_cards, unsigned char number_of_cards,
short coef); 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, void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
int subframe, int subframe,
......
...@@ -195,7 +195,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -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 first_run=1;
static int max_pos_fil2=0; 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_ ...@@ -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; max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15;
#ifdef DEBUG_PHY #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 #endif //DEBUG_PHY
return(max_pos_fil2-sync_pos); 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 ...@@ -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, int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
uint8_t eNB_id, uint8_t eNB_id,
uint8_t UE_id, uint8_t UE_id,
uint8_t thread_id,
unsigned char l, unsigned char l,
unsigned char Ns, unsigned char Ns,
uint8_t cooperation_flag) uint8_t cooperation_flag)
...@@ -68,8 +67,8 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB, ...@@ -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_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 **ul_ch_estimates_1= pusch_vars->drs_ch_estimates_1[eNB_id];
int32_t **rxdataF_ext= pusch_vars->rxdataF_ext[eNB_id]; int32_t **rxdataF_ext= pusch_vars->rxdataF_ext[eNB_id];
int subframe = eNB->proc[thread_id].subframe_rx; int subframe = eNB->proc.subframe_rx;
uint8_t harq_pid = subframe2harq_pid(frame_parms,eNB->proc[thread_id].frame_rx,subframe); uint8_t harq_pid = subframe2harq_pid(frame_parms,eNB->proc.frame_rx,subframe);
int16_t delta_phase = 0; int16_t delta_phase = 0;
int16_t *ru1 = ru_90; int16_t *ru1 = ru_90;
int16_t *ru2 = ru_90; int16_t *ru2 = ru_90;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
OpenAirInterface OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
...@@ -7077,12 +7077,11 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ...@@ -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, uint16_t rnti,
uint8_t thread_id,
DCI_format_t dci_format, DCI_format_t dci_format,
uint8_t UE_id, uint8_t UE_id,
PHY_VARS_eNB *eNB,
uint16_t si_rnti, uint16_t si_rnti,
uint16_t ra_rnti, uint16_t ra_rnti,
uint16_t p_rnti, uint16_t p_rnti,
...@@ -7096,7 +7095,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu, ...@@ -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; ANFBmode_t AckNackFBMode = eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode;
LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id];
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; 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 cqi_req = 0;
uint32_t dai = 0; uint32_t dai = 0;
...@@ -7117,11 +7116,10 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu, ...@@ -7117,11 +7116,10 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
harq_pid = subframe2harq_pid(frame_parms, harq_pid = subframe2harq_pid(frame_parms,
pdcch_alloc2ul_frame(frame_parms, pdcch_alloc2ul_frame(frame_parms,
eNB->proc[thread_id].frame_tx, eNB->proc.frame_tx,
subframe), subframe),
pdcch_alloc2ul_subframe(frame_parms,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) { switch (frame_parms->N_RB_DL) {
case 6: case 6:
...@@ -7639,7 +7637,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu, ...@@ -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", 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, ...@@ -1416,7 +1416,6 @@ void rx_phich(PHY_VARS_UE *ue,
} }
void generate_phich_top(PHY_VARS_eNB *eNB, void generate_phich_top(PHY_VARS_eNB *eNB,
unsigned char thread_id,
int16_t amp, int16_t amp,
uint8_t sect_id, uint8_t sect_id,
uint8_t abstraction_flag) uint8_t abstraction_flag)
...@@ -1432,7 +1431,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB, ...@@ -1432,7 +1431,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
uint8_t pusch_subframe; uint8_t pusch_subframe;
uint8_t UE_id; uint8_t UE_id;
uint32_t pusch_frame; 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 // 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, ...@@ -1444,7 +1443,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
if (frame_parms->Ncp == 1) if (frame_parms->Ncp == 1)
NSF_PHICH = 2; 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); pusch_subframe = phich_subframe2_pusch_subframe(frame_parms,subframe);
harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe); harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe);
...@@ -1453,7 +1452,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB, ...@@ -1453,7 +1452,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
if (ulsch[UE_id]->harq_processes[harq_pid]->phich_active == 1) { 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", 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 + ngroup_PHICH = (ulsch[UE_id]->harq_processes[harq_pid]->first_rb +
ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%Ngroup_PHICH; ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%Ngroup_PHICH;
...@@ -1467,7 +1466,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB, ...@@ -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) + 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); 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", 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, subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,
ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK, ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK,
ulsch[UE_id]->harq_processes[harq_pid]->first_rb, ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
...@@ -1475,7 +1474,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB, ...@@ -1475,7 +1474,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
if (ulsch[UE_id]->Msg3_active == 1) { 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", 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, 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); ulsch[UE_id]->harq_processes[harq_pid]->first_rb);
} }
...@@ -1505,7 +1504,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB, ...@@ -1505,7 +1504,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
(ulsch[UE_id]->harq_processes[harq_pid]->rar_alloc == 0) ) { (ulsch[UE_id]->harq_processes[harq_pid]->rar_alloc == 0) ) {
if (ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK==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", 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]->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]->rvidx = rv_table[ulsch[UE_id]->harq_processes[harq_pid]->round&3];
ulsch[UE_id]->harq_processes[harq_pid]->O_RI = 0; ulsch[UE_id]->harq_processes[harq_pid]->O_RI = 0;
...@@ -1515,7 +1514,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB, ...@@ -1515,7 +1514,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
} else { } 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", 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]->subframe_scheduling_flag = 0;
ulsch[UE_id]->harq_processes[harq_pid]->round=0; ulsch[UE_id]->harq_processes[harq_pid]->round=0;
} }
......
...@@ -43,13 +43,13 @@ ...@@ -43,13 +43,13 @@
int generate_mbsfn_pilot(PHY_VARS_eNB *eNB, int generate_mbsfn_pilot(PHY_VARS_eNB *eNB,
int32_t **txdataF, int32_t **txdataF,
int16_t amp, int16_t amp)
uint16_t subframe)
{ {
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
uint32_t subframe_offset,Nsymb,samples_per_symbol; uint32_t subframe_offset,Nsymb,samples_per_symbol;
int subframe = eNB->proc.subframe_tx;
if (subframe<0 || subframe>= 10) { 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) ...@@ -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 G;
int subframe = eNB->proc[thread_id].subframe_tx; int subframe = eNB->proc.subframe_tx;
if (abstraction_flag != 0) { if (abstraction_flag != 0) {
if (eNB_transport_info_TB_index[eNB->Mod_id][eNB->CC_id]!=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 ...@@ -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->frame_parms.N_RB_DL,
eNB->dlsch_MCH->harq_processes[0]->rb_alloc, eNB->dlsch_MCH->harq_processes[0]->rb_alloc,
get_Qm(eNB->dlsch_MCH->harq_processes[0]->mcs),1, 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, generate_mbsfn_pilot(eNB,
eNB->common_vars.txdataF[0], eNB->common_vars.txdataF[0],
AMP, AMP);
subframe);
if (dlsch_encoding(a, if (dlsch_encoding(a,
&eNB->frame_parms, &eNB->frame_parms,
1, 1,
eNB->dlsch_MCH, eNB->dlsch_MCH,
eNB->proc[thread_id].frame_tx, eNB->proc.frame_tx,
subframe, subframe,
&eNB->dlsch_rate_matching_stats, &eNB->dlsch_rate_matching_stats,
&eNB->dlsch_turbo_encoding_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 ...@@ -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; //__m128i mmtmpX0,mmtmpX1,mmtmpX2,mmtmpX3;
void rx_prach(PHY_VARS_eNB *eNB, void rx_prach(PHY_VARS_eNB *eNB,
uint8_t subframe,
uint16_t *preamble_energy_list, uint16_t *preamble_energy_list,
uint16_t *preamble_delay_list, uint16_t *preamble_delay_list,
uint16_t Nf, uint16_t Nf,
...@@ -1065,7 +1064,7 @@ void rx_prach(PHY_VARS_eNB *eNB, ...@@ -1065,7 +1064,7 @@ void rx_prach(PHY_VARS_eNB *eNB,
int i; int i;
lte_frame_type_t frame_type = eNB->frame_parms.frame_type; 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; 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 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; 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) ...@@ -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++) { 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", 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_id,number_of_cards_l,
eNB->proc[0].frame_tx, eNB->proc.frame_tx,
eNB->rx_total_gain_dB, eNB->rx_total_gain_dB,
eNB->measurements[eNB_id].n0_power_tot_dBm, eNB->measurements[eNB_id].n0_power_tot_dBm,
eNB->measurements[eNB_id].n0_power_dB[0], eNB->measurements[eNB_id].n0_power_dB[0],
...@@ -621,9 +621,9 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length) ...@@ -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 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] 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] 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); //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, ...@@ -228,12 +228,11 @@ int mch_modulation(int32_t **txdataF,
/** \brief Top-level generation function for eNB TX of MBSFN /** \brief Top-level generation function for eNB TX of MBSFN
@param phy_vars_eNB Pointer to eNB variables @param phy_vars_eNB Pointer to eNB variables
@param subframe Subframe for PMCH
@param a Pointer to transport block @param a Pointer to transport block
@param abstraction_flag @param abstraction_flag