Commit ea784f2b authored by knopp's avatar knopp

full IF4p5 simulation working

parent 596736af
This diff is collapsed.
...@@ -49,6 +49,9 @@ extern RAN_CONTEXT_t RC; ...@@ -49,6 +49,9 @@ extern RAN_CONTEXT_t RC;
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "openair2/LAYER2/MAC/mac_proto.h" #include "openair2/LAYER2/MAC/mac_proto.h"
#include "PHY/INIT/phy_init.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#define NUM_P5_PHY 2 #define NUM_P5_PHY 2
#define _GNU_SOURCE #define _GNU_SOURCE
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#ifndef TEST_DEBUG #ifndef TEST_DEBUG
#include "PHY/impl_defs_top.h"
#include "PHY/defs_common.h" #include "PHY/defs_common.h"
#include "PHY/CODING/coding_defs.h" #include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/CODING/lte_interleaver_inline.h"
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#include "phy_init.h" #include "phy_init.h"
#include "PHY/phy_extern.h" #include "PHY/phy_extern.h"
#include "PHY/CODING/coding_extern.h" #include "PHY/CODING/coding_extern.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
void generate_64qam_table(void) void generate_64qam_table(void)
{ {
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "PHY/phy_extern.h" #include "PHY/phy_extern.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h" #include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "SIMULATION/TOOLS/sim.h" #include "SIMULATION/TOOLS/sim.h"
#include "RadioResourceConfigCommonSIB.h" #include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h" #include "RadioResourceConfigDedicated.h"
......
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h" #include "PHY/defs_UE.h"
#include "PHY/phy_extern.h" #include "PHY/phy_extern.h"
#include "phy_init.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
extern PHY_VARS_eNB *eNB; extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE; extern PHY_VARS_UE *UE;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "PHY/phy_extern_ue.h" #include "PHY/phy_extern_ue.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "lte_estimation_defs.h" #include "lte_estimation.h"
#define DEBUG_PHY #define DEBUG_PHY
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/defs_UE.h" #include "PHY/defs_UE.h"
#include "PHY/LTE_ESTIMATION/lte_estimation_defs.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/impl_defs_top.h" #include "PHY/impl_defs_top.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "T.h" #include "T.h"
#include "lte_estimation_defs.h" #include "lte_estimation.h"
// round(exp(sqrt(-1)*(pi/2)*[0:1:N-1]/N)*pow2(15)) // round(exp(sqrt(-1)*(pi/2)*[0:1:N-1]/N)*pow2(15))
static int16_t ru_90[2*128] = {32767, 0,32766, 402,32758, 804,32746, 1206,32729, 1608,32706, 2009,32679, 2411,32647, 2811,32610, 3212,32568, 3612,32522, 4011,32470, 4410,32413, 4808,32352, 5205,32286, 5602,32214, 5998,32138, 6393,32058, 6787,31972, 7180,31881, 7571,31786, 7962,31686, 8351,31581, 8740,31471, 9127,31357, 9512,31238, 9896,31114, 10279,30986, 10660,30853, 11039,30715, 11417,30572, 11793,30425, 12167,30274, 12540,30118, 12910,29957, 13279,29792, 13646,29622, 14010,29448, 14373,29269, 14733,29086, 15091,28899, 15447,28707, 15800,28511, 16151,28311, 16500,28106, 16846,27897, 17190,27684, 17531,27467, 17869,27246, 18205,27020, 18538,26791, 18868,26557, 19195,26320, 19520,26078, 19841,25833, 20160,25583, 20475,25330, 20788,25073, 21097,24812, 21403,24548, 21706,24279, 22006,24008, 22302,23732, 22595,23453, 22884,23170, 23170,22884, 23453,22595, 23732,22302, 24008,22006, 24279,21706, 24548,21403, 24812,21097, 25073,20788, 25330,20475, 25583,20160, 25833,19841, 26078,19520, 26320,19195, 26557,18868, 26791,18538, 27020,18205, 27246,17869, 27467,17531, 27684,17190, 27897,16846, 28106,16500, 28311,16151, 28511,15800, 28707,15447, 28899,15091, 29086,14733, 29269,14373, 29448,14010, 29622,13646, 29792,13279, 29957,12910, 30118,12540, 30274,12167, 30425,11793, 30572,11417, 30715,11039, 30853,10660, 30986,10279, 31114,9896, 31238,9512, 31357,9127, 31471,8740, 31581,8351, 31686,7962, 31786,7571, 31881,7180, 31972,6787, 32058,6393, 32138,5998, 32214,5602, 32286,5205, 32352,4808, 32413,4410, 32470,4011, 32522,3612, 32568,3212, 32610,2811, 32647,2411, 32679,2009, 32706,1608, 32729,1206, 32746,804, 32758,402, 32766}; static int16_t ru_90[2*128] = {32767, 0,32766, 402,32758, 804,32746, 1206,32729, 1608,32706, 2009,32679, 2411,32647, 2811,32610, 3212,32568, 3612,32522, 4011,32470, 4410,32413, 4808,32352, 5205,32286, 5602,32214, 5998,32138, 6393,32058, 6787,31972, 7180,31881, 7571,31786, 7962,31686, 8351,31581, 8740,31471, 9127,31357, 9512,31238, 9896,31114, 10279,30986, 10660,30853, 11039,30715, 11417,30572, 11793,30425, 12167,30274, 12540,30118, 12910,29957, 13279,29792, 13646,29622, 14010,29448, 14373,29269, 14733,29086, 15091,28899, 15447,28707, 15800,28511, 16151,28311, 16500,28106, 16846,27897, 17190,27684, 17531,27467, 17869,27246, 18205,27020, 18538,26791, 18868,26557, 19195,26320, 19520,26078, 19841,25833, 20160,25583, 20475,25330, 20788,25073, 21097,24812, 21403,24548, 21706,24279, 22006,24008, 22302,23732, 22595,23453, 22884,23170, 23170,22884, 23453,22595, 23732,22302, 24008,22006, 24279,21706, 24548,21403, 24812,21097, 25073,20788, 25330,20475, 25583,20160, 25833,19841, 26078,19520, 26320,19195, 26557,18868, 26791,18538, 27020,18205, 27246,17869, 27467,17531, 27684,17190, 27897,16846, 28106,16500, 28311,16151, 28511,15800, 28707,15447, 28899,15091, 29086,14733, 29269,14373, 29448,14010, 29622,13646, 29792,13279, 29957,12910, 30118,12540, 30274,12167, 30425,11793, 30572,11417, 30715,11039, 30853,10660, 30986,10279, 31114,9896, 31238,9512, 31357,9127, 31471,8740, 31581,8351, 31686,7962, 31786,7571, 31881,7180, 31972,6787, 32058,6393, 32138,5998, 32214,5602, 32286,5205, 32352,4808, 32413,4410, 32470,4011, 32522,3612, 32568,3212, 32610,2811, 32647,2411, 32679,2009, 32706,1608, 32729,1206, 32746,804, 32758,402, 32766};
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "PHY/LTE_TRANSPORT/transport_extern.h" #include "PHY/LTE_TRANSPORT/transport_extern.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
//#define DEBUG_DCI_ENCODING 1 //#define DEBUG_DCI_ENCODING 1
//#define DEBUG_DCI_DECODING 1 //#define DEBUG_DCI_DECODING 1
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
//#define DEBUG_DCI //#define DEBUG_DCI
#include "dci_tools_common_extern.h" #include "dci_tools_common_extern.h"
#include "transport_proto.h"
int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
{ {
......
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
#endif #endif
#include "assertions.h" #include "assertions.h"
#include "nfapi_interface.h" #include "nfapi_interface.h"
#include "transport_common_proto.h"
#include "SCHED/sched_common.h"
//#define DEBUG_HARQ //#define DEBUG_HARQ
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/CODING/lte_interleaver_inline.h"
#include "PHY/LTE_TRANSPORT/transport_eNB.h" #include "PHY/LTE_TRANSPORT/transport_eNB.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
//#define DEBUG_DLSCH_MODULATION //#define DEBUG_DLSCH_MODULATION
#define NEW_ALLOC_RE #define NEW_ALLOC_RE
......
...@@ -189,7 +189,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -189,7 +189,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
void init_scrambling_lut() { void init_scrambling_lut(void) {
uint32_t s; uint32_t s;
int i=0,j; int i=0,j;
...@@ -242,7 +242,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -242,7 +242,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
} }
} }
void init_unscrambling_lut() { void init_unscrambling_lut(void) {
uint32_t s; uint32_t s;
int i=0,j; int i=0,j;
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "assertions.h" #include "assertions.h"
#include "T.h" #include "T.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
//#define DEBUG_DCI_ENCODING 1 //#define DEBUG_DCI_ENCODING 1
//#define DEBUG_DCI_DECODING 1 //#define DEBUG_DCI_DECODING 1
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
* \warning * \warning
*/ */
#include "PHY/defs_common.h" #include "PHY/defs_common.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
//#define DEBUG_GROUPHOP 1 //#define DEBUG_GROUPHOP 1
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "transport_proto.h" #include "transport_proto.h"
#include "PHY/phy_extern.h" #include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
//#define DEBUG_PBCH 1 //#define DEBUG_PBCH 1
//#define DEBUG_PBCH_ENCODING //#define DEBUG_PBCH_ENCODING
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
*/ */
#include "PHY/impl_defs_top.h" #include "PHY/impl_defs_top.h"
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
//#define DEBUG_PCFICH //#define DEBUG_PCFICH
extern uint8_t pcfich_b[4][32]; extern uint8_t pcfich_b[4][32];
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/impl_defs_top.h" #include "PHY/impl_defs_top.h"
#include "T.h" #include "T.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "transport_common_proto.h"
//#define DEBUG_PHICH 1 //#define DEBUG_PHICH 1
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
* \warning * \warning
*/ */
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
void generate_pilots(PHY_VARS_eNB *eNB, void generate_pilots(PHY_VARS_eNB *eNB,
int32_t **txdataF, int32_t **txdataF,
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
*/ */
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
int generate_mbsfn_pilot(PHY_VARS_eNB *eNB, int generate_mbsfn_pilot(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc, eNB_rxtx_proc_t *proc,
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "T.h" #include "T.h"
......
...@@ -157,6 +157,8 @@ void generate_pcfich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms); ...@@ -157,6 +157,8 @@ void generate_pcfich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms);
void generate_phich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms); void generate_phich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms);
uint32_t check_phich_reg(LTE_DL_FRAME_PARMS *frame_parms,uint32_t kprime,uint8_t lprime,uint8_t mi);
void generate_RIV_tables(void); void generate_RIV_tables(void);
/** \brief This routine provides the relationship between a PHICH TXOp and its corresponding PUSCH subframe (Table 8.3.-1 from 36.213). /** \brief This routine provides the relationship between a PHICH TXOp and its corresponding PUSCH subframe (Table 8.3.-1 from 36.213).
...@@ -267,9 +269,16 @@ uint64_t pmi2hex_2Ar1(uint32_t pmi); ...@@ -267,9 +269,16 @@ uint64_t pmi2hex_2Ar1(uint32_t pmi);
uint64_t pmi2hex_2Ar2(uint32_t pmi); uint64_t pmi2hex_2Ar2(uint32_t pmi);
uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb);
// DL power control functions // DL power control functions
double get_pa_dB(uint8_t pa); double get_pa_dB(uint8_t pa);
void init_scrambling_lut(void);
void init_unscrambling_lut(void);
uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms, uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t prach_ConfigIndex, uint8_t prach_ConfigIndex,
uint8_t n_ra_prboffset, uint8_t n_ra_prboffset,
......
...@@ -535,6 +535,7 @@ void pdcch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -535,6 +535,7 @@ void pdcch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
int8_t* llr, int8_t* llr,
uint32_t length); uint32_t length);
void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
int mbsfn_flag, int mbsfn_flag,
LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch,
...@@ -606,6 +607,9 @@ double computeRhoB_eNB(uint8_t pa, ...@@ -606,6 +607,9 @@ double computeRhoB_eNB(uint8_t pa,
void conv_eMTC_rballoc(uint16_t resource_block_coding,
uint32_t N_RB_DL,
uint32_t *rb_alloc);
int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type); int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
//#define DEBUG_ULSCH_DECODING //#define DEBUG_ULSCH_DECODING
#include "targets/RT/USER/rt_wrapper.h" #include "targets/RT/USER/rt_wrapper.h"
#include "transport_proto.h"
extern int codingw; extern int codingw;
......
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
#include "transport_eNB.h" #include "transport_eNB.h"
//#define DEBUG_ULSCH //#define DEBUG_ULSCH
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#include "transport_common_proto.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/MODULATION/modulation_eNB.h"
#include "T.h" #include "T.h"
...@@ -1103,7 +1106,7 @@ void ulsch_channel_level(int32_t **drs_ch_estimates_ext, ...@@ -1103,7 +1106,7 @@ void ulsch_channel_level(int32_t **drs_ch_estimates_ext,
int ulsch_power_LUT[750]; int ulsch_power_LUT[750];
void init_ulsch_power_LUT() { void init_ulsch_power_LUT(void) {
int i; int i;
......
...@@ -1263,7 +1263,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -1263,7 +1263,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms,
pdsch_vars->llr_offset[pdcch_vars->num_pdcch_symbols] = 0; pdsch_vars->llr_offset[pdcch_vars->num_pdcch_symbols] = 0;
LOG_I(PHY,"compute_llr_offset: nb RB %d - Qm %d \n", nb_rb_alloc, dlsch0_harq->Qm); LOG_D(PHY,"compute_llr_offset: nb RB %d - Qm %d \n", nb_rb_alloc, dlsch0_harq->Qm);
//dlsch0_harq->rb_alloc_even; //dlsch0_harq->rb_alloc_even;
//dlsch0_harq->rb_alloc_odd; //dlsch0_harq->rb_alloc_odd;
...@@ -1293,14 +1293,14 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -1293,14 +1293,14 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms,
if(symbol < (frame_parms->symbols_per_tti-1)) if(symbol < (frame_parms->symbols_per_tti-1))
pdsch_vars->llr_offset[symbol+1] = pdsch_vars->llr_offset[symbol] + llr_offset; pdsch_vars->llr_offset[symbol+1] = pdsch_vars->llr_offset[symbol] + llr_offset;
LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb); LOG_D(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb);
LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re); LOG_D(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re);
LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re); LOG_D(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re);
LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re); LOG_D(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re);
LOG_I(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol, LOG_D(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol,
pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]); pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]);
} }
} }
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "SIMULATION/TOOLS/sim.h" // for taus #include "SIMULATION/TOOLS/sim.h" // for taus
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#include "PHY/LTE_TRANSPORT/transport_extern.h" #include "PHY/LTE_TRANSPORT/transport_extern.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "SCHED/sched_common.h"
#include "assertions.h" #include "assertions.h"
#include "T.h" #include "T.h"
...@@ -155,7 +157,7 @@ void pdcch_demapping(uint16_t *llr,uint16_t *wbar,LTE_DL_FRAME_PARMS *frame_parm ...@@ -155,7 +157,7 @@ void pdcch_demapping(uint16_t *llr,uint16_t *wbar,LTE_DL_FRAME_PARMS *frame_parm
// if REG is allocated to PHICH, skip it // if REG is allocated to PHICH, skip it
if (check_phich_reg(frame_parms,kprime,lprime,mi) == 1) { if (check_phich_reg(frame_parms,kprime,lprime,mi) == 1) {
// printf("dci_demapping : skipping REG %d (RE %d)\n",(lprime==0)?kprime/6 : kprime>>2,kprime); // printf("dci_demapping : skipping REG %d (RE %d)\n",(lprime==0)?kprime/6 : kprime>>2,kprime);
if ((lprime == 0)&&((kprime%6)==0)) if ((lprime == 0)&&((kprime%6)==0))
re_offset0+=4; re_offset0+=4;
} else { // not allocated to PHICH/PCFICH } else { // not allocated to PHICH/PCFICH
...@@ -170,7 +172,7 @@ void pdcch_demapping(uint16_t *llr,uint16_t *wbar,LTE_DL_FRAME_PARMS *frame_parm ...@@ -170,7 +172,7 @@ void pdcch_demapping(uint16_t *llr,uint16_t *wbar,LTE_DL_FRAME_PARMS *frame_parm
for (i=0; i<4; i++) { for (i=0; i<4; i++) {
wbar[mprime] = llr[tti_offset0+i]; wbar[mprime] = llr[tti_offset0+i];
#ifdef DEBUG_DCI_DECODING #ifdef DEBUG_DCI_DECODING
// LOG_I(PHY,"PDCCH demapping mprime %d.%d <= llr %d (symbol %d re %d) -> (%d,%d)\n",mprime/4,i,tti_offset0+i,symbol_offset,re_offset0,*(char*)&wbar[mprime],*(1+(char*)&wbar[mprime])); LOG_I(PHY,"PDCCH demapping mprime %d.%d <= llr %d (symbol %d re %d) -> (%d,%d)\n",mprime/4,i,tti_offset0+i,symbol_offset,re_offset0,*(char*)&wbar[mprime],*(1+(char*)&wbar[mprime]));
#endif #endif
mprime++; mprime++;
re_offset0++; re_offset0++;
...@@ -335,7 +337,7 @@ int32_t pdcch_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -335,7 +337,7 @@ int32_t pdcch_llr(LTE_DL_FRAME_PARMS *frame_parms,
else else
*pdcch_llr8 = (char)(*rxF); *pdcch_llr8 = (char)(*rxF);
// printf("%d %d => %d\n",i,*rxF,*pdcch_llr8); // printf("rxF->llr : %d %d => %d\n",i,*rxF,*pdcch_llr8);
rxF++; rxF++;
pdcch_llr8++; pdcch_llr8++;
} }
...@@ -510,7 +512,6 @@ void pdcch_extract_rbs_single(int32_t **rxdataF, ...@@ -510,7 +512,6 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
int nushiftmod3 = frame_parms->nushift%3; int nushiftmod3 = frame_parms->nushift%3;
uint8_t symbol_mod; uint8_t symbol_mod;
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
#ifdef DEBUG_DCI_DECODING #ifdef DEBUG_DCI_DECODING
LOG_I(PHY, "extract_rbs_single: symbol_mod %d\n",symbol_mod); LOG_I(PHY, "extract_rbs_single: symbol_mod %d\n",symbol_mod);
...@@ -563,9 +564,9 @@ void pdcch_extract_rbs_single(int32_t **rxdataF, ...@@ -563,9 +564,9 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
(i!=(nushiftmod3+6)) && (i!=(nushiftmod3+6)) &&
(i!=(nushiftmod3+9))) { (i!=(nushiftmod3+9))) {
rxF_ext[j]=rxF[i]; rxF_ext[j]=rxF[i];
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j])); //printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
dl_ch0_ext[j++]=dl_ch0[i]; dl_ch0_ext[j++]=dl_ch0[i];
// printf("ch %d => (%d,%d)\n",i,*(short *)&dl_ch0[i],*(1+(short*)&dl_ch0[i])); //printf("ch %d => (%d,%d)\n",i,*(short *)&dl_ch0[i],*(1+(short*)&dl_ch0[i]));
} }
} }
...@@ -1289,8 +1290,7 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, ...@@ -1289,8 +1290,7 @@ int32_t rx_pdcch(PHY_VARS_UE *ue,
uint8_t subframe, uint8_t subframe,
uint8_t eNB_id, uint8_t eNB_id,
MIMO_mode_t mimo_mode, MIMO_mode_t mimo_mode,
uint32_t high_speed_flag, uint32_t high_speed_flag)
uint8_t is_secondary_ue)
{ {
LTE_UE_COMMON *common_vars = &ue->common_vars; LTE_UE_COMMON *common_vars = &ue->common_vars;
...@@ -1302,17 +1302,9 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, ...@@ -1302,17 +1302,9 @@ int32_t rx_pdcch(PHY_VARS_UE *ue,
uint8_t n_pdcch_symbols; uint8_t n_pdcch_symbols;
uint8_t mi = get_mi(frame_parms,subframe); uint8_t mi = get_mi(frame_parms,subframe);
//printf("In rx_pdcch, subframe %d, eNB_id %d, pdcch_vars %d \n",subframe,eNB_id,pdcch_vars); // printf("In rx_pdcch, subframe %d, eNB_id %d, pdcch_vars %d, handling symbol 0 \n",subframe,eNB_id,pdcch_vars);
// procress ofdm symbol 0 // procress ofdm symbol 0
if (is_secondary_ue == 1) { if (frame_parms->nb_antenna_ports_eNB>1) {
pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF,
common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB
pdcch_vars[eNB_id]->rxdataF_ext,
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
0,
high_speed_flag,
frame_parms);
} else if (frame_parms->nb_antenna_ports_eNB>1) {
pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF,
common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id],
pdcch_vars[eNB_id]->rxdataF_ext, pdcch_vars[eNB_id]->rxdataF_ext,
...@@ -1345,7 +1337,7 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, ...@@ -1345,7 +1337,7 @@ int32_t rx_pdcch(PHY_VARS_UE *ue,
log2_maxh = (log2_approx(avgs)/2) + 5; //+frame_parms->nb_antennas_rx; log2_maxh = (log2_approx(avgs)/2) + 5; //+frame_parms->nb_antennas_rx;
#ifdef UE_DEBUG_TRACE #ifdef UE_DEBUG_TRACE
LOG_D(PHY,"subframe %d: pdcch log2_maxh = %d (%d,%d)\n",subframe,log2_maxh,avgP[0],avgs); LOG_I(PHY,"subframe %d: pdcch log2_maxh = %d (%d,%d)\n",subframe,log2_maxh,avgP[0],avgs);
#endif #endif
T(T_UE_PHY_PDCCH_ENERGY, T_INT(eNB_id), T_INT(frame%1024), T_INT(subframe), T(T_UE_PHY_PDCCH_ENERGY, T_INT(eNB_id), T_INT(frame%1024), T_INT(subframe),
...@@ -1363,9 +1355,10 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, ...@@ -1363,9 +1355,10 @@ int32_t rx_pdcch(PHY_VARS_UE *ue,
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
if (subframe==5) if (subframe==5) {
write_output("rxF_comp_d.m","rxF_c_d",&pdcch_vars[eNB_id]->rxdataF_comp[0][s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1); printf("Writing output s0\n");
write_output("rxF_comp_d0.m","rxF_c_d",&pdcch_vars[eNB_id]->rxdataF_comp[0][0*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);
}
#endif #endif
if (frame_parms->nb_antennas_rx > 1) { if (frame_parms->nb_antennas_rx > 1) {
...@@ -1379,6 +1372,10 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, ...@@ -1379,6 +1372,10 @@ int32_t rx_pdcch(PHY_VARS_UE *ue,
else else
pdcch_alamouti(frame_parms,pdcch_vars[eNB_id]->rxdataF_comp,0); pdcch_alamouti(frame_parms,pdcch_vars[eNB_id]->rxdataF_comp,0);
pdcch_llr(frame_parms,
pdcch_vars[eNB_id]->rxdataF_comp,
(char *)pdcch_vars[eNB_id]->llr,
0);
// decode pcfich here and find out pdcch ofdm symbol number // decode pcfich here and find out pdcch ofdm symbol number
...@@ -1387,6 +1384,7 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, ...@@ -1387,6 +1384,7 @@ int32_t rx_pdcch(PHY_VARS_UE *ue,
pdcch_vars[eNB_id], pdcch_vars[eNB_id],
mimo_mode); mimo_mode);
// printf("In rx_pdcch, subframe %d, num_pdcch_symbols %d \n",subframe,n_pdcch_symbols);
if (n_pdcch_symbols>3) if (n_pdcch_symbols>3)
n_pdcch_symbols=1; n_pdcch_symbols=1;
...@@ -1400,20 +1398,13 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, ...@@ -1400,20 +1398,13 @@ int32_t rx_pdcch(PHY_VARS_UE *ue,
#ifdef DEBUG_DCI_DECODING #ifdef DEBUG_DCI_DECODING
LOG_I(PHY,"demapping: subframe %d, mi %d, tdd_config %d\n",subframe,get_mi(frame_parms,subframe),frame_parms->tdd_config); if (subframe==5) LOG_I(PHY,"demapping: subframe %d, num_pdcch_symbols %d\n",subframe,n_pdcch_symbols);
#endif #endif
// process pdcch ofdm symbol 1 and 2 if necessary // process pdcch ofdm symbol 1 and 2 if necessary
for (int s=1; s<n_pdcch_symbols; s++){ for (int s=1; s<n_pdcch_symbols; s++){
if (is_secondary_ue == 1) { // printf("In rx_pdcch, subframe %d, eNB_id %d, pdcch_vars %d, handling symbol %d \n",subframe,eNB_id,pdcch_vars,s);
pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, if (frame_parms->nb_antenna_ports_eNB>1) {
common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB
pdcch_vars[eNB_id]->rxdataF_ext,
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
s,
high_speed_flag,
frame_parms);
} else if (frame_parms->nb_antenna_ports_eNB>1) {
pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF, pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF,
common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id], common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id],
pdcch_vars[eNB_id]->rxdataF_ext, pdcch_vars[eNB_id]->rxdataF_ext,
...@@ -1443,9 +1434,9 @@ int32_t rx_pdcch(PHY_VARS_UE *ue, ...@@ -1443,9 +1434,9 @@ int32_t rx_pdcch(PHY_VARS_UE *ue,
#ifdef DEBUG_PHY #ifdef DEBUG_PHY