Merging latest develop commits
This commit is contained in:
+12
-379
@@ -310,6 +310,12 @@ void phy_config_request(PHY_Config_t *phy_config) {
|
||||
|
||||
fp->num_MBSFN_config = 0;
|
||||
|
||||
fp->NonMBSFN_config_flag =cfg->fembms_config.non_mbsfn_config_flag.value;
|
||||
fp->NonMBSFN_config.non_mbsfn_SubframeConfig = cfg->fembms_config.non_mbsfn_subframeconfig.value;
|
||||
fp->NonMBSFN_config.radioframeAllocationPeriod = cfg->fembms_config.radioframe_allocation_period.value;
|
||||
fp->NonMBSFN_config.radioframeAllocationOffset = cfg->fembms_config.radioframe_allocation_offset.value;
|
||||
LOG_D(PHY,"eNB %d/%d frame NonMBSFN configured: %d (%x) %d/%d\n",Mod_id,CC_id,fp->NonMBSFN_config_flag,fp->NonMBSFN_config.non_mbsfn_SubframeConfig,fp->NonMBSFN_config.radioframeAllocationPeriod,fp->NonMBSFN_config.radioframeAllocationOffset);
|
||||
|
||||
init_ncs_cell (fp, RC.eNB[Mod_id][CC_id]->ncs_cell);
|
||||
|
||||
|
||||
@@ -319,148 +325,6 @@ void phy_config_request(PHY_Config_t *phy_config) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void phy_config_sib2_eNB(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
|
||||
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList)
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = &RC.eNB[Mod_id][CC_id]->frame_parms;
|
||||
//LTE_eNB_UE_stats *eNB_UE_stats = RC.eNB[Mod_id][CC_id].eNB_UE_stats;
|
||||
//int32_t rx_total_gain_eNB_dB = RC.eNB[Mod_id][CC_id].rx_total_gain_eNB_dB;
|
||||
int i;
|
||||
|
||||
LOG_I(PHY,"[eNB%d] CCid %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id);
|
||||
|
||||
|
||||
fp->prach_config_common.rootSequenceIndex = radioResourceConfigCommon->prach_Config.rootSequenceIndex;
|
||||
LOG_D(PHY,"prach_config_common.rootSequenceIndex = %d\n",fp->prach_config_common.rootSequenceIndex );
|
||||
|
||||
fp->prach_config_common.prach_Config_enabled=1;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
init_prach_tables(839);
|
||||
compute_prach_seq(&fp->prach_config_common,fp->frame_type,
|
||||
RC.eNB[Mod_id][CC_id]->X_u);
|
||||
|
||||
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;
|
||||
|
||||
|
||||
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 );
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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 );
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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(fp);
|
||||
|
||||
fp->soundingrs_ul_config_common.enabled_flag = 0;
|
||||
|
||||
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.present==SoundingRS_UL_ConfigCommon_PR_setup) {
|
||||
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)
|
||||
fp->soundingrs_ul_config_common.srs_MaxUpPts = 1;
|
||||
else
|
||||
fp->soundingrs_ul_config_common.srs_MaxUpPts = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
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;
|
||||
|
||||
fp->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx;
|
||||
|
||||
|
||||
// Now configure some of the Physical Channels
|
||||
|
||||
// PUCCH
|
||||
|
||||
init_ncs_cell(fp,RC.eNB[Mod_id][CC_id]->ncs_cell);
|
||||
|
||||
init_ul_hopping(fp);
|
||||
|
||||
// MBSFN
|
||||
if (mbsfn_SubframeConfigList != NULL) {
|
||||
fp->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
|
||||
|
||||
for (i = 0; i < mbsfn_SubframeConfigList->list.count; i++) {
|
||||
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) {
|
||||
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 %d\n", i, fp->MBSFN_config[i].mbsfn_SubframeConfig);
|
||||
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
|
||||
fp->MBSFN_config[i].fourFrames_flag = 1;
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig =
|
||||
mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]|
|
||||
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
|
||||
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]<<16);
|
||||
|
||||
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", i,
|
||||
fp->MBSFN_config[i].mbsfn_SubframeConfig);
|
||||
}
|
||||
}
|
||||
|
||||
} else
|
||||
fp->num_MBSFN_config = 0;
|
||||
|
||||
//
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
void phy_config_sib13_eNB(module_id_t Mod_id,int CC_id,int mbsfn_Area_idx,
|
||||
long mbsfn_AreaId_r9)
|
||||
@@ -477,244 +341,13 @@ void phy_config_sib13_eNB(module_id_t Mod_id,int CC_id,int mbsfn_Area_idx,
|
||||
}
|
||||
|
||||
lte_gold_mbsfn (fp, RC.eNB[Mod_id][CC_id]->lte_gold_mbsfn_table, fp->Nid_cell_mbsfn);
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
lte_gold_mbsfn_khz_1dot25 (fp, RC.eNB[Mod_id][CC_id]->lte_gold_mbsfn_khz_1dot25_table, fp->Nid_cell_mbsfn);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
phy_config_dedicated_eNB_step2 (PHY_VARS_eNB * eNB)
|
||||
{
|
||||
uint16_t UE_id;
|
||||
|
||||
struct LTE_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];
|
||||
|
||||
if (physicalConfigDedicated != NULL) {
|
||||
LOG_I (PHY, "[eNB %d] Sent physicalConfigDedicated=%p for UE %d\n", eNB->Mod_id, physicalConfigDedicated, UE_id);
|
||||
LOG_D (PHY, "------------------------------------------------------------------------\n");
|
||||
|
||||
if (physicalConfigDedicated->pdsch_ConfigDedicated) {
|
||||
eNB->pdsch_config_dedicated[UE_id].p_a = physicalConfigDedicated->pdsch_ConfigDedicated->p_a;
|
||||
LOG_D (PHY, "pdsch_config_dedicated.p_a %d\n", eNB->pdsch_config_dedicated[UE_id].p_a);
|
||||
LOG_D (PHY, "\n");
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->pucch_ConfigDedicated) {
|
||||
if (physicalConfigDedicated->pucch_ConfigDedicated->ackNackRepetition.present==LTE_PUCCH_ConfigDedicated__ackNackRepetition_PR_release)
|
||||
eNB->pucch_config_dedicated[UE_id].ackNackRepetition=0;
|
||||
else {
|
||||
eNB->pucch_config_dedicated[UE_id].ackNackRepetition = 1;
|
||||
}
|
||||
|
||||
if (fp->frame_type == FDD) {
|
||||
eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode = multiplexing;
|
||||
} else {
|
||||
if (physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode)
|
||||
eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode = *physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode;
|
||||
else
|
||||
eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode = bundling;
|
||||
}
|
||||
|
||||
if (eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode == multiplexing)
|
||||
LOG_D (PHY, "pucch_config_dedicated.tdd_AckNackFeedbackMode = multiplexing\n");
|
||||
else
|
||||
LOG_D (PHY, "pucch_config_dedicated.tdd_AckNackFeedbackMode = bundling\n");
|
||||
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->pusch_ConfigDedicated) {
|
||||
eNB->pusch_config_dedicated[UE_id].betaOffset_ACK_Index = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_ACK_Index;
|
||||
eNB->pusch_config_dedicated[UE_id].betaOffset_RI_Index = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index;
|
||||
eNB->pusch_config_dedicated[UE_id].betaOffset_CQI_Index = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index;
|
||||
|
||||
LOG_E(PHY,"pusch_config_dedicated.betaOffset_ACK_Index %d\n",eNB->pusch_config_dedicated[UE_id].betaOffset_ACK_Index);
|
||||
LOG_E(PHY,"pusch_config_dedicated.betaOffset_RI_Index %d\n",eNB->pusch_config_dedicated[UE_id].betaOffset_RI_Index);
|
||||
LOG_E(PHY,"pusch_config_dedicated.betaOffset_CQI_Index %d\n",eNB->pusch_config_dedicated[UE_id].betaOffset_CQI_Index);
|
||||
LOG_D(PHY,"\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->uplinkPowerControlDedicated) {
|
||||
|
||||
eNB->ul_power_control_dedicated[UE_id].p0_UE_PUSCH = physicalConfigDedicated->uplinkPowerControlDedicated->p0_UE_PUSCH;
|
||||
eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled = physicalConfigDedicated->uplinkPowerControlDedicated->deltaMCS_Enabled;
|
||||
eNB->ul_power_control_dedicated[UE_id].accumulationEnabled = physicalConfigDedicated->uplinkPowerControlDedicated->accumulationEnabled;
|
||||
eNB->ul_power_control_dedicated[UE_id].p0_UE_PUCCH = physicalConfigDedicated->uplinkPowerControlDedicated->p0_UE_PUCCH;
|
||||
eNB->ul_power_control_dedicated[UE_id].pSRS_Offset = physicalConfigDedicated->uplinkPowerControlDedicated->pSRS_Offset;
|
||||
eNB->ul_power_control_dedicated[UE_id].filterCoefficient = *physicalConfigDedicated->uplinkPowerControlDedicated->filterCoefficient;
|
||||
LOG_D (PHY, "ul_power_control_dedicated.p0_UE_PUSCH %d\n", eNB->ul_power_control_dedicated[UE_id].p0_UE_PUSCH);
|
||||
LOG_D (PHY, "ul_power_control_dedicated.deltaMCS_Enabled %d\n", eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled);
|
||||
LOG_D (PHY, "ul_power_control_dedicated.accumulationEnabled %d\n", eNB->ul_power_control_dedicated[UE_id].accumulationEnabled);
|
||||
LOG_D (PHY, "ul_power_control_dedicated.p0_UE_PUCCH %d\n", eNB->ul_power_control_dedicated[UE_id].p0_UE_PUCCH);
|
||||
LOG_D (PHY, "ul_power_control_dedicated.pSRS_Offset %d\n", eNB->ul_power_control_dedicated[UE_id].pSRS_Offset);
|
||||
LOG_D (PHY, "ul_power_control_dedicated.filterCoefficient %d\n", eNB->ul_power_control_dedicated[UE_id].filterCoefficient);
|
||||
LOG_D (PHY, "\n");
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->antennaInfo) {
|
||||
eNB->transmission_mode[UE_id] = 1 + (physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode);
|
||||
LOG_D (PHY, "Transmission Mode (phy_config_dedicated_eNB_step2) %d\n", eNB->transmission_mode[UE_id]);
|
||||
LOG_D (PHY, "\n");
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->schedulingRequestConfig) {
|
||||
if (physicalConfigDedicated->schedulingRequestConfig->present == LTE_SchedulingRequestConfig_PR_setup) {
|
||||
eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex = physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex;
|
||||
eNB->scheduling_request_config[UE_id].sr_ConfigIndex = physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_ConfigIndex;
|
||||
eNB->scheduling_request_config[UE_id].dsr_TransMax = physicalConfigDedicated->schedulingRequestConfig->choice.setup.dsr_TransMax;
|
||||
|
||||
LOG_D (PHY, "scheduling_request_config.sr_PUCCH_ResourceIndex %d\n", eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex);
|
||||
LOG_D (PHY, "scheduling_request_config.sr_ConfigIndex %d\n", eNB->scheduling_request_config[UE_id].sr_ConfigIndex);
|
||||
LOG_D (PHY, "scheduling_request_config.dsr_TransMax %d\n", eNB->scheduling_request_config[UE_id].dsr_TransMax);
|
||||
}
|
||||
|
||||
LOG_D (PHY, "------------------------------------------------------------\n");
|
||||
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated) {
|
||||
if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated->present == LTE_SoundingRS_UL_ConfigDedicated_PR_setup) {
|
||||
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].srsConfigDedicatedSetup = 1;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].duration = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.duration;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].cyclicShift = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].freqDomainPosition = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].srs_Bandwidth = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].srs_HoppingBandwidth = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].transmissionComb = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb;
|
||||
|
||||
|
||||
LOG_D (PHY, "soundingrs_ul_config_dedicated.srs_ConfigIndex %d\n", eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex);
|
||||
|
||||
}
|
||||
|
||||
LOG_D (PHY, "------------------------------------------------------------\n");
|
||||
|
||||
}
|
||||
|
||||
eNB->physicalConfigDedicated[UE_id] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void phy_config_dedicated_eNB(uint8_t Mod_id,
|
||||
int CC_id,
|
||||
uint16_t rnti,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated)
|
||||
{
|
||||
|
||||
PHY_VARS_eNB *eNB = RC.eNB[Mod_id][CC_id];
|
||||
int8_t UE_id = find_ue(rnti,eNB);
|
||||
int i;
|
||||
|
||||
if (UE_id == -1) {
|
||||
LOG_E( PHY, "[eNB %"PRIu8"] find_ue() returns -1\n", Mod_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (physicalConfigDedicated) {
|
||||
eNB->physicalConfigDedicated[UE_id] = physicalConfigDedicated;
|
||||
LOG_I(PHY,"phy_config_dedicated_eNB: physicalConfigDedicated=%p\n",physicalConfigDedicated);
|
||||
|
||||
if (physicalConfigDedicated->antennaInfo) {
|
||||
switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) {
|
||||
case AntennaInfoDedicated__transmissionMode_tm1:
|
||||
eNB->transmission_mode[UE_id] = 1;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm2:
|
||||
eNB->transmission_mode[UE_id] = 2;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm3:
|
||||
eNB->transmission_mode[UE_id] = 3;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm4:
|
||||
eNB->transmission_mode[UE_id] = 4;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm5:
|
||||
eNB->transmission_mode[UE_id] = 5;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm6:
|
||||
eNB->transmission_mode[UE_id] = 6;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm7:
|
||||
lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],eNB->frame_parms.Nid_cell,rnti);
|
||||
|
||||
for (i=0;i<eNB->num_RU;i++) eNB->RU_list[i]->do_precoding=1;
|
||||
eNB->transmission_mode[UE_id] = 7;
|
||||
break;
|
||||
default:
|
||||
LOG_E (PHY, "Unknown transmission mode!\n");
|
||||
break;
|
||||
}
|
||||
LOG_I(PHY,"Transmission Mode (phy_config_dedicated_eNB) %d\n",eNB->transmission_mode[UE_id]);
|
||||
|
||||
} else {
|
||||
LOG_D(PHY,"[eNB %d] : Received NULL radioResourceConfigDedicated->antennaInfo from eNB %d\n",Mod_id,UE_id);
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"[eNB %d] Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, UE_id);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
|
||||
uint16_t rnti,
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
int CC_id)
|
||||
{
|
||||
|
||||
|
||||
uint8_t UE_id = find_ue(rnti,RC.eNB[Mod_id][0]);
|
||||
struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10;
|
||||
//struct RadioResourceConfigCommonSCell_r10 *physicalConfigCommonSCell_r10 = sCellToAddMod_r10->radioResourceConfigCommonSCell_r10;
|
||||
//PhysCellId_t physCellId_r10 = sCellToAddMod_r10->cellIdentification_r10->physCellId_r10;
|
||||
ARFCN_ValueEUTRA_t dl_CarrierFreq_r10 = sCellToAddMod_r10->cellIdentification_r10->dl_CarrierFreq_r10;
|
||||
uint32_t carrier_freq_local;
|
||||
|
||||
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 %ld) for UE %d\n",Mod_id,
|
||||
//eNB->frame
|
||||
0,
|
||||
CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
|
||||
} 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 %ld) for UE %d\n",Mod_id,
|
||||
//eNB->frame
|
||||
0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
|
||||
} else {
|
||||
LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %ld of SCell %d for UE %d not supported\n",Mod_id,
|
||||
//eNB->frame
|
||||
0,dl_CarrierFreq_r10,CC_id,UE_id);
|
||||
}
|
||||
|
||||
if (physicalConfigDedicatedSCell_r10) {
|
||||
//#warning " eNB->physicalConfigDedicatedSCell_r10 does not exist in eNB"
|
||||
// eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10;
|
||||
LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id,
|
||||
//eNB->frame
|
||||
0,CC_id,UE_id);
|
||||
} else {
|
||||
LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated (CC_id %d, UE %d)\n",Mod_id,
|
||||
//eNB->frame
|
||||
0,CC_id,UE_id);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
unsigned char is_secondary_eNB,
|
||||
unsigned char abstraction_flag)
|
||||
@@ -779,13 +412,13 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
common_vars->txdataF = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t*));
|
||||
common_vars->rxdataF = (int32_t **)malloc16(64*sizeof(int32_t*));
|
||||
|
||||
LOG_D(PHY,"[INIT] NB_ANTENNA_PORTS_ENB:%d fp->nb_antenna_ports_eNB:%d\n", NB_ANTENNA_PORTS_ENB, fp->nb_antenna_ports_eNB);
|
||||
LOG_I(PHY,"[INIT] NB_ANTENNA_PORTS_ENB:%d fp->nb_antenna_ports_eNB:%d\n", NB_ANTENNA_PORTS_ENB, fp->nb_antenna_ports_eNB);
|
||||
|
||||
for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
|
||||
if (i<fp->nb_antenna_ports_eNB || i==5) {
|
||||
common_vars->txdataF[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
|
||||
|
||||
LOG_D(PHY,"[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n",
|
||||
LOG_I(PHY,"[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n",
|
||||
i,common_vars->txdataF[i],
|
||||
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "phy_init.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "LTE_RadioResourceConfigCommonSIB.h"
|
||||
#include "LTE_RadioResourceConfigDedicated.h"
|
||||
@@ -34,28 +35,38 @@
|
||||
void init_7_5KHz(void);
|
||||
|
||||
int phy_init_RU(RU_t *ru) {
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
|
||||
int i,j;
|
||||
int p;
|
||||
int re;
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
RU_CALIBRATION *calibration = &ru->calibration;
|
||||
int i,j,p,re;
|
||||
|
||||
init_dfts();
|
||||
|
||||
LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d\n",ru_if_types[ru->if_south],ru->nb_tx);
|
||||
|
||||
if (ru->is_slave == 1) {
|
||||
generate_ul_ref_sigs_rx();
|
||||
}
|
||||
|
||||
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so allocate memory for time-domain signals
|
||||
// Time-domain signals
|
||||
ru->common.txdata = (int32_t**)malloc16(ru->nb_tx*sizeof(int32_t*));
|
||||
ru->common.rxdata = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) );
|
||||
|
||||
|
||||
for (i=0; i<ru->nb_tx; i++) {
|
||||
// Allocate 10 subframes of I/Q TX signal data (time) if not
|
||||
ru->common.txdata[i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||
|
||||
LOG_I(PHY,"[INIT] common.txdata[%d] = %p (%lu bytes)\n",i,ru->common.txdata[i],
|
||||
fp->samples_per_tti*10*sizeof(int32_t));
|
||||
|
||||
}
|
||||
|
||||
if (ru->is_slave == 1) {
|
||||
calibration->drs_ch_estimates_time = (int32_t**)malloc16_clear(ru->nb_rx*sizeof(int32_t*));
|
||||
for (i=0; i<ru->nb_rx; i++) {
|
||||
calibration->drs_ch_estimates_time[i] = (int32_t*)malloc16_clear(2*sizeof(int32_t)*fp->ofdm_symbol_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i=0;i<ru->nb_rx;i++) {
|
||||
ru->common.rxdata[i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||
}
|
||||
@@ -92,10 +103,22 @@ int phy_init_RU(RU_t *ru) {
|
||||
ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(2*fp->ofdm_symbol_size*fp->symbols_per_tti) );
|
||||
LOG_I(PHY,"rxdataF[%d] %p for RU %d\n",i,ru->common.rxdataF[i],ru->idx);
|
||||
}
|
||||
|
||||
if (ru->is_slave == 1) {
|
||||
// allocate FFT output buffers after extraction (RX)
|
||||
calibration->rxdataF_ext = (int32_t**)malloc16(2*sizeof(int32_t*));
|
||||
calibration->drs_ch_estimates = (int32_t**)malloc16(2*sizeof(int32_t*));
|
||||
for (i=0; i<ru->nb_rx; i++) {
|
||||
// allocate 2 subframes of I/Q signal data (frequency)
|
||||
calibration->rxdataF_ext[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
LOG_I(PHY,"rxdataF_ext[%d] %p for RU %d\n",i,calibration->rxdataF_ext[i],ru->idx);
|
||||
calibration->drs_ch_estimates[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti);
|
||||
}
|
||||
}
|
||||
|
||||
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
|
||||
// AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]),
|
||||
// "nb_antennas_rx too large");
|
||||
//AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]),
|
||||
//"nb_antennas_rx too large");
|
||||
ru->prach_rxsigF = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
|
||||
for (j=0;j<4;j++) ru->prach_rxsigF_br[j] = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
|
||||
|
||||
@@ -115,6 +138,9 @@ int phy_init_RU(RU_t *ru) {
|
||||
|
||||
LOG_D(PHY,"[INIT] %s() RC.nb_L1_inst:%d \n", __FUNCTION__, RC.nb_L1_inst);
|
||||
|
||||
int starting_antenna_index=0;
|
||||
for (i=0; i<ru->idx;i++) starting_antenna_index+=ru->nb_tx;
|
||||
|
||||
for (i=0; i<RC.nb_L1_inst; i++) {
|
||||
for (p=0;p<15;p++) {
|
||||
LOG_D(PHY,"[INIT] %s() nb_antenna_ports_eNB:%d \n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB);
|
||||
@@ -123,10 +149,14 @@ int phy_init_RU(RU_t *ru) {
|
||||
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
|
||||
for (j=0; j<ru->nb_tx; j++) {
|
||||
ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
// antenna ports 0-3 are mapped on antennas 0-3
|
||||
// antenna ports 0-3 are mapped on antennas 0-3 as follows
|
||||
// - antenna port p is mapped to antenna j on ru->idx as: p = (starting_antenna_index+j)%nb_anntena_ports_eNB
|
||||
// antenna port 4 is mapped on antenna 0
|
||||
// antenna ports 5-14 are mapped on all antennas
|
||||
if (((p<4) && (p==j)) || ((p==4) && (j==0))) {
|
||||
// antenna ports 5-14 are mapped on all antennas
|
||||
|
||||
if (((p<4) &&
|
||||
(p==((starting_antenna_index+j)%ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB))) ||
|
||||
((p==4) && (j==0))) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
{
|
||||
ru->beam_weights[i][p][j][re] = 0x00007fff;
|
||||
@@ -156,6 +186,7 @@ void phy_free_RU(RU_t *ru)
|
||||
{
|
||||
int i,j;
|
||||
int p;
|
||||
RU_CALIBRATION *calibration = &ru->calibration;
|
||||
|
||||
LOG_I(PHY, "Feeing RU signal buffers (if_south %s) nb_tx %d\n", ru_if_types[ru->if_south], ru->nb_tx);
|
||||
|
||||
@@ -164,6 +195,12 @@ void phy_free_RU(RU_t *ru)
|
||||
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so free memory for time-domain signals
|
||||
for (i = 0; i < ru->nb_tx; i++) free_and_zero(ru->common.txdata[i]);
|
||||
for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdata[i]);
|
||||
if (ru->is_slave == 1) {
|
||||
for (i = 0; i < ru->nb_rx; i++) {
|
||||
free_and_zero(calibration->drs_ch_estimates_time[i]);
|
||||
}
|
||||
free_and_zero(calibration->drs_ch_estimates_time);
|
||||
}
|
||||
free_and_zero(ru->common.txdata);
|
||||
free_and_zero(ru->common.rxdata);
|
||||
} // else: IF5 or local RF -> nothing to free()
|
||||
@@ -179,6 +216,14 @@ void phy_free_RU(RU_t *ru)
|
||||
// free FFT output buffers (RX)
|
||||
for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdataF[i]);
|
||||
free_and_zero(ru->common.rxdataF);
|
||||
if (ru->is_slave == 1) {
|
||||
for (i = 0; i < ru->nb_rx; i++) {
|
||||
free_and_zero(calibration->rxdataF_ext[i]);
|
||||
free_and_zero(calibration->drs_ch_estimates[i]);
|
||||
}
|
||||
free_and_zero(calibration->rxdataF_ext);
|
||||
free_and_zero(calibration->drs_ch_estimates);
|
||||
}
|
||||
|
||||
for (i = 0; i < ru->nb_rx; i++) {
|
||||
free_and_zero(ru->prach_rxsigF[i]);
|
||||
|
||||
@@ -165,8 +165,29 @@ void phy_config_sib13_ue(module_id_t Mod_id,int CC_id,uint8_t eNB_id,int mbsfn_A
|
||||
}
|
||||
|
||||
lte_gold_mbsfn(fp,PHY_vars_UE_g[Mod_id][CC_id]->lte_gold_mbsfn_table,fp->Nid_cell_mbsfn);
|
||||
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
lte_gold_mbsfn_khz_1dot25(fp,PHY_vars_UE_g[Mod_id][CC_id]->lte_gold_mbsfn_khz_1dot25_table,fp->Nid_cell_mbsfn);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void phy_config_sib1_fembms_ue(module_id_t Mod_id,int CC_id,
|
||||
uint8_t eNB_id,
|
||||
struct LTE_NonMBSFN_SubframeConfig_r14 *nonMBSFN_SubframeConfig){
|
||||
PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id];
|
||||
LTE_DL_FRAME_PARMS *fp = &ue->frame_parms;
|
||||
if (nonMBSFN_SubframeConfig != NULL) {
|
||||
fp->NonMBSFN_config_flag = 0;
|
||||
fp->NonMBSFN_config.radioframeAllocationPeriod=nonMBSFN_SubframeConfig->radioFrameAllocationPeriod_r14;
|
||||
fp->NonMBSFN_config.radioframeAllocationOffset=nonMBSFN_SubframeConfig->radioFrameAllocationOffset_r14;
|
||||
fp->NonMBSFN_config.non_mbsfn_SubframeConfig=(nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[0]<<1 | nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[0]>>7);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Configures UE MAC and PHY with radioResourceCommon received in mobilityControlInfo IE during Handover
|
||||
|
||||
@@ -128,6 +128,12 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
frame_parms->nb_prefix_samples0>>=(2-log2_osf);
|
||||
frame_parms->N_RBGS = 2;
|
||||
frame_parms->N_RBG = 13;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
frame_parms->ofdm_symbol_size_khz_1dot25 = 6144*osf;
|
||||
frame_parms->first_carrier_offset_khz_1dot25 = frame_parms->ofdm_symbol_size_khz_1dot25 - 1800; //4344
|
||||
frame_parms->nb_prefix_samples_khz_1dot25>>=(2-log2_osf);
|
||||
frame_parms->nb_prefix_samples0_khz_1dot25>>=(2-log2_osf);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 15:
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
#include "LTE_SCellToAddMod-r10.h"
|
||||
#endif
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
#include "LTE_NonMBSFN-SubframeConfig-r14.h"
|
||||
#endif
|
||||
/** @addtogroup _PHY_STRUCTURES_
|
||||
* @{
|
||||
*/
|
||||
@@ -151,7 +154,6 @@ void phy_config_sib1_ue(module_id_t Mod_id,
|
||||
uint8_t SIwindowsize,
|
||||
uint16_t SIperiod);
|
||||
|
||||
|
||||
/*!
|
||||
\fn void phy_config_sib2_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
@@ -262,6 +264,10 @@ void phy_config_sib13_ue(module_id_t Mod_id,
|
||||
int CC_id,uint8_t CH_index,int mbsfn_Area_idx,
|
||||
long mbsfn_AreaId_r9);
|
||||
|
||||
void phy_config_sib1_fembms_ue(module_id_t Mod_id,int CC_id,
|
||||
uint8_t eNB_id,
|
||||
struct LTE_NonMBSFN_SubframeConfig_r14 *nonMBSFN_SubframeConfig);
|
||||
|
||||
/**
|
||||
\brief Configure eNB MBSFN common parameters.
|
||||
\details Invoked upon transmission of SIB13 from eNB.
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
short filt24_0_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_0_dcl_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
2341,4681,7022,9362,11703,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_0_dcr_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
short filt24_1_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1_dcl_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1_dcr_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
|
||||
short filt24_2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2_dcl_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,2341,4681,7022,9362, 11703,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2_dcr_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,4681,2341,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
// X X X Y | X X X X | X Y X X
|
||||
short filt24_3_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_3_dcl_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,2341,4681,7022,9362,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
// X X X Y | X X DC X X | X Y X X
|
||||
short filt24_3_dcr_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,7022,4681,2341,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
|
||||
short filt24_4_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_4_dcl_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,2341,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_4_dcr_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,7022,4681,2341,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
short filt24_5_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
|
||||
};
|
||||
// X X X Y | X X DC X X | X Y X X
|
||||
short filt24_5_dcl_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,2341,4681,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_5_dcr_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,2730,5461,8192,10922,13653,16384,11703,9362,7022,4681,2730,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
|
||||
short filt24_6_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_6_dcl_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_6_dcr_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
|
||||
short filt24_7_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_7_dcl_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_7_dcr_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
short filt24_0l_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1l_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2l_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_3l_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
//0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0};
|
||||
0,0,0,0,0,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_4l_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_5l_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_6l_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_7l_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_0l2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1l2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2l2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_3l2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_4l2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_5l2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_6l2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
-13653,-10922,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_7l2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,-13653,-10922,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_0r_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1r_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2r_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_3r_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_4r_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_5r_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_6r_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_7r_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_0r2_khz_1dot25[24] __attribute__((aligned(32))) ={ /****/
|
||||
2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1r2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2r2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0
|
||||
};
|
||||
short filt24_3r2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0
|
||||
};
|
||||
short filt24_4r2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0
|
||||
};
|
||||
short filt24_5r2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0
|
||||
};
|
||||
short filt24_6r2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0
|
||||
};
|
||||
short filt24_7r2_khz_1dot25[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653
|
||||
};
|
||||
@@ -112,17 +112,20 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
|
||||
int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,module_id_t UE_id)
|
||||
int lte_est_timing_advance_pusch(PHY_VARS_eNB *eNB,module_id_t UE_id)
|
||||
{
|
||||
int temp, i, aa, max_pos=0, max_val=0;
|
||||
short Re,Im;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
||||
LTE_eNB_PUSCH *eNB_pusch_vars = eNB->pusch_vars[UE_id];
|
||||
int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time;
|
||||
RU_t *ru;
|
||||
ru = RC.ru[UE_id];
|
||||
LTE_DL_FRAME_PARMS *frame_parms = (eNB==NULL) ? &ru->frame_parms : &eNB->frame_parms;
|
||||
LTE_eNB_PUSCH *eNB_pusch_vars = (eNB!=NULL) ? eNB->pusch_vars[UE_id] : (LTE_eNB_PUSCH*)NULL;
|
||||
RU_CALIBRATION *calibration = &ru->calibration;
|
||||
int32_t **ul_ch_estimates_time = (eNB==NULL) ? calibration->drs_ch_estimates_time : eNB_pusch_vars->drs_ch_estimates_time;
|
||||
uint8_t cyclic_shift = 0;
|
||||
int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
|
||||
|
||||
|
||||
AssertFatal(frame_parms->ofdm_symbol_size > 127,"frame_parms->ofdm_symbol_size %d<128\n",frame_parms->ofdm_symbol_size);
|
||||
AssertFatal(frame_parms->nb_antennas_rx >0 && frame_parms->nb_antennas_rx<3,"frame_parms->nb_antennas_rx %d not in [0,1]\n",
|
||||
frame_parms->nb_antennas_rx);
|
||||
|
||||
@@ -19,11 +19,24 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file config_ue.c
|
||||
* \brief This includes FeMBMS UE Channel Estimation Procedures for FeMBMS 1.25KHz Carrier Spacing
|
||||
* \author Javier Morgade
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
* \email: javier.morgade@ieee.org
|
||||
* @ingroup _phy
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "lte_estimation.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
#include "filt96_32_khz_1dot25.h"
|
||||
|
||||
//#define DEBUG_CH
|
||||
int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
|
||||
module_id_t eNB_id,
|
||||
@@ -769,3 +782,180 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int lte_dl_mbsfn_khz_1dot25_channel_estimation(PHY_VARS_UE *ue,
|
||||
module_id_t eNB_id,
|
||||
uint8_t eNB_offset,
|
||||
int subframe)
|
||||
{
|
||||
|
||||
|
||||
|
||||
int pilot_khz_1dot25[600] __attribute__((aligned(16)));
|
||||
unsigned char aarx/*,aa*/;
|
||||
//unsigned int rb;
|
||||
int16_t ch[2];
|
||||
short *pil,*rxF,*dl_ch/*,*ch0,*ch1,*ch11,*chp,*ch_prev*/;
|
||||
int ch_offset,symbol_offset;
|
||||
int pilot_cnt;
|
||||
|
||||
int16_t *f,*f2,*fl,*f2l2,*fr,*f2r2/*,*f2_dc,*f_dc*/;
|
||||
|
||||
unsigned int k;
|
||||
|
||||
// unsigned int n;
|
||||
// int i;
|
||||
|
||||
int **dl_ch_estimates=ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[0];
|
||||
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF;
|
||||
|
||||
ch_offset = 0;//(l*(ue->frame_parms.ofdm_symbol_size));
|
||||
symbol_offset = 0;//ch_offset;//phy_vars_ue->lte_frame_parms.ofdm_symbol_size*l;
|
||||
|
||||
AssertFatal( ue->frame_parms.N_RB_DL==25,"OFDM symbol size %d not yet supported for FeMBMS\n",ue->frame_parms.N_RB_DL);
|
||||
|
||||
if( (subframe&0x1) == 0){
|
||||
f=filt24_0_khz_1dot25;
|
||||
f2=filt24_2_khz_1dot25;
|
||||
fl=filt24_0_khz_1dot25;
|
||||
f2l2=filt24_2_khz_1dot25;
|
||||
fr=filt24_0r2_khz_1dot25;
|
||||
f2r2=filt24_2r_khz_1dot25;
|
||||
//f_dc=filt24_0_dcr_khz_1dot25;
|
||||
//f2_dc=filt24_2_dcl_khz_1dot25;
|
||||
}else{
|
||||
f=filt24_0_khz_1dot25;
|
||||
f2=filt24_2_khz_1dot25;
|
||||
fl=filt24_0_khz_1dot25;
|
||||
f2l2=filt24_2_khz_1dot25;
|
||||
fr=filt24_0r2_khz_1dot25;
|
||||
f2r2=filt24_2r_khz_1dot25;
|
||||
//f_dc=filt24_0_dcr_khz_1dot25;
|
||||
//f2_dc=filt24_2_dcl_khz_1dot25;
|
||||
}
|
||||
|
||||
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||
// generate pilot
|
||||
lte_dl_mbsfn_khz_1dot25_rx(ue,
|
||||
&pilot_khz_1dot25[0],
|
||||
subframe);
|
||||
|
||||
|
||||
pil = (short *)&pilot_khz_1dot25[0];
|
||||
rxF = (short *)&rxdataF[aarx][((ue->frame_parms.first_carrier_offset_khz_1dot25))];
|
||||
dl_ch = (short *)&dl_ch_estimates[aarx][ch_offset];
|
||||
|
||||
memset(dl_ch,0,4*(ue->frame_parms.ofdm_symbol_size_khz_1dot25));
|
||||
|
||||
if( (subframe&0x1) == 0){
|
||||
rxF+=0;
|
||||
k=0;
|
||||
}else{
|
||||
rxF+=6;//2*3;
|
||||
k=3;
|
||||
}
|
||||
|
||||
if(ue->frame_parms.N_RB_DL==25){
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(fl,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f2l2,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
for(pilot_cnt=2;pilot_cnt<299;pilot_cnt+=2){
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
|
||||
}
|
||||
|
||||
rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+1+k))]; //Skip DC offset
|
||||
|
||||
for(pilot_cnt=0; pilot_cnt<297; pilot_cnt+=2){
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
pil+=2;
|
||||
rxF+=12;
|
||||
dl_ch+=16;
|
||||
}
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(fr,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
pil+=2; // Re Im
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(f2r2,
|
||||
ch,
|
||||
dl_ch,
|
||||
24);
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -94,6 +94,15 @@ int lte_sync_time_eNB_emul(PHY_VARS_eNB *phy_vars_eNb,
|
||||
uint8_t sect_id,
|
||||
int32_t *sync_val);
|
||||
|
||||
|
||||
int ru_sync_time_init(RU_t *ru);
|
||||
|
||||
int ru_sync_time(RU_t *ru,
|
||||
int64_t *lev,
|
||||
int64_t *avg);
|
||||
|
||||
void ru_sync_time_free(RU_t *ru);
|
||||
|
||||
/*!
|
||||
\brief This function performs channel estimation including frequency and temporal interpolation
|
||||
\param phy_vars_ue Pointer to UE PHY variables
|
||||
@@ -132,6 +141,11 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
int subframe,
|
||||
unsigned char l);
|
||||
|
||||
int lte_dl_mbsfn_khz_1dot25_channel_estimation(PHY_VARS_UE *ue,
|
||||
module_id_t eNB_id,
|
||||
uint8_t eNB_offset,
|
||||
int subframe);
|
||||
|
||||
/*!
|
||||
\brief Frequency offset estimation for LTE
|
||||
We estimate the frequency offset by calculating the phase difference between channel estimates for symbols carrying pilots (l==0 or l==3/4). We take a moving average of the phase difference.
|
||||
@@ -208,6 +222,19 @@ int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t l,
|
||||
uint8_t Ns);
|
||||
|
||||
int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **ul_ch_estimates,
|
||||
int32_t **ul_ch_estimates_time,
|
||||
int32_t **rxdataF_ext,
|
||||
int N_rb_alloc,
|
||||
int frame_rx,
|
||||
int subframe_rx,
|
||||
uint32_t u,
|
||||
uint32_t v,
|
||||
uint32_t cyclic_shift,
|
||||
unsigned char l,
|
||||
int interpolate,
|
||||
uint16_t rnti);
|
||||
|
||||
int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *ul_ch_estimates,
|
||||
|
||||
@@ -34,7 +34,10 @@
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
// Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs)
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
|
||||
int* sync_corr_ue0 = NULL;
|
||||
int* sync_corr_ue1 = NULL;
|
||||
@@ -338,7 +341,6 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
{
|
||||
|
||||
|
||||
|
||||
// perform a time domain correlation using the oversampled sync sequence
|
||||
|
||||
unsigned int n, ar, s, peak_pos, peak_val, sync_source;
|
||||
@@ -348,20 +350,12 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
int length = LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti>>1;
|
||||
|
||||
//LOG_D(PHY,"[SYNC TIME] Calling sync_time.\n");
|
||||
if (sync_corr_ue0 == NULL) {
|
||||
LOG_E(PHY,"[SYNC TIME] sync_corr_ue0 not yet allocated! Exiting.\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (sync_corr_ue1 == NULL) {
|
||||
LOG_E(PHY,"[SYNC TIME] sync_corr_ue1 not yet allocated! Exiting.\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (sync_corr_ue2 == NULL) {
|
||||
LOG_E(PHY,"[SYNC TIME] sync_corr_ue2 not yet allocated! Exiting.\n");
|
||||
return(-1);
|
||||
}
|
||||
AssertFatal(sync_corr_ue0 != NULL,
|
||||
"sync_corr_ue0 not yet allocated! Exiting.\n");
|
||||
AssertFatal(sync_corr_ue1 != NULL,
|
||||
"sync_corr_ue0 not yet allocated! Exiting.\n");
|
||||
AssertFatal(sync_corr_ue2 != NULL,
|
||||
"sync_corr_ue0 not yet allocated! Exiting.\n");
|
||||
|
||||
peak_val = 0;
|
||||
peak_pos = 0;
|
||||
@@ -478,6 +472,79 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars
|
||||
{
|
||||
|
||||
/*
|
||||
int16_t dmrs[2048];
|
||||
int16_t *dmrsp[2] = {dmrs,NULL};
|
||||
*/
|
||||
|
||||
int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32)));
|
||||
// int32_t *dmrsp[2] = {&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL};
|
||||
int32_t *dmrsp[2] = {&dmrs[0],NULL};
|
||||
|
||||
generate_ul_ref_sigs();
|
||||
|
||||
ru->dmrssync = (int16_t*)malloc16_clear(ru->frame_parms.ofdm_symbol_size*2*sizeof(int16_t));
|
||||
ru->dmrs_corr = (uint64_t*)malloc16_clear(ru->frame_parms.samples_per_tti*10*sizeof(uint64_t));
|
||||
|
||||
generate_drs_pusch(NULL,NULL,
|
||||
&ru->frame_parms,
|
||||
dmrsp,
|
||||
0,
|
||||
AMP,
|
||||
0,
|
||||
0,
|
||||
ru->frame_parms.N_RB_DL,
|
||||
0);
|
||||
|
||||
switch (ru->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
idft128((int16_t*)(&dmrsp[0][3*ru->frame_parms.ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft512((int16_t*)(&dmrsp[0][3*ru->frame_parms.ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft1024((int16_t*)(&dmrsp[0][3*ru->frame_parms.ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
|
||||
case 75:
|
||||
idft1536((int16_t*)(&dmrsp[0][3*ru->frame_parms.ofdm_symbol_size]),
|
||||
ru->dmrssync,
|
||||
1); /// complex output
|
||||
break;
|
||||
case 100:
|
||||
idft2048((int16_t*)(&dmrsp[0][3*ru->frame_parms.ofdm_symbol_size]),
|
||||
ru->dmrssync, /// complex output
|
||||
1);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Unsupported N_RB_DL %d\n",ru->frame_parms.N_RB_DL);
|
||||
break;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
void ru_sync_time_free(RU_t *ru) {
|
||||
|
||||
AssertFatal(ru->dmrssync!=NULL,"ru->dmrssync is NULL\n");
|
||||
free(ru->dmrssync);
|
||||
if (ru->dmrs_corr) free(ru->dmrs_corr);
|
||||
}
|
||||
|
||||
//#define DEBUG_PHY
|
||||
|
||||
int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t length,
|
||||
@@ -558,40 +625,96 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
*peak_val_out = peak_val;
|
||||
|
||||
if (peak_val <= (40*(uint32_t)mean_val)) {
|
||||
LOG_D(PHY,"[SYNC TIME] No peak found (%u,%u,%"PRIu64",%"PRIu64")\n",peak_pos,peak_val,mean_val,40*mean_val);
|
||||
LOG_I(PHY,"[SYNC TIME] No peak found (%u,%u,%"PRIu64",%"PRIu64")\n",peak_pos,peak_val,mean_val,40*mean_val);
|
||||
return(-1);
|
||||
} else {
|
||||
LOG_D(PHY,"[SYNC TIME] Peak found at pos %u, val = %u, mean_val = %"PRIu64"\n",peak_pos,peak_val,mean_val);
|
||||
LOG_I(PHY,"[SYNC TIME] Peak found at pos %u, val = %u, mean_val = %"PRIu64"\n",peak_pos,peak_val,mean_val);
|
||||
return(peak_pos);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef PHY_ABSTRACTION
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
#include "SIMULATION/RF/defs.h"
|
||||
//extern channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
|
||||
|
||||
int lte_sync_time_eNB_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t sect_id,
|
||||
int32_t *sync_val)
|
||||
static inline int64_t abs64(int64_t x)
|
||||
{
|
||||
return (((int64_t)((int32_t*)&x)[0])*((int64_t)((int32_t*)&x)[0]) + ((int64_t)
|
||||
((int32_t*)&x)[1])*((int64_t)((int32_t*)&x)[1]));
|
||||
}
|
||||
|
||||
uint8_t UE_id;
|
||||
uint8_t CC_id = phy_vars_eNB->CC_id;
|
||||
int ru_sync_time(RU_t *ru,
|
||||
int64_t *lev,
|
||||
int64_t *avg)
|
||||
{
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &ru->frame_parms;
|
||||
RU_CALIBRATION *calibration = &ru->calibration;
|
||||
|
||||
// perform a time domain correlation using the oversampled sync sequence
|
||||
|
||||
LOG_E(PHY,"[PHY] EMUL lte_sync_time_eNB_emul eNB %d, sect_id %d\n",phy_vars_eNB->Mod_id,sect_id);
|
||||
*sync_val = 0;
|
||||
int length = LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti;
|
||||
|
||||
|
||||
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
|
||||
//LOG_E(PHY,"[PHY] EMUL : eNB %d checking UE %d (PRACH %d) PL %d dB\n",phy_vars_eNB->Mod_id,UE_id,PHY_vars_UE_g[UE_id]->generate_prach,UE2eNB[UE_id][phy_vars_eNB->Mod_id]->path_loss_dB);
|
||||
if ((PHY_vars_UE_g[UE_id][CC_id]->generate_prach == 1) && (phy_vars_eNB->Mod_id == (UE_id % NB_eNB_INST))) {
|
||||
*sync_val = 1;
|
||||
return(0);
|
||||
}
|
||||
// circular copy of beginning to end of rxdata buffer. Note: buffer should be big enough upon calling this function
|
||||
for (int ar=0;ar<ru->nb_rx;ar++) memcpy((void*)&ru->common.rxdata[ar][2*length],
|
||||
(void*)&ru->common.rxdata[ar][0],
|
||||
frame_parms->ofdm_symbol_size);
|
||||
|
||||
int32_t maxlev0=0;
|
||||
int maxpos0=0;
|
||||
int64_t avg0=0;
|
||||
int64_t result;
|
||||
int64_t dmrs_corr;
|
||||
|
||||
int maxval=0;
|
||||
for (int i=0;i<2*(frame_parms->ofdm_symbol_size);i++) {
|
||||
maxval = max(maxval,ru->dmrssync[i]);
|
||||
maxval = max(maxval,-ru->dmrssync[i]);
|
||||
}
|
||||
|
||||
if (ru->state == RU_CHECK_SYNC) {
|
||||
for (int i=0;i<2*(frame_parms->ofdm_symbol_size);i++) {
|
||||
maxval = max(maxval,calibration->drs_ch_estimates_time[0][i]);
|
||||
maxval = max(maxval,-calibration->drs_ch_estimates_time[0][i]);
|
||||
}
|
||||
}
|
||||
|
||||
int shift = log2_approx(maxval);
|
||||
|
||||
for (int n=0; n<length; n+=4) {
|
||||
|
||||
dmrs_corr = 0;
|
||||
|
||||
//calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n];
|
||||
for (int ar=0; ar<ru->nb_rx; ar++) {
|
||||
|
||||
result = dot_product64(ru->dmrssync,
|
||||
(int16_t*) &ru->common.rxdata[ar][n],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
shift);
|
||||
|
||||
if (ru->state == RU_CHECK_SYNC) {
|
||||
result = dot_product64((int16_t*) &calibration->drs_ch_estimates_time[ar],
|
||||
(int16_t*) &ru->common.rxdata[ar][n],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
shift);
|
||||
}
|
||||
dmrs_corr += abs64(result);
|
||||
}
|
||||
if (ru->dmrs_corr != NULL) ru->dmrs_corr[n] = dmrs_corr;
|
||||
|
||||
// tmpi holds <synchi,rx0>+<synci,rx1>+...+<synchi,rx_{nbrx-1}>
|
||||
|
||||
|
||||
if (dmrs_corr>maxlev0) { maxlev0 = dmrs_corr; maxpos0 = n; }
|
||||
avg0 += dmrs_corr;
|
||||
}
|
||||
avg0/=(length/4);
|
||||
|
||||
int dmrsoffset = frame_parms->samples_per_tti + (3*frame_parms->ofdm_symbol_size)+(3*frame_parms->nb_prefix_samples) + frame_parms->nb_prefix_samples0;
|
||||
|
||||
if ((int64_t)maxlev0 > (10*avg0)) {*lev = maxlev0; *avg=avg0; return((length+maxpos0-dmrsoffset)%length);}
|
||||
|
||||
return(-1);
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -39,13 +39,23 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
|
||||
module_id_t UE_id,
|
||||
unsigned char l,
|
||||
unsigned char Ns) {
|
||||
RU_t *ru;
|
||||
ru = RC.ru[UE_id];
|
||||
LTE_DL_FRAME_PARMS *frame_parms = (eNB!=NULL) ? &eNB->frame_parms : &ru->frame_parms;
|
||||
LTE_eNB_PUSCH *pusch_vars = (eNB!=NULL) ? eNB->pusch_vars[UE_id] : NULL;
|
||||
RU_CALIBRATION *calibration = &ru->calibration;
|
||||
int32_t **ul_ch_estimates = (eNB!=NULL) ? pusch_vars->drs_ch_estimates : calibration->drs_ch_estimates;
|
||||
|
||||
AssertFatal(ul_ch_estimates != NULL, "ul_ch_estimates is null (eNB %p, pusch %p, pusch->drs_ch_estimates %p, pusch->drs_ch_estimates[0] %p ul_ch_estimates %p UE_id %d)\n",eNB,pusch_vars,pusch_vars->drs_ch_estimates,pusch_vars->drs_ch_estimates[0],ul_ch_estimates,UE_id);
|
||||
|
||||
int32_t **ul_ch_estimates_time = (eNB!=NULL) ? pusch_vars->drs_ch_estimates_time : calibration->drs_ch_estimates_time;
|
||||
|
||||
AssertFatal(ul_ch_estimates_time != NULL, "ul_ch_estimates_time is null\n");
|
||||
|
||||
int32_t **rxdataF_ext = (eNB!=NULL) ? pusch_vars->rxdataF_ext : calibration->rxdataF_ext;
|
||||
|
||||
int subframe = (eNB!=NULL) ? proc->subframe_rx : ru->proc.subframe_rx;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
||||
LTE_eNB_PUSCH *pusch_vars = eNB->pusch_vars[UE_id];
|
||||
int32_t **ul_ch_estimates=pusch_vars->drs_ch_estimates;
|
||||
int32_t **ul_ch_estimates_time= pusch_vars->drs_ch_estimates_time;
|
||||
int32_t **rxdataF_ext= pusch_vars->rxdataF_ext;
|
||||
int subframe = proc->subframe_rx;
|
||||
uint8_t harq_pid;
|
||||
int16_t delta_phase = 0;
|
||||
int16_t *ru1 = ru_90;
|
||||
@@ -122,14 +132,11 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
if (l == (3 - frame_parms->Ncp)) {
|
||||
|
||||
symbol_offset = frame_parms->N_RB_UL*12*(l+((7-frame_parms->Ncp)*(Ns&1)));
|
||||
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
// msg("Componentwise prod aa %d, symbol_offset %d,ul_ch_estimates %p,ul_ch_estimates[aa] %p,ul_ref_sigs_rx[0][0][Msc_RS_idx] %p\n",aa,symbol_offset,ul_ch_estimates,ul_ch_estimates[aa],ul_ref_sigs_rx[0][0][Msc_RS_idx]);
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
rxdataF128 = (__m128i *)&rxdataF_ext[aa][symbol_offset];
|
||||
ul_ch128 = (__m128i *)&ul_ch_estimates[aa][symbol_offset];
|
||||
@@ -425,6 +432,356 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **ul_ch_estimates,
|
||||
int32_t **ul_ch_estimates_time,
|
||||
int32_t **rxdataF_ext,
|
||||
int N_rb_alloc,
|
||||
int frame_rx,
|
||||
int subframe_rx,
|
||||
uint32_t u,
|
||||
uint32_t v,
|
||||
uint32_t cyclic_shift,
|
||||
unsigned char l,
|
||||
int interpolate,
|
||||
uint16_t rnti) {
|
||||
|
||||
int16_t delta_phase = 0;
|
||||
int16_t *ru1 = ru_90;
|
||||
int16_t *ru2 = ru_90;
|
||||
int16_t current_phase1,current_phase2;
|
||||
uint16_t aa,Msc_RS,Msc_RS_idx;
|
||||
uint16_t * Msc_idx_ptr;
|
||||
int k,pilot_pos1 = 3 - frame_parms->Ncp, pilot_pos2 = 10 - 2*frame_parms->Ncp;
|
||||
int32_t *ul_ch1=NULL, *ul_ch2=NULL;
|
||||
int16_t ul_ch_estimates_re,ul_ch_estimates_im;
|
||||
uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
|
||||
uint32_t alpha_ind;
|
||||
int32_t tmp_estimates[N_rb_alloc*12] __attribute__((aligned(16)));
|
||||
|
||||
int symbol_offset,i;
|
||||
|
||||
//debug_msg("lte_ul_channel_estimation_RRU: cyclic shift %d\n",cyclicShift);
|
||||
|
||||
int16_t alpha_re[12] = {32767, 28377, 16383, 0,-16384, -28378,-32768,-28378,-16384, -1, 16383, 28377};
|
||||
int16_t alpha_im[12] = {0, 16383, 28377, 32767, 28377, 16383, 0,-16384,-28378,-32768,-28378,-16384};
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *rxdataF128,*ul_ref128,*ul_ch128;
|
||||
__m128i mmtmpU0,mmtmpU1,mmtmpU2,mmtmpU3;
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *rxdataF128,*ul_ref128,*ul_ch128;
|
||||
int32x4_t mmtmp0,mmtmp1,mmtmp_re,mmtmp_im;
|
||||
#endif
|
||||
|
||||
int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
|
||||
|
||||
AssertFatal(l==pilot_pos1 || l==pilot_pos2,"%d is not a valid symbol for DMRS, should be %d or %d\n",
|
||||
l,pilot_pos1,pilot_pos2);
|
||||
|
||||
Msc_RS = N_rb_alloc*12;
|
||||
/*
|
||||
|
||||
*/
|
||||
|
||||
Msc_idx_ptr = (uint16_t*) bsearch(&Msc_RS, dftsizes, 33, sizeof(uint16_t), compareints);
|
||||
|
||||
if (Msc_idx_ptr)
|
||||
Msc_RS_idx = Msc_idx_ptr - dftsizes;
|
||||
else {
|
||||
LOG_E(PHY,"lte_ul_channel_estimation_RRU: index for Msc_RS=%d not found\n",Msc_RS);
|
||||
return(-1);
|
||||
}
|
||||
LOG_D(PHY,"subframe %d, l %d, Msc_RS = %d, Msc_RS_idx = %d, u %d, v %d, cyclic_shift %d\n",subframe_rx,l,Msc_RS, Msc_RS_idx,u,v,cyclic_shift);
|
||||
#ifdef DEBUG_CH
|
||||
if (l==pilot_pos1)
|
||||
write_output("drs_seq0.m","drsseq0",ul_ref_sigs_rx[u][v][Msc_RS_idx],Msc_RS,1,1);
|
||||
else
|
||||
write_output("drs_seq1.m","drsseq1",ul_ref_sigs_rx[u][v][Msc_RS_idx],Msc_RS,1,1);
|
||||
|
||||
#endif
|
||||
|
||||
symbol_offset = frame_parms->N_RB_UL*12*l;
|
||||
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
rxdataF128 = (__m128i *)&rxdataF_ext[aa][symbol_offset];
|
||||
ul_ch128 = (__m128i *)&ul_ch_estimates[aa][symbol_offset];
|
||||
ul_ref128 = (__m128i *)ul_ref_sigs_rx[u][v][Msc_RS_idx];
|
||||
#elif defined(__arm__)
|
||||
rxdataF128 = (int16x8_t *)&rxdataF_ext[aa][symbol_offset];
|
||||
ul_ch128 = (int16x8_t *)&ul_ch_estimates[aa][symbol_offset];
|
||||
ul_ref128 = (int16x8_t *)ul_ref_sigs_rx[u][v][Msc_RS_idx];
|
||||
#endif
|
||||
|
||||
for (i=0; i<Msc_RS/12; i++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
// multiply by conjugated channel
|
||||
mmtmpU0 = _mm_madd_epi16(ul_ref128[0],rxdataF128[0]);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = _mm_shufflelo_epi16(ul_ref128[0],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = _mm_shufflehi_epi16(mmtmpU1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = _mm_sign_epi16(mmtmpU1,*(__m128i*)&conjugate[0]);
|
||||
mmtmpU1 = _mm_madd_epi16(mmtmpU1,rxdataF128[0]);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = _mm_srai_epi32(mmtmpU0,15);
|
||||
mmtmpU1 = _mm_srai_epi32(mmtmpU1,15);
|
||||
mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
|
||||
mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
|
||||
|
||||
ul_ch128[0] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
|
||||
// printf("rb %d ch: %d %d\n",i,((int16_t*)ul_ch128)[0],((int16_t*)ul_ch128)[1]);
|
||||
// multiply by conjugated channel
|
||||
mmtmpU0 = _mm_madd_epi16(ul_ref128[1],rxdataF128[1]);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = _mm_shufflelo_epi16(ul_ref128[1],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = _mm_shufflehi_epi16(mmtmpU1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = _mm_sign_epi16(mmtmpU1,*(__m128i*)conjugate);
|
||||
mmtmpU1 = _mm_madd_epi16(mmtmpU1,rxdataF128[1]);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = _mm_srai_epi32(mmtmpU0,15);
|
||||
mmtmpU1 = _mm_srai_epi32(mmtmpU1,15);
|
||||
mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
|
||||
mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
|
||||
|
||||
ul_ch128[1] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
|
||||
|
||||
mmtmpU0 = _mm_madd_epi16(ul_ref128[2],rxdataF128[2]);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = _mm_shufflelo_epi16(ul_ref128[2],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = _mm_shufflehi_epi16(mmtmpU1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = _mm_sign_epi16(mmtmpU1,*(__m128i*)conjugate);
|
||||
mmtmpU1 = _mm_madd_epi16(mmtmpU1,rxdataF128[2]);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = _mm_srai_epi32(mmtmpU0,15);
|
||||
mmtmpU1 = _mm_srai_epi32(mmtmpU1,15);
|
||||
mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
|
||||
mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
|
||||
|
||||
ul_ch128[2] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
|
||||
#elif defined(__arm__)
|
||||
mmtmp0 = vmull_s16(((int16x4_t*)ul_ref128)[0],((int16x4_t*)rxdataF128)[0]);
|
||||
mmtmp1 = vmull_s16(((int16x4_t*)ul_ref128)[1],((int16x4_t*)rxdataF128)[1]);
|
||||
mmtmp_re = vcombine_s32(vpadd_s32(vget_low_s32(mmtmp0),vget_high_s32(mmtmp0)),
|
||||
vpadd_s32(vget_low_s32(mmtmp1),vget_high_s32(mmtmp1)));
|
||||
mmtmp0 = vmull_s16(vrev32_s16(vmul_s16(((int16x4_t*)ul_ref128)[0],*(int16x4_t*)conjugate)), ((int16x4_t*)rxdataF128)[0]);
|
||||
mmtmp1 = vmull_s16(vrev32_s16(vmul_s16(((int16x4_t*)ul_ref128)[1],*(int16x4_t*)conjugate)), ((int16x4_t*)rxdataF128)[1]);
|
||||
mmtmp_im = vcombine_s32(vpadd_s32(vget_low_s32(mmtmp0),vget_high_s32(mmtmp0)),
|
||||
vpadd_s32(vget_low_s32(mmtmp1),vget_high_s32(mmtmp1)));
|
||||
|
||||
ul_ch128[0] = vcombine_s16(vmovn_s32(mmtmp_re),vmovn_s32(mmtmp_im));
|
||||
ul_ch128++;
|
||||
ul_ref128++;
|
||||
rxdataF128++;
|
||||
mmtmp0 = vmull_s16(((int16x4_t*)ul_ref128)[0],((int16x4_t*)rxdataF128)[0]);
|
||||
mmtmp1 = vmull_s16(((int16x4_t*)ul_ref128)[1],((int16x4_t*)rxdataF128)[1]);
|
||||
mmtmp_re = vcombine_s32(vpadd_s32(vget_low_s32(mmtmp0),vget_high_s32(mmtmp0)),
|
||||
vpadd_s32(vget_low_s32(mmtmp1),vget_high_s32(mmtmp1)));
|
||||
mmtmp0 = vmull_s16(vrev32_s16(vmul_s16(((int16x4_t*)ul_ref128)[0],*(int16x4_t*)conjugate)), ((int16x4_t*)rxdataF128)[0]);
|
||||
mmtmp1 = vmull_s16(vrev32_s16(vmul_s16(((int16x4_t*)ul_ref128)[1],*(int16x4_t*)conjugate)), ((int16x4_t*)rxdataF128)[1]);
|
||||
mmtmp_im = vcombine_s32(vpadd_s32(vget_low_s32(mmtmp0),vget_high_s32(mmtmp0)),
|
||||
vpadd_s32(vget_low_s32(mmtmp1),vget_high_s32(mmtmp1)));
|
||||
|
||||
ul_ch128[0] = vcombine_s16(vmovn_s32(mmtmp_re),vmovn_s32(mmtmp_im));
|
||||
ul_ch128++;
|
||||
ul_ref128++;
|
||||
rxdataF128++;
|
||||
|
||||
mmtmp0 = vmull_s16(((int16x4_t*)ul_ref128)[0],((int16x4_t*)rxdataF128)[0]);
|
||||
mmtmp1 = vmull_s16(((int16x4_t*)ul_ref128)[1],((int16x4_t*)rxdataF128)[1]);
|
||||
mmtmp_re = vcombine_s32(vpadd_s32(vget_low_s32(mmtmp0),vget_high_s32(mmtmp0)),
|
||||
vpadd_s32(vget_low_s32(mmtmp1),vget_high_s32(mmtmp1)));
|
||||
mmtmp0 = vmull_s16(vrev32_s16(vmul_s16(((int16x4_t*)ul_ref128)[0],*(int16x4_t*)conjugate)), ((int16x4_t*)rxdataF128)[0]);
|
||||
mmtmp1 = vmull_s16(vrev32_s16(vmul_s16(((int16x4_t*)ul_ref128)[1],*(int16x4_t*)conjugate)), ((int16x4_t*)rxdataF128)[1]);
|
||||
mmtmp_im = vcombine_s32(vpadd_s32(vget_low_s32(mmtmp0),vget_high_s32(mmtmp0)),
|
||||
vpadd_s32(vget_low_s32(mmtmp1),vget_high_s32(mmtmp1)));
|
||||
|
||||
ul_ch128[0] = vcombine_s16(vmovn_s32(mmtmp_re),vmovn_s32(mmtmp_im));
|
||||
ul_ch128++;
|
||||
ul_ref128++;
|
||||
rxdataF128++;
|
||||
|
||||
|
||||
#endif
|
||||
ul_ch128+=3;
|
||||
ul_ref128+=3;
|
||||
rxdataF128+=3;
|
||||
}
|
||||
|
||||
alpha_ind = 0;
|
||||
|
||||
if((cyclic_shift != 0)) {
|
||||
// Compensating for the phase shift introduced at the transmitte
|
||||
#ifdef DEBUG_CH
|
||||
write_output("drs_est_pre.m","drsest_pre",ul_ch_estimates[0],300*12,1,1);
|
||||
#endif
|
||||
|
||||
for(i=symbol_offset; i<symbol_offset+Msc_RS; i++) {
|
||||
ul_ch_estimates_re = ((int16_t*) ul_ch_estimates[aa])[i<<1];
|
||||
ul_ch_estimates_im = ((int16_t*) ul_ch_estimates[aa])[(i<<1)+1];
|
||||
// ((int16_t*) ul_ch_estimates[aa])[i<<1] = (i%2 == 1? 1:-1) * ul_ch_estimates_re;
|
||||
((int16_t*) ul_ch_estimates[aa])[i<<1] =
|
||||
(int16_t) (((int32_t) (alpha_re[alpha_ind]) * (int32_t) (ul_ch_estimates_re) +
|
||||
(int32_t) (alpha_im[alpha_ind]) * (int32_t) (ul_ch_estimates_im))>>15);
|
||||
|
||||
//((int16_t*) ul_ch_estimates[aa])[(i<<1)+1] = (i%2 == 1? 1:-1) * ul_ch_estimates_im;
|
||||
((int16_t*) ul_ch_estimates[aa])[(i<<1)+1] =
|
||||
(int16_t) (((int32_t) (alpha_re[alpha_ind]) * (int32_t) (ul_ch_estimates_im) -
|
||||
(int32_t) (alpha_im[alpha_ind]) * (int32_t) (ul_ch_estimates_re))>>15);
|
||||
|
||||
alpha_ind+=cyclic_shift;
|
||||
|
||||
if (alpha_ind>11)
|
||||
alpha_ind-=12;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
write_output("drs_est_post.m","drsest_post",ul_ch_estimates[0],300*12,1,1);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (ul_ch_estimates_time && ul_ch_estimates_time[aa]) {
|
||||
// Convert to time domain for visualization
|
||||
memset(temp_in_ifft_0,0,frame_parms->ofdm_symbol_size*sizeof(int32_t));
|
||||
for(i=0; i<Msc_RS; i++)
|
||||
((int32_t*)temp_in_ifft_0)[i] = ul_ch_estimates[aa][symbol_offset+i];
|
||||
|
||||
switch(frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
idft128((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft512((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft1024((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
case 100:
|
||||
idft2048((int16_t*) temp_in_ifft_0,
|
||||
(int16_t*) ul_ch_estimates_time[aa],
|
||||
1);
|
||||
break;
|
||||
}
|
||||
|
||||
#if T_TRACER
|
||||
if (aa == 0)
|
||||
T(T_ENB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(rnti),
|
||||
T_INT(frame_rx), T_INT(subframe_rx),
|
||||
T_INT(0), T_BUFFER(ul_ch_estimates_time[0], 512 * 4));
|
||||
#endif
|
||||
}
|
||||
#ifdef DEBUG_CH
|
||||
|
||||
if (aa==1) {
|
||||
if (l == pilot_pos1) {
|
||||
write_output("rxdataF_ext.m","rxF_ext",&rxdataF_ext[aa][symbol_offset],512*2,2,1);
|
||||
write_output("tmpin_ifft.m","drs_in",temp_in_ifft_0,512,1,1);
|
||||
if (ul_ch_estimates_time[aa]) write_output("drs_est0.m","drs0",ul_ch_estimates_time[aa],512,1,1);
|
||||
} else
|
||||
if (ul_ch_estimates_time[aa]) write_output("drs_est1.m","drs1",ul_ch_estimates_time[aa],512,1,1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
if (l==pilot_pos2 && interpolate==1) {//we are in the second slot of the sub-frame, so do the interpolation
|
||||
|
||||
ul_ch1 = &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*pilot_pos1];
|
||||
ul_ch2 = &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*pilot_pos2];
|
||||
|
||||
|
||||
// Estimation of phase difference between the 2 channel estimates
|
||||
delta_phase = lte_ul_freq_offset_estimation(frame_parms,
|
||||
ul_ch_estimates[aa],
|
||||
N_rb_alloc);
|
||||
// negative phase index indicates negative Im of ru
|
||||
// msg("delta_phase: %d\n",delta_phase);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
LOG_D(PHY,"lte_ul_channel_estimation_RRU: ul_ch1 = %p, ul_ch2 = %p, pilot_pos1=%d, pilot_pos2=%d\n",ul_ch1, ul_ch2, pilot_pos1,pilot_pos2);
|
||||
#endif
|
||||
|
||||
for (k=0; k<frame_parms->symbols_per_tti; k++) {
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
// LOG_D(PHY,"lte_ul_channel_estimation: k=%d, alpha = %d, beta = %d\n",k,alpha,beta);
|
||||
#endif
|
||||
//symbol_offset_subframe = frame_parms->N_RB_UL*12*k;
|
||||
|
||||
// interpolate between estimates
|
||||
if ((k != pilot_pos1) && (k != pilot_pos2)) {
|
||||
|
||||
// the phase is linearly interpolated
|
||||
current_phase1 = (delta_phase/7)*(k-pilot_pos1);
|
||||
current_phase2 = (delta_phase/7)*(k-pilot_pos2);
|
||||
// msg("sym: %d, current_phase1: %d, current_phase2: %d\n",k,current_phase1,current_phase2);
|
||||
// set the right quadrant
|
||||
(current_phase1 > 0) ? (ru1 = ru_90) : (ru1 = ru_90c);
|
||||
(current_phase2 > 0) ? (ru2 = ru_90) : (ru2 = ru_90c);
|
||||
// take absolute value and clip
|
||||
current_phase1 = cmin(abs(current_phase1),127);
|
||||
current_phase2 = cmin(abs(current_phase2),127);
|
||||
|
||||
// msg("sym: %d, current_phase1: %d, ru: %d + j%d, current_phase2: %d, ru: %d + j%d\n",k,current_phase1,ru1[2*current_phase1],ru1[2*current_phase1+1],current_phase2,ru2[2*current_phase2],ru2[2*current_phase2+1]);
|
||||
|
||||
// rotate channel estimates by estimated phase
|
||||
rotate_cpx_vector((int16_t*) ul_ch1,
|
||||
&ru1[2*current_phase1],
|
||||
(int16_t*) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],
|
||||
Msc_RS,
|
||||
15);
|
||||
|
||||
rotate_cpx_vector((int16_t*) ul_ch2,
|
||||
&ru2[2*current_phase2],
|
||||
(int16_t*) &tmp_estimates[0],
|
||||
Msc_RS,
|
||||
15);
|
||||
|
||||
// Combine the two rotated estimates
|
||||
multadd_complex_vector_real_scalar((int16_t*) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],SCALE,(int16_t*) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],1,Msc_RS);
|
||||
multadd_complex_vector_real_scalar((int16_t*) &tmp_estimates[0],SCALE,(int16_t*) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],0,Msc_RS);
|
||||
|
||||
}
|
||||
} //for(k=...
|
||||
|
||||
// because of the scaling of alpha and beta we also need to scale the final channel estimate at the pilot positions
|
||||
|
||||
// multadd_complex_vector_real_scalar((int16_t*) ul_ch1,SCALE,(int16_t*) ul_ch1,1,Msc_RS);
|
||||
// multadd_complex_vector_real_scalar((int16_t*) ul_ch2,SCALE,(int16_t*) ul_ch2,1,Msc_RS);
|
||||
|
||||
} //if (Ns&1 && interpolate==1)
|
||||
else if (interpolate == 0 && l == pilot_pos1)
|
||||
for (k=0;k<frame_parms->symbols_per_tti>>1;k++) {
|
||||
if (k==pilot_pos1) k++;
|
||||
memcpy((void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],
|
||||
(void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*pilot_pos1],
|
||||
frame_parms->N_RB_UL*12*sizeof(int));
|
||||
}
|
||||
else if (interpolate == 0 && l == pilot_pos2) {
|
||||
for (k=0;k<frame_parms->symbols_per_tti>>1;k++) {
|
||||
if (k==pilot_pos2) k++;
|
||||
memcpy((void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*(k+(frame_parms->symbols_per_tti>>1))],
|
||||
(void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*pilot_pos2],
|
||||
frame_parms->N_RB_UL*12*sizeof(int));
|
||||
}
|
||||
delta_phase = lte_ul_freq_offset_estimation(frame_parms,
|
||||
ul_ch_estimates[aa],
|
||||
N_rb_alloc);
|
||||
LOG_D(PHY,"delta_phase = %d\n",delta_phase);
|
||||
}
|
||||
} //for(aa=...
|
||||
return(0);
|
||||
}
|
||||
|
||||
extern uint16_t transmission_offset_tdd[16];
|
||||
//#define DEBUG_SRS
|
||||
|
||||
|
||||
@@ -131,3 +131,92 @@ int lte_dl_mbsfn_rx(PHY_VARS_UE *ue,
|
||||
return(0);
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int lte_dl_mbsfn_khz_1dot25(PHY_VARS_eNB *eNB, int32_t *output,
|
||||
short amp,
|
||||
int subframe)
|
||||
{
|
||||
|
||||
unsigned int mprime,mprime_dword,mprime_qpsk_symb,m;
|
||||
unsigned short k=0,a;
|
||||
int32_t qpsk[4];
|
||||
|
||||
a = (amp*ONE_OVER_SQRT2_Q15)>>15;
|
||||
((short *)&qpsk[0])[0] = a;
|
||||
((short *)&qpsk[0])[1] = a;
|
||||
|
||||
((short *)&qpsk[1])[0] = -a;
|
||||
((short *)&qpsk[1])[1] = a;
|
||||
((short *)&qpsk[2])[0] = a;
|
||||
((short *)&qpsk[2])[1] = -a;
|
||||
|
||||
((short *)&qpsk[3])[0] = -a;
|
||||
((short *)&qpsk[3])[1] = -a;
|
||||
|
||||
|
||||
mprime = 3*(110 - eNB->frame_parms.N_RB_DL);
|
||||
|
||||
for (m=0; m<eNB->frame_parms.N_RB_DL*24; m++) // m = 0:24*N_RB_DL-1
|
||||
{
|
||||
if ((subframe&0x1)==0) // n_sf mod 2 == 0: even
|
||||
k = 6*m;
|
||||
else
|
||||
k = 6*m + 3;
|
||||
|
||||
|
||||
k+=eNB->frame_parms.first_carrier_offset_khz_1dot25;
|
||||
|
||||
mprime_dword = mprime>>4;
|
||||
mprime_qpsk_symb = mprime&0xf;
|
||||
|
||||
if (k >= eNB->frame_parms.ofdm_symbol_size_khz_1dot25) {
|
||||
k++; // skip DC carrier
|
||||
k-=eNB->frame_parms.ofdm_symbol_size_khz_1dot25;
|
||||
}
|
||||
output[k] = qpsk[(eNB->lte_gold_mbsfn_khz_1dot25_table[subframe][mprime_dword]>>(2*mprime_qpsk_symb))&3];
|
||||
mprime++;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int lte_dl_mbsfn_khz_1dot25_rx(PHY_VARS_UE *ue,
|
||||
int *output,
|
||||
int subframe)
|
||||
{
|
||||
|
||||
unsigned int mprime,mprime_dword,mprime_qpsk_symb,m;
|
||||
unsigned short k=0;
|
||||
unsigned int qpsk[4];
|
||||
|
||||
// This includes complex conjugate for channel estimation
|
||||
|
||||
((short *)&qpsk[0])[0] = ONE_OVER_SQRT2_Q15;
|
||||
((short *)&qpsk[0])[1] = -ONE_OVER_SQRT2_Q15;
|
||||
((short *)&qpsk[1])[0] = -ONE_OVER_SQRT2_Q15;
|
||||
((short *)&qpsk[1])[1] = -ONE_OVER_SQRT2_Q15;
|
||||
((short *)&qpsk[2])[0] = ONE_OVER_SQRT2_Q15;
|
||||
((short *)&qpsk[2])[1] = ONE_OVER_SQRT2_Q15;
|
||||
((short *)&qpsk[3])[0] = -ONE_OVER_SQRT2_Q15;
|
||||
((short *)&qpsk[3])[1] = ONE_OVER_SQRT2_Q15;
|
||||
|
||||
mprime = 3*(110 - ue->frame_parms.N_RB_DL);
|
||||
|
||||
for (m=0; m<ue->frame_parms.N_RB_DL*24; m++) // m = 0:24*N_RB_DL-1
|
||||
{ mprime_dword = mprime>>4;
|
||||
mprime_qpsk_symb = mprime&0xf;
|
||||
|
||||
// this is r_mprime from 3GPP 36-211 6.10.1.2
|
||||
output[k] = qpsk[(ue->lte_gold_mbsfn_khz_1dot25_table[subframe][mprime_dword]>>(2*mprime_qpsk_symb))&3];
|
||||
|
||||
mprime++;
|
||||
k++;
|
||||
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#endif // MAKE Rel14
|
||||
|
||||
|
||||
@@ -95,6 +95,34 @@ void lte_gold_mbsfn(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_mbsfn_tabl
|
||||
}
|
||||
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void lte_gold_mbsfn_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_mbsfn_khz_1dot25_table[10][150],uint16_t Nid_mbsfn){
|
||||
unsigned char sfn;
|
||||
unsigned int n,x1,x2;//,x1tmp,x2tmp;
|
||||
|
||||
for (sfn=0; sfn<10; sfn++) {
|
||||
x2 = (Nid_mbsfn) + (((1+(Nid_mbsfn<<1))*(1 + (7*(1+sfn))))<<9); //cinit
|
||||
x1 = 1+ (1<<31);
|
||||
x2=x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31);
|
||||
for (n=1; n<50; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
}
|
||||
for (n=0; n<150; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
lte_gold_mbsfn_khz_1dot25_table[sfn][n] = x1^x2;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef LTE_GOLD_MAIN
|
||||
main()
|
||||
{
|
||||
|
||||
@@ -57,6 +57,8 @@ void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][38],uint16_
|
||||
|
||||
void lte_gold_mbsfn(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_mbsfn_table[10][3][42],uint16_t Nid_MBSFN);
|
||||
|
||||
void lte_gold_mbsfn_khz_1dot25 (LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_mbsfn_1khz_1dot25_table[10][150],uint16_t Nid_MBSFN);
|
||||
|
||||
|
||||
/*! \brief This function generates the cell-specific reference signal sequence (36-211, Sec 6.10.1.1)
|
||||
@param phy_vars_eNB Pointer to eNB variables
|
||||
@@ -144,6 +146,10 @@ int lte_dl_mbsfn_rx(PHY_VARS_UE *phy_vars_ue,
|
||||
int subframe,
|
||||
unsigned char l);
|
||||
|
||||
int lte_dl_mbsfn_khz_1dot25_rx(PHY_VARS_UE *ue,
|
||||
int *output,
|
||||
int subframe);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -105,7 +105,7 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_comp);
|
||||
LOG_D(HW,"[SF %d] Compress_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 );
|
||||
clock_gettime( CLOCK_MONOTONIC, &start_comp);
|
||||
ru->ifdevice.trx_write_func(&ru->ifdevice,
|
||||
(proc_timestamp + packet_id*spp_eth),
|
||||
@@ -115,7 +115,7 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
0);
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_comp);
|
||||
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
|
||||
}
|
||||
} else if (eth->compression == NO_COMPRESS) {
|
||||
|
||||
@@ -124,7 +124,7 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
|
||||
for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 );
|
||||
clock_gettime( CLOCK_MONOTONIC, &start_comp);
|
||||
ru->ifdevice.trx_write_func(&ru->ifdevice,
|
||||
(proc_timestamp + packet_id*spp_eth),
|
||||
@@ -134,7 +134,7 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
0);
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_comp);
|
||||
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
|
||||
for (i=0; i < fp->nb_antennas_tx; i++)
|
||||
txp[i] += spp_eth;
|
||||
|
||||
@@ -160,7 +160,7 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_comp);
|
||||
LOG_D(HW,"[SF %d] Compress_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 );
|
||||
clock_gettime( CLOCK_MONOTONIC, &start_comp);
|
||||
ru->ifdevice.trx_write_func(&ru->ifdevice,
|
||||
(proc_timestamp + packet_id*spp_eth),
|
||||
@@ -170,7 +170,7 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
0);
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_comp);
|
||||
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
|
||||
}
|
||||
} else if (eth->compression == NO_COMPRESS) {
|
||||
for (i=0; i < fp->nb_antennas_rx; i++)
|
||||
@@ -178,7 +178,7 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
|
||||
for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 );
|
||||
clock_gettime( CLOCK_MONOTONIC, &start_comp);
|
||||
ru->ifdevice.trx_write_func(&ru->ifdevice,
|
||||
(proc_timestamp + packet_id*spp_eth),
|
||||
@@ -188,7 +188,7 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
|
||||
0);
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_comp);
|
||||
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
|
||||
for (i=0; i < fp->nb_antennas_rx; i++)
|
||||
rxp[i] += spp_eth;
|
||||
|
||||
@@ -343,6 +343,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
uint16_t *j = NULL;
|
||||
|
||||
openair0_timestamp timestamp[spsf / spp_eth];
|
||||
memset(timestamp, 0, sizeof(timestamp));
|
||||
eth_state_t *eth = (eth_state_t*) (ru->ifdevice.priv);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF5, 1 );
|
||||
@@ -356,7 +357,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
}
|
||||
for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RECV_IF5_PKT_ID, packet_id );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 1 );
|
||||
clock_gettime( CLOCK_MONOTONIC, &start_decomp);
|
||||
ru->ifdevice.trx_read_func(&ru->ifdevice,
|
||||
×tamp[packet_id],
|
||||
@@ -366,7 +367,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_decomp);
|
||||
LOG_D(HW,"[SF %d] IF_Read_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_decomp, end_decomp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 1 );
|
||||
clock_gettime( CLOCK_MONOTONIC, &start_decomp);
|
||||
for (i=0; i < fp->nb_antennas_tx; i++) {
|
||||
@@ -386,7 +387,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
|
||||
for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RECV_IF5_PKT_ID, packet_id );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 1 );
|
||||
clock_gettime( CLOCK_MONOTONIC, &start_decomp);
|
||||
ru->ifdevice.trx_read_func(&ru->ifdevice,
|
||||
×tamp[packet_id],
|
||||
@@ -395,7 +396,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
fp->nb_antennas_tx);
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_decomp);
|
||||
LOG_D(HW,"[SF %d] IF_Read_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_decomp, end_decomp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 0 );
|
||||
for (i=0; i < fp->nb_antennas_tx; i++)
|
||||
txp[i] += spp_eth;
|
||||
|
||||
@@ -412,7 +413,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
}
|
||||
for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 1 );
|
||||
clock_gettime( CLOCK_MONOTONIC, &start_decomp);
|
||||
ru->ifdevice.trx_read_func(&ru->ifdevice,
|
||||
×tamp[packet_id],
|
||||
@@ -421,7 +422,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
fp->nb_antennas_rx);
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_decomp);
|
||||
LOG_D(HW,"[SF %d] IF_Read_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_decomp, end_decomp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF, 1 );
|
||||
clock_gettime( CLOCK_MONOTONIC, &start_decomp);
|
||||
for (i=0; i < fp->nb_antennas_rx; i++) {
|
||||
@@ -441,7 +442,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
|
||||
for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 1 );
|
||||
clock_gettime( CLOCK_MONOTONIC, &start_decomp);
|
||||
ru->ifdevice.trx_read_func(&ru->ifdevice,
|
||||
×tamp[packet_id],
|
||||
@@ -450,7 +451,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
fp->nb_antennas_rx);
|
||||
clock_gettime( CLOCK_MONOTONIC, &end_decomp);
|
||||
LOG_D(HW,"[SF %d] IF_Read_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_decomp, end_decomp));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 0 );
|
||||
for (i=0; i < fp->nb_antennas_rx; i++)
|
||||
rxp[i] += spp_eth;
|
||||
|
||||
@@ -622,7 +623,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
free(rx_buffer);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -349,6 +349,43 @@ int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint
|
||||
}
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int get_G_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe,uint8_t beamforming_mode)
|
||||
{
|
||||
//int G_adj;
|
||||
|
||||
/*if (is_pmch_subframe(frame,subframe,frame_parms) == 0) {
|
||||
G_adj= adjust_G(frame_parms,rb_alloc,mod_order,subframe);
|
||||
|
||||
//printf("get_G subframe %d mod_order %d, nb_rb %d: rb_alloc %x,%x,%x,%x, G_adj %d\n",subframe,mod_order,nb_rb,rb_alloc[3],rb_alloc[2],rb_alloc[1],rb_alloc[0], G_adj);
|
||||
if (frame_parms->Ncp==NORMAL) { // normal prefix
|
||||
// PDDDPDD PDDDPDD - 13 PDSCH symbols, 10 full, 3 w/ pilots = 10*12 + 3*8
|
||||
// PCDDPDD PDDDPDD - 12 PDSCH symbols, 9 full, 3 w/ pilots = 9*12 + 3*8
|
||||
// PCCDPDD PDDDPDD - 11 PDSCH symbols, 8 full, 3 w/pilots = 8*12 + 3*8
|
||||
if (beamforming_mode==0 && frame_parms->nb_antenna_ports_eNB!=1)
|
||||
return((((int)nb_rb * mod_order * ((11-num_pdcch_symbols)*12 + 3*8)) - G_adj)*Nl);
|
||||
else if(beamforming_mode==7)
|
||||
return(((int)nb_rb * mod_order * ((7-num_pdcch_symbols)*12 + 3*10 + 4*9)) - G_adj);
|
||||
else //SISO
|
||||
return(((int)nb_rb * mod_order * ((11-num_pdcch_symbols)*12 + 3*10)) - G_adj);
|
||||
} else {
|
||||
// PDDPDD PDDPDD - 11 PDSCH symbols, 8 full, 3 w/ pilots = 8*12 + 3*8
|
||||
// PCDPDD PDDPDD - 10 PDSCH symbols, 7 full, 3 w/ pilots = 7*12 + 3*8
|
||||
// PCCPDD PDDPDD - 9 PDSCH symbols, 6 full, 3 w/pilots = 6*12 + 3*8
|
||||
if (frame_parms->nb_antenna_ports_eNB!=1)
|
||||
return((((int)nb_rb * mod_order * ((9-num_pdcch_symbols)*12 + 3*8)) - G_adj)*Nl);
|
||||
else if(beamforming_mode==7)
|
||||
return(((int)nb_rb * mod_order * ((5-num_pdcch_symbols)*12 + 3*8 + 4*9)) - G_adj);
|
||||
else //SISO
|
||||
return(((int)nb_rb * mod_order * ((9-num_pdcch_symbols)*12 + 3*10)) - G_adj);
|
||||
}
|
||||
} else { // This is an MBSFN subframe
|
||||
return((int)frame_parms->N_RB_DL * mod_order * 102);
|
||||
}*/
|
||||
return((int)frame_parms->N_RB_DL * mod_order * 120);
|
||||
}
|
||||
#endif
|
||||
|
||||
// following function requires dlsch_tbs_full.h
|
||||
#include "PHY/LTE_TRANSPORT/dlsch_tbs_full.h"
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ void generate_pcfich(uint8_t num_pdcch_symbols,
|
||||
subframe,num_pdcch_symbols,amp,frame_parms->nb_antenna_ports_eNB,frame_parms->Ncp);
|
||||
#endif
|
||||
|
||||
memset(pcfich_bt, 0, sizeof(pcfich_bt));
|
||||
|
||||
// scrambling
|
||||
if ((num_pdcch_symbols>0) && (num_pdcch_symbols<4))
|
||||
pcfich_scrambling(frame_parms,subframe,pcfich_b[num_pdcch_symbols-1],pcfich_bt);
|
||||
|
||||
@@ -774,3 +774,5 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
|
||||
}// for (i=0; i<eNB->phich_vars[subframe&1].num_hi; i++) {
|
||||
eNB->phich_vars[subframe&1].num_hi=0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,13 @@
|
||||
#include "PHY/defs_eNB.h"
|
||||
|
||||
|
||||
uint8_t get_mi(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe) {
|
||||
uint8_t get_mi(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
|
||||
{
|
||||
// for FeMBMS
|
||||
if(frame_parms->FeMBMS_active!=0){
|
||||
return(0);
|
||||
}
|
||||
|
||||
// for FDD
|
||||
if (frame_parms->frame_type == FDD)
|
||||
return 1;
|
||||
|
||||
@@ -22,6 +22,88 @@
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/pmch_common.c
|
||||
* \brief This includes routines for decoding the UE FeMBMS/PMCH physical/multicast/transport channel 3GPP TS 36.211 version 14.2.0 Release 14 Sections 6.5/6.10.2
|
||||
* \author J. Morgade
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
* \company Vicomtech
|
||||
* \email: javier.morgade@ieee.org
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int is_fembms_cas_subframe(uint32_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_parms){
|
||||
uint32_t period;
|
||||
if(frame_parms->NonMBSFN_config_flag ) {
|
||||
period = 4<<frame_parms->NonMBSFN_config.radioframeAllocationPeriod;
|
||||
if ((frame % period) == frame_parms->NonMBSFN_config.radioframeAllocationOffset) {
|
||||
switch (subframe) {
|
||||
case 0:
|
||||
return(1); //This should be CAS
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
int is_fembms_pmch_subframe(uint32_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
uint32_t period;
|
||||
|
||||
if(frame_parms->NonMBSFN_config_flag ) {
|
||||
period = 4<<frame_parms->NonMBSFN_config.radioframeAllocationPeriod;
|
||||
if ((frame % period) == frame_parms->NonMBSFN_config.radioframeAllocationOffset) {
|
||||
switch (subframe) {
|
||||
case 1:
|
||||
if ((frame_parms->NonMBSFN_config.non_mbsfn_SubframeConfig & 0x100) > 0)
|
||||
return(1);
|
||||
break;
|
||||
case 2:
|
||||
if ((frame_parms->NonMBSFN_config.non_mbsfn_SubframeConfig & 0x80) > 0)
|
||||
return(1);
|
||||
break;
|
||||
case 3:
|
||||
if ((frame_parms->NonMBSFN_config.non_mbsfn_SubframeConfig & 0x40) > 0)
|
||||
return(1);
|
||||
break;
|
||||
case 4:
|
||||
if ((frame_parms->NonMBSFN_config.non_mbsfn_SubframeConfig & 0x20) > 0)
|
||||
return(1);
|
||||
break;
|
||||
case 5:
|
||||
if ((frame_parms->NonMBSFN_config.non_mbsfn_SubframeConfig & 0x10) > 0)
|
||||
return(1);
|
||||
break;
|
||||
case 6:
|
||||
if ((frame_parms->NonMBSFN_config.non_mbsfn_SubframeConfig & 0x8) > 0)
|
||||
return(1);
|
||||
break;
|
||||
case 7:
|
||||
if ((frame_parms->NonMBSFN_config.non_mbsfn_SubframeConfig & 0x4) > 0)
|
||||
return(1);
|
||||
break;
|
||||
case 8:
|
||||
if ((frame_parms->NonMBSFN_config.non_mbsfn_SubframeConfig & 0x2) > 0)
|
||||
return(1);
|
||||
break;
|
||||
case 9:
|
||||
if ((frame_parms->NonMBSFN_config.non_mbsfn_SubframeConfig & 0x1) > 0)
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
} else { //Then regular MBSFN FeMBMS subframe
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
int is_pmch_subframe(uint32_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
uint16_t *max_preamble,
|
||||
uint16_t *max_preamble_energy,
|
||||
uint16_t *max_preamble_delay,
|
||||
uint16_t *avg_preamble_energy,
|
||||
uint16_t Nf,
|
||||
uint8_t tdd_mapindex
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
@@ -95,8 +96,6 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int prach_ifft_cnt=0;
|
||||
#endif
|
||||
|
||||
|
||||
if(eNB) {
|
||||
fp = &(eNB->frame_parms);
|
||||
nb_rx = fp->nb_antennas_rx;
|
||||
@@ -428,7 +427,6 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
else
|
||||
#endif
|
||||
send_IF4p5(ru, ru->proc.frame_prach, ru->proc.subframe_prach, IF4p5_PRACH);
|
||||
|
||||
return;
|
||||
} else if (eNB!=NULL) {
|
||||
if ( LOG_DEBUGFLAG(PRACH)) {
|
||||
@@ -469,6 +467,8 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
|
||||
*max_preamble_energy=0;
|
||||
*avg_preamble_energy=0;
|
||||
uint64_t avg_en=0;
|
||||
|
||||
for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
@@ -589,8 +589,8 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
if (prach[0]!= NULL) LOG_M("prach_rx0.m","prach_rx0",prach[0],6144+792,1,1);
|
||||
|
||||
LOG_M("prach_rx1.m","prach_rx1",prach[1],6144+792,1,1);
|
||||
LOG_M("prach_rxF0.m","prach_rxF0",rxsigF[0],24576,1,1);
|
||||
LOG_M("prach_rxF1.m","prach_rxF1",rxsigF[1],6144,1,1);
|
||||
LOG_M("prach_rxF0.m","prach_rxF0",rxsigF[0],12288,1,1);
|
||||
LOG_M("prach_rxF1.m","prach_rxF1",rxsigF[1],12288,1,1);
|
||||
}
|
||||
|
||||
for (aa=0; aa<nb_rx; aa++) {
|
||||
@@ -613,14 +613,14 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
|
||||
// compute energy and accumulate over receive antennas and repetitions for BR
|
||||
for (i=0; i<2048; i++)
|
||||
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[i<<1] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>10;
|
||||
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[i<<1] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>9;
|
||||
} else {
|
||||
idft256(prachF,prach_ifft_tmp,1);
|
||||
log2_ifft_size = 8;
|
||||
|
||||
// compute energy and accumulate over receive antennas and repetitions for BR
|
||||
for (i=0; i<256; i++)
|
||||
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[(i<<1)] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>10;
|
||||
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[(i<<1)] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>9;
|
||||
}
|
||||
|
||||
if (LOG_DUMPFLAG(PRACH)) {
|
||||
@@ -649,6 +649,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
|
||||
for (i=0; i<NCS2; i++) {
|
||||
lev = (int32_t)prach_ifft[(preamble_shift2+i)];
|
||||
avg_en += lev;
|
||||
levdB = dB_fixed_times10(lev);
|
||||
|
||||
if (levdB>*max_preamble_energy) {
|
||||
@@ -666,10 +667,10 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
*max_preamble,br_flag,ce_level,levdB,lev);
|
||||
}
|
||||
}
|
||||
}
|
||||
} ///ncs2
|
||||
}
|
||||
}// preamble_index
|
||||
|
||||
*avg_preamble_energy=dB_fixed(avg_en/64);
|
||||
if (LOG_DUMPFLAG(PRACH)) {
|
||||
int en = dB_fixed(signal_energy((int32_t *)&rxsigF[0][0],840));
|
||||
|
||||
@@ -687,6 +688,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
|
||||
LOG_M("Xu.m","xu",Xu,N_ZC,1,1);
|
||||
LOG_M("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);
|
||||
exit(-1);
|
||||
} else {
|
||||
LOG_E(PHY,"Dumping prach (br_flag %d), k = %d (n_ra_prb %d)\n",br_flag,k,n_ra_prb);
|
||||
LOG_M("rxsigF_br.m","prach_rxF_br",&rxsigF[0][0],12288,1,1);
|
||||
@@ -708,6 +710,7 @@ void rx_prach(PHY_VARS_eNB *eNB,
|
||||
uint16_t *max_preamble,
|
||||
uint16_t *max_preamble_energy,
|
||||
uint16_t *max_preamble_delay,
|
||||
uint16_t *avg_preamble_energy,
|
||||
uint16_t Nf,
|
||||
uint8_t tdd_mapindex,
|
||||
uint8_t br_flag) {
|
||||
@@ -715,7 +718,7 @@ void rx_prach(PHY_VARS_eNB *eNB,
|
||||
int prach_mask=0;
|
||||
|
||||
if (br_flag == 0) {
|
||||
rx_prach0(eNB,ru,max_preamble,max_preamble_energy,max_preamble_delay,Nf,tdd_mapindex,0,0);
|
||||
rx_prach0(eNB,ru,max_preamble,max_preamble_energy,max_preamble_delay,avg_preamble_energy,Nf,tdd_mapindex,0,0);
|
||||
} else { // This is procedure for eMTC, basically handling the repetitions
|
||||
prach_mask = is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br);
|
||||
|
||||
@@ -729,7 +732,7 @@ void rx_prach(PHY_VARS_eNB *eNB,
|
||||
// increment repetition number
|
||||
eNB->prach_vars_br.repetition_number[i]++;
|
||||
// do basic PRACH reception
|
||||
rx_prach0(eNB,ru,max_preamble,max_preamble_energy,max_preamble_delay,Nf,tdd_mapindex,1,i);
|
||||
rx_prach0(eNB,ru,max_preamble,max_preamble_energy,max_preamble_delay,avg_preamble_energy,Nf,tdd_mapindex,1,i);
|
||||
|
||||
// if last repetition, clear counter
|
||||
if (eNB->prach_vars_br.repetition_number[i] == eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[i]) {
|
||||
@@ -740,4 +743,6 @@ void rx_prach(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) */
|
||||
|
||||
|
||||
@@ -96,6 +96,8 @@ uint32_t conv_nprb(uint8_t ra_header,uint32_t rb_alloc,int N_RB_DL);
|
||||
|
||||
int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe, uint8_t beamforming_mode);
|
||||
|
||||
int get_G_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe, uint8_t beamforming_mode);
|
||||
|
||||
int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe);
|
||||
int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol);
|
||||
|
||||
@@ -256,6 +258,27 @@ void init_prach_tables(int N_ZC);
|
||||
*/
|
||||
int is_pmch_subframe(frame_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/*!
|
||||
\brief Return the status of CAS in this frame/subframe
|
||||
@param frame Frame index
|
||||
@param subframe Subframe index
|
||||
@param frame_parms Pointer to frame parameters
|
||||
@returns 1 if subframe is for CAS
|
||||
*/
|
||||
int is_fembms_cas_subframe(frame_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
/*!
|
||||
\brief Return the status of MBSFN in this frame/subframe
|
||||
@param frame Frame index
|
||||
@param subframe Subframe index
|
||||
@param frame_parms Pointer to frame parameters
|
||||
@returns 1 if subframe is for MBSFN
|
||||
*/
|
||||
int is_fembms_pmch_subframe(frame_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_parms);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/** \brief This routine expands a single (wideband) PMI to subband PMI bitmap similar to the one used in the UCI and in the dlsch_modulation routine
|
||||
@param frame_parms Pointer to DL frame configuration parameters
|
||||
|
||||
@@ -577,6 +577,7 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,RU_t *ru,
|
||||
uint16_t *max_preamble,
|
||||
uint16_t *max_preamble_energy,
|
||||
uint16_t *max_preamble_delay,
|
||||
uint16_t *avg_preamble_energy,
|
||||
uint16_t Nf, uint8_t tdd_mapindex
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,
|
||||
|
||||
@@ -1930,7 +1930,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
|
||||
|
||||
if (((L>1) && ((crc == si_rnti)||
|
||||
(crc == p_rnti)||
|
||||
(crc == ra_rnti)))||
|
||||
(crc == ra_rnti)/*||(crc == 0xfff9)*/))||
|
||||
(crc == pdcch_vars[eNB_id]->crnti)) {
|
||||
dci_alloc[*dci_cnt].dci_length = sizeof_bits;
|
||||
dci_alloc[*dci_cnt].rnti = crc;
|
||||
@@ -1965,7 +1965,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
|
||||
#endif
|
||||
}
|
||||
|
||||
if (crc==si_rnti) {
|
||||
if (crc==si_rnti /*|| crc==0xfff9*/) {
|
||||
dci_alloc[*dci_cnt].format = format_si;
|
||||
*dci_cnt = *dci_cnt+1;
|
||||
} else if (crc==p_rnti) {
|
||||
|
||||
@@ -256,7 +256,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
|
||||
if (frame_parms->nb_antenna_ports_eNB>1 && beamforming_mode==0) {
|
||||
#ifdef DEBUG_DLSCH_MOD
|
||||
LOG_I(PHY,"dlsch: using pmi %x (%p), rb_alloc %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),dlsch[0],dlsch0_harq->rb_alloc_even[0]);
|
||||
LOG_D(PHY,"dlsch: using pmi %x (%p), rb_alloc %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),dlsch[0],dlsch0_harq->rb_alloc_even[0]);
|
||||
#endif
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
|
||||
@@ -829,7 +829,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
pdsch_vars[eNB_id]->llr_offset[symbol],
|
||||
(int16_t*)pdsch_vars[eNB_id]->llr[0],
|
||||
pllr_symbol_cw0);
|
||||
*/
|
||||
*/
|
||||
switch (dlsch0_harq->Qm) {
|
||||
case 2 :
|
||||
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
|
||||
|
||||
@@ -37,7 +37,9 @@
|
||||
//#define DEBUG_DRS
|
||||
|
||||
int generate_drs_pusch(PHY_VARS_UE *ue,
|
||||
UE_rxtx_proc_t *proc,
|
||||
UE_rxtx_proc_t *proc,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **txdataF,
|
||||
uint8_t eNB_id,
|
||||
short amp,
|
||||
unsigned int subframe,
|
||||
@@ -56,29 +58,37 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
|
||||
int16_t alpha_re[12] = {32767, 28377, 16383, 0,-16384, -28378,-32768,-28378,-16384, -1, 16383, 28377};
|
||||
int16_t alpha_im[12] = {0, 16383, 28377, 32767, 28377, 16383, 0,-16384,-28378,-32768,-28378,-16384};
|
||||
|
||||
uint8_t cyclic_shift,cyclic_shift0,cyclic_shift1;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
int32_t *txdataF = ue->common_vars.txdataF[ant];
|
||||
uint8_t cyclic_shift,cyclic_shift0=0,cyclic_shift1=0;
|
||||
LTE_DL_FRAME_PARMS *fp = (ue==NULL) ? frame_parms : &ue->frame_parms;
|
||||
int32_t *txF = (ue==NULL) ? txdataF[ant] : ue->common_vars.txdataF[ant];
|
||||
uint32_t u,v,alpha_ind;
|
||||
uint32_t u0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1];
|
||||
uint32_t u1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)];
|
||||
uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1];
|
||||
uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
|
||||
uint32_t u0 = (ue==NULL) ? 0 : frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1];
|
||||
uint32_t u1 = (ue==NULL) ? 0 : frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)];
|
||||
uint32_t v0 = (ue==NULL) ? 0 : frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1];
|
||||
uint32_t v1 = (ue==NULL) ? 0 : frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
|
||||
|
||||
int32_t ref_re,ref_im;
|
||||
uint8_t harq_pid = subframe2harq_pid(frame_parms,proc->frame_tx,subframe);
|
||||
uint8_t harq_pid = (proc == NULL) ? 0: subframe2harq_pid(fp,proc->frame_tx,subframe);
|
||||
|
||||
cyclic_shift0 = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2 +
|
||||
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]+
|
||||
((ue->ulsch[0]->cooperation_flag==2)?10:0)+
|
||||
ant*6) % 12;
|
||||
// printf("PUSCH.cyclicShift %d, n_DMRS2 %d, nPRS %d\n",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift,ue->ulsch[eNB_id]->n_DMRS2,ue->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]);
|
||||
cyclic_shift1 = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2 +
|
||||
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[(subframe<<1)+1]+
|
||||
((ue->ulsch[0]->cooperation_flag==2)?10:0)+
|
||||
ant*6) % 12;
|
||||
if (ue!=NULL) {
|
||||
cyclic_shift0 = (fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2 +
|
||||
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]+
|
||||
((ue->ulsch[0]->cooperation_flag==2)?10:0)+
|
||||
ant*6) % 12;
|
||||
// printf("PUSCH.cyclicShift %d, n_DMRS2 %d, nPRS %d\n",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift,ue->ulsch[eNB_id]->n_DMRS2,ue->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]);
|
||||
cyclic_shift1 = (fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2 +
|
||||
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[(subframe<<1)+1]+
|
||||
((ue->ulsch[0]->cooperation_flag==2)?10:0)+
|
||||
ant*6) % 12;
|
||||
u0=fp->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1];
|
||||
u1=fp->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)];
|
||||
v0=fp->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1];
|
||||
v1=fp->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
|
||||
}
|
||||
|
||||
|
||||
// cyclic_shift0 = 0;
|
||||
// cyclic_shift1 = 0;
|
||||
Msc_RS = 12*nb_rb;
|
||||
@@ -92,9 +102,9 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
for (l = (3 - frame_parms->Ncp),u=u0,v=v0,cyclic_shift=cyclic_shift0;
|
||||
l<frame_parms->symbols_per_tti;
|
||||
l += (7 - frame_parms->Ncp),u=u1,v=v1,cyclic_shift=cyclic_shift1) {
|
||||
for (l = (3 - fp->Ncp),u=u0,v=v0,cyclic_shift=cyclic_shift0;
|
||||
l<fp->symbols_per_tti;
|
||||
l += (7 - fp->Ncp),u=u1,v=v1,cyclic_shift=cyclic_shift1) {
|
||||
|
||||
drs_offset = 0;
|
||||
#ifdef DEBUG_DRS
|
||||
@@ -102,17 +112,16 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
|
||||
#endif
|
||||
|
||||
|
||||
re_offset = frame_parms->first_carrier_offset;
|
||||
subframe_offset = subframe*frame_parms->symbols_per_tti*frame_parms->ofdm_symbol_size;
|
||||
symbol_offset = subframe_offset + frame_parms->ofdm_symbol_size*l;
|
||||
|
||||
re_offset = fp->first_carrier_offset;
|
||||
subframe_offset = subframe*fp->symbols_per_tti*fp->ofdm_symbol_size;
|
||||
symbol_offset = subframe_offset + fp->ofdm_symbol_size*l;
|
||||
|
||||
#ifdef DEBUG_DRS
|
||||
printf("generate_drs_pusch: symbol_offset %d, subframe offset %d, cyclic shift %d\n",symbol_offset,subframe_offset,cyclic_shift);
|
||||
#endif
|
||||
alpha_ind = 0;
|
||||
|
||||
for (rb=0; rb<frame_parms->N_RB_UL; rb++) {
|
||||
for (rb=0; rb<fp->N_RB_UL; rb++) {
|
||||
|
||||
if ((rb >= first_rb) && (rb<(first_rb+nb_rb))) {
|
||||
|
||||
@@ -124,12 +133,12 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
|
||||
ref_re = (int32_t) ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1];
|
||||
ref_im = (int32_t) ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1];
|
||||
|
||||
((int16_t*) txdataF)[2*(symbol_offset + re_offset)] = (int16_t) (((ref_re*alpha_re[alpha_ind]) -
|
||||
((int16_t*) txF)[2*(symbol_offset + re_offset)] = (int16_t) (((ref_re*alpha_re[alpha_ind]) -
|
||||
(ref_im*alpha_im[alpha_ind]))>>15);
|
||||
((int16_t*) txdataF)[2*(symbol_offset + re_offset)+1] = (int16_t) (((ref_re*alpha_im[alpha_ind]) +
|
||||
((int16_t*) txF)[2*(symbol_offset + re_offset)+1] = (int16_t) (((ref_re*alpha_im[alpha_ind]) +
|
||||
(ref_im*alpha_re[alpha_ind]))>>15);
|
||||
((short*) txdataF)[2*(symbol_offset + re_offset)] = (short) ((((short*) txdataF)[2*(symbol_offset + re_offset)]*(int32_t)amp)>>15);
|
||||
((short*) txdataF)[2*(symbol_offset + re_offset)+1] = (short) ((((short*) txdataF)[2*(symbol_offset + re_offset)+1]*(int32_t)amp)>>15);
|
||||
((short*) txF)[2*(symbol_offset + re_offset)] = (short) ((((short*) txF)[2*(symbol_offset + re_offset)]*(int32_t)amp)>>15);
|
||||
((short*) txF)[2*(symbol_offset + re_offset)+1] = (short) ((((short*) txF)[2*(symbol_offset + re_offset)+1]*(int32_t)amp)>>15);
|
||||
|
||||
|
||||
alpha_ind = (alpha_ind + cyclic_shift);
|
||||
@@ -142,14 +151,14 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
|
||||
symbol_offset,
|
||||
alpha_ind,
|
||||
re_offset,
|
||||
((short*) txdataF)[2*(symbol_offset + re_offset)],
|
||||
((short*) txdataF)[2*(symbol_offset + re_offset)+1]);
|
||||
((short*) txF)[2*(symbol_offset + re_offset)],
|
||||
((short*) txF)[2*(symbol_offset + re_offset)+1]);
|
||||
|
||||
#endif // DEBUG_DRS
|
||||
re_offset++;
|
||||
drs_offset++;
|
||||
|
||||
if (re_offset >= frame_parms->ofdm_symbol_size)
|
||||
if (re_offset >= fp->ofdm_symbol_size)
|
||||
re_offset = 0;
|
||||
}
|
||||
|
||||
@@ -158,8 +167,8 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
|
||||
|
||||
// check if we crossed the symbol boundary and skip DC
|
||||
|
||||
if (re_offset >= frame_parms->ofdm_symbol_size) {
|
||||
if (frame_parms->N_RB_DL&1) // odd number of RBs
|
||||
if (re_offset >= fp->ofdm_symbol_size) {
|
||||
if (fp->N_RB_DL&1) // odd number of RBs
|
||||
re_offset=6;
|
||||
else // even number of RBs (doesn't straddle DC)
|
||||
re_offset=0;
|
||||
@@ -172,4 +181,3 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,26 +120,54 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
|
||||
pbch_decoded = 0;
|
||||
|
||||
for (frame_mod4=0; frame_mod4<4; frame_mod4++) {
|
||||
pbch_tx_ant = rx_pbch(&ue->common_vars,
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (ue->FeMBMS_active != 2){
|
||||
#endif
|
||||
pbch_tx_ant = rx_pbch(&ue->common_vars,
|
||||
ue->pbch_vars[0],
|
||||
frame_parms,
|
||||
0,
|
||||
SISO,
|
||||
ue->high_speed_flag,
|
||||
frame_mod4);
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
}else{
|
||||
pbch_tx_ant = rx_pbch_fembms(&ue->common_vars,
|
||||
ue->pbch_vars[0],
|
||||
frame_parms,
|
||||
0,
|
||||
SISO,
|
||||
ue->high_speed_flag,
|
||||
frame_mod4);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((pbch_tx_ant>0) && (pbch_tx_ant<=2)) {
|
||||
pbch_decoded = 1;
|
||||
break;
|
||||
if ((pbch_tx_ant>0) && (pbch_tx_ant<=2)) {
|
||||
pbch_decoded = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
pbch_tx_ant = rx_pbch(&ue->common_vars,
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (ue->FeMBMS_active != 2){
|
||||
#endif
|
||||
pbch_tx_ant = rx_pbch(&ue->common_vars,
|
||||
ue->pbch_vars[0],
|
||||
frame_parms,
|
||||
0,
|
||||
ALAMOUTI,
|
||||
ue->high_speed_flag,
|
||||
frame_mod4);
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
}else{
|
||||
pbch_tx_ant = rx_pbch_fembms(&ue->common_vars,
|
||||
ue->pbch_vars[0],
|
||||
frame_parms,
|
||||
0,
|
||||
ALAMOUTI,
|
||||
ue->high_speed_flag,
|
||||
frame_mod4);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((pbch_tx_ant>0) && (pbch_tx_ant<=2)) {
|
||||
pbch_decoded = 1;
|
||||
@@ -189,6 +217,9 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
|
||||
break;
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if(ue->FeMBMS_active != 2) {
|
||||
#endif
|
||||
// now check for PHICH parameters
|
||||
frame_parms->phich_config_common.phich_duration = (PHICH_DURATION_t)((ue->pbch_vars[0]->decoded_output[2]>>4)&1);
|
||||
dummy = (ue->pbch_vars[0]->decoded_output[2]>>2)&3;
|
||||
@@ -235,6 +266,26 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
|
||||
frame_parms->N_RB_DL,
|
||||
frame_parms->phich_config_common.phich_duration,
|
||||
phich_resource); //frame_parms->phich_config_common.phich_resource);
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
}else{
|
||||
for(int i=0; i<RX_NB_TH;i++)
|
||||
{
|
||||
ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&31)<<1) + (ue->pbch_vars[0]->decoded_output[1]>>7))<<4;
|
||||
ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx;
|
||||
}
|
||||
LOG_D(PHY,"[UE%d] Initial sync: FeMBMS pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, AdditionalNonMBSFN_SF %d, frame_mod4 %d\n",
|
||||
ue->Mod_id,
|
||||
frame_parms->nb_antenna_ports_eNB,
|
||||
pbch_tx_ant,
|
||||
ue->proc.proc_rxtx[0].frame_rx,
|
||||
frame_parms->N_RB_DL,
|
||||
0,
|
||||
frame_mod4
|
||||
);
|
||||
|
||||
}
|
||||
#endif
|
||||
return(0);
|
||||
} else {
|
||||
return(-1);
|
||||
@@ -259,6 +310,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
|
||||
frame_parms->frame_type=FDD;
|
||||
frame_parms->nb_antenna_ports_eNB = 2;
|
||||
init_frame_parms(frame_parms,1);
|
||||
|
||||
/*
|
||||
LOG_M("rxdata0.m","rxd0",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
|
||||
|
||||
@@ -301,8 +353,21 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
|
||||
// LOG_M("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
|
||||
|
||||
LOG_D(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
|
||||
|
||||
frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret);
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (ret==-1){
|
||||
ue->FeMBMS_active = 2;
|
||||
ret = pbch_detection(ue,mode);
|
||||
if (ret==-1){
|
||||
ue->FeMBMS_active = 0;
|
||||
frame_parms->FeMBMS_active = 0;
|
||||
}
|
||||
else frame_parms->FeMBMS_active = 1;
|
||||
LOG_D(PHY,"FeMBMS Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
|
||||
frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
LOG_D(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
|
||||
}
|
||||
@@ -342,6 +407,23 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
|
||||
// LOG_M("rxdata3.m","rxd3",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
|
||||
LOG_D(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
|
||||
frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret);
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (ret==-1){
|
||||
ue->FeMBMS_active = 2;
|
||||
ret = pbch_detection(ue,mode);
|
||||
if (ret==-1){
|
||||
ue->FeMBMS_active = 0;
|
||||
frame_parms->FeMBMS_active = 0;
|
||||
}
|
||||
else frame_parms->FeMBMS_active = 1;
|
||||
LOG_I(PHY,"FeMBMS CAS Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
|
||||
frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
} else {
|
||||
LOG_D(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
|
||||
}
|
||||
@@ -444,6 +526,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
|
||||
generate_pcfich_reg_mapping(frame_parms);
|
||||
generate_phich_reg_mapping(frame_parms);
|
||||
ue->pbch_vars[0]->pdu_errors_conseq=0;
|
||||
|
||||
}
|
||||
|
||||
LOG_I(PHY, "[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id,
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/CODING/coding_defs.h"
|
||||
#include "PHY/CODING/coding_extern.h"
|
||||
@@ -630,3 +632,201 @@ uint16_t rx_pbch(LTE_UE_COMMON *lte_ue_common_vars,
|
||||
|
||||
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void pbch_unscrambling_fembms(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int8_t* llr,
|
||||
uint32_t length,
|
||||
uint8_t frame_mod4)
|
||||
{
|
||||
int i;
|
||||
uint8_t reset;
|
||||
uint32_t x1, x2, s=0;
|
||||
|
||||
reset = 1;
|
||||
// x1 is set in first call to lte_gold_generic
|
||||
x2 = frame_parms->Nid_cell+(1<<9); //this is c_init for FeMBMS in 36.211 Sec 6.6.1
|
||||
|
||||
//msg("pbch_unscrambling: Nid_cell = %d, x2 = %d, frame_mod4 %d length %d\n",frame_parms->Nid_cell,x2,frame_mod4,length);
|
||||
for (i=0; i<length; i++) {
|
||||
if (i%32==0) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
// printf("lte_gold[%d]=%x\n",i,s);
|
||||
reset = 0;
|
||||
}
|
||||
// take the quarter of the PBCH that corresponds to this frame
|
||||
if ((i>=(frame_mod4*(length>>2))) && (i<((1+frame_mod4)*(length>>2)))) {
|
||||
|
||||
if (((s>>(i%32))&1)==0)
|
||||
llr[i] = -llr[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t rx_pbch_fembms(LTE_UE_COMMON *lte_ue_common_vars,
|
||||
LTE_UE_PBCH *lte_ue_pbch_vars,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t eNB_id,
|
||||
MIMO_mode_t mimo_mode,
|
||||
uint32_t high_speed_flag,
|
||||
uint8_t frame_mod4)
|
||||
{
|
||||
|
||||
uint8_t log2_maxh;//,aatx,aarx;
|
||||
int max_h=0;
|
||||
|
||||
int symbol,i;
|
||||
uint32_t nsymb = (frame_parms->Ncp==0) ? 14:12;
|
||||
uint16_t pbch_E;
|
||||
uint8_t pbch_a[8];
|
||||
uint8_t RCC;
|
||||
|
||||
int8_t *pbch_e_rx;
|
||||
uint8_t *decoded_output = lte_ue_pbch_vars->decoded_output;
|
||||
uint16_t crc;
|
||||
|
||||
|
||||
// pbch_D = 16+PBCH_A;
|
||||
|
||||
pbch_E = (frame_parms->Ncp==0) ? 1920 : 1728; //RE/RB * #RB * bits/RB (QPSK)
|
||||
pbch_e_rx = <e_ue_pbch_vars->llr[frame_mod4*(pbch_E>>2)];
|
||||
#ifdef DEBUG_PBCH
|
||||
LOG_D(PHY,"[PBCH] starting symbol loop (Ncp %d, frame_mod4 %d,mimo_mode %d\n",frame_parms->Ncp,frame_mod4,mimo_mode);
|
||||
#endif
|
||||
|
||||
// clear LLR buffer
|
||||
memset(lte_ue_pbch_vars->llr,0,pbch_E);
|
||||
|
||||
for (symbol=(nsymb>>1); symbol<(nsymb>>1)+4; symbol++) {
|
||||
|
||||
#ifdef DEBUG_PBCH
|
||||
LOG_D(PHY,"[PBCH] starting extract\n");
|
||||
#endif
|
||||
pbch_extract(lte_ue_common_vars->common_vars_rx_data_per_thread[0].rxdataF,
|
||||
lte_ue_common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates[eNB_id],
|
||||
lte_ue_pbch_vars->rxdataF_ext,
|
||||
lte_ue_pbch_vars->dl_ch_estimates_ext,
|
||||
symbol,
|
||||
high_speed_flag,
|
||||
frame_parms);
|
||||
#ifdef DEBUG_PBCH
|
||||
LOG_D(PHY,"[PHY] PBCH Symbol %d\n",symbol);
|
||||
LOG_D(PHY,"[PHY] PBCH starting channel_level\n");
|
||||
#endif
|
||||
|
||||
max_h = pbch_channel_level(lte_ue_pbch_vars->dl_ch_estimates_ext,
|
||||
frame_parms,
|
||||
symbol);
|
||||
log2_maxh = 3+(log2_approx(max_h)/2);
|
||||
|
||||
#ifdef DEBUG_PBCH
|
||||
|
||||
LOG_D(PHY,"[PHY] PBCH log2_maxh = %d (%d)\n",log2_maxh,max_h);
|
||||
#endif
|
||||
|
||||
pbch_channel_compensation(lte_ue_pbch_vars->rxdataF_ext,
|
||||
lte_ue_pbch_vars->dl_ch_estimates_ext,
|
||||
lte_ue_pbch_vars->rxdataF_comp,
|
||||
frame_parms,
|
||||
symbol,
|
||||
log2_maxh); // log2_maxh+I0_shift
|
||||
|
||||
if (frame_parms->nb_antennas_rx > 1)
|
||||
pbch_detection_mrc(frame_parms,
|
||||
lte_ue_pbch_vars->rxdataF_comp,
|
||||
symbol);
|
||||
|
||||
|
||||
if (mimo_mode == ALAMOUTI) {
|
||||
pbch_alamouti(frame_parms,lte_ue_pbch_vars->rxdataF_comp,symbol);
|
||||
} else if (mimo_mode != SISO) {
|
||||
LOG_D(PHY,"[PBCH][RX] Unsupported MIMO mode\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (symbol>(nsymb>>1)+1) {
|
||||
pbch_quantize(pbch_e_rx,
|
||||
(short*)&(lte_ue_pbch_vars->rxdataF_comp[0][(symbol%(nsymb>>1))*72]),
|
||||
144);
|
||||
|
||||
pbch_e_rx+=144;
|
||||
} else {
|
||||
pbch_quantize(pbch_e_rx,
|
||||
(short*)&(lte_ue_pbch_vars->rxdataF_comp[0][(symbol%(nsymb>>1))*72]),
|
||||
96);
|
||||
|
||||
pbch_e_rx+=96;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
pbch_e_rx = lte_ue_pbch_vars->llr;
|
||||
|
||||
|
||||
|
||||
//un-scrambling
|
||||
#ifdef DEBUG_PBCH
|
||||
LOG_D(PHY,"[PBCH] doing unscrambling\n");
|
||||
#endif
|
||||
|
||||
pbch_unscrambling_fembms(frame_parms,
|
||||
pbch_e_rx,
|
||||
pbch_E,
|
||||
frame_mod4);
|
||||
|
||||
|
||||
//un-rate matching
|
||||
#ifdef DEBUG_PBCH
|
||||
LOG_D(PHY,"[PBCH] doing un-rate-matching\n");
|
||||
#endif
|
||||
|
||||
|
||||
memset(dummy_w_rx,0,3*3*(16+PBCH_A));
|
||||
RCC = generate_dummy_w_cc(16+PBCH_A,
|
||||
dummy_w_rx);
|
||||
|
||||
|
||||
lte_rate_matching_cc_rx(RCC,pbch_E,pbch_w_rx,dummy_w_rx,pbch_e_rx);
|
||||
|
||||
sub_block_deinterleaving_cc((unsigned int)(PBCH_A+16),
|
||||
&pbch_d_rx[96],
|
||||
&pbch_w_rx[0]);
|
||||
|
||||
memset(pbch_a,0,((16+PBCH_A)>>3));
|
||||
|
||||
|
||||
|
||||
|
||||
phy_viterbi_lte_sse2(pbch_d_rx+96,pbch_a,16+PBCH_A);
|
||||
|
||||
// Fix byte endian of PBCH (bit 23 goes in first)
|
||||
for (i=0; i<(PBCH_A>>3); i++)
|
||||
decoded_output[(PBCH_A>>3)-i-1] = pbch_a[i];
|
||||
|
||||
#ifdef DEBUG_PBCH
|
||||
|
||||
for (i=0; i<(PBCH_A>>3); i++)
|
||||
LOG_I(PHY,"[PBCH] pbch_a[%d] = %x\n",i,decoded_output[i]);
|
||||
|
||||
#endif //DEBUG_PBCH
|
||||
|
||||
#ifdef DEBUG_PBCH
|
||||
LOG_I(PHY,"PBCH CRC %x : %x\n",
|
||||
crc16(pbch_a,PBCH_A),
|
||||
((uint16_t)pbch_a[PBCH_A>>3]<<8)+pbch_a[(PBCH_A>>3)+1]);
|
||||
#endif
|
||||
|
||||
crc = (crc16(pbch_a,PBCH_A)>>16) ^
|
||||
(((uint16_t)pbch_a[PBCH_A>>3]<<8)+pbch_a[(PBCH_A>>3)+1]);
|
||||
|
||||
if (crc == 0x0000)
|
||||
return(1);
|
||||
else if (crc == 0xffff)
|
||||
return(2);
|
||||
else if (crc == 0x5555)
|
||||
return(4);
|
||||
else
|
||||
return(-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -19,6 +19,18 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_UE_TRANSPORT/pmch_ue.c
|
||||
* \brief This includes routines for decoding the UE FeMBMS/PMCH physical/multicast/transport channel 3GPP TS 36.211 version 14.2.0 Release 14 Sections 6.5/6.10.2
|
||||
* \author J. Morgade
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
* \company Vicomtech
|
||||
* \email: javier.morgade@ieee.org
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/phy_extern_ue.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
@@ -132,6 +144,39 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *ue,int mcs,int ndi,int rvidx,int eNB_id)
|
||||
}
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void mch_extract_rbs_khz_1dot25(int **rxdataF,
|
||||
int **dl_ch_estimates,
|
||||
int **rxdataF_ext,
|
||||
int **dl_ch_estimates_ext,
|
||||
/*unsigned char symbol,*/
|
||||
unsigned char subframe,
|
||||
LTE_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
|
||||
int i,j,offset,aarx,numext;
|
||||
|
||||
if( (subframe&0x1) == 0){
|
||||
offset=0;
|
||||
}else{
|
||||
offset=3;
|
||||
}
|
||||
numext=0;
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
for (i=0,j=0; i<frame_parms->N_RB_DL*72; i++) {
|
||||
if( ((i-offset)%6) != 0 ){
|
||||
//rxdataF_ext[aarx][j+0] = rxdataF[aarx][i+4344 +0];
|
||||
rxdataF_ext[aarx][j+0] = rxdataF[aarx][i+frame_parms->first_carrier_offset_khz_1dot25 +0];
|
||||
rxdataF_ext[aarx][(frame_parms->N_RB_DL*60)+j+0] = rxdataF[aarx][i+1+0]; //DC
|
||||
dl_ch_estimates_ext[aarx][j+0] = dl_ch_estimates[aarx][i+0];
|
||||
dl_ch_estimates_ext[aarx][(frame_parms->N_RB_DL*60)+j+0] = dl_ch_estimates[aarx][i+(frame_parms->N_RB_DL*72)+0];
|
||||
numext+=2;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void mch_extract_rbs(int **rxdataF,
|
||||
@@ -145,7 +190,6 @@ void mch_extract_rbs(int **rxdataF,
|
||||
|
||||
int pilots=0,i,j,offset,aarx;
|
||||
|
||||
// printf("Extracting PMCH: symbol %d\n",symbol);
|
||||
if ((symbol==2)||
|
||||
(symbol==10)) {
|
||||
pilots = 1;
|
||||
@@ -240,6 +284,62 @@ void mch_channel_level(int **dl_ch_estimates_ext,
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void mch_channel_level_khz_1dot25(int **dl_ch_estimates_ext,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int *avg,
|
||||
/*uint8_t symbol,*/
|
||||
unsigned short nb_rb)
|
||||
{
|
||||
|
||||
int i,aarx,nre;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *dl_ch128,avg128;
|
||||
#elif defined(__arm__)
|
||||
int32x4_t avg128;
|
||||
#endif
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
//clear average level
|
||||
avg128 = _mm_setzero_si128();
|
||||
// 5 is always a symbol with no pilots for both normal and extended prefix
|
||||
|
||||
dl_ch128=(__m128i *)&dl_ch_estimates_ext[aarx][0/*symbol*frame_parms->N_RB_DL*12*/];
|
||||
#elif defined(__arm__)
|
||||
|
||||
|
||||
#endif
|
||||
/*if ((symbol == 2) || (symbol == 6) || (symbol == 10))
|
||||
nre = (frame_parms->N_RB_DL*6);
|
||||
else
|
||||
nre = (frame_parms->N_RB_DL*12);*/
|
||||
nre = frame_parms->N_RB_DL*12*10;
|
||||
//nre = frame_parms->N_RB_DL*12;
|
||||
|
||||
for (i=0; i<(nre>>2); i++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
avg128 = _mm_add_epi32(avg128,_mm_madd_epi16(dl_ch128[0],dl_ch128[0]));
|
||||
#elif defined(__arm__)
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
avg[aarx] = (((int*)&avg128)[0] +
|
||||
((int*)&avg128)[1] +
|
||||
((int*)&avg128)[2] +
|
||||
((int*)&avg128)[3])/nre;
|
||||
|
||||
//printf("Channel level : %d\n",avg[(aatx<<1)+aarx]);
|
||||
}
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void mch_channel_compensation(int **rxdataF_ext,
|
||||
int **dl_ch_estimates_ext,
|
||||
int **dl_ch_mag,
|
||||
@@ -389,6 +489,164 @@ void mch_channel_compensation(int **rxdataF_ext,
|
||||
|
||||
}
|
||||
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void mch_channel_compensation_khz_1dot25(int **rxdataF_ext,
|
||||
int **dl_ch_estimates_ext,
|
||||
int **dl_ch_mag,
|
||||
int **dl_ch_magb,
|
||||
int **rxdataF_comp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
/*unsigned char symbol,*/
|
||||
unsigned char mod_order,
|
||||
unsigned char output_shift)
|
||||
{
|
||||
|
||||
int aarx,nre,i;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128;
|
||||
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b;
|
||||
#elif defined(__arm__)
|
||||
|
||||
#endif
|
||||
/*if ((symbol == 2) || (symbol == 6) || (symbol == 10))
|
||||
nre = frame_parms->N_RB_DL*6;
|
||||
else
|
||||
nre = frame_parms->N_RB_DL*12;*/
|
||||
|
||||
nre = frame_parms->N_RB_DL*12*10;
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
if (mod_order == 4) {
|
||||
QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
|
||||
QAM_amp128b = _mm_setzero_si128();
|
||||
} else if (mod_order == 6) {
|
||||
QAM_amp128 = _mm_set1_epi16(QAM64_n1); //
|
||||
QAM_amp128b = _mm_set1_epi16(QAM64_n2);
|
||||
}
|
||||
#elif defined(__arm__)
|
||||
|
||||
#endif
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
|
||||
dl_ch128 = (__m128i *)&dl_ch_estimates_ext[aarx][0];
|
||||
dl_ch_mag128 = (__m128i *)&dl_ch_mag[aarx][0];
|
||||
dl_ch_mag128b = (__m128i *)&dl_ch_magb[aarx][0];
|
||||
rxdataF128 = (__m128i *)&rxdataF_ext[aarx][0];
|
||||
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aarx][0];
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
#endif
|
||||
|
||||
for (i=0; i<(nre>>2); i+=2) {
|
||||
if (mod_order>2) {
|
||||
// get channel amplitude if not QPSK
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
|
||||
mmtmpD0 = _mm_madd_epi16(dl_ch128[0],dl_ch128[0]);
|
||||
mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
|
||||
|
||||
mmtmpD1 = _mm_madd_epi16(dl_ch128[1],dl_ch128[1]);
|
||||
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
|
||||
|
||||
mmtmpD0 = _mm_packs_epi32(mmtmpD0,mmtmpD1);
|
||||
|
||||
// store channel magnitude here in a new field of dlsch
|
||||
|
||||
dl_ch_mag128[0] = _mm_unpacklo_epi16(mmtmpD0,mmtmpD0);
|
||||
dl_ch_mag128b[0] = dl_ch_mag128[0];
|
||||
dl_ch_mag128[0] = _mm_mulhi_epi16(dl_ch_mag128[0],QAM_amp128);
|
||||
|
||||
dl_ch_mag128[0] = _mm_slli_epi16(dl_ch_mag128[0],1);
|
||||
|
||||
dl_ch_mag128[1] = _mm_unpackhi_epi16(mmtmpD0,mmtmpD0);
|
||||
dl_ch_mag128b[1] = dl_ch_mag128[1];
|
||||
dl_ch_mag128[1] = _mm_mulhi_epi16(dl_ch_mag128[1],QAM_amp128);
|
||||
dl_ch_mag128[1] = _mm_slli_epi16(dl_ch_mag128[1],1);
|
||||
|
||||
|
||||
dl_ch_mag128b[0] = _mm_mulhi_epi16(dl_ch_mag128b[0],QAM_amp128b);
|
||||
dl_ch_mag128b[0] = _mm_slli_epi16(dl_ch_mag128b[0],1);
|
||||
|
||||
|
||||
dl_ch_mag128b[1] = _mm_mulhi_epi16(dl_ch_mag128b[1],QAM_amp128b);
|
||||
dl_ch_mag128b[1] = _mm_slli_epi16(dl_ch_mag128b[1],1);
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = _mm_madd_epi16(dl_ch128[0],rxdataF128[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = _mm_shufflelo_epi16(dl_ch128[0],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_sign_epi16(mmtmpD1,*(__m128i*)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = _mm_madd_epi16(mmtmpD1,rxdataF128[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rxdataF_comp128[0] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128);
|
||||
// print_shorts("ch:",dl_ch128);
|
||||
// print_shorts("pack:",rxdataF_comp128);
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = _mm_madd_epi16(dl_ch128[1],rxdataF128[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = _mm_shufflelo_epi16(dl_ch128[1],_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = _mm_sign_epi16(mmtmpD1,*(__m128i*)conjugate);
|
||||
mmtmpD1 = _mm_madd_epi16(mmtmpD1,rxdataF128[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
|
||||
rxdataF_comp128[1] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+1);
|
||||
// print_shorts("ch:",dl_ch128+1);
|
||||
// print_shorts("pack:",rxdataF_comp128+1);
|
||||
|
||||
dl_ch128+=2;
|
||||
dl_ch_mag128+=2;
|
||||
dl_ch_mag128b+=2;
|
||||
rxdataF128+=2;
|
||||
rxdataF_comp128+=2;
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void mch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **rxdataF_comp,
|
||||
int **dl_ch_mag,
|
||||
@@ -442,6 +700,65 @@ void mch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void mch_detection_mrc_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **rxdataF_comp,
|
||||
int **dl_ch_mag,
|
||||
int **dl_ch_magb/*,
|
||||
unsigned char symbol*/)
|
||||
{
|
||||
|
||||
|
||||
int i;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0,*dl_ch_mag128_1,*dl_ch_mag128_0b,*dl_ch_mag128_1b;
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0,*dl_ch_mag128_1,*dl_ch_mag128_0b,*dl_ch_mag128_1b;
|
||||
#endif
|
||||
if (frame_parms->nb_antennas_rx>1) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
|
||||
rxdataF_comp128_0 = (__m128i *)&rxdataF_comp[0][0];
|
||||
rxdataF_comp128_1 = (__m128i *)&rxdataF_comp[1][0];
|
||||
dl_ch_mag128_0 = (__m128i *)&dl_ch_mag[0][0];
|
||||
dl_ch_mag128_1 = (__m128i *)&dl_ch_mag[1][0];
|
||||
dl_ch_mag128_0b = (__m128i *)&dl_ch_magb[0][0];
|
||||
dl_ch_mag128_1b = (__m128i *)&dl_ch_magb[1][0];
|
||||
|
||||
#elif defined(__arm__)
|
||||
rxdataF_comp128_0 = (int16x8_t *)&rxdataF_comp[0][0];
|
||||
rxdataF_comp128_1 = (int16x8_t *)&rxdataF_comp[1][0];
|
||||
dl_ch_mag128_0 = (int16x8_t *)&dl_ch_mag[0][0];
|
||||
dl_ch_mag128_1 = (int16x8_t *)&dl_ch_mag[1][0];
|
||||
dl_ch_mag128_0b = (int16x8_t *)&dl_ch_magb[0][0];
|
||||
dl_ch_mag128_1b = (int16x8_t *)&dl_ch_magb[1][0];
|
||||
|
||||
#endif
|
||||
// MRC on each re of rb, both on MF output and magnitude (for 16QAM/64QAM llr computation)
|
||||
for (i=0; i<frame_parms->N_RB_DL*30; i++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
rxdataF_comp128_0[i] = _mm_adds_epi16(_mm_srai_epi16(rxdataF_comp128_0[i],1),_mm_srai_epi16(rxdataF_comp128_1[i],1));
|
||||
dl_ch_mag128_0[i] = _mm_adds_epi16(_mm_srai_epi16(dl_ch_mag128_0[i],1),_mm_srai_epi16(dl_ch_mag128_1[i],1));
|
||||
dl_ch_mag128_0b[i] = _mm_adds_epi16(_mm_srai_epi16(dl_ch_mag128_0b[i],1),_mm_srai_epi16(dl_ch_mag128_1b[i],1));
|
||||
#elif defined(__arm__)
|
||||
rxdataF_comp128_0[i] = vhaddq_s16(rxdataF_comp128_0[i],rxdataF_comp128_1[i]);
|
||||
dl_ch_mag128_0[i] = vhaddq_s16(dl_ch_mag128_0[i],dl_ch_mag128_1[i]);
|
||||
dl_ch_mag128_0b[i] = vhaddq_s16(dl_ch_mag128_0b[i],dl_ch_mag128_1b[i]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int mch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **rxdataF_comp,
|
||||
short *dlsch_llr,
|
||||
@@ -468,7 +785,6 @@ int mch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
len = frame_parms->N_RB_DL*12;
|
||||
}
|
||||
|
||||
// printf("dlsch_qpsk_llr: symbol %d,len %d,pbch_pss_sss_adjust %d\n",symbol,len,pbch_pss_sss_adjust);
|
||||
for (i=0; i<len; i++) {
|
||||
*llr32 = *rxF;
|
||||
rxF++;
|
||||
@@ -485,6 +801,48 @@ int mch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
return(0);
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int mch_qpsk_llr_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **rxdataF_comp,
|
||||
short *dlsch_llr,
|
||||
/*unsigned char symbol,*/
|
||||
short **llr32p)
|
||||
{
|
||||
|
||||
uint32_t *rxF = (uint32_t*)&rxdataF_comp[0][0/*(symbol*frame_parms->N_RB_DL*12)*/];
|
||||
//uint32_t *rxF = (uint32_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
uint32_t *llr32;
|
||||
int i,len;
|
||||
|
||||
//if (symbol==0) {
|
||||
llr32 = (uint32_t*)dlsch_llr;
|
||||
//} else {
|
||||
//llr32 = (uint32_t*)(*llr32p);
|
||||
//}
|
||||
|
||||
//AssertFatal(llr32!=NULL,"dlsch_qpsk_llr: llr is null, symbol %d, llr32=%p\n",symbol, llr32);
|
||||
AssertFatal(llr32!=NULL,"dlsch_qpsk_llr: llr is null, llr32=%p\n",llr32);
|
||||
|
||||
len = frame_parms->N_RB_DL*12*10;
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
*llr32 = *rxF;
|
||||
rxF++;
|
||||
llr32++;
|
||||
}
|
||||
|
||||
*llr32p = (short *)llr32;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// 16-QAM
|
||||
//----------------------------------------------------------------------------------------------
|
||||
@@ -599,6 +957,114 @@ void mch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void mch_16qam_llr_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **rxdataF_comp,
|
||||
short *dlsch_llr,
|
||||
int **dl_ch_mag,
|
||||
/*unsigned char symbol,*/
|
||||
int16_t **llr32p)
|
||||
{
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *rxF = (__m128i*)&rxdataF_comp[0][0];
|
||||
__m128i *ch_mag;
|
||||
__m128i llr128[2],xmm0;
|
||||
uint32_t *llr32;
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][0];
|
||||
int16x8_t *ch_mag;
|
||||
int16x8_t llr128[2],xmm0;
|
||||
int16_t *llr16;
|
||||
#endif
|
||||
int i,len;
|
||||
unsigned char len_mod4=0;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
//if (symbol==2) {
|
||||
llr32 = (uint32_t*)dlsch_llr;
|
||||
//} else {
|
||||
//llr32 = (uint32_t*)*llr32p;
|
||||
//}
|
||||
#elif defined(__arm__)
|
||||
//if (symbol==2) {
|
||||
llr16 = (int16_t*)dlsch_llr;
|
||||
//} else {
|
||||
// llr16 = (int16_t*)*llr32p;
|
||||
//}
|
||||
#endif
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
ch_mag = (__m128i*)&dl_ch_mag[0][0];
|
||||
#elif defined(__arm__)
|
||||
ch_mag = (int16x8_t*)&dl_ch_mag[0][0];
|
||||
#endif
|
||||
len = frame_parms->N_RB_DL*12*10;
|
||||
|
||||
|
||||
|
||||
// update output pointer according to number of REs in this symbol (<<2 because 4 bits per RE)
|
||||
//if (symbol==2)
|
||||
*llr32p = dlsch_llr + (len<<2);
|
||||
//else
|
||||
//*llr32p += (len<<2);
|
||||
|
||||
len_mod4 = len&3;
|
||||
len>>=2; // length in quad words (4 REs)
|
||||
len+=(len_mod4==0 ? 0 : 1);
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
xmm0 = _mm_abs_epi16(rxF[i]);
|
||||
xmm0 = _mm_subs_epi16(ch_mag[i],xmm0);
|
||||
|
||||
// lambda_1=y_R, lambda_2=|y_R|-|h|^2, lamda_3=y_I, lambda_4=|y_I|-|h|^2
|
||||
llr128[0] = _mm_unpacklo_epi32(rxF[i],xmm0);
|
||||
llr128[1] = _mm_unpackhi_epi32(rxF[i],xmm0);
|
||||
llr32[0] = ((uint32_t *)&llr128[0])[0];
|
||||
llr32[1] = ((uint32_t *)&llr128[0])[1];
|
||||
llr32[2] = ((uint32_t *)&llr128[0])[2];
|
||||
llr32[3] = ((uint32_t *)&llr128[0])[3];
|
||||
llr32[4] = ((uint32_t *)&llr128[1])[0];
|
||||
llr32[5] = ((uint32_t *)&llr128[1])[1];
|
||||
llr32[6] = ((uint32_t *)&llr128[1])[2];
|
||||
llr32[7] = ((uint32_t *)&llr128[1])[3];
|
||||
llr32+=8;
|
||||
|
||||
#elif defined(__arm__)
|
||||
xmm0 = vabsq_s16(rxF[i]);
|
||||
xmm0 = vsubq_s16(ch_mag[i],xmm0);
|
||||
|
||||
// lambda_1=y_R, lambda_2=|y_R|-|h|^2, lamda_3=y_I, lambda_4=|y_I|-|h|^2
|
||||
|
||||
llr16[0] = vgetq_lane_s16(rxF[i],0);
|
||||
llr16[1] = vgetq_lane_s16(xmm0,0);
|
||||
llr16[2] = vgetq_lane_s16(rxF[i],1);
|
||||
llr16[3] = vgetq_lane_s16(xmm0,1);
|
||||
llr16[4] = vgetq_lane_s16(rxF[i],2);
|
||||
llr16[5] = vgetq_lane_s16(xmm0,2);
|
||||
llr16[6] = vgetq_lane_s16(rxF[i],2);
|
||||
llr16[7] = vgetq_lane_s16(xmm0,3);
|
||||
llr16[8] = vgetq_lane_s16(rxF[i],4);
|
||||
llr16[9] = vgetq_lane_s16(xmm0,4);
|
||||
llr16[10] = vgetq_lane_s16(rxF[i],5);
|
||||
llr16[11] = vgetq_lane_s16(xmm0,5);
|
||||
llr16[12] = vgetq_lane_s16(rxF[i],6);
|
||||
llr16[13] = vgetq_lane_s16(xmm0,6);
|
||||
llr16[14] = vgetq_lane_s16(rxF[i],7);
|
||||
llr16[15] = vgetq_lane_s16(xmm0,7);
|
||||
llr16+=16;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// 64-QAM
|
||||
//----------------------------------------------------------------------------------------------
|
||||
@@ -666,10 +1132,6 @@ void mch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
xmm2 = vsubq_s16(ch_magb[i],xmm2);
|
||||
#endif
|
||||
|
||||
/*
|
||||
printf("pmch i: %d => mag (%d,%d) (%d,%d)\n",i,((short *)&ch_mag[i])[0],((short *)&ch_magb[i])[0],
|
||||
((short *)&rxF[i])[0],((short *)&rxF[i])[1]);
|
||||
*/
|
||||
// loop over all LLRs in quad word (24 coded bits)
|
||||
/*
|
||||
for (j=0;j<8;j+=2) {
|
||||
@@ -749,6 +1211,149 @@ void mch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void mch_64qam_llr_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **rxdataF_comp,
|
||||
short *dlsch_llr,
|
||||
int **dl_ch_mag,
|
||||
int **dl_ch_magb,
|
||||
/*unsigned char symbol,*/
|
||||
short **llr_save)
|
||||
{
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i xmm1,xmm2,*ch_mag,*ch_magb;
|
||||
__m128i *rxF = (__m128i*)&rxdataF_comp[0][0];
|
||||
#elif defined(__arm__)
|
||||
int16x8_t xmm1,xmm2,*ch_mag,*ch_magb;
|
||||
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][0];
|
||||
#endif
|
||||
|
||||
int i,len,len2;
|
||||
// int j=0;
|
||||
unsigned char len_mod4;
|
||||
short *llr;
|
||||
int16_t *llr2;
|
||||
|
||||
//if (symbol==2)
|
||||
llr = dlsch_llr;
|
||||
//else
|
||||
//llr = *llr_save;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
ch_mag = (__m128i*)&dl_ch_mag[0][0];
|
||||
ch_magb = (__m128i*)&dl_ch_magb[0][0];
|
||||
#elif defined(__arm__)
|
||||
ch_mag = (int16x8_t*)&dl_ch_mag[0][0];
|
||||
ch_magb = (int16x8_t*)&dl_ch_magb[0][0];
|
||||
#endif
|
||||
|
||||
len = frame_parms->N_RB_DL*12*10;
|
||||
|
||||
|
||||
llr2 = llr;
|
||||
llr += (len*6);
|
||||
|
||||
len_mod4 =len&3;
|
||||
len2=len>>2; // length in quad words (4 REs)
|
||||
len2+=(len_mod4?0:1);
|
||||
|
||||
|
||||
for (i=0; i<len2; i++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
xmm1 = _mm_abs_epi16(rxF[i]);
|
||||
xmm1 = _mm_subs_epi16(ch_mag[i],xmm1);
|
||||
xmm2 = _mm_abs_epi16(xmm1);
|
||||
xmm2 = _mm_subs_epi16(ch_magb[i],xmm2);
|
||||
#elif defined(__arm__)
|
||||
xmm1 = vabsq_s16(rxF[i]);
|
||||
xmm1 = vsubq_s16(ch_mag[i],xmm1);
|
||||
xmm2 = vabsq_s16(xmm1);
|
||||
xmm2 = vsubq_s16(ch_magb[i],xmm2);
|
||||
#endif
|
||||
|
||||
// loop over all LLRs in quad word (24 coded bits)
|
||||
/*
|
||||
for (j=0;j<8;j+=2) {
|
||||
llr2[0] = ((short *)&rxF[i])[j];
|
||||
llr2[1] = ((short *)&rxF[i])[j+1];
|
||||
llr2[2] = _mm_extract_epi16(xmm1,j);
|
||||
llr2[3] = _mm_extract_epi16(xmm1,j+1);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = _mm_extract_epi16(xmm2,j);//((short *)&xmm2)[j];
|
||||
llr2[5] = _mm_extract_epi16(xmm2,j+1);//((short *)&xmm2)[j+1];
|
||||
|
||||
llr2+=6;
|
||||
}
|
||||
*/
|
||||
llr2[0] = ((short *)&rxF[i])[0];
|
||||
llr2[1] = ((short *)&rxF[i])[1];
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
llr2[2] = _mm_extract_epi16(xmm1,0);
|
||||
llr2[3] = _mm_extract_epi16(xmm1,1);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = _mm_extract_epi16(xmm2,0);//((short *)&xmm2)[j];
|
||||
llr2[5] = _mm_extract_epi16(xmm2,1);//((short *)&xmm2)[j+1];
|
||||
#elif defined(__arm__)
|
||||
llr2[2] = vgetq_lane_s16(xmm1,0);
|
||||
llr2[3] = vgetq_lane_s16(xmm1,1);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = vgetq_lane_s16(xmm2,0);//((short *)&xmm2)[j];
|
||||
llr2[5] = vgetq_lane_s16(xmm2,1);//((short *)&xmm2)[j+1];
|
||||
#endif
|
||||
|
||||
llr2+=6;
|
||||
llr2[0] = ((short *)&rxF[i])[2];
|
||||
llr2[1] = ((short *)&rxF[i])[3];
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
llr2[2] = _mm_extract_epi16(xmm1,2);
|
||||
llr2[3] = _mm_extract_epi16(xmm1,3);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = _mm_extract_epi16(xmm2,2);//((short *)&xmm2)[j];
|
||||
llr2[5] = _mm_extract_epi16(xmm2,3);//((short *)&xmm2)[j+1];
|
||||
#elif defined(__arm__)
|
||||
llr2[2] = vgetq_lane_s16(xmm1,2);
|
||||
llr2[3] = vgetq_lane_s16(xmm1,3);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = vgetq_lane_s16(xmm2,2);//((short *)&xmm2)[j];
|
||||
llr2[5] = vgetq_lane_s16(xmm2,3);//((short *)&xmm2)[j+1];
|
||||
#endif
|
||||
llr2+=6;
|
||||
llr2[0] = ((short *)&rxF[i])[4];
|
||||
llr2[1] = ((short *)&rxF[i])[5];
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
llr2[2] = _mm_extract_epi16(xmm1,4);
|
||||
llr2[3] = _mm_extract_epi16(xmm1,5);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = _mm_extract_epi16(xmm2,4);//((short *)&xmm2)[j];
|
||||
llr2[5] = _mm_extract_epi16(xmm2,5);//((short *)&xmm2)[j+1];
|
||||
#elif defined(__arm__)
|
||||
llr2[2] = vgetq_lane_s16(xmm1,4);
|
||||
llr2[3] = vgetq_lane_s16(xmm1,5);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = vgetq_lane_s16(xmm2,4);//((short *)&xmm2)[j];
|
||||
llr2[5] = vgetq_lane_s16(xmm2,5);//((short *)&xmm2)[j+1];
|
||||
#endif
|
||||
llr2+=6;
|
||||
llr2[0] = ((short *)&rxF[i])[6];
|
||||
llr2[1] = ((short *)&rxF[i])[7];
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
llr2[2] = _mm_extract_epi16(xmm1,6);
|
||||
llr2[3] = _mm_extract_epi16(xmm1,7);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = _mm_extract_epi16(xmm2,6);//((short *)&xmm2)[j];
|
||||
llr2[5] = _mm_extract_epi16(xmm2,7);//((short *)&xmm2)[j+1];
|
||||
#elif defined(__arm__)
|
||||
llr2[2] = vgetq_lane_s16(xmm1,6);
|
||||
llr2[3] = vgetq_lane_s16(xmm1,7);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = vgetq_lane_s16(xmm2,6);//((short *)&xmm2)[j];
|
||||
llr2[5] = vgetq_lane_s16(xmm2,7);//((short *)&xmm2)[j+1];
|
||||
#endif
|
||||
llr2+=6;
|
||||
}
|
||||
|
||||
*llr_save = llr;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int avg_pmch[4];
|
||||
int rx_pmch(PHY_VARS_UE *ue,
|
||||
unsigned char eNB_id,
|
||||
@@ -762,7 +1367,6 @@ int rx_pmch(PHY_VARS_UE *ue,
|
||||
LTE_UE_DLSCH_t **dlsch = &ue->dlsch_MCH[eNB_id];
|
||||
int avgs,aarx;
|
||||
|
||||
//printf("*********************mch: symbol %d\n",symbol);
|
||||
|
||||
mch_extract_rbs(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id],
|
||||
@@ -839,4 +1443,99 @@ int rx_pmch(PHY_VARS_UE *ue,
|
||||
|
||||
return(0);
|
||||
}
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int rx_pmch_khz_1dot25(PHY_VARS_UE *ue,
|
||||
unsigned char eNB_id,
|
||||
uint8_t subframe/*,
|
||||
unsigned char symbol*/
|
||||
,int mcs) // currently work around TOFIX
|
||||
{
|
||||
//unsigned int symbol;
|
||||
|
||||
LTE_UE_COMMON *common_vars = &ue->common_vars;
|
||||
LTE_UE_PDSCH **pdsch_vars = &ue->pdsch_vars_MCH[eNB_id];
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
//LTE_UE_DLSCH_t **dlsch = &ue->dlsch_MCH[eNB_id];
|
||||
int avgs,aarx;
|
||||
|
||||
|
||||
mch_extract_rbs_khz_1dot25(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF,
|
||||
common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id],
|
||||
pdsch_vars[eNB_id]->rxdataF_ext,
|
||||
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||
/*symbol,*/
|
||||
subframe,
|
||||
frame_parms);
|
||||
|
||||
mch_channel_level_khz_1dot25(pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||
frame_parms,
|
||||
avg_pmch,
|
||||
/*symbol,*/
|
||||
frame_parms->N_RB_DL);
|
||||
|
||||
avgs = 0;
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++){
|
||||
avgs = cmax(avgs,avg_pmch[aarx]);
|
||||
}
|
||||
|
||||
|
||||
if (get_Qm(mcs/*dlsch[0]->harq_processes[0]->mcs)==2*/)==2)
|
||||
pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2) ;// + 2
|
||||
else
|
||||
pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2); // + 5;// + 2*/
|
||||
|
||||
|
||||
|
||||
|
||||
mch_channel_compensation_khz_1dot25(pdsch_vars[eNB_id]->rxdataF_ext,
|
||||
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||
pdsch_vars[eNB_id]->dl_ch_mag0,
|
||||
pdsch_vars[eNB_id]->dl_ch_magb0,
|
||||
pdsch_vars[eNB_id]->rxdataF_comp0,
|
||||
frame_parms,
|
||||
/*symbol,*/
|
||||
get_Qm(mcs/*dlsch[0]->harq_processes[0]->mcs*/),
|
||||
pdsch_vars[eNB_id]->log2_maxh);
|
||||
|
||||
if (frame_parms->nb_antennas_rx > 1){
|
||||
mch_detection_mrc_khz_1dot25(frame_parms,
|
||||
pdsch_vars[eNB_id]->rxdataF_comp0,
|
||||
pdsch_vars[eNB_id]->dl_ch_mag0,
|
||||
pdsch_vars[eNB_id]->dl_ch_magb0/*,
|
||||
symbol*/);
|
||||
}
|
||||
|
||||
switch (get_Qm(mcs/*dlsch[0]->harq_processes[0]->mcs*/)) {
|
||||
case 2 :
|
||||
mch_qpsk_llr_khz_1dot25(frame_parms,
|
||||
pdsch_vars[eNB_id]->rxdataF_comp0,
|
||||
pdsch_vars[eNB_id]->llr[0],
|
||||
/*symbol,*/
|
||||
pdsch_vars[eNB_id]->llr128);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
mch_16qam_llr_khz_1dot25(frame_parms,
|
||||
pdsch_vars[eNB_id]->rxdataF_comp0,
|
||||
pdsch_vars[eNB_id]->llr[0],
|
||||
pdsch_vars[eNB_id]->dl_ch_mag0,
|
||||
/*symbol,*/
|
||||
pdsch_vars[eNB_id]->llr128);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
mch_64qam_llr_khz_1dot25(frame_parms,
|
||||
pdsch_vars[eNB_id]->rxdataF_comp0,
|
||||
pdsch_vars[eNB_id]->llr[0],
|
||||
pdsch_vars[eNB_id]->dl_ch_mag0,
|
||||
pdsch_vars[eNB_id]->dl_ch_magb0,
|
||||
/*symbol,*/
|
||||
pdsch_vars[eNB_id]->llr128);
|
||||
break;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -72,6 +72,12 @@ int rx_pmch(PHY_VARS_UE *phy_vars_ue,
|
||||
uint8_t subframe,
|
||||
unsigned char symbol);
|
||||
|
||||
int rx_pmch_khz_1dot25(PHY_VARS_UE *ue,
|
||||
unsigned char eNB_id,
|
||||
uint8_t subframe/*,
|
||||
unsigned char symbol*/
|
||||
,int mcs);
|
||||
|
||||
/** \brief Dump OCTAVE/MATLAB files for PMCH debugging
|
||||
@param phy_vars_ue Pointer to UE variables
|
||||
@param eNB_id index of eNB in ue variables
|
||||
@@ -1125,6 +1131,20 @@ uint16_t rx_pbch(LTE_UE_COMMON *lte_ue_common_vars,
|
||||
uint32_t high_speed_flag,
|
||||
uint8_t frame_mod4);
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
/*! \brief receiver for the PBCH FeMBMS
|
||||
\returns number of tx antennas or -1 if error
|
||||
*/
|
||||
uint16_t rx_pbch_fembms(LTE_UE_COMMON *lte_ue_common_vars,
|
||||
LTE_UE_PBCH *lte_ue_pbch_vars,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t eNB_id,
|
||||
MIMO_mode_t mimo_mode,
|
||||
uint32_t high_speed_flag,
|
||||
uint8_t frame_mod4);
|
||||
#endif
|
||||
|
||||
|
||||
uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
|
||||
uint8_t eNB_id,
|
||||
uint8_t pbch_phase);
|
||||
@@ -1338,15 +1358,17 @@ int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue,
|
||||
/*!
|
||||
\brief This function generates the downlink reference signal for the PUSCH according to 36.211 v8.6.0. The DRS occuies the RS defined by rb_alloc and the symbols 2 and 8 for extended CP and 3 and 10 for normal CP.
|
||||
*/
|
||||
int generate_drs_pusch(PHY_VARS_UE *ue,
|
||||
UE_rxtx_proc_t *proc,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **txdataF,
|
||||
uint8_t eNB_id,
|
||||
short amp,
|
||||
unsigned int subframe,
|
||||
unsigned int first_rb,
|
||||
unsigned int nb_rb,
|
||||
uint8_t ant);
|
||||
|
||||
int32_t generate_drs_pusch(PHY_VARS_UE *phy_vars_ue,
|
||||
UE_rxtx_proc_t *proc,
|
||||
uint8_t eNB_id,
|
||||
int16_t amp,
|
||||
uint32_t subframe,
|
||||
uint32_t first_rb,
|
||||
uint32_t nb_rb,
|
||||
uint8_t ant);
|
||||
|
||||
/*!
|
||||
\brief This function initializes the Group Hopping, Sequence Hopping and nPRS sequences for PUCCH/PUSCH according to 36.211 v8.6.0. It should be called after configuration of UE (reception of SIB2/3) and initial configuration of eNB (or after reconfiguration of cell-specific parameters).
|
||||
|
||||
@@ -29,6 +29,19 @@
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
/*! \function beam_precoding_one_eNB
|
||||
* \brief Create and Implementation of beamforming in one eNB
|
||||
* \author TY Hsu, SY Yeh(fdragon), TH Wang(Judy)
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company ISIP@NCTU and Eurecom
|
||||
* \email: tyhsu@cs.nctu.edu.tw,fdragon.cs96g@g2.nctu.edu.tw,Tsu-Han.Wang@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
@@ -41,50 +54,83 @@
|
||||
|
||||
int beam_precoding(int32_t **txdataF,
|
||||
int32_t **txdataF_BF,
|
||||
int subframe,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t ***beam_weights,
|
||||
int slot,
|
||||
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15],
|
||||
int symbol,
|
||||
int aa)
|
||||
int aa,
|
||||
int p,
|
||||
int l1_id)
|
||||
{
|
||||
uint8_t p;
|
||||
//uint16_t re=0;
|
||||
int slot_offset_F;
|
||||
int rb_offset_neg0 = frame_parms->ofdm_symbol_size - (6*frame_parms->N_RB_DL);
|
||||
int rb_offset_neg = (subframe*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti) + rb_offset_neg0;
|
||||
int rb_offset_pos = (subframe*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti);
|
||||
|
||||
|
||||
multadd_cpx_vector((int16_t*)&txdataF[p][rb_offset_neg+(symbol*frame_parms->ofdm_symbol_size)],
|
||||
(int16_t*)&beam_weights[l1_id][p][aa][rb_offset_neg0],
|
||||
(int16_t*)&txdataF_BF[aa][rb_offset_neg0+(symbol*frame_parms->ofdm_symbol_size)],
|
||||
0,
|
||||
6*frame_parms->N_RB_DL,
|
||||
15);
|
||||
multadd_cpx_vector((int16_t*)&txdataF[p][rb_offset_pos+(symbol*frame_parms->ofdm_symbol_size)],
|
||||
(int16_t*)&beam_weights[l1_id][p][aa][0],
|
||||
(int16_t*)&txdataF_BF[aa][(symbol*frame_parms->ofdm_symbol_size)],
|
||||
0,
|
||||
7*frame_parms->N_RB_DL, // to allow for extra RE at the end, 12 useless multipy-adds (first one at DC and 11 at end)
|
||||
15);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int beam_precoding_one_eNB(int32_t **txdataF,
|
||||
int32_t **txdataF_BF,
|
||||
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15],
|
||||
int subframe,
|
||||
int nb_antenna_ports,
|
||||
int nb_tx, // total physical antenna
|
||||
LTE_DL_FRAME_PARMS *frame_parms
|
||||
)
|
||||
{
|
||||
int p, symbol, aa; // loop index
|
||||
int re_offset;
|
||||
int ofdm_symbol_size = frame_parms->ofdm_symbol_size;
|
||||
int symbols_per_tti = frame_parms->symbols_per_tti;
|
||||
int nb_antenna_ports_eNB = frame_parms->nb_antenna_ports_eNB; // logic antenna ports
|
||||
|
||||
slot_offset_F = slot*(frame_parms->ofdm_symbol_size)*((frame_parms->Ncp==1) ? 6 : 7);
|
||||
|
||||
// clear txdata_BF[aa][re] for each call of ue_spec_beamforming
|
||||
memset(txdataF_BF[aa],0,sizeof(int32_t)*(frame_parms->ofdm_symbol_size));
|
||||
|
||||
for (p=0; p<NB_ANTENNA_PORTS_ENB; p++) {
|
||||
if (p<frame_parms->nb_antenna_ports_eNB || p==5) {
|
||||
multadd_cpx_vector((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size],
|
||||
(int16_t*)beam_weights[p][aa],
|
||||
(int16_t*)&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size],
|
||||
0,
|
||||
frame_parms->ofdm_symbol_size,
|
||||
15);
|
||||
//mult_cpx_conj_vector((int16_t*)beam_weights[p][aa], (int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size], (int16_t*)txdataF_BF[aa], frame_parms->ofdm_symbol_size, 15, 1);
|
||||
|
||||
// if check version
|
||||
/*for (re=0;re<frame_parms->ofdm_symbol_size;re++) {
|
||||
if (txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) {
|
||||
((int16_t*)&txdataF_BF[aa][re])[0] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
||||
|
||||
printf("beamforming.c:txdataF[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
|
||||
p,slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
|
||||
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
|
||||
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1],
|
||||
p,aa,re,
|
||||
((int16_t*)&beam_weights[p][aa][re])[0],((int16_t*)&beam_weights[p][aa][re])[1],
|
||||
aa,re,
|
||||
((int16_t*)&txdataF_BF[aa][re])[0],
|
||||
((int16_t*)&txdataF_BF[aa][re])[1]);
|
||||
}
|
||||
}*/
|
||||
|
||||
re_offset = ofdm_symbol_size*symbols_per_tti*subframe;
|
||||
|
||||
|
||||
// txdataF_BF[aa][re] = sum(beam_weghts[p][aa][re]*txdataF[p][re]), p=0~nb_antenna_ports-1
|
||||
// real part and image part need to compute separately
|
||||
|
||||
for (aa=0; aa<nb_tx; aa++) {
|
||||
memset(txdataF_BF[aa],0,sizeof(int32_t)*(ofdm_symbol_size*symbols_per_tti));
|
||||
for(p=0;p<nb_antenna_ports;p++){
|
||||
if (p<nb_antenna_ports_eNB || p==5){
|
||||
for (symbol=0; symbol<symbols_per_tti; symbol++){
|
||||
|
||||
multadd_cpx_vector((int16_t*)&txdataF[p][symbol*ofdm_symbol_size+re_offset],
|
||||
(int16_t*)beam_weights[0][p][aa],
|
||||
(int16_t*)&txdataF_BF[aa][symbol*ofdm_symbol_size],
|
||||
0,
|
||||
ofdm_symbol_size,
|
||||
15);
|
||||
|
||||
|
||||
/*
|
||||
for (re=0; re<ofdm_symbol_size; re++){
|
||||
// direct
|
||||
((int16_t*)&txdataF_BF[aa][re])[0] += (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[1]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
||||
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[1]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -60,6 +60,10 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
|
||||
int sample_offset,
|
||||
int no_prefix);
|
||||
|
||||
int slot_fep_mbsfn_khz_1dot25(PHY_VARS_UE *phy_vars_ue,
|
||||
int subframe,
|
||||
int sample_offset);
|
||||
|
||||
int front_end_fft(PHY_VARS_UE *ue,
|
||||
unsigned char l,
|
||||
unsigned char Ns,
|
||||
|
||||
@@ -37,6 +37,30 @@ void remove_7_5_kHz(RU_t *ru,uint8_t subframe);
|
||||
|
||||
/** \brief This function performs beamforming precoding for common
|
||||
* data
|
||||
@param txdataF Table of pointers for frequency-domain TX signals
|
||||
@param txdataF_BF Table of pointers for frequency-domain TX signals
|
||||
@param subframe subframe index
|
||||
@param frame_parms Frame descriptor structure
|
||||
after beamforming
|
||||
@param beam_weights Beamforming weights applied on each
|
||||
antenna element and each carrier
|
||||
@param slot Slot number
|
||||
@param symbol Symbol index on which to act
|
||||
@param aa physical antenna index
|
||||
@param p logical antenna index
|
||||
@param l1_id L1 instance id*/
|
||||
int beam_precoding(int32_t **txdataF,
|
||||
int32_t **txdataF_BF,
|
||||
int subframe,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15],
|
||||
int symbol,
|
||||
int aa,
|
||||
int p,
|
||||
int l1_id);
|
||||
|
||||
/** \brief This function performs beamforming precoding for common
|
||||
* data for only one eNB, fdragon
|
||||
@param txdataF Table of pointers for frequency-domain TX signals
|
||||
@param txdataF_BF Table of pointers for frequency-domain TX signals
|
||||
@param frame_parms Frame descriptor structure
|
||||
@@ -46,13 +70,13 @@ antenna element and each carrier
|
||||
@param slot Slot number
|
||||
@param symbol Symbol index on which to act
|
||||
@param aa physical antenna index*/
|
||||
int beam_precoding(int32_t **txdataF,
|
||||
int32_t **txdataF_BF,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t ***beam_weights,
|
||||
int slot,
|
||||
int symbol,
|
||||
int aa);
|
||||
int beam_precoding_one_eNB(int32_t **txdataF,
|
||||
int32_t **txdataF_BF,
|
||||
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15],
|
||||
int subframe,
|
||||
int nb_antenna_ports,
|
||||
int nb_tx, // total physical antenna
|
||||
LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
int f_read(char *calibF_fname, int nb_ant, int nb_freq, int32_t **tdd_calib_coeffs);
|
||||
|
||||
|
||||
@@ -204,3 +204,112 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue,
|
||||
#endif
|
||||
return(0);
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int slot_fep_mbsfn_khz_1dot25(PHY_VARS_UE *ue,
|
||||
int subframe,
|
||||
int sample_offset)
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
LTE_UE_COMMON *common_vars = &ue->common_vars;
|
||||
uint8_t eNB_id = 0;//ue_common_vars->eNb_id;
|
||||
|
||||
unsigned char aa;
|
||||
//unsigned char frame_type = frame_parms->frame_type; // Frame Type: 0 - FDD, 1 - TDD;
|
||||
unsigned int nb_prefix_samples;
|
||||
int ofdm_symbol_size;
|
||||
unsigned int subframe_offset;
|
||||
unsigned int frame_length_samples = frame_parms->samples_per_tti * 10;
|
||||
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
|
||||
AssertFatal(frame_parms->frame_type == FDD, "Frame is TDD!\n");
|
||||
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
|
||||
case 128:
|
||||
dft = dft1536;
|
||||
ofdm_symbol_size=1536;
|
||||
nb_prefix_samples=384;
|
||||
break;
|
||||
case 256:
|
||||
AssertFatal(1==0,"FeMBMS dft3072 not implemented\n");
|
||||
dft = dft3072;
|
||||
ofdm_symbol_size=3072;
|
||||
nb_prefix_samples=768;
|
||||
break;
|
||||
|
||||
case 512:
|
||||
dft = dft6144;
|
||||
nb_prefix_samples=1536;
|
||||
ofdm_symbol_size=6144;
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
dft = dft12288;
|
||||
nb_prefix_samples=3072;
|
||||
ofdm_symbol_size=12288;
|
||||
break;
|
||||
|
||||
case 1536:
|
||||
dft = dft18432;
|
||||
nb_prefix_samples=4608;
|
||||
ofdm_symbol_size=18432;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft24576;
|
||||
nb_prefix_samples=6144;
|
||||
ofdm_symbol_size=24576;
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"Illegal ofdm symbol size %d\n",frame_parms->ofdm_symbol_size);
|
||||
break;
|
||||
}
|
||||
|
||||
subframe_offset = frame_parms->samples_per_tti * subframe;
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
LOG_D(PHY,"slot_fep_mbsfn125: subframe %d, nb_prefix_samples %d, subframe_offset %d, sample_offset %d\n", subframe, nb_prefix_samples,subframe_offset,
|
||||
sample_offset);
|
||||
#endif
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||
memset(&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aa][0],0,ofdm_symbol_size*sizeof(int));
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->rx_dft_stats);
|
||||
#endif
|
||||
dft((int16_t *)&common_vars->rxdata[aa][(sample_offset +
|
||||
nb_prefix_samples +
|
||||
subframe_offset -
|
||||
SOFFSET) % frame_length_samples],
|
||||
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aa][0],1);
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->rx_dft_stats);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
if (ue->perfect_ce == 0) {
|
||||
#ifdef DEBUG_FEP
|
||||
LOG_D(PHY,"Channel estimation eNB %d, aatx %d, subframe %d\n",eNB_id,aa,subframe);
|
||||
#endif
|
||||
lte_dl_mbsfn_khz_1dot25_channel_estimation(ue,
|
||||
eNB_id,
|
||||
0,
|
||||
subframe);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
LOG_D(PHY,"slot_fep_mbsfn: done\n");
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -144,6 +144,17 @@ void remove_7_5_kHz(RU_t *ru,uint8_t slot)
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// undo 7.5 kHz offset for symbol 3 in case RU is slave (for OTA synchronization)
|
||||
if (ru->is_slave == 1 && slot == 2){
|
||||
memcpy((void*)&rxdata_7_5kHz[aa][(3*frame_parms->ofdm_symbol_size)+
|
||||
(2*frame_parms->nb_prefix_samples)+
|
||||
frame_parms->nb_prefix_samples0],
|
||||
(void*)&rxdata[aa][slot_offset+ru->N_TA_offset+
|
||||
(3*frame_parms->ofdm_symbol_size)+
|
||||
(2*frame_parms->nb_prefix_samples)+
|
||||
frame_parms->nb_prefix_samples0],
|
||||
(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
lte_dfts_sse4: lte_dfts.c
|
||||
gcc -O2 -std=gnu99 -msse4.1 -g -ggdb -o lte_dfts_sse4 lte_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
|
||||
gcc-7 -O3 -std=gnu99 -msse4.1 -o lte_dfts_sse4 lte_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -I$$OPENAIR_HOME/common/utils/T -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
|
||||
|
||||
lte_dfts_avx2: lte_dfts.c
|
||||
gcc -O2 -std=gnu99 -mavx2 -g -ggdb -o lte_dfts_avx2 lte_dfts.c time_meas.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR_HOME -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR -I$$OPENAIR2_DIR/COMMON -I$$OPENAIR_HOME/common/utils -DMR_MAIN -DNB_ANTENNAS_RX=1 -lm -lpthread # -DD256STATS #-DD64STATS
|
||||
|
||||
@@ -159,6 +159,125 @@ int32_t dot_product(int16_t *x,
|
||||
}
|
||||
|
||||
|
||||
int64_t dot_product64(int16_t *x,
|
||||
int16_t *y,
|
||||
uint32_t N, //must be a multiple of 8
|
||||
uint8_t output_shift)
|
||||
{
|
||||
uint32_t n;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *x128,*y128,mmtmp1,mmtmp2,mmtmp3,mmcumul,mmcumul_re,mmcumul_im;
|
||||
__m128i minus_i = _mm_set_epi16(-1,1,-1,1,-1,1,-1,1);
|
||||
int32_t result;
|
||||
|
||||
x128 = (__m128i*) x;
|
||||
y128 = (__m128i*) y;
|
||||
|
||||
mmcumul_re = _mm_setzero_si128();
|
||||
mmcumul_im = _mm_setzero_si128();
|
||||
|
||||
for (n=0; n<(N>>2); n++) {
|
||||
|
||||
// printf("n=%d, x128=%p, y128=%p\n",n,x128,y128);
|
||||
// print_shorts("x",&x128[0]);
|
||||
// print_shorts("y",&y128[0]);
|
||||
|
||||
// this computes Re(z) = Re(x)*Re(y) + Im(x)*Im(y)
|
||||
mmtmp1 = _mm_madd_epi16(x128[0],y128[0]);
|
||||
// print_ints("retmp",&mmtmp1);
|
||||
// mmtmp1 contains real part of 4 consecutive outputs (32-bit)
|
||||
|
||||
// shift and accumulate results
|
||||
mmtmp1 = _mm_srai_epi32(mmtmp1,output_shift);
|
||||
mmcumul_re = _mm_add_epi32(mmcumul_re,mmtmp1);
|
||||
//print_ints("re",&mmcumul_re);
|
||||
|
||||
|
||||
// this computes Im(z) = Re(x)*Im(y) - Re(y)*Im(x)
|
||||
mmtmp2 = _mm_shufflelo_epi16(y128[0],_MM_SHUFFLE(2,3,0,1));
|
||||
//print_shorts("y",&mmtmp2);
|
||||
mmtmp2 = _mm_shufflehi_epi16(mmtmp2,_MM_SHUFFLE(2,3,0,1));
|
||||
//print_shorts("y",&mmtmp2);
|
||||
mmtmp2 = _mm_sign_epi16(mmtmp2,minus_i);
|
||||
// print_shorts("y",&mmtmp2);
|
||||
|
||||
mmtmp3 = _mm_madd_epi16(x128[0],mmtmp2);
|
||||
//print_ints("imtmp",&mmtmp3);
|
||||
// mmtmp3 contains imag part of 4 consecutive outputs (32-bit)
|
||||
|
||||
// shift and accumulate results
|
||||
mmtmp3 = _mm_srai_epi32(mmtmp3,output_shift);
|
||||
mmcumul_im = _mm_add_epi32(mmcumul_im,mmtmp3);
|
||||
//print_ints("im",&mmcumul_im);
|
||||
|
||||
x128++;
|
||||
y128++;
|
||||
}
|
||||
|
||||
// this gives Re Re Im Im
|
||||
mmcumul = _mm_hadd_epi32(mmcumul_re,mmcumul_im);
|
||||
//print_ints("cumul1",&mmcumul);
|
||||
|
||||
// this gives Re Im Re Im
|
||||
mmcumul = _mm_hadd_epi32(mmcumul,mmcumul);
|
||||
|
||||
//print_ints("cumul2",&mmcumul);
|
||||
|
||||
|
||||
//mmcumul = _mm_srai_epi32(mmcumul,output_shift);
|
||||
// extract the lower half
|
||||
result = _mm_extract_epi64(mmcumul,0);
|
||||
//printf("result: (%d,%d)\n",((int32_t*)&result)[0],((int32_t*)&result)[1]);
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(result);
|
||||
#elif defined(__arm__)
|
||||
int16x4_t *x_128=(int16x4_t*)x;
|
||||
int16x4_t *y_128=(int16x4_t*)y;
|
||||
int32x4_t tmp_re,tmp_im;
|
||||
int32x4_t tmp_re1,tmp_im1;
|
||||
int32x4_t re_cumul,im_cumul;
|
||||
int32x2_t re_cumul2,im_cumul2;
|
||||
int32x4_t shift = vdupq_n_s32(-output_shift);
|
||||
int32x2x2_t result2;
|
||||
int16_t conjug[4]__attribute__((aligned(16))) = {-1,1,-1,1} ;
|
||||
|
||||
re_cumul = vdupq_n_s32(0);
|
||||
im_cumul = vdupq_n_s32(0);
|
||||
|
||||
for (n=0; n<(N>>2); n++) {
|
||||
|
||||
tmp_re = vmull_s16(*x_128++, *y_128++);
|
||||
//tmp_re = [Re(x[0])Re(y[0]) Im(x[0])Im(y[0]) Re(x[1])Re(y[1]) Im(x[1])Im(y[1])]
|
||||
tmp_re1 = vmull_s16(*x_128++, *y_128++);
|
||||
//tmp_re1 = [Re(x1[1])Re(x2[1]) Im(x1[1])Im(x2[1]) Re(x1[1])Re(x2[2]) Im(x1[1])Im(x2[2])]
|
||||
tmp_re = vcombine_s32(vpadd_s32(vget_low_s32(tmp_re),vget_high_s32(tmp_re)),
|
||||
vpadd_s32(vget_low_s32(tmp_re1),vget_high_s32(tmp_re1)));
|
||||
//tmp_re = [Re(ch[0])Re(rx[0])+Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1])+Im(ch[1])Im(ch[1]) Re(ch[2])Re(rx[2])+Im(ch[2]) Im(ch[2]) Re(ch[3])Re(rx[3])+Im(ch[3])Im(ch[3])]
|
||||
|
||||
tmp_im = vmull_s16(vrev32_s16(vmul_s16(*x_128++,*(int16x4_t*)conjug)),*y_128++);
|
||||
//tmp_im = [-Im(ch[0])Re(rx[0]) Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1]) Re(ch[1])Im(rx[1])]
|
||||
tmp_im1 = vmull_s16(vrev32_s16(vmul_s16(*x_128++,*(int16x4_t*)conjug)),*y_128++);
|
||||
//tmp_im1 = [-Im(ch[2])Re(rx[2]) Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3]) Re(ch[3])Im(rx[3])]
|
||||
tmp_im = vcombine_s32(vpadd_s32(vget_low_s32(tmp_im),vget_high_s32(tmp_im)),
|
||||
vpadd_s32(vget_low_s32(tmp_im1),vget_high_s32(tmp_im1)));
|
||||
//tmp_im = [-Im(ch[0])Re(rx[0])+Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1])+Re(ch[1])Im(rx[1]) -Im(ch[2])Re(rx[2])+Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3])+Re(ch[3])Im(rx[3])]
|
||||
|
||||
re_cumul = vqaddq_s32(re_cumul,vqshlq_s32(tmp_re,shift));
|
||||
im_cumul = vqaddq_s32(im_cumul,vqshlq_s32(tmp_im,shift));
|
||||
}
|
||||
|
||||
re_cumul2 = vpadd_s32(vget_low_s32(re_cumul),vget_high_s32(re_cumul));
|
||||
im_cumul2 = vpadd_s32(vget_low_s32(im_cumul),vget_high_s32(im_cumul));
|
||||
re_cumul2 = vpadd_s32(re_cumul2,re_cumul2);
|
||||
im_cumul2 = vpadd_s32(im_cumul2,im_cumul2);
|
||||
result2 = vzip_s32(re_cumul2,im_cumul2);
|
||||
return(vget_lane_s32(result2.val[0],0));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef MAIN
|
||||
void print_bytes(char *s,__m128i *x)
|
||||
|
||||
@@ -597,6 +597,12 @@ int16_t dB_fixed_times10(uint32_t x)
|
||||
return dB_power;
|
||||
}
|
||||
|
||||
uint8_t dB_fixed64(uint64_t x) {
|
||||
|
||||
if ((x<(((uint64_t)1)<<32))) return(dB_fixed((uint32_t)x));
|
||||
else return(4*dB_table[255]+dB_fixed((uint32_t)(x>>32)));
|
||||
|
||||
}
|
||||
int8_t dB_fixed(uint32_t x)
|
||||
{
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "tools_defs.h"
|
||||
#else
|
||||
#include "time_meas.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "LOG/log.h"
|
||||
#define debug_msg
|
||||
#define ONE_OVER_SQRT2_Q15 23170
|
||||
|
||||
@@ -9315,7 +9315,7 @@ int main(int argc, char**argv)
|
||||
|
||||
for (i=0; i<10000; i++) {
|
||||
start_meas(&ts);
|
||||
idft2048((int16_t *)x,(int16_t *)y,1);
|
||||
dft2048((int16_t *)x,(int16_t *)y,1);
|
||||
stop_meas(&ts);
|
||||
}
|
||||
|
||||
|
||||
+22
-128
@@ -69,8 +69,7 @@ The function implemented is : \f$\mathbf{y} = y + \alpha\mathbf{x}\f$
|
||||
void multadd_real_vector_complex_scalar(int16_t *x,
|
||||
int16_t *alpha,
|
||||
int16_t *y,
|
||||
uint32_t N
|
||||
);
|
||||
uint32_t N);
|
||||
|
||||
/*!\fn void multadd_complex_vector_real_scalar(int16_t *x,int16_t alpha,int16_t *y,uint8_t zero_flag,uint32_t N)
|
||||
This function performs componentwise multiplication and accumulation of a real scalar and a complex vector.
|
||||
@@ -122,7 +121,7 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift,
|
||||
int madd);
|
||||
int madd);
|
||||
|
||||
/*!
|
||||
Element-wise multiplication and accumulation of two complex vectors x1 and x2.
|
||||
@@ -137,11 +136,11 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
*/
|
||||
|
||||
int multadd_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint8_t zero_flag,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint8_t zero_flag,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
|
||||
int mult_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
@@ -188,15 +187,14 @@ void idft24576(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft1536(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft3072(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft6144(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft12288(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft18432(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
|
||||
void dft3072(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft24576(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
|
||||
@@ -234,9 +232,9 @@ int32_t add_cpx_vector(int16_t *x,
|
||||
uint32_t N);
|
||||
|
||||
int32_t sub_cpx_vector16(int16_t *x,
|
||||
int16_t *y,
|
||||
int16_t *z,
|
||||
uint32_t N);
|
||||
int16_t *y,
|
||||
int16_t *z,
|
||||
uint32_t N);
|
||||
|
||||
int32_t add_cpx_vector32(int16_t *x,
|
||||
int16_t *y,
|
||||
@@ -347,130 +345,26 @@ Compensate the phase rotation of the RF. WARNING: This function is currently unu
|
||||
|
||||
int8_t dB_fixed(uint32_t x);
|
||||
|
||||
uint8_t dB_fixed64(uint64_t x);
|
||||
|
||||
int8_t dB_fixed2(uint32_t x,uint32_t y);
|
||||
|
||||
int16_t dB_fixed_times10(uint32_t x);
|
||||
|
||||
uint8_t dB_fixed64(uint64_t x);
|
||||
|
||||
int32_t phy_phase_compensation_top (uint32_t pilot_type, uint32_t initial_pilot,
|
||||
uint32_t last_pilot, int32_t ignore_prefix);
|
||||
int32_t phy_phase_compensation_top(uint32_t pilot_type,
|
||||
uint32_t initial_pilot,
|
||||
uint32_t last_pilot,
|
||||
int32_t ignore_prefix);
|
||||
|
||||
int32_t dot_product(int16_t *x,
|
||||
int16_t *y,
|
||||
uint32_t N, //must be a multiple of 8
|
||||
uint8_t output_shift);
|
||||
|
||||
static inline int64_t dot_product64(int16_t *x,
|
||||
int16_t *y,
|
||||
uint32_t N, //must be a multiple of 8
|
||||
uint8_t output_shift)
|
||||
{
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *x128,*y128,mmtmp1,mmtmp2,mmtmp3,mmcumul,mmcumul_re,mmcumul_im;
|
||||
__m128i minus_i = _mm_set_epi16(-1,1,-1,1,-1,1,-1,1);
|
||||
int64_t result;
|
||||
|
||||
x128 = (__m128i*) x;
|
||||
y128 = (__m128i*) y;
|
||||
|
||||
mmcumul_re = _mm_setzero_si128();
|
||||
mmcumul_im = _mm_setzero_si128();
|
||||
|
||||
__m128i*end=x128+(N>>2);
|
||||
for (__m128i* inPtr=x128; inPtr < end ; inPtr++) {
|
||||
|
||||
// printf("n=%d, x128=%p, y128=%p\n",n,x128,y128);
|
||||
// print_shorts("x",&x128[0]);
|
||||
// print_shorts("y",&y128[0]);
|
||||
|
||||
// this computes Re(z) = Re(x)*Re(y) + Im(x)*Im(y)
|
||||
mmtmp1 = _mm_madd_epi16(*inPtr,*y128);
|
||||
// print_ints("retmp",&mmtmp1);
|
||||
// mmtmp1 contains real part of 4 consecutive outputs (32-bit)
|
||||
// shift and accumulate results
|
||||
mmtmp1 = _mm_srai_epi32(mmtmp1,output_shift);
|
||||
mmcumul_re = _mm_add_epi32(mmcumul_re,mmtmp1);
|
||||
//print_ints("re",&mmcumul_re);
|
||||
|
||||
|
||||
// this computes Im(z) = Re(x)*Im(y) - Re(y)*Im(x)
|
||||
mmtmp2 = _mm_shufflelo_epi16(*y128,_MM_SHUFFLE(2,3,0,1));
|
||||
//print_shorts("y",&mmtmp2);
|
||||
mmtmp2 = _mm_shufflehi_epi16(mmtmp2,_MM_SHUFFLE(2,3,0,1));
|
||||
//print_shorts("y",&mmtmp2);
|
||||
mmtmp2 = _mm_sign_epi16(mmtmp2,minus_i);
|
||||
// print_shorts("y",&mmtmp2);
|
||||
|
||||
mmtmp3 = _mm_madd_epi16(*inPtr,mmtmp2);
|
||||
//print_ints("imtmp",&mmtmp3);
|
||||
// mmtmp3 contains imag part of 4 consecutive outputs (32-bit)
|
||||
// shift and accumulate results
|
||||
mmtmp3 = _mm_srai_epi32(mmtmp3,output_shift);
|
||||
mmcumul_im = _mm_add_epi32(mmcumul_im,mmtmp3);
|
||||
//print_ints("im",&mmcumul_im);
|
||||
y128++;
|
||||
}
|
||||
|
||||
// this gives Re Re Im Im
|
||||
mmcumul = _mm_hadd_epi32(mmcumul_re,mmcumul_im);
|
||||
//print_ints("cumul1",&mmcumul);
|
||||
// this gives Re Im Re Im
|
||||
mmcumul = _mm_hadd_epi32(mmcumul,mmcumul);
|
||||
//print_ints("cumul2",&mmcumul);
|
||||
|
||||
//mmcumul = _mm_srai_epi32(mmcumul,output_shift);
|
||||
// extract the lower half
|
||||
result = _mm_extract_epi64(mmcumul,0);
|
||||
//printf("result: (%d,%d)\n",((int32_t*)&result)[0],((int32_t*)&result)[1]);
|
||||
|
||||
return(result);
|
||||
|
||||
#elif defined(__arm__)
|
||||
int16x4_t *x_128=(int16x4_t*)x;
|
||||
int16x4_t *y_128=(int16x4_t*)y;
|
||||
int32x4_t tmp_re,tmp_im;
|
||||
int32x4_t tmp_re1,tmp_im1;
|
||||
int32x4_t re_cumul,im_cumul;
|
||||
int32x2_t re_cumul2,im_cumul2;
|
||||
int32x4_t shift = vdupq_n_s32(-output_shift);
|
||||
int32x2x2_t result2;
|
||||
int16_t conjug[4]__attribute__((aligned(16))) = {-1,1,-1,1} ;
|
||||
|
||||
re_cumul = vdupq_n_s32(0);
|
||||
im_cumul = vdupq_n_s32(0);
|
||||
|
||||
for (n=0; n<(N>>2); n++) {
|
||||
|
||||
tmp_re = vmull_s16(*x_128++, *y_128++);
|
||||
//tmp_re = [Re(x[0])Re(y[0]) Im(x[0])Im(y[0]) Re(x[1])Re(y[1]) Im(x[1])Im(y[1])]
|
||||
tmp_re1 = vmull_s16(*x_128++, *y_128++);
|
||||
//tmp_re1 = [Re(x1[1])Re(x2[1]) Im(x1[1])Im(x2[1]) Re(x1[1])Re(x2[2]) Im(x1[1])Im(x2[2])]
|
||||
tmp_re = vcombine_s32(vpadd_s32(vget_low_s32(tmp_re),vget_high_s32(tmp_re)),
|
||||
vpadd_s32(vget_low_s32(tmp_re1),vget_high_s32(tmp_re1)));
|
||||
//tmp_re = [Re(ch[0])Re(rx[0])+Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1])+Im(ch[1])Im(ch[1]) Re(ch[2])Re(rx[2])+Im(ch[2]) Im(ch[2]) Re(ch[3])Re(rx[3])+Im(ch[3])Im(ch[3])]
|
||||
|
||||
tmp_im = vmull_s16(vrev32_s16(vmul_s16(*x_128++,*(int16x4_t*)conjug)),*y_128++);
|
||||
//tmp_im = [-Im(ch[0])Re(rx[0]) Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1]) Re(ch[1])Im(rx[1])]
|
||||
tmp_im1 = vmull_s16(vrev32_s16(vmul_s16(*x_128++,*(int16x4_t*)conjug)),*y_128++);
|
||||
//tmp_im1 = [-Im(ch[2])Re(rx[2]) Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3]) Re(ch[3])Im(rx[3])]
|
||||
tmp_im = vcombine_s32(vpadd_s32(vget_low_s32(tmp_im),vget_high_s32(tmp_im)),
|
||||
vpadd_s32(vget_low_s32(tmp_im1),vget_high_s32(tmp_im1)));
|
||||
//tmp_im = [-Im(ch[0])Re(rx[0])+Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1])+Re(ch[1])Im(rx[1]) -Im(ch[2])Re(rx[2])+Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3])+Re(ch[3])Im(rx[3])]
|
||||
|
||||
re_cumul = vqaddq_s32(re_cumul,vqshlq_s32(tmp_re,shift));
|
||||
im_cumul = vqaddq_s32(im_cumul,vqshlq_s32(tmp_im,shift));
|
||||
}
|
||||
|
||||
re_cumul2 = vpadd_s32(vget_low_s32(re_cumul),vget_high_s32(re_cumul));
|
||||
im_cumul2 = vpadd_s32(vget_low_s32(im_cumul),vget_high_s32(im_cumul));
|
||||
re_cumul2 = vpadd_s32(re_cumul2,re_cumul2);
|
||||
im_cumul2 = vpadd_s32(im_cumul2,im_cumul2);
|
||||
result2 = vzip_s32(re_cumul2,im_cumul2);
|
||||
return(vget_lane_s32(result2.val[0],0));
|
||||
#endif
|
||||
}
|
||||
int64_t dot_product64(int16_t *x,
|
||||
int16_t *y,
|
||||
uint32_t N, //must be a multiple of 8
|
||||
uint8_t output_shift);
|
||||
|
||||
void dft12(int16_t *x,int16_t *y);
|
||||
void dft24(int16_t *x,int16_t *y,uint8_t scale_flag);
|
||||
|
||||
@@ -567,6 +567,10 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
|
||||
uint32_t lte_gold_uespec_table[2][20][2][21];
|
||||
/// mbsfn reference symbols
|
||||
uint32_t lte_gold_mbsfn_table[10][3][42];
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/// mbsfn reference symbols
|
||||
uint32_t lte_gold_mbsfn_khz_1dot25_table[10][150]; //Not sure whether we need this here
|
||||
#endif
|
||||
///
|
||||
uint32_t X_u[64][839];
|
||||
///
|
||||
@@ -839,6 +843,10 @@ typedef struct {
|
||||
uint32_t lte_gold_uespec_table[2][20][2][21];
|
||||
//mbsfn reference symbols
|
||||
uint32_t lte_gold_mbsfn_table[10][3][42];
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/// mbsfn reference symbols
|
||||
uint32_t lte_gold_mbsfn_khz_1dot25_table[10][150]; //Not sure whether we need this here
|
||||
#endif
|
||||
///
|
||||
uint32_t X_u[64][839];
|
||||
///
|
||||
|
||||
+90
-1
@@ -180,11 +180,15 @@ typedef struct RU_proc_t_s {
|
||||
int instance_cnt_fep;
|
||||
/// \internal This variable is protected by \ref mutex_feptx
|
||||
int instance_cnt_feptx;
|
||||
/// \internal This variable is protected by \ref mutex_ru_thread
|
||||
int instance_cnt_ru;
|
||||
/// This varible is protected by \ref mutex_emulatedRF
|
||||
int instance_cnt_emulateRF;
|
||||
/// pthread structure for RU FH processing thread
|
||||
pthread_t pthread_FH;
|
||||
pthread_t pthread_FH1;
|
||||
/// pthread structure for RU control thread
|
||||
pthread_t pthread_ctrl;
|
||||
/// pthread structure for RU prach processing thread
|
||||
pthread_t pthread_prach;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
@@ -208,6 +212,8 @@ typedef struct RU_proc_t_s {
|
||||
/// pthread attributes for RU FH processing thread
|
||||
pthread_attr_t attr_FH;
|
||||
pthread_attr_t attr_FH1;
|
||||
/// pthread attributes for RU control thread
|
||||
pthread_attr_t attr_ctrl;
|
||||
/// pthread attributes for RU prach
|
||||
pthread_attr_t attr_prach;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
@@ -281,10 +287,14 @@ typedef struct RU_proc_t_s {
|
||||
pthread_mutex_t mutex_fep;
|
||||
/// mutex for fep TX worker thread
|
||||
pthread_mutex_t mutex_feptx;
|
||||
/// mutex for ru_thread
|
||||
pthread_mutex_t mutex_ru;
|
||||
/// mutex for emulated RF thread
|
||||
pthread_mutex_t mutex_emulateRF;
|
||||
/// symbol mask for IF4p5 reception per subframe
|
||||
uint32_t symbol_mask[10];
|
||||
/// time measurements for each subframe
|
||||
struct timespec t[10];
|
||||
/// number of slave threads
|
||||
int num_slaves;
|
||||
/// array of pointers to slaves
|
||||
@@ -334,6 +344,27 @@ typedef enum {
|
||||
//EMULATE_RF =6
|
||||
} RU_if_south_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
RU_IDLE = 0,
|
||||
RU_CONFIG = 1,
|
||||
RU_READY = 2,
|
||||
RU_RUN = 3,
|
||||
RU_ERROR = 4,
|
||||
RU_SYNC = 5,
|
||||
RU_CHECK_SYNC = 6
|
||||
} rru_state_t;
|
||||
|
||||
|
||||
/// Some commamds to RRU. Not sure we should do it like this !
|
||||
typedef enum {
|
||||
EMPTY = 0,
|
||||
STOP_RU = 1,
|
||||
RU_FRAME_RESYNCH = 2,
|
||||
WAIT_RESYNCH = 3
|
||||
} rru_cmd_t;
|
||||
|
||||
|
||||
typedef struct RU_t_s{
|
||||
/// index of this ru
|
||||
uint32_t idx;
|
||||
@@ -351,8 +382,24 @@ typedef struct RU_t_s{
|
||||
int in_synch;
|
||||
/// timing offset
|
||||
int rx_offset;
|
||||
/// south in counter
|
||||
int south_in_cnt;
|
||||
/// south out counter
|
||||
int south_out_cnt;
|
||||
/// north in counter
|
||||
int north_in_cnt;
|
||||
/// north out counter
|
||||
int north_out_cnt;
|
||||
/// flag to indicate the RU is a slave to another source
|
||||
int is_slave;
|
||||
/// flag to indicate that the RU should generate the DMRS sequence in slot 2 (subframe 1) for OTA synchronization and calibration
|
||||
int generate_dmrs_sync;
|
||||
/// flag to indicate if the RU has a control channel
|
||||
int has_ctrl_prt;
|
||||
/// counter to delay start of processing of RU until HW settles
|
||||
int wait_cnt;
|
||||
/// counter to delay start of slave RUs until stable synchronization
|
||||
int wait_check;
|
||||
/// Total gain of receive chain
|
||||
uint32_t rx_total_gain_dB;
|
||||
/// number of bands that this device can support
|
||||
@@ -462,6 +509,7 @@ typedef struct RU_t_s{
|
||||
time_stats_t transport;
|
||||
/// RX and TX buffers for precoder output
|
||||
RU_COMMON common;
|
||||
RU_CALIBRATION calibration;
|
||||
/// beamforming weight vectors per eNB
|
||||
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15];
|
||||
/// beamforming weight vectors per gNB
|
||||
@@ -474,25 +522,48 @@ typedef struct RU_t_s{
|
||||
uint8_t seqno;
|
||||
/// initial timestamp used as an offset make first real timestamp 0
|
||||
openair0_timestamp ts_offset;
|
||||
/// Current state of the RU
|
||||
rru_state_t state;
|
||||
/// Command to do
|
||||
rru_cmd_t cmd;
|
||||
/// value to be passed using command
|
||||
uint16_t cmdval;
|
||||
/// process scheduling variables
|
||||
RU_proc_t proc;
|
||||
/// stats thread pthread descriptor
|
||||
pthread_t ru_stats_thread;
|
||||
/// OTA synchronization signal
|
||||
int16_t *dmrssync;
|
||||
/// OTA synchronization correlator output
|
||||
uint64_t *dmrs_corr;
|
||||
/// sleep time in us for delaying L1 wakeup
|
||||
int wakeup_L1_sleeptime;
|
||||
/// maximum number of sleeps
|
||||
int wakeup_L1_sleep_cnt_max;
|
||||
} RU_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
RAU_tick=0,
|
||||
RRU_capabilities=1,
|
||||
RRU_config=2,
|
||||
RRU_MSG_max_num=3
|
||||
RRU_config_ok=3,
|
||||
RRU_start=4,
|
||||
RRU_stop=5,
|
||||
RRU_sync_ok=6,
|
||||
RRU_frame_resynch=7,
|
||||
RRU_MSG_max_num=8,
|
||||
RRU_check_sync = 9
|
||||
} rru_config_msg_type_t;
|
||||
|
||||
|
||||
typedef struct RRU_CONFIG_msg_s {
|
||||
rru_config_msg_type_t type;
|
||||
ssize_t len;
|
||||
uint8_t msg[MAX_RRU_CONFIG_SIZE];
|
||||
} RRU_CONFIG_msg_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
OAI_IF5_only =0,
|
||||
OAI_IF4p5_only =1,
|
||||
@@ -501,6 +572,7 @@ typedef enum {
|
||||
MAX_FH_FMTs =4
|
||||
} FH_fmt_options_t;
|
||||
|
||||
|
||||
typedef struct RRU_capabilities_s {
|
||||
/// Fronthaul format
|
||||
FH_fmt_options_t FH_fmt;
|
||||
@@ -524,6 +596,7 @@ typedef struct RRU_capabilities_s {
|
||||
uint8_t N_RB_UL[MAX_BANDS_PER_RRU];
|
||||
} RRU_capabilities_t;
|
||||
|
||||
|
||||
typedef struct RRU_config_s {
|
||||
/// Fronthaul format
|
||||
RU_if_south_t FH_fmt;
|
||||
@@ -560,6 +633,22 @@ typedef struct RRU_config_s {
|
||||
/// emtc_prach_ConfigIndex for IF4p5 per CE Level
|
||||
int emtc_prach_ConfigIndex[MAX_BANDS_PER_RRU][4];
|
||||
#endif
|
||||
/// mutex for asynch RX/TX thread
|
||||
pthread_mutex_t mutex_asynch_rxtx;
|
||||
/// mutex for RU access to eNB processing (PDSCH/PUSCH)
|
||||
pthread_mutex_t mutex_RU;
|
||||
/// mutex for RU access to eNB processing (PRACH)
|
||||
pthread_mutex_t mutex_RU_PRACH;
|
||||
/// mutex for RU access to eNB processing (PRACH BR)
|
||||
pthread_mutex_t mutex_RU_PRACH_br;
|
||||
/// mask for RUs serving eNB (PDSCH/PUSCH)
|
||||
int RU_mask[10];
|
||||
/// time measurements for RU arrivals
|
||||
struct timespec t[10];
|
||||
/// Timing statistics (RU_arrivals)
|
||||
time_stats_t ru_arrival_time;
|
||||
/// mask for RUs serving eNB (PRACH)
|
||||
int RU_mask_prach;
|
||||
} RRU_config_t;
|
||||
|
||||
#endif //__PHY_DEFS_RU__H__
|
||||
|
||||
@@ -621,6 +621,11 @@ typedef struct {
|
||||
//uint8_t local_flag;
|
||||
/// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach)
|
||||
runmode_t mode;
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/// \brief Indicator that UE is configured for FeMBMS functionality (This flag should be avoided) ... just kept for PBCH initical scan (TODO)
|
||||
int FeMBMS_active;
|
||||
#endif
|
||||
/// \brief Indicator that UE should perform band scanning
|
||||
int UE_scan;
|
||||
/// \brief Indicator that UE should perform coarse scanning around carrier
|
||||
@@ -703,6 +708,10 @@ typedef struct {
|
||||
|
||||
/// mbsfn reference symbols
|
||||
uint32_t lte_gold_mbsfn_table[10][3][42];
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/// mbsfn reference symbols
|
||||
uint32_t lte_gold_mbsfn_khz_1dot25_table[10][150];
|
||||
#endif
|
||||
|
||||
uint32_t X_u[64][839];
|
||||
|
||||
|
||||
+93
-47
@@ -50,16 +50,13 @@
|
||||
#include <execinfo.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/sysinfo.h>
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "common_lib.h"
|
||||
#include "msc.h"
|
||||
#include <common/utils/LOG/log.h>
|
||||
#include "assertions.h"
|
||||
|
||||
//#include <complex.h>
|
||||
#include "PHY/TOOLS/time_meas.h"
|
||||
@@ -579,7 +576,17 @@ typedef struct {
|
||||
int mbsfn_SubframeConfig;
|
||||
} MBSFN_config_t;
|
||||
|
||||
typedef struct LTE_DL_FRAME_PARMS {
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
typedef struct {
|
||||
int radioframeAllocationPeriod;
|
||||
int radioframeAllocationOffset;
|
||||
int non_mbsfn_SubframeConfig;
|
||||
} NonMBSFN_config_t;
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// Number of resource blocks (RB) in DL
|
||||
uint8_t N_RB_DL;
|
||||
/// Number of resource blocks (RB) in UL
|
||||
@@ -622,12 +629,29 @@ typedef struct LTE_DL_FRAME_PARMS {
|
||||
uint8_t threequarter_fs;
|
||||
/// Size of FFT
|
||||
uint16_t ofdm_symbol_size;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uint8_t FeMBMS_active;
|
||||
#endif
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/// Size of FFT
|
||||
uint16_t ofdm_symbol_size_khz_1dot25;
|
||||
#endif
|
||||
/// Number of prefix samples in all but first symbol of slot
|
||||
uint16_t nb_prefix_samples;
|
||||
/// Number of prefix samples in first symbol of slot
|
||||
uint16_t nb_prefix_samples0;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/// Number of prefix samples in all but first symbol of slot
|
||||
uint16_t nb_prefix_samples_khz_1dot25;
|
||||
/// Number of prefix samples in first symbol of slot
|
||||
uint16_t nb_prefix_samples0_khz_1dot25;
|
||||
#endif
|
||||
/// Carrier offset in FFT buffer for first RE in PRB0
|
||||
uint16_t first_carrier_offset;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/// Carrier offset in FFT buffer for first RE in PRB0 (FeMBMS
|
||||
uint16_t first_carrier_offset_khz_1dot25;
|
||||
#endif
|
||||
/// Number of samples in a subframe
|
||||
uint32_t samples_per_tti;
|
||||
/// Number of OFDM/SC-FDMA symbols in one subframe (to be modified to account for potential different in UL/DL)
|
||||
@@ -664,6 +688,10 @@ typedef struct LTE_DL_FRAME_PARMS {
|
||||
int num_MBSFN_config;
|
||||
/// Array of MBSFN Configurations (max 8 (maxMBSFN-Allocations) elements as per 36.331)
|
||||
MBSFN_config_t MBSFN_config[8];
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uint8_t NonMBSFN_config_flag;
|
||||
NonMBSFN_config_t NonMBSFN_config;
|
||||
#endif
|
||||
/// Maximum Number of Retransmissions of RRCConnectionRequest (from 36-331 RRC Spec)
|
||||
uint8_t maxHARQ_Msg3Tx;
|
||||
/// Size of SI windows used for repetition of one SI message (in frames)
|
||||
@@ -678,6 +706,9 @@ typedef struct LTE_DL_FRAME_PARMS {
|
||||
uint16_t phich_reg[MAX_NUM_PHICH_GROUPS][3];
|
||||
|
||||
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[MAX_MBSFN_AREA];
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
struct NonMBSFN_SubframeConfig *non_mbsfn_SubframeConfig;
|
||||
#endif
|
||||
/// for fair RR scheduler
|
||||
uint32_t ue_multiple_max;
|
||||
} LTE_DL_FRAME_PARMS;
|
||||
@@ -995,14 +1026,15 @@ typedef uint8_t(encoder_if_t)(uint8_t *input,
|
||||
|
||||
|
||||
static inline void wait_sync(char *thread_name) {
|
||||
int rc;
|
||||
|
||||
printf( "waiting for sync (%s,%d/%p,%p,%p)\n",thread_name,sync_var,&sync_var,&sync_cond,&sync_mutex);
|
||||
pthread_mutex_lock( &sync_mutex );
|
||||
AssertFatal((rc = pthread_mutex_lock( &sync_mutex ))==0,"sync mutex lock error");
|
||||
|
||||
while (sync_var<0)
|
||||
pthread_cond_wait( &sync_cond, &sync_mutex );
|
||||
|
||||
pthread_mutex_unlock(&sync_mutex);
|
||||
AssertFatal((rc = pthread_mutex_unlock( &sync_mutex ))==0,"sync mutex unlock error");
|
||||
|
||||
printf( "got sync (%s)\n", thread_name);
|
||||
/*
|
||||
@@ -1012,15 +1044,25 @@ static inline void wait_sync(char *thread_name) {
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
static inline int wakeup_thread(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) {
|
||||
static inline int wakeup_thread(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name, int sleeptime,int sleep_cnt_max) {
|
||||
int rc;
|
||||
if ((rc = pthread_mutex_lock(mutex)) != 0) {
|
||||
LOG_E(PHY, "wakeup_thread(): error locking mutex for %s (%d %s, %p)\n",
|
||||
name, rc, strerror(rc), (void *)mutex);
|
||||
exit_fun("nothing to add");
|
||||
return(-1);
|
||||
int sleep_cnt=0;
|
||||
|
||||
AssertFatal((rc = pthread_mutex_lock(mutex))==0,"wakeup_thread(): error locking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex);
|
||||
|
||||
while (*instance_cnt == 0) {
|
||||
|
||||
AssertFatal((rc = pthread_mutex_unlock(mutex))==0,"wakeup_thread(): error unlocking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex);
|
||||
|
||||
sleep_cnt++;
|
||||
if (sleep_cnt>sleep_cnt_max) return(-1);
|
||||
usleep(sleeptime);
|
||||
AssertFatal((rc = pthread_mutex_lock(mutex))==0,"wakeup_thread(): error locking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex);
|
||||
}
|
||||
*instance_cnt = *instance_cnt + 1;
|
||||
|
||||
AssertFatal((rc = pthread_mutex_unlock(mutex))==0,"wakeup_thread(): error unlocking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex);
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(cond) != 0) {
|
||||
LOG_E( PHY, "ERROR pthread_cond_signal\n");
|
||||
@@ -1028,18 +1070,40 @@ static inline int wakeup_thread(pthread_mutex_t *mutex,pthread_cond_t *cond,int
|
||||
return(-1);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(mutex);
|
||||
AssertFatal((rc = pthread_mutex_unlock(mutex))==0,"wakeup_thread(): error unlocking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static inline int timedwait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name,uint32_t time_ns) {
|
||||
int rc;
|
||||
int waitret=0;
|
||||
struct timespec now,abstime;
|
||||
|
||||
AssertFatal((rc = pthread_mutex_lock(mutex))==0,"[SCHED][eNB] timedwait_on_condition(): error locking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex);
|
||||
|
||||
clock_gettime(CLOCK_REALTIME,&now);
|
||||
while (*instance_cnt < 0) {
|
||||
// most of the time the thread is waiting here
|
||||
// proc->instance_cnt_rxtx is -1
|
||||
abstime.tv_sec=now.tv_sec;
|
||||
abstime.tv_nsec = now.tv_nsec + time_ns;
|
||||
if (abstime.tv_nsec >= 1000*1000*1000)
|
||||
{
|
||||
abstime.tv_nsec -= 1000*1000*1000;
|
||||
abstime.tv_sec += 1;
|
||||
}
|
||||
if ((waitret = pthread_cond_timedwait(cond,mutex,&abstime)) == 0) break; // this unlocks mutex_rxtx while waiting and then locks it again
|
||||
}
|
||||
|
||||
AssertFatal((rc = pthread_mutex_unlock(mutex)) == 0,"[SCHED][eNB] timedwait_on_condition(): error unlocking mutex return %d for %s\n", rc, name);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) {
|
||||
int rc;
|
||||
if ((rc = pthread_mutex_lock(mutex)) != 0) {
|
||||
LOG_E(PHY, "[SCHED][eNB] wait_on_condition(): error locking mutex for %s (%d %s, %p)\n",
|
||||
name, rc, strerror(rc), (void *)mutex);
|
||||
exit_fun("nothing to add");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
AssertFatal((rc = pthread_mutex_lock(mutex))==0,"[SCHED][eNB] wait_on_condition(): error locking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex);
|
||||
|
||||
while (*instance_cnt < 0) {
|
||||
// most of the time the thread is waiting here
|
||||
@@ -1047,11 +1111,8 @@ static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,
|
||||
pthread_cond_wait(cond,mutex); // this unlocks mutex_rxtx while waiting and then locks it again
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(mutex) != 0) {
|
||||
LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for %s\n",name);
|
||||
exit_fun("nothing to add");
|
||||
return(-1);
|
||||
}
|
||||
AssertFatal((rc = pthread_mutex_unlock(mutex))==0,"[SCHED][eNB] wait_on_condition(): error unlocking mutex return %d for %s\n", rc, name);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1086,12 +1147,7 @@ static inline int timedwait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *
|
||||
}
|
||||
static inline int wait_on_busy_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) {
|
||||
int rc;
|
||||
if ((rc = pthread_mutex_lock(mutex)) != 0) {
|
||||
LOG_E(PHY, "[SCHED][eNB] wait_on_busy_condition(): error locking mutex for %s (%d %s, %p)\n",
|
||||
name, rc, strerror(rc), (void *)mutex);
|
||||
exit_fun("nothing to add");
|
||||
return(-1);
|
||||
}
|
||||
AssertFatal((rc = pthread_mutex_lock(mutex))==0,"[SCHED][eNB] wait_on_busy_condition(): error locking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex);
|
||||
|
||||
while (*instance_cnt == 0) {
|
||||
// most of the time the thread will skip this
|
||||
@@ -1099,30 +1155,20 @@ static inline int wait_on_busy_condition(pthread_mutex_t *mutex,pthread_cond_t *
|
||||
pthread_cond_wait(cond,mutex); // this unlocks mutex_rxtx while waiting and then locks it again
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(mutex) != 0) {
|
||||
LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for %s\n",name);
|
||||
exit_fun("nothing to add");
|
||||
return(-1);
|
||||
}
|
||||
AssertFatal((rc = pthread_mutex_unlock(mutex))==0,"[SCHED][eNB] wait_on_busy_condition(): error unlocking mutex return %d for %s\n", rc, name);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char *name) {
|
||||
int rc;
|
||||
if ((rc = pthread_mutex_lock(mutex)) != 0) {
|
||||
LOG_E(PHY, "[SCHED][eNB] release_thread(): error locking mutex for %s (%d %s, %p)\n",
|
||||
name, rc, strerror(rc), (void *)mutex);
|
||||
exit_fun("nothing to add");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
AssertFatal((rc = pthread_mutex_lock(mutex))==0,"[SCHED][eNB] release_thread(): error locking mutex for %s (%d %s, %p)\n", name, rc, strerror(rc), (void *)mutex);
|
||||
|
||||
*instance_cnt=-1;
|
||||
|
||||
if (pthread_mutex_unlock(mutex) != 0) {
|
||||
LOG_E( PHY, "[SCHED][eNB] error unlocking mutex for %s\n",name);
|
||||
exit_fun("nothing to add");
|
||||
return(-1);
|
||||
}
|
||||
AssertFatal((rc = pthread_mutex_unlock(mutex))==0,"[SCHED][eNB] release_thread(): error unlocking mutex return %d for %s\n", rc, name);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
+22
-14
@@ -33,9 +33,13 @@
|
||||
#define __PHY_DEFS_ENB__H__
|
||||
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include <execinfo.h>
|
||||
#include <getopt.h>
|
||||
#include <linux/sched.h>
|
||||
#include <malloc.h>
|
||||
#include <math.h>
|
||||
#include <pthread.h>
|
||||
@@ -44,13 +48,11 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/sched.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common_lib.h"
|
||||
#include "msc.h"
|
||||
@@ -67,13 +69,8 @@
|
||||
|
||||
|
||||
#define PBCH_A 24
|
||||
#define NUMBER_OF_SUBBANDS_MAX 13
|
||||
#define NUMBER_OF_HARQ_PID_MAX 8
|
||||
#define MAX_BANDS_PER_RRU 4
|
||||
#define MAX_FRAME_NUMBER 0x400
|
||||
#define MAX_NUM_RU_PER_eNB 64
|
||||
#define MAX_NUM_RX_PRACH_PREAMBLES 4
|
||||
#define MAX_RRU_CONFIG_SIZE 1024
|
||||
|
||||
|
||||
typedef struct {
|
||||
@@ -86,10 +83,8 @@ typedef struct {
|
||||
/// - second index: ? [0..2*ofdm_symbol_size*frame_parms->symbols_per_tti[
|
||||
int32_t **rxdataF;
|
||||
/// \brief holds the transmit data in the frequency domain.
|
||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. //?
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: tx antenna [0..14[ where 14 is the total supported antenna ports.
|
||||
/// - third index: sample [0..]
|
||||
/// - first index: tx antenna [0..14[ where 14 is the total supported antenna ports.
|
||||
/// - second index: sample [0..]
|
||||
int32_t **txdataF;
|
||||
} LTE_eNB_COMMON;
|
||||
|
||||
@@ -313,6 +308,8 @@ typedef struct L1_proc_t_s {
|
||||
#endif
|
||||
// instance count for over-the-air eNB synchronization
|
||||
int instance_cnt_synch;
|
||||
|
||||
|
||||
/// \internal This variable is protected by \ref mutex_asynch_rxtx.
|
||||
int instance_cnt_asynch_rxtx;
|
||||
/// pthread structure for asychronous RX/TX processing thread
|
||||
@@ -369,6 +366,7 @@ typedef struct L1_proc_t_s {
|
||||
/// condition variable for PRACH processing thread BL/CE UEs;
|
||||
pthread_cond_t cond_prach_br;
|
||||
#endif
|
||||
|
||||
/// condition variable for asynch RX/TX thread
|
||||
pthread_cond_t cond_asynch_rxtx;
|
||||
/// mutex for parallel turbo-decoder thread
|
||||
@@ -392,9 +390,13 @@ typedef struct L1_proc_t_s {
|
||||
/// mutex for RU access to eNB processing (PRACH BR)
|
||||
pthread_mutex_t mutex_RU_PRACH_br;
|
||||
/// mask for RUs serving eNB (PDSCH/PUSCH)
|
||||
int RU_mask;
|
||||
int RU_mask[10];
|
||||
/// mask for RUs serving eNB (PDSCH/PUSCH)
|
||||
int RU_mask_tx;
|
||||
/// time measurements for RU arrivals
|
||||
struct timespec t[10];
|
||||
/// Timing statistics (RU_arrivals)
|
||||
time_stats_t ru_arrival_time;
|
||||
/// mask for RUs serving eNB (PRACH)
|
||||
int RU_mask_prach;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
@@ -409,6 +411,8 @@ typedef struct L1_proc_t_s {
|
||||
L1_rxtx_proc_t L1_proc,L1_proc_tx;
|
||||
/// stats thread pthread descriptor
|
||||
pthread_t process_stats_thread;
|
||||
/// for waking up tx procedure
|
||||
RU_proc_t *ru_proc;
|
||||
} L1_proc_t;
|
||||
|
||||
|
||||
@@ -541,6 +545,10 @@ typedef struct PHY_VARS_eNB_s {
|
||||
|
||||
/// mbsfn reference symbols
|
||||
uint32_t lte_gold_mbsfn_table[10][3][42];
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/// mbsfn reference symbols
|
||||
uint32_t lte_gold_mbsfn_khz_1dot25_table[10][150];
|
||||
#endif
|
||||
|
||||
// PRACH energy detection parameters
|
||||
/// Detection threshold for LTE PRACH
|
||||
@@ -717,4 +725,4 @@ typedef struct PHY_VARS_eNB_s {
|
||||
int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240];
|
||||
} PHY_VARS_eNB;
|
||||
|
||||
#endif // __PHY_DEFS_eNB_H__
|
||||
#endif /* __PHY_DEFS_ENB__H__ */
|
||||
|
||||
@@ -415,7 +415,7 @@ typedef struct {
|
||||
/// nprach_CP_Length_r13, for the CP length(unit us) only 66.7 and 266.7 is implemented
|
||||
uint16_t nprach_CP_Length;
|
||||
/// The criterion for UEs to select a NPRACH resource. Up to 2 RSRP threshold values can be signalled. \vr{[1..2]}
|
||||
struct rsrp_ThresholdsNPrachInfoList *rsrp_ThresholdsPrachInfoList;
|
||||
rsrp_ThresholdsNPrachInfoList *rsrp_ThresholdsPrachInfoList;
|
||||
/// NPRACH Parameters List
|
||||
NPRACH_List_NB_IoT_t nprach_ParametersList;
|
||||
|
||||
|
||||
@@ -299,8 +299,16 @@ typedef struct {
|
||||
#define cmax(a,b) ((a>b) ? (a) : (b))
|
||||
#define cmax3(a,b,c) ((cmax(a,b)>c) ? (cmax(a,b)) : (c))
|
||||
#define cmin(a,b) ((a<b) ? (a) : (b))
|
||||
|
||||
#ifdef __cplusplus
|
||||
#ifdef min
|
||||
#undef min
|
||||
#undef max
|
||||
#endif
|
||||
#else
|
||||
#define max(a,b) cmax(a,b)
|
||||
#define min(a,b) cmin(a,b)
|
||||
#endif
|
||||
|
||||
#ifndef malloc16
|
||||
# ifdef __AVX2__
|
||||
|
||||
@@ -122,6 +122,7 @@ void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxt
|
||||
phich->config[phich->num_hi].n_DMRS = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms;
|
||||
phich->num_hi++;
|
||||
AssertFatal(phich->num_hi<32,"Maximum number of phich reached in subframe\n");
|
||||
|
||||
}
|
||||
|
||||
void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
|
||||
|
||||
@@ -860,7 +860,7 @@ dci_detect_mode_t dci_detect_mode_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t
|
||||
uint8_t phich_subframe_to_harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe)
|
||||
{
|
||||
|
||||
//LOG_D(PHY,"phich_subframe_to_harq_pid.c: frame %d, subframe %d\n",frame,subframe);
|
||||
LOG_D(PHY,"phich_subframe_to_harq_pid.c: frame %d, subframe %d\n",frame,subframe);
|
||||
return(subframe2harq_pid(frame_parms,
|
||||
phich_frame2_pusch_frame(frame_parms,frame,subframe),
|
||||
phich_subframe2_pusch_subframe(frame_parms,subframe)));
|
||||
|
||||
@@ -868,7 +868,6 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
uci->rnti,uci->type,SR_payload,frame,subframe,pucch_b0b1[0][0],pucch_b0b1[0][1],pucch_b0b1[1][0],pucch_b0b1[1][1]);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (SR_payload == 1) { // this implements Table 7.3.1 from 36.213
|
||||
if (pucch_b0b1[0][0] == 4) { // there isn't a likely transmission
|
||||
harq_ack[0] = 4; // DTX
|
||||
|
||||
@@ -59,7 +59,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
|
||||
int br_flag
|
||||
#endif
|
||||
) {
|
||||
uint16_t max_preamble[4],max_preamble_energy[4],max_preamble_delay[4];
|
||||
uint16_t max_preamble[4],max_preamble_energy[4],max_preamble_delay[4],avg_preamble_energy[4];
|
||||
uint16_t i;
|
||||
int frame,subframe;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
@@ -106,18 +106,21 @@ void prach_procedures(PHY_VARS_eNB *eNB
|
||||
&max_preamble[0],
|
||||
&max_preamble_energy[0],
|
||||
&max_preamble_delay[0],
|
||||
&avg_preamble_energy[0],
|
||||
frame,
|
||||
0
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,br_flag
|
||||
#endif
|
||||
);
|
||||
LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : BR %d Most likely preamble %d, energy %d dB delay %d (prach_energy counter %d)\n",
|
||||
LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : BR %d Most likely preamble %d, energy %d dB delay %d (prach_energy counter %d), threshold %d, I0 %d\n",
|
||||
frame,subframe,br_flag,
|
||||
max_preamble[0],
|
||||
max_preamble_energy[0]/10,
|
||||
max_preamble_delay[0],
|
||||
eNB->prach_energy_counter);
|
||||
eNB->prach_energy_counter,
|
||||
eNB->measurements.prach_I0+eNB->prach_DTX_threshold,
|
||||
eNB->measurements.prach_I0);
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
|
||||
if (br_flag==1) {
|
||||
@@ -201,7 +204,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
} // max_preamble_energy > prach_I0 + 100
|
||||
else {
|
||||
eNB->measurements.prach_I0 = ((eNB->measurements.prach_I0*900)>>10) + ((max_preamble_energy[0]*124)>>10);
|
||||
eNB->measurements.prach_I0 = ((eNB->measurements.prach_I0*900)>>10) + ((avg_preamble_energy[0]*124)>>10);
|
||||
|
||||
if (frame==0) LOG_I(PHY,"prach_I0 = %d.%d dB\n",eNB->measurements.prach_I0/10,eNB->measurements.prach_I0%10);
|
||||
|
||||
|
||||
+228
-106
@@ -29,6 +29,18 @@
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
/*! \function feptx_prec
|
||||
* \brief Implementation of precoding for beamforming in one eNB
|
||||
* \author TY Hsu, SY Yeh(fdragon), TH Wang(Judy)
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company ISIP@NCTU and Eurecom
|
||||
* \email: tyhsu@cs.nctu.edu.tw,fdragon.cs96g@g2.nctu.edu.tw,Tsu-Han.Wang@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
@@ -37,12 +49,14 @@
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
#include "PHY/LTE_TRANSPORT/if5_tools.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
|
||||
#include "assertions.h"
|
||||
#include "common/utils/system.h"
|
||||
#include "msc.h"
|
||||
@@ -52,18 +66,16 @@
|
||||
extern int oai_exit;
|
||||
|
||||
|
||||
void feptx0(RU_t *ru,int slot) {
|
||||
|
||||
void feptx0(RU_t *ru,
|
||||
int slot)
|
||||
{
|
||||
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
|
||||
//int dummy_tx_b[7680*2] __attribute__((aligned(32)));
|
||||
|
||||
unsigned int aa,slot_offset;
|
||||
int slot_sizeF = (fp->ofdm_symbol_size)*
|
||||
((fp->Ncp==1) ? 6 : 7);
|
||||
int slot_sizeF = (fp->ofdm_symbol_size) * ((fp->Ncp==1) ? 6 : 7);
|
||||
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+slot , 1 );
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+slot , 1 );
|
||||
|
||||
slot_offset = slot*(fp->samples_per_tti>>1);
|
||||
|
||||
@@ -71,19 +83,18 @@ void feptx0(RU_t *ru,int slot) {
|
||||
|
||||
for (aa=0; aa<ru->nb_tx; aa++) {
|
||||
if (fp->Ncp == EXTENDED) PHY_ofdm_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
6,
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
6,
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
else normal_prefix_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
7,
|
||||
fp);
|
||||
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
7,
|
||||
fp);
|
||||
|
||||
/*
|
||||
len = fp->samples_per_tti>>1;
|
||||
|
||||
|
||||
if ((slot_offset+len)>(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti)) {
|
||||
tx_offset = (int)slot_offset;
|
||||
@@ -123,12 +134,13 @@ void feptx0(RU_t *ru,int slot) {
|
||||
}
|
||||
}*/
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(slot&1) , 0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(slot&1), 0);
|
||||
}
|
||||
|
||||
static void *feptx_thread(void *param) {
|
||||
|
||||
RU_t *ru = (RU_t *)param;
|
||||
static void *feptx_thread(void *param)
|
||||
{
|
||||
RU_t *ru = (RU_t *)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
LOG_I(PHY,"thread feptx created \n");
|
||||
@@ -155,12 +167,14 @@ static void *feptx_thread(void *param) {
|
||||
printf("delay in fep wakeup in frame_tx: %d subframe_rx: %d \n",proc->frame_tx,proc->subframe_tx);
|
||||
}*/
|
||||
}
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void feptx_ofdm_2thread(RU_t *ru,int frame,int subframe) {
|
||||
|
||||
void feptx_ofdm_2thread(RU_t *ru,
|
||||
int frame,
|
||||
int subframe)
|
||||
{
|
||||
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
struct timespec wait;
|
||||
@@ -171,7 +185,7 @@ void feptx_ofdm_2thread(RU_t *ru,int frame,int subframe) {
|
||||
|
||||
if (subframe_select(fp,subframe) == SF_UL) return;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
|
||||
|
||||
if (subframe_select(fp,subframe)==SF_DL) {
|
||||
// If this is not an S-subframe
|
||||
@@ -209,36 +223,35 @@ void feptx_ofdm_2thread(RU_t *ru,int frame,int subframe) {
|
||||
stop_meas(&ru->ofdm_mod_wait_stats);
|
||||
/*if(opp_enabled == 1 && ru->ofdm_mod_wait_stats.p_time>30*3000){
|
||||
print_meas_now(&ru->ofdm_mod_wait_stats,"fep wakeup",stderr);
|
||||
printf("delay in feptx wait on codition in frame_rx: %d subframe_rx: %d \n",proc->frame_tx,proc->subframe_tx);
|
||||
printf("delay in feptx wait on condition in frame_rx: %d subframe_rx: %d \n", proc->frame_tx, proc->subframe_tx);
|
||||
}*/
|
||||
|
||||
|
||||
stop_meas(&ru->ofdm_mod_stats);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 0 );
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+ru->idx , 0 );
|
||||
}
|
||||
|
||||
void feptx_ofdm(RU_t *ru, int frame, int subframe)
|
||||
|
||||
void feptx_ofdm(RU_t *ru,
|
||||
int frame,
|
||||
int subframe)
|
||||
{
|
||||
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
|
||||
|
||||
unsigned int aa, slot_offset, slot_offset_F;
|
||||
int dummy_tx_b[7680*4] __attribute__((aligned(32)));
|
||||
int i,j, tx_offset;
|
||||
int slot_sizeF = (fp->ofdm_symbol_size)*
|
||||
((fp->Ncp==1) ? 6 : 7);
|
||||
int i, j, tx_offset;
|
||||
int slot_sizeF = (fp->ofdm_symbol_size) * ((fp->Ncp==1) ? 6 : 7);
|
||||
int len,len2;
|
||||
int16_t *txdata;
|
||||
|
||||
// int CC_id = ru->proc.CC_id;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+ru->idx , 1 );
|
||||
slot_offset_F = 0;
|
||||
|
||||
slot_offset = subframe*fp->samples_per_tti;
|
||||
|
||||
if ((subframe_select(fp,subframe)==SF_DL)||
|
||||
((subframe_select(fp,subframe)==SF_S))) {
|
||||
if ((subframe_select(fp,subframe)==SF_DL)|| ((subframe_select(fp,subframe)==SF_S)))
|
||||
{
|
||||
// LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot);
|
||||
|
||||
start_meas(&ru->ofdm_mod_stats);
|
||||
@@ -354,75 +367,118 @@ void feptx_ofdm(RU_t *ru, int frame, int subframe)
|
||||
dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[aa],2*slot_sizeF)));
|
||||
}
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+ru->idx , 0 );
|
||||
}
|
||||
|
||||
void feptx_prec(RU_t *ru,int frame,int subframe) {
|
||||
|
||||
void feptx_prec(RU_t *ru,
|
||||
int frame,
|
||||
int subframe)
|
||||
{
|
||||
int l,i,aa;
|
||||
PHY_VARS_eNB **eNB_list = ru->eNB_list,*eNB;
|
||||
PHY_VARS_eNB **eNB_list = ru->eNB_list, *eNB;
|
||||
LTE_DL_FRAME_PARMS *fp;
|
||||
int32_t ***bw;
|
||||
|
||||
if (ru->num_eNB == 1) {
|
||||
if (ru->num_eNB == 1)
|
||||
{
|
||||
eNB = eNB_list[0];
|
||||
fp = &eNB->frame_parms;
|
||||
LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[subframe&1];
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 1);
|
||||
if (subframe_select(fp,subframe) == SF_UL) return;
|
||||
|
||||
for (aa=0;aa<ru->nb_tx;aa++)
|
||||
memcpy((void*)ru->common.txdataF_BF[aa],
|
||||
(void*)&eNB->common_vars.txdataF[aa][subframe*fp->symbols_per_tti*fp->ofdm_symbol_size],
|
||||
fp->symbols_per_tti*fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+ru->idx , 1);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0);
|
||||
for (aa=0;aa<ru->nb_tx;aa++) {
|
||||
memset(ru->common.txdataF_BF[aa],0,sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
|
||||
for (int p=0;p<NB_ANTENNA_PORTS_ENB;p++) {
|
||||
if (ru->do_precoding == 0) {
|
||||
if (p==0)
|
||||
memcpy((void*)ru->common.txdataF_BF[aa],
|
||||
(void*)&eNB->common_vars.txdataF[aa][subframe*fp->symbols_per_tti*fp->ofdm_symbol_size],
|
||||
sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
|
||||
} else {
|
||||
if (p<fp->nb_antenna_ports_eNB) {
|
||||
// For the moment this does nothing different than below, except ignore antenna ports 5,7,8.
|
||||
for (l=0;l<pdcch_vars->num_pdcch_symbols;l++)
|
||||
beam_precoding(eNB->common_vars.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
subframe,
|
||||
fp,
|
||||
ru->beam_weights,
|
||||
l,
|
||||
aa,
|
||||
p,
|
||||
eNB->Mod_id);
|
||||
} //if (p<fp->nb_antenna_ports_eNB)
|
||||
|
||||
// PDSCH region
|
||||
if (p<fp->nb_antenna_ports_eNB || p==5 || p==7 || p==8) {
|
||||
for (l=pdcch_vars->num_pdcch_symbols;l<fp->symbols_per_tti;l++) {
|
||||
beam_precoding(eNB->common_vars.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
subframe,
|
||||
fp,
|
||||
ru->beam_weights,
|
||||
l,
|
||||
aa,
|
||||
p,
|
||||
eNB->Mod_id);
|
||||
} // for (l=pdcch_vars ....)
|
||||
} // if (p<fp->nb_antenna_ports_eNB) ...
|
||||
} // ru->do_precoding!=0
|
||||
} // for (p=0...)
|
||||
} // for (aa=0 ...)
|
||||
|
||||
if(ru->idx<2)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+ru->idx , 0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+ru->idx , 0);
|
||||
}
|
||||
else {
|
||||
AssertFatal(1==0,"Handling of multi-L1 case not ready yet\n");
|
||||
for (i=0;i<ru->num_eNB;i++) {
|
||||
eNB = eNB_list[i];
|
||||
fp = &eNB->frame_parms;
|
||||
bw = ru->beam_weights[i];
|
||||
|
||||
for (l=0;l<fp->symbols_per_tti;l++) {
|
||||
for (aa=0;aa<ru->nb_tx;aa++) {
|
||||
beam_precoding(eNB->common_vars.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
fp,
|
||||
bw,
|
||||
subframe<<1,
|
||||
l,
|
||||
aa);
|
||||
}
|
||||
for (aa=0;aa<ru->nb_tx;aa++) {
|
||||
beam_precoding(eNB->common_vars.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
subframe,
|
||||
fp,
|
||||
ru->beam_weights,
|
||||
subframe<<1,
|
||||
l,
|
||||
aa,
|
||||
eNB->Mod_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void fep0(RU_t *ru,int slot) {
|
||||
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
void fep0(RU_t *ru,
|
||||
int slot)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
|
||||
int l;
|
||||
|
||||
// printf("fep0: slot %d\n",slot);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+slot, 1);
|
||||
//printf("fep0: slot %d\n",slot);
|
||||
|
||||
remove_7_5_kHz(ru,(slot&1)+(proc->tti_rx<<1));
|
||||
for (l=0; l<fp->symbols_per_tti/2; l++) {
|
||||
for (int l=0; l<fp->symbols_per_tti/2; l++) {
|
||||
slot_fep_ul(ru,
|
||||
l,
|
||||
(slot&1),
|
||||
0
|
||||
);
|
||||
l,
|
||||
(slot&1),
|
||||
0);
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+slot, 0);
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+slot, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void *fep_thread(void *param) {
|
||||
|
||||
static void *fep_thread(void *param)
|
||||
{
|
||||
RU_t *ru = (RU_t *)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
@@ -431,9 +487,9 @@ static void *fep_thread(void *param) {
|
||||
if (wait_on_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
|
||||
if (oai_exit) break;
|
||||
//stop_meas(&ru->ofdm_demod_wakeup_stats);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 1 );
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 1 );
|
||||
fep0(ru,0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 0 );
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 0 );
|
||||
if (release_thread(&proc->mutex_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
|
||||
|
||||
if (pthread_cond_signal(&proc->cond_fep) != 0) {
|
||||
@@ -446,13 +502,12 @@ static void *fep_thread(void *param) {
|
||||
printf("delay in fep wakeup in frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->subframe_rx);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void init_feptx_thread(RU_t *ru, pthread_attr_t *attr_feptx)
|
||||
|
||||
void init_feptx_thread(RU_t *ru,
|
||||
pthread_attr_t *attr_feptx)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
@@ -464,7 +519,9 @@ void init_feptx_thread(RU_t *ru, pthread_attr_t *attr_feptx)
|
||||
threadCreate(&proc->pthread_feptx, feptx_thread, (void*)ru, "feptx", -1, OAI_PRIORITY_RT);
|
||||
}
|
||||
|
||||
void init_fep_thread(RU_t *ru, pthread_attr_t *attr_fep)
|
||||
|
||||
void init_fep_thread(RU_t *ru,
|
||||
pthread_attr_t *attr_fep)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
@@ -476,6 +533,7 @@ void init_fep_thread(RU_t *ru, pthread_attr_t *attr_fep)
|
||||
threadCreate(&proc->pthread_fep, fep_thread, (void*)ru, "fep", -1, OAI_PRIORITY_RT);
|
||||
}
|
||||
|
||||
|
||||
extern void kill_fep_thread(RU_t *ru)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
@@ -489,6 +547,7 @@ extern void kill_fep_thread(RU_t *ru)
|
||||
pthread_cond_destroy( &proc->cond_fep );
|
||||
}
|
||||
|
||||
|
||||
extern void kill_feptx_thread(RU_t *ru)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
@@ -502,23 +561,27 @@ extern void kill_feptx_thread(RU_t *ru)
|
||||
pthread_cond_destroy( &proc->cond_feptx );
|
||||
}
|
||||
|
||||
void ru_fep_full_2thread(RU_t *ru, int subframe) {
|
||||
|
||||
void ru_fep_full_2thread(RU_t *ru,
|
||||
int subframe)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
//PHY_VARS_eNB *eNB = RC.eNB[0][0];
|
||||
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
|
||||
RU_CALIBRATION *calibration = &ru->calibration;
|
||||
RRU_CONFIG_msg_t rru_config_msg;
|
||||
int check_sync_pos;
|
||||
|
||||
struct timespec wait;
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
|
||||
|
||||
if ((fp->frame_type == TDD) &&
|
||||
(subframe_select(fp,subframe) != SF_UL)) return;
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe) != SF_UL)) return;
|
||||
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
|
||||
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+ru->idx, 1 );
|
||||
start_meas(&ru->ofdm_demod_stats);
|
||||
|
||||
if (pthread_mutex_timedlock(&proc->mutex_fep,&wait) != 0) {
|
||||
@@ -536,7 +599,6 @@ void ru_fep_full_2thread(RU_t *ru, int subframe) {
|
||||
|
||||
++proc->instance_cnt_fep;
|
||||
|
||||
|
||||
if (pthread_cond_signal(&proc->cond_fep) != 0) {
|
||||
printf("[RU] ERROR pthread_cond_signal for fep thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
@@ -554,17 +616,82 @@ void ru_fep_full_2thread(RU_t *ru, int subframe) {
|
||||
stop_meas(&ru->ofdm_demod_wait_stats);
|
||||
if(opp_enabled == 1 && ru->ofdm_demod_wakeup_stats.p_time>30*3000){
|
||||
print_meas_now(&ru->ofdm_demod_wakeup_stats,"fep wakeup",stderr);
|
||||
printf("delay in fep wait on codition in frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->tti_rx);
|
||||
printf("delay in fep wait on condition in frame_rx: %d subframe_rx: %d \n", proc->frame_rx, proc->tti_rx);
|
||||
}
|
||||
|
||||
if (proc->tti_rx/*proc->subframe_rx*/==1 && ru->is_slave==1/* && ru->state == RU_CHECK_SYNC*/)
|
||||
{
|
||||
//LOG_I(PHY,"Running check synchronization procedure for frame %d\n", proc->frame_rx);
|
||||
ulsch_extract_rbs_single(ru->common.rxdataF,
|
||||
calibration->rxdataF_ext,
|
||||
0,
|
||||
fp->N_RB_DL,
|
||||
3%(fp->symbols_per_tti/2),// l = symbol within slot
|
||||
3/(fp->symbols_per_tti/2),// Ns = slot number
|
||||
fp);
|
||||
|
||||
/*lte_ul_channel_estimation((PHY_VARS_eNB *)NULL,
|
||||
proc,
|
||||
ru->idx,
|
||||
3%(fp->symbols_per_tti/2),
|
||||
3/(fp->symbols_per_tti/2));
|
||||
*/
|
||||
lte_ul_channel_estimation_RRU(fp,
|
||||
calibration->drs_ch_estimates,
|
||||
calibration->drs_ch_estimates_time,
|
||||
calibration->rxdataF_ext,
|
||||
fp->N_RB_DL, //N_rb_alloc,
|
||||
proc->frame_rx,
|
||||
proc->tti_rx,//proc->subframe_rx,
|
||||
0,//u = 0..29
|
||||
0,//v = 0,1
|
||||
/*eNB->ulsch[ru->idx]->cyclicShift,cyclic_shift,0..7*/0,
|
||||
3,//l,
|
||||
0,//interpolate,
|
||||
0 /*eNB->ulsch[ru->idx]->rnti rnti or ru->ulsch[eNB_id]->rnti*/);
|
||||
|
||||
check_sync_pos = lte_est_timing_advance_pusch((PHY_VARS_eNB *)NULL, ru->idx);
|
||||
if (ru->state == RU_CHECK_SYNC) {
|
||||
if ((check_sync_pos >= 0 && check_sync_pos<8) || (check_sync_pos < 0 && check_sync_pos>-8)) {
|
||||
LOG_I(PHY,"~~~~~~~~~~~ check_sync_pos %d, frame %d, cnt %d\n",check_sync_pos,proc->frame_rx,ru->wait_check);
|
||||
ru->wait_check++;
|
||||
}
|
||||
|
||||
if (ru->wait_check==20) {
|
||||
ru->state = RU_RUN;
|
||||
ru->wait_check = 0;
|
||||
// Send RRU_sync_ok
|
||||
rru_config_msg.type = RRU_sync_ok;
|
||||
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t); // TODO: set to correct msg len
|
||||
LOG_I(PHY,"Sending RRU_sync_ok to RAU\n");
|
||||
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),"Failed to send msg to RAU %d\n",ru->idx);
|
||||
//LOG_I(PHY,"~~~~~~~~~ RU_RUN\n");
|
||||
/*LOG_M("dmrs_time.m","dmrstime",calibration->drs_ch_estimates_time[0], (fp->ofdm_symbol_size),1,1);
|
||||
LOG_M("rxdataF_ext.m","rxdataFext",&calibration->rxdataF_ext[0][36*fp->N_RB_DL], 12*(fp->N_RB_DL),1,1);
|
||||
LOG_M("drs_seq0.m","drsseq0",ul_ref_sigs_rx[0][0][23],600,1,1);
|
||||
LOG_M("rxdata.m","rxdata",&ru->common.rxdata[0][0], fp->samples_per_tti*2,1,1);
|
||||
exit(-1);*/
|
||||
}
|
||||
} else if (ru->state == RU_RUN) {
|
||||
// check for synchronization error
|
||||
if (check_sync_pos >= 8 || check_sync_pos<=-8) {
|
||||
LOG_E(PHY,"~~~~~~~~~~~~~~ check_sync_pos %d, frame %d ---> LOST SYNC-EXIT\n", check_sync_pos, proc->frame_rx);
|
||||
LOG_M("rxdata.m","rxdata",&ru->common.rxdata[0][0], fp->samples_per_tti*2,1,1);
|
||||
exit(-1);
|
||||
}
|
||||
} else {
|
||||
AssertFatal(1==0,"Should not get here\n");
|
||||
}
|
||||
}
|
||||
|
||||
stop_meas(&ru->ofdm_demod_stats);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+ru->idx, 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void fep_full(RU_t *ru,int subframe) {
|
||||
|
||||
void fep_full(RU_t *ru,
|
||||
int subframe)
|
||||
{
|
||||
int l;
|
||||
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
|
||||
|
||||
@@ -572,32 +699,28 @@ void fep_full(RU_t *ru,int subframe) {
|
||||
(subframe_select(fp,subframe) != SF_UL)) return;
|
||||
|
||||
start_meas(&ru->ofdm_demod_stats);
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+ru->idx, 1 );
|
||||
|
||||
remove_7_5_kHz(ru,subframe<<1);
|
||||
remove_7_5_kHz(ru,1+(subframe<<1));
|
||||
|
||||
for (l=0; l<fp->symbols_per_tti/2; l++) {
|
||||
slot_fep_ul(ru,
|
||||
l,
|
||||
0,
|
||||
0
|
||||
);
|
||||
l,
|
||||
0,
|
||||
0);
|
||||
slot_fep_ul(ru,
|
||||
l,
|
||||
1,
|
||||
0
|
||||
);
|
||||
l,
|
||||
1,
|
||||
0);
|
||||
}
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 );
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+ru->idx, 0 );
|
||||
stop_meas(&ru->ofdm_demod_stats);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void do_prach_ru(RU_t *ru) {
|
||||
|
||||
void do_prach_ru(RU_t *ru)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
|
||||
|
||||
@@ -633,5 +756,4 @@ void do_prach_ru(RU_t *ru) {
|
||||
|
||||
pthread_mutex_unlock( &proc->mutex_prach );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,16 +19,17 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file phy_procedures_lte_ue.c
|
||||
* \brief Implementation of UE procedures from 36.213 LTE specifications
|
||||
* \author R. Knopp, F. Kaltenberger, N. Nikaein
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
/*! \file phy_procedures_lte_ue.c
|
||||
* \brief Implementation of UE procedures from 36.213 LTE specifications / This includes FeMBMS UE procedures from 36.213 v14.2.0 specification
|
||||
* \author R. Knopp, F. Kaltenberger, N. Nikaein, J. Morgade
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr, javier.morgad
|
||||
e@ieee.org
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
@@ -1736,6 +1737,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,
|
||||
for (aa=0; aa<1/*frame_parms->nb_antennas_tx*/; aa++)
|
||||
generate_drs_pusch(ue,
|
||||
proc,
|
||||
(LTE_DL_FRAME_PARMS *)NULL,
|
||||
(int32_t**)NULL,
|
||||
eNB_id,
|
||||
tx_amp,
|
||||
subframe_tx,
|
||||
@@ -2411,7 +2414,19 @@ void ue_pbch_procedures(uint8_t eNB_id,
|
||||
for (pbch_trials=0; pbch_trials<4; pbch_trials++) {
|
||||
//for (pbch_phase=0;pbch_phase<4;pbch_phase++) {
|
||||
//LOG_I(PHY,"[UE %d] Frame %d, Trying PBCH %d (NidCell %d, eNB_id %d)\n",ue->Mod_id,frame_rx,pbch_phase,ue->frame_parms.Nid_cell,eNB_id);
|
||||
pbch_tx_ant = rx_pbch(&ue->common_vars,
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if(is_fembms_cas_subframe(frame_rx,subframe_rx,&ue->frame_parms)){
|
||||
pbch_tx_ant = rx_pbch_fembms(&ue->common_vars,
|
||||
ue->pbch_vars[eNB_id],
|
||||
&ue->frame_parms,
|
||||
eNB_id,
|
||||
ue->frame_parms.nb_antenna_ports_eNB==1?SISO:ALAMOUTI,
|
||||
ue->high_speed_flag,
|
||||
pbch_phase);
|
||||
|
||||
}else
|
||||
#endif
|
||||
pbch_tx_ant = rx_pbch(&ue->common_vars,
|
||||
ue->pbch_vars[eNB_id],
|
||||
&ue->frame_parms,
|
||||
eNB_id,
|
||||
@@ -2447,10 +2462,22 @@ void ue_pbch_procedures(uint8_t eNB_id,
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ue->pbch_vars[eNB_id]->pdu_errors_conseq = 0;
|
||||
frame_tx = (((int)(ue->pbch_vars[eNB_id]->decoded_output[2]&0x03))<<8);
|
||||
frame_tx += ((int)(ue->pbch_vars[eNB_id]->decoded_output[1]&0xfc));
|
||||
frame_tx += pbch_phase;
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if(is_fembms_cas_subframe(frame_rx,subframe_rx,&ue->frame_parms)){
|
||||
frame_tx = (int)((ue->pbch_vars[eNB_id]->decoded_output[2]&31)<<1);
|
||||
frame_tx += ue->pbch_vars[eNB_id]->decoded_output[1]>>7;
|
||||
frame_tx +=4*pbch_phase;
|
||||
}else{
|
||||
#endif
|
||||
frame_tx = (((int)(ue->pbch_vars[eNB_id]->decoded_output[2]&0x03))<<8);
|
||||
frame_tx += ((int)(ue->pbch_vars[eNB_id]->decoded_output[1]&0xfc));
|
||||
frame_tx += pbch_phase;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ue->mac_enabled==1) {
|
||||
dl_phy_sync_success(ue->Mod_id,frame_rx,eNB_id,
|
||||
@@ -2698,7 +2725,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,
|
||||
LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Problem in DCI!\n",ue->Mod_id,frame_rx,subframe_rx);
|
||||
dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
|
||||
}
|
||||
} else if ((dci_alloc_rx[i].rnti == SI_RNTI) &&
|
||||
} else if ((dci_alloc_rx[i].rnti == SI_RNTI /*|| dci_alloc_rx[i].rnti == 0xfff9*/) &&
|
||||
((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) {
|
||||
if (LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) {
|
||||
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);
|
||||
@@ -2707,6 +2734,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,
|
||||
if (generate_ue_dlsch_params_from_dci(frame_rx,
|
||||
subframe_rx,
|
||||
(void *)&dci_alloc_rx[i].dci_pdu,
|
||||
//dci_alloc_rx[i].rnti,//SI_RNTI (to enable MBMS dedicated SI-RNTI = 0xfff9
|
||||
SI_RNTI,
|
||||
dci_alloc_rx[i].format,
|
||||
ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id],
|
||||
@@ -2875,10 +2903,13 @@ int ue_pdcch_procedures(uint8_t eNB_id,
|
||||
|
||||
|
||||
void ue_pmch_procedures(PHY_VARS_UE *ue,
|
||||
UE_rxtx_proc_t *proc,
|
||||
UE_rxtx_proc_t *proc,
|
||||
int eNB_id,
|
||||
int abstraction_flag)
|
||||
{
|
||||
int abstraction_flag
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
, uint8_t fembms_flag
|
||||
#endif
|
||||
) {
|
||||
int subframe_rx = proc->subframe_rx;
|
||||
int frame_rx = proc->frame_rx;
|
||||
int pmch_mcs=-1;
|
||||
@@ -2910,30 +2941,72 @@ void ue_pmch_procedures(PHY_VARS_UE *ue,
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Programming PMCH demodulation for mcs %d\n",ue->Mod_id,frame_rx,subframe_rx,pmch_mcs);
|
||||
fill_UE_dlsch_MCH(ue,pmch_mcs,1,0,0);
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if(fembms_flag /*subframe_rx == 3 || subframe_rx == 2*/){
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN_KHZ_1DOT25, VCD_FUNCTION_IN);
|
||||
slot_fep_mbsfn_khz_1dot25(ue,subframe_rx,0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN_KHZ_1DOT25, VCD_FUNCTION_OUT);
|
||||
}
|
||||
else{
|
||||
#endif
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN, VCD_FUNCTION_IN);
|
||||
for (l=2; l<12; l++) {
|
||||
slot_fep_mbsfn(ue,
|
||||
l,
|
||||
subframe_rx,
|
||||
0,0);//ue->rx_offset,0);
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN, VCD_FUNCTION_OUT);
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if(fembms_flag /*subframe_rx == 3 || subframe_rx == 2*/){
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH_KHZ_1DOT25, VCD_FUNCTION_IN);
|
||||
rx_pmch_khz_1dot25(ue,0,subframe_rx,pmch_mcs);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH_KHZ_1DOT25, VCD_FUNCTION_OUT);
|
||||
|
||||
}
|
||||
else{
|
||||
#endif
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH, VCD_FUNCTION_IN);
|
||||
for (l=2; l<12; l++) {
|
||||
rx_pmch(ue,
|
||||
0,
|
||||
subframe_rx,
|
||||
l);
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH, VCD_FUNCTION_OUT);
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
}
|
||||
#endif
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_DECODING, VCD_FUNCTION_IN);
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->Qm = get_Qm(pmch_mcs);
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->G = get_G(&ue->frame_parms,
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->nb_rb,
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->rb_alloc_even,
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->Qm,
|
||||
1,
|
||||
2,
|
||||
frame_rx,
|
||||
subframe_rx,
|
||||
0);
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if(fembms_flag /*subframe_rx == 3 || subframe_rx == 2*/)
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->G = get_G_khz_1dot25(&ue->frame_parms,
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->nb_rb,
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->rb_alloc_even,
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->Qm,
|
||||
1,
|
||||
2,
|
||||
frame_rx,
|
||||
subframe_rx,
|
||||
0);
|
||||
else
|
||||
#endif
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->G = get_G(&ue->frame_parms,
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->nb_rb,
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->rb_alloc_even,
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->Qm,
|
||||
1,
|
||||
2,
|
||||
frame_rx,
|
||||
subframe_rx,
|
||||
0);
|
||||
|
||||
dlsch_unscrambling(&ue->frame_parms,1,ue->dlsch_MCH[0],
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->G,
|
||||
ue->pdsch_vars_MCH[0]->llr[0],0,subframe_rx<<1);
|
||||
@@ -2952,6 +3025,7 @@ void ue_pmch_procedures(PHY_VARS_UE *ue,
|
||||
subframe_rx,
|
||||
0,
|
||||
0,1);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_DECODING, VCD_FUNCTION_OUT);
|
||||
|
||||
if (mcch_active == 1)
|
||||
ue->dlsch_mcch_trials[sync_area][0]++;
|
||||
@@ -2964,7 +3038,7 @@ void ue_pmch_procedures(PHY_VARS_UE *ue,
|
||||
else
|
||||
ue->dlsch_mtch_errors[sync_area][0]++;
|
||||
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: PMCH in error (%d,%d), not passing to L2 (TBS %d, iter %d,G %d)\n",
|
||||
LOG_E(PHY,"[UE %d] Frame %d, subframe %d: PMCH in error (%d,%d), not passing to L2 (TBS %d, iter %d,G %d)\n",
|
||||
ue->Mod_id,
|
||||
frame_rx,subframe_rx,
|
||||
ue->dlsch_mcch_errors[sync_area][0],
|
||||
@@ -2973,6 +3047,10 @@ void ue_pmch_procedures(PHY_VARS_UE *ue,
|
||||
ue->dlsch_MCH[0]->max_turbo_iterations,
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->G);
|
||||
// dump_mch(ue,0,ue->dlsch_MCH[0]->harq_processes[0]->G,subframe_rx);
|
||||
//if(subframe_rx == 3){
|
||||
//dump_mch(ue,0,ue->dlsch_MCH[0]->harq_processes[0]->G,subframe_rx);
|
||||
//exit_fun("nothing to add");
|
||||
//}
|
||||
|
||||
if (LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) {
|
||||
for (int i=0; i<ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3; i++) {
|
||||
@@ -2986,6 +3064,15 @@ void ue_pmch_procedures(PHY_VARS_UE *ue,
|
||||
// mac_xface->macphy_exit("Why are we exiting here?");
|
||||
} else { // decoding successful
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: PMCH OK (%d,%d), passing to L2 (TBS %d, iter %d,G %d)\n",
|
||||
ue->Mod_id,
|
||||
frame_rx,subframe_rx,
|
||||
ue->dlsch_mcch_errors[sync_area][0],
|
||||
ue->dlsch_mtch_errors[sync_area][0],
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3,
|
||||
ue->dlsch_MCH[0]->max_turbo_iterations,
|
||||
ue->dlsch_MCH[0]->harq_processes[0]->G);
|
||||
|
||||
ue_send_mch_sdu(ue->Mod_id,
|
||||
CC_id,
|
||||
frame_rx,
|
||||
@@ -3489,12 +3576,31 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
|
||||
break;
|
||||
|
||||
case SI_PDSCH:
|
||||
ue_decode_si(ue->Mod_id,
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if(subframe_rx == 0) {
|
||||
ue_decode_si_mbms(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);
|
||||
|
||||
} else {
|
||||
ue_decode_si(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);
|
||||
}
|
||||
#else
|
||||
ue_decode_si(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);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case P_PDSCH:
|
||||
@@ -4386,7 +4492,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,
|
||||
|
||||
// start timers
|
||||
if ( LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) {
|
||||
LOG_I(PHY," ****** start RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx);
|
||||
LOG_I(PHY," ****** start RX-Chain for AbsSubframe->0 %d.%d ****** \n", frame_rx%1024, subframe_rx);
|
||||
}
|
||||
|
||||
if(LOG_DEBUGFLAG(UE_TIMING)) {
|
||||
@@ -4394,6 +4500,15 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,
|
||||
start_meas(&ue->ue_front_end_stat[ue->current_thread_id[subframe_rx]]);
|
||||
}
|
||||
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if(is_fembms_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms)){
|
||||
ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag,1);
|
||||
return 0;
|
||||
}else{ // this gets closed at end
|
||||
#endif
|
||||
|
||||
|
||||
pmch_flag = is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms) ? 1 : 0;
|
||||
|
||||
if (do_pdcch_flag) {
|
||||
@@ -4497,7 +4612,11 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,
|
||||
|
||||
// If this is PMCH, call procedures, do channel estimation for first symbol of next DL subframe and return
|
||||
if (pmch_flag == 1) {
|
||||
ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag);
|
||||
ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,0
|
||||
#endif
|
||||
);
|
||||
int next_subframe_rx = (1+subframe_rx)%10;
|
||||
|
||||
if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) {
|
||||
@@ -4786,6 +4905,10 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,
|
||||
ue->dlsch_ra[eNB_id]->active = 0;
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
} // This commes from feMBMS subframe filtering !
|
||||
#endif
|
||||
|
||||
// duplicate harq structure
|
||||
uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid;
|
||||
LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[current_harq_pid];
|
||||
|
||||
@@ -81,7 +81,7 @@ static int tun_alloc(char *dev) {
|
||||
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
|
||||
|
||||
if( *dev )
|
||||
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
|
||||
strncpy(ifr.ifr_name, dev, sizeof(ifr.ifr_name)-1);
|
||||
|
||||
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ) {
|
||||
close(fd);
|
||||
|
||||
@@ -911,7 +911,6 @@ int main(int argc, char **argv) {
|
||||
|
||||
if (help)
|
||||
exit(0);
|
||||
|
||||
if (thread_struct.parallel_conf != PARALLEL_SINGLE_THREAD)
|
||||
set_worker_conf("WORKER_ENABLE");
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@ void ue_decode_p(module_id_t module_idP, int CC_id, frame_t frame,
|
||||
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_si_mbms(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,
|
||||
sub_frame_t subframe, uint8_t * sdu, uint16_t sdu_len,
|
||||
uint8_t CH_index){}
|
||||
|
||||
@@ -737,9 +737,9 @@ int main(int argc, char **argv) {
|
||||
printf("ULSCH %p\n",UE->ulsch[0]);
|
||||
|
||||
if(get_thread_worker_conf() == WORKER_ENABLE) {
|
||||
extern void init_fep_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_fep_thread(RU_t *, pthread_attr_t *);
|
||||
extern void init_td_thread(PHY_VARS_eNB *);
|
||||
init_fep_thread(eNB,NULL);
|
||||
init_fep_thread(ru,NULL);
|
||||
init_td_thread(eNB);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
#include <stdio.h>
|
||||
#include "PHY/TOOLS/tools_defs.h"
|
||||
#include "rf.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
|
||||
void dac(double *s_re[2],
|
||||
double *s_im[2],
|
||||
int32_t **input,
|
||||
@@ -56,7 +59,7 @@ void dac(double *s_re[2],
|
||||
|
||||
V /= (meas_length);
|
||||
#ifdef DEBUG_DAC
|
||||
printf("DAC: 10*log10(V)=%f (%f)\n",10*log10(V),V);
|
||||
LOG_I(OCM,"DAC: 10*log10(V)=%f (%f)\n",10*log10(V),V);
|
||||
#endif
|
||||
|
||||
if (V) {
|
||||
@@ -73,7 +76,7 @@ void dac(double *s_re[2],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
double dac_fixed_gain(double *s_re[2],
|
||||
double *s_im[2],
|
||||
int32_t **input,
|
||||
@@ -107,21 +110,20 @@ double dac_fixed_gain(double *s_re[2],
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_DAC
|
||||
LOG_I(OCM,"DAC: amp %f, amp1 %f dB (%d,%d), tx_power target %f (actual %f %f),length %d,pos %d\n",
|
||||
20*log10(amp),
|
||||
20*log10(*amp1p),
|
||||
input_offset,
|
||||
input_offset_meas,
|
||||
txpwr_dBm,
|
||||
10*log10((double)signal_energy((int32_t*)&input[0][input_offset_meas],length_meas)/NB_RE),
|
||||
10*log10((double)signal_energy((int32_t*)&input[1][input_offset_meas],length_meas)/NB_RE),
|
||||
length,
|
||||
input_offset_meas);
|
||||
|
||||
// printf("DAC: amp %f, amp1 %f dB (%d,%d), tx_power %f (%f),length %d,pos %d\n",20*log10(amp),20*log10(*amp1p),input_offset,input_offset_meas,txpwr_dBm,length, 10*log10((double)signal_energy((int32_t*)&input[0][input_offset_meas],length_meas)/NB_RE),input_offset_meas);
|
||||
#endif
|
||||
|
||||
/*
|
||||
if (nb_tx_antennas==2)
|
||||
amp1 = AMP/2;
|
||||
else if (nb_tx_antennas==4)
|
||||
amp1 = ((AMP*ONE_OVER_SQRT2_Q15)>>16);
|
||||
else //assume (nb_tx_antennas==1)
|
||||
amp1 = ((AMP*ONE_OVER_SQRT2_Q15)>>15);
|
||||
amp1 = amp1*sqrt(512.0/300.0); //account for loss due to null carriers
|
||||
//printf("DL: amp1 %f dB (%d,%d), tx_power %f\n",20*log10(amp1),input_offset,input_offset_meas,txpwr_dBm);
|
||||
*/
|
||||
|
||||
// printf("DAC: amp/amp1p %f amp1 %f dB (%d,%d), tx_power %f\n",amp/(*amp1p),20*log10(*amp1p),input_offset,input_offset_meas,txpwr_dBm);
|
||||
for (i=0; i<length; i++) {
|
||||
for (aa=0; aa<nb_tx_antennas; aa++) {
|
||||
s_re[aa][i] = amp*((double)(((short *)input[aa]))[((i+input_offset)<<1)])/(*amp1p);
|
||||
@@ -129,7 +131,8 @@ double dac_fixed_gain(double *s_re[2],
|
||||
}
|
||||
}
|
||||
|
||||
// printf("ener %e\n",signal_energy_fp(s_re,s_im,nb_tx_antennas,length<length_meas?length:length_meas,0));
|
||||
|
||||
#ifdef DEBUG_DAC
|
||||
LOG_I(OCM,"ener %e\n",signal_energy_fp(s_re,s_im,nb_tx_antennas,length<length_meas?length:length_meas,0));
|
||||
#endif
|
||||
return(signal_energy_fp(s_re,s_im,nb_tx_antennas,length<length_meas?length:length_meas,0)/NB_RE);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
#define RF
|
||||
|
||||
//#define DEBUG_SIM 1
|
||||
|
||||
|
||||
|
||||
@@ -116,7 +117,8 @@ void do_DL_sig(sim_t *sim,
|
||||
|
||||
// sf_offset = (subframe*frame_parms->samples_per_tti) + offset;
|
||||
sf_offset = (subframe*frame_parms->samples_per_tti);
|
||||
LOG_D(OCM,">>>>>>>>>>>>>>>>>TXPATH: RU %d : DL_sig reading TX for subframe %d (sf_offset %d, length %d) from %p\n",ru_id,subframe,sf_offset,length,txdata[0]+sf_offset);
|
||||
for (int aid=0;aid<RC.ru[ru_id]->nb_tx;aid++)
|
||||
LOG_D(OCM,">>>>>>>>>>>>>>>>>TXPATH: RU %d : DL_sig reading TX%d for subframe %d (sf_offset %d, length %d) from %p\n",ru_id,aid,subframe,sf_offset,length,txdata[0]+sf_offset);
|
||||
int length_meas = frame_parms->ofdm_symbol_size;
|
||||
if (sf_offset+length <= frame_parms->samples_per_tti*10) {
|
||||
|
||||
@@ -165,8 +167,9 @@ void do_DL_sig(sim_t *sim,
|
||||
frame_parms->N_RB_DL*12);
|
||||
}
|
||||
#ifdef DEBUG_SIM
|
||||
LOG_D(OCM,"[SIM][DL] subframe %d: txp (time) %d dB\n",
|
||||
subframe,dB_fixed(signal_energy(&txdata[0][sf_offset],length_meas)));
|
||||
for (int aid=0;aid<RC.ru[ru_id]->nb_tx;aid++)
|
||||
LOG_D(OCM,"[SIM][DL] subframe %d: txp%d (time) %d dB\n",
|
||||
subframe,aid,dB_fixed(signal_energy(&txdata[aid][sf_offset],length_meas)));
|
||||
|
||||
LOG_D(OCM,"[SIM][DL] RU %d (CCid %d): tx_pwr %.1f dBm/RE (target %d dBm/RE), for subframe %d\n",
|
||||
ru_id,CC_id,
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "sim.h"
|
||||
|
||||
//#define DEBUG_CH
|
||||
|
||||
uint8_t multipath_channel_nosigconv(channel_desc_t *desc)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user