Commit e198a742 authored by Raymond Knopp's avatar Raymond Knopp

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

parent 2b6c7a52
......@@ -31,7 +31,7 @@
#include "PHY/defs.h"
#ifdef OPENAIR_LTE
#include "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
......@@ -41,18 +41,6 @@
#ifdef Rel10
#include "SCellToAddMod-r10.h"
#endif
#else
/**
\fn int phy_init(unsigned char nb_antennas_tx)
\brief Allocate and Initialize the PHY variables after receiving static configuration
@param nb_antennas_tx Number of TX antennas
*/
int phy_init(unsigned char nb_antennas_tx);
#endif
#ifdef OPENAIR_LTE
/** @addtogroup _PHY_STRUCTURES_
* @{
*/
......@@ -325,17 +313,28 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
int CC_id);
#endif
#endif
/*! !\fn void phy_cleanup(void)
\brief Cleanup the PHY variables*/
void phy_cleanup(void);
#ifdef OPENAIR_LTE
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
#endif
void lte_param_init(unsigned char N_tx,
unsigned char N_rx,
unsigned char transmission_mode,
uint8_t extended_prefix_flag,
frame_t frame_type,
uint16_t Nid_cell,
uint8_t tdd_config,
uint8_t N_RB_DL,
uint8_t threequarter_fs,
uint8_t osf,
uint32_t perfect_ce);
/** @} */
#endif
......
......@@ -121,7 +121,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
//int32_t rx_total_gain_eNB_dB = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
int i;
LOG_D(PHY,"[eNB%d] CCid %d Frame %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc[0].frame_tx);
LOG_D(PHY,"[eNB%d] CCid %d Frame %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc.frame_tx);
frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
LOG_D(PHY,"prach_config_common.rootSequenceIndex = %d\n",frame_parms->prach_config_common.rootSequenceIndex );
......@@ -388,7 +388,7 @@ void phy_config_sib13_eNB(uint8_t Mod_id,int CC_id,int mbsfn_Area_idx,
LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
LOG_I(PHY,"[eNB%d] Frame %d: Applying MBSFN_Area_id %d for index %d\n",Mod_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc[0].frame_tx,mbsfn_AreaId_r9,mbsfn_Area_idx);
LOG_I(PHY,"[eNB%d] Frame %d: Applying MBSFN_Area_id %d for index %d\n",Mod_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc.frame_tx,mbsfn_AreaId_r9,mbsfn_Area_idx);
if (mbsfn_Area_idx == 0) {
frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
......@@ -409,7 +409,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
physicalConfigDedicated = eNB->physicalConfigDedicated[UE_id];
if (physicalConfigDedicated != NULL) {
LOG_I(PHY,"[eNB %d] Frame %d: Sent physicalConfigDedicated=%p for UE %d\n",eNB->Mod_id, eNB->proc[0].frame_tx,physicalConfigDedicated,UE_id);
LOG_I(PHY,"[eNB %d] Frame %d: Sent physicalConfigDedicated=%p for UE %d\n",eNB->Mod_id, eNB->proc.frame_tx,physicalConfigDedicated,UE_id);
LOG_D(PHY,"------------------------------------------------------------------------\n");
if (physicalConfigDedicated->pdsch_ConfigDedicated) {
......@@ -644,7 +644,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
int8_t UE_id = find_ue(rnti,eNB);
if (UE_id == -1) {
LOG_E( PHY, "[eNB %"PRIu8"] Frame %d: find_ue() returns -1\n", Mod_id, eNB->proc[0].frame_tx );
LOG_E( PHY, "[eNB %"PRIu8"] Frame %d: find_ue() returns -1\n", Mod_id, eNB->proc.frame_tx );
return;
}
......@@ -653,7 +653,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
eNB->physicalConfigDedicated[UE_id] = physicalConfigDedicated;
LOG_I(PHY,"phy_config_dedicated_eNB: physicalConfigDedicated=%p\n",physicalConfigDedicated);
} else {
LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, eNB->proc[0].frame_tx,UE_id);
LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, eNB->proc.frame_tx,UE_id);
return;
}
......
......@@ -9,8 +9,8 @@
#include "PHY/defs.h"
#include "PHY/extern.h"
extern PHY_VARS_eNB *PHY_vars_eNB;
extern PHY_VARS_UE *PHY_vars_UE;
extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE;
void lte_param_init(unsigned char N_tx,
unsigned char N_rx,
......@@ -30,8 +30,8 @@ void lte_param_init(unsigned char N_tx,
printf("Start lte_param_init\n");
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
eNB = malloc(sizeof(PHY_VARS_eNB));
UE = malloc(sizeof(PHY_VARS_UE));
//PHY_config = malloc(sizeof(PHY_CONFIG));
mac_xface = malloc(sizeof(MAC_xface));
......@@ -39,7 +39,7 @@ void lte_param_init(unsigned char N_tx,
randominit(0);
set_taus_seed(0);
frame_parms = &(PHY_vars_eNB->frame_parms);
frame_parms = &(eNB->frame_parms);
frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
frame_parms->N_RB_UL = N_RB_DL;
......@@ -66,40 +66,40 @@ void lte_param_init(unsigned char N_tx,
// phy_init_top(frame_parms); //allocation
PHY_vars_UE->is_secondary_ue = 0;
PHY_vars_UE->frame_parms = *frame_parms;
PHY_vars_eNB->frame_parms = *frame_parms;
UE->is_secondary_ue = 0;
UE->frame_parms = *frame_parms;
eNB->frame_parms = *frame_parms;
phy_init_lte_top(frame_parms);
dump_frame_parms(frame_parms);
PHY_vars_UE->measurements.n_adj_cells=0;
PHY_vars_UE->measurements.adj_cell_id[0] = Nid_cell+1;
PHY_vars_UE->measurements.adj_cell_id[1] = Nid_cell+2;
UE->measurements.n_adj_cells=0;
UE->measurements.adj_cell_id[0] = Nid_cell+1;
UE->measurements.adj_cell_id[1] = Nid_cell+2;
for (i=0; i<3; i++)
lte_gold(frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
lte_gold(frame_parms,UE->lte_gold_table[i],Nid_cell+i);
phy_init_lte_ue(PHY_vars_UE,1,0);
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
phy_init_lte_ue(UE,1,0);
phy_init_lte_eNB(eNB,0,0,0);
generate_pcfich_reg_mapping(&PHY_vars_UE->frame_parms);
generate_phich_reg_mapping(&PHY_vars_UE->frame_parms);
generate_pcfich_reg_mapping(&UE->frame_parms);
generate_phich_reg_mapping(&UE->frame_parms);
// DL power control init
if (transmission_mode == 1) {
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_eNB->frame_parms).pdsch_config_common).p_b = 0;
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_UE->frame_parms).pdsch_config_common).p_b = 0;
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((eNB->frame_parms).pdsch_config_common).p_b = 0;
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((UE->frame_parms).pdsch_config_common).p_b = 0;
} else { // rho_a = rhob
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_eNB->frame_parms).pdsch_config_common).p_b = 1;
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_UE->frame_parms).pdsch_config_common).p_b = 1;
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((eNB->frame_parms).pdsch_config_common).p_b = 1;
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((UE->frame_parms).pdsch_config_common).p_b = 1;
}
PHY_vars_UE->perfect_ce = perfect_ce;
UE->perfect_ce = perfect_ce;
printf("Done lte_param_init\n");
......
......@@ -219,7 +219,6 @@ void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue,
int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
module_id_t eNB_id,
module_id_t UE_id,
uint8_t subframe,
uint8_t l,
uint8_t Ns,
uint8_t cooperation_flag);
......@@ -242,7 +241,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
unsigned char number_of_cards,
short coef);
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id,uint8_t subframe);
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id);
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
int subframe,
......
......@@ -195,7 +195,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
}
int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id,uint8_t thread_id)
int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id)
{
static int first_run=1;
static int max_pos_fil2=0;
......@@ -236,7 +236,7 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id,uint8_t thread_
max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15;
#ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc[thread_id].frame_rx,max_pos,max_pos_fil2,sync_pos);
LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc.frame_rx,max_pos,max_pos_fil2,sync_pos);
#endif //DEBUG_PHY
return(max_pos_fil2-sync_pos);
......
......@@ -55,7 +55,6 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
uint8_t eNB_id,
uint8_t UE_id,
uint8_t thread_id,
unsigned char l,
unsigned char Ns,
uint8_t cooperation_flag)
......@@ -68,8 +67,8 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
int32_t **ul_ch_estimates_0= pusch_vars->drs_ch_estimates_0[eNB_id];
int32_t **ul_ch_estimates_1= pusch_vars->drs_ch_estimates_1[eNB_id];
int32_t **rxdataF_ext= pusch_vars->rxdataF_ext[eNB_id];
int subframe = eNB->proc[thread_id].subframe_rx;
uint8_t harq_pid = subframe2harq_pid(frame_parms,eNB->proc[thread_id].frame_rx,subframe);
int subframe = eNB->proc.subframe_rx;
uint8_t harq_pid = subframe2harq_pid(frame_parms,eNB->proc.frame_rx,subframe);
int16_t delta_phase = 0;
int16_t *ru1 = ru_90;
int16_t *ru2 = ru_90;
......
......@@ -2,7 +2,7 @@
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
OpenAirInterface is free software: you can redistrirbute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
......@@ -7077,12 +7077,11 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
}
int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
void *dci_pdu,
uint16_t rnti,
uint8_t thread_id,
DCI_format_t dci_format,
uint8_t UE_id,
PHY_VARS_eNB *eNB,
uint16_t si_rnti,
uint16_t ra_rnti,
uint16_t p_rnti,
......@@ -7096,7 +7095,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
ANFBmode_t AckNackFBMode = eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode;
LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id];
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
int subframe = eNB->proc[thread_id].subframe_tx;
int subframe = eNB->proc.subframe_tx;
uint32_t cqi_req = 0;
uint32_t dai = 0;
......@@ -7117,11 +7116,10 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
harq_pid = subframe2harq_pid(frame_parms,
pdcch_alloc2ul_frame(frame_parms,
eNB->proc[thread_id].frame_tx,
eNB->proc.frame_tx,
subframe),
pdcch_alloc2ul_subframe(frame_parms,subframe));
// printf("eNB: thread_id %d, subframe %d, frame_tx %d\n",thread_id,subframe,eNB->proc[thread_id].frame_tx);
switch (frame_parms->N_RB_DL) {
case 6:
......@@ -7639,7 +7637,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, subframe %d : Programming PUSCH with n_DMRS2 %d (cshift %d)\n",
eNB->Mod_id,harq_pid,eNB->proc[thread_id].frame_tx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift);
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift);
......
......@@ -1416,7 +1416,6 @@ void rx_phich(PHY_VARS_UE *ue,
}
void generate_phich_top(PHY_VARS_eNB *eNB,
unsigned char thread_id,
int16_t amp,
uint8_t sect_id,
uint8_t abstraction_flag)
......@@ -1432,7 +1431,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
uint8_t pusch_subframe;
uint8_t UE_id;
uint32_t pusch_frame;
int subframe = eNB->proc[thread_id].subframe_tx;
int subframe = eNB->proc.subframe_tx;
// compute Ngroup_PHICH (see formula at beginning of Section 6.9 in 36-211
......@@ -1444,7 +1443,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
if (frame_parms->Ncp == 1)
NSF_PHICH = 2;
pusch_frame = phich_frame2_pusch_frame(frame_parms,eNB->proc[thread_id].frame_tx,subframe);
pusch_frame = phich_frame2_pusch_frame(frame_parms,eNB->proc.frame_tx,subframe);
pusch_subframe = phich_subframe2_pusch_subframe(frame_parms,subframe);
harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe);
......@@ -1453,7 +1452,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
if (ulsch[UE_id]->harq_processes[harq_pid]->phich_active == 1) {
LOG_D(PHY,"[eNB][PUSCH %d/%x] Frame %d subframe %d (pusch_subframe %d,pusch_frame %d) phich active %d\n",
harq_pid,ulsch[UE_id]->rnti,eNB->proc[thread_id].frame_tx,subframe,pusch_subframe,pusch_frame,ulsch[UE_id]->harq_processes[harq_pid]->phich_active);
harq_pid,ulsch[UE_id]->rnti,eNB->proc.frame_tx,subframe,pusch_subframe,pusch_frame,ulsch[UE_id]->harq_processes[harq_pid]->phich_active);
ngroup_PHICH = (ulsch[UE_id]->harq_processes[harq_pid]->first_rb +
ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%Ngroup_PHICH;
......@@ -1467,7 +1466,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
nseq_PHICH = ((ulsch[UE_id]->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) +
ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH);
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n",
eNB->Mod_id,harq_pid,eNB->proc[thread_id].frame_tx,
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,
subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,
ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK,
ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
......@@ -1475,7 +1474,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
if (ulsch[UE_id]->Msg3_active == 1) {
LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n",
eNB->Mod_id,harq_pid,eNB->proc[thread_id].frame_tx,subframe,
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe,
UE_id,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK,
ulsch[UE_id]->harq_processes[harq_pid]->first_rb);
}
......@@ -1505,7 +1504,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
(ulsch[UE_id]->harq_processes[harq_pid]->rar_alloc == 0) ) {
if (ulsch[UE_id]->harq_processes[harq_pid]->phich_ACK==0 ) {
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d : PHICH NACK / (no format0 DCI) Setting subframe_scheduling_flag\n",
eNB->Mod_id,harq_pid,eNB->proc[thread_id].frame_tx,subframe);
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe);
ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
ulsch[UE_id]->harq_processes[harq_pid]->rvidx = rv_table[ulsch[UE_id]->harq_processes[harq_pid]->round&3];
ulsch[UE_id]->harq_processes[harq_pid]->O_RI = 0;
......@@ -1515,7 +1514,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
} else {
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d PHICH ACK (no format0 DCI) Clearing subframe_scheduling_flag, setting round to 0\n",
eNB->Mod_id,harq_pid,eNB->proc[thread_id].frame_tx,subframe);
eNB->Mod_id,harq_pid,eNB->proc.frame_tx,subframe);
ulsch[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
ulsch[UE_id]->harq_processes[harq_pid]->round=0;
}
......
......@@ -43,13 +43,13 @@
int generate_mbsfn_pilot(PHY_VARS_eNB *eNB,
int32_t **txdataF,
int16_t amp,
uint16_t subframe)
int16_t amp)
{
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
uint32_t subframe_offset,Nsymb,samples_per_symbol;
int subframe = eNB->proc.subframe_tx;
if (subframe<0 || subframe>= 10) {
......
......@@ -286,11 +286,11 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *ue,int mcs,int ndi,int rvidx,int eNB_id)
}
}
void generate_mch(PHY_VARS_eNB *eNB,int thread_id,uint8_t *a,int abstraction_flag)
void generate_mch(PHY_VARS_eNB *eNB,uint8_t *a,int abstraction_flag)
{
int G;
int subframe = eNB->proc[thread_id].subframe_tx;
int subframe = eNB->proc.subframe_tx;
if (abstraction_flag != 0) {
if (eNB_transport_info_TB_index[eNB->Mod_id][eNB->CC_id]!=0)
......@@ -312,18 +312,18 @@ void generate_mch(PHY_VARS_eNB *eNB,int thread_id,uint8_t *a,int abstraction_fla
eNB->frame_parms.N_RB_DL,
eNB->dlsch_MCH->harq_processes[0]->rb_alloc,
get_Qm(eNB->dlsch_MCH->harq_processes[0]->mcs),1,
2,eNB->proc[thread_id].frame_tx,subframe);
2,eNB->proc.frame_tx,subframe);
generate_mbsfn_pilot(eNB,
eNB->common_vars.txdataF[0],
AMP,
subframe);
AMP);
if (dlsch_encoding(a,
&eNB->frame_parms,
1,
eNB->dlsch_MCH,
eNB->proc[thread_id].frame_tx,
eNB->proc.frame_tx,
subframe,
&eNB->dlsch_rate_matching_stats,
&eNB->dlsch_turbo_encoding_stats,
......
......@@ -1056,7 +1056,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
//__m128i mmtmpX0,mmtmpX1,mmtmpX2,mmtmpX3;
void rx_prach(PHY_VARS_eNB *eNB,
uint8_t subframe,
uint16_t *preamble_energy_list,
uint16_t *preamble_delay_list,
uint16_t Nf,
......@@ -1065,7 +1064,7 @@ void rx_prach(PHY_VARS_eNB *eNB,
int i;
lte_frame_type_t frame_type = eNB->frame_parms.frame_type;
int subframe = eNB->proc.subframe_rx;
uint16_t rootSequenceIndex = eNB->frame_parms.prach_config_common.rootSequenceIndex;
uint8_t prach_ConfigIndex = eNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
uint8_t Ncs_config = eNB->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
......
......@@ -583,7 +583,7 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
for (eNB_id=0; eNB_id<number_of_cards_l; eNB_id++) {
len += sprintf(&buffer[len],"eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n",
eNB_id,number_of_cards_l,
eNB->proc[0].frame_tx,
eNB->proc.frame_tx,
eNB->rx_total_gain_dB,
eNB->measurements[eNB_id].n0_power_tot_dBm,
eNB->measurements[eNB_id].n0_power_dB[0],
......@@ -621,9 +621,9 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length)
len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),eNB->proc[0].frame_tx+1);
len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),eNB->proc.frame_tx+1);
len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000));
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,eNB->proc[0].frame_tx+1);
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,eNB->proc.frame_tx+1);
//len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions);
//len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions);
//len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,eNB->check_for_total_transmissions);
......
......@@ -228,12 +228,11 @@ int mch_modulation(int32_t **txdataF,
/** \brief Top-level generation function for eNB TX of MBSFN
@param phy_vars_eNB Pointer to eNB variables
@param subframe Subframe for PMCH
@param a Pointer to transport block
@param abstraction_flag
*/
void generate_mch(PHY_VARS_eNB *phy_vars_eNB,int subframe,uint8_t *a,int abstraction_flag);
void generate_mch(PHY_VARS_eNB *phy_vars_eNB,uint8_t *a,int abstraction_flag);
/** \brief This function generates the frequency-domain pilots (cell-specific downlink reference signals)
@param phy_vars_eNB Pointer to eNB variables
......@@ -301,8 +300,7 @@ int32_t generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB,
int32_t generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB,
int32_t **txdataF,
int16_t amp,
uint16_t subframe);
int16_t amp);
int32_t generate_pss(int32_t **txdataF,
int16_t amp,
......@@ -1409,27 +1407,26 @@ int32_t generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
uint8_t eNB_id);
double sinr_eff_cqi_calc(PHY_VARS_UE *phy_vars_ue,
uint8_t eNB_id);
int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB,
void *dci_pdu,
rnti_t rnti,
uint8_t subframe,
DCI_format_t dci_format,
DCI_format_t dci_format,
uint8_t UE_id,
PHY_VARS_eNB *PHY_vars_eNB,
uint16_t si_rnti,
uint16_t si_rnti,
uint16_t ra_rnti,
uint16_t p_rnti,
uint16_t cba_rnti,
uint8_t use_srs);
#ifdef USER_MODE
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNb,uint8_t subframe, uint8_t UE_id);
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNb,uint8_t UE_id);
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round);
#endif
int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci);
......@@ -1477,14 +1474,12 @@ void generate_RIV_tables(void);
int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode);
void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
uint32_t subframe,
uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id,
LTE_eNB_ULSCH_t **ulsch,
uint8_t cooperation_flag);
void rx_ulsch_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t subframe,
uint8_t sect_id,
uint8_t UE_index);
......@@ -1532,18 +1527,15 @@ int32_t ulsch_encoding_emul(uint8_t *ulsch_buffer,
*/
unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
uint8_t UE_id,
uint8_t subframe,
uint8_t control_only_flag,
uint8_t Nbundled,
uint8_t llr8_flag);
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t subframe,
uint8_t UE_index,
uint16_t *crnti);
void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
uint8_t subframe,
int16_t amp,
uint8_t sect_id,
uint8_t abstraction_flag);
......@@ -1671,11 +1663,11 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
uint8_t pucch1_thres);
int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t UE_index,
PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel,
uint8_t *payload,
uint8_t subframe);
uint8_t UE_index,
PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel,
uint8_t *payload);
/*!
......@@ -1702,7 +1694,6 @@ int32_t generate_prach(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,
/*!
\brief Process PRACH waveform
@param phy_vars_eNB Pointer to eNB top-level descriptor
@param subframe subframe index to operate on
@param preamble_energy_list List of energies for each candidate preamble
@param preamble_delay_list List of delays for each candidate preamble
@param Nf System frame number
......@@ -1710,7 +1701,7 @@ int32_t generate_prach(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,
@returns 0 on success
*/
void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_energy_list, uint16_t *preamble_delay_list, uint16_t Nf, uint8_t tdd_mapindex);
void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint16_t *preamble_energy_list, uint16_t *preamble_delay_list, uint16_t Nf, uint8_t tdd_mapindex);
/*!
\brief Helper for MAC, returns number of available PRACH in TDD for a particular configuration index
......
......@@ -1067,12 +1067,12 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *eNB,
uint8_t UE_index,
PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel,
uint8_t *payload,
uint8_t thread_id)
uint8_t *payload)
{
uint8_t UE_id;
uint16_t rnti;
int subframe = eNB->proc[thread_id].subframe_rx;
int subframe = eNB->proc.subframe_rx;
uint8_t CC_id = eNB->CC_id;
rnti = eNB->ulsch[UE_index]->rnti;
......@@ -1095,7 +1095,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *eNB,
payload[0] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[0];
payload[1] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[1];
} else
LOG_E(PHY,"[eNB] Frame %d: Can't handle formats 2/2a/2b\n",eNB->proc[thread_id].frame_rx);
LOG_E(PHY,"[eNB] Frame %d: Can't handle formats 2/2a/2b\n",eNB->proc.frame_rx);
if (PHY_vars_UE_g[UE_id][CC_id]->pucch_sel[subframe] == n1_pucch_sel)
return(99);
......
......@@ -70,35 +70,35 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch)
if (ulsch) {
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch %p\n",ulsch);
printf("Freeing ulsch %p\n",ulsch);
#endif
for (i=0; i<8; i++) {
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch process %d\n",i);
printf("Freeing ulsch process %d\n",i);
#endif
if (ulsch->harq_processes[i]) {
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch process %d (%p)\n",i,ulsch->harq_processes[i]);
printf("Freeing ulsch process %d (%p)\n",i,ulsch->harq_processes[i]);
#endif
if (ulsch->harq_processes[i]->b) {
free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES);
ulsch->harq_processes[i]->b = NULL;
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch process %d b (%p)\n",i,ulsch->harq_processes[i]->b);
printf("Freeing ulsch process %d b (%p)\n",i,ulsch->harq_processes[i]->b);
#endif
}
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch process %d c (%p)\n",i,ulsch->harq_processes[i]->c);
printf("Freeing ulsch process %d c (%p)\n",i,ulsch->harq_processes[i]->c);
#endif
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
#ifdef DEBUG_ULSCH_FREE
msg("Freeing ulsch process %d c[%d] (%p)\n",i,r,ulsch->harq_processes[i]->c[r]);
printf("Freeing ulsch process %d c[%d] (%p)\n",i,r,ulsch->harq_processes[i]->c[r]);
#endif
if (ulsch->harq_processes[i]->c[r]) {
......@@ -302,7 +302,7 @@ uint32_t ulsch_encoding(uint8_t *a,
ulsch->harq_processes[harq_pid]->control_only = 0;
#ifdef DEBUG_ULSCH_CODING
msg("[PHY][UE] ULSCH coding : A %d, Qm %d, mcs %d, harq_pid %d, round %d, RV %d\n",
printf("[PHY][UE] ULSCH coding : A %d, Qm %d, mcs %d, harq_pid %d, round %d, RV %d\n",
ulsch->harq_processes[harq_pid]->TBS,
Q_m,
ulsch->harq_processes[harq_pid]->mcs,
......@@ -311,16 +311,16 @@ uint32_t ulsch_encoding(uint8_t *a,
ulsch->harq_processes[harq_pid]->rvidx);
for (i=0; i<ulsch->harq_processes[harq_pid]->O_ACK; i++)
msg("ulsch_coding: o_ACK[%d] %d\n",i,ulsch->o_ACK[i]);
printf("ulsch_coding: o_ACK[%d] %d\n",i,ulsch->o_ACK[i]);
for (i=0; i<ulsch->O_RI; i++)
msg("ulsch_coding: o_RI[%d] %d\n",i,ulsch->o_RI[i]);
printf("ulsch_coding: o_RI[%d] %d\n",i,ulsch->o_RI[i]);
msg("ulsch_coding: O=%d\n",ulsch->O);
printf("ulsch_coding: O=%d\n",ulsch->O);
for (i=0; i<1+((8+ulsch->O)/8); i++) {
// ulsch->o[i] = i;
msg("ulsch_coding: O[%d] %d\n",i,ulsch->o[i]);
printf("ulsch_coding: O[%d] %d\n",i,ulsch->o[i]);
}
if ((tmode != 4))
......@@ -380,20 +380,20 @@ uint32_t ulsch_encoding(uint8_t *a,
#ifdef DEBUG_ULSCH_CODING
msg("Generating Code Segment %d (%d bits)\n",r,Kr);
printf("Generating Code Segment %d (%d bits)\n",r,Kr);
// generate codewords
msg("bits_per_codeword (Kr)= %d\n",Kr);
msg("N_RB = %d\n",ulsch->harq_processes[harq_pid]->nb_rb);
msg("Ncp %d\n",frame_parms->Ncp);
msg("Qm %d\n",Q_m);
printf("bits_per_codeword (Kr)= %d\n",Kr);
printf("N_RB = %d\n",ulsch->harq_processes[harq_pid]->nb_rb);
printf("Ncp %d\n",frame_parms->Ncp);
printf("Qm %d\n",Q_m);
#endif
// offset=0;
#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
start_meas(te_stats);
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++) {
#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,
G,
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)
wACK_idx = (ulsch->bundling==0) ? 4 : ((Nbundled-1)&3);
#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);
#endif
......@@ -865,7 +865,7 @@ uint32_t ulsch_encoding(uint8_t *a,
for (q=0; q<Q_m; q++) {
y[q+(Q_m*((r*Cmux) + columnset[j]))] = ulsch->q_ACK[(q+(Q_m*i))%len_ACK];
#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],
i,r*Cmux,columnset[j]);
#endif
......@@ -965,7 +965,7 @@ int ulsch_encoding_emul(uint8_t *ulsch_buffer,
// print_CQI(ulsch->o,ulsch->uci_format,eNB_id);
// 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)
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].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 ;
// 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].cntl.pusch_uci = *(uint32_t *)ulsch->o;
memcpy(UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_uci,
ulsch->o,
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.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_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);
}
......
......@@ -220,7 +220,6 @@ uint8_t extract_cqi_crc(uint8_t *cqi,uint8_t CQI_LENGTH)
unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
uint8_t UE_id,
uint8_t thread_id,
uint8_t control_only_flag,
uint8_t Nbundled,
uint8_t llr8_flag)
......@@ -260,7 +259,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
int16_t cseq[6*14*1200];
int off;
int status[20];
int subframe = eNB->proc[thread_id].subframe_rx;
int subframe = eNB->proc.subframe_rx;
LTE_UL_eNB_HARQ_t *ulsch_harq;
uint8_t (*tc)(int16_t *y,
......@@ -279,7 +278,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
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);
......@@ -1501,18 +1500,17 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
#endif
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB,
uint8_t thread_id,
uint8_t UE_index,
uint16_t *crnti)
{
uint8_t UE_id;
uint16_t rnti;
int subframe = eNB->proc[thread_id].subframe_rx;
int subframe = eNB->proc.subframe_rx;
uint8_t harq_pid;
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;
#ifdef DEBUG_PHY
......
......@@ -1577,7 +1577,6 @@ int32_t avgU[2];
int32_t avgU_0[2],avgU_1[2]; // For the Distributed Alamouti Scheme
void rx_ulsch(PHY_VARS_eNB *eNB,
uint32_t thread_id,
uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id,
LTE_eNB_ULSCH_t **ulsch,
......@@ -1603,9 +1602,9 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
uint8_t Qm;
uint16_t rx_power_correction;
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);
#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,
......@@ -1640,7 +1639,6 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
lte_ul_channel_estimation(eNB,
eNB_id,
UE_id,
thread_id,
l%(frame_parms->symbols_per_tti/2),
l/(frame_parms->symbols_per_tti/2),
cooperation_flag);
......@@ -1887,25 +1885,24 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
}
void rx_ulsch_emul(PHY_VARS_eNB *eNB,
uint8_t subframe,
uint8_t sect_id,
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[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;
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,
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 "UTIL/LOG/vcd_signal_dumper.h"
//#define OFDMA_ULSCH
//#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__)
int16x8_t norm128;
#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;
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;
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) {
dft_in0[ip] = d0[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+2] = d10[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+2] = d10[i];
}
// msg("\n");
// printf("\n");
switch (Msc_PUSCH) {
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;
z11 = z10+Msc_PUSCH;
// msg("symbol0 (dft)\n");
// printf("symbol0 (dft)\n");
for (i=0,ip=0; i<Msc_PUSCH; i++,ip+=4) {
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];
z2[i] = dft_out0[ip+2];
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];
z10[i] = dft_out2[ip+2];
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
......@@ -403,7 +403,7 @@ void ulsch_modulation(int32_t **txdataF,
uint8_t c;
if (!ulsch) {
msg("ulsch_modulation.c: Null ulsch\n");
printf("ulsch_modulation.c: Null ulsch\n");
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
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;
}
......@@ -419,12 +419,12 @@ void ulsch_modulation(int32_t **txdataF,
nb_rb = ulsch->harq_processes[harq_pid]->nb_rb;
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;
}
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;
}
......@@ -439,12 +439,12 @@ void ulsch_modulation(int32_t **txdataF,
Msc_PUSCH = ulsch->harq_processes[harq_pid]->nb_rb*12;
#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);
#endif
// 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);
k=0;
......@@ -454,14 +454,14 @@ void ulsch_modulation(int32_t **txdataF,
c = (uint8_t)((s>>j)&1);
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;
} 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];
} else {
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);
}
//msg("\n");
//printf("\n");
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])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
// 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*
((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])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
// 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;
......@@ -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])[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;
case 6:
......@@ -710,14 +710,14 @@ void ulsch_modulation(int32_t **txdataF,
// 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++) {
re_offset = re_offset0;
symbol_offset = (int)frame_parms->ofdm_symbol_size*(l+(subframe*nsymb));
#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
txptr = &txdataF[0][symbol_offset];
......@@ -727,10 +727,10 @@ void ulsch_modulation(int32_t **txdataF,
// Skip reference symbols
else {
// msg("copying %d REs\n",Msc_PUSCH);
// printf("copying %d REs\n",Msc_PUSCH);
for (i=0; i<Msc_PUSCH; i++,j++) {
#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
txptr[re_offset++] = ulsch->z[j];
......@@ -748,13 +748,13 @@ void ulsch_modulation(int32_t **txdataF,
// re_offset0++;
}
// msg("re_offset0 %d\n",re_offset0);
// printf("re_offset0 %d\n",re_offset0);
// printf("txdataF %p\n",&txdataF[0][0]);
for (j=0,l=0; l<(nsymb-ulsch->srs_active); l++) {
re_offset = re_offset0;
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*(l+(subframe*nsymb));
#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
txptr = &txdataF[0][symbol_offset];
......@@ -763,11 +763,11 @@ void ulsch_modulation(int32_t **txdataF,
}
// Skip reference symbols
else {
// msg("copying %d REs\n",Msc_PUSCH);
// printf("copying %d REs\n",Msc_PUSCH);
for (i=0; i<Msc_PUSCH; i++,j++) {
#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
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 time2[2048];
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;
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
......
......@@ -48,7 +48,7 @@ double get_cpu_freq_GHz(void) {
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) {
......
......@@ -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));
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);
double get_time_meas_us(time_stats_t *ts);
double get_cpu_freq_GHz(void);
......
......@@ -192,10 +192,14 @@ typedef struct {
int subframe_tx;
/// subframe to act upon for reception
int subframe_rx;
/// subframe to act upon for PRACH
int subframe_prach;
/// frame to act upon for transmission
int frame_tx;
/// frame to act upon for reception
int frame_rx;
/// frame to act upon for PRACH
int frame_prach;
/// \brief Instance count for tx processing thread.
/// \internal This variable is protected by \ref mutex_tx.
int instance_cnt_tx;
......@@ -232,14 +236,13 @@ typedef struct {
//! \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.
#define NUM_ENB_THREADS 1
/// Top-level PHY Data Structure for eNB
typedef struct PHY_VARS_eNB_s {
/// Module ID indicator for this instance
module_id_t Mod_id;
uint8_t CC_id;
eNB_proc_t proc[NUM_ENB_THREADS];
eNB_proc_t proc;
eNB_func_t node_function;
uint8_t local_flag;
uint32_t rx_total_gain_dB;
......
......@@ -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);
/*! \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 eNB_id ID of eNB on which to act
@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);
/*! \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 eNB_id Local id of eNB on which to act
@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
*/
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.
@param thread_index Index of thread in proc vector
@param phy_vars_eNB Pointer to eNB variables on which to act
@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 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.
@param thread_index Thread index in proc vector
@param phy_vars_eNB Pointer to eNB variables on which to act
@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
*/
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.
@param thread_index Index of thread in proc vector
@param phy_vars_eNB Pointer to eNB variables on which to act
@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
*/
/*! \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 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.
@param thread_index Index of thread in proc vector
@param phy_vars_eNB Pointer to eNB variables on which to act
@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
*/
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.
@param last_slot Index of next slot (0-19)
@param phy_vars_eNB Pointer to eNB variables on which to act
@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
*/
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.
@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)
*/
/*! \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);
......@@ -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.
@param phy_vars_eNB Pointer to eNB variables
@param UE_id ID of UE which may be issuing the SR
@param subframe index of last subframe
@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
@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)
@param phy_vars_ue Pointer to UE variables
@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 SR 1 means there's a positive SR in parallel to ACK/NAK
@returns n1_pucch
*/
uint16_t get_n1_pucch(PHY_VARS_UE *phy_vars_ue,
uint8_t eNB_id,
uint8_t thread_id,
uint8_t subframe,
uint8_t *b,
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,
uint8_t UE_id,
uint8_t subframe,
int16_t *n1_pucch0,
int16_t *n1_pucch1,
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.
@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 pusch_flag Indication that feedback came from PUSCH
@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)
*/
void process_HARQ_feedback(uint8_t UE_id,
uint8_t subframe,
PHY_VARS_eNB *phy_vars_eNB,
uint8_t pusch_flag,
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);
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_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);
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -43,10 +43,12 @@
#include "OCG_vars.h"
#include "unitary_defs.h"
int current_dlsch_cqi; //FIXME!
PHY_VARS_eNB *PHY_vars_eNB;
PHY_VARS_UE *PHY_vars_UE;
PHY_VARS_eNB *eNB;
PHY_VARS_UE *UE;
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
......@@ -105,17 +107,9 @@ int main(int argc, char **argv)
logInit();
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) {
switch (c) {
case 'a':
......@@ -343,10 +337,10 @@ int main(int argc, char **argv)
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]);
s_re = malloc(2*sizeof(double*));
......@@ -361,11 +355,11 @@ int main(int argc, char **argv)
msg("[SIM] Using SCM/101\n");
UE2eNB = new_channel_desc_scm(PHY_vars_UE->lte_frame_parms.nb_antennas_tx,
PHY_vars_eNB->lte_frame_parms.nb_antennas_rx,
UE2eNB = new_channel_desc_scm(UE->frame_parms.nb_antennas_tx,
eNB->frame_parms.nb_antennas_rx,
channel_model,
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
N_RB2sampling_rate(eNB->frame_parms.N_RB_UL),
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_UL),
0.0,
delay,
0);
......@@ -388,32 +382,35 @@ int main(int argc, char **argv)
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
}
PHY_vars_UE->lte_frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
PHY_vars_UE->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
PHY_vars_UE->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
PHY_vars_UE->lte_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.rootSequenceIndex=rootSequenceIndex;
UE->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
UE->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
UE->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
UE->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
eNB->frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
eNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
eNB->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
eNB->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
eNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
PHY_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
PHY_vars_eNB->lte_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->node_function = eNodeB_3GPP;
eNB->proc.subframe_rx = subframe;
/* 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,
// PHY_vars_eNB->lte_frame_parms.frame_type);
//prach_fmt = get_prach_fmt(eNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
// eNB->frame_parms.frame_type);
/* N_ZC not used later, no need to set */
//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)
preamble_tx = (uint16_t)(taus()&0x3f);
......@@ -421,10 +418,10 @@ int main(int argc, char **argv)
if (n_frames == 1)
printf("raPreamble %d\n",preamble_tx);
PHY_vars_UE->prach_resources[0]->ra_PreambleIndex = preamble_tx;
PHY_vars_UE->prach_resources[0]->ra_TDD_map_index = 0;
UE->prach_resources[0]->ra_PreambleIndex = preamble_tx;
UE->prach_resources[0]->ra_TDD_map_index = 0;
tx_lev = generate_prach(PHY_vars_UE,
tx_lev = generate_prach(UE,
0, //eNB_id,
subframe,
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);
// 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 (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_im[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_tti]))[(i<<1)+1]);
} 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) {
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]);
......@@ -491,15 +488,14 @@ int main(int argc, char **argv)
}
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*) &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] = (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+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,
subframe,
rx_prach(eNB,
preamble_energy_list,
preamble_delay_list,
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]);
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",
&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);
write_output("rxsigF0.m","rxsF0", &PHY_vars_eNB->lte_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("rxsigF0.m","rxsF0", &eNB->common_vars.rxdataF[0][0][0],512*nsymb*2,2,1);
write_output("prach_preamble.m","prachp",&eNB->X_u[0],839,1,1);
}
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -786,7 +786,7 @@ rrc_get_estimated_ue_distance(
const int CC_idP,
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
/** @}*/
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment