updated unitary simulations and corrected bugs in threading and scheduling of L1 procedures.
This commit is contained in:
+15
-16
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include "PHY/defs.h"
|
#include "PHY/defs.h"
|
||||||
|
|
||||||
#ifdef OPENAIR_LTE
|
|
||||||
#include "SystemInformationBlockType2.h"
|
#include "SystemInformationBlockType2.h"
|
||||||
//#include "RadioResourceConfigCommonSIB.h"
|
//#include "RadioResourceConfigCommonSIB.h"
|
||||||
#include "RadioResourceConfigDedicated.h"
|
#include "RadioResourceConfigDedicated.h"
|
||||||
@@ -41,18 +41,6 @@
|
|||||||
#ifdef Rel10
|
#ifdef Rel10
|
||||||
#include "SCellToAddMod-r10.h"
|
#include "SCellToAddMod-r10.h"
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
|
|
||||||
/**
|
|
||||||
\fn int phy_init(unsigned char nb_antennas_tx)
|
|
||||||
\brief Allocate and Initialize the PHY variables after receiving static configuration
|
|
||||||
@param nb_antennas_tx Number of TX antennas
|
|
||||||
*/
|
|
||||||
int phy_init(unsigned char nb_antennas_tx);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef OPENAIR_LTE
|
|
||||||
|
|
||||||
/** @addtogroup _PHY_STRUCTURES_
|
/** @addtogroup _PHY_STRUCTURES_
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
@@ -325,17 +313,28 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
|
|||||||
int CC_id);
|
int CC_id);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*! !\fn void phy_cleanup(void)
|
/*! !\fn void phy_cleanup(void)
|
||||||
\brief Cleanup the PHY variables*/
|
\brief Cleanup the PHY variables*/
|
||||||
void phy_cleanup(void);
|
void phy_cleanup(void);
|
||||||
|
|
||||||
#ifdef OPENAIR_LTE
|
|
||||||
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
|
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
|
||||||
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
|
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
|
||||||
#endif
|
|
||||||
|
void lte_param_init(unsigned char N_tx,
|
||||||
|
unsigned char N_rx,
|
||||||
|
unsigned char transmission_mode,
|
||||||
|
uint8_t extended_prefix_flag,
|
||||||
|
frame_t frame_type,
|
||||||
|
uint16_t Nid_cell,
|
||||||
|
uint8_t tdd_config,
|
||||||
|
uint8_t N_RB_DL,
|
||||||
|
uint8_t threequarter_fs,
|
||||||
|
uint8_t osf,
|
||||||
|
uint32_t perfect_ce);
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
|
|||||||
//int32_t rx_total_gain_eNB_dB = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
|
//int32_t rx_total_gain_eNB_dB = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
LOG_D(PHY,"[eNB%d] CCid %d Frame %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc[0].frame_tx);
|
LOG_D(PHY,"[eNB%d] CCid %d Frame %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc.frame_tx);
|
||||||
|
|
||||||
frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
|
frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
|
||||||
LOG_D(PHY,"prach_config_common.rootSequenceIndex = %d\n",frame_parms->prach_config_common.rootSequenceIndex );
|
LOG_D(PHY,"prach_config_common.rootSequenceIndex = %d\n",frame_parms->prach_config_common.rootSequenceIndex );
|
||||||
@@ -388,7 +388,7 @@ void phy_config_sib13_eNB(uint8_t Mod_id,int CC_id,int mbsfn_Area_idx,
|
|||||||
LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
|
LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
|
||||||
|
|
||||||
|
|
||||||
LOG_I(PHY,"[eNB%d] Frame %d: Applying MBSFN_Area_id %d for index %d\n",Mod_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc[0].frame_tx,mbsfn_AreaId_r9,mbsfn_Area_idx);
|
LOG_I(PHY,"[eNB%d] Frame %d: Applying MBSFN_Area_id %d for index %d\n",Mod_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc.frame_tx,mbsfn_AreaId_r9,mbsfn_Area_idx);
|
||||||
|
|
||||||
if (mbsfn_Area_idx == 0) {
|
if (mbsfn_Area_idx == 0) {
|
||||||
frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
|
frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
|
||||||
@@ -409,7 +409,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
|
|||||||
physicalConfigDedicated = eNB->physicalConfigDedicated[UE_id];
|
physicalConfigDedicated = eNB->physicalConfigDedicated[UE_id];
|
||||||
|
|
||||||
if (physicalConfigDedicated != NULL) {
|
if (physicalConfigDedicated != NULL) {
|
||||||
LOG_I(PHY,"[eNB %d] Frame %d: Sent physicalConfigDedicated=%p for UE %d\n",eNB->Mod_id, eNB->proc[0].frame_tx,physicalConfigDedicated,UE_id);
|
LOG_I(PHY,"[eNB %d] Frame %d: Sent physicalConfigDedicated=%p for UE %d\n",eNB->Mod_id, eNB->proc.frame_tx,physicalConfigDedicated,UE_id);
|
||||||
LOG_D(PHY,"------------------------------------------------------------------------\n");
|
LOG_D(PHY,"------------------------------------------------------------------------\n");
|
||||||
|
|
||||||
if (physicalConfigDedicated->pdsch_ConfigDedicated) {
|
if (physicalConfigDedicated->pdsch_ConfigDedicated) {
|
||||||
@@ -644,7 +644,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
|
|||||||
int8_t UE_id = find_ue(rnti,eNB);
|
int8_t UE_id = find_ue(rnti,eNB);
|
||||||
|
|
||||||
if (UE_id == -1) {
|
if (UE_id == -1) {
|
||||||
LOG_E( PHY, "[eNB %"PRIu8"] Frame %d: find_ue() returns -1\n", Mod_id, eNB->proc[0].frame_tx );
|
LOG_E( PHY, "[eNB %"PRIu8"] Frame %d: find_ue() returns -1\n", Mod_id, eNB->proc.frame_tx );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -653,7 +653,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
|
|||||||
eNB->physicalConfigDedicated[UE_id] = physicalConfigDedicated;
|
eNB->physicalConfigDedicated[UE_id] = physicalConfigDedicated;
|
||||||
LOG_I(PHY,"phy_config_dedicated_eNB: physicalConfigDedicated=%p\n",physicalConfigDedicated);
|
LOG_I(PHY,"phy_config_dedicated_eNB: physicalConfigDedicated=%p\n",physicalConfigDedicated);
|
||||||
} else {
|
} else {
|
||||||
LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, eNB->proc[0].frame_tx,UE_id);
|
LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, eNB->proc.frame_tx,UE_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
#include "PHY/defs.h"
|
#include "PHY/defs.h"
|
||||||
#include "PHY/extern.h"
|
#include "PHY/extern.h"
|
||||||
|
|
||||||
extern PHY_VARS_eNB *PHY_vars_eNB;
|
extern PHY_VARS_eNB *eNB;
|
||||||
extern PHY_VARS_UE *PHY_vars_UE;
|
extern PHY_VARS_UE *UE;
|
||||||
|
|
||||||
void lte_param_init(unsigned char N_tx,
|
void lte_param_init(unsigned char N_tx,
|
||||||
unsigned char N_rx,
|
unsigned char N_rx,
|
||||||
@@ -30,8 +30,8 @@ void lte_param_init(unsigned char N_tx,
|
|||||||
|
|
||||||
|
|
||||||
printf("Start lte_param_init\n");
|
printf("Start lte_param_init\n");
|
||||||
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
|
eNB = malloc(sizeof(PHY_VARS_eNB));
|
||||||
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
|
UE = malloc(sizeof(PHY_VARS_UE));
|
||||||
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
||||||
mac_xface = malloc(sizeof(MAC_xface));
|
mac_xface = malloc(sizeof(MAC_xface));
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ void lte_param_init(unsigned char N_tx,
|
|||||||
randominit(0);
|
randominit(0);
|
||||||
set_taus_seed(0);
|
set_taus_seed(0);
|
||||||
|
|
||||||
frame_parms = &(PHY_vars_eNB->frame_parms);
|
frame_parms = &(eNB->frame_parms);
|
||||||
|
|
||||||
frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
||||||
frame_parms->N_RB_UL = N_RB_DL;
|
frame_parms->N_RB_UL = N_RB_DL;
|
||||||
@@ -66,40 +66,40 @@ void lte_param_init(unsigned char N_tx,
|
|||||||
|
|
||||||
// phy_init_top(frame_parms); //allocation
|
// phy_init_top(frame_parms); //allocation
|
||||||
|
|
||||||
PHY_vars_UE->is_secondary_ue = 0;
|
UE->is_secondary_ue = 0;
|
||||||
PHY_vars_UE->frame_parms = *frame_parms;
|
UE->frame_parms = *frame_parms;
|
||||||
PHY_vars_eNB->frame_parms = *frame_parms;
|
eNB->frame_parms = *frame_parms;
|
||||||
|
|
||||||
phy_init_lte_top(frame_parms);
|
phy_init_lte_top(frame_parms);
|
||||||
dump_frame_parms(frame_parms);
|
dump_frame_parms(frame_parms);
|
||||||
|
|
||||||
PHY_vars_UE->measurements.n_adj_cells=0;
|
UE->measurements.n_adj_cells=0;
|
||||||
PHY_vars_UE->measurements.adj_cell_id[0] = Nid_cell+1;
|
UE->measurements.adj_cell_id[0] = Nid_cell+1;
|
||||||
PHY_vars_UE->measurements.adj_cell_id[1] = Nid_cell+2;
|
UE->measurements.adj_cell_id[1] = Nid_cell+2;
|
||||||
|
|
||||||
for (i=0; i<3; i++)
|
for (i=0; i<3; i++)
|
||||||
lte_gold(frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
|
lte_gold(frame_parms,UE->lte_gold_table[i],Nid_cell+i);
|
||||||
|
|
||||||
phy_init_lte_ue(PHY_vars_UE,1,0);
|
phy_init_lte_ue(UE,1,0);
|
||||||
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
|
phy_init_lte_eNB(eNB,0,0,0);
|
||||||
|
|
||||||
generate_pcfich_reg_mapping(&PHY_vars_UE->frame_parms);
|
generate_pcfich_reg_mapping(&UE->frame_parms);
|
||||||
generate_phich_reg_mapping(&PHY_vars_UE->frame_parms);
|
generate_phich_reg_mapping(&UE->frame_parms);
|
||||||
|
|
||||||
// DL power control init
|
// DL power control init
|
||||||
if (transmission_mode == 1) {
|
if (transmission_mode == 1) {
|
||||||
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||||
((PHY_vars_eNB->frame_parms).pdsch_config_common).p_b = 0;
|
((eNB->frame_parms).pdsch_config_common).p_b = 0;
|
||||||
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||||
((PHY_vars_UE->frame_parms).pdsch_config_common).p_b = 0;
|
((UE->frame_parms).pdsch_config_common).p_b = 0;
|
||||||
} else { // rho_a = rhob
|
} else { // rho_a = rhob
|
||||||
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||||
((PHY_vars_eNB->frame_parms).pdsch_config_common).p_b = 1;
|
((eNB->frame_parms).pdsch_config_common).p_b = 1;
|
||||||
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||||
((PHY_vars_UE->frame_parms).pdsch_config_common).p_b = 1;
|
((UE->frame_parms).pdsch_config_common).p_b = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
PHY_vars_UE->perfect_ce = perfect_ce;
|
UE->perfect_ce = perfect_ce;
|
||||||
|
|
||||||
printf("Done lte_param_init\n");
|
printf("Done lte_param_init\n");
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,6 @@ void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue,
|
|||||||
int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
|
int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
|
||||||
module_id_t eNB_id,
|
module_id_t eNB_id,
|
||||||
module_id_t UE_id,
|
module_id_t UE_id,
|
||||||
uint8_t subframe,
|
|
||||||
uint8_t l,
|
uint8_t l,
|
||||||
uint8_t Ns,
|
uint8_t Ns,
|
||||||
uint8_t cooperation_flag);
|
uint8_t cooperation_flag);
|
||||||
@@ -242,7 +241,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
unsigned char number_of_cards,
|
unsigned char number_of_cards,
|
||||||
short coef);
|
short coef);
|
||||||
|
|
||||||
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id,uint8_t subframe);
|
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id);
|
||||||
|
|
||||||
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
|
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
|
||||||
int subframe,
|
int subframe,
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id,uint8_t thread_id)
|
int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id)
|
||||||
{
|
{
|
||||||
static int first_run=1;
|
static int first_run=1;
|
||||||
static int max_pos_fil2=0;
|
static int max_pos_fil2=0;
|
||||||
@@ -236,7 +236,7 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id,uint8_t thread_
|
|||||||
max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15;
|
max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15;
|
||||||
|
|
||||||
#ifdef DEBUG_PHY
|
#ifdef DEBUG_PHY
|
||||||
LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc[thread_id].frame_rx,max_pos,max_pos_fil2,sync_pos);
|
LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc.frame_rx,max_pos,max_pos_fil2,sync_pos);
|
||||||
#endif //DEBUG_PHY
|
#endif //DEBUG_PHY
|
||||||
|
|
||||||
return(max_pos_fil2-sync_pos);
|
return(max_pos_fil2-sync_pos);
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
|
|||||||
int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
|
int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
|
||||||
uint8_t eNB_id,
|
uint8_t eNB_id,
|
||||||
uint8_t UE_id,
|
uint8_t UE_id,
|
||||||
uint8_t thread_id,
|
|
||||||
unsigned char l,
|
unsigned char l,
|
||||||
unsigned char Ns,
|
unsigned char Ns,
|
||||||
uint8_t cooperation_flag)
|
uint8_t cooperation_flag)
|
||||||
@@ -68,8 +67,8 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
|
|||||||
int32_t **ul_ch_estimates_0= pusch_vars->drs_ch_estimates_0[eNB_id];
|
int32_t **ul_ch_estimates_0= pusch_vars->drs_ch_estimates_0[eNB_id];
|
||||||
int32_t **ul_ch_estimates_1= pusch_vars->drs_ch_estimates_1[eNB_id];
|
int32_t **ul_ch_estimates_1= pusch_vars->drs_ch_estimates_1[eNB_id];
|
||||||
int32_t **rxdataF_ext= pusch_vars->rxdataF_ext[eNB_id];
|
int32_t **rxdataF_ext= pusch_vars->rxdataF_ext[eNB_id];
|
||||||
int subframe = eNB->proc[thread_id].subframe_rx;
|
int subframe = eNB->proc.subframe_rx;
|
||||||
uint8_t harq_pid = subframe2harq_pid(frame_parms,eNB->proc[thread_id].frame_rx,subframe);
|
uint8_t harq_pid = subframe2harq_pid(frame_parms,eNB->proc.frame_rx,subframe);
|
||||||
int16_t delta_phase = 0;
|
int16_t delta_phase = 0;
|
||||||
int16_t *ru1 = ru_90;
|
int16_t *ru1 = ru_90;
|
||||||
int16_t *ru2 = ru_90;
|
int16_t *ru2 = ru_90;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
OpenAirInterface
|
OpenAirInterface
|
||||||
Copyright(c) 1999 - 2014 Eurecom
|
Copyright(c) 1999 - 2014 Eurecom
|
||||||
|
|
||||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
OpenAirInterface is free software: you can redistrirbute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
@@ -7077,12 +7077,11 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
|
||||||
|
void *dci_pdu,
|
||||||
uint16_t rnti,
|
uint16_t rnti,
|
||||||
uint8_t thread_id,
|
|
||||||
DCI_format_t dci_format,
|
DCI_format_t dci_format,
|
||||||
uint8_t UE_id,
|
uint8_t UE_id,
|
||||||
PHY_VARS_eNB *eNB,
|
|
||||||
uint16_t si_rnti,
|
uint16_t si_rnti,
|
||||||
uint16_t ra_rnti,
|
uint16_t ra_rnti,
|
||||||
uint16_t p_rnti,
|
uint16_t p_rnti,
|
||||||
@@ -7096,7 +7095,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
|||||||
ANFBmode_t AckNackFBMode = eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode;
|
ANFBmode_t AckNackFBMode = eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode;
|
||||||
LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id];
|
LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id];
|
||||||
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
||||||
int subframe = eNB->proc[thread_id].subframe_tx;
|
int subframe = eNB->proc.subframe_tx;
|
||||||
|
|
||||||
uint32_t cqi_req = 0;
|
uint32_t cqi_req = 0;
|
||||||
uint32_t dai = 0;
|
uint32_t dai = 0;
|
||||||
@@ -7117,11 +7116,10 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
|||||||
|
|
||||||
harq_pid = subframe2harq_pid(frame_parms,
|
harq_pid = subframe2harq_pid(frame_parms,
|
||||||
pdcch_alloc2ul_frame(frame_parms,
|
pdcch_alloc2ul_frame(frame_parms,
|
||||||
eNB->proc[thread_id].frame_tx,
|
eNB->proc.frame_tx,
|
||||||
subframe),
|
subframe),
|
||||||
pdcch_alloc2ul_subframe(frame_parms,subframe));
|
pdcch_alloc2ul_subframe(frame_parms,subframe));
|
||||||
|
|
||||||
// printf("eNB: thread_id %d, subframe %d, frame_tx %d\n",thread_id,subframe,eNB->proc[thread_id].frame_tx);
|
|
||||||
|
|
||||||
switch (frame_parms->N_RB_DL) {
|
switch (frame_parms->N_RB_DL) {
|
||||||
case 6:
|
case 6:
|
||||||
@@ -7639,7 +7637,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
|||||||
|
|
||||||
|
|
||||||
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, subframe %d : Programming PUSCH with n_DMRS2 %d (cshift %d)\n",
|
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, subframe %d : Programming PUSCH with n_DMRS2 %d (cshift %d)\n",
|
||||||
eNB->Mod_id,harq_pid,eNB->proc[thread_id].frame_tx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift);
|
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1416,7 +1416,6 @@ void rx_phich(PHY_VARS_UE *ue,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void generate_phich_top(PHY_VARS_eNB *eNB,
|
void generate_phich_top(PHY_VARS_eNB *eNB,
|
||||||
unsigned char thread_id,
|
|
||||||
int16_t amp,
|
int16_t amp,
|
||||||
uint8_t sect_id,
|
uint8_t sect_id,
|
||||||
uint8_t abstraction_flag)
|
uint8_t abstraction_flag)
|
||||||
@@ -1432,7 +1431,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
|
|||||||
uint8_t pusch_subframe;
|
uint8_t pusch_subframe;
|
||||||
uint8_t UE_id;
|
uint8_t UE_id;
|
||||||
uint32_t pusch_frame;
|
uint32_t pusch_frame;
|
||||||
int subframe = eNB->proc[thread_id].subframe_tx;
|
int subframe = eNB->proc.subframe_tx;
|
||||||
|
|
||||||
// compute Ngroup_PHICH (see formula at beginning of Section 6.9 in 36-211
|
// compute Ngroup_PHICH (see formula at beginning of Section 6.9 in 36-211
|
||||||
|
|
||||||
@@ -1444,7 +1443,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
|
|||||||
if (frame_parms->Ncp == 1)
|
if (frame_parms->Ncp == 1)
|
||||||
NSF_PHICH = 2;
|
NSF_PHICH = 2;
|
||||||
|
|
||||||
pusch_frame = phich_frame2_pusch_frame(frame_parms,eNB->proc[thread_id].frame_tx,subframe);
|
pusch_frame = phich_frame2_pusch_frame(frame_parms,eNB->proc.frame_tx,subframe);
|
||||||
pusch_subframe = phich_subframe2_pusch_subframe(frame_parms,subframe);
|
pusch_subframe = phich_subframe2_pusch_subframe(frame_parms,subframe);
|
||||||
harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe);
|
harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe);
|
||||||
|
|
||||||
@@ -1453,7 +1452,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
|
|||||||
if (ulsch[UE_id]->harq_processes[harq_pid]->phich_active == 1) {
|
if (ulsch[UE_id]->harq_processes[harq_pid]->phich_active == 1) {
|
||||||
|
|
||||||
LOG_D(PHY,"[eNB][PUSCH %d/%x] Frame %d subframe %d (pusch_subframe %d,pusch_frame %d) phich active %d\n",
|
LOG_D(PHY,"[eNB][PUSCH %d/%x] Frame %d subframe %d (pusch_subframe %d,pusch_frame %d) phich active %d\n",
|
||||||
harq_pid,ulsch[UE_id]->rnti,eNB->proc[thread_id].frame_tx,subframe,pusch_subframe,pusch_frame,ulsch[UE_id]->harq_processes[harq_pid]->phich_active);
|
harq_pid,ulsch[UE_id]->rnti,eNB->proc.frame_tx,subframe,pusch_subframe,pusch_frame,ulsch[UE_id]->harq_processes[harq_pid]->phich_active);
|
||||||
|
|
||||||
ngroup_PHICH = (ulsch[UE_id]->harq_processes[harq_pid]->first_rb +
|
ngroup_PHICH = (ulsch[UE_id]->harq_processes[harq_pid]->first_rb +
|
||||||
ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%Ngroup_PHICH;
|
ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%Ngroup_PHICH;
|
||||||
@@ -1467,7 +1466,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
|
|||||||
nseq_PHICH = ((ulsch[UE_id]->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) +
|
nseq_PHICH = ((ulsch[UE_id]->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) +
|
||||||
ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH);
|
ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH);
|
||||||
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n",
|
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n",
|
||||||
eNB->Mod_id,harq_pid,eNB->proc[thread_id].frame_tx,
|
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,
|
||||||
subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,
|
subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,
|
||||||
ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK,
|
ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK,
|
||||||
ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
|
ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
|
||||||
@@ -1475,7 +1474,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
|
|||||||
|
|
||||||
if (ulsch[UE_id]->Msg3_active == 1) {
|
if (ulsch[UE_id]->Msg3_active == 1) {
|
||||||
LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n",
|
LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n",
|
||||||
eNB->Mod_id,harq_pid,eNB->proc[thread_id].frame_tx,subframe,
|
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe,
|
||||||
UE_id,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK,
|
UE_id,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK,
|
||||||
ulsch[UE_id]->harq_processes[harq_pid]->first_rb);
|
ulsch[UE_id]->harq_processes[harq_pid]->first_rb);
|
||||||
}
|
}
|
||||||
@@ -1505,7 +1504,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
|
|||||||
(ulsch[UE_id]->harq_processes[harq_pid]->rar_alloc == 0) ) {
|
(ulsch[UE_id]->harq_processes[harq_pid]->rar_alloc == 0) ) {
|
||||||
if (ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK==0 ) {
|
if (ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK==0 ) {
|
||||||
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d : PHICH NACK / (no format0 DCI) Setting subframe_scheduling_flag\n",
|
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d : PHICH NACK / (no format0 DCI) Setting subframe_scheduling_flag\n",
|
||||||
eNB->Mod_id,harq_pid,eNB->proc[thread_id].frame_tx,subframe);
|
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe);
|
||||||
ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
|
ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
|
||||||
ulsch[UE_id]->harq_processes[harq_pid]->rvidx = rv_table[ulsch[UE_id]->harq_processes[harq_pid]->round&3];
|
ulsch[UE_id]->harq_processes[harq_pid]->rvidx = rv_table[ulsch[UE_id]->harq_processes[harq_pid]->round&3];
|
||||||
ulsch[UE_id]->harq_processes[harq_pid]->O_RI = 0;
|
ulsch[UE_id]->harq_processes[harq_pid]->O_RI = 0;
|
||||||
@@ -1515,7 +1514,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d PHICH ACK (no format0 DCI) Clearing subframe_scheduling_flag, setting round to 0\n",
|
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d PHICH ACK (no format0 DCI) Clearing subframe_scheduling_flag, setting round to 0\n",
|
||||||
eNB->Mod_id,harq_pid,eNB->proc[thread_id].frame_tx,subframe);
|
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe);
|
||||||
ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
|
ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
|
||||||
ulsch[UE_id]->harq_processes[harq_pid]->round=0;
|
ulsch[UE_id]->harq_processes[harq_pid]->round=0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,13 +43,13 @@
|
|||||||
|
|
||||||
int generate_mbsfn_pilot(PHY_VARS_eNB *eNB,
|
int generate_mbsfn_pilot(PHY_VARS_eNB *eNB,
|
||||||
int32_t **txdataF,
|
int32_t **txdataF,
|
||||||
int16_t amp,
|
int16_t amp)
|
||||||
uint16_t subframe)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
||||||
uint32_t subframe_offset,Nsymb,samples_per_symbol;
|
uint32_t subframe_offset,Nsymb,samples_per_symbol;
|
||||||
|
int subframe = eNB->proc.subframe_tx;
|
||||||
|
|
||||||
|
|
||||||
if (subframe<0 || subframe>= 10) {
|
if (subframe<0 || subframe>= 10) {
|
||||||
|
|||||||
@@ -286,11 +286,11 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *ue,int mcs,int ndi,int rvidx,int eNB_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void generate_mch(PHY_VARS_eNB *eNB,int thread_id,uint8_t *a,int abstraction_flag)
|
void generate_mch(PHY_VARS_eNB *eNB,uint8_t *a,int abstraction_flag)
|
||||||
{
|
{
|
||||||
|
|
||||||
int G;
|
int G;
|
||||||
int subframe = eNB->proc[thread_id].subframe_tx;
|
int subframe = eNB->proc.subframe_tx;
|
||||||
|
|
||||||
if (abstraction_flag != 0) {
|
if (abstraction_flag != 0) {
|
||||||
if (eNB_transport_info_TB_index[eNB->Mod_id][eNB->CC_id]!=0)
|
if (eNB_transport_info_TB_index[eNB->Mod_id][eNB->CC_id]!=0)
|
||||||
@@ -312,18 +312,18 @@ void generate_mch(PHY_VARS_eNB *eNB,int thread_id,uint8_t *a,int abstraction_fla
|
|||||||
eNB->frame_parms.N_RB_DL,
|
eNB->frame_parms.N_RB_DL,
|
||||||
eNB->dlsch_MCH->harq_processes[0]->rb_alloc,
|
eNB->dlsch_MCH->harq_processes[0]->rb_alloc,
|
||||||
get_Qm(eNB->dlsch_MCH->harq_processes[0]->mcs),1,
|
get_Qm(eNB->dlsch_MCH->harq_processes[0]->mcs),1,
|
||||||
2,eNB->proc[thread_id].frame_tx,subframe);
|
2,eNB->proc.frame_tx,subframe);
|
||||||
|
|
||||||
generate_mbsfn_pilot(eNB,
|
generate_mbsfn_pilot(eNB,
|
||||||
eNB->common_vars.txdataF[0],
|
eNB->common_vars.txdataF[0],
|
||||||
AMP,
|
AMP);
|
||||||
subframe);
|
|
||||||
|
|
||||||
if (dlsch_encoding(a,
|
if (dlsch_encoding(a,
|
||||||
&eNB->frame_parms,
|
&eNB->frame_parms,
|
||||||
1,
|
1,
|
||||||
eNB->dlsch_MCH,
|
eNB->dlsch_MCH,
|
||||||
eNB->proc[thread_id].frame_tx,
|
eNB->proc.frame_tx,
|
||||||
subframe,
|
subframe,
|
||||||
&eNB->dlsch_rate_matching_stats,
|
&eNB->dlsch_rate_matching_stats,
|
||||||
&eNB->dlsch_turbo_encoding_stats,
|
&eNB->dlsch_turbo_encoding_stats,
|
||||||
|
|||||||
@@ -1056,7 +1056,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
|||||||
//__m128i mmtmpX0,mmtmpX1,mmtmpX2,mmtmpX3;
|
//__m128i mmtmpX0,mmtmpX1,mmtmpX2,mmtmpX3;
|
||||||
|
|
||||||
void rx_prach(PHY_VARS_eNB *eNB,
|
void rx_prach(PHY_VARS_eNB *eNB,
|
||||||
uint8_t subframe,
|
|
||||||
uint16_t *preamble_energy_list,
|
uint16_t *preamble_energy_list,
|
||||||
uint16_t *preamble_delay_list,
|
uint16_t *preamble_delay_list,
|
||||||
uint16_t Nf,
|
uint16_t Nf,
|
||||||
@@ -1065,7 +1064,7 @@ void rx_prach(PHY_VARS_eNB *eNB,
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
lte_frame_type_t frame_type = eNB->frame_parms.frame_type;
|
lte_frame_type_t frame_type = eNB->frame_parms.frame_type;
|
||||||
|
int subframe = eNB->proc.subframe_rx;
|
||||||
uint16_t rootSequenceIndex = eNB->frame_parms.prach_config_common.rootSequenceIndex;
|
uint16_t rootSequenceIndex = eNB->frame_parms.prach_config_common.rootSequenceIndex;
|
||||||
uint8_t prach_ConfigIndex = eNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
|
uint8_t prach_ConfigIndex = eNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
|
||||||
uint8_t Ncs_config = eNB->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
|
uint8_t Ncs_config = eNB->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
|
||||||
|
|||||||
@@ -583,7 +583,7 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
|
|||||||
for (eNB_id=0; eNB_id<number_of_cards_l; eNB_id++) {
|
for (eNB_id=0; eNB_id<number_of_cards_l; eNB_id++) {
|
||||||
len += sprintf(&buffer[len],"eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n",
|
len += sprintf(&buffer[len],"eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n",
|
||||||
eNB_id,number_of_cards_l,
|
eNB_id,number_of_cards_l,
|
||||||
eNB->proc[0].frame_tx,
|
eNB->proc.frame_tx,
|
||||||
eNB->rx_total_gain_dB,
|
eNB->rx_total_gain_dB,
|
||||||
eNB->measurements[eNB_id].n0_power_tot_dBm,
|
eNB->measurements[eNB_id].n0_power_tot_dBm,
|
||||||
eNB->measurements[eNB_id].n0_power_dB[0],
|
eNB->measurements[eNB_id].n0_power_dB[0],
|
||||||
@@ -621,9 +621,9 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),eNB->proc[0].frame_tx+1);
|
len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),eNB->proc.frame_tx+1);
|
||||||
len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000));
|
len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000));
|
||||||
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,eNB->proc[0].frame_tx+1);
|
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,eNB->proc.frame_tx+1);
|
||||||
//len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions);
|
//len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions);
|
||||||
//len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions);
|
//len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions);
|
||||||
//len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,eNB->check_for_total_transmissions);
|
//len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,eNB->check_for_total_transmissions);
|
||||||
|
|||||||
@@ -228,12 +228,11 @@ int mch_modulation(int32_t **txdataF,
|
|||||||
|
|
||||||
/** \brief Top-level generation function for eNB TX of MBSFN
|
/** \brief Top-level generation function for eNB TX of MBSFN
|
||||||
@param phy_vars_eNB Pointer to eNB variables
|
@param phy_vars_eNB Pointer to eNB variables
|
||||||
@param subframe Subframe for PMCH
|
|
||||||
@param a Pointer to transport block
|
@param a Pointer to transport block
|
||||||
@param abstraction_flag
|
@param abstraction_flag
|
||||||
|
|
||||||
*/
|
*/
|
||||||
void generate_mch(PHY_VARS_eNB *phy_vars_eNB,int subframe,uint8_t *a,int abstraction_flag);
|
void generate_mch(PHY_VARS_eNB *phy_vars_eNB,uint8_t *a,int abstraction_flag);
|
||||||
|
|
||||||
/** \brief This function generates the frequency-domain pilots (cell-specific downlink reference signals)
|
/** \brief This function generates the frequency-domain pilots (cell-specific downlink reference signals)
|
||||||
@param phy_vars_eNB Pointer to eNB variables
|
@param phy_vars_eNB Pointer to eNB variables
|
||||||
@@ -301,8 +300,7 @@ int32_t generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB,
|
|||||||
|
|
||||||
int32_t generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB,
|
int32_t generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB,
|
||||||
int32_t **txdataF,
|
int32_t **txdataF,
|
||||||
int16_t amp,
|
int16_t amp);
|
||||||
uint16_t subframe);
|
|
||||||
|
|
||||||
int32_t generate_pss(int32_t **txdataF,
|
int32_t generate_pss(int32_t **txdataF,
|
||||||
int16_t amp,
|
int16_t amp,
|
||||||
@@ -1409,27 +1407,26 @@ int32_t generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
|
|||||||
uint8_t eNB_id);
|
uint8_t eNB_id);
|
||||||
double sinr_eff_cqi_calc(PHY_VARS_UE *phy_vars_ue,
|
double sinr_eff_cqi_calc(PHY_VARS_UE *phy_vars_ue,
|
||||||
uint8_t eNB_id);
|
uint8_t eNB_id);
|
||||||
int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB,
|
||||||
|
void *dci_pdu,
|
||||||
rnti_t rnti,
|
rnti_t rnti,
|
||||||
uint8_t subframe,
|
DCI_format_t dci_format,
|
||||||
DCI_format_t dci_format,
|
|
||||||
uint8_t UE_id,
|
uint8_t UE_id,
|
||||||
PHY_VARS_eNB *PHY_vars_eNB,
|
uint16_t si_rnti,
|
||||||
uint16_t si_rnti,
|
|
||||||
uint16_t ra_rnti,
|
uint16_t ra_rnti,
|
||||||
uint16_t p_rnti,
|
uint16_t p_rnti,
|
||||||
uint16_t cba_rnti,
|
uint16_t cba_rnti,
|
||||||
uint8_t use_srs);
|
uint8_t use_srs);
|
||||||
|
|
||||||
#ifdef USER_MODE
|
|
||||||
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNb,uint8_t subframe, uint8_t UE_id);
|
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNb,uint8_t UE_id);
|
||||||
|
|
||||||
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
|
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
|
||||||
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
|
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
|
||||||
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
|
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
|
||||||
|
|
||||||
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round);
|
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round);
|
||||||
#endif
|
|
||||||
|
|
||||||
int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci);
|
int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci);
|
||||||
|
|
||||||
@@ -1477,14 +1474,12 @@ void generate_RIV_tables(void);
|
|||||||
int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode);
|
int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode);
|
||||||
|
|
||||||
void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
|
void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
|
||||||
uint32_t subframe,
|
|
||||||
uint8_t eNB_id, // this is the effective sector id
|
uint8_t eNB_id, // this is the effective sector id
|
||||||
uint8_t UE_id,
|
uint8_t UE_id,
|
||||||
LTE_eNB_ULSCH_t **ulsch,
|
LTE_eNB_ULSCH_t **ulsch,
|
||||||
uint8_t cooperation_flag);
|
uint8_t cooperation_flag);
|
||||||
|
|
||||||
void rx_ulsch_emul(PHY_VARS_eNB *phy_vars_eNB,
|
void rx_ulsch_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||||
uint8_t subframe,
|
|
||||||
uint8_t sect_id,
|
uint8_t sect_id,
|
||||||
uint8_t UE_index);
|
uint8_t UE_index);
|
||||||
|
|
||||||
@@ -1532,18 +1527,15 @@ int32_t ulsch_encoding_emul(uint8_t *ulsch_buffer,
|
|||||||
*/
|
*/
|
||||||
unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||||
uint8_t UE_id,
|
uint8_t UE_id,
|
||||||
uint8_t subframe,
|
|
||||||
uint8_t control_only_flag,
|
uint8_t control_only_flag,
|
||||||
uint8_t Nbundled,
|
uint8_t Nbundled,
|
||||||
uint8_t llr8_flag);
|
uint8_t llr8_flag);
|
||||||
|
|
||||||
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB,
|
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||||
uint8_t subframe,
|
|
||||||
uint8_t UE_index,
|
uint8_t UE_index,
|
||||||
uint16_t *crnti);
|
uint16_t *crnti);
|
||||||
|
|
||||||
void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
|
void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
|
||||||
uint8_t subframe,
|
|
||||||
int16_t amp,
|
int16_t amp,
|
||||||
uint8_t sect_id,
|
uint8_t sect_id,
|
||||||
uint8_t abstraction_flag);
|
uint8_t abstraction_flag);
|
||||||
@@ -1671,11 +1663,11 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
|||||||
uint8_t pucch1_thres);
|
uint8_t pucch1_thres);
|
||||||
|
|
||||||
int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
|
int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||||
uint8_t UE_index,
|
uint8_t UE_index,
|
||||||
PUCCH_FMT_t fmt,
|
PUCCH_FMT_t fmt,
|
||||||
uint8_t n1_pucch_sel,
|
uint8_t n1_pucch_sel,
|
||||||
uint8_t *payload,
|
uint8_t *payload);
|
||||||
uint8_t subframe);
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -1702,7 +1694,6 @@ int32_t generate_prach(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,
|
|||||||
/*!
|
/*!
|
||||||
\brief Process PRACH waveform
|
\brief Process PRACH waveform
|
||||||
@param phy_vars_eNB Pointer to eNB top-level descriptor
|
@param phy_vars_eNB Pointer to eNB top-level descriptor
|
||||||
@param subframe subframe index to operate on
|
|
||||||
@param preamble_energy_list List of energies for each candidate preamble
|
@param preamble_energy_list List of energies for each candidate preamble
|
||||||
@param preamble_delay_list List of delays for each candidate preamble
|
@param preamble_delay_list List of delays for each candidate preamble
|
||||||
@param Nf System frame number
|
@param Nf System frame number
|
||||||
@@ -1710,7 +1701,7 @@ int32_t generate_prach(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,
|
|||||||
@returns 0 on success
|
@returns 0 on success
|
||||||
|
|
||||||
*/
|
*/
|
||||||
void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_energy_list, uint16_t *preamble_delay_list, uint16_t Nf, uint8_t tdd_mapindex);
|
void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint16_t *preamble_energy_list, uint16_t *preamble_delay_list, uint16_t Nf, uint8_t tdd_mapindex);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Helper for MAC, returns number of available PRACH in TDD for a particular configuration index
|
\brief Helper for MAC, returns number of available PRACH in TDD for a particular configuration index
|
||||||
|
|||||||
@@ -1067,12 +1067,12 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *eNB,
|
|||||||
uint8_t UE_index,
|
uint8_t UE_index,
|
||||||
PUCCH_FMT_t fmt,
|
PUCCH_FMT_t fmt,
|
||||||
uint8_t n1_pucch_sel,
|
uint8_t n1_pucch_sel,
|
||||||
uint8_t *payload,
|
uint8_t *payload)
|
||||||
uint8_t thread_id)
|
|
||||||
{
|
{
|
||||||
uint8_t UE_id;
|
uint8_t UE_id;
|
||||||
uint16_t rnti;
|
uint16_t rnti;
|
||||||
int subframe = eNB->proc[thread_id].subframe_rx;
|
int subframe = eNB->proc.subframe_rx;
|
||||||
uint8_t CC_id = eNB->CC_id;
|
uint8_t CC_id = eNB->CC_id;
|
||||||
|
|
||||||
rnti = eNB->ulsch[UE_index]->rnti;
|
rnti = eNB->ulsch[UE_index]->rnti;
|
||||||
@@ -1095,7 +1095,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *eNB,
|
|||||||
payload[0] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[0];
|
payload[0] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[0];
|
||||||
payload[1] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[1];
|
payload[1] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[1];
|
||||||
} else
|
} else
|
||||||
LOG_E(PHY,"[eNB] Frame %d: Can't handle formats 2/2a/2b\n",eNB->proc[thread_id].frame_rx);
|
LOG_E(PHY,"[eNB] Frame %d: Can't handle formats 2/2a/2b\n",eNB->proc.frame_rx);
|
||||||
|
|
||||||
if (PHY_vars_UE_g[UE_id][CC_id]->pucch_sel[subframe] == n1_pucch_sel)
|
if (PHY_vars_UE_g[UE_id][CC_id]->pucch_sel[subframe] == n1_pucch_sel)
|
||||||
return(99);
|
return(99);
|
||||||
|
|||||||
@@ -70,35 +70,35 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch)
|
|||||||
|
|
||||||
if (ulsch) {
|
if (ulsch) {
|
||||||
#ifdef DEBUG_ULSCH_FREE
|
#ifdef DEBUG_ULSCH_FREE
|
||||||
msg("Freeing ulsch %p\n",ulsch);
|
printf("Freeing ulsch %p\n",ulsch);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (i=0; i<8; i++) {
|
for (i=0; i<8; i++) {
|
||||||
#ifdef DEBUG_ULSCH_FREE
|
#ifdef DEBUG_ULSCH_FREE
|
||||||
msg("Freeing ulsch process %d\n",i);
|
printf("Freeing ulsch process %d\n",i);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ulsch->harq_processes[i]) {
|
if (ulsch->harq_processes[i]) {
|
||||||
#ifdef DEBUG_ULSCH_FREE
|
#ifdef DEBUG_ULSCH_FREE
|
||||||
msg("Freeing ulsch process %d (%p)\n",i,ulsch->harq_processes[i]);
|
printf("Freeing ulsch process %d (%p)\n",i,ulsch->harq_processes[i]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ulsch->harq_processes[i]->b) {
|
if (ulsch->harq_processes[i]->b) {
|
||||||
free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES);
|
free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES);
|
||||||
ulsch->harq_processes[i]->b = NULL;
|
ulsch->harq_processes[i]->b = NULL;
|
||||||
#ifdef DEBUG_ULSCH_FREE
|
#ifdef DEBUG_ULSCH_FREE
|
||||||
msg("Freeing ulsch process %d b (%p)\n",i,ulsch->harq_processes[i]->b);
|
printf("Freeing ulsch process %d b (%p)\n",i,ulsch->harq_processes[i]->b);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_ULSCH_FREE
|
#ifdef DEBUG_ULSCH_FREE
|
||||||
msg("Freeing ulsch process %d c (%p)\n",i,ulsch->harq_processes[i]->c);
|
printf("Freeing ulsch process %d c (%p)\n",i,ulsch->harq_processes[i]->c);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
|
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
|
||||||
|
|
||||||
#ifdef DEBUG_ULSCH_FREE
|
#ifdef DEBUG_ULSCH_FREE
|
||||||
msg("Freeing ulsch process %d c[%d] (%p)\n",i,r,ulsch->harq_processes[i]->c[r]);
|
printf("Freeing ulsch process %d c[%d] (%p)\n",i,r,ulsch->harq_processes[i]->c[r]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ulsch->harq_processes[i]->c[r]) {
|
if (ulsch->harq_processes[i]->c[r]) {
|
||||||
@@ -302,7 +302,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
|||||||
ulsch->harq_processes[harq_pid]->control_only = 0;
|
ulsch->harq_processes[harq_pid]->control_only = 0;
|
||||||
|
|
||||||
#ifdef DEBUG_ULSCH_CODING
|
#ifdef DEBUG_ULSCH_CODING
|
||||||
msg("[PHY][UE] ULSCH coding : A %d, Qm %d, mcs %d, harq_pid %d, round %d, RV %d\n",
|
printf("[PHY][UE] ULSCH coding : A %d, Qm %d, mcs %d, harq_pid %d, round %d, RV %d\n",
|
||||||
ulsch->harq_processes[harq_pid]->TBS,
|
ulsch->harq_processes[harq_pid]->TBS,
|
||||||
Q_m,
|
Q_m,
|
||||||
ulsch->harq_processes[harq_pid]->mcs,
|
ulsch->harq_processes[harq_pid]->mcs,
|
||||||
@@ -311,16 +311,16 @@ uint32_t ulsch_encoding(uint8_t *a,
|
|||||||
ulsch->harq_processes[harq_pid]->rvidx);
|
ulsch->harq_processes[harq_pid]->rvidx);
|
||||||
|
|
||||||
for (i=0; i<ulsch->harq_processes[harq_pid]->O_ACK; i++)
|
for (i=0; i<ulsch->harq_processes[harq_pid]->O_ACK; i++)
|
||||||
msg("ulsch_coding: o_ACK[%d] %d\n",i,ulsch->o_ACK[i]);
|
printf("ulsch_coding: o_ACK[%d] %d\n",i,ulsch->o_ACK[i]);
|
||||||
|
|
||||||
for (i=0; i<ulsch->O_RI; i++)
|
for (i=0; i<ulsch->O_RI; i++)
|
||||||
msg("ulsch_coding: o_RI[%d] %d\n",i,ulsch->o_RI[i]);
|
printf("ulsch_coding: o_RI[%d] %d\n",i,ulsch->o_RI[i]);
|
||||||
|
|
||||||
msg("ulsch_coding: O=%d\n",ulsch->O);
|
printf("ulsch_coding: O=%d\n",ulsch->O);
|
||||||
|
|
||||||
for (i=0; i<1+((8+ulsch->O)/8); i++) {
|
for (i=0; i<1+((8+ulsch->O)/8); i++) {
|
||||||
// ulsch->o[i] = i;
|
// ulsch->o[i] = i;
|
||||||
msg("ulsch_coding: O[%d] %d\n",i,ulsch->o[i]);
|
printf("ulsch_coding: O[%d] %d\n",i,ulsch->o[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((tmode != 4))
|
if ((tmode != 4))
|
||||||
@@ -380,20 +380,20 @@ uint32_t ulsch_encoding(uint8_t *a,
|
|||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_ULSCH_CODING
|
#ifdef DEBUG_ULSCH_CODING
|
||||||
msg("Generating Code Segment %d (%d bits)\n",r,Kr);
|
printf("Generating Code Segment %d (%d bits)\n",r,Kr);
|
||||||
// generate codewords
|
// generate codewords
|
||||||
|
|
||||||
msg("bits_per_codeword (Kr)= %d\n",Kr);
|
printf("bits_per_codeword (Kr)= %d\n",Kr);
|
||||||
msg("N_RB = %d\n",ulsch->harq_processes[harq_pid]->nb_rb);
|
printf("N_RB = %d\n",ulsch->harq_processes[harq_pid]->nb_rb);
|
||||||
msg("Ncp %d\n",frame_parms->Ncp);
|
printf("Ncp %d\n",frame_parms->Ncp);
|
||||||
msg("Qm %d\n",Q_m);
|
printf("Qm %d\n",Q_m);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// offset=0;
|
// offset=0;
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_ULSCH_CODING
|
#ifdef DEBUG_ULSCH_CODING
|
||||||
msg("Encoding ... iind %d f1 %d, f2 %d\n",iind,f1f2mat_old[iind*2],f1f2mat_old[(iind*2)+1]);
|
printf("Encoding ... iind %d f1 %d, f2 %d\n",iind,f1f2mat_old[iind*2],f1f2mat_old[(iind*2)+1]);
|
||||||
#endif
|
#endif
|
||||||
start_meas(te_stats);
|
start_meas(te_stats);
|
||||||
threegpplte_turbo_encoder(ulsch->harq_processes[harq_pid]->c[r],
|
threegpplte_turbo_encoder(ulsch->harq_processes[harq_pid]->c[r],
|
||||||
@@ -526,7 +526,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
|||||||
|
|
||||||
for (r=0; r<ulsch->harq_processes[harq_pid]->C; r++) {
|
for (r=0; r<ulsch->harq_processes[harq_pid]->C; r++) {
|
||||||
#ifdef DEBUG_ULSCH_CODING
|
#ifdef DEBUG_ULSCH_CODING
|
||||||
msg("Rate Matching, Code segment %d (coded bits (G) %d,unpunctured/repeated bits per code segment %d,mod_order %d, nb_rb %d)...\n",
|
printf("Rate Matching, Code segment %d (coded bits (G) %d,unpunctured/repeated bits per code segment %d,mod_order %d, nb_rb %d)...\n",
|
||||||
r,
|
r,
|
||||||
G,
|
G,
|
||||||
Kr*3,
|
Kr*3,
|
||||||
@@ -633,7 +633,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
|||||||
// Do ACK coding, Section 5.2.2.6 36.213 (p.23-24 in v8.6)
|
// Do ACK coding, Section 5.2.2.6 36.213 (p.23-24 in v8.6)
|
||||||
wACK_idx = (ulsch->bundling==0) ? 4 : ((Nbundled-1)&3);
|
wACK_idx = (ulsch->bundling==0) ? 4 : ((Nbundled-1)&3);
|
||||||
#ifdef DEBUG_ULSCH_CODING
|
#ifdef DEBUG_ULSCH_CODING
|
||||||
msg("ulsch_coding.c: Bundling %d, Nbundled %d, wACK_idx %d\n",
|
printf("ulsch_coding.c: Bundling %d, Nbundled %d, wACK_idx %d\n",
|
||||||
ulsch->bundling,Nbundled,wACK_idx);
|
ulsch->bundling,Nbundled,wACK_idx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -865,7 +865,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
|||||||
for (q=0; q<Q_m; q++) {
|
for (q=0; q<Q_m; q++) {
|
||||||
y[q+(Q_m*((r*Cmux) + columnset[j]))] = ulsch->q_ACK[(q+(Q_m*i))%len_ACK];
|
y[q+(Q_m*((r*Cmux) + columnset[j]))] = ulsch->q_ACK[(q+(Q_m*i))%len_ACK];
|
||||||
#ifdef DEBUG_ULSCH_CODING
|
#ifdef DEBUG_ULSCH_CODING
|
||||||
msg("ulsch_coding.c: ACK %d => y[%d]=%d (i %d, r*Cmux %d, columnset %d)\n",q+(Q_m*i),
|
printf("ulsch_coding.c: ACK %d => y[%d]=%d (i %d, r*Cmux %d, columnset %d)\n",q+(Q_m*i),
|
||||||
q+(Q_m*((r*Cmux) + columnset[j])),ulsch->q_ACK[(q+(Q_m*i))%len_ACK],
|
q+(Q_m*((r*Cmux) + columnset[j])),ulsch->q_ACK[(q+(Q_m*i))%len_ACK],
|
||||||
i,r*Cmux,columnset[j]);
|
i,r*Cmux,columnset[j]);
|
||||||
#endif
|
#endif
|
||||||
@@ -965,7 +965,7 @@ int ulsch_encoding_emul(uint8_t *ulsch_buffer,
|
|||||||
// print_CQI(ulsch->o,ulsch->uci_format,eNB_id);
|
// print_CQI(ulsch->o,ulsch->uci_format,eNB_id);
|
||||||
|
|
||||||
// save PUSCH pmi for later (transmission modes 4,5,6)
|
// save PUSCH pmi for later (transmission modes 4,5,6)
|
||||||
// msg("ulsch: saving pmi for DL %x\n",pmi2hex_2Ar1(((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi));
|
// printf("ulsch: saving pmi for DL %x\n",pmi2hex_2Ar1(((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi));
|
||||||
// if (ulsch->uci_format != HLC_subband_cqi_mcs_CBA)
|
// if (ulsch->uci_format != HLC_subband_cqi_mcs_CBA)
|
||||||
dlsch[0]->harq_processes[harq_pid]->pmi_alloc = ((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi;
|
dlsch[0]->harq_processes[harq_pid]->pmi_alloc = ((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi;
|
||||||
}
|
}
|
||||||
@@ -986,20 +986,20 @@ int ulsch_encoding_emul(uint8_t *ulsch_buffer,
|
|||||||
UE_transport_info[ue->Mod_id][ue->CC_id].eNB_id[0] = eNB_id;
|
UE_transport_info[ue->Mod_id][ue->CC_id].eNB_id[0] = eNB_id;
|
||||||
UE_transport_info[ue->Mod_id][ue->CC_id].harq_pid[0] = harq_pid;
|
UE_transport_info[ue->Mod_id][ue->CC_id].harq_pid[0] = harq_pid;
|
||||||
UE_transport_info[ue->Mod_id][ue->CC_id].tbs[0] = ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3 ;
|
UE_transport_info[ue->Mod_id][ue->CC_id].tbs[0] = ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3 ;
|
||||||
// msg("\nue->Mod_id%d\n",ue->Mod_id);
|
// printf("\nue->Mod_id%d\n",ue->Mod_id);
|
||||||
|
|
||||||
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_flag = 1;
|
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_flag = 1;
|
||||||
//UE_transport_info[ue->Mod_id].cntl.pusch_uci = *(uint32_t *)ulsch->o;
|
//UE_transport_info[ue->Mod_id].cntl.pusch_uci = *(uint32_t *)ulsch->o;
|
||||||
memcpy(UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_uci,
|
memcpy(UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_uci,
|
||||||
ulsch->o,
|
ulsch->o,
|
||||||
MAX_CQI_BYTES);
|
MAX_CQI_BYTES);
|
||||||
// msg("[UE]cqi is %d \n", ((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1);
|
// printf("[UE]cqi is %d \n", ((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1);
|
||||||
|
|
||||||
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.length_uci = ulsch->O;
|
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.length_uci = ulsch->O;
|
||||||
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.uci_format = ulsch->uci_format;
|
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.uci_format = ulsch->uci_format;
|
||||||
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_ri = (ulsch->o_RI[0]&1)+((ulsch->o_RI[1]&1)<<1);
|
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_ri = (ulsch->o_RI[0]&1)+((ulsch->o_RI[1]&1)<<1);
|
||||||
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_ack = (ulsch->o_ACK[0]&1) + ((ulsch->o_ACK[1]&1)<<1);
|
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_ack = (ulsch->o_ACK[0]&1) + ((ulsch->o_ACK[1]&1)<<1);
|
||||||
//msg("ack is %d %d %d\n",UE_transport_info[ue->Mod_id].cntl.pusch_ack, (ulsch->o_ACK[1]&1)<<1, ulsch->o_ACK[0]&1);
|
//printf("ack is %d %d %d\n",UE_transport_info[ue->Mod_id].cntl.pusch_ack, (ulsch->o_ACK[1]&1)<<1, ulsch->o_ACK[0]&1);
|
||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,7 +220,6 @@ uint8_t extract_cqi_crc(uint8_t *cqi,uint8_t CQI_LENGTH)
|
|||||||
|
|
||||||
unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
||||||
uint8_t UE_id,
|
uint8_t UE_id,
|
||||||
uint8_t thread_id,
|
|
||||||
uint8_t control_only_flag,
|
uint8_t control_only_flag,
|
||||||
uint8_t Nbundled,
|
uint8_t Nbundled,
|
||||||
uint8_t llr8_flag)
|
uint8_t llr8_flag)
|
||||||
@@ -260,7 +259,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
|||||||
int16_t cseq[6*14*1200];
|
int16_t cseq[6*14*1200];
|
||||||
int off;
|
int off;
|
||||||
int status[20];
|
int status[20];
|
||||||
int subframe = eNB->proc[thread_id].subframe_rx;
|
int subframe = eNB->proc.subframe_rx;
|
||||||
LTE_UL_eNB_HARQ_t *ulsch_harq;
|
LTE_UL_eNB_HARQ_t *ulsch_harq;
|
||||||
|
|
||||||
uint8_t (*tc)(int16_t *y,
|
uint8_t (*tc)(int16_t *y,
|
||||||
@@ -279,7 +278,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
|
|||||||
time_stats_t *,
|
time_stats_t *,
|
||||||
time_stats_t *);
|
time_stats_t *);
|
||||||
|
|
||||||
harq_pid = subframe2harq_pid(frame_parms,eNB->proc[thread_id].frame_rx,subframe);
|
harq_pid = subframe2harq_pid(frame_parms,eNB->proc.frame_rx,subframe);
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,1);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,1);
|
||||||
|
|
||||||
@@ -1501,18 +1500,17 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB,
|
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB,
|
||||||
uint8_t thread_id,
|
|
||||||
uint8_t UE_index,
|
uint8_t UE_index,
|
||||||
uint16_t *crnti)
|
uint16_t *crnti)
|
||||||
{
|
{
|
||||||
|
|
||||||
uint8_t UE_id;
|
uint8_t UE_id;
|
||||||
uint16_t rnti;
|
uint16_t rnti;
|
||||||
int subframe = eNB->proc[thread_id].subframe_rx;
|
int subframe = eNB->proc.subframe_rx;
|
||||||
uint8_t harq_pid;
|
uint8_t harq_pid;
|
||||||
uint8_t CC_id = eNB->CC_id;
|
uint8_t CC_id = eNB->CC_id;
|
||||||
|
|
||||||
harq_pid = subframe2harq_pid(&eNB->frame_parms,eNB->proc[thread_id].frame_rx,subframe);
|
harq_pid = subframe2harq_pid(&eNB->frame_parms,eNB->proc.frame_rx,subframe);
|
||||||
|
|
||||||
rnti = eNB->ulsch[UE_index]->rnti;
|
rnti = eNB->ulsch[UE_index]->rnti;
|
||||||
#ifdef DEBUG_PHY
|
#ifdef DEBUG_PHY
|
||||||
|
|||||||
@@ -1577,7 +1577,6 @@ int32_t avgU[2];
|
|||||||
int32_t avgU_0[2],avgU_1[2]; // For the Distributed Alamouti Scheme
|
int32_t avgU_0[2],avgU_1[2]; // For the Distributed Alamouti Scheme
|
||||||
|
|
||||||
void rx_ulsch(PHY_VARS_eNB *eNB,
|
void rx_ulsch(PHY_VARS_eNB *eNB,
|
||||||
uint32_t thread_id,
|
|
||||||
uint8_t eNB_id, // this is the effective sector id
|
uint8_t eNB_id, // this is the effective sector id
|
||||||
uint8_t UE_id,
|
uint8_t UE_id,
|
||||||
LTE_eNB_ULSCH_t **ulsch,
|
LTE_eNB_ULSCH_t **ulsch,
|
||||||
@@ -1603,9 +1602,9 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
|
|||||||
uint8_t Qm;
|
uint8_t Qm;
|
||||||
uint16_t rx_power_correction;
|
uint16_t rx_power_correction;
|
||||||
int16_t *llrp;
|
int16_t *llrp;
|
||||||
int subframe = eNB->proc[thread_id].subframe_rx;
|
int subframe = eNB->proc.subframe_rx;
|
||||||
|
|
||||||
harq_pid = subframe2harq_pid(frame_parms,eNB->proc[thread_id].frame_rx,subframe);
|
harq_pid = subframe2harq_pid(frame_parms,eNB->proc.frame_rx,subframe);
|
||||||
Qm = get_Qm_ul(ulsch[UE_id]->harq_processes[harq_pid]->mcs);
|
Qm = get_Qm_ul(ulsch[UE_id]->harq_processes[harq_pid]->mcs);
|
||||||
#ifdef DEBUG_ULSCH
|
#ifdef DEBUG_ULSCH
|
||||||
msg("rx_ulsch: eNB_id %d, harq_pid %d, nb_rb %d first_rb %d, cooperation %d\n",eNB_id,harq_pid,ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
|
msg("rx_ulsch: eNB_id %d, harq_pid %d, nb_rb %d first_rb %d, cooperation %d\n",eNB_id,harq_pid,ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
|
||||||
@@ -1640,7 +1639,6 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
|
|||||||
lte_ul_channel_estimation(eNB,
|
lte_ul_channel_estimation(eNB,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
UE_id,
|
UE_id,
|
||||||
thread_id,
|
|
||||||
l%(frame_parms->symbols_per_tti/2),
|
l%(frame_parms->symbols_per_tti/2),
|
||||||
l/(frame_parms->symbols_per_tti/2),
|
l/(frame_parms->symbols_per_tti/2),
|
||||||
cooperation_flag);
|
cooperation_flag);
|
||||||
@@ -1887,25 +1885,24 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void rx_ulsch_emul(PHY_VARS_eNB *eNB,
|
void rx_ulsch_emul(PHY_VARS_eNB *eNB,
|
||||||
uint8_t subframe,
|
|
||||||
uint8_t sect_id,
|
uint8_t sect_id,
|
||||||
uint8_t UE_index)
|
uint8_t UE_index)
|
||||||
{
|
{
|
||||||
msg("[PHY] EMUL eNB %d rx_ulsch_emul : subframe %d, sect_id %d, UE_index %d\n",eNB->Mod_id,subframe,sect_id,UE_index);
|
msg("[PHY] EMUL eNB %d rx_ulsch_emul : subframe %d, sect_id %d, UE_index %d\n",eNB->Mod_id,eNB->proc.subframe_rx,sect_id,UE_index);
|
||||||
eNB->pusch_vars[UE_index]->ulsch_power[0] = 31622; //=45dB;
|
eNB->pusch_vars[UE_index]->ulsch_power[0] = 31622; //=45dB;
|
||||||
eNB->pusch_vars[UE_index]->ulsch_power[1] = 31622; //=45dB;
|
eNB->pusch_vars[UE_index]->ulsch_power[1] = 31622; //=45dB;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void dump_ulsch(PHY_VARS_eNB *eNB,uint8_t thread_id, uint8_t UE_id)
|
void dump_ulsch(PHY_VARS_eNB *eNB,uint8_t UE_id)
|
||||||
{
|
{
|
||||||
|
|
||||||
uint32_t nsymb = (eNB->frame_parms.Ncp == 0) ? 14 : 12;
|
uint32_t nsymb = (eNB->frame_parms.Ncp == 0) ? 14 : 12;
|
||||||
uint8_t harq_pid;
|
uint8_t harq_pid;
|
||||||
int subframe = eNB->proc[thread_id].subframe_rx;
|
int subframe = eNB->proc.subframe_rx;
|
||||||
|
|
||||||
harq_pid = subframe2harq_pid(&eNB->frame_parms,eNB->proc[thread_id].frame_rx,subframe);
|
harq_pid = subframe2harq_pid(&eNB->frame_parms,eNB->proc.frame_rx,subframe);
|
||||||
|
|
||||||
printf("Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, mcs %d, Qm %d, N_symb %d\n", subframe,harq_pid,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
|
printf("Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, mcs %d, Qm %d, N_symb %d\n", subframe,harq_pid,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
|
||||||
eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs,get_Qm_ul(eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs),
|
eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs,get_Qm_ul(eNB->ulsch[UE_id]->harq_processes[harq_pid]->mcs),
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||||
|
|
||||||
//#define OFDMA_ULSCH
|
|
||||||
|
|
||||||
//#define DEBUG_ULSCH_MODULATION
|
//#define DEBUG_ULSCH_MODULATION
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
|
|||||||
#elif defined(__arm__)
|
#elif defined(__arm__)
|
||||||
int16x8_t norm128;
|
int16x8_t norm128;
|
||||||
#endif
|
#endif
|
||||||
// msg("Doing lte_dft for Msc_PUSCH %d\n",Msc_PUSCH);
|
// printf("Doing lte_dft for Msc_PUSCH %d\n",Msc_PUSCH);
|
||||||
|
|
||||||
d0 = (uint32_t *)d;
|
d0 = (uint32_t *)d;
|
||||||
d1 = d0+Msc_PUSCH;
|
d1 = d0+Msc_PUSCH;
|
||||||
@@ -87,7 +87,7 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
|
|||||||
d10 = d9+Msc_PUSCH;
|
d10 = d9+Msc_PUSCH;
|
||||||
d11 = d10+Msc_PUSCH;
|
d11 = d10+Msc_PUSCH;
|
||||||
|
|
||||||
// msg("symbol 0 (d0 %p, d %p)\n",d0,d);
|
// printf("symbol 0 (d0 %p, d %p)\n",d0,d);
|
||||||
for (i=0,ip=0; i<Msc_PUSCH; i++,ip+=4) {
|
for (i=0,ip=0; i<Msc_PUSCH; i++,ip+=4) {
|
||||||
dft_in0[ip] = d0[i];
|
dft_in0[ip] = d0[i];
|
||||||
dft_in0[ip+1] = d1[i];
|
dft_in0[ip+1] = d1[i];
|
||||||
@@ -101,13 +101,13 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
|
|||||||
dft_in2[ip+1] = d9[i];
|
dft_in2[ip+1] = d9[i];
|
||||||
dft_in2[ip+2] = d10[i];
|
dft_in2[ip+2] = d10[i];
|
||||||
dft_in2[ip+3] = d11[i];
|
dft_in2[ip+3] = d11[i];
|
||||||
// msg("dft%d %d: %d,%d,%d,%d\n",Msc_PUSCH,ip,d0[i],d1[i],d2[i],d3[i]);
|
// printf("dft%d %d: %d,%d,%d,%d\n",Msc_PUSCH,ip,d0[i],d1[i],d2[i],d3[i]);
|
||||||
|
|
||||||
// dft_in_re2[ip+1] = d9[i];
|
// dft_in_re2[ip+1] = d9[i];
|
||||||
// dft_in_re2[ip+2] = d10[i];
|
// dft_in_re2[ip+2] = d10[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// msg("\n");
|
// printf("\n");
|
||||||
|
|
||||||
switch (Msc_PUSCH) {
|
switch (Msc_PUSCH) {
|
||||||
case 12:
|
case 12:
|
||||||
@@ -350,10 +350,10 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
|
|||||||
z10 = z9+Msc_PUSCH;
|
z10 = z9+Msc_PUSCH;
|
||||||
z11 = z10+Msc_PUSCH;
|
z11 = z10+Msc_PUSCH;
|
||||||
|
|
||||||
// msg("symbol0 (dft)\n");
|
// printf("symbol0 (dft)\n");
|
||||||
for (i=0,ip=0; i<Msc_PUSCH; i++,ip+=4) {
|
for (i=0,ip=0; i<Msc_PUSCH; i++,ip+=4) {
|
||||||
z0[i] = dft_out0[ip];
|
z0[i] = dft_out0[ip];
|
||||||
// msg("%d,%d,",((short*)&z0[i])[0],((short*)&z0[i])[1]);
|
// printf("%d,%d,",((short*)&z0[i])[0],((short*)&z0[i])[1]);
|
||||||
z1[i] = dft_out0[ip+1];
|
z1[i] = dft_out0[ip+1];
|
||||||
z2[i] = dft_out0[ip+2];
|
z2[i] = dft_out0[ip+2];
|
||||||
z3[i] = dft_out0[ip+3];
|
z3[i] = dft_out0[ip+3];
|
||||||
@@ -365,11 +365,11 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
|
|||||||
z9[i] = dft_out2[ip+1];
|
z9[i] = dft_out2[ip+1];
|
||||||
z10[i] = dft_out2[ip+2];
|
z10[i] = dft_out2[ip+2];
|
||||||
z11[i] = dft_out2[ip+3];
|
z11[i] = dft_out2[ip+3];
|
||||||
// msg("out dft%d %d: %d,%d,%d,%d,%d,%d,%d,%d\n",Msc_PUSCH,ip,z0[i],z1[i],z2[i],z3[i],z4[i],z5[i],z6[i],z7[i]);
|
// printf("out dft%d %d: %d,%d,%d,%d,%d,%d,%d,%d\n",Msc_PUSCH,ip,z0[i],z1[i],z2[i],z3[i],z4[i],z5[i],z6[i],z7[i]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// msg("\n");
|
// printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -403,7 +403,7 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
uint8_t c;
|
uint8_t c;
|
||||||
|
|
||||||
if (!ulsch) {
|
if (!ulsch) {
|
||||||
msg("ulsch_modulation.c: Null ulsch\n");
|
printf("ulsch_modulation.c: Null ulsch\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,7 +411,7 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1
|
x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1
|
||||||
|
|
||||||
if (harq_pid > 7) {
|
if (harq_pid > 7) {
|
||||||
msg("ulsch_modulation.c: Illegal harq_pid %d\n",harq_pid);
|
printf("ulsch_modulation.c: Illegal harq_pid %d\n",harq_pid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,12 +419,12 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
nb_rb = ulsch->harq_processes[harq_pid]->nb_rb;
|
nb_rb = ulsch->harq_processes[harq_pid]->nb_rb;
|
||||||
|
|
||||||
if (nb_rb == 0) {
|
if (nb_rb == 0) {
|
||||||
msg("ulsch_modulation.c: Frame %d, Subframe %d Illegal nb_rb %d\n",frame,subframe,nb_rb);
|
printf("ulsch_modulation.c: Frame %d, Subframe %d Illegal nb_rb %d\n",frame,subframe,nb_rb);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (first_rb >25 ) {
|
if (first_rb >25 ) {
|
||||||
msg("ulsch_modulation.c: Frame %d, Subframe %d Illegal first_rb %d\n",frame,subframe,first_rb);
|
printf("ulsch_modulation.c: Frame %d, Subframe %d Illegal first_rb %d\n",frame,subframe,first_rb);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,12 +439,12 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
Msc_PUSCH = ulsch->harq_processes[harq_pid]->nb_rb*12;
|
Msc_PUSCH = ulsch->harq_processes[harq_pid]->nb_rb*12;
|
||||||
|
|
||||||
#ifdef DEBUG_ULSCH_MODULATION
|
#ifdef DEBUG_ULSCH_MODULATION
|
||||||
msg("ulsch_modulation.c: Doing modulation (rnti %x,x2 %x) for G=%d bits, harq_pid %d , nb_rb %d, Q_m %d, Nsymb_pusch %d (nsymb %d), subframe %d\n",
|
printf("ulsch_modulation.c: Doing modulation (rnti %x,x2 %x) for G=%d bits, harq_pid %d , nb_rb %d, Q_m %d, Nsymb_pusch %d (nsymb %d), subframe %d\n",
|
||||||
ulsch->rnti,x2,G,harq_pid,ulsch->harq_processes[harq_pid]->nb_rb,Q_m, ulsch->Nsymb_pusch,nsymb,subframe);
|
ulsch->rnti,x2,G,harq_pid,ulsch->harq_processes[harq_pid]->nb_rb,Q_m, ulsch->Nsymb_pusch,nsymb,subframe);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// scrambling (Note the placeholding bits are handled in ulsch_coding.c directly!)
|
// scrambling (Note the placeholding bits are handled in ulsch_coding.c directly!)
|
||||||
//msg("ulsch bits: ");
|
//printf("ulsch bits: ");
|
||||||
s = lte_gold_generic(&x1, &x2, 1);
|
s = lte_gold_generic(&x1, &x2, 1);
|
||||||
k=0;
|
k=0;
|
||||||
|
|
||||||
@@ -454,14 +454,14 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
c = (uint8_t)((s>>j)&1);
|
c = (uint8_t)((s>>j)&1);
|
||||||
|
|
||||||
if (ulsch->h[k] == PUSCH_x) {
|
if (ulsch->h[k] == PUSCH_x) {
|
||||||
// msg("i %d: PUSCH_x\n",i);
|
// printf("i %d: PUSCH_x\n",i);
|
||||||
ulsch->b_tilde[k] = 1;
|
ulsch->b_tilde[k] = 1;
|
||||||
} else if (ulsch->h[k] == PUSCH_y) {
|
} else if (ulsch->h[k] == PUSCH_y) {
|
||||||
// msg("i %d: PUSCH_y\n",i);
|
// printf("i %d: PUSCH_y\n",i);
|
||||||
ulsch->b_tilde[k] = ulsch->b_tilde[k-1];
|
ulsch->b_tilde[k] = ulsch->b_tilde[k-1];
|
||||||
} else {
|
} else {
|
||||||
ulsch->b_tilde[k] = (ulsch->h[k]+c)&1;
|
ulsch->b_tilde[k] = (ulsch->h[k]+c)&1;
|
||||||
// msg("i %d : %d (h %d c %d)\n", (i<<5)+j,ulsch->b_tilde[k],ulsch->h[k],c);
|
// printf("i %d : %d (h %d c %d)\n", (i<<5)+j,ulsch->b_tilde[k],ulsch->h[k],c);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -469,7 +469,7 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
s = lte_gold_generic(&x1, &x2, 0);
|
s = lte_gold_generic(&x1, &x2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//msg("\n");
|
//printf("\n");
|
||||||
|
|
||||||
|
|
||||||
gain_lin_QPSK = (short)((amp*ONE_OVER_SQRT2_Q15)>>15);
|
gain_lin_QPSK = (short)((amp*ONE_OVER_SQRT2_Q15)>>15);
|
||||||
@@ -493,7 +493,7 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
((int16_t*)&ulsch->d[i])[0] = (ulsch->b_tilde[j] == 1) ? (gain_lin_QPSK) : -gain_lin_QPSK;
|
((int16_t*)&ulsch->d[i])[0] = (ulsch->b_tilde[j] == 1) ? (gain_lin_QPSK) : -gain_lin_QPSK;
|
||||||
((int16_t*)&ulsch->d[i])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
|
((int16_t*)&ulsch->d[i])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||||
// if (i<Msc_PUSCH)
|
// if (i<Msc_PUSCH)
|
||||||
// msg("input %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
|
// printf("input %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
|
||||||
|
|
||||||
// UE1, x0*
|
// UE1, x0*
|
||||||
((int16_t*)&ulsch->d[i+1])[0] = (ulsch->b_tilde[j-2] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
((int16_t*)&ulsch->d[i+1])[0] = (ulsch->b_tilde[j-2] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||||
@@ -626,7 +626,7 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
((int16_t*)&ulsch->d[i])[0] = (ulsch->b_tilde[j] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
((int16_t*)&ulsch->d[i])[0] = (ulsch->b_tilde[j] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||||
((int16_t*)&ulsch->d[i])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
|
((int16_t*)&ulsch->d[i])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||||
// if (i<Msc_PUSCH)
|
// if (i<Msc_PUSCH)
|
||||||
// msg("input %d/%d Msc_PUSCH %d (%p): %d,%d\n", i,Msymb,Msc_PUSCH,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
|
// printf("input %d/%d Msc_PUSCH %d (%p): %d,%d\n", i,Msymb,Msc_PUSCH,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -650,7 +650,7 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
|
|
||||||
((int16_t*)&ulsch->d[i])[0]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
|
((int16_t*)&ulsch->d[i])[0]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
|
||||||
((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
|
((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
|
||||||
// msg("input(16qam) %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
|
// printf("input(16qam) %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
@@ -710,14 +710,14 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
// re_offset0++;
|
// re_offset0++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// msg("re_offset0 %d\n",re_offset0);
|
// printf("re_offset0 %d\n",re_offset0);
|
||||||
|
|
||||||
|
|
||||||
for (j=0,l=0; l<(nsymb-ulsch->srs_active); l++) {
|
for (j=0,l=0; l<(nsymb-ulsch->srs_active); l++) {
|
||||||
re_offset = re_offset0;
|
re_offset = re_offset0;
|
||||||
symbol_offset = (int)frame_parms->ofdm_symbol_size*(l+(subframe*nsymb));
|
symbol_offset = (int)frame_parms->ofdm_symbol_size*(l+(subframe*nsymb));
|
||||||
#ifdef DEBUG_ULSCH_MODULATION
|
#ifdef DEBUG_ULSCH_MODULATION
|
||||||
msg("symbol %d (subframe %d): symbol_offset %d\n",l,subframe,symbol_offset);
|
printf("symbol %d (subframe %d): symbol_offset %d\n",l,subframe,symbol_offset);
|
||||||
#endif
|
#endif
|
||||||
txptr = &txdataF[0][symbol_offset];
|
txptr = &txdataF[0][symbol_offset];
|
||||||
|
|
||||||
@@ -727,10 +727,10 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
// Skip reference symbols
|
// Skip reference symbols
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// msg("copying %d REs\n",Msc_PUSCH);
|
// printf("copying %d REs\n",Msc_PUSCH);
|
||||||
for (i=0; i<Msc_PUSCH; i++,j++) {
|
for (i=0; i<Msc_PUSCH; i++,j++) {
|
||||||
#ifdef DEBUG_ULSCH_MODULATION
|
#ifdef DEBUG_ULSCH_MODULATION
|
||||||
msg("re_offset %d (%p): %d,%d\n", re_offset,&ulsch->z[j],((int16_t*)&ulsch->z[j])[0],((int16_t*)&ulsch->z[j])[1]);
|
printf("re_offset %d (%p): %d,%d\n", re_offset,&ulsch->z[j],((int16_t*)&ulsch->z[j])[0],((int16_t*)&ulsch->z[j])[1]);
|
||||||
#endif
|
#endif
|
||||||
txptr[re_offset++] = ulsch->z[j];
|
txptr[re_offset++] = ulsch->z[j];
|
||||||
|
|
||||||
@@ -748,13 +748,13 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
// re_offset0++;
|
// re_offset0++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// msg("re_offset0 %d\n",re_offset0);
|
// printf("re_offset0 %d\n",re_offset0);
|
||||||
// printf("txdataF %p\n",&txdataF[0][0]);
|
// printf("txdataF %p\n",&txdataF[0][0]);
|
||||||
for (j=0,l=0; l<(nsymb-ulsch->srs_active); l++) {
|
for (j=0,l=0; l<(nsymb-ulsch->srs_active); l++) {
|
||||||
re_offset = re_offset0;
|
re_offset = re_offset0;
|
||||||
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*(l+(subframe*nsymb));
|
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*(l+(subframe*nsymb));
|
||||||
#ifdef DEBUG_ULSCH_MODULATION
|
#ifdef DEBUG_ULSCH_MODULATION
|
||||||
msg("ulsch_mod (OFDMA) symbol %d (subframe %d): symbol_offset %d\n",l,subframe,symbol_offset);
|
printf("ulsch_mod (OFDMA) symbol %d (subframe %d): symbol_offset %d\n",l,subframe,symbol_offset);
|
||||||
#endif
|
#endif
|
||||||
txptr = &txdataF[0][symbol_offset];
|
txptr = &txdataF[0][symbol_offset];
|
||||||
|
|
||||||
@@ -763,11 +763,11 @@ void ulsch_modulation(int32_t **txdataF,
|
|||||||
}
|
}
|
||||||
// Skip reference symbols
|
// Skip reference symbols
|
||||||
else {
|
else {
|
||||||
// msg("copying %d REs\n",Msc_PUSCH);
|
// printf("copying %d REs\n",Msc_PUSCH);
|
||||||
for (i=0; i<Msc_PUSCH; i++,j++) {
|
for (i=0; i<Msc_PUSCH; i++,j++) {
|
||||||
|
|
||||||
#ifdef DEBUG_ULSCH_MODULATION
|
#ifdef DEBUG_ULSCH_MODULATION
|
||||||
msg("re_offset %d (%p): %d,%d => %p\n", re_offset,&ulsch->z[j],((int16_t*)&ulsch->z[j])[0],((int16_t*)&ulsch->z[j])[1],&txptr[re_offset]);
|
printf("re_offset %d (%p): %d,%d => %p\n", re_offset,&ulsch->z[j],((int16_t*)&ulsch->z[j])[0],((int16_t*)&ulsch->z[j])[1],&txptr[re_offset]);
|
||||||
#endif //DEBUG_ULSCH_MODULATION
|
#endif //DEBUG_ULSCH_MODULATION
|
||||||
txptr[re_offset++] = ulsch->z[j];
|
txptr[re_offset++] = ulsch->z[j];
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
|||||||
float time[FRAME_LENGTH_COMPLEX_SAMPLES];
|
float time[FRAME_LENGTH_COMPLEX_SAMPLES];
|
||||||
float time2[2048];
|
float time2[2048];
|
||||||
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
|
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
|
||||||
int frame = phy_vars_enb->proc[0].frame_tx;
|
int frame = phy_vars_enb->proc.frame_tx;
|
||||||
uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate;
|
uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate;
|
||||||
int coded_bits_per_codeword = 0;
|
int coded_bits_per_codeword = 0;
|
||||||
uint8_t harq_pid; // in TDD config 3 it is sf-2, i.e., can be 0,1,2
|
uint8_t harq_pid; // in TDD config 3 it is sf-2, i.e., can be 0,1,2
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ double get_cpu_freq_GHz(void) {
|
|||||||
return cpu_freq_GHz;
|
return cpu_freq_GHz;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_meas_now(time_stats_t *ts, const char* name, int subframe, FILE* file_name){
|
void print_meas_now(time_stats_t *ts, const char* name, FILE* file_name){
|
||||||
|
|
||||||
if (opp_enabled) {
|
if (opp_enabled) {
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ static inline void start_meas(time_stats_t *ts) __attribute__((always_inline));
|
|||||||
static inline void stop_meas(time_stats_t *ts) __attribute__((always_inline));
|
static inline void stop_meas(time_stats_t *ts) __attribute__((always_inline));
|
||||||
|
|
||||||
|
|
||||||
void print_meas_now(time_stats_t *ts, const char* name, int subframe, FILE* file_name);
|
void print_meas_now(time_stats_t *ts, const char* name, FILE* file_name);
|
||||||
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time);
|
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time);
|
||||||
double get_time_meas_us(time_stats_t *ts);
|
double get_time_meas_us(time_stats_t *ts);
|
||||||
double get_cpu_freq_GHz(void);
|
double get_cpu_freq_GHz(void);
|
||||||
|
|||||||
+5
-2
@@ -192,10 +192,14 @@ typedef struct {
|
|||||||
int subframe_tx;
|
int subframe_tx;
|
||||||
/// subframe to act upon for reception
|
/// subframe to act upon for reception
|
||||||
int subframe_rx;
|
int subframe_rx;
|
||||||
|
/// subframe to act upon for PRACH
|
||||||
|
int subframe_prach;
|
||||||
/// frame to act upon for transmission
|
/// frame to act upon for transmission
|
||||||
int frame_tx;
|
int frame_tx;
|
||||||
/// frame to act upon for reception
|
/// frame to act upon for reception
|
||||||
int frame_rx;
|
int frame_rx;
|
||||||
|
/// frame to act upon for PRACH
|
||||||
|
int frame_prach;
|
||||||
/// \brief Instance count for tx processing thread.
|
/// \brief Instance count for tx processing thread.
|
||||||
/// \internal This variable is protected by \ref mutex_tx.
|
/// \internal This variable is protected by \ref mutex_tx.
|
||||||
int instance_cnt_tx;
|
int instance_cnt_tx;
|
||||||
@@ -232,14 +236,13 @@ typedef struct {
|
|||||||
|
|
||||||
//! \brief Number of eNB TX and RX threads.
|
//! \brief Number of eNB TX and RX threads.
|
||||||
//! This number must be equal to the number of LTE subframes (10). Each thread is responsible for a single subframe.
|
//! This number must be equal to the number of LTE subframes (10). Each thread is responsible for a single subframe.
|
||||||
#define NUM_ENB_THREADS 1
|
|
||||||
|
|
||||||
/// Top-level PHY Data Structure for eNB
|
/// Top-level PHY Data Structure for eNB
|
||||||
typedef struct PHY_VARS_eNB_s {
|
typedef struct PHY_VARS_eNB_s {
|
||||||
/// Module ID indicator for this instance
|
/// Module ID indicator for this instance
|
||||||
module_id_t Mod_id;
|
module_id_t Mod_id;
|
||||||
uint8_t CC_id;
|
uint8_t CC_id;
|
||||||
eNB_proc_t proc[NUM_ENB_THREADS];
|
eNB_proc_t proc;
|
||||||
eNB_func_t node_function;
|
eNB_func_t node_function;
|
||||||
uint8_t local_flag;
|
uint8_t local_flag;
|
||||||
uint32_t rx_total_gain_dB;
|
uint32_t rx_total_gain_dB;
|
||||||
|
|||||||
+15
-30
@@ -161,8 +161,6 @@ void cleanup_dlsch_threads(void);
|
|||||||
void phy_procedures_eNB_lte(uint8_t subframe,PHY_VARS_eNB **phy_vars_eNB,uint8_t abstraction_flag, relaying_type_t r_type, PHY_VARS_RN *phy_vars_rn);
|
void phy_procedures_eNB_lte(uint8_t subframe,PHY_VARS_eNB **phy_vars_eNB,uint8_t abstraction_flag, relaying_type_t r_type, PHY_VARS_RN *phy_vars_rn);
|
||||||
|
|
||||||
/*! \brief Top-level entry routine for UE procedures. Called every slot by process scheduler. In even slots, it performs RX functions from previous subframe (if required). On odd slots, it generate TX waveform for the following subframe.
|
/*! \brief Top-level entry routine for UE procedures. Called every slot by process scheduler. In even slots, it performs RX functions from previous subframe (if required). On odd slots, it generate TX waveform for the following subframe.
|
||||||
@param last_slot Index of last slot (0-19)
|
|
||||||
@param next_slot Index of next_slot (0-19)
|
|
||||||
@param phy_vars_ue Pointer to UE variables on which to act
|
@param phy_vars_ue Pointer to UE variables on which to act
|
||||||
@param eNB_id ID of eNB on which to act
|
@param eNB_id ID of eNB on which to act
|
||||||
@param abstraction_flag Indicator of PHY abstraction
|
@param abstraction_flag Indicator of PHY abstraction
|
||||||
@@ -215,61 +213,60 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
|||||||
void phy_procedures_UE_S_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,relaying_type_t r_type);
|
void phy_procedures_UE_S_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,relaying_type_t r_type);
|
||||||
|
|
||||||
/*! \brief Scheduling for UE RX procedures in TDD S-subframes.
|
/*! \brief Scheduling for UE RX procedures in TDD S-subframes.
|
||||||
@param thread_index Thread index in proc vector
|
|
||||||
@param phy_vars_ue Pointer to UE variables on which to act
|
@param phy_vars_ue Pointer to UE variables on which to act
|
||||||
@param eNB_id Local id of eNB on which to act
|
@param eNB_id Local id of eNB on which to act
|
||||||
@param abstraction_flag Indicator of PHY abstraction
|
@param abstraction_flag Indicator of PHY abstraction
|
||||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||||
*/
|
*/
|
||||||
void phy_procedures_UE_S_RX(uint8_t thread_index,PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag, relaying_type_t r_type);
|
void phy_procedures_UE_S_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag, relaying_type_t r_type);
|
||||||
|
|
||||||
/*! \brief Scheduling for eNB TX procedures in normal subframes.
|
/*! \brief Scheduling for eNB TX procedures in normal subframes.
|
||||||
@param thread_index Index of thread in proc vector
|
|
||||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||||
@param abstraction_flag Indicator of PHY abstraction
|
@param abstraction_flag Indicator of PHY abstraction
|
||||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||||
@param phy_vars_rn pointer to the RN variables
|
@param phy_vars_rn pointer to the RN variables
|
||||||
*/
|
*/
|
||||||
void phy_procedures_eNB_TX(uint8_t thread_index,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
|
void phy_procedures_eNB_TX(PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
|
||||||
|
|
||||||
/*! \brief Scheduling for eNB RX UE-specific procedures in normal subframes.
|
/*! \brief Scheduling for eNB RX UE-specific procedures in normal subframes.
|
||||||
@param thread_index Thread index in proc vector
|
|
||||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||||
@param abstraction_flag Indicator of PHY abstraction
|
@param abstraction_flag Indicator of PHY abstraction
|
||||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||||
*/
|
*/
|
||||||
void phy_procedures_eNB_uespec_RX(uint8_t thread_index,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type);
|
void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type);
|
||||||
|
|
||||||
/*! \brief Scheduling for eNB TX procedures in TDD S-subframes.
|
/*! \brief Scheduling for eNB TX procedures in TDD S-subframes.
|
||||||
@param thread_index Index of thread in proc vector
|
|
||||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||||
@param abstraction_flag Indicator of PHY abstraction
|
@param abstraction_flag Indicator of PHY abstraction
|
||||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \brief Scheduling for eNB RX common procedures in normal subframes.
|
/*! \brief Scheduling for eNB RX common procedures in normal subframes.
|
||||||
@param thread_index Thread index in proc vector
|
|
||||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||||
@param abstraction_flag Indicator of PHY abstraction
|
@param abstraction_flag Indicator of PHY abstraction
|
||||||
*/
|
*/
|
||||||
void phy_procedures_eNB_common_RX(uint8_t thread_index,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag);
|
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag);
|
||||||
|
|
||||||
/*! \brief Scheduling for eNB TX procedures in TDD S-subframes.
|
/*! \brief Scheduling for eNB TX procedures in TDD S-subframes.
|
||||||
@param thread_index Index of thread in proc vector
|
|
||||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||||
@param abstraction_flag Indicator of PHY abstraction
|
@param abstraction_flag Indicator of PHY abstraction
|
||||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void phy_procedures_eNB_S_TX(uint8_t next_slot,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type);
|
void phy_procedures_eNB_S_TX(PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type);
|
||||||
|
|
||||||
/*! \brief Scheduling for eNB RX procedures in TDD S-subframes.
|
/*! \brief Scheduling for eNB RX procedures in TDD S-subframes.
|
||||||
@param last_slot Index of next slot (0-19)
|
|
||||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||||
@param abstraction_flag Indicator of PHY abstraction
|
@param abstraction_flag Indicator of PHY abstraction
|
||||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||||
*/
|
*/
|
||||||
void phy_procedures_eNB_S_RX(uint8_t last_slot,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type);
|
void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type);
|
||||||
|
|
||||||
|
/*! \brief Scheduling for eNB PRACH RX procedures
|
||||||
|
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||||
|
@param abstraction_flag Indicator of PHY abstraction
|
||||||
|
*/
|
||||||
|
void prach_procedures(PHY_VARS_eNB *eNB,uint8_t abstraction_flag);
|
||||||
|
|
||||||
/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index.
|
/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index.
|
||||||
@param frame_parms Pointer to DL frame parameter descriptor
|
@param frame_parms Pointer to DL frame parameter descriptor
|
||||||
@@ -277,12 +274,6 @@ void phy_procedures_eNB_S_RX(uint8_t last_slot,PHY_VARS_eNB *phy_vars_eNB,uint8_
|
|||||||
@returns Subframe type (DL,UL,S)
|
@returns Subframe type (DL,UL,S)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \brief Scheduling for eNB PRACH RX procedures
|
|
||||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
|
||||||
@param thread_id Index of thread in proc vector
|
|
||||||
@param abstraction_flag Indicator of PHY abstraction
|
|
||||||
*/
|
|
||||||
void prach_procedures(PHY_VARS_eNB *eNB,uint8_t thread_id,uint8_t abstraction_flag);
|
|
||||||
|
|
||||||
lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||||
|
|
||||||
@@ -400,10 +391,9 @@ uint8_t is_SR_TXOp(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
|
|||||||
/*! \brief Indicates the SR TXOp in current subframe for eNB and particular UE index. Implements Table 10.1-5 from 36.213.
|
/*! \brief Indicates the SR TXOp in current subframe for eNB and particular UE index. Implements Table 10.1-5 from 36.213.
|
||||||
@param phy_vars_eNB Pointer to eNB variables
|
@param phy_vars_eNB Pointer to eNB variables
|
||||||
@param UE_id ID of UE which may be issuing the SR
|
@param UE_id ID of UE which may be issuing the SR
|
||||||
@param subframe index of last subframe
|
|
||||||
@returns 1 if TXOp is active.
|
@returns 1 if TXOp is active.
|
||||||
*/
|
*/
|
||||||
uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t subframe);
|
uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id);
|
||||||
|
|
||||||
/*! \brief Gives the UL subframe corresponding to a PDDCH order in subframe n
|
/*! \brief Gives the UL subframe corresponding to a PDDCH order in subframe n
|
||||||
@param frame_parms Pointer to DL frame parameters
|
@param frame_parms Pointer to DL frame parameters
|
||||||
@@ -443,14 +433,14 @@ subframe n-4 which is acknowledged in subframe n (for FDD) according to n1_pucch
|
|||||||
TDD, this routine computes the complex procedure described in Section 10.1 of 36.213 (through tables 10.1-1,10.1-2)
|
TDD, this routine computes the complex procedure described in Section 10.1 of 36.213 (through tables 10.1-1,10.1-2)
|
||||||
@param phy_vars_ue Pointer to UE variables
|
@param phy_vars_ue Pointer to UE variables
|
||||||
@param eNB_id Index of eNB
|
@param eNB_id Index of eNB
|
||||||
@param thread_id Index of thread where procedures are executed
|
@param subframe subframe on which to act
|
||||||
@param b Pointer to PUCCH payload (b[0],b[1])
|
@param b Pointer to PUCCH payload (b[0],b[1])
|
||||||
@param SR 1 means there's a positive SR in parallel to ACK/NAK
|
@param SR 1 means there's a positive SR in parallel to ACK/NAK
|
||||||
@returns n1_pucch
|
@returns n1_pucch
|
||||||
*/
|
*/
|
||||||
uint16_t get_n1_pucch(PHY_VARS_UE *phy_vars_ue,
|
uint16_t get_n1_pucch(PHY_VARS_UE *phy_vars_ue,
|
||||||
uint8_t eNB_id,
|
uint8_t eNB_id,
|
||||||
uint8_t thread_id,
|
uint8_t subframe,
|
||||||
uint8_t *b,
|
uint8_t *b,
|
||||||
uint8_t SR);
|
uint8_t SR);
|
||||||
|
|
||||||
@@ -468,7 +458,6 @@ TDD, this routine computes the procedure described in Section 10.1 of 36.213 (th
|
|||||||
*/
|
*/
|
||||||
void get_n1_pucch_eNB(PHY_VARS_eNB *phy_vars_eNB,
|
void get_n1_pucch_eNB(PHY_VARS_eNB *phy_vars_eNB,
|
||||||
uint8_t UE_id,
|
uint8_t UE_id,
|
||||||
uint8_t subframe,
|
|
||||||
int16_t *n1_pucch0,
|
int16_t *n1_pucch0,
|
||||||
int16_t *n1_pucch1,
|
int16_t *n1_pucch1,
|
||||||
int16_t *n1_pucch2,
|
int16_t *n1_pucch2,
|
||||||
@@ -477,7 +466,6 @@ void get_n1_pucch_eNB(PHY_VARS_eNB *phy_vars_eNB,
|
|||||||
|
|
||||||
/*! \brief This function retrieves the harq_pid of the corresponding DLSCH process and updates the error statistics of the DLSCH based on the received ACK info from UE along with the round index. It also performs the fine-grain rate-adaptation based on the error statistics derived from the ACK/NAK process.
|
/*! \brief This function retrieves the harq_pid of the corresponding DLSCH process and updates the error statistics of the DLSCH based on the received ACK info from UE along with the round index. It also performs the fine-grain rate-adaptation based on the error statistics derived from the ACK/NAK process.
|
||||||
@param UE_id Local UE index on which to act
|
@param UE_id Local UE index on which to act
|
||||||
@param subframe Index of subframe
|
|
||||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||||
@param pusch_flag Indication that feedback came from PUSCH
|
@param pusch_flag Indication that feedback came from PUSCH
|
||||||
@param pucch_payload Resulting payload from pucch
|
@param pucch_payload Resulting payload from pucch
|
||||||
@@ -485,7 +473,6 @@ void get_n1_pucch_eNB(PHY_VARS_eNB *phy_vars_eNB,
|
|||||||
@param SR_payload Indication of SR presence (TDD specific)
|
@param SR_payload Indication of SR presence (TDD specific)
|
||||||
*/
|
*/
|
||||||
void process_HARQ_feedback(uint8_t UE_id,
|
void process_HARQ_feedback(uint8_t UE_id,
|
||||||
uint8_t subframe,
|
|
||||||
PHY_VARS_eNB *phy_vars_eNB,
|
PHY_VARS_eNB *phy_vars_eNB,
|
||||||
uint8_t pusch_flag,
|
uint8_t pusch_flag,
|
||||||
uint8_t *pucch_payload,
|
uint8_t *pucch_payload,
|
||||||
@@ -548,8 +535,6 @@ int16_t get_target_pucch_rx_power(module_id_t module_idP, uint8_t CC_id);
|
|||||||
|
|
||||||
int get_ue_active_harq_pid(uint8_t Mod_id,uint8_t CC_id,uint16_t rnti,int frame, uint8_t subframe,uint8_t *harq_pid,uint8_t *round,uint8_t ul_flag);
|
int get_ue_active_harq_pid(uint8_t Mod_id,uint8_t CC_id,uint16_t rnti,int frame, uint8_t subframe,uint8_t *harq_pid,uint8_t *round,uint8_t ul_flag);
|
||||||
|
|
||||||
void ulsch_decoding_procedures(unsigned char last_slot, unsigned int i, PHY_VARS_eNB *phy_vars_eNB, unsigned char abstraction_flag);
|
|
||||||
|
|
||||||
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
|
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
|
||||||
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
|
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
|
||||||
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
|
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
#include "SCHED/phy_procedures_emos.h"
|
#include "SCHED/phy_procedures_emos.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
|
|
||||||
uint32_t rballoc = 0x7FFF;
|
uint32_t rballoc = 0x7FFF;
|
||||||
//uint32_t rballoc2 = 0x000F;
|
//uint32_t rballoc2 = 0x000F;
|
||||||
int subframe = eNB->proc[thread_id].subframe_tx;
|
int subframe = eNB->proc.subframe_tx;
|
||||||
|
|
||||||
LTE_eNB_DLSCH_t *DLSCH_ptr = eNB->dlsch[0][0];
|
LTE_eNB_DLSCH_t *DLSCH_ptr = eNB->dlsch[0][0];
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->type = 1;
|
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->type = 1;
|
||||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
||||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
||||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
||||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
||||||
@@ -100,7 +100,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
||||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
||||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
||||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
||||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = 0;
|
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = 0;
|
||||||
@@ -117,7 +117,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->type = 1;
|
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->type = 1;
|
||||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
||||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
||||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
||||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
||||||
@@ -128,7 +128,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
||||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
||||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
||||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
||||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = 0;
|
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = 0;
|
||||||
@@ -144,7 +144,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->type = 1;
|
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->type = 1;
|
||||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
||||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
||||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
||||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
||||||
@@ -155,7 +155,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
||||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
||||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
||||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
||||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||||
@@ -171,7 +171,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->type = 1;
|
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->type = 1;
|
||||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
||||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
||||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
||||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
||||||
@@ -182,7 +182,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
||||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
||||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
||||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
||||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = 0;
|
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = 0;
|
||||||
@@ -236,7 +236,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
||||||
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
||||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
|
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
|
||||||
|
|
||||||
@@ -267,7 +267,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
||||||
//((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
//((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
||||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
||||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
|
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
||||||
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
||||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t));
|
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t));
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
||||||
//((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
//((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
||||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
||||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t));
|
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t));
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
||||||
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
||||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
|
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
|
||||||
//((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
//((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
|
||||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->ndi = eNB->proc[thread_id].frame_tx&1;
|
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->ndi = eNB->proc.frame_tx&1;
|
||||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
||||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_TDD_t));
|
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_TDD_t));
|
||||||
|
|
||||||
@@ -437,10 +437,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
|
|
||||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tpmi = 0;
|
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tpmi = 0;
|
||||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv1 = 0;
|
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv1 = 0;
|
||||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi1 = eNB->proc[thread_id].frame_tx&1;
|
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi1 = eNB->proc.frame_tx&1;
|
||||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs1 = eNB->target_ue_dl_mcs;
|
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs1 = eNB->target_ue_dl_mcs;
|
||||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv2 = 0;
|
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv2 = 0;
|
||||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi2 = eNB->proc[thread_id].frame_tx&1;
|
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi2 = eNB->proc.frame_tx&1;
|
||||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs2 = eNB->target_ue_dl_mcs;
|
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs2 = eNB->target_ue_dl_mcs;
|
||||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tb_swap = 0;
|
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tb_swap = 0;
|
||||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||||
@@ -459,7 +459,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
|
|
||||||
DLSCH_alloc_pdu1E.tpmi = 5; //5=use feedback
|
DLSCH_alloc_pdu1E.tpmi = 5; //5=use feedback
|
||||||
DLSCH_alloc_pdu1E.rv = 0;
|
DLSCH_alloc_pdu1E.rv = 0;
|
||||||
DLSCH_alloc_pdu1E.ndi = eNB->proc[thread_id].frame_tx&1;
|
DLSCH_alloc_pdu1E.ndi = eNB->proc.frame_tx&1;
|
||||||
//DLSCH_alloc_pdu1E.mcs = cqi_to_mcs[eNB->eNB_UE_stats->DL_cqi[0]];
|
//DLSCH_alloc_pdu1E.mcs = cqi_to_mcs[eNB->eNB_UE_stats->DL_cqi[0]];
|
||||||
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
|
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
|
||||||
DLSCH_alloc_pdu1E.mcs = eNB->target_ue_dl_mcs;
|
DLSCH_alloc_pdu1E.mcs = eNB->target_ue_dl_mcs;
|
||||||
@@ -482,7 +482,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
//DLSCH_alloc_pdu1E.mcs = eNB->target_ue_dl_mcs;
|
//DLSCH_alloc_pdu1E.mcs = eNB->target_ue_dl_mcs;
|
||||||
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
|
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
|
||||||
//DLSCH_alloc_pdu1E.mcs = (unsigned char) ((eNB->frame%1024)%28);
|
//DLSCH_alloc_pdu1E.mcs = (unsigned char) ((eNB->frame%1024)%28);
|
||||||
DLSCH_alloc_pdu1E.mcs = (unsigned char) (((eNB->proc[thread_id].frame_tx%1024)/3)%28);
|
DLSCH_alloc_pdu1E.mcs = (unsigned char) (((eNB->proc.frame_tx%1024)/3)%28);
|
||||||
eNB->UE_stats[1].dlsch_mcs1 = DLSCH_alloc_pdu1E.mcs;
|
eNB->UE_stats[1].dlsch_mcs1 = DLSCH_alloc_pdu1E.mcs;
|
||||||
|
|
||||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
|
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
|
||||||
@@ -533,7 +533,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
UL_alloc_pdu.hopping = 0;
|
UL_alloc_pdu.hopping = 0;
|
||||||
UL_alloc_pdu.rballoc = computeRIV(25,2,eNB->ue_ul_nb_rb);
|
UL_alloc_pdu.rballoc = computeRIV(25,2,eNB->ue_ul_nb_rb);
|
||||||
UL_alloc_pdu.mcs = eNB->target_ue_ul_mcs;
|
UL_alloc_pdu.mcs = eNB->target_ue_ul_mcs;
|
||||||
UL_alloc_pdu.ndi = eNB->proc[thread_id].frame_tx&1;
|
UL_alloc_pdu.ndi = eNB->proc.frame_tx&1;
|
||||||
UL_alloc_pdu.TPC = 0;
|
UL_alloc_pdu.TPC = 0;
|
||||||
UL_alloc_pdu.cshift = 0;
|
UL_alloc_pdu.cshift = 0;
|
||||||
UL_alloc_pdu.dai = 0;
|
UL_alloc_pdu.dai = 0;
|
||||||
@@ -555,7 +555,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t thread_id, PHY_VARS_eNB *eNB)
|
|||||||
else
|
else
|
||||||
UL_alloc_pdu.rballoc = computeRIV(25,0,eNB->ue_ul_nb_rb);
|
UL_alloc_pdu.rballoc = computeRIV(25,0,eNB->ue_ul_nb_rb);
|
||||||
UL_alloc_pdu.mcs = eNB->target_ue_ul_mcs;
|
UL_alloc_pdu.mcs = eNB->target_ue_ul_mcs;
|
||||||
UL_alloc_pdu.ndi = eNB->proc[thread_id].frame_tx&1;
|
UL_alloc_pdu.ndi = eNB->proc.frame_tx&1;
|
||||||
UL_alloc_pdu.TPC = 0;
|
UL_alloc_pdu.TPC = 0;
|
||||||
if ((cooperation_flag==0) || (cooperation_flag==1))
|
if ((cooperation_flag==0) || (cooperation_flag==1))
|
||||||
UL_alloc_pdu.cshift = 0;
|
UL_alloc_pdu.cshift = 0;
|
||||||
|
|||||||
@@ -101,10 +101,10 @@ extern uint8_t smbv_frame_cnt;
|
|||||||
extern int rx_sig_fifo;
|
extern int rx_sig_fifo;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint8_t is_SR_subframe(PHY_VARS_eNB *eNB,uint8_t UE_id,uint8_t thread_id)
|
uint8_t is_SR_subframe(PHY_VARS_eNB *eNB,uint8_t UE_id)
|
||||||
{
|
{
|
||||||
|
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
const int subframe = proc->subframe_rx;
|
const int subframe = proc->subframe_rx;
|
||||||
const int frame = proc->frame_rx;
|
const int frame = proc->frame_rx;
|
||||||
|
|
||||||
@@ -339,10 +339,10 @@ void phy_procedures_emos_eNB_TX(unsigned char subframe, PHY_VARS_eNB *eNB)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void phy_procedures_eNB_S_RX(unsigned char thread_id,PHY_VARS_eNB *eNB,uint8_t abstraction_flag,relaying_type_t r_type)
|
void phy_procedures_eNB_S_RX(PHY_VARS_eNB *eNB,uint8_t abstraction_flag,relaying_type_t r_type)
|
||||||
{
|
{
|
||||||
UNUSED(r_type);
|
UNUSED(r_type);
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
int subframe = proc->subframe_rx;
|
int subframe = proc->subframe_rx;
|
||||||
|
|
||||||
#ifdef DEBUG_PHY_PROC
|
#ifdef DEBUG_PHY_PROC
|
||||||
@@ -435,14 +435,15 @@ int QPSK2[4]= {AMP_OVER_2|(AMP_OVER_2<<16),AMP_OVER_2|((65536-AMP_OVER_2)<<16),(
|
|||||||
|
|
||||||
unsigned int taus(void);
|
unsigned int taus(void);
|
||||||
|
|
||||||
void pmch_procedures(PHY_VARS_eNB *eNB,PHY_VARS_RN *rn, int subframe,int thread_id,int abstraction_flag,relaying_type_t r_type) {
|
void pmch_procedures(PHY_VARS_eNB *eNB,PHY_VARS_RN *rn, int abstraction_flag,relaying_type_t r_type) {
|
||||||
|
|
||||||
#ifdef Rel10
|
#ifdef Rel10
|
||||||
MCH_PDU *mch_pduP;
|
MCH_PDU *mch_pduP;
|
||||||
MCH_PDU mch_pdu;
|
MCH_PDU mch_pdu;
|
||||||
// uint8_t sync_area=255;
|
// uint8_t sync_area=255;
|
||||||
#endif
|
#endif
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
|
int subframe = proc->subframe_tx;
|
||||||
|
|
||||||
if (abstraction_flag==0) {
|
if (abstraction_flag==0) {
|
||||||
// This is DL-Cell spec pilots in Control region
|
// This is DL-Cell spec pilots in Control region
|
||||||
@@ -507,7 +508,7 @@ void pmch_procedures(PHY_VARS_eNB *eNB,PHY_VARS_RN *rn, int subframe,int thread_
|
|||||||
if (mch_pduP) {
|
if (mch_pduP) {
|
||||||
fill_eNB_dlsch_MCH(eNB,mch_pduP->mcs,1,0, abstraction_flag);
|
fill_eNB_dlsch_MCH(eNB,mch_pduP->mcs,1,0, abstraction_flag);
|
||||||
// Generate PMCH
|
// Generate PMCH
|
||||||
generate_mch(eNB,thread_id,(uint8_t*)mch_pduP->payload,abstraction_flag);
|
generate_mch(eNB,(uint8_t*)mch_pduP->payload,abstraction_flag);
|
||||||
} else {
|
} else {
|
||||||
LOG_D(PHY,"[eNB/RN] Frame %d subframe %d: MCH not generated \n",proc->frame_tx,subframe);
|
LOG_D(PHY,"[eNB/RN] Frame %d subframe %d: MCH not generated \n",proc->frame_tx,subframe);
|
||||||
}
|
}
|
||||||
@@ -515,12 +516,14 @@ void pmch_procedures(PHY_VARS_eNB *eNB,PHY_VARS_RN *rn, int subframe,int thread_
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void common_signal_procedures (int subframe,int thread_id,PHY_VARS_eNB *eNB,int abstraction_flag) {
|
void common_signal_procedures (PHY_VARS_eNB *eNB,int abstraction_flag) {
|
||||||
|
|
||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
int **txdataF = eNB->common_vars.txdataF[0];
|
int **txdataF = eNB->common_vars.txdataF[0];
|
||||||
uint8_t *pbch_pdu=&eNB->pbch_pdu[0];
|
uint8_t *pbch_pdu=&eNB->pbch_pdu[0];
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
|
int subframe = proc->subframe_tx;
|
||||||
|
int frame = proc->frame_tx;
|
||||||
|
|
||||||
// generate Cell-Specific Reference Signals for both slots
|
// generate Cell-Specific Reference Signals for both slots
|
||||||
if (abstraction_flag==0) {
|
if (abstraction_flag==0) {
|
||||||
@@ -557,7 +560,7 @@ void common_signal_procedures (int subframe,int thread_id,PHY_VARS_eNB *eNB,int
|
|||||||
}
|
}
|
||||||
|
|
||||||
// generate PBCH (Physical Broadcast CHannel) info
|
// generate PBCH (Physical Broadcast CHannel) info
|
||||||
if ((proc->frame_tx&3) == 0) {
|
if ((frame&3) == 0) {
|
||||||
pbch_pdu[2] = 0;
|
pbch_pdu[2] = 0;
|
||||||
|
|
||||||
// FIXME setting pbch_pdu[2] to zero makes the switch statement easier: remove all the or-operators
|
// FIXME setting pbch_pdu[2] to zero makes the switch statement easier: remove all the or-operators
|
||||||
@@ -617,8 +620,8 @@ void common_signal_procedures (int subframe,int thread_id,PHY_VARS_eNB *eNB,int
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pbch_pdu[2] = (pbch_pdu[2]&0xfc) | ((proc->frame_tx>>8)&0x3);
|
pbch_pdu[2] = (pbch_pdu[2]&0xfc) | ((frame>>8)&0x3);
|
||||||
pbch_pdu[1] = proc->frame_tx&0xfc;
|
pbch_pdu[1] = frame&0xfc;
|
||||||
pbch_pdu[0] = 0;
|
pbch_pdu[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -640,7 +643,7 @@ void common_signal_procedures (int subframe,int thread_id,PHY_VARS_eNB *eNB,int
|
|||||||
AMP,
|
AMP,
|
||||||
fp,
|
fp,
|
||||||
pbch_pdu,
|
pbch_pdu,
|
||||||
proc->frame_tx&3);
|
frame&3);
|
||||||
}
|
}
|
||||||
#ifdef PHY_ABSTRACTION
|
#ifdef PHY_ABSTRACTION
|
||||||
else {
|
else {
|
||||||
@@ -700,10 +703,12 @@ void common_signal_procedures (int subframe,int thread_id,PHY_VARS_eNB *eNB,int
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void generate_eNB_dlsch_params(const int frame,const int subframe,int thread_id,PHY_VARS_eNB *eNB,DCI_ALLOC_t *dci_alloc,const int UE_id) {
|
void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,DCI_ALLOC_t *dci_alloc,const int UE_id) {
|
||||||
|
|
||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
|
int frame = proc->frame_tx;
|
||||||
|
int subframe = proc->subframe_tx;
|
||||||
|
|
||||||
// if we have SI_RNTI, configure dlsch parameters and CCE index
|
// if we have SI_RNTI, configure dlsch parameters and CCE index
|
||||||
if (dci_alloc->rnti == SI_RNTI) {
|
if (dci_alloc->rnti == SI_RNTI) {
|
||||||
@@ -724,14 +729,14 @@ void generate_eNB_dlsch_params(const int frame,const int subframe,int thread_id,
|
|||||||
|
|
||||||
eNB->dlsch_SI->nCCE[subframe] = dci_alloc->firstCCE;
|
eNB->dlsch_SI->nCCE[subframe] = dci_alloc->firstCCE;
|
||||||
|
|
||||||
LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (SI) => %"PRIu8"\n",eNB->Mod_id,proc->frame_tx,subframe,
|
LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (SI) => %"PRIu8"\n",eNB->Mod_id,frame,subframe,
|
||||||
eNB->dlsch_SI->nCCE[subframe]);
|
eNB->dlsch_SI->nCCE[subframe]);
|
||||||
|
|
||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
|
|
||||||
// configure SI DCI
|
// configure SI DCI
|
||||||
if (smbv_is_config_frame(proc->frame_tx) && (smbv_frame_cnt < 4)) {
|
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4)) {
|
||||||
LOG_D(PHY,"[SMBV] Frame %3d, SI in SF %d DCI %"PRIu32"\n",proc->frame_tx,subframe,i);
|
LOG_D(PHY,"[SMBV] Frame %3d, SI in SF %d DCI %"PRIu32"\n",frame,subframe,i);
|
||||||
smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "SI", dci_alloc, i);
|
smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "SI", dci_alloc, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -757,13 +762,13 @@ void generate_eNB_dlsch_params(const int frame,const int subframe,int thread_id,
|
|||||||
|
|
||||||
eNB->dlsch_ra->nCCE[subframe] = dci_alloc->firstCCE;
|
eNB->dlsch_ra->nCCE[subframe] = dci_alloc->firstCCE;
|
||||||
|
|
||||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA) => %"PRIu8"\n",eNB->Mod_id,proc->frame_tx,subframe,
|
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA) => %"PRIu8"\n",eNB->Mod_id,frame,subframe,
|
||||||
eNB->dlsch_ra->nCCE[subframe]);
|
eNB->dlsch_ra->nCCE[subframe]);
|
||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
|
|
||||||
// configure RA DCI
|
// configure RA DCI
|
||||||
if (smbv_is_config_frame(proc->frame_tx) && (smbv_frame_cnt < 4)) {
|
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4)) {
|
||||||
LOG_D(PHY,"[SMBV] Frame %3d, RA in SF %d DCI %"PRIu32"\n",proc->frame_tx,subframe,i);
|
LOG_D(PHY,"[SMBV] Frame %3d, RA in SF %d DCI %"PRIu32"\n",frame,subframe,i);
|
||||||
smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "RA", dci_alloc, i);
|
smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "RA", dci_alloc, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -781,8 +786,8 @@ void generate_eNB_dlsch_params(const int frame,const int subframe,int thread_id,
|
|||||||
if (UE_id>=0) {
|
if (UE_id>=0) {
|
||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
// Configure this user
|
// Configure this user
|
||||||
if (smbv_is_config_frame(proc->frame_tx) && (smbv_frame_cnt < 4)) {
|
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4)) {
|
||||||
LOG_D(PHY,"[SMBV] Frame %3d, SF %d (SMBV SF %d) Configuring user %d with RNTI %"PRIu16" in TM%"PRIu8"\n",proc->frame_tx,subframe,(smbv_frame_cnt*10) + (subframe),UE_id+1,
|
LOG_D(PHY,"[SMBV] Frame %3d, SF %d (SMBV SF %d) Configuring user %d with RNTI %"PRIu16" in TM%"PRIu8"\n",frame,subframe,(smbv_frame_cnt*10) + (subframe),UE_id+1,
|
||||||
dci_alloc->rnti,eNB->transmission_mode[(uint8_t)UE_id]);
|
dci_alloc->rnti,eNB->transmission_mode[(uint8_t)UE_id]);
|
||||||
smbv_configure_user(smbv_fname,UE_id+1,eNB->transmission_mode[(uint8_t)UE_id],dci_alloc->rnti);
|
smbv_configure_user(smbv_fname,UE_id+1,eNB->transmission_mode[(uint8_t)UE_id],dci_alloc->rnti);
|
||||||
}
|
}
|
||||||
@@ -803,19 +808,19 @@ void generate_eNB_dlsch_params(const int frame,const int subframe,int thread_id,
|
|||||||
P_RNTI,
|
P_RNTI,
|
||||||
eNB->UE_stats[(uint8_t)UE_id].DL_pmi_single);
|
eNB->UE_stats[(uint8_t)UE_id].DL_pmi_single);
|
||||||
LOG_D(PHY,"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d subframe %d: Generated dlsch params\n",
|
LOG_D(PHY,"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d subframe %d: Generated dlsch params\n",
|
||||||
eNB->Mod_id,dci_alloc->rnti,eNB->dlsch[(uint8_t)UE_id][0]->current_harq_pid,proc->frame_tx,subframe);
|
eNB->Mod_id,dci_alloc->rnti,eNB->dlsch[(uint8_t)UE_id][0]->current_harq_pid,frame,subframe);
|
||||||
|
|
||||||
|
|
||||||
eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe] = dci_alloc->firstCCE;
|
eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe] = dci_alloc->firstCCE;
|
||||||
|
|
||||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"/%u\n",eNB->Mod_id,proc->frame_tx,subframe,
|
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"/%u\n",eNB->Mod_id,frame,subframe,
|
||||||
dci_alloc->rnti,eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe]);
|
dci_alloc->rnti,eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe]);
|
||||||
|
|
||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
|
|
||||||
// configure UE-spec DCI
|
// configure UE-spec DCI
|
||||||
if (smbv_is_config_frame(proc->frame_tx) && (smbv_frame_cnt < 4)) {
|
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4)) {
|
||||||
LOG_D(PHY,"[SMBV] Frame %3d, PDSCH in SF %d DCI %"PRIu32"\n",proc->frame_tx,subframe,i);
|
LOG_D(PHY,"[SMBV] Frame %3d, PDSCH in SF %d DCI %"PRIu32"\n",frame,subframe,i);
|
||||||
smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1,dci_alloc, i);
|
smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1,dci_alloc, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -823,43 +828,44 @@ void generate_eNB_dlsch_params(const int frame,const int subframe,int thread_id,
|
|||||||
|
|
||||||
LOG_D(PHY,"[eNB %"PRIu8"][DCI][PDSCH %"PRIx16"] Frame %d subframe %d UE_id %"PRId8" Generated DCI format %d, aggregation %d\n",
|
LOG_D(PHY,"[eNB %"PRIu8"][DCI][PDSCH %"PRIx16"] Frame %d subframe %d UE_id %"PRId8" Generated DCI format %d, aggregation %d\n",
|
||||||
eNB->Mod_id, dci_alloc->rnti,
|
eNB->Mod_id, dci_alloc->rnti,
|
||||||
proc->frame_tx, subframe,UE_id,
|
frame, subframe,UE_id,
|
||||||
dci_alloc->format,
|
dci_alloc->format,
|
||||||
1<<dci_alloc->L);
|
1<<dci_alloc->L);
|
||||||
} else {
|
} else {
|
||||||
LOG_D(PHY,"[eNB %"PRIu8"][PDSCH] Frame %d : No UE_id with corresponding rnti %"PRIx16", dropping DLSCH\n",
|
LOG_D(PHY,"[eNB %"PRIu8"][PDSCH] Frame %d : No UE_id with corresponding rnti %"PRIx16", dropping DLSCH\n",
|
||||||
eNB->Mod_id,proc->frame_tx,dci_alloc->rnti);
|
eNB->Mod_id,frame,dci_alloc->rnti);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void generate_eNB_ulsch_params(const int frame,const int subframe,int thread_id,PHY_VARS_eNB *eNB,DCI_ALLOC_t *dci_alloc,const int UE_id) {
|
void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,DCI_ALLOC_t *dci_alloc,const int UE_id) {
|
||||||
|
|
||||||
int harq_pid;
|
int harq_pid;
|
||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
|
int frame = proc->frame_tx;
|
||||||
|
int subframe = proc->frame_rx;
|
||||||
|
|
||||||
LOG_D(PHY,
|
LOG_D(PHY,
|
||||||
"[eNB %"PRIu8"][PUSCH %"PRIu8"] Frame %d subframe %d UL Frame %"PRIu32", UL Subframe %"PRIu8", Generated ULSCH (format0) DCI (rnti %"PRIx16", dci %"PRIx8"), aggregation %d\n",
|
"[eNB %"PRIu8"][PUSCH %"PRIu8"] Frame %d subframe %d UL Frame %"PRIu32", UL Subframe %"PRIu8", Generated ULSCH (format0) DCI (rnti %"PRIx16", dci %"PRIx8"), aggregation %d\n",
|
||||||
eNB->Mod_id,
|
eNB->Mod_id,
|
||||||
subframe2harq_pid(fp,
|
subframe2harq_pid(fp,
|
||||||
pdcch_alloc2ul_frame(fp,proc->frame_tx,subframe),
|
pdcch_alloc2ul_frame(fp,frame,subframe),
|
||||||
pdcch_alloc2ul_subframe(fp,subframe)),
|
pdcch_alloc2ul_subframe(fp,subframe)),
|
||||||
proc->frame_tx,
|
frame,
|
||||||
subframe,
|
subframe,
|
||||||
pdcch_alloc2ul_frame(fp,proc->frame_tx,subframe),
|
pdcch_alloc2ul_frame(fp,frame,subframe),
|
||||||
pdcch_alloc2ul_subframe(fp,subframe),
|
pdcch_alloc2ul_subframe(fp,subframe),
|
||||||
dci_alloc->rnti,
|
dci_alloc->rnti,
|
||||||
dci_alloc->dci_pdu[0],
|
dci_alloc->dci_pdu[0],
|
||||||
1<<dci_alloc->L);
|
1<<dci_alloc->L);
|
||||||
|
|
||||||
generate_eNB_ulsch_params_from_dci(&dci_alloc->dci_pdu[0],
|
generate_eNB_ulsch_params_from_dci(eNB,
|
||||||
|
&dci_alloc->dci_pdu[0],
|
||||||
dci_alloc->rnti,
|
dci_alloc->rnti,
|
||||||
thread_id,
|
|
||||||
format0,
|
format0,
|
||||||
UE_id,
|
UE_id,
|
||||||
eNB,
|
|
||||||
SI_RNTI,
|
SI_RNTI,
|
||||||
0,
|
0,
|
||||||
P_RNTI,
|
P_RNTI,
|
||||||
@@ -867,14 +873,14 @@ void generate_eNB_ulsch_params(const int frame,const int subframe,int thread_id,
|
|||||||
0); // do_srs
|
0); // do_srs
|
||||||
|
|
||||||
LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d\n",
|
LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d\n",
|
||||||
eNB->Mod_id,proc->frame_tx,subframe,dci_alloc->rnti,
|
eNB->Mod_id,frame,subframe,dci_alloc->rnti,
|
||||||
dci_alloc->firstCCE);
|
dci_alloc->firstCCE);
|
||||||
|
|
||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
|
|
||||||
// configure UE-spec DCI for UL Grant
|
// configure UE-spec DCI for UL Grant
|
||||||
if (smbv_is_config_frame(proc->frame_tx) && (smbv_frame_cnt < 4)) {
|
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4)) {
|
||||||
LOG_D(PHY,"[SMBV] Frame %3d, SF %d UL DCI %"PRIu32"\n",proc->frame_tx,subframe,i);
|
LOG_D(PHY,"[SMBV] Frame %3d, SF %d UL DCI %"PRIu32"\n",frame,subframe,i);
|
||||||
smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i);
|
smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -883,11 +889,11 @@ void generate_eNB_ulsch_params(const int frame,const int subframe,int thread_id,
|
|||||||
|
|
||||||
// get the hard_pid for this subframe
|
// get the hard_pid for this subframe
|
||||||
harq_pid = subframe2harq_pid(fp,
|
harq_pid = subframe2harq_pid(fp,
|
||||||
pdcch_alloc2ul_frame(fp,proc->frame_tx,subframe),
|
pdcch_alloc2ul_frame(fp,frame,subframe),
|
||||||
pdcch_alloc2ul_subframe(fp,subframe));
|
pdcch_alloc2ul_subframe(fp,subframe));
|
||||||
|
|
||||||
if (harq_pid==255) { // should not happen, log an error and exit, this is a fatal error
|
if (harq_pid==255) { // should not happen, log an error and exit, this is a fatal error
|
||||||
LOG_E(PHY,"[eNB %"PRIu8"] Frame %d: Bad harq_pid for ULSCH allocation\n",eNB->Mod_id,proc->frame_tx);
|
LOG_E(PHY,"[eNB %"PRIu8"] Frame %d: Bad harq_pid for ULSCH allocation\n",eNB->Mod_id,frame);
|
||||||
mac_xface->macphy_exit("FATAL\n");
|
mac_xface->macphy_exit("FATAL\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -898,9 +904,11 @@ void generate_eNB_ulsch_params(const int frame,const int subframe,int thread_id,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1,LTE_eNB_UE_stats *ue_stats,int ra_flag,int subframe,int thread_id,int num_pdcch_symbols,int abstraction_flag) {
|
void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1,LTE_eNB_UE_stats *ue_stats,int ra_flag,int num_pdcch_symbols,int abstraction_flag) {
|
||||||
|
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
|
int frame=proc->frame_tx;
|
||||||
|
int subframe=proc->subframe_tx;
|
||||||
int harq_pid = dlsch->current_harq_pid;
|
int harq_pid = dlsch->current_harq_pid;
|
||||||
LTE_DL_eNB_HARQ_t *dlsch_harq=dlsch->harq_processes[harq_pid];
|
LTE_DL_eNB_HARQ_t *dlsch_harq=dlsch->harq_processes[harq_pid];
|
||||||
int input_buffer_length = dlsch_harq->TBS/8;
|
int input_buffer_length = dlsch_harq->TBS/8;
|
||||||
@@ -913,13 +921,13 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t
|
|||||||
LOG_D(PHY,
|
LOG_D(PHY,
|
||||||
"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")\n",
|
"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")\n",
|
||||||
eNB->Mod_id, dlsch->rnti,harq_pid,
|
eNB->Mod_id, dlsch->rnti,harq_pid,
|
||||||
proc->frame_tx, subframe, input_buffer_length,
|
frame, subframe, input_buffer_length,
|
||||||
get_G(fp,
|
get_G(fp,
|
||||||
dlsch_harq->nb_rb,
|
dlsch_harq->nb_rb,
|
||||||
dlsch_harq->rb_alloc,
|
dlsch_harq->rb_alloc,
|
||||||
get_Qm(dlsch_harq->mcs),
|
get_Qm(dlsch_harq->mcs),
|
||||||
dlsch_harq->Nl,
|
dlsch_harq->Nl,
|
||||||
num_pdcch_symbols,proc->frame_tx,subframe),
|
num_pdcch_symbols,frame,subframe),
|
||||||
dlsch_harq->nb_rb,
|
dlsch_harq->nb_rb,
|
||||||
dlsch_harq->mcs,
|
dlsch_harq->mcs,
|
||||||
pmi2hex_2Ar1(dlsch_harq->pmi_alloc),
|
pmi2hex_2Ar1(dlsch_harq->pmi_alloc),
|
||||||
@@ -931,14 +939,14 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t
|
|||||||
MSC_PHY_ENB,MSC_PHY_UE,
|
MSC_PHY_ENB,MSC_PHY_UE,
|
||||||
NULL,0,
|
NULL,0,
|
||||||
"%05u:%02u PDSCH/DLSCH input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")",
|
"%05u:%02u PDSCH/DLSCH input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")",
|
||||||
proc->frame_tx, subframe,
|
frame, subframe,
|
||||||
input_buffer_length,
|
input_buffer_length,
|
||||||
get_G(fp,
|
get_G(fp,
|
||||||
dlsch_harq->nb_rb,
|
dlsch_harq->nb_rb,
|
||||||
dlsch_harq->rb_alloc,
|
dlsch_harq->rb_alloc,
|
||||||
get_Qm(dlsch_harq->mcs),
|
get_Qm(dlsch_harq->mcs),
|
||||||
dlsch_harq->Nl,
|
dlsch_harq->Nl,
|
||||||
num_pdcch_symbols,proc->frame_tx,subframe),
|
num_pdcch_symbols,frame,subframe),
|
||||||
dlsch_harq->nb_rb,
|
dlsch_harq->nb_rb,
|
||||||
dlsch_harq->mcs,
|
dlsch_harq->mcs,
|
||||||
pmi2hex_2Ar1(dlsch_harq->pmi_alloc),
|
pmi2hex_2Ar1(dlsch_harq->pmi_alloc),
|
||||||
@@ -957,14 +965,14 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t
|
|||||||
if (ra_flag == 0) {
|
if (ra_flag == 0) {
|
||||||
DLSCH_pdu = mac_xface->get_dlsch_sdu(eNB->Mod_id,
|
DLSCH_pdu = mac_xface->get_dlsch_sdu(eNB->Mod_id,
|
||||||
eNB->CC_id,
|
eNB->CC_id,
|
||||||
proc->frame_tx,
|
frame,
|
||||||
dlsch->rnti,
|
dlsch->rnti,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int16_t crnti = mac_xface->fill_rar(eNB->Mod_id,
|
int16_t crnti = mac_xface->fill_rar(eNB->Mod_id,
|
||||||
eNB->CC_id,
|
eNB->CC_id,
|
||||||
proc->frame_tx,
|
frame,
|
||||||
DLSCH_pdu_rar,
|
DLSCH_pdu_rar,
|
||||||
fp->N_RB_UL,
|
fp->N_RB_UL,
|
||||||
input_buffer_length);
|
input_buffer_length);
|
||||||
@@ -981,7 +989,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t
|
|||||||
LOG_W(PHY,"[eNB] Max user count reached.\n");
|
LOG_W(PHY,"[eNB] Max user count reached.\n");
|
||||||
mac_xface->cancel_ra_proc(eNB->Mod_id,
|
mac_xface->cancel_ra_proc(eNB->Mod_id,
|
||||||
eNB->CC_id,
|
eNB->CC_id,
|
||||||
proc->frame_tx,
|
frame,
|
||||||
crnti);
|
crnti);
|
||||||
} else {
|
} else {
|
||||||
eNB->UE_stats[(uint32_t)UE_id].mode = RA_RESPONSE;
|
eNB->UE_stats[(uint32_t)UE_id].mode = RA_RESPONSE;
|
||||||
@@ -989,7 +997,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t
|
|||||||
eNB->first_sr[(uint32_t)UE_id] = 1;
|
eNB->first_sr[(uint32_t)UE_id] = 1;
|
||||||
|
|
||||||
generate_eNB_ulsch_params_from_rar(DLSCH_pdu,
|
generate_eNB_ulsch_params_from_rar(DLSCH_pdu,
|
||||||
proc->frame_tx,
|
frame,
|
||||||
(subframe),
|
(subframe),
|
||||||
eNB->ulsch[(uint32_t)UE_id],
|
eNB->ulsch[(uint32_t)UE_id],
|
||||||
fp);
|
fp);
|
||||||
@@ -998,11 +1006,11 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t
|
|||||||
|
|
||||||
get_Msg3_alloc(fp,
|
get_Msg3_alloc(fp,
|
||||||
subframe,
|
subframe,
|
||||||
proc->frame_tx,
|
frame,
|
||||||
&eNB->ulsch[(uint32_t)UE_id]->Msg3_frame,
|
&eNB->ulsch[(uint32_t)UE_id]->Msg3_frame,
|
||||||
&eNB->ulsch[(uint32_t)UE_id]->Msg3_subframe);
|
&eNB->ulsch[(uint32_t)UE_id]->Msg3_subframe);
|
||||||
LOG_D(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n",
|
LOG_D(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n",
|
||||||
proc->frame_tx,
|
frame,
|
||||||
subframe,
|
subframe,
|
||||||
UE_id,
|
UE_id,
|
||||||
eNB->ulsch[(uint32_t)UE_id]->Msg3_frame,
|
eNB->ulsch[(uint32_t)UE_id]->Msg3_frame,
|
||||||
@@ -1021,8 +1029,8 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t
|
|||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
|
|
||||||
// Configures the data source of allocation (allocation is configured by DCI)
|
// Configures the data source of allocation (allocation is configured by DCI)
|
||||||
if (smbv_is_config_frame(proc->frame_tx) && (smbv_frame_cnt < 4)) {
|
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4)) {
|
||||||
LOG_D(PHY,"[SMBV] Frame %3d, Configuring PDSCH payload in SF %d alloc %"PRIu8"\n",proc->frame_tx,(smbv_frame_cnt*10) + (subframe),smbv_alloc_cnt);
|
LOG_D(PHY,"[SMBV] Frame %3d, Configuring PDSCH payload in SF %d alloc %"PRIu8"\n",frame,(smbv_frame_cnt*10) + (subframe),smbv_alloc_cnt);
|
||||||
// smbv_configure_datalist_for_user(smbv_fname, find_ue(dlsch->rnti,eNB)+1, DLSCH_pdu, input_buffer_length);
|
// smbv_configure_datalist_for_user(smbv_fname, find_ue(dlsch->rnti,eNB)+1, DLSCH_pdu, input_buffer_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1057,7 +1065,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t
|
|||||||
fp,
|
fp,
|
||||||
num_pdcch_symbols,
|
num_pdcch_symbols,
|
||||||
dlsch,
|
dlsch,
|
||||||
proc->frame_tx,subframe,
|
frame,subframe,
|
||||||
&eNB->dlsch_rate_matching_stats,
|
&eNB->dlsch_rate_matching_stats,
|
||||||
&eNB->dlsch_turbo_encoding_stats,
|
&eNB->dlsch_turbo_encoding_stats,
|
||||||
&eNB->dlsch_interleaving_stats);
|
&eNB->dlsch_interleaving_stats);
|
||||||
@@ -1072,7 +1080,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t
|
|||||||
dlsch_harq->rb_alloc,
|
dlsch_harq->rb_alloc,
|
||||||
get_Qm(dlsch_harq->mcs),
|
get_Qm(dlsch_harq->mcs),
|
||||||
dlsch_harq->Nl,
|
dlsch_harq->Nl,
|
||||||
num_pdcch_symbols,proc->frame_tx,subframe),
|
num_pdcch_symbols,frame,subframe),
|
||||||
0,
|
0,
|
||||||
subframe<<1);
|
subframe<<1);
|
||||||
stop_meas(&eNB->dlsch_scrambling_stats);
|
stop_meas(&eNB->dlsch_scrambling_stats);
|
||||||
@@ -1103,14 +1111,15 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t
|
|||||||
dlsch->active = 0;
|
dlsch->active = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void phy_procedures_eNB_TX(unsigned char thread_id,
|
void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||||
PHY_VARS_eNB *eNB,
|
|
||||||
uint8_t abstraction_flag,
|
uint8_t abstraction_flag,
|
||||||
relaying_type_t r_type,
|
relaying_type_t r_type,
|
||||||
PHY_VARS_RN *rn)
|
PHY_VARS_RN *rn)
|
||||||
{
|
{
|
||||||
UNUSED(rn);
|
UNUSED(rn);
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
|
int frame=proc->frame_tx;
|
||||||
|
int subframe=proc->subframe_tx;
|
||||||
// uint16_t input_buffer_length;
|
// uint16_t input_buffer_length;
|
||||||
uint32_t i,aa;
|
uint32_t i,aa;
|
||||||
uint8_t harq_pid;
|
uint8_t harq_pid;
|
||||||
@@ -1128,8 +1137,6 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
// there is at least one allocation for PDCCH
|
// there is at least one allocation for PDCCH
|
||||||
uint8_t smbv_alloc_cnt = 1;
|
uint8_t smbv_alloc_cnt = 1;
|
||||||
#endif
|
#endif
|
||||||
int frame = proc->frame_tx;
|
|
||||||
int subframe = proc->subframe_tx;
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX,1);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX,1);
|
||||||
start_meas(&eNB->phy_proc_tx);
|
start_meas(&eNB->phy_proc_tx);
|
||||||
@@ -1157,7 +1164,7 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
// This is called only for the CC_id = 0 and triggers scheduling for all CC_id's
|
// This is called only for the CC_id = 0 and triggers scheduling for all CC_id's
|
||||||
if (eNB->mac_enabled==1) {
|
if (eNB->mac_enabled==1) {
|
||||||
if (eNB->CC_id == 0) {
|
if (eNB->CC_id == 0) {
|
||||||
mac_xface->eNB_dlsch_ulsch_scheduler(eNB->Mod_id,0,proc->frame_tx,subframe);//,1);
|
mac_xface->eNB_dlsch_ulsch_scheduler(eNB->Mod_id,0,frame,subframe);//,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1169,18 +1176,18 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_pmch_subframe(proc->frame_tx,subframe,fp)) {
|
if (is_pmch_subframe(frame,subframe,fp)) {
|
||||||
pmch_procedures(eNB,rn,subframe,thread_id,abstraction_flag,r_type);
|
pmch_procedures(eNB,rn,abstraction_flag,r_type);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// this is not a pmch subframe, so generate PSS/SSS/PBCH
|
// this is not a pmch subframe, so generate PSS/SSS/PBCH
|
||||||
common_signal_procedures(subframe,thread_id,eNB,abstraction_flag);
|
common_signal_procedures(eNB,abstraction_flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
|
|
||||||
// PBCH takes one allocation
|
// PBCH takes one allocation
|
||||||
if (smbv_is_config_frame(proc->frame_tx) && (smbv_frame_cnt < 4)) {
|
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4)) {
|
||||||
if (subframe==0)
|
if (subframe==0)
|
||||||
smbv_alloc_cnt++;
|
smbv_alloc_cnt++;
|
||||||
}
|
}
|
||||||
@@ -1192,21 +1199,21 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1);
|
||||||
DCI_pdu = mac_xface->get_dci_sdu(eNB->Mod_id,
|
DCI_pdu = mac_xface->get_dci_sdu(eNB->Mod_id,
|
||||||
eNB->CC_id,
|
eNB->CC_id,
|
||||||
proc->frame_tx,
|
frame,
|
||||||
subframe);
|
subframe);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DCI_pdu = &DCI_pdu_tmp;
|
DCI_pdu = &DCI_pdu_tmp;
|
||||||
#ifdef EMOS_CHANNEL
|
#ifdef EMOS_CHANNEL
|
||||||
fill_dci_emos(DCI_pdu,thread_id,eNB);
|
fill_dci_emos(DCI_pdu,eNB);
|
||||||
#else
|
#else
|
||||||
fill_dci(DCI_pdu,thread_id,eNB);
|
fill_dci(DCI_pdu,eNB);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear existing ulsch dci allocations before applying info from MAC (this is table
|
// clear existing ulsch dci allocations before applying info from MAC (this is table
|
||||||
ul_subframe = pdcch_alloc2ul_subframe(fp,subframe);
|
ul_subframe = pdcch_alloc2ul_subframe(fp,subframe);
|
||||||
ul_frame = pdcch_alloc2ul_frame(fp,proc->frame_tx,subframe);
|
ul_frame = pdcch_alloc2ul_frame(fp,frame,subframe);
|
||||||
|
|
||||||
if ((subframe_select(fp,ul_subframe)==SF_UL) ||
|
if ((subframe_select(fp,ul_subframe)==SF_UL) ||
|
||||||
(fp->frame_type == FDD)) {
|
(fp->frame_type == FDD)) {
|
||||||
@@ -1232,8 +1239,8 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
|
|
||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
// Sets up PDCCH and DCI table
|
// Sets up PDCCH and DCI table
|
||||||
if (smbv_is_config_frame(proc->frame_tx) && (smbv_frame_cnt < 4) && ((DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci)>0)) {
|
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4) && ((DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci)>0)) {
|
||||||
LOG_D(PHY,"[SMBV] Frame %3d, SF %d PDCCH, number of DCIs %d\n",proc->frame_tx,subframe,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci);
|
LOG_D(PHY,"[SMBV] Frame %3d, SF %d PDCCH, number of DCIs %d\n",frame,subframe,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci);
|
||||||
dump_dci(fp,&DCI_pdu->dci_alloc[0]);
|
dump_dci(fp,&DCI_pdu->dci_alloc[0]);
|
||||||
smbv_configure_pdcch(smbv_fname,(smbv_frame_cnt*10) + (subframe),num_pdcch_symbols,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci);
|
smbv_configure_pdcch(smbv_fname,(smbv_frame_cnt*10) + (subframe),num_pdcch_symbols,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci);
|
||||||
}
|
}
|
||||||
@@ -1258,7 +1265,7 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
}
|
}
|
||||||
else UE_id=0;
|
else UE_id=0;
|
||||||
|
|
||||||
generate_eNB_dlsch_params(frame,subframe,thread_id,eNB,dci_alloc,UE_id);
|
generate_eNB_dlsch_params(eNB,dci_alloc,UE_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1277,10 +1284,10 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
UE_id = i;
|
UE_id = i;
|
||||||
|
|
||||||
if (UE_id<0) { // should not happen, log an error and exit, this is a fatal error
|
if (UE_id<0) { // should not happen, log an error and exit, this is a fatal error
|
||||||
LOG_E(PHY,"[eNB %"PRIu8"] Frame %d: Unknown UE_id for rnti %"PRIx16"\n",eNB->Mod_id,proc->frame_tx,dci_alloc->rnti);
|
LOG_E(PHY,"[eNB %"PRIu8"] Frame %d: Unknown UE_id for rnti %"PRIx16"\n",eNB->Mod_id,frame,dci_alloc->rnti);
|
||||||
mac_xface->macphy_exit("FATAL\n");
|
mac_xface->macphy_exit("FATAL\n");
|
||||||
}
|
}
|
||||||
generate_eNB_ulsch_params(frame,subframe,thread_id,eNB,dci_alloc,UE_id);
|
generate_eNB_ulsch_params(eNB,dci_alloc,UE_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1300,7 +1307,7 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
if (abstraction_flag == 0) {
|
if (abstraction_flag == 0) {
|
||||||
|
|
||||||
if (DCI_pdu->Num_ue_spec_dci+DCI_pdu->Num_common_dci > 0)
|
if (DCI_pdu->Num_ue_spec_dci+DCI_pdu->Num_common_dci > 0)
|
||||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (common %"PRIu8",ue_spec %"PRIu8")\n",eNB->Mod_id,proc->frame_tx, subframe,
|
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (common %"PRIu8",ue_spec %"PRIu8")\n",eNB->Mod_id,frame, subframe,
|
||||||
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
|
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
|
||||||
|
|
||||||
num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci,
|
num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci,
|
||||||
@@ -1316,7 +1323,7 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
|
|
||||||
#ifdef PHY_ABSTRACTION // FIXME this ifdef seems suspicious
|
#ifdef PHY_ABSTRACTION // FIXME this ifdef seems suspicious
|
||||||
else {
|
else {
|
||||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_to_emul\n",eNB->Mod_id,proc->frame_tx, subframe);
|
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_to_emul\n",eNB->Mod_id,frame, subframe);
|
||||||
num_pdcch_symbols = generate_dci_top_emul(eNB,DCI_pdu->Num_ue_spec_dci,DCI_pdu->Num_common_dci,DCI_pdu->dci_alloc,subframe);
|
num_pdcch_symbols = generate_dci_top_emul(eNB,DCI_pdu->Num_ue_spec_dci,DCI_pdu->Num_common_dci,DCI_pdu->dci_alloc,subframe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1328,13 +1335,13 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
|
|
||||||
if (eNB->dlsch_SI->active == 1) {
|
if (eNB->dlsch_SI->active == 1) {
|
||||||
|
|
||||||
pdsch_procedures(eNB,eNB->dlsch_SI,(LTE_eNB_DLSCH_t*)NULL,(LTE_eNB_UE_stats*)NULL,0,subframe,thread_id,num_pdcch_symbols,abstraction_flag);
|
pdsch_procedures(eNB,eNB->dlsch_SI,(LTE_eNB_DLSCH_t*)NULL,(LTE_eNB_UE_stats*)NULL,0,num_pdcch_symbols,abstraction_flag);
|
||||||
|
|
||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
|
|
||||||
// Configures the data source of allocation (allocation is configured by DCI)
|
// Configures the data source of allocation (allocation is configured by DCI)
|
||||||
if (smbv_is_config_frame(proc->frame_tx) && (smbv_frame_cnt < 4)) {
|
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4)) {
|
||||||
LOG_D(PHY,"[SMBV] Frame %3d, Configuring SI payload in SF %d alloc %"PRIu8"\n",proc->frame_tx,(smbv_frame_cnt*10) + (subframe),smbv_alloc_cnt);
|
LOG_D(PHY,"[SMBV] Frame %3d, Configuring SI payload in SF %d alloc %"PRIu8"\n",frame,(smbv_frame_cnt*10) + (subframe),smbv_alloc_cnt);
|
||||||
smbv_configure_datalist_for_alloc(smbv_fname, smbv_alloc_cnt++, (smbv_frame_cnt*10) + (subframe), DLSCH_pdu, input_buffer_length);
|
smbv_configure_datalist_for_alloc(smbv_fname, smbv_alloc_cnt++, (smbv_frame_cnt*10) + (subframe), DLSCH_pdu, input_buffer_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1347,8 +1354,8 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
|
|
||||||
// Configures the data source of allocation (allocation is configured by DCI)
|
// Configures the data source of allocation (allocation is configured by DCI)
|
||||||
if (smbv_is_config_frame(proc->frame_tx) && (smbv_frame_cnt < 4)) {
|
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4)) {
|
||||||
LOG_D(PHY,"[SMBV] Frame %3d, Configuring RA payload in SF %d alloc %"PRIu8"\n",proc->frame_tx,(smbv_frame_cnt*10) + (subframe),smbv_alloc_cnt);
|
LOG_D(PHY,"[SMBV] Frame %3d, Configuring RA payload in SF %d alloc %"PRIu8"\n",frame,(smbv_frame_cnt*10) + (subframe),smbv_alloc_cnt);
|
||||||
smbv_configure_datalist_for_alloc(smbv_fname, smbv_alloc_cnt++, (smbv_frame_cnt*10) + (subframe), dlsch_input_buffer, input_buffer_length);
|
smbv_configure_datalist_for_alloc(smbv_fname, smbv_alloc_cnt++, (smbv_frame_cnt*10) + (subframe), dlsch_input_buffer, input_buffer_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1357,11 +1364,11 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
|
|
||||||
LOG_D(PHY,"[eNB %"PRIu8"][RAPROC] Frame %d, subframe %d: Calling generate_dlsch (RA),Msg3 frame %"PRIu32", Msg3 subframe %"PRIu8"\n",
|
LOG_D(PHY,"[eNB %"PRIu8"][RAPROC] Frame %d, subframe %d: Calling generate_dlsch (RA),Msg3 frame %"PRIu32", Msg3 subframe %"PRIu8"\n",
|
||||||
eNB->Mod_id,
|
eNB->Mod_id,
|
||||||
proc->frame_tx, subframe,
|
frame, subframe,
|
||||||
eNB->ulsch[(uint32_t)UE_id]->Msg3_frame,
|
eNB->ulsch[(uint32_t)UE_id]->Msg3_frame,
|
||||||
eNB->ulsch[(uint32_t)UE_id]->Msg3_subframe);
|
eNB->ulsch[(uint32_t)UE_id]->Msg3_subframe);
|
||||||
|
|
||||||
pdsch_procedures(eNB,eNB->dlsch_ra,(LTE_eNB_DLSCH_t*)NULL,(LTE_eNB_UE_stats*)NULL,1,subframe,thread_id,num_pdcch_symbols,abstraction_flag);
|
pdsch_procedures(eNB,eNB->dlsch_ra,(LTE_eNB_DLSCH_t*)NULL,(LTE_eNB_UE_stats*)NULL,1,num_pdcch_symbols,abstraction_flag);
|
||||||
|
|
||||||
|
|
||||||
eNB->dlsch_ra->active = 0;
|
eNB->dlsch_ra->active = 0;
|
||||||
@@ -1374,7 +1381,7 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
(eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&&
|
(eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&&
|
||||||
(eNB->dlsch[(uint8_t)UE_id][0]->active == 1)) {
|
(eNB->dlsch[(uint8_t)UE_id][0]->active == 1)) {
|
||||||
|
|
||||||
pdsch_procedures(eNB,eNB->dlsch[(uint8_t)UE_id][0],eNB->dlsch[(uint8_t)UE_id][1],&eNB->UE_stats[(uint32_t)UE_id],0,subframe,thread_id,num_pdcch_symbols,abstraction_flag);
|
pdsch_procedures(eNB,eNB->dlsch[(uint8_t)UE_id][0],eNB->dlsch[(uint8_t)UE_id][1],&eNB->UE_stats[(uint32_t)UE_id],0,num_pdcch_symbols,abstraction_flag);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1395,7 +1402,6 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
if (is_phich_subframe(fp,subframe))
|
if (is_phich_subframe(fp,subframe))
|
||||||
{
|
{
|
||||||
generate_phich_top(eNB,
|
generate_phich_top(eNB,
|
||||||
thread_id,
|
|
||||||
AMP,
|
AMP,
|
||||||
0,
|
0,
|
||||||
abstraction_flag);
|
abstraction_flag);
|
||||||
@@ -1414,11 +1420,11 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
start_meas(&eNB->ofdm_mod_stats);
|
start_meas(&eNB->ofdm_mod_stats);
|
||||||
do_OFDM_mod(eNB->common_vars.txdataF[0],
|
do_OFDM_mod(eNB->common_vars.txdataF[0],
|
||||||
eNB->common_vars.txdata[0],
|
eNB->common_vars.txdata[0],
|
||||||
proc->frame_tx,subframe<<1,
|
frame,subframe<<1,
|
||||||
fp);
|
fp);
|
||||||
do_OFDM_mod(eNB->common_vars.txdataF[0],
|
do_OFDM_mod(eNB->common_vars.txdataF[0],
|
||||||
eNB->common_vars.txdata[0],
|
eNB->common_vars.txdata[0],
|
||||||
proc->frame_tx,1+(subframe<<1),
|
frame,1+(subframe<<1),
|
||||||
fp);
|
fp);
|
||||||
stop_meas(&eNB->ofdm_mod_stats);
|
stop_meas(&eNB->ofdm_mod_stats);
|
||||||
}
|
}
|
||||||
@@ -1431,10 +1437,10 @@ void phy_procedures_eNB_TX(unsigned char thread_id,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void process_Msg3(PHY_VARS_eNB *eNB,uint8_t thread_id,uint8_t UE_id, uint8_t harq_pid)
|
void process_Msg3(PHY_VARS_eNB *eNB,uint8_t UE_id, uint8_t harq_pid)
|
||||||
{
|
{
|
||||||
// this prepares the demodulation of the first PUSCH of a new user, containing Msg3
|
// this prepares the demodulation of the first PUSCH of a new user, containing Msg3
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
int subframe = proc->subframe_rx;
|
int subframe = proc->subframe_rx;
|
||||||
int frame = proc->frame_rx;
|
int frame = proc->frame_rx;
|
||||||
|
|
||||||
@@ -1468,7 +1474,6 @@ void process_Msg3(PHY_VARS_eNB *eNB,uint8_t thread_id,uint8_t UE_id, uint8_t har
|
|||||||
// rate-adaptation based on the error statistics derived from the ACK/NAK process
|
// rate-adaptation based on the error statistics derived from the ACK/NAK process
|
||||||
|
|
||||||
void process_HARQ_feedback(uint8_t UE_id,
|
void process_HARQ_feedback(uint8_t UE_id,
|
||||||
uint8_t thread_id,
|
|
||||||
PHY_VARS_eNB *eNB,
|
PHY_VARS_eNB *eNB,
|
||||||
uint8_t pusch_flag,
|
uint8_t pusch_flag,
|
||||||
uint8_t *pucch_payload,
|
uint8_t *pucch_payload,
|
||||||
@@ -1476,7 +1481,7 @@ void process_HARQ_feedback(uint8_t UE_id,
|
|||||||
uint8_t SR_payload)
|
uint8_t SR_payload)
|
||||||
{
|
{
|
||||||
|
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
uint8_t dl_harq_pid[8],dlsch_ACK[8],dl_subframe;
|
uint8_t dl_harq_pid[8],dlsch_ACK[8],dl_subframe;
|
||||||
LTE_eNB_DLSCH_t *dlsch = eNB->dlsch[(uint32_t)UE_id][0];
|
LTE_eNB_DLSCH_t *dlsch = eNB->dlsch[(uint32_t)UE_id][0];
|
||||||
@@ -1741,14 +1746,13 @@ void process_HARQ_feedback(uint8_t UE_id,
|
|||||||
|
|
||||||
void get_n1_pucch_eNB(PHY_VARS_eNB *eNB,
|
void get_n1_pucch_eNB(PHY_VARS_eNB *eNB,
|
||||||
uint8_t UE_id,
|
uint8_t UE_id,
|
||||||
uint8_t thread_id,
|
|
||||||
int16_t *n1_pucch0,
|
int16_t *n1_pucch0,
|
||||||
int16_t *n1_pucch1,
|
int16_t *n1_pucch1,
|
||||||
int16_t *n1_pucch2,
|
int16_t *n1_pucch2,
|
||||||
int16_t *n1_pucch3)
|
int16_t *n1_pucch3)
|
||||||
{
|
{
|
||||||
|
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
LTE_DL_FRAME_PARMS *frame_parms=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *frame_parms=&eNB->frame_parms;
|
||||||
uint8_t nCCE0,nCCE1;
|
uint8_t nCCE0,nCCE1;
|
||||||
int sf;
|
int sf;
|
||||||
@@ -1880,7 +1884,7 @@ void get_n1_pucch_eNB(PHY_VARS_eNB *eNB,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void prach_procedures(PHY_VARS_eNB *eNB,uint8_t thread_id,uint8_t abstraction_flag)
|
void prach_procedures(PHY_VARS_eNB *eNB,uint8_t abstraction_flag)
|
||||||
{
|
{
|
||||||
|
|
||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
@@ -1888,7 +1892,7 @@ void prach_procedures(PHY_VARS_eNB *eNB,uint8_t thread_id,uint8_t abstraction_fl
|
|||||||
uint16_t preamble_max,preamble_energy_max;
|
uint16_t preamble_max,preamble_energy_max;
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
int8_t UE_id;
|
int8_t UE_id;
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
int subframe = proc->subframe_rx;
|
int subframe = proc->subframe_rx;
|
||||||
int frame = proc->frame_rx;
|
int frame = proc->frame_rx;
|
||||||
uint8_t CC_id = eNB->CC_id;
|
uint8_t CC_id = eNB->CC_id;
|
||||||
@@ -1902,7 +1906,6 @@ void prach_procedures(PHY_VARS_eNB *eNB,uint8_t thread_id,uint8_t abstraction_fl
|
|||||||
|
|
||||||
|
|
||||||
rx_prach(eNB,
|
rx_prach(eNB,
|
||||||
subframe,
|
|
||||||
preamble_energy_list,
|
preamble_energy_list,
|
||||||
preamble_delay_list,
|
preamble_delay_list,
|
||||||
frame,
|
frame,
|
||||||
@@ -1999,17 +2002,7 @@ void prach_procedures(PHY_VARS_eNB *eNB,uint8_t thread_id,uint8_t abstraction_fl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ulsch_decoding_procedures(unsigned char subframe, unsigned int i, PHY_VARS_eNB *eNB, unsigned char abstraction_flag)
|
void pucch_procedures(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,const uint8_t abstraction_flag) {
|
||||||
{
|
|
||||||
UNUSED(subframe);
|
|
||||||
UNUSED(i);
|
|
||||||
UNUSED(eNB);
|
|
||||||
UNUSED(abstraction_flag);
|
|
||||||
LOG_D(PHY,"ulsch_decoding_procedures not yet implemented. should not be called");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void pucch_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,int harq_pid,const uint8_t abstraction_flag) {
|
|
||||||
|
|
||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
uint8_t SR_payload = 0,*pucch_payload=NULL,pucch_payload0[2]= {0,0},pucch_payload1[2]= {0,0};
|
uint8_t SR_payload = 0,*pucch_payload=NULL,pucch_payload0[2]= {0,0},pucch_payload1[2]= {0,0};
|
||||||
@@ -2019,7 +2012,7 @@ void pucch_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,
|
|||||||
int32_t metric0=0,metric1=0,metric0_SR=0;
|
int32_t metric0=0,metric1=0,metric0_SR=0;
|
||||||
ANFBmode_t bundling_flag;
|
ANFBmode_t bundling_flag;
|
||||||
PUCCH_FMT_t format;
|
PUCCH_FMT_t format;
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
const int subframe = proc->subframe_rx;
|
const int subframe = proc->subframe_rx;
|
||||||
const int frame = proc->frame_rx;
|
const int frame = proc->frame_rx;
|
||||||
|
|
||||||
@@ -2028,14 +2021,13 @@ void pucch_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,
|
|||||||
(eNB->ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag==0)) {
|
(eNB->ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag==0)) {
|
||||||
|
|
||||||
// check SR availability
|
// check SR availability
|
||||||
do_SR = is_SR_subframe(eNB,UE_id,thread_id);
|
do_SR = is_SR_subframe(eNB,UE_id);
|
||||||
// do_SR = 0;
|
// do_SR = 0;
|
||||||
|
|
||||||
// Now ACK/NAK
|
// Now ACK/NAK
|
||||||
// First check subframe_tx flag for earlier subframes
|
// First check subframe_tx flag for earlier subframes
|
||||||
get_n1_pucch_eNB(eNB,
|
get_n1_pucch_eNB(eNB,
|
||||||
UE_id,
|
UE_id,
|
||||||
thread_id,
|
|
||||||
&n1_pucch0,
|
&n1_pucch0,
|
||||||
&n1_pucch1,
|
&n1_pucch1,
|
||||||
&n1_pucch2,
|
&n1_pucch2,
|
||||||
@@ -2098,8 +2090,7 @@ void pucch_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,
|
|||||||
UE_id,
|
UE_id,
|
||||||
pucch_format1,
|
pucch_format1,
|
||||||
0,
|
0,
|
||||||
&SR_payload,
|
&SR_payload);
|
||||||
thread_id);
|
|
||||||
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",eNB->Mod_id,
|
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",eNB->Mod_id,
|
||||||
eNB->ulsch[UE_id]->rnti,frame,subframe,SR_payload,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex);
|
eNB->ulsch[UE_id]->rnti,frame,subframe,SR_payload,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex);
|
||||||
}
|
}
|
||||||
@@ -2182,7 +2173,7 @@ void pucch_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,
|
|||||||
pucch_payload0[0],metric0);
|
pucch_payload0[0],metric0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
process_HARQ_feedback(UE_id,thread_id,eNB,
|
process_HARQ_feedback(UE_id,eNB,
|
||||||
0,// pusch_flag
|
0,// pusch_flag
|
||||||
pucch_payload0,
|
pucch_payload0,
|
||||||
2,
|
2,
|
||||||
@@ -2313,7 +2304,7 @@ void pucch_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,
|
|||||||
frame,subframe,
|
frame,subframe,
|
||||||
metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]);
|
metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]);
|
||||||
#endif
|
#endif
|
||||||
process_HARQ_feedback(UE_id,thread_id,eNB,
|
process_HARQ_feedback(UE_id,eNB,
|
||||||
0,// pusch_flag
|
0,// pusch_flag
|
||||||
pucch_payload,
|
pucch_payload,
|
||||||
pucch_sel,
|
pucch_sel,
|
||||||
@@ -2324,9 +2315,9 @@ void pucch_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cba_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,int harq_pid,const uint8_t abstraction_flag) {
|
void cba_procedures(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,const uint8_t abstraction_flag) {
|
||||||
|
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
uint8_t access_mode;
|
uint8_t access_mode;
|
||||||
int num_active_cba_groups;
|
int num_active_cba_groups;
|
||||||
const int subframe = proc->subframe_rx;
|
const int subframe = proc->subframe_rx;
|
||||||
@@ -2352,7 +2343,6 @@ void cba_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,in
|
|||||||
|
|
||||||
if (abstraction_flag==0) {
|
if (abstraction_flag==0) {
|
||||||
rx_ulsch(eNB,
|
rx_ulsch(eNB,
|
||||||
thread_id,
|
|
||||||
eNB->UE_stats[UE_id].sector, // this is the effective sector id
|
eNB->UE_stats[UE_id].sector, // this is the effective sector id
|
||||||
UE_id,
|
UE_id,
|
||||||
eNB->ulsch,
|
eNB->ulsch,
|
||||||
@@ -2372,7 +2362,6 @@ void cba_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,in
|
|||||||
if (abstraction_flag == 0) {
|
if (abstraction_flag == 0) {
|
||||||
ret = ulsch_decoding(eNB,
|
ret = ulsch_decoding(eNB,
|
||||||
UE_id,
|
UE_id,
|
||||||
thread_id,
|
|
||||||
0, // control_only_flag
|
0, // control_only_flag
|
||||||
eNB->ulsch[UE_id]->harq_processes[harq_pid]->V_UL_DAI,
|
eNB->ulsch[UE_id]->harq_processes[harq_pid]->V_UL_DAI,
|
||||||
eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0);
|
eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0);
|
||||||
@@ -2381,7 +2370,6 @@ void cba_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,in
|
|||||||
#ifdef PHY_ABSTRACTION
|
#ifdef PHY_ABSTRACTION
|
||||||
else {
|
else {
|
||||||
ret = ulsch_decoding_emul(eNB,
|
ret = ulsch_decoding_emul(eNB,
|
||||||
thread_id,
|
|
||||||
UE_id,
|
UE_id,
|
||||||
&rnti);
|
&rnti);
|
||||||
}
|
}
|
||||||
@@ -2489,20 +2477,26 @@ void cba_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,in
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eNB,const uint8_t abstraction_flag) {
|
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_flag) {
|
||||||
|
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
int i,l;
|
int i,l;
|
||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
void *rxp[fp->nb_antennas_rx];
|
void *rxp[fp->nb_antennas_rx];
|
||||||
unsigned int rxs;
|
unsigned int rxs;
|
||||||
|
int subframe = proc->subframe_rx;
|
||||||
|
int frame = proc->frame_rx;
|
||||||
|
|
||||||
AssertFatal(thread_id < NUM_ENB_THREADS, "Bad thread_id %d", thread_id);
|
if (subframe==9) {
|
||||||
|
subframe=0;
|
||||||
|
frame++;
|
||||||
|
}
|
||||||
|
else subframe++;
|
||||||
|
|
||||||
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_COMMON_RX,1);
|
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_COMMON_RX,1);
|
||||||
start_meas(&eNB->phy_proc_rx);
|
start_meas(&eNB->phy_proc_rx);
|
||||||
#ifdef DEBUG_PHY_PROC
|
#ifdef DEBUG_PHY_PROC
|
||||||
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",eNB->Mod_id,proc->frame_rx, proc->subframe_rx);
|
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",eNB->Mod_id,frame, subframe);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (abstraction_flag==0) { // grab signal in chunks of 500 us (1 slot)
|
if (abstraction_flag==0) { // grab signal in chunks of 500 us (1 slot)
|
||||||
@@ -2511,7 +2505,7 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
if ((eNB->node_function == NGFI_RRU_IF4) ||
|
if ((eNB->node_function == NGFI_RRU_IF4) ||
|
||||||
(eNB->node_function == eNodeB_3GPP)) { // acquisition from RF and front-end processing
|
(eNB->node_function == eNodeB_3GPP)) { // acquisition from RF and front-end processing
|
||||||
for (i=0; i<fp->nb_antennas_rx; i++)
|
for (i=0; i<fp->nb_antennas_rx; i++)
|
||||||
rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][proc->subframe*fp->samples_per_tti];
|
rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][subframe*fp->samples_per_tti];
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
|
||||||
rxs = openair0.trx_read_func(&openair0,
|
rxs = openair0.trx_read_func(&openair0,
|
||||||
@@ -2521,9 +2515,11 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
fp->nb_antennas_rx);
|
fp->nb_antennas_rx);
|
||||||
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023;
|
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023;
|
||||||
proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10;
|
proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10;
|
||||||
|
AssertFatal(proc->subframe_rx == subframe, "Received Timestamp doesn't correspond to the time we think it is");
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX_ENB, proc->frame_rx );
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX_ENB, frame );
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX_ENB, proc->subframe_rx );
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX_ENB, subframe );
|
||||||
|
|
||||||
if (frame > 20){
|
if (frame > 20){
|
||||||
if (rxs != fp->samples_per_tti>>1)
|
if (rxs != fp->samples_per_tti>>1)
|
||||||
@@ -2583,15 +2579,18 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
|
|
||||||
|
|
||||||
// check if we have to detect PRACH first
|
// check if we have to detect PRACH first
|
||||||
if (is_prach_subframe(fp,proc->frame_rx,proc->subframe_rx)>0) {
|
if (is_prach_subframe(fp,frame,subframe)>0) {
|
||||||
// wake up thread for PRACH RX
|
// wake up thread for PRACH RX
|
||||||
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
|
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
|
||||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", thread_id, proc->instance_cnt_prach );
|
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", proc->instance_cnt_prach );
|
||||||
exit_fun( "error locking mutex_prach" );
|
exit_fun( "error locking mutex_prach" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cnt_prach = ++proc->instance_cnt_prach;
|
int cnt_prach = ++proc->instance_cnt_prach;
|
||||||
|
// set timing for prach thread
|
||||||
|
proc->frame_prach = frame;
|
||||||
|
proc->subframe_prach = subframe;
|
||||||
|
|
||||||
pthread_mutex_unlock( &proc->mutex_prach );
|
pthread_mutex_unlock( &proc->mutex_prach );
|
||||||
|
|
||||||
@@ -2603,7 +2602,7 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_W( PHY,"[eNB] Frame %d, eNB PRACH thread busy!!\n", proc->frame_tx);
|
LOG_W( PHY,"[eNB] Frame %d, eNB PRACH thread busy!!\n", frame);
|
||||||
exit_fun( "PRACH thread busy" );
|
exit_fun( "PRACH thread busy" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2614,7 +2613,7 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
// wake up TX thread
|
// wake up TX thread
|
||||||
// lock the TX mutex and make sure the thread is ready
|
// lock the TX mutex and make sure the thread is ready
|
||||||
if (pthread_mutex_lock(&proc->mutex_tx) != 0) {
|
if (pthread_mutex_lock(&proc->mutex_tx) != 0) {
|
||||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX thread %d (IC %d)\n", thread_id, proc->instance_cnt_tx );
|
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX thread %d (IC %d)\n", proc->instance_cnt_tx );
|
||||||
exit_fun( "error locking mutex_tx" );
|
exit_fun( "error locking mutex_tx" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2627,20 +2626,20 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
// we want to generate subframe (n+3), so TS_tx = TX_rx+2.5*samples_per_tti,
|
// we want to generate subframe (n+3), so TS_tx = TX_rx+2.5*samples_per_tti,
|
||||||
// and proc->subframe_tx = proc->subframe_rx+3
|
// and proc->subframe_tx = proc->subframe_rx+3
|
||||||
proc->timestamp_tx = proc->timestamp_rx + (fp->samples_per_tti<<1) + (fp->samples_per_tti>>1);
|
proc->timestamp_tx = proc->timestamp_rx + (fp->samples_per_tti<<1) + (fp->samples_per_tti>>1);
|
||||||
proc->frame_tx = (proc->subframe_rx > 6) ? (proc->frame_rx+1) : proc->frame_rx;
|
proc->frame_tx = (subframe > 6) ? (frame+1) : frame;
|
||||||
proc->subframe_tx = (proc->subframe_rx + 3)%10;
|
proc->subframe_tx = (subframe + 3)%10;
|
||||||
|
|
||||||
pthread_mutex_unlock( &proc->mutex_tx );
|
pthread_mutex_unlock( &proc->mutex_tx );
|
||||||
|
|
||||||
if (cnt_tx == 0){
|
if (cnt_tx == 0){
|
||||||
// the thread was presumably waiting where it should and can now be woken up
|
// the thread was presumably waiting where it should and can now be woken up
|
||||||
if (pthread_cond_signal(&proc->cond_tx) != 0) {
|
if (pthread_cond_signal(&proc->cond_tx) != 0) {
|
||||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TX thread %d\n", thread_id);
|
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TX thread\n");
|
||||||
exit_fun( "ERROR pthread_cond_signal" );
|
exit_fun( "ERROR pthread_cond_signal" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_W( PHY,"[eNB] Frame %d, eNB TX thread %d busy!! (cnt_tx %i)\n", proc->frame_tx, thread_id, cnt_tx );
|
LOG_W( PHY,"[eNB] Frame %d, eNB TX thread busy!! (cnt_tx %i)\n", frame, cnt_tx );
|
||||||
exit_fun( "TX thread busy" );
|
exit_fun( "TX thread busy" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2652,11 +2651,11 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eNB,const uint8_t abstraction_flag,const relaying_type_t r_type)
|
void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_flag,const relaying_type_t r_type)
|
||||||
{
|
{
|
||||||
//RX processing for ue-specific resources (i
|
//RX processing for ue-specific resources (i
|
||||||
UNUSED(r_type);
|
UNUSED(r_type);
|
||||||
eNB_proc_t *proc = &eNB->proc[thread_id];
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
uint32_t l, ret=0,i,j,k;
|
uint32_t l, ret=0,i,j,k;
|
||||||
uint32_t harq_pid, harq_idx, round;
|
uint32_t harq_pid, harq_idx, round;
|
||||||
uint8_t nPRS;
|
uint8_t nPRS;
|
||||||
@@ -2668,8 +2667,6 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
const int subframe = proc->subframe_rx;
|
const int subframe = proc->subframe_rx;
|
||||||
const int frame = proc->frame_rx;
|
const int frame = proc->frame_rx;
|
||||||
|
|
||||||
AssertFatal(thread_id < NUM_ENB_THREADS, "Bad thread_id %d", thread_id);
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1);
|
||||||
start_meas(&eNB->phy_proc_rx);
|
start_meas(&eNB->phy_proc_rx);
|
||||||
#ifdef DEBUG_PHY_PROC
|
#ifdef DEBUG_PHY_PROC
|
||||||
@@ -2720,7 +2717,7 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
// Do PUCCH processing first
|
// Do PUCCH processing first
|
||||||
|
|
||||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||||
pucch_procedures(thread_id,eNB,i,harq_pid,abstraction_flag);
|
pucch_procedures(eNB,i,harq_pid,abstraction_flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||||
@@ -2728,7 +2725,7 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
// check for Msg3
|
// check for Msg3
|
||||||
if (eNB->mac_enabled==1) {
|
if (eNB->mac_enabled==1) {
|
||||||
if (eNB->UE_stats[i].mode == RA_RESPONSE) {
|
if (eNB->UE_stats[i].mode == RA_RESPONSE) {
|
||||||
process_Msg3(eNB,thread_id,i,harq_pid);
|
process_Msg3(eNB,i,harq_pid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2810,7 +2807,6 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
|
|
||||||
if (abstraction_flag==0) {
|
if (abstraction_flag==0) {
|
||||||
rx_ulsch(eNB,
|
rx_ulsch(eNB,
|
||||||
thread_id,
|
|
||||||
eNB->UE_stats[i].sector, // this is the effective sector id
|
eNB->UE_stats[i].sector, // this is the effective sector id
|
||||||
i,
|
i,
|
||||||
eNB->ulsch,
|
eNB->ulsch,
|
||||||
@@ -2834,7 +2830,6 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
if (abstraction_flag == 0) {
|
if (abstraction_flag == 0) {
|
||||||
ret = ulsch_decoding(eNB,
|
ret = ulsch_decoding(eNB,
|
||||||
i,
|
i,
|
||||||
thread_id,
|
|
||||||
0, // control_only_flag
|
0, // control_only_flag
|
||||||
eNB->ulsch[i]->harq_processes[harq_pid]->V_UL_DAI,
|
eNB->ulsch[i]->harq_processes[harq_pid]->V_UL_DAI,
|
||||||
eNB->ulsch[i]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0);
|
eNB->ulsch[i]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0);
|
||||||
@@ -2843,7 +2838,6 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
#ifdef PHY_ABSTRACTION
|
#ifdef PHY_ABSTRACTION
|
||||||
else {
|
else {
|
||||||
ret = ulsch_decoding_emul(eNB,
|
ret = ulsch_decoding_emul(eNB,
|
||||||
thread_id,
|
|
||||||
i,
|
i,
|
||||||
&rnti);
|
&rnti);
|
||||||
}
|
}
|
||||||
@@ -2869,8 +2863,6 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
eNB->ulsch[(uint32_t)i]->harq_processes[harq_pid]->delta_TF =
|
eNB->ulsch[(uint32_t)i]->harq_processes[harq_pid]->delta_TF =
|
||||||
get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered
|
get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered
|
||||||
|
|
||||||
//dump_ulsch(eNB, thread_id, i);
|
|
||||||
|
|
||||||
eNB->UE_stats[i].ulsch_decoding_attempts[harq_pid][eNB->ulsch[i]->harq_processes[harq_pid]->round]++;
|
eNB->UE_stats[i].ulsch_decoding_attempts[harq_pid][eNB->ulsch[i]->harq_processes[harq_pid]->round]++;
|
||||||
#ifdef DEBUG_PHY_PROC
|
#ifdef DEBUG_PHY_PROC
|
||||||
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d Clearing subframe_scheduling_flag\n",
|
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d Clearing subframe_scheduling_flag\n",
|
||||||
@@ -2880,7 +2872,7 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
|
|
||||||
if (eNB->ulsch[i]->harq_processes[harq_pid]->cqi_crc_status == 1) {
|
if (eNB->ulsch[i]->harq_processes[harq_pid]->cqi_crc_status == 1) {
|
||||||
#ifdef DEBUG_PHY_PROC
|
#ifdef DEBUG_PHY_PROC
|
||||||
//if (((proc->frame_tx%10) == 0) || (proc->frame_tx < 50))
|
//if (((frame%10) == 0) || (frame < 50))
|
||||||
print_CQI(eNB->ulsch[i]->harq_processes[harq_pid]->o,eNB->ulsch[i]->harq_processes[harq_pid]->uci_format,0,fp->N_RB_DL);
|
print_CQI(eNB->ulsch[i]->harq_processes[harq_pid]->o,eNB->ulsch[i]->harq_processes[harq_pid]->uci_format,0,fp->N_RB_DL);
|
||||||
#endif
|
#endif
|
||||||
extract_CQI(eNB->ulsch[i]->harq_processes[harq_pid]->o,
|
extract_CQI(eNB->ulsch[i]->harq_processes[harq_pid]->o,
|
||||||
@@ -3139,7 +3131,7 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
|
|
||||||
// estimate timing advance for MAC
|
// estimate timing advance for MAC
|
||||||
if (abstraction_flag == 0) {
|
if (abstraction_flag == 0) {
|
||||||
sync_pos = lte_est_timing_advance_pusch(eNB,i,thread_id);
|
sync_pos = lte_est_timing_advance_pusch(eNB,i);
|
||||||
eNB->UE_stats[i].timing_advance_update = sync_pos - fp->nb_prefix_samples/4; //to check
|
eNB->UE_stats[i].timing_advance_update = sync_pos - fp->nb_prefix_samples/4; //to check
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3162,7 +3154,6 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
i);
|
i);
|
||||||
#endif
|
#endif
|
||||||
process_HARQ_feedback(i,
|
process_HARQ_feedback(i,
|
||||||
thread_id,
|
|
||||||
eNB,
|
eNB,
|
||||||
1, // pusch_flag
|
1, // pusch_flag
|
||||||
0,
|
0,
|
||||||
@@ -3226,7 +3217,7 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CBA (non-LTE)
|
// CBA (non-LTE)
|
||||||
cba_procedures(thread_id,eNB,i,harq_pid,abstraction_flag);
|
cba_procedures(eNB,i,harq_pid,abstraction_flag);
|
||||||
} // loop i=0 ... NUMBER_OF_UE_MAX-1
|
} // loop i=0 ... NUMBER_OF_UE_MAX-1
|
||||||
|
|
||||||
if (abstraction_flag == 0) {
|
if (abstraction_flag == 0) {
|
||||||
|
|||||||
+569
-569
File diff suppressed because it is too large
Load Diff
@@ -48,13 +48,14 @@
|
|||||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "unitary_defs.h"
|
||||||
#define N_TRIALS 100
|
#define N_TRIALS 100
|
||||||
|
|
||||||
PHY_VARS_eNB *PHY_vars_eNB,*PHY_vars_eNB1,*PHY_vars_eNB2;
|
PHY_VARS_eNB *eNB,*eNB1,*eNB2;
|
||||||
PHY_VARS_UE *PHY_vars_UE;
|
PHY_VARS_UE *UE;
|
||||||
|
|
||||||
#define UL_RB_ALLOC 0x1ff;
|
#define UL_RB_ALLOC 0x1ff;
|
||||||
#define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2)
|
#define CCCH_RB_ALLOC computeRIV(eNB->frame_parms.N_RB_UL,0,2)
|
||||||
#define DLSCH_RB_ALLOC ((uint16_t)0x1fbf) // igore DC component,RB13
|
#define DLSCH_RB_ALLOC ((uint16_t)0x1fbf) // igore DC component,RB13
|
||||||
|
|
||||||
DCI_PDU DCI_pdu;
|
DCI_PDU DCI_pdu;
|
||||||
@@ -459,17 +460,7 @@ int main(int argc, char **argv)
|
|||||||
int CCE_table[800];
|
int CCE_table[800];
|
||||||
|
|
||||||
number_of_cards = 1;
|
number_of_cards = 1;
|
||||||
openair_daq_vars.rx_rf_mode = 1;
|
|
||||||
|
|
||||||
/*
|
|
||||||
rxdataF = (int **)malloc16(2*sizeof(int*));
|
|
||||||
rxdataF[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
rxdataF[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
|
|
||||||
rxdata = (int **)malloc16(2*sizeof(int*));
|
|
||||||
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
*/
|
|
||||||
while ((c = getopt (argc, argv, "hapFg:R:c:n:s:x:y:z:L:M:N:I:f:i:S:P:Y")) != -1) {
|
while ((c = getopt (argc, argv, "hapFg:R:c:n:s:x:y:z:L:M:N:I:f:i:S:P:Y")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'a':
|
case 'a':
|
||||||
@@ -719,7 +710,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
mac_xface->computeRIV = computeRIV;
|
mac_xface->computeRIV = computeRIV;
|
||||||
mac_xface->lte_frame_parms = &PHY_vars_eNB->lte_frame_parms;
|
mac_xface->frame_parms = &eNB->frame_parms;
|
||||||
// init_transport_channels(transmission_mode);
|
// init_transport_channels(transmission_mode);
|
||||||
|
|
||||||
if (n_frames==1)
|
if (n_frames==1)
|
||||||
@@ -729,27 +720,27 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
|
printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
|
||||||
|
|
||||||
frame_parms = &PHY_vars_eNB->lte_frame_parms;
|
frame_parms = &eNB->frame_parms;
|
||||||
get_dci(frame_parms, log2L, log2Lcommon, format_selector, n_rnti);
|
get_dci(frame_parms, log2L, log2Lcommon, format_selector, n_rnti);
|
||||||
|
|
||||||
txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[eNb_id];
|
txdata = eNB->common_vars.txdata[eNb_id];
|
||||||
|
|
||||||
s_re = malloc(2*sizeof(double*));
|
s_re = malloc(2*sizeof(double*));
|
||||||
s_im = malloc(2*sizeof(double*));
|
s_im = malloc(2*sizeof(double*));
|
||||||
r_re = malloc(2*sizeof(double*));
|
r_re = malloc(2*sizeof(double*));
|
||||||
r_im = malloc(2*sizeof(double*));
|
r_im = malloc(2*sizeof(double*));
|
||||||
|
|
||||||
nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12;
|
nsymb = (eNB->frame_parms.Ncp == 0) ? 14 : 12;
|
||||||
|
|
||||||
printf("Subframe %d, FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d\n",
|
printf("Subframe %d, FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d\n",
|
||||||
subframe,NUMBER_OF_OFDM_CARRIERS,
|
subframe,NUMBER_OF_OFDM_CARRIERS,
|
||||||
PHY_vars_eNB->lte_frame_parms.Ncp,PHY_vars_eNB->lte_frame_parms.samples_per_tti,nsymb);
|
eNB->frame_parms.Ncp,eNB->frame_parms.samples_per_tti,nsymb);
|
||||||
|
|
||||||
eNB2UE = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB,
|
eNB2UE = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx_eNB,
|
||||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
UE->frame_parms.nb_antennas_rx,
|
||||||
channel_model,
|
channel_model,
|
||||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
N_RB2sampling_rate(eNB->frame_parms.N_RB_DL),
|
||||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
@@ -769,12 +760,12 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
eNB->ulsch[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||||
PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(N_RB_DL,0);
|
UE->ulsch[0] = new_ue_ulsch(N_RB_DL,0);
|
||||||
|
|
||||||
|
|
||||||
PHY_vars_eNB->proc[subframe].frame_tx = 0;
|
eNB->proc.frame_tx = 0;
|
||||||
PHY_vars_eNB->proc[subframe].subframe_tx = subframe;
|
eNB->proc.subframe_tx = subframe;
|
||||||
|
|
||||||
if (input_fd==NULL) {
|
if (input_fd==NULL) {
|
||||||
msg("No input file, so starting TX\n");
|
msg("No input file, so starting TX\n");
|
||||||
@@ -812,9 +803,9 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PHY_vars_UE->UE_mode[0] = PUSCH;
|
UE->UE_mode[0] = PUSCH;
|
||||||
|
|
||||||
// nCCE_max = get_nCCE(3,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,0));
|
// nCCE_max = get_nCCE(3,&eNB->frame_parms,get_mi(&eNB->frame_parms,0));
|
||||||
//printf("nCCE_max %d\n",nCCE_max);
|
//printf("nCCE_max %d\n",nCCE_max);
|
||||||
|
|
||||||
//printf("num_phich interferers %d\n",num_phich_interf);
|
//printf("num_phich interferers %d\n",num_phich_interf);
|
||||||
@@ -832,31 +823,31 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
for (trial=0; trial<n_frames; trial++) {
|
for (trial=0; trial<n_frames; trial++) {
|
||||||
|
|
||||||
// printf("DCI (SF %d): txdataF %p (0 %p)\n",subframe,&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][512*14*subframe],&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0]);
|
// printf("DCI (SF %d): txdataF %p (0 %p)\n",subframe,&eNB->common_vars.txdataF[eNb_id][aa][512*14*subframe],&eNB->common_vars.txdataF[eNb_id][aa][0]);
|
||||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB; aa++) {
|
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx_eNB; aa++) {
|
||||||
memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
|
memset(&eNB->common_vars.txdataF[eNb_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
re_offset = PHY_vars_eNB->lte_frame_parms.first_carrier_offset;
|
re_offset = eNB->frame_parms.first_carrier_offset;
|
||||||
txptr = (uint32_t*)&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti];
|
txptr = (uint32_t*)&eNB->common_vars.txdataF[eNb_id][aa][subframe*eNB->frame_parms.samples_per_tti];
|
||||||
for (i=0;i<PHY_vars_eNB->lte_frame_parms.N_RB_DL*6;i++) {
|
for (i=0;i<eNB->frame_parms.N_RB_DL*6;i++) {
|
||||||
txptr[re_offset++] = PHY_vars_eNB->lte_frame_parms.mode1_flag==1 ? QPSK[taus()&3] : QPSK2[taus()&3];
|
txptr[re_offset++] = eNB->frame_parms.mode1_flag==1 ? QPSK[taus()&3] : QPSK2[taus()&3];
|
||||||
//printf("%i => %d,%d\n",re_offset-1,*(int16_t*)&txptr[re_offset-1],*(1+(int16_t*)&txptr[re_offset-1]));
|
//printf("%i => %d,%d\n",re_offset-1,*(int16_t*)&txptr[re_offset-1],*(1+(int16_t*)&txptr[re_offset-1]));
|
||||||
}
|
}
|
||||||
re_offset=1; //skip DC
|
re_offset=1; //skip DC
|
||||||
for (i=0;i<PHY_vars_eNB->lte_frame_parms.N_RB_DL*6;i++)
|
for (i=0;i<eNB->frame_parms.N_RB_DL*6;i++)
|
||||||
txptr[re_offset++] = PHY_vars_eNB->lte_frame_parms.mode1_flag==1 ? QPSK[taus()&3] : QPSK2[taus()&3];
|
txptr[re_offset++] = eNB->frame_parms.mode1_flag==1 ? QPSK[taus()&3] : QPSK2[taus()&3];
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
generate_pilots_slot(PHY_vars_eNB,
|
generate_pilots_slot(eNB,
|
||||||
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id],
|
eNB->common_vars.txdataF[eNb_id],
|
||||||
AMP, //1024,
|
AMP, //1024,
|
||||||
(subframe*2),
|
(subframe*2),
|
||||||
0);
|
0);
|
||||||
generate_pilots_slot(PHY_vars_eNB,
|
generate_pilots_slot(eNB,
|
||||||
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id],
|
eNB->common_vars.txdataF[eNb_id],
|
||||||
AMP, //1024,
|
AMP, //1024,
|
||||||
(subframe*2)+1,
|
(subframe*2)+1,
|
||||||
0);
|
0);
|
||||||
@@ -866,18 +857,18 @@ int main(int argc, char **argv)
|
|||||||
numCCE=0;
|
numCCE=0;
|
||||||
n_trials_common++;
|
n_trials_common++;
|
||||||
common_active = 1;
|
common_active = 1;
|
||||||
if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 50) {
|
if (eNB->frame_parms.N_RB_DL >= 50) {
|
||||||
n_trials_ul++;
|
n_trials_ul++;
|
||||||
ul_active = 1;
|
ul_active = 1;
|
||||||
}
|
}
|
||||||
if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 25) {
|
if (eNB->frame_parms.N_RB_DL >= 25) {
|
||||||
n_trials_dl++;
|
n_trials_dl++;
|
||||||
dl_active = 1;
|
dl_active = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci,
|
num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci,
|
||||||
DCI_pdu.dci_alloc, frame_parms, subframe);
|
DCI_pdu.dci_alloc, frame_parms, subframe);
|
||||||
numCCE = get_nCCE(num_pdcch_symbols,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,subframe));
|
numCCE = get_nCCE(num_pdcch_symbols,&eNB->frame_parms,get_mi(&eNB->frame_parms,subframe));
|
||||||
|
|
||||||
if (n_frames==1) {
|
if (n_frames==1) {
|
||||||
printf("num_dci %d, num_pddch_symbols %d, nCCE %d\n",
|
printf("num_dci %d, num_pddch_symbols %d, nCCE %d\n",
|
||||||
@@ -930,91 +921,83 @@ int main(int argc, char **argv)
|
|||||||
DCI_pdu.dci_alloc,
|
DCI_pdu.dci_alloc,
|
||||||
0,
|
0,
|
||||||
AMP,
|
AMP,
|
||||||
&PHY_vars_eNB->lte_frame_parms,
|
&eNB->frame_parms,
|
||||||
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id],
|
eNB->common_vars.txdataF[eNb_id],
|
||||||
subframe);
|
subframe);
|
||||||
|
|
||||||
if (n_frames==1)
|
if (n_frames==1)
|
||||||
printf("num_pdcch_symbols at TX %d\n",num_pdcch_symbols);
|
printf("num_pdcch_symbols at TX %d\n",num_pdcch_symbols);
|
||||||
|
|
||||||
if (is_phich_subframe(&PHY_vars_eNB->lte_frame_parms,subframe)) {
|
if (is_phich_subframe(&eNB->frame_parms,subframe)) {
|
||||||
if (n_frames==1)
|
if (n_frames==1)
|
||||||
printf("generating PHICH\n");
|
printf("generating PHICH\n");
|
||||||
|
|
||||||
harq_pid = phich_subframe_to_harq_pid(&PHY_vars_eNB->lte_frame_parms, PHY_vars_eNB->proc[subframe].frame_tx, subframe);
|
harq_pid = phich_subframe_to_harq_pid(&eNB->frame_parms, eNB->proc.frame_tx, subframe);
|
||||||
|
|
||||||
phich_ACK = taus()&1;
|
phich_ACK = taus()&1;
|
||||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->phich_active = 1;
|
eNB->ulsch[0]->harq_processes[harq_pid]->phich_active = 1;
|
||||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 0;
|
eNB->ulsch[0]->harq_processes[harq_pid]->first_rb = 0;
|
||||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->n_DMRS = 0;
|
eNB->ulsch[0]->harq_processes[harq_pid]->n_DMRS = 0;
|
||||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->phich_ACK = phich_ACK;
|
eNB->ulsch[0]->harq_processes[harq_pid]->phich_ACK = phich_ACK;
|
||||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->dci_alloc = 1;
|
eNB->ulsch[0]->harq_processes[harq_pid]->dci_alloc = 1;
|
||||||
|
|
||||||
PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->first_rb = 0;
|
UE->ulsch[0]->harq_processes[harq_pid]->first_rb = 0;
|
||||||
PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->n_DMRS = 0;
|
UE->ulsch[0]->harq_processes[harq_pid]->n_DMRS = 0;
|
||||||
|
|
||||||
generate_phich_top(PHY_vars_eNB,
|
generate_phich_top(eNB,AMP,0,0);
|
||||||
subframe,AMP,0,0);
|
|
||||||
|
|
||||||
// generate 3 interfering PHICH
|
// generate 3 interfering PHICH
|
||||||
if (num_phich_interf>0) {
|
if (num_phich_interf>0) {
|
||||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 4;
|
eNB->ulsch[0]->harq_processes[harq_pid]->first_rb = 4;
|
||||||
generate_phich_top(PHY_vars_eNB,
|
generate_phich_top(eNB,1024,0,0);
|
||||||
subframe,
|
|
||||||
1024,
|
|
||||||
0,0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num_phich_interf>1) {
|
if (num_phich_interf>1) {
|
||||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 8;
|
eNB->ulsch[0]->harq_processes[harq_pid]->first_rb = 8;
|
||||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->n_DMRS = 1;
|
eNB->ulsch[0]->harq_processes[harq_pid]->n_DMRS = 1;
|
||||||
generate_phich_top(PHY_vars_eNB,
|
generate_phich_top(eNB,1024,0,0);
|
||||||
subframe,
|
|
||||||
1024,0,0);
|
|
||||||
}
|
}
|
||||||
if (num_phich_interf>2) {
|
if (num_phich_interf>2) {
|
||||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 12;
|
eNB->ulsch[0]->harq_processes[harq_pid]->first_rb = 12;
|
||||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->n_DMRS = 1;
|
eNB->ulsch[0]->harq_processes[harq_pid]->n_DMRS = 1;
|
||||||
generate_phich_top(PHY_vars_eNB,
|
generate_phich_top(eNB,1024,0,0);
|
||||||
subframe,
|
|
||||||
1024,0,0);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 0;
|
eNB->ulsch[0]->harq_processes[harq_pid]->first_rb = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// write_output("pilotsF.m","rsF",txdataF[0],lte_PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,1,1);
|
// write_output("pilotsF.m","rsF",txdataF[0],lte_eNB->frame_parms.ofdm_symbol_size,1,1);
|
||||||
|
|
||||||
if (n_frames==1) {
|
if (n_frames==1) {
|
||||||
write_output("txsigF0.m","txsF0", PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][0],4*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
write_output("txsigF0.m","txsF0", eNB->common_vars.txdataF[eNb_id][0],4*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||||
|
|
||||||
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB > 1)
|
if (eNB->frame_parms.nb_antennas_tx_eNB > 1)
|
||||||
write_output("txsigF1.m","txsF1", PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][1],4*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
write_output("txsigF1.m","txsF1", eNB->common_vars.txdataF[eNb_id][1],4*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
tx_lev = 0;
|
tx_lev = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB; aa++) {
|
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx_eNB; aa++) {
|
||||||
if (PHY_vars_eNB->lte_frame_parms.Ncp == 1)
|
if (eNB->frame_parms.Ncp == 1)
|
||||||
PHY_ofdm_mod(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][subframe*nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size], // input,
|
PHY_ofdm_mod(&eNB->common_vars.txdataF[eNb_id][aa][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size], // input,
|
||||||
&txdata[aa][subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti], // output
|
&txdata[aa][subframe*eNB->frame_parms.samples_per_tti], // output
|
||||||
PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,
|
eNB->frame_parms.ofdm_symbol_size,
|
||||||
2*nsymb, // number of symbols
|
2*nsymb, // number of symbols
|
||||||
PHY_vars_eNB->lte_frame_parms.nb_prefix_samples, // number of prefix samples
|
eNB->frame_parms.nb_prefix_samples, // number of prefix samples
|
||||||
CYCLIC_PREFIX);
|
CYCLIC_PREFIX);
|
||||||
else {
|
else {
|
||||||
normal_prefix_mod(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][subframe*nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size],
|
normal_prefix_mod(&eNB->common_vars.txdataF[eNb_id][aa][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
|
||||||
&txdata[aa][subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti],
|
&txdata[aa][subframe*eNB->frame_parms.samples_per_tti],
|
||||||
2*nsymb,
|
2*nsymb,
|
||||||
frame_parms);
|
frame_parms);
|
||||||
}
|
}
|
||||||
|
|
||||||
tx_lev += signal_energy(&txdata[aa][subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti],
|
tx_lev += signal_energy(&txdata[aa][subframe*eNB->frame_parms.samples_per_tti],
|
||||||
PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size);
|
eNB->frame_parms.ofdm_symbol_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
|
tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
|
||||||
@@ -1023,18 +1006,18 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
||||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB; aa++) {
|
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx_eNB; aa++) {
|
||||||
if (awgn_flag == 0) {
|
if (awgn_flag == 0) {
|
||||||
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + (i<<1)]);
|
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(2*subframe*UE->frame_parms.samples_per_tti) + (i<<1)]);
|
||||||
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + (i<<1)+1]);
|
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(2*subframe*UE->frame_parms.samples_per_tti) + (i<<1)+1]);
|
||||||
} else {
|
} else {
|
||||||
for (aarx=0; aarx<PHY_vars_UE->lte_frame_parms.nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<UE->frame_parms.nb_antennas_rx; aarx++) {
|
||||||
if (aa==0) {
|
if (aa==0) {
|
||||||
r_re[aarx][i] = ((double)(((short *)txdata[aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + (i<<1)]);
|
r_re[aarx][i] = ((double)(((short *)txdata[aa]))[(2*subframe*UE->frame_parms.samples_per_tti) + (i<<1)]);
|
||||||
r_im[aarx][i] = ((double)(((short *)txdata[aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + (i<<1)+1]);
|
r_im[aarx][i] = ((double)(((short *)txdata[aa]))[(2*subframe*UE->frame_parms.samples_per_tti) + (i<<1)+1]);
|
||||||
} else {
|
} else {
|
||||||
r_re[aarx][i] += ((double)(((short *)txdata[aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + (i<<1)]);
|
r_re[aarx][i] += ((double)(((short *)txdata[aa]))[(2*subframe*UE->frame_parms.samples_per_tti) + (i<<1)]);
|
||||||
r_im[aarx][i] += ((double)(((short *)txdata[aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + (i<<1)+1]);
|
r_im[aarx][i] += ((double)(((short *)txdata[aa]))[(2*subframe*UE->frame_parms.samples_per_tti) + (i<<1)+1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1054,7 +1037,7 @@ int main(int argc, char **argv)
|
|||||||
// scale by path_loss = NOW - P_noise
|
// scale by path_loss = NOW - P_noise
|
||||||
//sigma2 = pow(10,sigma2_dB/10);
|
//sigma2 = pow(10,sigma2_dB/10);
|
||||||
//N0W = -95.87;
|
//N0W = -95.87;
|
||||||
sigma2_dB = (double)tx_lev_dB +10*log10((double)PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(double)(12*PHY_vars_eNB->lte_frame_parms.N_RB_DL)) - SNR;
|
sigma2_dB = (double)tx_lev_dB +10*log10((double)eNB->frame_parms.ofdm_symbol_size/(double)(12*eNB->frame_parms.N_RB_DL)) - SNR;
|
||||||
|
|
||||||
if (n_frames==1)
|
if (n_frames==1)
|
||||||
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %d\n",sigma2_dB,SNR,tx_lev_dB);
|
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %d\n",sigma2_dB,SNR,tx_lev_dB);
|
||||||
@@ -1064,37 +1047,37 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
// printf("Sigma2 %f (sigma2_dB %f)\n",sigma2,sigma2_dB);
|
// printf("Sigma2 %f (sigma2_dB %f)\n",sigma2,sigma2_dB);
|
||||||
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
||||||
for (aa=0; aa<PHY_vars_UE->lte_frame_parms.nb_antennas_rx; aa++) {
|
for (aa=0; aa<UE->frame_parms.nb_antennas_rx; aa++) {
|
||||||
|
|
||||||
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + 2*i] = (short) (.667*(r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
((short*) UE->common_vars.rxdata[aa])[(2*subframe*UE->frame_parms.samples_per_tti) + 2*i] = (short) (.667*(r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||||
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + 2*i+1] = (short) (.667*(r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(
|
((short*) UE->common_vars.rxdata[aa])[(2*subframe*UE->frame_parms.samples_per_tti) + 2*i+1] = (short) (.667*(r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(
|
||||||
0.0,1.0)));
|
0.0,1.0)));
|
||||||
/*
|
/*
|
||||||
((short*)PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + 2*i] =
|
((short*)UE->common_vars.rxdata[aa])[(2*subframe*UE->frame_parms.samples_per_tti) + 2*i] =
|
||||||
((short*)txdata[aa])[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + 2*i];
|
((short*)txdata[aa])[(2*subframe*UE->frame_parms.samples_per_tti) + 2*i];
|
||||||
((short*)PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + 2*i+1] =
|
((short*)UE->common_vars.rxdata[aa])[(2*subframe*UE->frame_parms.samples_per_tti) + 2*i+1] =
|
||||||
((short*)txdata[aa])[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) + 2*i+1];
|
((short*)txdata[aa])[(2*subframe*UE->frame_parms.samples_per_tti) + 2*i+1];
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UE receiver
|
// UE receiver
|
||||||
for (l=0; l<PHY_vars_eNB->lte_frame_parms.symbols_per_tti; l++) {
|
for (l=0; l<eNB->frame_parms.symbols_per_tti; l++) {
|
||||||
|
|
||||||
// subframe_offset = (l/PHY_vars_eNB->lte_frame_parms.symbols_per_tti)*PHY_vars_eNB->lte_frame_parms.samples_per_tti;
|
// subframe_offset = (l/eNB->frame_parms.symbols_per_tti)*eNB->frame_parms.samples_per_tti;
|
||||||
// printf("subframe_offset = %d\n",subframe_offset);
|
// printf("subframe_offset = %d\n",subframe_offset);
|
||||||
|
|
||||||
slot_fep(PHY_vars_UE,
|
slot_fep(UE,
|
||||||
l%(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2),
|
l%(eNB->frame_parms.symbols_per_tti/2),
|
||||||
(2*subframe)+(l/(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2)),
|
(2*subframe)+(l/(eNB->frame_parms.symbols_per_tti/2)),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
if (PHY_vars_UE->perfect_ce == 1) {
|
if (UE->perfect_ce == 1) {
|
||||||
if (awgn_flag==0) {
|
if (awgn_flag==0) {
|
||||||
// fill in perfect channel estimates
|
// fill in perfect channel estimates
|
||||||
freq_channel(eNB2UE,PHY_vars_UE->lte_frame_parms.N_RB_DL,12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1);
|
freq_channel(eNB2UE,UE->frame_parms.N_RB_DL,12*UE->frame_parms.N_RB_DL + 1);
|
||||||
|
|
||||||
//write_output("channel.m","ch",desc1->ch[0],desc1->channel_length,1,8);
|
//write_output("channel.m","ch",desc1->ch[0],desc1->channel_length,1,8);
|
||||||
//write_output("channelF.m","chF",desc1->chF[0],nb_samples,1,8);
|
//write_output("channelF.m","chF",desc1->chF[0],nb_samples,1,8);
|
||||||
@@ -1102,9 +1085,9 @@ int main(int argc, char **argv)
|
|||||||
for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||||
((int16_t *) PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||||
eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||||
((int16_t *) PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||||
eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1114,42 +1097,42 @@ int main(int argc, char **argv)
|
|||||||
for(aa=0; aa<frame_parms->nb_antennas_tx_eNB; aa++) {
|
for(aa=0; aa<frame_parms->nb_antennas_tx_eNB; aa++) {
|
||||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||||
((int16_t *) PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
|
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
|
||||||
((int16_t *) PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
|
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l==((PHY_vars_eNB->lte_frame_parms.Ncp==0)?4:3)) {
|
if (l==((eNB->frame_parms.Ncp==0)?4:3)) {
|
||||||
|
|
||||||
// write_output("H00.m","h00",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
// write_output("H00.m","h00",&(UE->common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||||
|
|
||||||
// do PDCCH procedures here
|
// do PDCCH procedures here
|
||||||
PHY_vars_UE->lte_ue_pdcch_vars[0]->crnti = n_rnti;
|
UE->pdcch_vars[0]->crnti = n_rnti;
|
||||||
|
|
||||||
// printf("Doing RX : num_pdcch_symbols at TX %d\n",num_pdcch_symbols);
|
// printf("Doing RX : num_pdcch_symbols at TX %d\n",num_pdcch_symbols);
|
||||||
rx_pdcch(&PHY_vars_UE->lte_ue_common_vars,
|
rx_pdcch(&UE->common_vars,
|
||||||
PHY_vars_UE->lte_ue_pdcch_vars,
|
UE->pdcch_vars,
|
||||||
&PHY_vars_UE->lte_frame_parms,
|
&UE->frame_parms,
|
||||||
subframe,
|
subframe,
|
||||||
0,
|
0,
|
||||||
(PHY_vars_UE->lte_frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
|
(UE->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
|
||||||
PHY_vars_UE->high_speed_flag,
|
UE->high_speed_flag,
|
||||||
PHY_vars_UE->is_secondary_ue);
|
UE->is_secondary_ue);
|
||||||
|
|
||||||
if (is_phich_subframe(&PHY_vars_UE->lte_frame_parms,subframe)) {
|
if (is_phich_subframe(&UE->frame_parms,subframe)) {
|
||||||
PHY_vars_UE->ulsch_ue[0]->harq_processes[phich_subframe_to_harq_pid(&PHY_vars_UE->lte_frame_parms,0,subframe)]->status = ACTIVE;
|
UE->ulsch[0]->harq_processes[phich_subframe_to_harq_pid(&UE->frame_parms,0,subframe)]->status = ACTIVE;
|
||||||
//PHY_vars_UE->ulsch_ue[0]->harq_processes[phich_subframe_to_harq_pid(&PHY_vars_UE->lte_frame_parms,0,subframe)]->Ndi = 1;
|
//UE->ulsch[0]->harq_processes[phich_subframe_to_harq_pid(&UE->frame_parms,0,subframe)]->Ndi = 1;
|
||||||
rx_phich(PHY_vars_UE,
|
rx_phich(UE,
|
||||||
subframe,
|
subframe,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols != num_pdcch_symbols)
|
// if (UE->pdcch_vars[0]->num_pdcch_symbols != num_pdcch_symbols)
|
||||||
// break;
|
// break;
|
||||||
dci_cnt = dci_decoding_procedure(PHY_vars_UE,
|
dci_cnt = dci_decoding_procedure(UE,
|
||||||
dci_alloc_rx,1,
|
dci_alloc_rx,1,
|
||||||
0,subframe);
|
0,subframe);
|
||||||
|
|
||||||
@@ -1158,7 +1141,7 @@ int main(int argc, char **argv)
|
|||||||
dl_rx=0;
|
dl_rx=0;
|
||||||
|
|
||||||
if (n_frames==1) {
|
if (n_frames==1) {
|
||||||
numCCE = get_nCCE(PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, &PHY_vars_UE->lte_frame_parms, get_mi(&PHY_vars_UE->lte_frame_parms,subframe));
|
numCCE = get_nCCE(UE->pdcch_vars[0]->num_pdcch_symbols, &UE->frame_parms, get_mi(&UE->frame_parms,subframe));
|
||||||
|
|
||||||
for (i = 0; i < dci_cnt; i++)
|
for (i = 0; i < dci_cnt; i++)
|
||||||
printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i, dci_alloc_rx[i].rnti, dci_alloc_rx[i].format,
|
printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i, dci_alloc_rx[i].rnti, dci_alloc_rx[i].format,
|
||||||
@@ -1168,21 +1151,21 @@ int main(int argc, char **argv)
|
|||||||
for (i=0; i<dci_cnt; i++) {
|
for (i=0; i<dci_cnt; i++) {
|
||||||
if (dci_alloc_rx[i].rnti == SI_RNTI) {
|
if (dci_alloc_rx[i].rnti == SI_RNTI) {
|
||||||
if (n_frames==1)
|
if (n_frames==1)
|
||||||
dump_dci(&PHY_vars_UE->lte_frame_parms, &dci_alloc_rx[i]);
|
dump_dci(&UE->frame_parms, &dci_alloc_rx[i]);
|
||||||
|
|
||||||
common_rx=1;
|
common_rx=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dci_alloc_rx[i].rnti == n_rnti) && (dci_alloc_rx[i].format == format0)) {
|
if ((dci_alloc_rx[i].rnti == n_rnti) && (dci_alloc_rx[i].format == format0)) {
|
||||||
if (n_frames==1)
|
if (n_frames==1)
|
||||||
dump_dci(&PHY_vars_UE->lte_frame_parms, &dci_alloc_rx[i]);
|
dump_dci(&UE->frame_parms, &dci_alloc_rx[i]);
|
||||||
|
|
||||||
ul_rx=1;
|
ul_rx=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dci_alloc_rx[i].rnti == n_rnti) && ((dci_alloc_rx[i].format == format1))) {
|
if ((dci_alloc_rx[i].rnti == n_rnti) && ((dci_alloc_rx[i].format == format1))) {
|
||||||
if (n_frames==1)
|
if (n_frames==1)
|
||||||
dump_dci(&PHY_vars_UE->lte_frame_parms, &dci_alloc_rx[i]);
|
dump_dci(&UE->frame_parms, &dci_alloc_rx[i]);
|
||||||
|
|
||||||
dl_rx=1;
|
dl_rx=1;
|
||||||
}
|
}
|
||||||
@@ -1207,12 +1190,12 @@ int main(int argc, char **argv)
|
|||||||
// exit(-1);
|
// exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols != num_pdcch_symbols)
|
if (UE->pdcch_vars[0]->num_pdcch_symbols != num_pdcch_symbols)
|
||||||
n_errors_cfi++;
|
n_errors_cfi++;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (is_phich_subframe(&PHY_vars_UE->lte_frame_parms,subframe))
|
if (is_phich_subframe(&UE->frame_parms,subframe))
|
||||||
if (PHY_vars_UE->ulsch_ue[0]->harq_processes[phich_subframe_to_harq_pid(&PHY_vars_UE->lte_frame_parms, PHY_vars_UE->frame, subframe)]->Ndi != phich_ACK)
|
if (UE->ulsch[0]->harq_processes[phich_subframe_to_harq_pid(&UE->frame_parms, UE->frame, subframe)]->Ndi != phich_ACK)
|
||||||
n_errors_hi++;
|
n_errors_hi++;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -1230,7 +1213,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
phy_scope_UE(form_ue,
|
phy_scope_UE(form_ue,
|
||||||
PHY_vars_UE,
|
UE,
|
||||||
eNb_id,0,subframe);
|
eNb_id,0,subframe);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1250,22 +1233,22 @@ int main(int argc, char **argv)
|
|||||||
if (n_tx>1)
|
if (n_tx>1)
|
||||||
write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||||
|
|
||||||
write_output("rxsig0.m","rxs0", PHY_vars_UE->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
|
write_output("rxsig0.m","rxs0", UE->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
|
||||||
write_output("rxsigF0.m","rxsF0", PHY_vars_UE->lte_ue_common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
write_output("rxsigF0.m","rxsF0", UE->common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||||
|
|
||||||
if (n_rx>1) {
|
if (n_rx>1) {
|
||||||
write_output("rxsig1.m","rxs1", PHY_vars_UE->lte_ue_common_vars.rxdata[1],10*frame_parms->samples_per_tti,1,1);
|
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],10*frame_parms->samples_per_tti,1,1);
|
||||||
write_output("rxsigF1.m","rxsF1", PHY_vars_UE->lte_ue_common_vars.rxdataF[1],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
write_output("rxsigF1.m","rxsF1", UE->common_vars.rxdataF[1],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
write_output("H00.m","h00",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
write_output("H00.m","h00",&(UE->common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||||
|
|
||||||
if (n_tx==2)
|
if (n_tx==2)
|
||||||
write_output("H10.m","h10",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
write_output("H10.m","h10",&(UE->common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||||
|
|
||||||
write_output("pdcch_rxF_ext0.m","pdcch_rxF_ext0",PHY_vars_UE->lte_ue_pdcch_vars[eNb_id]->rxdataF_ext[0],3*12*PHY_vars_UE->lte_frame_parms.N_RB_DL,1,1);
|
write_output("pdcch_rxF_ext0.m","pdcch_rxF_ext0",UE->pdcch_vars[eNb_id]->rxdataF_ext[0],3*12*UE->frame_parms.N_RB_DL,1,1);
|
||||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",PHY_vars_UE->lte_ue_pdcch_vars[eNb_id]->rxdataF_comp[0],4*12*PHY_vars_UE->lte_frame_parms.N_RB_DL,1,1);
|
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNb_id]->rxdataF_comp[0],4*12*UE->frame_parms.N_RB_DL,1,1);
|
||||||
write_output("pdcch_rxF_llr.m","pdcch_llr",PHY_vars_UE->lte_ue_pdcch_vars[eNb_id]->llr,2400,1,4);
|
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[eNb_id]->llr,2400,1,4);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<2; i++) {
|
for (i=0; i<2; i++) {
|
||||||
|
|||||||
@@ -43,10 +43,12 @@
|
|||||||
|
|
||||||
#include "OCG_vars.h"
|
#include "OCG_vars.h"
|
||||||
|
|
||||||
|
#include "unitary_defs.h"
|
||||||
|
|
||||||
int current_dlsch_cqi; //FIXME!
|
int current_dlsch_cqi; //FIXME!
|
||||||
|
|
||||||
PHY_VARS_eNB *PHY_vars_eNB;
|
PHY_VARS_eNB *eNB;
|
||||||
PHY_VARS_UE *PHY_vars_UE;
|
PHY_VARS_UE *UE;
|
||||||
|
|
||||||
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
||||||
|
|
||||||
@@ -105,17 +107,9 @@ int main(int argc, char **argv)
|
|||||||
logInit();
|
logInit();
|
||||||
|
|
||||||
number_of_cards = 1;
|
number_of_cards = 1;
|
||||||
openair_daq_vars.rx_rf_mode = 1;
|
|
||||||
|
|
||||||
/*
|
|
||||||
rxdataF = (int **)malloc16(2*sizeof(int*));
|
|
||||||
rxdataF[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
rxdataF[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
|
|
||||||
rxdata = (int **)malloc16(2*sizeof(int*));
|
|
||||||
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
*/
|
|
||||||
while ((c = getopt (argc, argv, "hHaA:Cr:p:g:n:s:S:t:x:y:v:V:z:N:F:d:Z:L:R:")) != -1) {
|
while ((c = getopt (argc, argv, "hHaA:Cr:p:g:n:s:S:t:x:y:v:V:z:N:F:d:Z:L:R:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'a':
|
case 'a':
|
||||||
@@ -343,10 +337,10 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
|
printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
|
||||||
|
|
||||||
frame_parms = &PHY_vars_eNB->lte_frame_parms;
|
frame_parms = &eNB->frame_parms;
|
||||||
|
|
||||||
|
|
||||||
txdata = PHY_vars_UE->lte_ue_common_vars.txdata;
|
txdata = UE->common_vars.txdata;
|
||||||
printf("txdata %p\n",&txdata[0][subframe*frame_parms->samples_per_tti]);
|
printf("txdata %p\n",&txdata[0][subframe*frame_parms->samples_per_tti]);
|
||||||
|
|
||||||
s_re = malloc(2*sizeof(double*));
|
s_re = malloc(2*sizeof(double*));
|
||||||
@@ -361,11 +355,11 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
msg("[SIM] Using SCM/101\n");
|
msg("[SIM] Using SCM/101\n");
|
||||||
UE2eNB = new_channel_desc_scm(PHY_vars_UE->lte_frame_parms.nb_antennas_tx,
|
UE2eNB = new_channel_desc_scm(UE->frame_parms.nb_antennas_tx,
|
||||||
PHY_vars_eNB->lte_frame_parms.nb_antennas_rx,
|
eNB->frame_parms.nb_antennas_rx,
|
||||||
channel_model,
|
channel_model,
|
||||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
|
N_RB2sampling_rate(eNB->frame_parms.N_RB_UL),
|
||||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
|
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_UL),
|
||||||
0.0,
|
0.0,
|
||||||
delay,
|
delay,
|
||||||
0);
|
0);
|
||||||
@@ -388,32 +382,35 @@ int main(int argc, char **argv)
|
|||||||
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
|
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
|
||||||
}
|
}
|
||||||
|
|
||||||
PHY_vars_UE->lte_frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
|
UE->frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
|
||||||
PHY_vars_UE->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
|
UE->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
|
||||||
PHY_vars_UE->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
|
UE->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
|
||||||
PHY_vars_UE->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
|
UE->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
|
||||||
PHY_vars_UE->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
|
UE->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
|
||||||
|
|
||||||
|
|
||||||
PHY_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
|
eNB->frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
|
||||||
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
|
eNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
|
||||||
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
|
eNB->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
|
||||||
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
|
eNB->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
|
||||||
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
|
eNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
|
||||||
|
|
||||||
|
eNB->node_function = eNodeB_3GPP;
|
||||||
|
eNB->proc.subframe_rx = subframe;
|
||||||
|
|
||||||
/* N_ZC not used later, so prach_fmt is also useless, don't set */
|
/* N_ZC not used later, so prach_fmt is also useless, don't set */
|
||||||
//prach_fmt = get_prach_fmt(PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
//prach_fmt = get_prach_fmt(eNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||||
// PHY_vars_eNB->lte_frame_parms.frame_type);
|
// eNB->frame_parms.frame_type);
|
||||||
/* N_ZC not used later, no need to set */
|
/* N_ZC not used later, no need to set */
|
||||||
//N_ZC = (prach_fmt <4)?839:139;
|
//N_ZC = (prach_fmt <4)?839:139;
|
||||||
|
|
||||||
compute_prach_seq(&PHY_vars_eNB->lte_frame_parms.prach_config_common,PHY_vars_eNB->lte_frame_parms.frame_type,PHY_vars_eNB->X_u);
|
compute_prach_seq(&eNB->frame_parms.prach_config_common,eNB->frame_parms.frame_type,eNB->X_u);
|
||||||
|
|
||||||
compute_prach_seq(&PHY_vars_UE->lte_frame_parms.prach_config_common,PHY_vars_UE->lte_frame_parms.frame_type,PHY_vars_UE->X_u);
|
compute_prach_seq(&UE->frame_parms.prach_config_common,UE->frame_parms.frame_type,UE->X_u);
|
||||||
|
|
||||||
PHY_vars_UE->lte_ue_prach_vars[0]->amp = AMP;
|
UE->prach_vars[0]->amp = AMP;
|
||||||
|
|
||||||
PHY_vars_UE->prach_resources[0] = &prach_resources;
|
UE->prach_resources[0] = &prach_resources;
|
||||||
|
|
||||||
if (preamble_tx == 99)
|
if (preamble_tx == 99)
|
||||||
preamble_tx = (uint16_t)(taus()&0x3f);
|
preamble_tx = (uint16_t)(taus()&0x3f);
|
||||||
@@ -421,10 +418,10 @@ int main(int argc, char **argv)
|
|||||||
if (n_frames == 1)
|
if (n_frames == 1)
|
||||||
printf("raPreamble %d\n",preamble_tx);
|
printf("raPreamble %d\n",preamble_tx);
|
||||||
|
|
||||||
PHY_vars_UE->prach_resources[0]->ra_PreambleIndex = preamble_tx;
|
UE->prach_resources[0]->ra_PreambleIndex = preamble_tx;
|
||||||
PHY_vars_UE->prach_resources[0]->ra_TDD_map_index = 0;
|
UE->prach_resources[0]->ra_TDD_map_index = 0;
|
||||||
|
|
||||||
tx_lev = generate_prach(PHY_vars_UE,
|
tx_lev = generate_prach(UE,
|
||||||
0, //eNB_id,
|
0, //eNB_id,
|
||||||
subframe,
|
subframe,
|
||||||
0); //Nf
|
0); //Nf
|
||||||
@@ -436,7 +433,7 @@ int main(int argc, char **argv)
|
|||||||
//write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
//write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||||
|
|
||||||
// multipath channel
|
// multipath channel
|
||||||
dump_prach_config(&PHY_vars_eNB->lte_frame_parms,subframe);
|
dump_prach_config(&eNB->frame_parms,subframe);
|
||||||
|
|
||||||
for (i=0; i<2*frame_parms->samples_per_tti; i++) {
|
for (i=0; i<2*frame_parms->samples_per_tti; i++) {
|
||||||
for (aa=0; aa<1; aa++) {
|
for (aa=0; aa<1; aa++) {
|
||||||
@@ -444,7 +441,7 @@ int main(int argc, char **argv)
|
|||||||
s_re[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
|
s_re[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
|
||||||
s_im[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
|
s_im[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
|
||||||
} else {
|
} else {
|
||||||
for (aarx=0; aarx<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<eNB->frame_parms.nb_antennas_rx; aarx++) {
|
||||||
if (aa==0) {
|
if (aa==0) {
|
||||||
r_re[aarx][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
|
r_re[aarx][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
|
||||||
r_im[aarx][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
|
r_im[aarx][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
|
||||||
@@ -491,15 +488,14 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<frame_parms->samples_per_tti; i++) {
|
for (i=0; i<frame_parms->samples_per_tti; i++) {
|
||||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
|
for (aa=0; aa<eNB->frame_parms.nb_antennas_rx; aa++) {
|
||||||
|
|
||||||
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) (.167*(r_re[aa][i] +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) (.167*(r_re[aa][i] +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||||
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) (.167*(r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) (.167*(r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rx_prach(PHY_vars_eNB,
|
rx_prach(eNB,
|
||||||
subframe,
|
|
||||||
preamble_energy_list,
|
preamble_energy_list,
|
||||||
preamble_delay_list,
|
preamble_delay_list,
|
||||||
0, //Nf
|
0, //Nf
|
||||||
@@ -530,12 +526,12 @@ int main(int argc, char **argv)
|
|||||||
printf("preamble %d : energy %d, delay %d\n",i,preamble_energy_list[i],preamble_delay_list[i]);
|
printf("preamble %d : energy %d, delay %d\n",i,preamble_energy_list[i],preamble_delay_list[i]);
|
||||||
|
|
||||||
write_output("prach0.m","prach0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
|
write_output("prach0.m","prach0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
|
||||||
write_output("prachF0.m","prachF0", &PHY_vars_eNB->lte_eNB_prach_vars.prachF[0],24576,1,1);
|
write_output("prachF0.m","prachF0", &eNB->prach_vars.prachF[0],24576,1,1);
|
||||||
write_output("rxsig0.m","rxs0",
|
write_output("rxsig0.m","rxs0",
|
||||||
&PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*frame_parms->samples_per_tti],
|
&eNB->common_vars.rxdata[0][0][subframe*frame_parms->samples_per_tti],
|
||||||
frame_parms->samples_per_tti,1,1);
|
frame_parms->samples_per_tti,1,1);
|
||||||
write_output("rxsigF0.m","rxsF0", &PHY_vars_eNB->lte_eNB_common_vars.rxdataF[0][0][0],512*nsymb*2,2,1);
|
write_output("rxsigF0.m","rxsF0", &eNB->common_vars.rxdataF[0][0][0],512*nsymb*2,2,1);
|
||||||
write_output("prach_preamble.m","prachp",&PHY_vars_eNB->X_u[0],839,1,1);
|
write_output("prach_preamble.m","prachp",&eNB->X_u[0],839,1,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,10 +45,12 @@
|
|||||||
#include "OCG_vars.h"
|
#include "OCG_vars.h"
|
||||||
#include "UTIL/LOG/log_extern.h"
|
#include "UTIL/LOG/log_extern.h"
|
||||||
|
|
||||||
|
#include "unitary_defs.h"
|
||||||
|
|
||||||
int current_dlsch_cqi; //FIXME!
|
int current_dlsch_cqi; //FIXME!
|
||||||
|
|
||||||
PHY_VARS_eNB *PHY_vars_eNB;
|
PHY_VARS_eNB *eNB;
|
||||||
PHY_VARS_UE *PHY_vars_UE;
|
PHY_VARS_UE *UE;
|
||||||
|
|
||||||
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
||||||
|
|
||||||
@@ -101,17 +103,6 @@ int main(int argc, char **argv)
|
|||||||
uint16_t n2_pucch = 0;
|
uint16_t n2_pucch = 0;
|
||||||
|
|
||||||
number_of_cards = 1;
|
number_of_cards = 1;
|
||||||
openair_daq_vars.rx_rf_mode = 1;
|
|
||||||
|
|
||||||
/*
|
|
||||||
rxdataF = (int **)malloc16(2*sizeof(int*));
|
|
||||||
rxdataF[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
rxdataF[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
|
|
||||||
rxdata = (int **)malloc16(2*sizeof(int*));
|
|
||||||
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
|
||||||
*/
|
|
||||||
|
|
||||||
while ((c = getopt (argc, argv, "har:pf:g:n:s:S:x:y:z:N:F:T:R:")) != -1) {
|
while ((c = getopt (argc, argv, "har:pf:g:n:s:S:x:y:z:N:F:T:R:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
@@ -311,10 +302,11 @@ int main(int argc, char **argv)
|
|||||||
n_rx,
|
n_rx,
|
||||||
transmission_mode,
|
transmission_mode,
|
||||||
extended_prefix_flag,
|
extended_prefix_flag,
|
||||||
Nid_cell,
|
|
||||||
FDD,
|
FDD,
|
||||||
|
Nid_cell,
|
||||||
3,
|
3,
|
||||||
N_RB_DL,
|
N_RB_DL,
|
||||||
|
0,
|
||||||
osf,
|
osf,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
@@ -328,10 +320,10 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
|
printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
|
||||||
|
|
||||||
frame_parms = &PHY_vars_eNB->lte_frame_parms;
|
frame_parms = &eNB->frame_parms;
|
||||||
|
|
||||||
|
|
||||||
txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id];
|
txdata = eNB->common_vars.txdata[eNB_id];
|
||||||
|
|
||||||
s_re = malloc(2*sizeof(double*));
|
s_re = malloc(2*sizeof(double*));
|
||||||
s_im = malloc(2*sizeof(double*));
|
s_im = malloc(2*sizeof(double*));
|
||||||
@@ -345,11 +337,11 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
printf("[SIM] Using SCM/101\n");
|
printf("[SIM] Using SCM/101\n");
|
||||||
UE2eNB = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
UE2eNB = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx,
|
||||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
UE->frame_parms.nb_antennas_rx,
|
||||||
channel_model,
|
channel_model,
|
||||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
|
N_RB2sampling_rate(eNB->frame_parms.N_RB_UL),
|
||||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
|
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_UL),
|
||||||
0.0,
|
0.0,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
@@ -373,22 +365,22 @@ int main(int argc, char **argv)
|
|||||||
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
|
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
|
||||||
}
|
}
|
||||||
|
|
||||||
init_ncs_cell(&PHY_vars_eNB->lte_frame_parms,PHY_vars_eNB->ncs_cell);
|
init_ncs_cell(&eNB->frame_parms,eNB->ncs_cell);
|
||||||
|
|
||||||
init_ncs_cell(&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->ncs_cell);
|
init_ncs_cell(&UE->frame_parms,UE->ncs_cell);
|
||||||
|
|
||||||
PHY_vars_eNB->lte_frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
|
eNB->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
|
||||||
PHY_vars_eNB->lte_frame_parms.pucch_config_common.nRB_CQI = 0;
|
eNB->frame_parms.pucch_config_common.nRB_CQI = 0;
|
||||||
PHY_vars_eNB->lte_frame_parms.pucch_config_common.nCS_AN = 0;
|
eNB->frame_parms.pucch_config_common.nCS_AN = 0;
|
||||||
PHY_vars_UE->lte_frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
|
UE->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
|
||||||
PHY_vars_UE->lte_frame_parms.pucch_config_common.nRB_CQI = 0;
|
UE->frame_parms.pucch_config_common.nRB_CQI = 0;
|
||||||
PHY_vars_UE->lte_frame_parms.pucch_config_common.nCS_AN = 0;
|
UE->frame_parms.pucch_config_common.nCS_AN = 0;
|
||||||
|
|
||||||
pucch_payload = 0;
|
pucch_payload = 0;
|
||||||
|
|
||||||
generate_pucch(PHY_vars_UE->lte_ue_common_vars.txdataF,
|
generate_pucch(UE->common_vars.txdataF,
|
||||||
frame_parms,
|
frame_parms,
|
||||||
PHY_vars_UE->ncs_cell,
|
UE->ncs_cell,
|
||||||
pucch_format,
|
pucch_format,
|
||||||
&pucch_config_dedicated,
|
&pucch_config_dedicated,
|
||||||
n1_pucch,
|
n1_pucch,
|
||||||
@@ -397,34 +389,34 @@ int main(int argc, char **argv)
|
|||||||
&pucch_payload,
|
&pucch_payload,
|
||||||
AMP, //amp,
|
AMP, //amp,
|
||||||
subframe); //subframe
|
subframe); //subframe
|
||||||
write_output("txsigF0.m","txsF0", &PHY_vars_UE->lte_ue_common_vars.txdataF[0][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*nsymb,1,1);
|
write_output("txsigF0.m","txsF0", &UE->common_vars.txdataF[0][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*nsymb,1,1);
|
||||||
|
|
||||||
tx_lev = 0;
|
tx_lev = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
|
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx; aa++) {
|
||||||
if (frame_parms->Ncp == 1)
|
if (frame_parms->Ncp == 1)
|
||||||
PHY_ofdm_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[aa][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX], // input,
|
PHY_ofdm_mod(&UE->common_vars.txdataF[aa][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX], // input,
|
||||||
&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe], // output
|
&txdata[aa][eNB->frame_parms.samples_per_tti*subframe], // output
|
||||||
frame_parms->ofdm_symbol_size,
|
frame_parms->ofdm_symbol_size,
|
||||||
nsymb, // number of symbols
|
nsymb, // number of symbols
|
||||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||||
CYCLIC_PREFIX);
|
CYCLIC_PREFIX);
|
||||||
else {
|
else {
|
||||||
normal_prefix_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[eNB_id][subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],
|
normal_prefix_mod(&UE->common_vars.txdataF[eNB_id][subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],
|
||||||
&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe],
|
&txdata[aa][eNB->frame_parms.samples_per_tti*subframe],
|
||||||
nsymb,
|
nsymb,
|
||||||
frame_parms);
|
frame_parms);
|
||||||
//apply_7_5_kHz(PHY_vars_UE,PHY_vars_UE->lte_ue_common_vars.txdata[aa],subframe<<1);
|
//apply_7_5_kHz(UE,UE->common_vars.txdata[aa],subframe<<1);
|
||||||
//apply_7_5_kHz(PHY_vars_UE,PHY_vars_UE->lte_ue_common_vars.txdata[aa],1+(subframe<<1));
|
//apply_7_5_kHz(UE,UE->common_vars.txdata[aa],1+(subframe<<1));
|
||||||
apply_7_5_kHz(PHY_vars_UE,&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe],0);
|
apply_7_5_kHz(UE,&txdata[aa][eNB->frame_parms.samples_per_tti*subframe],0);
|
||||||
apply_7_5_kHz(PHY_vars_UE,&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe],1);
|
apply_7_5_kHz(UE,&txdata[aa][eNB->frame_parms.samples_per_tti*subframe],1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tx_lev += signal_energy(&txdata[aa][subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti],
|
tx_lev += signal_energy(&txdata[aa][subframe*eNB->frame_parms.samples_per_tti],
|
||||||
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
|
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,7 +428,7 @@ int main(int argc, char **argv)
|
|||||||
// multipath channel
|
// multipath channel
|
||||||
|
|
||||||
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
||||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
|
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx; aa++) {
|
||||||
s_re[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
|
s_re[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)]);
|
||||||
s_im[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
|
s_im[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
|
||||||
}
|
}
|
||||||
@@ -498,17 +490,17 @@ int main(int argc, char **argv)
|
|||||||
//printf("n_trial %d\n",n_trials);
|
//printf("n_trial %d\n",n_trials);
|
||||||
// fill measurement symbol (19) with noise
|
// fill measurement symbol (19) with noise
|
||||||
for (i=0; i<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
for (i=0; i<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
||||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
|
for (aa=0; aa<eNB->frame_parms.nb_antennas_rx; aa++) {
|
||||||
|
|
||||||
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
((short*) &eNB->common_vars.rxdata[0][aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||||
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
((short*) &eNB->common_vars.rxdata[0][aa][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
||||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
|
for (aa=0; aa<eNB->frame_parms.nb_antennas_rx; aa++) {
|
||||||
if (n_trials==0) {
|
if (n_trials==0) {
|
||||||
// r_re[aa][i] += (pow(10.0,.05*interf1)*r_re1[aa][i] + pow(10.0,.05*interf2)*r_re2[aa][i]);
|
// r_re[aa][i] += (pow(10.0,.05*interf1)*r_re1[aa][i] + pow(10.0,.05*interf2)*r_re2[aa][i]);
|
||||||
// r_im[aa][i] += (pow(10.0,.05*interf1)*r_im1[aa][i] + pow(10.0,.05*interf2)*r_im2[aa][i]);
|
// r_im[aa][i] += (pow(10.0,.05*interf1)*r_im1[aa][i] + pow(10.0,.05*interf2)*r_im2[aa][i]);
|
||||||
@@ -516,31 +508,31 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
if (sig==1) {
|
if (sig==1) {
|
||||||
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) (((tx_gain*r_re[aa][i]) +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) (((tx_gain*r_re[aa][i]) +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||||
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) (((tx_gain*r_im[aa][i]) + (iqim*r_re[aa][i]*tx_gain) + sqrt(sigma2/2)*gaussdouble(
|
((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) (((tx_gain*r_im[aa][i]) + (iqim*r_re[aa][i]*tx_gain) + sqrt(sigma2/2)*gaussdouble(
|
||||||
0.0,1.0)));
|
0.0,1.0)));
|
||||||
} else {
|
} else {
|
||||||
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||||
((short*) &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_7_5_kHz(PHY_vars_eNB,subframe<<1);
|
remove_7_5_kHz(eNB,subframe<<1);
|
||||||
remove_7_5_kHz(PHY_vars_eNB,1+(subframe<<1));
|
remove_7_5_kHz(eNB,1+(subframe<<1));
|
||||||
|
|
||||||
for (l=0; l<PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2; l++) {
|
for (l=0; l<eNB->frame_parms.symbols_per_tti/2; l++) {
|
||||||
|
|
||||||
slot_fep_ul(&PHY_vars_eNB->lte_frame_parms,
|
slot_fep_ul(&eNB->frame_parms,
|
||||||
&PHY_vars_eNB->lte_eNB_common_vars,
|
&eNB->common_vars,
|
||||||
l,
|
l,
|
||||||
subframe*2,// slot
|
subframe*2,// slot
|
||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
slot_fep_ul(&PHY_vars_eNB->lte_frame_parms,
|
slot_fep_ul(&eNB->frame_parms,
|
||||||
&PHY_vars_eNB->lte_eNB_common_vars,
|
&eNB->common_vars,
|
||||||
l,
|
l,
|
||||||
1+(subframe*2),//slot
|
1+(subframe*2),//slot
|
||||||
0,
|
0,
|
||||||
@@ -553,12 +545,12 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
// if (sig == 1)
|
// if (sig == 1)
|
||||||
// printf("*");
|
// printf("*");
|
||||||
lte_eNB_I0_measurements(PHY_vars_eNB,
|
lte_eNB_I0_measurements(eNB,
|
||||||
subframe,
|
subframe,
|
||||||
0,
|
0,
|
||||||
1);
|
1);
|
||||||
PHY_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB = N0;//(int8_t)(sigma2_dB-10*log10(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(12*NB_RB)));
|
eNB->measurements[0].n0_power_tot_dB = N0;//(int8_t)(sigma2_dB-10*log10(eNB->frame_parms.ofdm_symbol_size/(12*NB_RB)));
|
||||||
stat = rx_pucch(PHY_vars_eNB,
|
stat = rx_pucch(eNB,
|
||||||
pucch_format,
|
pucch_format,
|
||||||
0,
|
0,
|
||||||
n1_pucch,
|
n1_pucch,
|
||||||
@@ -593,7 +585,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pucch_format==pucch_format1)
|
if (pucch_format==pucch_format1)
|
||||||
printf("pucch_trials %d : pucch1_false %d,pucch1_missed %d, N0 %d dB, stat_no_sig %f dB, stat_sig %f dB\n",pucch_tx,pucch1_false,pucch1_missed,PHY_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB,
|
printf("pucch_trials %d : pucch1_false %d,pucch1_missed %d, N0 %d dB, stat_no_sig %f dB, stat_sig %f dB\n",pucch_tx,pucch1_false,pucch1_missed,eNB->measurements[0].n0_power_tot_dB,
|
||||||
10*log10(stat_no_sig),10*log10(stat_sig));
|
10*log10(stat_no_sig),10*log10(stat_sig));
|
||||||
else if (pucch_format==pucch_format1a)
|
else if (pucch_format==pucch_format1a)
|
||||||
printf("pucch_trials %d : pucch1a_errors %d\n",pucch_tx,pucch1_false);
|
printf("pucch_trials %d : pucch1a_errors %d\n",pucch_tx,pucch1_false);
|
||||||
@@ -605,8 +597,8 @@ int main(int argc, char **argv)
|
|||||||
if (n_frames==1) {
|
if (n_frames==1) {
|
||||||
//write_output("txsig0.m","txs0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
|
//write_output("txsig0.m","txs0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
|
||||||
write_output("txsig0pucch.m", "txs0", &txdata[0][0], FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
write_output("txsig0pucch.m", "txs0", &txdata[0][0], FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||||
write_output("rxsig0.m","rxs0", &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
|
write_output("rxsig0.m","rxs0", &eNB->common_vars.rxdata[0][0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
|
||||||
write_output("rxsigF0.m","rxsF0", &PHY_vars_eNB->lte_eNB_common_vars.rxdataF[0][0][0],512*nsymb*2,2,1);
|
write_output("rxsigF0.m","rxsF0", &eNB->common_vars.rxdataF[0][0][0],512*nsymb*2,2,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+341
-347
File diff suppressed because it is too large
Load Diff
@@ -786,7 +786,7 @@ rrc_get_estimated_ue_distance(
|
|||||||
const int CC_idP,
|
const int CC_idP,
|
||||||
const uint8_t loc_typeP);
|
const uint8_t loc_typeP);
|
||||||
|
|
||||||
void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB);
|
void fill_dci(DCI_PDU *DCI_pdu, PHY_VARS_eNB *phy_vars_eNB);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/** @}*/
|
/** @}*/
|
||||||
|
|||||||
+153
-524
@@ -139,8 +139,8 @@ extern int sync_var;
|
|||||||
|
|
||||||
time_stats_t softmodem_stats_mt; // main thread
|
time_stats_t softmodem_stats_mt; // main thread
|
||||||
time_stats_t softmodem_stats_hw; // hw acquisition
|
time_stats_t softmodem_stats_hw; // hw acquisition
|
||||||
time_stats_t softmodem_stats_tx_sf[10]; // total tx time
|
time_stats_t softmodem_stats_tx_sf; // total tx time
|
||||||
time_stats_t softmodem_stats_rx_sf[10]; // total rx time
|
time_stats_t softmodem_stats_rx_sf; // total rx time
|
||||||
int32_t **rxdata;
|
int32_t **rxdata;
|
||||||
int32_t **txdata;
|
int32_t **txdata;
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ static struct {
|
|||||||
pthread_mutex_t mutex_phy_proc_tx;
|
pthread_mutex_t mutex_phy_proc_tx;
|
||||||
pthread_cond_t cond_phy_proc_tx;
|
pthread_cond_t cond_phy_proc_tx;
|
||||||
volatile uint8_t phy_proc_CC_id;
|
volatile uint8_t phy_proc_CC_id;
|
||||||
} sync_phy_proc[NUM_ENB_THREADS];
|
} sync_phy_proc;
|
||||||
|
|
||||||
|
|
||||||
void exit_fun(const char* s);
|
void exit_fun(const char* s);
|
||||||
@@ -271,7 +271,7 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
|
|||||||
*/
|
*/
|
||||||
static void* eNB_thread_tx( void* param )
|
static void* eNB_thread_tx( void* param )
|
||||||
{
|
{
|
||||||
static int eNB_thread_tx_status[NUM_ENB_THREADS];
|
static int eNB_thread_tx_status;
|
||||||
|
|
||||||
eNB_proc_t *proc = (eNB_proc_t*)param;
|
eNB_proc_t *proc = (eNB_proc_t*)param;
|
||||||
FILE *tx_time_file = NULL;
|
FILE *tx_time_file = NULL;
|
||||||
@@ -279,11 +279,11 @@ static void* eNB_thread_tx( void* param )
|
|||||||
void *txp[PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx];
|
void *txp[PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx];
|
||||||
|
|
||||||
if (opp_enabled == 1) {
|
if (opp_enabled == 1) {
|
||||||
snprintf(tx_time_name, 100,"/tmp/%s_tx_time_thread_sf_%d", "eNB", proc->thread_index);
|
snprintf(tx_time_name, 100,"/tmp/%s_tx_time_thread_sf", "eNB");
|
||||||
tx_time_file = fopen(tx_time_name,"w");
|
tx_time_file = fopen(tx_time_name,"w");
|
||||||
}
|
}
|
||||||
// set default return value
|
// set default return value
|
||||||
eNB_thread_tx_status[proc->thread_index] = 0;
|
eNB_thread_tx_status = 0;
|
||||||
|
|
||||||
MSC_START_USE();
|
MSC_START_USE();
|
||||||
|
|
||||||
@@ -306,10 +306,10 @@ static void* eNB_thread_tx( void* param )
|
|||||||
|
|
||||||
if (sched_setattr(0, &attr, flags) < 0 ) {
|
if (sched_setattr(0, &attr, flags) < 0 ) {
|
||||||
perror("[SCHED] eNB tx thread: sched_setattr failed\n");
|
perror("[SCHED] eNB tx thread: sched_setattr failed\n");
|
||||||
return &eNB_thread_tx_status[proc->thread_index];
|
return &eNB_thread_tx_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I( HW, "[SCHED] eNB TX deadline thread %d(TID %ld) started on CPU %d\n", proc->thread_index, gettid(), sched_getcpu() );
|
LOG_I( HW, "[SCHED] eNB TX deadline thread (TID %ld) started on CPU %d\n", gettid(), sched_getcpu() );
|
||||||
|
|
||||||
#else //LOW_LATENCY
|
#else //LOW_LATENCY
|
||||||
int policy, s, j;
|
int policy, s, j;
|
||||||
@@ -372,7 +372,7 @@ static void* eNB_thread_tx( void* param )
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I( HW, "[SCHED][eNB] TX thread %d started on CPU %d TID %ld, sched_policy = %s , priority = %d, CPU Affinity=%s \n", proc->thread_index, sched_getcpu(),gettid(),
|
LOG_I( HW, "[SCHED][eNB] TX thread %d started on CPU %d TID %ld, sched_policy = %s , priority = %d, CPU Affinity=%s \n",sched_getcpu(),gettid(),
|
||||||
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
|
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
|
||||||
(policy == SCHED_RR) ? "SCHED_RR" :
|
(policy == SCHED_RR) ? "SCHED_RR" :
|
||||||
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
|
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
|
||||||
@@ -388,10 +388,10 @@ static void* eNB_thread_tx( void* param )
|
|||||||
|
|
||||||
while (!oai_exit) {
|
while (!oai_exit) {
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX0+(2*proc->thread_index), 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX0, 0 );
|
||||||
|
|
||||||
if (pthread_mutex_lock(&proc->mutex_tx) != 0) {
|
if (pthread_mutex_lock(&proc->mutex_tx) != 0) {
|
||||||
LOG_E( PHY, "[SCHED][eNB] error locking mutex for eNB TX proc %d\n", proc->thread_index );
|
LOG_E( PHY, "[SCHED][eNB] error locking mutex for eNB TX\n");
|
||||||
exit_fun("nothing to add");
|
exit_fun("nothing to add");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -403,13 +403,13 @@ static void* eNB_thread_tx( void* param )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pthread_mutex_unlock(&proc->mutex_tx) != 0) {
|
if (pthread_mutex_unlock(&proc->mutex_tx) != 0) {
|
||||||
LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for eNB TX proc %d\n",proc->thread_index);
|
LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for eNB TX\n");
|
||||||
exit_fun("nothing to add");
|
exit_fun("nothing to add");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX0+(2*proc->thread_index), 1 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX0, 1 );
|
||||||
start_meas( &softmodem_stats_tx_sf[proc->thread_index] );
|
start_meas( &softmodem_stats_tx_sf );
|
||||||
|
|
||||||
if (oai_exit) break;
|
if (oai_exit) break;
|
||||||
|
|
||||||
@@ -420,19 +420,19 @@ static void* eNB_thread_tx( void* param )
|
|||||||
/* run PHY TX procedures the one after the other for all CCs to avoid race conditions
|
/* run PHY TX procedures the one after the other for all CCs to avoid race conditions
|
||||||
* (may be relaxed in the future for performance reasons)
|
* (may be relaxed in the future for performance reasons)
|
||||||
*/
|
*/
|
||||||
if (pthread_mutex_lock(&sync_phy_proc[proc->thread_index].mutex_phy_proc_tx) != 0) {
|
if (pthread_mutex_lock(&sync_phy_proc.mutex_phy_proc_tx) != 0) {
|
||||||
LOG_E(PHY, "[SCHED][eNB] error locking PHY proc mutex for eNB TX proc %d\n", proc->thread_index);
|
LOG_E(PHY, "[SCHED][eNB] error locking PHY proc mutex for eNB TX\n");
|
||||||
exit_fun("nothing to add");
|
exit_fun("nothing to add");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* wait for our turn or oai_exit */
|
/* wait for our turn or oai_exit */
|
||||||
while (sync_phy_proc[proc->thread_index].phy_proc_CC_id != proc->CC_id && !oai_exit) {
|
while (sync_phy_proc.phy_proc_CC_id != proc->CC_id && !oai_exit) {
|
||||||
pthread_cond_wait(&sync_phy_proc[proc->thread_index].cond_phy_proc_tx,
|
pthread_cond_wait(&sync_phy_proc.cond_phy_proc_tx,
|
||||||
&sync_phy_proc[proc->thread_index].mutex_phy_proc_tx);
|
&sync_phy_proc.mutex_phy_proc_tx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pthread_mutex_unlock(&sync_phy_proc[proc->thread_index].mutex_phy_proc_tx) != 0) {
|
if (pthread_mutex_unlock(&sync_phy_proc.mutex_phy_proc_tx) != 0) {
|
||||||
LOG_E(PHY, "[SCHED][eNB] error unlocking PHY proc mutex for eNB TX proc %d\n", proc->thread_index);
|
LOG_E(PHY, "[SCHED][eNB] error unlocking PHY proc mutex for eNB TX\n");
|
||||||
exit_fun("nothing to add");
|
exit_fun("nothing to add");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,19 +442,19 @@ static void* eNB_thread_tx( void* param )
|
|||||||
if (oai_exit)
|
if (oai_exit)
|
||||||
break;
|
break;
|
||||||
if (PHY_vars_eNB_g[0][proc->CC_id]->node_function != NGFI_RRU_IF4) {
|
if (PHY_vars_eNB_g[0][proc->CC_id]->node_function != NGFI_RRU_IF4) {
|
||||||
phy_procedures_eNB_TX( proc->thread_index, PHY_vars_eNB_g[0][proc->CC_id], 0, no_relay, NULL );
|
phy_procedures_eNB_TX(PHY_vars_eNB_g[0][proc->CC_id], 0, no_relay, NULL );
|
||||||
|
|
||||||
/* we're done, let the next one proceed */
|
/* we're done, let the next one proceed */
|
||||||
if (pthread_mutex_lock(&sync_phy_proc[proc->thread_index].mutex_phy_proc_tx) != 0) {
|
if (pthread_mutex_lock(&sync_phy_proc.mutex_phy_proc_tx) != 0) {
|
||||||
LOG_E(PHY, "[SCHED][eNB] error locking PHY proc mutex for eNB TX proc %d\n", proc->thread_index);
|
LOG_E(PHY, "[SCHED][eNB] error locking PHY proc mutex for eNB TX proc\n");
|
||||||
exit_fun("nothing to add");
|
exit_fun("nothing to add");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sync_phy_proc[proc->thread_index].phy_proc_CC_id++;
|
sync_phy_proc.phy_proc_CC_id++;
|
||||||
sync_phy_proc[proc->thread_index].phy_proc_CC_id %= MAX_NUM_CCs;
|
sync_phy_proc.phy_proc_CC_id %= MAX_NUM_CCs;
|
||||||
pthread_cond_broadcast(&sync_phy_proc[proc->thread_index].cond_phy_proc_tx);
|
pthread_cond_broadcast(&sync_phy_proc.cond_phy_proc_tx);
|
||||||
if (pthread_mutex_unlock(&sync_phy_proc[proc->thread_index].mutex_phy_proc_tx) != 0) {
|
if (pthread_mutex_unlock(&sync_phy_proc.mutex_phy_proc_tx) != 0) {
|
||||||
LOG_E(PHY, "[SCHED][eNB] error unlocking PHY proc mutex for eNB TX proc %d\n", proc->thread_index);
|
LOG_E(PHY, "[SCHED][eNB] error unlocking PHY proc mutex for eNB TX proc\n");
|
||||||
exit_fun("nothing to add");
|
exit_fun("nothing to add");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -503,7 +503,7 @@ static void* eNB_thread_tx( void* param )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pthread_mutex_lock(&proc->mutex_tx) != 0) {
|
if (pthread_mutex_lock(&proc->mutex_tx) != 0) {
|
||||||
LOG_E( PHY, "[SCHED][eNB] error locking mutex for eNB TX proc %d\n", proc->thread_index );
|
LOG_E( PHY, "[SCHED][eNB] error locking mutex for eNB TX proc\n");
|
||||||
exit_fun("nothing to add");
|
exit_fun("nothing to add");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -511,55 +511,55 @@ static void* eNB_thread_tx( void* param )
|
|||||||
proc->instance_cnt_tx--;
|
proc->instance_cnt_tx--;
|
||||||
|
|
||||||
if (pthread_mutex_unlock(&proc->mutex_tx) != 0) {
|
if (pthread_mutex_unlock(&proc->mutex_tx) != 0) {
|
||||||
LOG_E( PHY, "[SCHED][eNB] error unlocking mutex for eNB TX proc %d\n", proc->thread_index );
|
LOG_E( PHY, "[SCHED][eNB] error unlocking mutex for eNB TX proc\n");
|
||||||
exit_fun("nothing to add");
|
exit_fun("nothing to add");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_meas( &softmodem_stats_tx_sf[proc->thread_index] );
|
stop_meas( &softmodem_stats_tx_sf );
|
||||||
#ifdef LOWLATENCY
|
#ifdef LOWLATENCY
|
||||||
if (opp_enabled){
|
if (opp_enabled){
|
||||||
if(softmodem_stats_tx_sf[proc->thread_index].diff_now/(cpuf) > attr.sched_runtime){
|
if(softmodem_stats_tx_sf.diff_now/(cpuf) > attr.sched_runtime){
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB, (softmodem_stats_tx_sf[proc->thread_index].diff_now/cpuf - attr.sched_runtime)/1000000.0);
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB, (softmodem_stats_tx_sf.diff_now/cpuf - attr.sched_runtime)/1000000.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
print_meas_now(&softmodem_stats_tx_sf[proc->thread_index],"eNB_TX_SF",proc->thread_index, tx_time_file);
|
print_meas_now(&softmodem_stats_tx_sf,"eNB_TX_SF",tx_time_file);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX0+(2*proc->thread_index), 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX0, 0 );
|
||||||
|
|
||||||
#ifdef DEBUG_THREADS
|
#ifdef DEBUG_THREADS
|
||||||
printf( "Exiting eNB thread TX %d\n", proc->thread_index );
|
printf( "Exiting eNB thread TX\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
eNB_thread_tx_status[proc->thread_index] = 0;
|
eNB_thread_tx_status = 0;
|
||||||
return &eNB_thread_tx_status[proc->thread_index];
|
return &eNB_thread_tx_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
static void wait_system_ready (char *message, volatile int *start_flag)
|
static void wait_system_ready (char *message, volatile int *start_flag)
|
||||||
{
|
|
||||||
/* Wait for eNB application initialization to be complete (eNB registration to MME) */
|
/* Wait for eNB application initialization to be complete (eNB registration to MME) */
|
||||||
{
|
{
|
||||||
static char *indicator[] = {". ", ".. ", "... ", ".... ", ".....",
|
static char *indicator[] = {". ", ".. ", "... ", ".... ", ".....",
|
||||||
" ....", " ...", " ..", " .", " "
|
" ....", " ...", " ..", " .", " "
|
||||||
};
|
};
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while ((!oai_exit) && (*start_flag == 0)) {
|
while ((!oai_exit) && (*start_flag == 0)) {
|
||||||
LOG_N(EMU, message, indicator[i]);
|
LOG_N(EMU, message, indicator[i]);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
i = (i + 1) % (sizeof(indicator) / sizeof(indicator[0]));
|
i = (i + 1) % (sizeof(indicator) / sizeof(indicator[0]));
|
||||||
usleep(200000);
|
usleep(200000);
|
||||||
}
|
|
||||||
|
|
||||||
LOG_D(EMU,"\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG_D(EMU,"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -570,7 +570,7 @@ static void wait_system_ready (char *message, volatile int *start_flag)
|
|||||||
*/
|
*/
|
||||||
static void* eNB_thread_rx( void* param )
|
static void* eNB_thread_rx( void* param )
|
||||||
{
|
{
|
||||||
static int eNB_thread_rx_status[NUM_ENB_THREADS];
|
static int eNB_thread_rx_status;
|
||||||
|
|
||||||
eNB_proc_t *proc = (eNB_proc_t*)param;
|
eNB_proc_t *proc = (eNB_proc_t*)param;
|
||||||
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
|
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
|
||||||
@@ -581,11 +581,11 @@ static void* eNB_thread_rx( void* param )
|
|||||||
//int i;
|
//int i;
|
||||||
|
|
||||||
if (opp_enabled == 1){
|
if (opp_enabled == 1){
|
||||||
snprintf(rx_time_name, 100,"/tmp/%s_rx_time_thread_sf_%d", "eNB", proc->thread_index);
|
snprintf(rx_time_name, 100,"/tmp/%s_rx_time_thread_sf", "eNB");
|
||||||
rx_time_file = fopen(rx_time_name,"w");
|
rx_time_file = fopen(rx_time_name,"w");
|
||||||
}
|
}
|
||||||
// set default return value
|
// set default return value
|
||||||
eNB_thread_rx_status[proc->thread_index] = 0;
|
eNB_thread_rx_status = 0;
|
||||||
|
|
||||||
MSC_START_USE();
|
MSC_START_USE();
|
||||||
|
|
||||||
@@ -608,10 +608,10 @@ static void* eNB_thread_rx( void* param )
|
|||||||
|
|
||||||
if (sched_setattr(0, &attr, flags) < 0 ) {
|
if (sched_setattr(0, &attr, flags) < 0 ) {
|
||||||
perror("[SCHED] eNB RX sched_setattr failed\n");
|
perror("[SCHED] eNB RX sched_setattr failed\n");
|
||||||
return &eNB_thread_rx_status[proc->thread_index];
|
return &eNB_thread_rx_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I( HW, "[SCHED] eNB RX deadline thread %d(TID %ld) started on CPU %d\n", proc->thread_index, gettid(), sched_getcpu() );
|
LOG_I( HW, "[SCHED] eNB RX deadline thread (TID %ld) started on CPU %d\n", gettid(), sched_getcpu() );
|
||||||
#else // LOW_LATENCY
|
#else // LOW_LATENCY
|
||||||
int policy, s, j;
|
int policy, s, j;
|
||||||
struct sched_param sparam;
|
struct sched_param sparam;
|
||||||
@@ -678,7 +678,7 @@ static void* eNB_thread_rx( void* param )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %ld, sched_policy = %s, priority = %d, CPU Affinity = %s\n", proc->thread_index, sched_getcpu(),gettid(),
|
LOG_I( HW, "[SCHED][eNB] RX thread started on CPU %d TID %ld, sched_policy = %s, priority = %d, CPU Affinity = %s\n", sched_getcpu(),gettid(),
|
||||||
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
|
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
|
||||||
(policy == SCHED_RR) ? "SCHED_RR" :
|
(policy == SCHED_RR) ? "SCHED_RR" :
|
||||||
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
|
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
|
||||||
@@ -692,7 +692,7 @@ static void* eNB_thread_rx( void* param )
|
|||||||
|
|
||||||
|
|
||||||
// wait for top-level synchronization and do one acquisition to get timestamp for setting frame/subframe of TX and RX threads
|
// wait for top-level synchronization and do one acquisition to get timestamp for setting frame/subframe of TX and RX threads
|
||||||
printf( "waiting for sync (eNB_thread_rx %d)\n",proc->thread_index);
|
printf( "waiting for sync (eNB_thread_rx)\n");
|
||||||
pthread_mutex_lock( &sync_mutex );
|
pthread_mutex_lock( &sync_mutex );
|
||||||
|
|
||||||
while (sync_var<0)
|
while (sync_var<0)
|
||||||
@@ -710,9 +710,9 @@ static void* eNB_thread_rx( void* param )
|
|||||||
while (!oai_exit) {
|
while (!oai_exit) {
|
||||||
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0+(2*proc->thread_index), 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0, 0 );
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, 0 );
|
||||||
start_meas( &softmodem_stats_rx_sf[proc->thread_index] );
|
start_meas( &softmodem_stats_rx_sf );
|
||||||
|
|
||||||
if (oai_exit) break;
|
if (oai_exit) break;
|
||||||
|
|
||||||
@@ -720,44 +720,44 @@ static void* eNB_thread_rx( void* param )
|
|||||||
(fp->frame_type == FDD))) {
|
(fp->frame_type == FDD))) {
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, 1 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, 1 );
|
||||||
// this spawns the prach and TX threads inside and updates the frame and subframe counters
|
// this spawns the prach and TX threads inside and updates the frame and subframe counters
|
||||||
phy_procedures_eNB_common_RX(proc->thread_index, eNB, 0);
|
phy_procedures_eNB_common_RX(eNB, 0);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, 0 );
|
||||||
if (eNB->node_function != NGFI_RRU_IF4) {
|
if (eNB->node_function != NGFI_RRU_IF4) {
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 1 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 1 );
|
||||||
// this is the ue-specific processing for the subframe and can be multi-threaded later
|
// this is the ue-specific processing for the subframe and can be multi-threaded later
|
||||||
phy_procedures_eNB_uespec_RX(proc->thread_index, eNB, 0, no_relay );
|
phy_procedures_eNB_uespec_RX(eNB, 0, no_relay );
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((subframe_select(fp,proc->subframe_rx) == SF_S)) {
|
if ((subframe_select(fp,proc->subframe_rx) == SF_S)) {
|
||||||
phy_procedures_eNB_S_RX(proc->thread_index, PHY_vars_eNB_g[0][proc->CC_id], 0, no_relay );
|
phy_procedures_eNB_S_RX(eNB, 0, no_relay );
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_meas( &softmodem_stats_rx_sf[proc->thread_index] );
|
stop_meas( &softmodem_stats_rx_sf );
|
||||||
#ifdef LOWLATENCY
|
#ifdef LOWLATENCY
|
||||||
if (opp_enabled){
|
if (opp_enabled){
|
||||||
if(softmodem_stats_rx_sf[proc->thread_index].diff_now/(cpuf) > attr.sched_runtime){
|
if(softmodem_stats_rx_sf.diff_now/(cpuf) > attr.sched_runtime){
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RX_ENB, (softmodem_stats_rx_sf[proc->thread_index].diff_now/cpuf - attr.sched_runtime)/1000000.0);
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RX_ENB, (softmodem_stats_rx_sf.diff_now/cpuf - attr.sched_runtime)/1000000.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // LOWLATENCY
|
#endif // LOWLATENCY
|
||||||
print_meas_now(&softmodem_stats_rx_sf[proc->thread_index],"eNB_RX_SF",proc->thread_index, rx_time_file);
|
print_meas_now(&softmodem_stats_rx_sf,"eNB_RX_SF", rx_time_file);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0+(2*proc->thread_index), 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0, 0 );
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//stop_meas( &softmodem_stats_rx_sf[proc->thread_index] );
|
//stop_meas( &softmodem_stats_rx_sf[proc->thread_index] );
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0+(2*proc->thread_index), 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0, 0 );
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_THREADS
|
#ifdef DEBUG_THREADS
|
||||||
printf( "Exiting eNB thread RX %d\n", proc->thread_index );
|
printf( "Exiting eNB thread RX\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
eNB_thread_rx_status[proc->thread_index] = 0;
|
eNB_thread_rx_status = 0;
|
||||||
return &eNB_thread_rx_status[proc->thread_index];
|
return &eNB_thread_rx_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -778,7 +778,6 @@ static void* eNB_thread_prach( void* param )
|
|||||||
|
|
||||||
MSC_START_USE();
|
MSC_START_USE();
|
||||||
|
|
||||||
AssertFatal(proc->thread_index==0,"Invalid thread index %d for PRACH thread\n",proc->thread_index);
|
|
||||||
|
|
||||||
#ifdef LOWLATENCY
|
#ifdef LOWLATENCY
|
||||||
struct sched_attr attr;
|
struct sched_attr attr;
|
||||||
@@ -869,7 +868,7 @@ static void* eNB_thread_prach( void* param )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %ld, sched_policy = %s, priority = %d, CPU Affinity = %s\n", proc->thread_index, sched_getcpu(),gettid(),
|
LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %ld, sched_policy = %s, priority = %d, CPU Affinity = %s\n", sched_getcpu(),gettid(),
|
||||||
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
|
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
|
||||||
(policy == SCHED_RR) ? "SCHED_RR" :
|
(policy == SCHED_RR) ? "SCHED_RR" :
|
||||||
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
|
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
|
||||||
@@ -888,7 +887,7 @@ static void* eNB_thread_prach( void* param )
|
|||||||
if (oai_exit) break;
|
if (oai_exit) break;
|
||||||
|
|
||||||
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
|
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
|
||||||
LOG_E( PHY, "[SCHED][eNB] error locking mutex for eNB PRACH proc %d\n", proc->thread_index );
|
LOG_E( PHY, "[SCHED][eNB] error locking mutex for eNB PRACH\n");
|
||||||
exit_fun( "error locking mutex" );
|
exit_fun( "error locking mutex" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -900,17 +899,17 @@ static void* eNB_thread_prach( void* param )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pthread_mutex_unlock(&proc->mutex_prach) != 0) {
|
if (pthread_mutex_unlock(&proc->mutex_prach) != 0) {
|
||||||
LOG_E( PHY, "[SCHED][eNB] error unlocking mutex for eNB PRACH proc %d\n", proc->thread_index );
|
LOG_E( PHY, "[SCHED][eNB] error unlocking mutex for eNB PRACH\n");
|
||||||
exit_fun( "error unlocking mutex" );
|
exit_fun( "error unlocking mutex" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1);
|
||||||
prach_procedures(eNB,proc->thread_index,0);
|
prach_procedures(eNB,0);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0);
|
||||||
|
|
||||||
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
|
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
|
||||||
LOG_E( PHY, "[SCHED][eNB] error locking mutex for eNB PRACH proc %d\n", proc->thread_index );
|
LOG_E( PHY, "[SCHED][eNB] error locking mutex for eNB PRACH proc %d\n");
|
||||||
exit_fun( "error locking mutex" );
|
exit_fun( "error locking mutex" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -918,7 +917,7 @@ static void* eNB_thread_prach( void* param )
|
|||||||
proc->instance_cnt_prach--;
|
proc->instance_cnt_prach--;
|
||||||
|
|
||||||
if (pthread_mutex_unlock(&proc->mutex_prach) != 0) {
|
if (pthread_mutex_unlock(&proc->mutex_prach) != 0) {
|
||||||
LOG_E( PHY, "[SCHED][eNB] error unlocking mutex for eNB RX proc %d\n", proc->thread_index );
|
LOG_E( PHY, "[SCHED][eNB] error unlocking mutex for eNB RX proc %d\n");
|
||||||
exit_fun( "error unlocking mutex" );
|
exit_fun( "error unlocking mutex" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -945,67 +944,64 @@ void init_eNB_proc(void)
|
|||||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||||
eNB = PHY_vars_eNB_g[0][CC_id];
|
eNB = PHY_vars_eNB_g[0][CC_id];
|
||||||
|
|
||||||
for (i=0; i<NUM_ENB_THREADS; i++) {
|
|
||||||
proc = &eNB->proc[i];
|
|
||||||
// set the stack size
|
|
||||||
|
|
||||||
|
proc = &eNB->proc;
|
||||||
|
|
||||||
#ifndef LOWLATENCY
|
#ifndef LOWLATENCY
|
||||||
/*
|
/*
|
||||||
pthread_attr_init( &attr_eNB_proc_tx[CC_id][i] );
|
pthread_attr_init( &attr_eNB_proc_tx[CC_id][i] );
|
||||||
if (pthread_attr_setstacksize( &attr_eNB_proc_tx[CC_id][i], 64 *PTHREAD_STACK_MIN ) != 0)
|
if (pthread_attr_setstacksize( &attr_eNB_proc_tx[CC_id][i], 64 *PTHREAD_STACK_MIN ) != 0)
|
||||||
perror("[ENB_PROC_TX] setting thread stack size failed\n");
|
perror("[ENB_PROC_TX] setting thread stack size failed\n");
|
||||||
|
|
||||||
pthread_attr_init( &attr_eNB_proc_rx[CC_id][i] );
|
pthread_attr_init( &attr_eNB_proc_rx[CC_id][i] );
|
||||||
if (pthread_attr_setstacksize( &attr_eNB_proc_rx[CC_id][i], 64 * PTHREAD_STACK_MIN ) != 0)
|
if (pthread_attr_setstacksize( &attr_eNB_proc_rx[CC_id][i], 64 * PTHREAD_STACK_MIN ) != 0)
|
||||||
perror("[ENB_PROC_RX] setting thread stack size failed\n");
|
perror("[ENB_PROC_RX] setting thread stack size failed\n");
|
||||||
*/
|
*/
|
||||||
// set the kernel scheduling policy and priority
|
// set the kernel scheduling policy and priority
|
||||||
proc->sched_param_tx.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; //OPENAIR_THREAD_PRIORITY;
|
proc->sched_param_tx.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; //OPENAIR_THREAD_PRIORITY;
|
||||||
pthread_attr_setschedparam (&proc->attr_tx, &proc->sched_param_tx);
|
pthread_attr_setschedparam (&proc->attr_tx, &proc->sched_param_tx);
|
||||||
pthread_attr_setschedpolicy (&proc->attr_tx, SCHED_FIFO);
|
pthread_attr_setschedpolicy (&proc->attr_tx, SCHED_FIFO);
|
||||||
|
|
||||||
proc->sched_param_rx.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; //OPENAIR_THREAD_PRIORITY;
|
proc->sched_param_rx.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; //OPENAIR_THREAD_PRIORITY;
|
||||||
pthread_attr_setschedparam (&proc->attr_rx, &proc->sched_param_rx);
|
pthread_attr_setschedparam (&proc->attr_rx, &proc->sched_param_rx);
|
||||||
pthread_attr_setschedpolicy (&proc->attr_rx, SCHED_FIFO);
|
pthread_attr_setschedpolicy (&proc->attr_rx, SCHED_FIFO);
|
||||||
|
|
||||||
proc->sched_param_prach.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; //OPENAIR_THREAD_PRIORITY;
|
proc->sched_param_prach.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; //OPENAIR_THREAD_PRIORITY;
|
||||||
pthread_attr_setschedparam (&proc->attr_prach, &proc->sched_param_prach);
|
pthread_attr_setschedparam (&proc->attr_prach, &proc->sched_param_prach);
|
||||||
pthread_attr_setschedpolicy (&proc->attr_prach, SCHED_FIFO);
|
pthread_attr_setschedpolicy (&proc->attr_prach, SCHED_FIFO);
|
||||||
|
|
||||||
printf("Setting OS scheduler to SCHED_FIFO for eNB [cc%d][thread%d] \n",CC_id, i);
|
printf("Setting OS scheduler to SCHED_FIFO for eNB [cc%d][thread%d] \n",CC_id, i);
|
||||||
#endif
|
#endif
|
||||||
proc->instance_cnt_tx = -1;
|
proc->instance_cnt_tx = -1;
|
||||||
proc->instance_cnt_prach = -1;
|
proc->instance_cnt_prach = -1;
|
||||||
proc->CC_id = CC_id;
|
proc->CC_id = CC_id;
|
||||||
pthread_mutex_init( &proc->mutex_tx, NULL);
|
pthread_mutex_init( &proc->mutex_tx, NULL);
|
||||||
pthread_cond_init( &proc->cond_tx, NULL);
|
pthread_cond_init( &proc->cond_tx, NULL);
|
||||||
pthread_cond_init( &proc->cond_prach, NULL);
|
pthread_cond_init( &proc->cond_prach, NULL);
|
||||||
#ifndef LOWLATENCY
|
#ifndef LOWLATENCY
|
||||||
pthread_create( &proc->pthread_tx, &proc->attr_tx, eNB_thread_tx, &eNB->proc[i] );
|
pthread_create( &proc->pthread_tx, &proc->attr_tx, eNB_thread_tx, &eNB->proc );
|
||||||
pthread_create( &proc->pthread_rx, &proc->attr_rx, eNB_thread_rx, &eNB->proc[i] );
|
pthread_create( &proc->pthread_rx, &proc->attr_rx, eNB_thread_rx, &eNB->proc );
|
||||||
pthread_create( &proc->pthread_prach, &proc->attr_prach, eNB_thread_prach, &eNB->proc[i] );
|
pthread_create( &proc->pthread_prach, &proc->attr_prach, eNB_thread_prach, &eNB->proc );
|
||||||
#else
|
#else
|
||||||
pthread_create( &proc->pthread_tx, NULL, eNB_thread_tx, &eNB->proc[i] );
|
pthread_create( &proc->pthread_tx, NULL, eNB_thread_tx, &eNB->proc );
|
||||||
pthread_create( &proc->pthread_rx, NULL, eNB_thread_rx, &eNB->proc[i] );
|
pthread_create( &proc->pthread_rx, NULL, eNB_thread_rx, &eNB->proc );
|
||||||
pthread_create( &proc->pthread_prach, NULL, eNB_thread_prach, &eNB->proc[i] );
|
pthread_create( &proc->pthread_prach, NULL, eNB_thread_prach, &eNB->proc );
|
||||||
#endif
|
#endif
|
||||||
char name[16];
|
char name[16];
|
||||||
snprintf( name, sizeof(name), "TX %d", i );
|
snprintf( name, sizeof(name), "TX %d", i );
|
||||||
pthread_setname_np( proc->pthread_tx, name );
|
pthread_setname_np( proc->pthread_tx, name );
|
||||||
snprintf( name, sizeof(name), "RX %d", i );
|
snprintf( name, sizeof(name), "RX %d", i );
|
||||||
pthread_setname_np( proc->pthread_rx, name );
|
pthread_setname_np( proc->pthread_rx, name );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* setup PHY proc TX sync mechanism */
|
/* setup PHY proc TX sync mechanism */
|
||||||
for (i=0; i<NUM_ENB_THREADS; i++) {
|
pthread_mutex_init(&sync_phy_proc.mutex_phy_proc_tx, NULL);
|
||||||
pthread_mutex_init(&sync_phy_proc[i].mutex_phy_proc_tx, NULL);
|
pthread_cond_init(&sync_phy_proc.cond_phy_proc_tx, NULL);
|
||||||
pthread_cond_init(&sync_phy_proc[i].cond_phy_proc_tx, NULL);
|
sync_phy_proc.phy_proc_CC_id = 0;
|
||||||
sync_phy_proc[i].phy_proc_CC_id = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Terminate eNB TX and RX threads.
|
* \brief Terminate eNB TX and RX threads.
|
||||||
*/
|
*/
|
||||||
@@ -1016,36 +1012,36 @@ void kill_eNB_proc(void)
|
|||||||
eNB_proc_t *proc;
|
eNB_proc_t *proc;
|
||||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||||
eNB=PHY_vars_eNB_g[0][CC_id];
|
eNB=PHY_vars_eNB_g[0][CC_id];
|
||||||
for (int i=0; i<NUM_ENB_THREADS; i++) {
|
|
||||||
proc = &eNB->proc[i];
|
proc = &eNB->proc;
|
||||||
|
|
||||||
#ifdef DEBUG_THREADS
|
#ifdef DEBUG_THREADS
|
||||||
printf( "Killing TX CC_id %d thread %d\n", CC_id, i );
|
printf( "Killing TX CC_id %d thread %d\n", CC_id, i );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
proc->instance_cnt_tx = 0; // FIXME data race!
|
proc->instance_cnt_tx = 0; // FIXME data race!
|
||||||
pthread_cond_signal( &proc->cond_tx );
|
pthread_cond_signal( &proc->cond_tx );
|
||||||
pthread_cond_broadcast(&sync_phy_proc[i].cond_phy_proc_tx);
|
pthread_cond_broadcast(&sync_phy_proc.cond_phy_proc_tx);
|
||||||
|
|
||||||
#ifdef DEBUG_THREADS
|
#ifdef DEBUG_THREADS
|
||||||
printf( "Joining eNB TX CC_id %d thread %d...\n", CC_id, i );
|
printf( "Joining eNB TX CC_id %d thread %d...\n", CC_id, i );
|
||||||
#endif
|
#endif
|
||||||
int result = pthread_join( proc->pthread_tx, (void**)&status );
|
int result = pthread_join( proc->pthread_tx, (void**)&status );
|
||||||
|
|
||||||
#ifdef DEBUG_THREADS
|
#ifdef DEBUG_THREADS
|
||||||
|
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
printf( "Error joining thread.\n" );
|
printf( "Error joining thread.\n" );
|
||||||
|
} else {
|
||||||
|
if (status) {
|
||||||
|
printf( "status %d\n", *status );
|
||||||
} else {
|
} else {
|
||||||
if (status) {
|
printf( "The thread was killed. No status available.\n" );
|
||||||
printf( "status %d\n", *status );
|
|
||||||
} else {
|
|
||||||
printf( "The thread was killed. No status available.\n" );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
UNUSED(result)
|
UNUSED(result)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_THREADS
|
#ifdef DEBUG_THREADS
|
||||||
@@ -1053,32 +1049,32 @@ void kill_eNB_proc(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_THREADS
|
#ifdef DEBUG_THREADS
|
||||||
printf( "Joining eNB RX CC_id %d thread %d...\n", CC_id, i );
|
printf( "Joining eNB RX CC_id %d thread %d...\n", CC_id, i );
|
||||||
#endif
|
#endif
|
||||||
result = pthread_join( proc->pthread_rx, (void**)&status );
|
result = pthread_join( proc->pthread_rx, (void**)&status );
|
||||||
|
|
||||||
#ifdef DEBUG_THREADS
|
#ifdef DEBUG_THREADS
|
||||||
|
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
printf( "Error joining thread.\n" );
|
printf( "Error joining thread.\n" );
|
||||||
|
} else {
|
||||||
|
if (status) {
|
||||||
|
printf( "status %d\n", *status );
|
||||||
} else {
|
} else {
|
||||||
if (status) {
|
printf( "The thread was killed. No status available.\n" );
|
||||||
printf( "status %d\n", *status );
|
|
||||||
} else {
|
|
||||||
printf( "The thread was killed. No status available.\n" );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
UNUSED(result)
|
UNUSED(result);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pthread_mutex_destroy( &proc->mutex_tx );
|
pthread_mutex_destroy( &proc->mutex_tx );
|
||||||
pthread_cond_destroy( &proc->cond_tx );
|
pthread_cond_destroy( &proc->cond_tx );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* this function maps the phy_vars_eNB tx and rx buffers to the available rf chains.
|
/* this function maps the phy_vars_eNB tx and rx buffers to the available rf chains.
|
||||||
Each rf chain is is addressed by the card number and the chain on the card. The
|
Each rf chain is is addressed by the card number and the chain on the card. The
|
||||||
rf_map specifies for each CC, on which rf chain the mapping should start. Multiple
|
rf_map specifies for each CC, on which rf chain the mapping should start. Multiple
|
||||||
@@ -1197,381 +1193,14 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief This is the main eNB thread.
|
|
||||||
* \param arg unused
|
|
||||||
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
static void* eNB_thread( void* arg )
|
|
||||||
{
|
|
||||||
UNUSED(arg);
|
|
||||||
static int eNB_thread_status;
|
|
||||||
|
|
||||||
unsigned char slot;
|
|
||||||
// the USRP implementation operates on subframes, not slots
|
|
||||||
// one subframe consists of one even and one odd slot
|
|
||||||
|
|
||||||
slot = 1;
|
|
||||||
int spp;
|
|
||||||
int tx_launched = 0;
|
|
||||||
int card=0;
|
|
||||||
|
|
||||||
void *rxp[2]; // FIXME hard coded array size; indexed by frame_parms.nb_antennas_rx
|
|
||||||
void *txp[2]; // FIXME hard coded array size; indexed by frame_parms.nb_antennas_tx
|
|
||||||
|
|
||||||
int hw_subframe = 0; // 0..NUM_ENB_THREADS-1 => 0..9
|
|
||||||
|
|
||||||
unsigned int rx_pos = 0;
|
|
||||||
unsigned int tx_pos = 0;
|
|
||||||
|
|
||||||
int CC_id=0;
|
|
||||||
struct timespec trx_time0, trx_time1, trx_time2;
|
|
||||||
|
|
||||||
//avoid gcc warnings
|
|
||||||
(void)trx_time0;
|
|
||||||
(void)trx_time1;
|
|
||||||
(void)trx_time2;
|
|
||||||
|
|
||||||
#ifdef LOWLATENCY
|
|
||||||
struct sched_attr attr;
|
|
||||||
unsigned int flags = 0;
|
|
||||||
|
|
||||||
attr.size = sizeof(attr);
|
|
||||||
attr.sched_flags = 0;
|
|
||||||
attr.sched_nice = 0;
|
|
||||||
attr.sched_priority = 0;
|
|
||||||
|
|
||||||
//This creates a .2 ms reservation
|
|
||||||
attr.sched_policy = SCHED_DEADLINE;
|
|
||||||
attr.sched_runtime = (0.3 * 100) * 10000;
|
|
||||||
attr.sched_deadline = (0.9 * 100) * 10000;
|
|
||||||
attr.sched_period = 1 * 1000000;
|
|
||||||
|
|
||||||
if (sched_setattr(0, &attr, flags) < 0 ) {
|
|
||||||
perror("[SCHED] main eNB thread: sched_setattr failed\n");
|
|
||||||
exit_fun("Nothing to add");
|
|
||||||
} else {
|
|
||||||
LOG_I(HW,"[SCHED][eNB] eNB main deadline thread %ld started on CPU %d\n",
|
|
||||||
gettid(),sched_getcpu());
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
int policy, s, j;
|
|
||||||
struct sched_param sparam;
|
|
||||||
char cpu_affinity[1024];
|
|
||||||
cpu_set_t cpuset;
|
|
||||||
|
|
||||||
//Set affinity mask to include CPUs 1 to MAX_CPUS
|
|
||||||
//CPU 0 is reserved for UHD threads
|
|
||||||
CPU_ZERO(&cpuset);
|
|
||||||
#ifdef CPU_AFFINITY
|
|
||||||
if (get_nprocs() >2)
|
|
||||||
{
|
|
||||||
for (j = 1; j < get_nprocs(); j++)
|
|
||||||
CPU_SET(j, &cpuset);
|
|
||||||
|
|
||||||
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
|
||||||
if (s != 0)
|
|
||||||
{
|
|
||||||
perror( "pthread_setaffinity_np");
|
|
||||||
exit_fun("Error setting processor affinity");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // CPU_AFFINITY
|
|
||||||
|
|
||||||
//Check the actual affinity mask assigned to the thread
|
|
||||||
|
|
||||||
s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
|
||||||
if (s != 0)
|
|
||||||
{
|
|
||||||
perror( "pthread_getaffinity_np");
|
|
||||||
exit_fun("Error getting processor affinity ");
|
|
||||||
}
|
|
||||||
memset(cpu_affinity, 0 , sizeof(cpu_affinity));
|
|
||||||
for (j = 0; j < CPU_SETSIZE; j++)
|
|
||||||
if (CPU_ISSET(j, &cpuset))
|
|
||||||
{
|
|
||||||
char temp[1024];
|
|
||||||
sprintf(temp, " CPU_%d ", j);
|
|
||||||
strcat(cpu_affinity, temp);
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&sparam, 0 , sizeof (sparam));
|
|
||||||
sparam.sched_priority = sched_get_priority_max(SCHED_FIFO);
|
|
||||||
policy = SCHED_FIFO ;
|
|
||||||
|
|
||||||
s = pthread_setschedparam(pthread_self(), policy, &sparam);
|
|
||||||
if (s != 0)
|
|
||||||
{
|
|
||||||
perror("pthread_setschedparam : ");
|
|
||||||
exit_fun("Error setting thread priority");
|
|
||||||
}
|
|
||||||
s = pthread_getschedparam(pthread_self(), &policy, &sparam);
|
|
||||||
if (s != 0)
|
|
||||||
{
|
|
||||||
perror("pthread_getschedparam : ");
|
|
||||||
exit_fun("Error getting thread priority");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LOG_I( HW, "[SCHED][eNB] Started eNB main thread on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(),
|
|
||||||
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
|
|
||||||
(policy == SCHED_RR) ? "SCHED_RR" :
|
|
||||||
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
|
|
||||||
"???",
|
|
||||||
(int) sparam.sched_priority, cpu_affinity);
|
|
||||||
|
|
||||||
|
|
||||||
#endif //LOWLATENCY
|
|
||||||
|
|
||||||
|
|
||||||
// stop early, if an exit is requested
|
|
||||||
// FIXME really neccessary?
|
|
||||||
if (oai_exit)
|
|
||||||
goto eNB_thread_cleanup;
|
|
||||||
|
|
||||||
printf("eNB_thread: mlockall in ...\n");
|
|
||||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
|
||||||
printf("eNB_thread: mlockall out ...\n");
|
|
||||||
|
|
||||||
timing_info.time_min = 100000000ULL;
|
|
||||||
timing_info.time_max = 0;
|
|
||||||
timing_info.time_avg = 0;
|
|
||||||
timing_info.n_samples = 0;
|
|
||||||
|
|
||||||
printf( "waiting for sync (eNB_thread)\n" );
|
|
||||||
pthread_mutex_lock( &sync_mutex );
|
|
||||||
|
|
||||||
while (sync_var<0)
|
|
||||||
pthread_cond_wait( &sync_cond, &sync_mutex );
|
|
||||||
|
|
||||||
pthread_mutex_unlock(&sync_mutex);
|
|
||||||
|
|
||||||
printf( "got sync (eNB_thread)\n" );
|
|
||||||
|
|
||||||
int frame = 0;
|
|
||||||
|
|
||||||
|
|
||||||
spp = openair0_cfg[0].samples_per_packet;
|
|
||||||
tx_pos = openair0_cfg[0].tx_scheduling_advance;
|
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
|
||||||
wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (!oai_exit) {
|
|
||||||
start_meas( &softmodem_stats_mt );
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_SUBFRAME, hw_subframe );
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_FRAME, frame );
|
|
||||||
tx_launched = 0;
|
|
||||||
|
|
||||||
while (rx_pos < ((1+hw_subframe)*PHY_vars_eNB_g[0][0]->frame_parms.samples_per_tti)) {
|
|
||||||
|
|
||||||
unsigned int rxs;
|
|
||||||
#ifndef USRP_DEBUG
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TXCNT, tx_pos );
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RXCNT, rx_pos );
|
|
||||||
|
|
||||||
clock_gettime( CLOCK_MONOTONIC, &trx_time0 );
|
|
||||||
|
|
||||||
start_meas( &softmodem_stats_hw );
|
|
||||||
|
|
||||||
openair0_timestamp timestamp;
|
|
||||||
int i=0;
|
|
||||||
// prepare rx buffer pointers
|
|
||||||
for (i=0; i<PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx; i++)
|
|
||||||
rxp[i] = (void*)&rxdata[i][rx_pos];
|
|
||||||
// check if nsymb_read == spp
|
|
||||||
// map antenna port i to the cc_id. Now use the 1:1 mapping
|
|
||||||
rxs = openair0.trx_read_func(&openair0,
|
|
||||||
×tamp,
|
|
||||||
rxp,
|
|
||||||
spp,
|
|
||||||
PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx);
|
|
||||||
|
|
||||||
stop_meas( &softmodem_stats_hw );
|
|
||||||
if (frame > 50) {
|
|
||||||
clock_gettime( CLOCK_MONOTONIC, &trx_time1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (frame > 20){
|
|
||||||
if (rxs != spp)
|
|
||||||
exit_fun( "problem receiving samples" );
|
|
||||||
}
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
|
|
||||||
|
|
||||||
// Transmit TX buffer based on timestamp from RX
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
|
|
||||||
// prepare tx buffer pointers
|
|
||||||
for (i=0; i<PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx; i++)
|
|
||||||
txp[i] = (void*)&txdata[i][tx_pos];
|
|
||||||
// if symb_written < spp ==> error
|
|
||||||
if (frame > 50) {
|
|
||||||
openair0.trx_write_func(&openair0,
|
|
||||||
(timestamp+(openair0_cfg[card].tx_scheduling_advance)-openair0_cfg[card].tx_sample_advance),
|
|
||||||
txp,
|
|
||||||
spp,
|
|
||||||
PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx,
|
|
||||||
1);
|
|
||||||
}
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, timestamp&0xffffffff );
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp+(openair0_cfg[card].tx_scheduling_advance)-openair0_cfg[card].tx_sample_advance)&0xffffffff );
|
|
||||||
|
|
||||||
stop_meas( &softmodem_stats_mt );
|
|
||||||
if (frame > 50) {
|
|
||||||
clock_gettime( CLOCK_MONOTONIC, &trx_time2 );
|
|
||||||
//update_difftimes(trx_time1, trx_time2);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE,0);
|
|
||||||
#else
|
|
||||||
// USRP_DEBUG is active
|
|
||||||
rt_sleep_ns(1000000);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( (frame>50) && (tx_launched == 0) &&
|
|
||||||
((openair0_cfg[card].txlaunch_wait == 0) ||
|
|
||||||
((openair0_cfg[card].txlaunch_wait == 1) &&
|
|
||||||
(rx_pos >= (((2*hw_subframe)+openair0_cfg[card].txlaunch_wait_slotcount)*PHY_vars_eNB_g[0][0]->frame_parms.samples_per_tti>>1))))) {
|
|
||||||
|
|
||||||
tx_launched = 1;
|
|
||||||
|
|
||||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
|
||||||
if (pthread_mutex_lock(&PHY_vars_eNB_g[0][CC_id]->proc[hw_subframe].mutex_tx) != 0) {
|
|
||||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX thread %d (IC %d)\n", hw_subframe, PHY_vars_eNB_g[0][CC_id]->proc[hw_subframe].instance_cnt_tx );
|
|
||||||
exit_fun( "error locking mutex_tx" );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cnt_tx = ++PHY_vars_eNB_g[0][CC_id]->proc[hw_subframe].instance_cnt_tx;
|
|
||||||
|
|
||||||
pthread_mutex_unlock( &PHY_vars_eNB_g[0][CC_id]->proc[hw_subframe].mutex_tx );
|
|
||||||
|
|
||||||
if (cnt_tx == 0) {
|
|
||||||
// the thread was presumably waiting where it should and can now be woken up
|
|
||||||
if (pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[hw_subframe].cond_tx) != 0) {
|
|
||||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TX thread %d\n", hw_subframe );
|
|
||||||
exit_fun( "ERROR pthread_cond_signal" );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LOG_W( PHY,"[eNB] Frame %d, eNB TX thread %d busy!! (rx_cnt %u, cnt_tx %i)\n", PHY_vars_eNB_g[0][CC_id]->proc[hw_subframe].frame_tx, hw_subframe, rx_pos, cnt_tx );
|
|
||||||
exit_fun( "TX thread busy" );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rx_pos += spp;
|
|
||||||
tx_pos += spp;
|
|
||||||
|
|
||||||
if (tx_pos >= openair0_cfg[card].samples_per_frame)
|
|
||||||
tx_pos -= openair0_cfg[card].samples_per_frame;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rx_pos >= openair0_cfg[card].samples_per_frame)
|
|
||||||
rx_pos -= openair0_cfg[card].samples_per_frame;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (oai_exit) break;
|
|
||||||
|
|
||||||
timing_info.time_last = timing_info.time_now;
|
|
||||||
timing_info.time_now = rt_get_time_ns();
|
|
||||||
|
|
||||||
if (timing_info.n_samples>0) {
|
|
||||||
RTIME time_diff = timing_info.time_now - timing_info.time_last;
|
|
||||||
|
|
||||||
if (time_diff < timing_info.time_min)
|
|
||||||
timing_info.time_min = time_diff;
|
|
||||||
|
|
||||||
if (time_diff > timing_info.time_max)
|
|
||||||
timing_info.time_max = time_diff;
|
|
||||||
|
|
||||||
timing_info.time_avg += time_diff;
|
|
||||||
}
|
|
||||||
|
|
||||||
timing_info.n_samples++;
|
|
||||||
|
|
||||||
if ((slot&1) == 1) {
|
|
||||||
// odd slot
|
|
||||||
int sf = hw_subframe;
|
|
||||||
if (frame>50) {
|
|
||||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
|
||||||
if (pthread_mutex_lock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_rx) != 0) {
|
|
||||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RX thread %d (IC %d)\n", sf, PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx );
|
|
||||||
exit_fun( "error locking mutex_rx" );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cnt_rx = ++PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx;
|
|
||||||
|
|
||||||
pthread_mutex_unlock( &PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_rx );
|
|
||||||
|
|
||||||
if (cnt_rx == 0) {
|
|
||||||
// the thread was presumably waiting where it should and can now be woken up
|
|
||||||
if (pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[sf].cond_rx) != 0) {
|
|
||||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RX thread %d\n", sf );
|
|
||||||
exit_fun( "ERROR pthread_cond_signal" );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LOG_W( PHY, "[eNB] Frame %d, eNB RX thread %d busy!! instance_cnt %d CC_id %d\n", PHY_vars_eNB_g[0][CC_id]->proc[sf].frame_rx, sf, PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx, CC_id );
|
|
||||||
exit_fun( "RX thread busy" );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
hw_subframe++;
|
|
||||||
slot += 2;
|
|
||||||
|
|
||||||
if (hw_subframe == NUM_ENB_THREADS) {
|
|
||||||
// the radio frame is complete, start over
|
|
||||||
hw_subframe = 0;
|
|
||||||
frame++;
|
|
||||||
slot = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
|
||||||
itti_update_lte_time( frame, slot );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
eNB_thread_cleanup:
|
|
||||||
#ifdef DEBUG_THREADS
|
|
||||||
printf( "eNB_thread: finished, ran %d times.\n", frame );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEBUG_THREADS
|
|
||||||
printf( "Exiting eNB_thread ..." );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
eNB_thread_status = 0;
|
|
||||||
|
|
||||||
// print_difftimes();
|
|
||||||
|
|
||||||
return &eNB_thread_status;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void reset_opp_meas(void) {
|
void reset_opp_meas(void) {
|
||||||
int sfn;
|
int sfn;
|
||||||
reset_meas(&softmodem_stats_mt);
|
reset_meas(&softmodem_stats_mt);
|
||||||
reset_meas(&softmodem_stats_hw);
|
reset_meas(&softmodem_stats_hw);
|
||||||
|
|
||||||
for (sfn=0; sfn < 10; sfn++) {
|
for (sfn=0; sfn < 10; sfn++) {
|
||||||
reset_meas(&softmodem_stats_tx_sf[sfn]);
|
reset_meas(&softmodem_stats_tx_sf);
|
||||||
reset_meas(&softmodem_stats_rx_sf[sfn]);
|
reset_meas(&softmodem_stats_rx_sf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1582,8 +1211,8 @@ void print_opp_meas(void) {
|
|||||||
print_meas(&softmodem_stats_hw, "HW Acquisation", NULL, NULL);
|
print_meas(&softmodem_stats_hw, "HW Acquisation", NULL, NULL);
|
||||||
|
|
||||||
for (sfn=0; sfn < 10; sfn++) {
|
for (sfn=0; sfn < 10; sfn++) {
|
||||||
print_meas(&softmodem_stats_tx_sf[sfn],"[eNB][total_phy_proc_tx]",NULL, NULL);
|
print_meas(&softmodem_stats_tx_sf,"[eNB][total_phy_proc_tx]",NULL, NULL);
|
||||||
print_meas(&softmodem_stats_rx_sf[sfn],"[eNB][total_phy_proc_rx]",NULL,NULL);
|
print_meas(&softmodem_stats_rx_sf,"[eNB][total_phy_proc_rx]",NULL,NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user