Commit bd3200e6 authored by Raymond Knopp's avatar Raymond Knopp

addition of paging in UE, modifications for dlsim

parent 4d1346df
......@@ -960,6 +960,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c
......
......@@ -26,9 +26,6 @@
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#ifdef EXMIMO
#include "openair0_lib.h"
#endif
#include "defs.h"
#include "SCHED/defs.h"
#include "PHY/extern.h"
......@@ -48,7 +45,7 @@ extern uint16_t prach_root_sequence_map4[138];
uint8_t dmrs1_tab[8] = {0,2,3,4,6,8,9,10};
// FIXME not used anywhere
void phy_config_mib(LTE_DL_FRAME_PARMS *frame_parms,
void phy_config_mib(LTE_DL_FRAME_PARMS *fp,
uint8_t N_RB_DL,
uint8_t Nid_cell,
uint8_t Ncp,
......@@ -57,14 +54,14 @@ void phy_config_mib(LTE_DL_FRAME_PARMS *frame_parms,
PHICH_CONFIG_COMMON *phich_config)
{
frame_parms->N_RB_DL = N_RB_DL;
frame_parms->Nid_cell = Nid_cell;
frame_parms->nushift = Nid_cell%6;
frame_parms->Ncp = Ncp;
frame_parms->frame_type = frame_type;
frame_parms->nb_antennas_tx_eNB = p_eNB;
frame_parms->phich_config_common.phich_resource = phich_config->phich_resource;
frame_parms->phich_config_common.phich_duration = phich_config->phich_duration;
fp->N_RB_DL = N_RB_DL;
fp->Nid_cell = Nid_cell;
fp->nushift = Nid_cell%6;
fp->Ncp = Ncp;
fp->frame_type = frame_type;
fp->nb_antennas_tx_eNB = p_eNB;
fp->phich_config_common.phich_resource = phich_config->phich_resource;
fp->phich_config_common.phich_duration = phich_config->phich_duration;
}
void phy_config_sib1_eNB(uint8_t Mod_id,
......@@ -74,15 +71,15 @@ void phy_config_sib1_eNB(uint8_t Mod_id,
uint16_t SIPeriod)
{
LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
LTE_DL_FRAME_PARMS *fp = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
if (tdd_Config) {
frame_parms->tdd_config = tdd_Config->subframeAssignment;
frame_parms->tdd_config_S = tdd_Config->specialSubframePatterns;
fp->tdd_config = tdd_Config->subframeAssignment;
fp->tdd_config_S = tdd_Config->specialSubframePatterns;
}
frame_parms->SIwindowsize = SIwindowsize;
frame_parms->SIPeriod = SIPeriod;
fp->SIwindowsize = SIwindowsize;
fp->SIPeriod = SIPeriod;
}
void phy_config_sib1_ue(uint8_t Mod_id,int CC_id,
......@@ -92,15 +89,15 @@ void phy_config_sib1_ue(uint8_t Mod_id,int CC_id,
uint16_t SIperiod)
{
LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
if (tdd_Config) {
frame_parms->tdd_config = tdd_Config->subframeAssignment;
frame_parms->tdd_config_S = tdd_Config->specialSubframePatterns;
fp->tdd_config = tdd_Config->subframeAssignment;
fp->tdd_config_S = tdd_Config->specialSubframePatterns;
}
frame_parms->SIwindowsize = SIwindowsize;
frame_parms->SIPeriod = SIperiod;
fp->SIwindowsize = SIwindowsize;
fp->SIPeriod = SIperiod;
}
void phy_config_sib2_eNB(uint8_t Mod_id,
......@@ -112,132 +109,132 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList)
{
LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
LTE_DL_FRAME_PARMS *fp = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
//LTE_eNB_UE_stats *eNB_UE_stats = PHY_vars_eNB_g[Mod_id][CC_id]->eNB_UE_stats;
//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: 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 );
fp->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
LOG_D(PHY,"prach_config_common.rootSequenceIndex = %d\n",fp->prach_config_common.rootSequenceIndex );
frame_parms->prach_config_common.prach_Config_enabled=1;
fp->prach_config_common.prach_Config_enabled=1;
frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
LOG_D(PHY,"prach_config_common.prach_ConfigInfo.prach_ConfigIndex = %d\n",frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex);
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
LOG_D(PHY,"prach_config_common.prach_ConfigInfo.prach_ConfigIndex = %d\n",fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex);
frame_parms->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.highSpeedFlag;
LOG_D(PHY,"prach_config_common.prach_ConfigInfo.highSpeedFlag = %d\n",frame_parms->prach_config_common.prach_ConfigInfo.highSpeedFlag);
frame_parms->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
LOG_D(PHY,"prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = %d\n",frame_parms->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig);
frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
LOG_D(PHY,"prach_config_common.prach_ConfigInfo.prach_FreqOffset = %d\n",frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset);
compute_prach_seq(&frame_parms->prach_config_common,frame_parms->frame_type,
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.highSpeedFlag;
LOG_D(PHY,"prach_config_common.prach_ConfigInfo.highSpeedFlag = %d\n",fp->prach_config_common.prach_ConfigInfo.highSpeedFlag);
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
LOG_D(PHY,"prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = %d\n",fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig);
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
LOG_D(PHY,"prach_config_common.prach_ConfigInfo.prach_FreqOffset = %d\n",fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset);
compute_prach_seq(&fp->prach_config_common,fp->frame_type,
PHY_vars_eNB_g[Mod_id][CC_id]->X_u);
frame_parms->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift;
frame_parms->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon.nRB_CQI;
frame_parms->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon.nCS_AN;
frame_parms->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN;
fp->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift;
fp->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon.nRB_CQI;
fp->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon.nCS_AN;
fp->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN;
frame_parms->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon.referenceSignalPower;
frame_parms->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon.p_b;
fp->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon.referenceSignalPower;
fp->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon.p_b;
frame_parms->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
LOG_D(PHY,"pusch_config_common.n_SB = %d\n",frame_parms->pusch_config_common.n_SB );
fp->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
LOG_D(PHY,"pusch_config_common.n_SB = %d\n",fp->pusch_config_common.n_SB );
frame_parms->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
LOG_D(PHY,"pusch_config_common.hoppingMode = %d\n",frame_parms->pusch_config_common.hoppingMode);
fp->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
LOG_D(PHY,"pusch_config_common.hoppingMode = %d\n",fp->pusch_config_common.hoppingMode);
frame_parms->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
LOG_D(PHY,"pusch_config_common.pusch_HoppingOffset = %d\n",frame_parms->pusch_config_common.pusch_HoppingOffset);
fp->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
LOG_D(PHY,"pusch_config_common.pusch_HoppingOffset = %d\n",fp->pusch_config_common.pusch_HoppingOffset);
frame_parms->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
LOG_D(PHY,"pusch_config_common.enable64QAM = %d\n",frame_parms->pusch_config_common.enable64QAM );
fp->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
LOG_D(PHY,"pusch_config_common.enable64QAM = %d\n",fp->pusch_config_common.enable64QAM );
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = %d\n",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled);
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled);
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = %d\n",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH);
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH);
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = %d\n",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled);
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled);
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = dmrs1_tab[radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift];
LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = %d\n",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift);
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = dmrs1_tab[radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift];
LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift);
init_ul_hopping(frame_parms);
init_ul_hopping(fp);
frame_parms->soundingrs_ul_config_common.enabled_flag = 0;
fp->soundingrs_ul_config_common.enabled_flag = 0;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.present==SoundingRS_UL_ConfigCommon_PR_setup) {
frame_parms->soundingrs_ul_config_common.enabled_flag = 1;
frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig;
frame_parms->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig;
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
fp->soundingrs_ul_config_common.enabled_flag = 1;
fp->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig;
fp->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig;
fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts)
frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 1;
fp->soundingrs_ul_config_common.srs_MaxUpPts = 1;
else
frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 0;
fp->soundingrs_ul_config_common.srs_MaxUpPts = 0;
}
frame_parms->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUSCH;
frame_parms->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon.alpha;
frame_parms->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUCCH;
frame_parms->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaPreambleMsg3;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2a;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2b;
fp->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUSCH;
fp->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon.alpha;
fp->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUCCH;
fp->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaPreambleMsg3;
fp->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1;
fp->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b;
fp->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2;
fp->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2a;
fp->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2b;
frame_parms->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx;
fp->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx;
// Now configure some of the Physical Channels
// PUCCH
init_ncs_cell(frame_parms,PHY_vars_eNB_g[Mod_id][CC_id]->ncs_cell);
init_ncs_cell(fp,PHY_vars_eNB_g[Mod_id][CC_id]->ncs_cell);
init_ul_hopping(frame_parms);
init_ul_hopping(fp);
// MBSFN
if (mbsfn_SubframeConfigList != NULL) {
frame_parms->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
fp->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
frame_parms->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod;
frame_parms->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset;
fp->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod;
fp->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset;
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
frame_parms->MBSFN_config[i].fourFrames_flag = 0;
frame_parms->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
fp->MBSFN_config[i].fourFrames_flag = 0;
fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
frame_parms->MBSFN_config[i].mbsfn_SubframeConfig);
fp->MBSFN_config[i].mbsfn_SubframeConfig);
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
frame_parms->MBSFN_config[i].fourFrames_flag = 1;
frame_parms->MBSFN_config[i].mbsfn_SubframeConfig =
fp->MBSFN_config[i].fourFrames_flag = 1;
fp->MBSFN_config[i].mbsfn_SubframeConfig =
mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
frame_parms->MBSFN_config[i].mbsfn_SubframeConfig);
fp->MBSFN_config[i].mbsfn_SubframeConfig);
}
}
} else
frame_parms->num_MBSFN_config = 0;
fp->num_MBSFN_config = 0;
}
......@@ -250,106 +247,109 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList)
{
LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id];
LTE_DL_FRAME_PARMS *fp = &ue->frame_parms;
int i;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_CONFIG_SIB2, VCD_FUNCTION_IN);
LOG_I(PHY,"[UE%d] Applying radioResourceConfigCommon from eNB%d\n",Mod_id,CH_index);
frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
fp->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
frame_parms->prach_config_common.prach_Config_enabled=1;
frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
frame_parms->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.highSpeedFlag;
frame_parms->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
fp->prach_config_common.prach_Config_enabled=1;
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.highSpeedFlag;
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
compute_prach_seq(&frame_parms->prach_config_common,frame_parms->frame_type,PHY_vars_UE_g[Mod_id][CC_id]->X_u);
compute_prach_seq(&fp->prach_config_common,fp->frame_type,ue->X_u);
frame_parms->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift;
frame_parms->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon.nRB_CQI;
frame_parms->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon.nCS_AN;
frame_parms->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN;
fp->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift;
fp->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon.nRB_CQI;
fp->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon.nCS_AN;
fp->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN;
frame_parms->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon.referenceSignalPower;
frame_parms->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon.p_b;
fp->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon.referenceSignalPower;
fp->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon.p_b;
frame_parms->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
frame_parms->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
frame_parms->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
frame_parms->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = dmrs1_tab[radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift];
fp->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
fp->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
fp->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
fp->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = dmrs1_tab[radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift];
init_ul_hopping(frame_parms);
frame_parms->soundingrs_ul_config_common.enabled_flag = 0;
init_ul_hopping(fp);
fp->soundingrs_ul_config_common.enabled_flag = 0;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.present==SoundingRS_UL_ConfigCommon_PR_setup) {
frame_parms->soundingrs_ul_config_common.enabled_flag = 1;
frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig;
frame_parms->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig;
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
fp->soundingrs_ul_config_common.enabled_flag = 1;
fp->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig;
fp->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig;
fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts)
frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 1;
fp->soundingrs_ul_config_common.srs_MaxUpPts = 1;
else
frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 0;
fp->soundingrs_ul_config_common.srs_MaxUpPts = 0;
}
frame_parms->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUSCH;
frame_parms->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon.alpha;
frame_parms->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUCCH;
frame_parms->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaPreambleMsg3;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2a;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2b;
fp->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUSCH;
fp->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon.alpha;
fp->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUCCH;
fp->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaPreambleMsg3;
fp->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1;
fp->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b;
fp->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2;
fp->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2a;
fp->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2b;
frame_parms->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx;
fp->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx;
// Now configure some of the Physical Channels
// PUCCH
init_ncs_cell(frame_parms,PHY_vars_UE_g[Mod_id][CC_id]->ncs_cell);
init_ncs_cell(fp,ue->ncs_cell);
init_ul_hopping(frame_parms);
init_ul_hopping(fp);
// PCH
init_ue_paging_info(ue,radioResourceConfigCommon->pcch_Config.defaultPagingCycle,radioResourceConfigCommon->pcch_Config.nB);
// MBSFN
if (mbsfn_SubframeConfigList != NULL) {
frame_parms->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
fp->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
frame_parms->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod;
frame_parms->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset;
fp->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod;
fp->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset;
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
frame_parms->MBSFN_config[i].fourFrames_flag = 0;
frame_parms->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
fp->MBSFN_config[i].fourFrames_flag = 0;
fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
frame_parms->MBSFN_config[i].mbsfn_SubframeConfig);
fp->MBSFN_config[i].mbsfn_SubframeConfig);
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
frame_parms->MBSFN_config[i].fourFrames_flag = 1;
frame_parms->MBSFN_config[i].mbsfn_SubframeConfig =
fp->MBSFN_config[i].fourFrames_flag = 1;
fp->MBSFN_config[i].mbsfn_SubframeConfig =
mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
frame_parms->MBSFN_config[i].mbsfn_SubframeConfig);
fp->MBSFN_config[i].mbsfn_SubframeConfig);
}
}
}
......@@ -362,17 +362,17 @@ void phy_config_sib13_ue(uint8_t Mod_id,int CC_id,uint8_t CH_index,int mbsfn_Are
long mbsfn_AreaId_r9)
{
LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
LOG_I(PHY,"[UE%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;
fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
LOG_N(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
}
lte_gold_mbsfn(frame_parms,PHY_vars_UE_g[Mod_id][CC_id]->lte_gold_mbsfn_table,frame_parms->Nid_cell_mbsfn);
lte_gold_mbsfn(fp,PHY_vars_UE_g[Mod_id][CC_id]->lte_gold_mbsfn_table,fp->Nid_cell_mbsfn);
}
......@@ -381,17 +381,17 @@ void phy_config_sib13_eNB(uint8_t Mod_id,int CC_id,int mbsfn_Area_idx,
long mbsfn_AreaId_r9)
{
LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
LTE_DL_FRAME_PARMS *fp = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
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;
fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
LOG_N(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
}
lte_gold_mbsfn(frame_parms,PHY_vars_eNB_g[Mod_id][CC_id]->lte_gold_mbsfn_table,frame_parms->Nid_cell_mbsfn);
lte_gold_mbsfn(fp,PHY_vars_eNB_g[Mod_id][CC_id]->lte_gold_mbsfn_table,fp->Nid_cell_mbsfn);
}
......@@ -400,6 +400,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
uint8_t UE_id;
struct PhysicalConfigDedicated *physicalConfigDedicated;
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
physicalConfigDedicated = eNB->physicalConfigDedicated[UE_id];
......@@ -421,7 +422,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
eNB->pucch_config_dedicated[UE_id].ackNackRepetition=1;
}
if (eNB->frame_parms.frame_type == FDD) {
if (fp->frame_type == FDD) {
eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode = multiplexing;
} else {
if (physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode)
......@@ -508,7 +509,7 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
PHY_vars_UE_g[Mod_id][CC_id]->ho_triggered = 1;
//PHY_vars_UE_g[UE_id]->UE_mode[0] = PRACH;
LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
// int N_ZC;
// uint8_t prach_fmt;
// int u;
......@@ -516,88 +517,88 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
LOG_I(PHY,"[UE%d] Handover triggered: Applying radioResourceConfigCommon from eNB %d\n",
Mod_id,eNB_id);
frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
frame_parms->prach_config_common.prach_Config_enabled=1;
frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex;
frame_parms->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->highSpeedFlag;
frame_parms->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->zeroCorrelationZoneConfig;
frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_FreqOffset;
fp->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
fp->prach_config_common.prach_Config_enabled=1;
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex;
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->highSpeedFlag;
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->zeroCorrelationZoneConfig;
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_FreqOffset;
// prach_fmt = get_prach_fmt(radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex,frame_parms->frame_type);
// prach_fmt = get_prach_fmt(radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex,fp->frame_type);
// N_ZC = (prach_fmt <4)?839:139;
// u = (prach_fmt < 4) ? prach_root_sequence_map0_3[frame_parms->prach_config_common.rootSequenceIndex] :
// prach_root_sequence_map4[frame_parms->prach_config_common.rootSequenceIndex];
// u = (prach_fmt < 4) ? prach_root_sequence_map0_3[fp->prach_config_common.rootSequenceIndex] :
// prach_root_sequence_map4[fp->prach_config_common.rootSequenceIndex];
//compute_prach_seq(u,N_ZC, PHY_vars_UE_g[Mod_id]->X_u);
compute_prach_seq(&PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common,
frame_parms->frame_type,
fp->frame_type,
PHY_vars_UE_g[Mod_id][CC_id]->X_u);
frame_parms->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon->deltaPUCCH_Shift;
frame_parms->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon->nRB_CQI;
frame_parms->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon->nCS_AN;
frame_parms->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon->n1PUCCH_AN;
frame_parms->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon->referenceSignalPower;
frame_parms->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon->p_b;
fp->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon->deltaPUCCH_Shift;
fp->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon->nRB_CQI;
fp->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon->nCS_AN;
fp->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon->n1PUCCH_AN;
fp->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon->referenceSignalPower;
fp->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon->p_b;
frame_parms->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
frame_parms->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
frame_parms->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
frame_parms->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift;
fp->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
fp->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
fp->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
fp->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift;
init_ul_hopping(frame_parms);
frame_parms->soundingrs_ul_config_common.enabled_flag = 0;
init_ul_hopping(fp);
fp->soundingrs_ul_config_common.enabled_flag = 0;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon->present==SoundingRS_UL_ConfigCommon_PR_setup) {
frame_parms->soundingrs_ul_config_common.enabled_flag = 1;
frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_BandwidthConfig;
frame_parms->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig;
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.ackNackSRS_SimultaneousTransmission;
fp->soundingrs_ul_config_common.enabled_flag = 1;
fp->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_BandwidthConfig;
fp->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig;
fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.ackNackSRS_SimultaneousTransmission;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_MaxUpPts)
frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 1;
fp->soundingrs_ul_config_common.srs_MaxUpPts = 1;
else
frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 0;
fp->soundingrs_ul_config_common.srs_MaxUpPts = 0;
}
frame_parms->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon->p0_NominalPUSCH;
frame_parms->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon->alpha;
frame_parms->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon->p0_NominalPUCCH;
frame_parms->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaPreambleMsg3;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format1;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format1b;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2a;
frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2b;
fp->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon->p0_NominalPUSCH;
fp->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon->alpha;
fp->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon->p0_NominalPUCCH;
fp->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaPreambleMsg3;
fp->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format1;
fp->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format1b;
fp->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2;
fp->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2a;
fp->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2b;
frame_parms->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon->maxHARQ_Msg3Tx;
fp->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon->maxHARQ_Msg3Tx;
// Now configure some of the Physical Channels
if (radioResourceConfigCommon->antennaInfoCommon)
frame_parms->nb_antennas_tx = (1<<radioResourceConfigCommon->antennaInfoCommon->antennaPortsCount);
fp->nb_antennas_tx = (1<<radioResourceConfigCommon->antennaInfoCommon->antennaPortsCount);
else
frame_parms->nb_antennas_tx = 1;
fp->nb_antennas_tx = 1;
//PHICH
if (radioResourceConfigCommon->antennaInfoCommon) {
frame_parms->phich_config_common.phich_resource = radioResourceConfigCommon->phich_Config->phich_Resource;
frame_parms->phich_config_common.phich_duration = radioResourceConfigCommon->phich_Config->phich_Duration;
fp->phich_config_common.phich_resource = radioResourceConfigCommon->phich_Config->phich_Resource;
fp->phich_config_common.phich_duration = radioResourceConfigCommon->phich_Config->phich_Duration;
}
//Target CellId
frame_parms->Nid_cell = mobilityControlInfo->targetPhysCellId;
frame_parms->nushift = frame_parms->Nid_cell%6;
fp->Nid_cell = mobilityControlInfo->targetPhysCellId;
fp->nushift = fp->Nid_cell%6;
// PUCCH
init_ncs_cell(frame_parms,PHY_vars_UE_g[Mod_id][CC_id]->ncs_cell);
init_ncs_cell(fp,PHY_vars_UE_g[Mod_id][CC_id]->ncs_cell);
init_ul_hopping(frame_parms);
init_ul_hopping(fp);
// RNTI
......@@ -676,46 +677,13 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
ARFCN_ValueEUTRA_t dl_CarrierFreq_r10 = sCellToAddMod_r10->cellIdentification_r10->dl_CarrierFreq_r10;
uint32_t carrier_freq_local;
#ifdef EXMIMO
#ifdef DRIVER2013
// exmimo_config_t *p_exmimo_config = openair0_exmimo_pci[rf_map[CC_id].card].exmimo_config_ptr;
#endif
#endif
if ((dl_CarrierFreq_r10>=36000) && (dl_CarrierFreq_r10<=36199)) {
carrier_freq_local = 1900000000 + (dl_CarrierFreq_r10-36000)*100000; //band 33 from 3GPP 36.101 v 10.9 Table 5.7.3-1
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
/*
#ifdef EXMIMO
#ifdef DRIVER2013
//carrier_freq[CC_id] = carrier_freq_local;
//openair_daq_vars.freq_offset = -6540;
p_exmimo_config->rf.rf_freq_rx[rf_map[CC_id].chain] = carrier_freq_local;//+openair_daq_vars.freq_offset2;
p_exmimo_config->rf.rf_freq_tx[rf_map[CC_id].chain] = carrier_freq_local;//+openair_daq_vars.freq_offset2;
p_exmimo_config->rf.tx_gain[rf_map[CC_id].chain][0] = 25;
p_exmimo_config->rf.rf_vcocal[rf_map[CC_id].chain] = 910;
p_exmimo_config->rf.rf_local[rf_map[CC_id].chain] = 8255063; //this should be taken form calibration file
p_exmimo_config->rf.rffe_band_mode[rf_map[CC_id].chain] = B19G_TDD;
#endif
#endif*/
} else if ((dl_CarrierFreq_r10>=6150) && (dl_CarrierFreq_r10<=6449)) {
carrier_freq_local = 832000000 + (dl_CarrierFreq_r10-6150)*100000; //band 20 from 3GPP 36.101 v 10.9 Table 5.7.3-1
// this is actually for the UL only, but we use it for DL too, since there is no TDD mode for this band
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
/*
#ifdef EXMIMO
#ifdef DRIVER2013
//carrier_freq[CC_id] = carrier_freq_local;
//openair_daq_vars.freq_offset = -2000;
p_exmimo_config->rf.rf_freq_rx[rf_map[CC_id].chain] = carrier_freq_local;//+openair_daq_vars.freq_offset2;
p_exmimo_config->rf.rf_freq_tx[rf_map[CC_id].chain] = carrier_freq_local;//+openair_daq_vars.freq_offset2;
p_exmimo_config->rf.tx_gain[rf_map[CC_id].chain][0] = 10;
p_exmimo_config->rf.rf_vcocal[rf_map[CC_id].chain] = 2015;
p_exmimo_config->rf.rf_local[rf_map[CC_id].chain] = 8254992; //this should be taken form calibration file
p_exmimo_config->rf.rffe_band_mode[rf_map[CC_id].chain] = DD_TDD;
#endif
#endif
*/
} else {
LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %d of SCell %d for UE %d not supported\n",Mod_id,/*eNB->frame*/0,dl_CarrierFreq_r10,CC_id,UE_id);
}
......@@ -906,11 +874,11 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
* \param[in] frame_parms LTE_DL_FRAME_PARMS structure.
* \note This function is optimistic in that it expects malloc() to succeed.
*/
void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS* const frame_parms )
void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS* const fp )
{
AssertFatal( pdsch, "pdsch==0" );
pdsch->pmi_ext = (uint8_t*)malloc16_clear( frame_parms->N_RB_DL );
pdsch->pmi_ext = (uint8_t*)malloc16_clear( fp->N_RB_DL );
pdsch->llr[0] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
pdsch->llr128 = (int16_t**)malloc16_clear( sizeof(int16_t*) );
pdsch->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) );
......@@ -918,7 +886,7 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
pdsch->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rxdataF_comp0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rho = (int32_t**)malloc16_clear( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pdsch->rho = (int32_t**)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t*) );
pdsch->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
......@@ -926,14 +894,14 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
pdsch->dl_ch_magb0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
// the allocated memory size is fixed:
AssertFatal( frame_parms->nb_antennas_rx <= 2, "nb_antennas_rx > 2" );
AssertFatal( fp->nb_antennas_rx <= 2, "nb_antennas_rx > 2" );
for (int i=0; i<frame_parms->nb_antennas_rx; i++) {
pdsch->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*7*2) );
for (int i=0; i<fp->nb_antennas_rx; i++) {
pdsch->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*7*2) );
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
for (int j=0; j<4; j++) { //fp->nb_antennas_tx; j++)
const int idx = (j<<1)+i;
const size_t num = 7*2*frame_parms->N_RB_DL*12;
const size_t num = 7*2*fp->N_RB_DL*12;
pdsch->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->rxdataF_comp0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
......@@ -952,7 +920,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
{
// create shortcuts
LTE_DL_FRAME_PARMS* const frame_parms = &ue->frame_parms;
LTE_DL_FRAME_PARMS* const fp = &ue->frame_parms;
LTE_UE_COMMON* const common_vars = &ue->common_vars;
LTE_UE_PDSCH** const pdsch_vars = ue->pdsch_vars;
LTE_UE_PDSCH** const pdsch_vars_SI = ue->pdsch_vars_SI;
......@@ -965,11 +933,11 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
int i,j,k;
int eNB_id;
printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,frame_parms->nb_antennas_tx,frame_parms->nb_antennas_rx);
printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx);
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST);
// many memory allocation sizes are hard coded
AssertFatal( frame_parms->nb_antennas_rx <= 2, "hard coded allocation for ue_common_vars->dl_ch_estimates[eNB_id]" );
AssertFatal( fp->nb_antennas_rx <= 2, "hard coded allocation for ue_common_vars->dl_ch_estimates[eNB_id]" );
AssertFatal( ue->n_connected_eNB <= NUMBER_OF_CONNECTED_eNB_MAX, "n_connected_eNB is too large" );
// init phy_vars_ue
......@@ -995,25 +963,25 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
// init TX buffers
common_vars->txdata = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
common_vars->txdataF = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
common_vars->txdata = (int32_t**)malloc16( fp->nb_antennas_tx*sizeof(int32_t*) );
common_vars->txdataF = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_tx; i++) {
for (i=0; i<fp->nb_antennas_tx; i++) {
common_vars->txdata[i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) );
common_vars->txdataF[i] = (int32_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) );
common_vars->txdata[i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
common_vars->txdataF[i] = (int32_t *)malloc16_clear( fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
}
// init RX buffers
common_vars->rxdata = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
common_vars->rxdataF = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
common_vars->rxdataF2 = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
common_vars->rxdata = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
common_vars->rxdataF = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
common_vars->rxdataF2 = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
common_vars->rxdata[i] = (int32_t*) malloc16_clear( (FRAME_LENGTH_COMPLEX_SAMPLES+2048)*sizeof(int32_t) );
common_vars->rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->ofdm_symbol_size*14) );
common_vars->rxdataF2[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*10) );
for (i=0; i<fp->nb_antennas_rx; i++) {
common_vars->rxdata[i] = (int32_t*) malloc16_clear( (fp->samples_per_tti*10+2048)*sizeof(int32_t) );
common_vars->rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
common_vars->rxdataF2[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti*10) );
}
}
......@@ -1022,11 +990,11 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
common_vars->dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
common_vars->dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (i=0; i<fp->nb_antennas_rx; i++)
for (j=0; j<4; j++) {
int idx = (j<<1) + i;
common_vars->dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->symbols_per_tti*(frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
common_vars->dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->ofdm_symbol_size*2 );
common_vars->dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
common_vars->dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
}
}
......@@ -1041,9 +1009,9 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16_clear(sizeof(LTE_UE_PBCH));
if (abstraction_flag == 0) {
phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], frame_parms );
phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], fp );
pdsch_vars[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*frame_parms->N_RB_DL*12);
pdsch_vars[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
pdsch_vars[eNB_id]->llr_shifts_p = pdsch_vars[eNB_id]->llr_shifts;
pdsch_vars[eNB_id]->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch_vars[eNB_id]->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
......@@ -1052,19 +1020,19 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
for (k=0; k<8; k++)
pdsch_vars[eNB_id]->rxdataF_comp1[k] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (i=0; i<fp->nb_antennas_rx; i++)
for (j=0; j<4; j++) {
int idx = (j<<1)+i;
pdsch_vars[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(frame_parms->N_RB_DL*12) );
pdsch_vars[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(frame_parms->N_RB_DL*12) );
pdsch_vars[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
pdsch_vars[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
for (k=0; k<8; k++)
pdsch_vars[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*14) );
pdsch_vars[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*14) );
}
phy_init_lte_ue__PDSCH( pdsch_vars_SI[eNB_id], frame_parms );
phy_init_lte_ue__PDSCH( pdsch_vars_ra[eNB_id], frame_parms );
phy_init_lte_ue__PDSCH( pdsch_vars_mch[eNB_id], frame_parms );
phy_init_lte_ue__PDSCH( pdsch_vars_SI[eNB_id], fp );
phy_init_lte_ue__PDSCH( pdsch_vars_ra[eNB_id], fp );
phy_init_lte_ue__PDSCH( pdsch_vars_mch[eNB_id], fp );
// 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE
pdcch_vars[eNB_id]->llr = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
pdcch_vars[eNB_id]->llr16 = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
......@@ -1073,17 +1041,17 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
pdcch_vars[eNB_id]->rxdataF_comp = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars[eNB_id]->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars[eNB_id]->rho = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pdcch_vars[eNB_id]->rho = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pdcch_vars[eNB_id]->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars[eNB_id]->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
//ue_pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*7*2) );
for (i=0; i<fp->nb_antennas_rx; i++) {
//ue_pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*7*2) );
pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(100*12*4) );
for (j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
for (j=0; j<4; j++) { //fp->nb_antennas_tx; j++)
int idx = (j<<1)+i;
// size_t num = 7*2*frame_parms->N_RB_DL*12;
// size_t num = 7*2*fp->N_RB_DL*12;
size_t num = 4*100*12; // 4 symbols, 100 PRBs, 12 REs per PRB
pdcch_vars[eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdcch_vars[eNB_id]->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
......@@ -1093,17 +1061,17 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
}
// PBCH
pbch_vars[eNB_id]->rxdataF_ext = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pbch_vars[eNB_id]->rxdataF_ext = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pbch_vars[eNB_id]->rxdataF_comp = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pbch_vars[eNB_id]->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pbch_vars[eNB_id]->llr = (int8_t*)malloc16_clear( 1920 );
prach_vars[eNB_id]->prachF = (int16_t*)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(frame_parms->ofdm_symbol_size*12)) );
prach_vars[eNB_id]->prach = (int16_t*)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(frame_parms->ofdm_symbol_size*12)) );
prach_vars[eNB_id]->prachF = (int16_t*)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
prach_vars[eNB_id]->prach = (int16_t*)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
for (i=0; i<fp->nb_antennas_rx; i++) {
pbch_vars[eNB_id]->rxdataF_ext[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*6*12*4 );
for (j=0; j<4; j++) {//frame_parms->nb_antennas_tx;j++) {
for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) {
int idx = (j<<1)+i;
pbch_vars[eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*6*12*4 );
pbch_vars[eNB_id]->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*6*12*4 );
......@@ -1121,14 +1089,14 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
if (abstraction_flag == 0) {
phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], frame_parms );
phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], fp );
pdsch_vars[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
} else { //abstraction == 1
ue->sinr_dB = (double*) malloc16_clear( frame_parms->N_RB_DL*12*sizeof(double) );
ue->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
}
ue->sinr_CQI_dB = (double*) malloc16_clear( frame_parms->N_RB_DL*12*sizeof(double) );
ue->sinr_CQI_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
ue->init_averaging = 1;
ue->pdsch_config_dedicated->p_a = dB0; // default value until overwritten by RRCConnectionReconfiguration
......@@ -1149,7 +1117,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
{
// shortcuts
LTE_DL_FRAME_PARMS* const frame_parms = &eNB->frame_parms;
LTE_DL_FRAME_PARMS* const fp = &eNB->frame_parms;
LTE_eNB_COMMON* const common_vars = &eNB->common_vars;
LTE_eNB_PUSCH** const pusch_vars = eNB->pusch_vars;
LTE_eNB_SRS* const srs_vars = eNB->srs_vars;
......@@ -1163,14 +1131,14 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
LOG_I(PHY,"[eNB %"PRIu8"] Initializing DL_FRAME_PARMS : N_RB_DL %"PRIu8", PHICH Resource %d, PHICH Duration %d\n",
eNB->Mod_id,
frame_parms->N_RB_DL,frame_parms->phich_config_common.phich_resource,
frame_parms->phich_config_common.phich_duration);
fp->N_RB_DL,fp->phich_config_common.phich_resource,
fp->phich_config_common.phich_duration);
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02"PRIu8"][]\n", eNB->Mod_id);
if (eNB->node_function != NGFI_RRU_IF4p5) {
lte_gold(frame_parms,eNB->lte_gold_table,frame_parms->Nid_cell);
generate_pcfich_reg_mapping(frame_parms);
generate_phich_reg_mapping(frame_parms);
lte_gold(fp,eNB->lte_gold_table,fp->Nid_cell);
generate_pcfich_reg_mapping(fp);
generate_phich_reg_mapping(fp);
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
eNB->first_run_timing_advance[UE_id] =
......@@ -1192,35 +1160,35 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
// TX vars
if (eNB->node_function != NGFI_RCC_IF4p5)
common_vars->txdata[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
common_vars->txdataF[eNB_id] = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
common_vars->txdata[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_tx*sizeof(int32_t*) );
common_vars->txdataF[eNB_id] = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_tx; i++) {
for (i=0; i<fp->nb_antennas_tx; i++) {
if (eNB->node_function != NGFI_RCC_IF4p5)
common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) );
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) );
common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear( fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
#ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] common_vars->txdata[%d][%d] = %p\n",eNB_id,i,common_vars->txdata[eNB_id][i]);
printf("[openair][LTE_PHY][INIT] common_vars->txdataF[%d][%d] = %p (%d bytes)\n",
eNB_id,i,common_vars->txdataF[eNB_id][i],
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
#endif
}
// RX vars
if (eNB->node_function != NGFI_RCC_IF4p5) {
common_vars->rxdata[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
common_vars->rxdata_7_5kHz[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
common_vars->rxdata[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
common_vars->rxdata_7_5kHz[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
}
common_vars->rxdataF[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
common_vars->rxdataF[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
for (i=0; i<fp->nb_antennas_rx; i++) {
if (eNB->node_function != NGFI_RCC_IF4p5) {
common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) );
common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->samples_per_tti*sizeof(int32_t) );
common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*sizeof(int32_t) );
}
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti) );
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti) );
#ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata[eNB_id][i]);
printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i]);
......@@ -1231,19 +1199,19 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
// Channel estimates for SRS
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
srs_vars[UE_id].srs_ch_estimates[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
srs_vars[UE_id].srs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
srs_vars[UE_id].srs_ch_estimates[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
srs_vars[UE_id].srs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
srs_vars[UE_id].srs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->ofdm_symbol_size );
srs_vars[UE_id].srs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->ofdm_symbol_size*2 );
for (i=0; i<fp->nb_antennas_rx; i++) {
srs_vars[UE_id].srs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size );
srs_vars[UE_id].srs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
}
} //UE_id
common_vars->sync_corr[eNB_id] = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*frame_parms->samples_per_tti );
common_vars->sync_corr[eNB_id] = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_tti );
}
} else { //UPLINK abstraction = 1
eNB->sinr_dB = (double*) malloc16_clear( frame_parms->N_RB_DL*12*sizeof(double) );
eNB->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
}
} //eNB_id
......@@ -1255,7 +1223,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
// SRS
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
srs_vars[UE_id].srs = (int32_t*)malloc16_clear(2*frame_parms->ofdm_symbol_size*sizeof(int32_t));
srs_vars[UE_id].srs = (int32_t*)malloc16_clear(2*fp->ofdm_symbol_size*sizeof(int32_t));
}
}
}
......@@ -1268,19 +1236,19 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
prach_vars->prachF = (int16_t*)malloc16_clear( 1024*2*sizeof(int16_t) );
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
AssertFatal(frame_parms->nb_antennas_rx <= sizeof(prach_vars->rxsigF) / sizeof(prach_vars->rxsigF[0]),
AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->rxsigF) / sizeof(prach_vars->rxsigF[0]),
"nb_antennas_rx too large");
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
prach_vars->rxsigF[i] = (int16_t*)malloc16_clear( frame_parms->ofdm_symbol_size*12*2*sizeof(int16_t) );
for (i=0; i<fp->nb_antennas_rx; i++) {
prach_vars->rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) );
#ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]);
#endif
}
if (eNB->node_function != NGFI_RRU_IF4p5) {
AssertFatal(frame_parms->nb_antennas_rx <= sizeof(prach_vars->prach_ifft) / sizeof(prach_vars->prach_ifft[0]),
AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->prach_ifft) / sizeof(prach_vars->prach_ifft[0]),
"nb_antennas_rx too large");
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
for (i=0; i<fp->nb_antennas_rx; i++) {
prach_vars->prach_ifft[i] = (int16_t*)malloc16_clear(1024*2*sizeof(int16_t));
#ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] prach_vars->prach_ifft[%d] = %p\n",i,prach_vars->prach_ifft[i]);
......@@ -1295,61 +1263,61 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
if (abstraction_flag==0) {
for (eNB_id=0; eNB_id<3; eNB_id++) {
pusch_vars[UE_id]->rxdataF_ext[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->rxdataF_ext2[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->drs_ch_estimates[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->rxdataF_comp[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->ul_ch_mag[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->ul_ch_magb[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->rxdataF_ext[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->rxdataF_ext2[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->drs_ch_estimates[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->rxdataF_comp[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->ul_ch_mag[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->ul_ch_magb[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
for (i=0; i<fp->nb_antennas_rx; i++) {
// RK 2 times because of output format of FFT!
// FIXME We should get rid of this
pusch_vars[UE_id]->rxdataF_ext[eNB_id][i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*frame_parms->N_RB_UL*12*frame_parms->symbols_per_tti );
pusch_vars[UE_id]->rxdataF_ext2[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->N_RB_UL*12*frame_parms->symbols_per_tti );
pusch_vars[UE_id]->drs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->N_RB_UL*12*frame_parms->symbols_per_tti );
pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( 2*2*sizeof(int32_t)*frame_parms->ofdm_symbol_size );
pusch_vars[UE_id]->rxdataF_comp[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->N_RB_UL*12*frame_parms->symbols_per_tti );
pusch_vars[UE_id]->ul_ch_mag[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
pusch_vars[UE_id]->ul_ch_magb[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
pusch_vars[UE_id]->rxdataF_ext[eNB_id][i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
pusch_vars[UE_id]->rxdataF_ext2[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
pusch_vars[UE_id]->drs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( 2*2*sizeof(int32_t)*fp->ofdm_symbol_size );
pusch_vars[UE_id]->rxdataF_comp[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
pusch_vars[UE_id]->ul_ch_mag[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
pusch_vars[UE_id]->ul_ch_magb[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
// In case of Distributed Alamouti Collabrative scheme separate channel estimates are required for both the UEs
if (cooperation_flag == 2) {
pusch_vars[UE_id]->drs_ch_estimates_0[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) ); // UE 0 DRS estimates
pusch_vars[UE_id]->drs_ch_estimates_1[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) ); // UE 1 DRS estimates
pusch_vars[UE_id]->drs_ch_estimates_0[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); // UE 0 DRS estimates
pusch_vars[UE_id]->drs_ch_estimates_1[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); // UE 1 DRS estimates
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
pusch_vars[UE_id]->drs_ch_estimates_0[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
pusch_vars[UE_id]->drs_ch_estimates_1[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
for (i=0; i<fp->nb_antennas_rx; i++) {
pusch_vars[UE_id]->drs_ch_estimates_0[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
pusch_vars[UE_id]->drs_ch_estimates_1[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
// Compensated data for the case of Distributed Alamouti Scheme
pusch_vars[UE_id]->rxdataF_comp_0[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) ); // it will contain(y)*(h0*)
pusch_vars[UE_id]->rxdataF_comp_1[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) ); // it will contain(y*)*(h1)
pusch_vars[UE_id]->rxdataF_comp_0[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); // it will contain(y)*(h0*)
pusch_vars[UE_id]->rxdataF_comp_1[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); // it will contain(y*)*(h1)
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
pusch_vars[UE_id]->rxdataF_comp_0[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
pusch_vars[UE_id]->rxdataF_comp_1[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
for (i=0; i<fp->nb_antennas_rx; i++) {
pusch_vars[UE_id]->rxdataF_comp_0[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
pusch_vars[UE_id]->rxdataF_comp_1[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
// UE 0
pusch_vars[UE_id]->ul_ch_mag_0[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->ul_ch_magb_0[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->ul_ch_mag_0[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->ul_ch_magb_0[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
pusch_vars[UE_id]->ul_ch_mag_0[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
pusch_vars[UE_id]->ul_ch_magb_0[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
for (i=0; i<fp->nb_antennas_rx; i++) {
pusch_vars[UE_id]->ul_ch_mag_0[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
pusch_vars[UE_id]->ul_ch_magb_0[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
// UE 1
pusch_vars[UE_id]->ul_ch_mag_1[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->ul_ch_magb_1[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->ul_ch_mag_1[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pusch_vars[UE_id]->ul_ch_magb_1[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
pusch_vars[UE_id]->ul_ch_mag_1[eNB_id][i] = (int32_t*)malloc16( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
pusch_vars[UE_id]->ul_ch_magb_1[eNB_id][i] = (int32_t*)malloc16( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
for (i=0; i<fp->nb_antennas_rx; i++) {
pusch_vars[UE_id]->ul_ch_mag_1[eNB_id][i] = (int32_t*)malloc16( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
pusch_vars[UE_id]->ul_ch_magb_1[eNB_id][i] = (int32_t*)malloc16( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
}//cooperation_flag
} //eNB_id
......@@ -1374,15 +1342,15 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
return(-1);
}
for (j=0; j<eNB->frame_parms.nb_antennas_tx; j++) {
eNB->dl_precoder_SeNB[eNB_id][j] = (int *)malloc16(2*sizeof(int)*(eNB->frame_parms.ofdm_symbol_size)); // repeated format (hence the '2*')
for (j=0; j<fp->nb_antennas_tx; j++) {
eNB->dl_precoder_SeNB[eNB_id][j] = (int *)malloc16(2*sizeof(int)*(fp->ofdm_symbol_size)); // repeated format (hence the '2*')
if (eNB->dl_precoder_SeNB[eNB_id][j]) {
#ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] allocated at %p\n",eNB_id,j,
eNB->dl_precoder_SeNB[eNB_id][j]);
#endif
memset(eNB->dl_precoder_SeNB[eNB_id][j],0,2*sizeof(int)*(eNB->frame_parms.ofdm_symbol_size));
memset(eNB->dl_precoder_SeNB[eNB_id][j],0,2*sizeof(int)*(fp->ofdm_symbol_size));
} else {
printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] not allocated\n",eNB_id,j);
return(-1);
......
......@@ -2664,8 +2664,10 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
uint8_t mi,
uint16_t si_rnti,
uint16_t ra_rnti,
uint16_t p_rnti,
uint8_t L,
uint8_t format_si,
uint8_t format_p,
uint8_t format_ra,
uint8_t format_c,
uint8_t sizeof_bits,
......@@ -2797,6 +2799,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
#endif
if (((L>1) && ((crc == si_rnti)||
(crc == p_rnti)||
(crc == ra_rnti)))||
(crc == pdcch_vars[eNB_id]->crnti)) {
dci_alloc[*dci_cnt].dci_length = sizeof_bits;
......@@ -2831,6 +2834,9 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
if (crc==si_rnti) {
dci_alloc[*dci_cnt].format = format_si;
*dci_cnt = *dci_cnt+1;
} else if (crc==p_rnti) {
dci_alloc[*dci_cnt].format = format_p;
*dci_cnt = *dci_cnt+1;
} else if (crc==ra_rnti) {
dci_alloc[*dci_cnt].format = format_ra;
// store first nCCE of group for PUCCH transmission of ACK/NAK
......@@ -3118,7 +3124,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
if (ue->prach_resources[eNB_id])
ra_rnti = ue->prach_resources[eNB_id]->ra_RNTI;
// First check common search spaces at aggregation 4 (SI_RNTI and RA_RNTI format 0/1A),
// First check common search spaces at aggregation 4 (SI_RNTI, P_RNTI and RA_RNTI format 0/1A),
// and UE_SPEC format0 (PUSCH) too while we're at it
dci_decoding_procedure0(pdcch_vars,1,subframe,
dci_alloc,
......@@ -3127,9 +3133,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
2,
format1A,
format1A,
format1A,
format0,
format1A_size_bits,
format1A_size_bytes,
......@@ -3144,7 +3152,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
// Now check common search spaces at aggregation 4 (SI_RNTI and RA_RNTI and C-RNTI format 1C),
// Now check common search spaces at aggregation 4 (SI_RNTI,P_RNTI and RA_RNTI and C-RNTI format 1C),
// and UE_SPEC format0 (PUSCH) too while we're at it
dci_decoding_procedure0(pdcch_vars,1,subframe,
dci_alloc,
......@@ -3153,10 +3161,12 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
2,
format1C,
format1C,
format1C,
format1C,
format1C_size_bits,
format1C_size_bytes,
&dci_cnt,
......@@ -3170,7 +3180,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
// Now check common search spaces at aggregation 8 (SI_RNTI and RA_RNTI format 1A),
// Now check common search spaces at aggregation 8 (SI_RNTI,P_RNTI and RA_RNTI format 1A),
// and UE_SPEC format0 (PUSCH) too while we're at it
// printf("[DCI search] doing common search/format0 aggregation 3\n");
#ifdef DEBUG_DCI_DECODING
......@@ -3182,10 +3192,12 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
frame_parms,
mi,
SI_RNTI,
P_RNTI,
ra_rnti,
3,
format1A,
format1A,
format1A,
format0,
format1A_size_bits,
format1A_size_bytes,
......@@ -3209,7 +3221,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
3,
P_RNTI,
3,
format1C,
format1C,
format1C,
format1C,
......@@ -3241,7 +3255,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
3,
P_RNTI,
3,
format1A,
format1A,
format1A,
format0,
......@@ -3268,7 +3284,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
2,
P_RNTI,
2,
format1A,
format1A,
format1A,
format0,
......@@ -3299,9 +3317,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
1,
format1A,
format1A,
format1A,
format0,
format0_size_bits,
format0_size_bytes,
......@@ -3326,9 +3346,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
0,
format1A,
format1A,
format1A,
format0,
format0_size_bits,
format0_size_bytes,
......@@ -3357,9 +3379,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
0,
format1A,
format1A,
format1A,
format1,
format1_size_bits,
format1_size_bytes,
......@@ -3386,9 +3410,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
1,
format1A,
format1A,
format1A,
format1,
format1_size_bits,
format1_size_bytes,
......@@ -3416,7 +3442,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
2,
P_RNTI,
2,
format1A,
format1A,
format1A,
format1,
......@@ -3446,9 +3474,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
3,
format1A,
format1A,
format1A,
format1,
format1_size_bits,
format1_size_bytes,
......@@ -3479,9 +3509,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
0,
format1A,
format1A,
format1A,
format2A,
format2A_size_bits,
format2A_size_bytes,
......@@ -3508,9 +3540,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
1,
format1A,
format1A,
format1A,
format2A,
format2A_size_bits,
format2A_size_bytes,
......@@ -3537,9 +3571,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
2,
format1A,
format1A,
format1A,
format2A,
format2A_size_bits,
format2A_size_bytes,
......@@ -3567,9 +3603,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
3,
format1A,
format1A,
format1A,
format2A,
format2A_size_bits,
format2A_size_bytes,
......@@ -3591,9 +3629,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
0,
format1A,
format1A,
format1A,
format2,
format2_size_bits,
format2_size_bytes,
......@@ -3620,9 +3660,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
1,
format1A,
format1A,
format1A,
format2,
format2_size_bits,
format2_size_bytes,
......@@ -3649,9 +3691,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
2,
format1A,
format1A,
format1A,
format2,
format2_size_bits,
format2_size_bytes,
......@@ -3679,9 +3723,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
3,
format1A,
format1A,
format1A,
format2,
format2_size_bits,
format2_size_bytes,
......@@ -3706,9 +3752,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
0,
format1A,
format1A,
format1A,
format1E_2A_M10PRB,
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t),
......@@ -3736,9 +3784,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
1,
format1A,
format1A,
format1A,
format1E_2A_M10PRB,
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t),
......@@ -3765,9 +3815,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
2,
format1A,
format1A,
format1A,
format1E_2A_M10PRB,
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t),
......@@ -3796,9 +3848,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
3,
format1A,
format1A,
format1A,
format1E_2A_M10PRB,
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t),
......
......@@ -729,6 +729,7 @@ typedef enum {format0,
typedef enum {
SI_PDSCH=0,
RA_PDSCH,
P_PDSCH,
PDSCH,
PDSCH1,
PMCH
......
......@@ -1339,6 +1339,14 @@ int32_t generate_drs_pusch(PHY_VARS_UE *phy_vars_ue,
@param frame_parms Pointer to a LTE_DL_FRAME_PARMS structure (eNB or UE)*/
void init_ul_hopping(LTE_DL_FRAME_PARMS *frame_parms);
/*!
\brief This function implements the initialization of paging parameters for UE (See Section 7, 36.304).It must be called after setting IMSImod1024 during UE startup and after receiving SIB2
@param ue Pointer to UE context
@param defaultPagingCycle T from 36.304 (0=32,1=64,2=128,3=256)
@param nB nB from 36.304 (0=4T,1=2T,2=T,3=T/2,4=T/4,5=T/8,6=T/16,7=T/32*/
int init_ue_paging_info(PHY_VARS_UE *ue, long defaultPagingCycle, long nB);
int32_t compareints (const void * a, const void * b);
......
......@@ -53,11 +53,6 @@
# define msg mexPrintf
#else
# ifdef OPENAIR2
# if ENABLE_RAL
# include "collection/hashtable/hashtable.h"
# include "COMMON/ral_messages_types.h"
# include "UTIL/queue.h"
# endif
# include "log.h"
# define msg(aRGS...) LOG_D(PHY, ##aRGS)
# else
......@@ -132,10 +127,6 @@ static inline void* malloc16_clear( size_t size )
#include "PHY/TOOLS/defs.h"
#include "platform_types.h"
#ifdef OPENAIR_LTE
//#include "PHY/LTE_ESTIMATION/defs.h"
#include "PHY/LTE_TRANSPORT/defs.h"
#include <pthread.h>
......@@ -178,16 +169,6 @@ typedef struct UE_SCAN_INFO_s {
int32_t freq_offset_Hz[3][10];
} UE_SCAN_INFO_t;
#if ENABLE_RAL
typedef struct ral_threshold_phy_s {
SLIST_ENTRY(ral_threshold_phy_s) ral_thresholds;
ral_threshold_t threshold;
ral_th_action_t th_action;
ral_link_param_t link_param;
long timer_id;
} ral_threshold_phy_t;
#endif
/// Top-level PHY Data Structure for RN
typedef struct {
/// Module ID indicator for this instance
......@@ -647,17 +628,25 @@ typedef struct {
LTE_UE_PDSCH_FLP *pdsch_vars_flp[NUMBER_OF_CONNECTED_eNB_MAX+1];
LTE_UE_PDSCH *pdsch_vars_SI[NUMBER_OF_CONNECTED_eNB_MAX+1];
LTE_UE_PDSCH *pdsch_vars_ra[NUMBER_OF_CONNECTED_eNB_MAX+1];
LTE_UE_PDSCH *pdsch_vars_p[NUMBER_OF_CONNECTED_eNB_MAX+1];
LTE_UE_PDSCH *pdsch_vars_MCH[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_PBCH *pbch_vars[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_PDCCH *pdcch_vars[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_DLSCH_t *dlsch[NUMBER_OF_CONNECTED_eNB_MAX][2];
LTE_UE_ULSCH_t *ulsch[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_eNB_MAX],*dlsch_ra[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_DLSCH_t *dlsch_ra[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_DLSCH_t *dlsch_p[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_eNB_MAX];
// This is for SIC in the UE, to store the reencoded data
LTE_eNB_DLSCH_t *dlsch_eNB[NUMBER_OF_CONNECTED_eNB_MAX];
//Paging parameters
uint32_t IMSImod1024;
uint32_t PF;
uint32_t PO;
// For abstraction-purposes only
uint8_t sr[10];
uint8_t pucch_sel[10];
......@@ -712,6 +701,8 @@ typedef struct {
int dlsch_SI_errors[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_ra_received[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_ra_errors[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_p_received[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_p_errors[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mch_received_sf[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mch_received[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mcch_received[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
......@@ -835,11 +826,6 @@ typedef struct {
/// RF and Interface devices per CC
openair0_device rfdevice;
#if ENABLE_RAL
hash_table_t *ral_thresholds_timed;
SLIST_HEAD(ral_thresholds_gen_poll_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
SLIST_HEAD(ral_thresholds_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX];
#endif
} PHY_VARS_UE;
......@@ -851,6 +837,5 @@ typedef struct {
#include "PHY/LTE_ESTIMATION/defs.h"
#include "SIMULATION/ETH_TRANSPORT/defs.h"
#endif //OPENAIR_LTE
#endif // __PHY_DEFS__H__
......@@ -1627,8 +1627,10 @@ void restart_phy(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uint8_t eNB_id,uint8_t ab
ue->dlsch_fer[eNB_id] = 0;
ue->dlsch_SI_received[eNB_id] = 0;
ue->dlsch_ra_received[eNB_id] = 0;
ue->dlsch_p_received[eNB_id] = 0;
ue->dlsch_SI_errors[eNB_id] = 0;
ue->dlsch_ra_errors[eNB_id] = 0;
ue->dlsch_p_errors[eNB_id] = 0;
ue->dlsch_mch_received[eNB_id] = 0;
......@@ -2027,6 +2029,35 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
}
}
else if ((dci_alloc_rx[i].rnti == P_RNTI) &&
((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) {
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i);
#endif
if (generate_ue_dlsch_params_from_dci(frame_rx,
subframe_rx,
(void *)&dci_alloc_rx[i].dci_pdu,
SI_RNTI,
dci_alloc_rx[i].format,
&ue->dlsch_SI[eNB_id],
&ue->frame_parms,
ue->pdsch_config_dedicated,
SI_RNTI,
0,
P_RNTI)==0) {
ue->dlsch_p_received[eNB_id]++;
LOG_D(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH P_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C");
//dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
}
}
else if ((ue->prach_resources[eNB_id]) &&
(dci_alloc_rx[i].rnti == ue->prach_resources[eNB_id]->ra_RNTI) &&
(dci_alloc_rx[i].format == format1A)) {
......@@ -2440,6 +2471,9 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
case RA_PDSCH:
pdsch_vars = ue->pdsch_vars_ra[eNB_id];
break;
case P_PDSCH:
pdsch_vars = ue->pdsch_vars_p[eNB_id];
break;
case PDSCH:
pdsch_vars = ue->pdsch_vars[eNB_id];
break;
......@@ -2557,6 +2591,14 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
ue->dlsch_SI[eNB_id]->harq_processes[0]->b,
ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3);
break;
case P_PDSCH:
mac_xface->ue_decode_p(ue->Mod_id,
CC_id,
frame_rx,
eNB_id,
ue->dlsch_SI[eNB_id]->harq_processes[0]->b,
ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3);
break;
case RA_PDSCH:
process_rar(ue,proc,eNB_id,mode,abstraction_flag);
break;
......@@ -2630,6 +2672,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
if (ue->dlsch_SI[eNB_id])
ue->dlsch_SI[eNB_id]->active = 0;
if (ue->dlsch_p[eNB_id])
ue->dlsch_p[eNB_id]->active = 0;
if (ue->dlsch_ra[eNB_id])
ue->dlsch_ra[eNB_id]->active = 0;
......@@ -2726,6 +2770,20 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->frame_parms.symbols_per_tti>>1,
abstraction_flag);
}
// do procedures for SI-RNTI
if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) {
ue_pdsch_procedures(ue,
proc,
eNB_id,
P_PDSCH,
ue->dlsch_p[eNB_id],
NULL,
ue->pdcch_vars[eNB_id]->num_pdcch_symbols,
ue->frame_parms.symbols_per_tti>>1,
abstraction_flag);
}
// do procedures for RA-RNTI
if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) {
ue_pdsch_procedures(ue,
......@@ -2821,6 +2879,30 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
abstraction_flag);
ue->dlsch_SI[eNB_id]->active = 0;
}
// do procedures for P-RNTI
if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) {
ue_pdsch_procedures(ue,
proc,
eNB_id,
P_PDSCH,
ue->dlsch_p[eNB_id],
NULL,
1+(ue->frame_parms.symbols_per_tti>>1),
ue->frame_parms.symbols_per_tti-1,
abstraction_flag);
ue_dlsch_procedures(ue,
proc,
eNB_id,
P_PDSCH,
ue->dlsch_p[eNB_id],
NULL,
&ue->dlsch_p_errors[eNB_id],
mode,
abstraction_flag);
ue->dlsch_p[eNB_id]->active = 0;
}
// do procedures for RA-RNTI
if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) {
ue_pdsch_procedures(ue,
......
......@@ -129,7 +129,8 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_
}
void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4], double **s_re,double **s_im,double **r_re,double **r_im,FILE *csv_fd) {
void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4],
double s_re[2][30720*2],double s_im[2][30720*2],double r_re[2][30720*2],double r_im[2][30720*2],FILE *csv_fd) {
int i,u;
int aa,aarx,aatx;
......@@ -1266,7 +1267,7 @@ int main(int argc, char **argv)
double snr_step=1,input_snr_step=1, snr_int=30;
LTE_DL_FRAME_PARMS *frame_parms;
double **s_re,**s_im,**r_re,**r_im;
double s_re[2][30720*2],s_im[2][30720*2],r_re[2][30720*2],r_im[2][30720*2];
double forgetting_factor=0.0; //in [0,1] 0 means a new channel every time, 1 means keep the same channel
......@@ -1798,13 +1799,6 @@ int main(int argc, char **argv)
frame_parms = &eNB->frame_parms;
s_re = malloc(2*sizeof(double*));
s_im = malloc(2*sizeof(double*));
r_re = malloc(2*sizeof(double*));
r_im = malloc(2*sizeof(double*));
// r_re0 = malloc(2*sizeof(double*));
// r_im0 = malloc(2*sizeof(double*));
nsymb = (eNB->frame_parms.Ncp == 0) ? 14 : 12;
printf("Channel Model= (%s,%d)\n",channel_model_input, channel_model);
......@@ -1948,14 +1942,6 @@ int main(int argc, char **argv)
}
*/
for (i=0; i<2; i++) {
s_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
s_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
r_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
r_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
}
UE->pdcch_vars[0]->crnti = n_rnti;
// Fill in UL_alloc
......@@ -2329,165 +2315,7 @@ int main(int argc, char **argv)
} // common_flag == 0
/*
num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci,
num_common_dci,
dci_alloc,
0,
AMP,
&eNB->frame_parms,
eNB->common_vars.txdataF[eNB_id],
subframe);
if (n_frames==1) printf("Generated DCI, num_pdcch_symbols %d\n",num_pdcch_symbols_2);
if (num_pdcch_symbols_2 > num_pdcch_symbols) {
printf("Error: given num_pdcch_symbols not big enough (%d > %d)\n",num_pdcch_symbols_2,num_pdcch_symbols);
exit(-1);
}
for (k=0; k<n_users; k++) {
for (int cw=0; cw<Kmimo; cw++) {
coded_bits_per_codeword = get_G(&eNB->frame_parms,
eNB->dlsch[k][cw]->harq_processes[0]->nb_rb,
eNB->dlsch[k][cw]->harq_processes[0]->rb_alloc,
get_Qm(eNB->dlsch[k][cw]->harq_processes[0]->mcs),
eNB->dlsch[k][cw]->harq_processes[0]->Nl,
num_pdcch_symbols,
0,subframe);
tbs = eNB->dlsch[k][cw]->harq_processes[0]->TBS;
rate = (double)tbs/(double)coded_bits_per_codeword;
if ((SNR==snr0) && (trials==0) && (round==0))
printf("User %d, cw %d: Rate = %f (%f bits/dim) (G %d, TBS %d, mod %d, pdcch_sym %d, ndi %d)\n",
k,cw,rate,rate*get_Qm(eNB->dlsch[k][0]->harq_processes[0]->mcs),
coded_bits_per_codeword,
tbs,
get_Qm(eNB->dlsch[k][0]->harq_processes[0]->mcs),
num_pdcch_symbols,
eNB->dlsch[0][0]->harq_processes[0]->round);
// use the PMI from previous trial
if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) {
eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,eNB->frame_parms.N_RB_DL);
UE->dlsch[0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
if (n_users>1)
eNB->dlsch[1][0]->harq_processes[0]->pmi_alloc = (eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc ^ 0x1555);
}
start_meas(&eNB->dlsch_encoding_stats);
if (dlsch_encoding(((cw==0) ? input_buffer0[k] : input_buffer1[k]),
&eNB->frame_parms,
num_pdcch_symbols,
eNB->dlsch[k][cw],
0,subframe,
&eNB->dlsch_rate_matching_stats,
&eNB->dlsch_turbo_encoding_stats,
&eNB->dlsch_interleaving_stats
)<0)
exit(-1);
stop_meas(&eNB->dlsch_encoding_stats);
eNB->dlsch[k][cw]->rnti = (common_flag==0) ? n_rnti+k : SI_RNTI;
start_meas(&eNB->dlsch_scrambling_stats);
dlsch_scrambling(&eNB->frame_parms,
0,
eNB->dlsch[k][cw],
coded_bits_per_codeword,
0,
subframe<<1);
stop_meas(&eNB->dlsch_scrambling_stats);
if (n_frames==1) {
for (s=0; s<eNB->dlsch[k][cw]->harq_processes[0]->C; s++) {
if (s<eNB->dlsch[k][cw]->harq_processes[0]->Cminus)
Kr = eNB->dlsch[k][cw]->harq_processes[0]->Kminus;
else
Kr = eNB->dlsch[k][cw]->harq_processes[0]->Kplus;
Kr_bytes = Kr>>3;
for (i=0; i<Kr_bytes; i++)
printf("%d : (%x)\n",i,eNB->dlsch[k][cw]->harq_processes[0]->c[s][i]);
}
}
}
start_meas(&eNB->dlsch_modulation_stats);
re_allocated = dlsch_modulation(eNB->common_vars.txdataF[eNB_id],
AMP,
subframe,
&eNB->frame_parms,
num_pdcch_symbols,
eNB->dlsch[k][0],
(transmission_mode==3)||(transmission_mode==4) ? eNB->dlsch[k][1] : NULL);
(void)re_allocated;
stop_meas(&eNB->dlsch_modulation_stats);
} //n_users
generate_pilots(eNB,
eNB->common_vars.txdataF[eNB_id],
AMP,
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
start_meas(&eNB->ofdm_mod_stats);
do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
eNB->common_vars.txdata[eNB_id],
(subframe*2),
&eNB->frame_parms);
do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
eNB->common_vars.txdata[eNB_id],
(subframe*2)+1,
&eNB->frame_parms);
stop_meas(&eNB->ofdm_mod_stats);
stop_meas(&eNB->phy_proc_tx);
do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
eNB->common_vars.txdata[eNB_id],
(subframe*2)+2,
&eNB->frame_parms);
if (n_frames==1) {
write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
if (eNB->frame_parms.nb_antennas_tx>1)
write_output("txsigF1.m","txsF1", &eNB->common_vars.txdataF[eNB_id][1][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
}
tx_lev = 0;
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx; aa++) {
tx_lev += signal_energy(&eNB->common_vars.txdata[eNB_id][aa]
[subframe*eNB->frame_parms.samples_per_tti],
eNB->frame_parms.samples_per_tti);
}
tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
if (n_frames==1) {
printf("tx_lev = %d (%d dB)\n",tx_lev,tx_lev_dB);
write_output("txsig0.m","txs0", &eNB->common_vars.txdata[eNB_id][0][subframe* eNB->frame_parms.samples_per_tti],
eNB->frame_parms.samples_per_tti,1,1);
}
}
*/
/*
else { // Read signal from file
i=0;
......@@ -2533,7 +2361,6 @@ int main(int argc, char **argv)
&eNB->frame_parms);
stop_meas(&eNB->ofdm_mod_stats);
stop_meas(&eNB->phy_proc_tx);
// generate next subframe for channel estimation
......@@ -2653,461 +2480,7 @@ int main(int argc, char **argv)
}
/*
if (n_frames==1) {
printf("RX level in null symbol %d\n",dB_fixed(signal_energy(&UE->common_vars.rxdata[0][160+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)));
printf("RX level in data symbol %d\n",dB_fixed(signal_energy(&UE->common_vars.rxdata[0][160+(2*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES)],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)));
printf("rx_level Null symbol %f\n",10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2,256+(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES))));
printf("rx_level data symbol %f\n",10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2,256+(2*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES))));
}
if (eNB->frame_parms.Ncp == 0) { // normal prefix
pilot1 = 4;
pilot2 = 7;
pilot3 = 11;
} else { // extended prefix
pilot1 = 3;
pilot2 = 6;
pilot3 = 9;
}
start_meas(&UE->phy_proc_rx);
// Inner receiver scheduling for 3 slots
for (Ns=(2*subframe); Ns<((2*subframe)+3); Ns++) {
for (l=0; l<pilot2; l++) {
if (n_frames==1)
printf("Ns %d, l %d, l2 %d\n",Ns, l, l+(Ns%2)*pilot2);
start_meas(&UE->ofdm_demod_stats);
slot_fep(UE,
l,
Ns%20,
0,
0,
0);
stop_meas(&UE->ofdm_demod_stats);
if (UE->perfect_ce==1) {
if (awgn_flag==0) {
for(k=0; k<NUMBER_OF_eNB_MAX; k++) {
for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
}
}
}
}
} else {
for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
}
}
}
}
}
if ((Ns==((2*subframe))) && (l==0)) {
lte_ue_measurements(UE,
subframe*UE->frame_parms.samples_per_tti,
1,
0);
if (transmission_mode==5 || transmission_mode==6) {
if (pmi_feedback == 1) {
pmi_feedback = 0;
hold_channel = 1;
goto PMI_FEEDBACK;
}
}
}
if ((Ns==(2*subframe)) && (l==pilot1)) {// process symbols 0,1,2
if (dci_flag == 1) {
UE->UE_mode[0] = PUSCH;
start_meas(&UE->dlsch_rx_pdcch_stats);
rx_pdcch(&UE->common_vars,
UE->pdcch_vars,
&UE->frame_parms,
subframe,
0,
(UE->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
UE->high_speed_flag,
0);
stop_meas(&UE->dlsch_rx_pdcch_stats);
// overwrite number of pdcch symbols
UE->pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols;
dci_cnt = dci_decoding_procedure(UE,
dci_alloc_rx,1,
eNB_id,
subframe);
//printf("dci_cnt %d\n",dci_cnt);
if (dci_cnt==0) {
dlsch_active = 0;
if (round==0) {
dci_errors++;
round=5;
errs[0]++;
//round_trials[0]++;
if (n_frames==1)
printf("DCI error trial %d errs[0] %d\n",trials,errs[0]);
}
// for (i=1;i<=round;i++)
// round_trials[i]--;
// round=5;
}
for (i=0; i<dci_cnt; i++) {
// printf("Generating dlsch parameters for RNTI %x\n",dci_alloc_rx[i].rnti);
if (round == 0) UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->first_tx=1;
if ((dci_alloc_rx[i].rnti == n_rnti) &&
(generate_ue_dlsch_params_from_dci(0,
subframe,
dci_alloc_rx[i].dci_pdu,
dci_alloc_rx[i].rnti,
dci_alloc_rx[i].format,
UE->dlsch[0],
&UE->frame_parms,
UE->pdsch_config_dedicated,
SI_RNTI,
0,
P_RNTI)==0)) {
//dump_dci(&UE->frame_parms,&dci_alloc_rx[i]);
coded_bits_per_codeword = get_G(&eNB->frame_parms,
UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->nb_rb,
UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->rb_alloc_even,
get_Qm(UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs),
UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->Nl,
UE->pdcch_vars[0]->num_pdcch_symbols,
0,subframe);
printf("num_pdcch_symbols %d, G %d, TBS %d\n",UE->pdcch_vars[0]->num_pdcch_symbols,coded_bits_per_codeword,
UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->TBS);
dlsch_active = 1;
} else {
dlsch_active = 0;
if (round==0) {
dci_errors++;
errs[0]++;
//round_trials[0]++;
round=5;
if (n_frames==1)
printf("DCI misdetection trial %d\n",trials);
}
// for (i=1;i<=round;i++)
// round_trials[i]--;
// round=5;
}
}
} // if dci_flag==1
else { //dci_flag == 0
UE->pdcch_vars[0]->crnti = n_rnti;
UE->pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols;
if (round == 0) UE->dlsch[0][0]->harq_processes[0]->first_tx=1;
switch (transmission_mode) {
case 1:
case 2:
generate_ue_dlsch_params_from_dci(0,
subframe,
&DLSCH_alloc_pdu_1[0],
(common_flag==0)? C_RNTI : SI_RNTI,
(common_flag==0)? format1 : format1A,
UE->dlsch[0],
&UE->frame_parms,
UE->pdsch_config_dedicated,
SI_RNTI,
0,
P_RNTI);
break;
case 3:
// printf("Rate: TM3 (before) round %d (%d) first_tx %d\n",round,UE->dlsch[0][0]->harq_processes[0]->round,UE->dlsch[0][0]->harq_processes[0]->first_tx);
generate_ue_dlsch_params_from_dci(0,
subframe,
&DLSCH_alloc_pdu_1[0],
(common_flag==0)? C_RNTI : SI_RNTI,
(common_flag==0)? format2A : format1A,
UE->dlsch[0],
&UE->frame_parms,
UE->pdsch_config_dedicated,
SI_RNTI,
0,
P_RNTI);
// printf("Rate: TM3 (after) round %d (%d) first_tx %d\n",round,UE->dlsch[0][0]->harq_processes[0]->round,UE->dlsch[0][0]->harq_processes[0]->first_tx);
break;
case 4:
generate_ue_dlsch_params_from_dci(0,
subframe,
&DLSCH_alloc_pdu_1[0],
(common_flag==0)? C_RNTI : SI_RNTI,
(common_flag==0)? format2 : format1A,
UE->dlsch[0],
&UE->frame_parms,
UE->pdsch_config_dedicated,
SI_RNTI,
0,
P_RNTI);
break;
case 5:
case 6:
generate_ue_dlsch_params_from_dci(0,
subframe,
&DLSCH_alloc_pdu2_1E[0],
C_RNTI,
format1E_2A_M10PRB,
UE->dlsch[0],
&UE->frame_parms,
UE->pdsch_config_dedicated,
SI_RNTI,
0,
P_RNTI);
break;
}
dlsch_active = 1;
} // if dci_flag == 1
}
if (dlsch_active == 1) {
if ((Ns==(1+(2*subframe))) && (l==0)) {// process PDSCH symbols 1,2,3,4,5,(6 Normal Prefix)
if ((transmission_mode == 5) &&
(UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->dl_power_off==0) &&
(UE->use_ia_receiver ==1)) {
dual_stream_UE = 1;
} else {
dual_stream_UE = 0;
}
start_meas(&UE->dlsch_llr_stats);
for (m=UE->pdcch_vars[0]->num_pdcch_symbols;
m<pilot2;
m++) {
if (rx_pdsch(UE,
PDSCH,
eNB_id,
eNB_id_i,
subframe,
m,
(m==UE->pdcch_vars[0]->num_pdcch_symbols)?1:0,
dual_stream_UE,
i_mod,
UE->dlsch[0][0]->current_harq_pid)==-1) {
dlsch_active = 0;
break;
}
}
stop_meas(&UE->dlsch_llr_stats);
}
if ((Ns==(1+(2*subframe))) && (l==pilot1)) {
// process symbols (6 Extended Prefix),7,8,9
start_meas(&UE->dlsch_llr_stats);
for (m=pilot2;
m<pilot3;
m++) {
if (rx_pdsch(UE,
PDSCH,
eNB_id,
eNB_id_i,
subframe,
m,
0,
dual_stream_UE,
i_mod,
UE->dlsch[0][0]->current_harq_pid)==-1) {
dlsch_active=0;
break;
}
}
stop_meas(&UE->dlsch_llr_stats);
}
if ((Ns==(2+(2*subframe))) && (l==0)) { // process symbols 10,11,(12,13 Normal Prefix) do deinterleaving for TTI
start_meas(&UE->dlsch_llr_stats);
for (m=pilot3;
m<UE->frame_parms.symbols_per_tti;
m++) {
if (rx_pdsch(UE,
PDSCH,
eNB_id,
eNB_id_i,
subframe,
m,
0,
dual_stream_UE,
i_mod,
UE->dlsch[0][0]->current_harq_pid)==-1) {
dlsch_active=0;
break;
}
}
stop_meas(&UE->dlsch_llr_stats);
}
if (test_perf ==0 ) {
if ((n_frames==1) && (Ns==(2+(2*subframe))) && (l==0)) {
write_output("ch0.m","ch0",eNB2UE[0]->ch[0],eNB2UE[0]->channel_length,1,8);
if (eNB->frame_parms.nb_antennas_tx>1)
write_output("ch1.m","ch1",eNB2UE[0]->ch[eNB->frame_parms.nb_antennas_rx],eNB2UE[0]->channel_length,1,8);
//common vars
write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
write_output("rxsigF0.m","rxsF0", &UE->common_vars.rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
if (UE->frame_parms.nb_antennas_rx>1) {
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
write_output("rxsigF1.m","rxsF1", UE->common_vars.rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
}
write_output("dlsch00_r0.m","dl00_r0",
&(UE->common_vars.dl_ch_estimates[eNB_id][0][0]),
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
if (UE->frame_parms.nb_antennas_rx>1)
write_output("dlsch01_r0.m","dl01_r0",
&(UE->common_vars.dl_ch_estimates[eNB_id][1][0]),
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
if (eNB->frame_parms.nb_antennas_tx>1)
write_output("dlsch10_r0.m","dl10_r0",
&(UE->common_vars.dl_ch_estimates[eNB_id][2][0]),
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1))
write_output("dlsch11_r0.m","dl11_r0",
&(UE->common_vars.dl_ch_estimates[eNB_id][3][0]),
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
//pdsch_vars
dump_dlsch2(UE,eNB_id,coded_bits_per_codeword,round);
//dump_dlsch2(UE,eNB_id_i,coded_bits_per_codeword);
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
//pdcch_vars
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],300*3,1,1);
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNB_id]->rxdataF_comp[0],4*300,1,1);
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[eNB_id]->llr,2400,1,4);
}
}
}
}
}
//saving PMI in case of Transmission Mode > 5
if(abstx) {
if (trials==0 && round==0 && transmission_mode>=5) {
for (iii=0; iii<NB_RB; iii++) {
//fprintf(csv_fd, "%d, %d", (UE->lte_ue_pdsch_vars[eNB_id]->pmi_ext[iii]),(UE->lte_ue_pdsch_vars[eNB_id_i]->pmi_ext[iii]));
fprintf(csv_fd,"%x,%x,",(UE->pdsch_vars[eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id]->pmi_ext[iii]));
printf("%x ",(UE->pdsch_vars[eNB_id]->pmi_ext[iii]));
}
}
}
for (int cw=Kmimo-1; cw>=0; cw--) {
UE->dlsch[0][cw]->rnti = (common_flag==0) ? n_rnti: SI_RNTI;
coded_bits_per_codeword = get_G(&eNB->frame_parms,
eNB->dlsch[0][cw]->harq_processes[0]->nb_rb,
eNB->dlsch[0][cw]->harq_processes[0]->rb_alloc,
get_Qm(eNB->dlsch[0][cw]->harq_processes[0]->mcs),
eNB->dlsch[0][cw]->harq_processes[0]->Nl,
num_pdcch_symbols,
0,subframe);
UE->dlsch[0][cw]->harq_processes[UE->dlsch[0][cw]->current_harq_pid]->G = coded_bits_per_codeword;
// calculate uncoded BLER
uncoded_ber=0;
for (i=0;i<coded_bits_per_codeword;i++)
if (eNB->dlsch[0][0]->harq_processes[0]->e[i] != (UE->pdsch_vars[0]->llr[0][i]<0)) {
uncoded_ber_bit[i] = 1;
uncoded_ber++;
}
else
uncoded_ber_bit[i] = 0;
uncoded_ber/=coded_bits_per_codeword;
avg_ber += uncoded_ber;
if (n_frames==1)
write_output("uncoded_ber_bit.m","uncoded_ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
start_meas(&UE->dlsch_unscrambling_stats);
dlsch_unscrambling(&UE->frame_parms,
0,
UE->dlsch[0][cw],
coded_bits_per_codeword,
UE->pdsch_vars[eNB_id]->llr[cw],
0,
subframe<<1);
stop_meas(&UE->dlsch_unscrambling_stats);
start_meas(&UE->dlsch_decoding_stats);
ret = dlsch_decoding(UE,
UE->pdsch_vars[eNB_id]->llr[cw],
&UE->frame_parms,
UE->dlsch[0][cw],
UE->dlsch[0][cw]->harq_processes[UE->dlsch[0][cw]->current_harq_pid],
subframe,
UE->dlsch[0][cw]->current_harq_pid,
1,llr8_flag);
stop_meas(&UE->dlsch_decoding_stats);
if (cw==1) {
if (ret <= UE->dlsch[0][cw]->max_turbo_iterations) {
} else {
errs2[round]++;
}
}
}
stop_meas(&UE->phy_proc_rx);
*/
if (UE->dlsch_errors[0] == 0) {
......@@ -3120,45 +2493,7 @@ int main(int argc, char **argv)
UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->TBS;
TB0_active = 0;
if (UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->mimo_mode == LARGE_CDD) { //try to decode second stream using SIC
//for (round = 0 ; round < UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->round ; round++) {
// re-encoding of first stream
//dlsch0_ue_harq = UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid];
//dlsch0_eNB_harq = UE->dlsch[eNB_id]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid];
//dlsch0_eNB_harq->mimo_mode = LARGE_CDD;
//dlsch0_eNB_harq->rb_alloc[0] = dlsch0_ue_harq->rb_alloc_even[0];
//dlsch0_eNB_harq->nb_rb = dlsch0_ue_harq->nb_rb;
//dlsch0_eNB_harq->mcs = dlsch0_ue_harq->mcs;
//dlsch0_eNB_harq->rvidx = dlsch0_ue_harq->rvidx;
//dlsch0_eNB_harq->Nl = dlsch0_ue_harq->Nl;
//dlsch0_eNB_harq->TBS = dlsch0_ue_harq->TBS;
//dlsch0_eNB_harq->dl_power_off = dlsch0_ue_harq->dl_power_off;
//dlsch0_eNB_harq->status = dlsch0_ue_harq->status;
//UE->dlsch[eNB_id]->active = UE->dlsch[eNB_id][0]->active;
//UE->dlsch[eNB_id]->rnti = UE->dlsch[eNB_id][0]->rnti;
//dlsch_encoding(UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->b,
// &UE->frame_parms,
// num_pdcch_symbols,
// UE->dlsch[0],
// 0,subframe,
// &UE->dlsch_rate_matching_stats,
// &UE->dlsch_turbo_encoding_stats,
// &UE->dlsch_interleaving_stats
// );
//scrambling
//modulation
//stripping (from matched filter output?)
//detection of second stream
}
} // DLSCH received ok
else {
errs[round]++;
......@@ -3449,13 +2784,14 @@ int main(int argc, char **argv)
printf("eNB TX function statistics (per 1ms subframe)\n\n");
std_phy_proc_tx = sqrt((double)eNB->phy_proc_tx.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
2)/eNB->phy_proc_tx.trials - pow((double)eNB->phy_proc_tx.diff/eNB->phy_proc_tx.trials/cpu_freq_GHz/1000,2));
printf("Total PHY proc tx :%f us (%d trials)\n",(double)eNB->phy_proc_tx.diff/eNB->phy_proc_tx.trials/cpu_freq_GHz/1000.0,eNB->phy_proc_tx.trials);
printf("|__ Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n",std_phy_proc_tx, t_tx_max, t_tx_min, tx_median, tx_q1, tx_q3,
n_tx_dropped);
std_phy_proc_tx_ifft = sqrt((double)eNB->ofdm_mod_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
2)/eNB->ofdm_mod_stats.trials - pow((double)eNB->ofdm_mod_stats.diff/eNB->ofdm_mod_stats.trials/cpu_freq_GHz/1000,2));
printf("OFDM_mod time :%f us (%d trials)\n",(double)eNB->ofdm_mod_stats.diff/eNB->ofdm_mod_stats.trials/cpu_freq_GHz/1000.0,eNB->ofdm_mod_stats.trials);
printf("|__ Statistcs std: %fus median %fus q1 %fus q3 %fus \n",std_phy_proc_tx_ifft, tx_ifft_median, tx_ifft_q1, tx_ifft_q3);
printf("Total PHY proc tx :%f us (%d trials)\n",(double)eNB->phy_proc_tx.diff/eNB->phy_proc_tx.trials/cpu_freq_GHz/1000.0,eNB->phy_proc_tx.trials);
printf("|__ Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n",std_phy_proc_tx, t_tx_max, t_tx_min, tx_median, tx_q1, tx_q3,
n_tx_dropped);
std_phy_proc_tx_mod = sqrt((double)eNB->dlsch_modulation_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
2)/eNB->dlsch_modulation_stats.trials - pow((double)eNB->dlsch_modulation_stats.diff/eNB->dlsch_modulation_stats.trials/cpu_freq_GHz/1000,2));
printf("DLSCH modulation time :%f us (%d trials)\n",(double)eNB->dlsch_modulation_stats.diff/eNB->dlsch_modulation_stats.trials/cpu_freq_GHz/1000.0,
......@@ -3809,24 +3145,6 @@ int main(int argc, char **argv)
}
printf("Freeing channel I/O\n");
for (i=0; i<2; i++) {
free(s_re[i]);
free(s_im[i]);
free(r_re[i]);
free(r_im[i]);
}
free(s_re);
free(s_im);
free(r_re);
free(r_im);
// lte_sync_time_free();
// printf("[MUMIMO] mcs %d, mcsi %d, offset %d, bler %f\n",mcs,mcs_i,offset_mumimo_llr_drange_fix,((double)errs[0])/((double)round_trials[0]));
return(0);
}
......
......@@ -82,6 +82,7 @@
#define BCCH_PAYLOAD_SIZE_MAX 128
#define CCCH_PAYLOAD_SIZE_MAX 128
#define PCCH_PAYLOAD_SIZE_MAX 128
#define SCH_PAYLOAD_SIZE_MAX 4096
/// Logical channel ids from 36-311 (Note BCCH is not specified in 36-311, uses the same as first DRB)
......@@ -263,6 +264,10 @@ typedef struct {
typedef struct {
uint8_t payload[BCCH_PAYLOAD_SIZE_MAX] ;
} __attribute__((__packed__))BCCH_PDU;
/*! \brief BCCH payload */
typedef struct {
uint8_t payload[PCCH_PAYLOAD_SIZE_MAX] ;
} __attribute__((__packed__))PCCH_PDU;
#ifdef Rel10
/*! \brief MCCH payload */
......@@ -291,6 +296,8 @@ typedef struct {
#define CCCH_LCHANID 0
/*!\brief Values of BCCH logical channel */
#define BCCH 3 // SI
/*!\brief Values of PCCH logical channel */
#define PCCH 4 // Paging
/*!\brief Value of CCCH / SRB0 logical channel */
#define CCCH 0 // srb0
/*!\brief DCCH / SRB1 logical channel */
......@@ -1104,6 +1111,8 @@ typedef struct {
time_stats_t rx_mch_sdu;
/// UE BCCH rx processing time including RLC interface (mac_rrc_data_ind)
time_stats_t rx_si;
/// UE PCCH rx processing time including RLC interface (mac_rrc_data_ind)
time_stats_t rx_p;
} UE_MAC_INST;
/*! \brief ID of the neighboring cells used for HO*/
typedef struct {
......
......@@ -480,6 +480,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
LOG_I(MAC,"[MAIN] init UE MAC functions \n");
mac_xface->ue_decode_si = ue_decode_si;
mac_xface->ue_decode_p = ue_decode_p;
mac_xface->ue_send_sdu = ue_send_sdu;
#ifdef Rel10
mac_xface->ue_send_mch_sdu = ue_send_mch_sdu;
......
......@@ -385,6 +385,8 @@ void mac_out_of_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t CH_ind
void ue_decode_si(module_id_t module_idP, int CC_id,frame_t frame, uint8_t CH_index, void *pdu, uint16_t len);
void ue_decode_p(module_id_t module_idP, int CC_id,frame_t frame, uint8_t CH_index, void *pdu, uint16_t len);
void ue_send_sdu(module_id_t module_idP, uint8_t CC_id,frame_t frame, uint8_t *sdu,uint16_t sdu_len,uint8_t CH_index);
......
......@@ -525,6 +525,41 @@ void ue_decode_si(module_id_t module_idP,int CC_id,frame_t frameP, uint8_t eNB_i
}
}
void ue_decode_p(module_id_t module_idP,int CC_id,frame_t frameP, uint8_t eNB_index, void *pdu,uint16_t len)
{
start_meas(&UE_mac_inst[module_idP].rx_p);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_IN);
LOG_D(MAC,"[UE %d] Frame %d Sending Paging message to RRC (LCID Id %d,len %d)\n",module_idP,frameP,PCCH,len);
mac_rrc_data_ind(module_idP,
CC_id,
frameP,0, // unknown subframe
P_RNTI,
PCCH,
(uint8_t *)pdu,
len,
ENB_FLAG_NO,
eNB_index,
0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_OUT);
stop_meas(&UE_mac_inst[module_idP].rx_p);
if (opt_enabled == 1) {
trace_pdu(0,
(uint8_t *)pdu,
len,
module_idP,
4,
P_RNTI,
UE_mac_inst[module_idP].subframe,
0,
0);
LOG_D(OPT,"[UE %d][BCH] Frame %d trace pdu for CC_id %d rnti %x with size %d\n",
module_idP, frameP, CC_id, P_RNTI, len);
}
}
#ifdef Rel10
unsigned char *parse_mch_header(unsigned char *mac_header,
unsigned char *num_sdu,
......
......@@ -146,6 +146,9 @@ typedef struct {
/// Send a received SI sdu
void (*ue_decode_si)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
/// Send a received Paging sdu
void (*ue_decode_p)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
/// Send a received DLSCH sdu to MAC
void (*ue_send_sdu)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,uint8_t *sdu,uint16_t sdu_len,uint8_t CH_index);
......
......@@ -397,6 +397,10 @@ mac_rrc_data_ind(
#endif
}
if(srb_idP == PCCH) {
LOG_D(RRC,"[UE %d] Received SDU for PCCH on SRB %d from eNB %d\n",module_idP,srb_idP,eNB_indexP);
decode_PCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t*)sduP,sdu_lenP);
}
if((srb_idP & RAB_OFFSET) == CCCH) {
if (sdu_lenP>0) {
LOG_T(RRC,"[UE %d] Received SDU for CCCH on SRB %d from eNB %d\n",module_idP,srb_idP & RAB_OFFSET,eNB_indexP);
......
......@@ -357,6 +357,12 @@ int decode_BCCH_DLSCH_Message(
const uint8_t rsrq,
const uint8_t rsrp );
int decode_PCCH_DLSCH_Message(
const protocol_ctxt_t* const ctxt_pP,
const uint8_t eNB_index,
uint8_t* const Sdu,
const uint8_t Sdu_len);
void
ue_meas_filtering(
const protocol_ctxt_t* const ctxt_pP,
......
......@@ -58,6 +58,7 @@
#include "UL-DCCH-Message.h"
#include "DL-DCCH-Message.h"
#include "BCCH-DL-SCH-Message.h"
#include "PCCH-Message.h"
#ifdef Rel10
#include "MCCH-Message.h"
#endif
......@@ -2463,6 +2464,39 @@ int decode_BCCH_DLSCH_Message(
return 0;
}
//-----------------------------------------------------------------------------
int decode_PCCH_DLSCH_Message(
const protocol_ctxt_t* const ctxt_pP,
const uint8_t eNB_index,
uint8_t* const Sdu,
const uint8_t Sdu_len)
{
PCCH_Message_t *pcch_message = NULL;
int i;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_IN );
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
&asn_DEF_PCCH_Message,
(void **)&pcch_message,
(const void *)Sdu,
Sdu_len );
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E( RRC, "[UE %"PRIu8"] Failed to decode PCCH_MESSAGE (%zu bits)\n",
ctxt_pP->module_id,
dec_rval.consumed );
for (i=0;i<Sdu_len;i++)
printf("%02x ",Sdu[i]);
printf("\n");
// free the memory
SEQUENCE_free( &asn_DEF_PCCH_Message, (void*)pcch_message, 1 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_OUT );
return -1;
}
return(0);
}
//-----------------------------------------------------------------------------
static int decode_SIB1( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t rsrq, const uint8_t rsrp )
......
......@@ -293,6 +293,7 @@ const char* eurecomFunctionsNames[] = {
"macxface_out_of_sync_ind",
"macxface_ue_decode_si",
"macxface_ue_decode_pcch",
"macxface_ue_decode_ccch",
"macxface_ue_decode_bcch",
"macxface_ue_send_sdu",
......
......@@ -267,6 +267,7 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_OUT_OF_SYNC_IND,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_CCCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_BCCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU,
......
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