Commit 50b72dbc authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/dlsim-ulsim-fix' into develop_integration_2018_w08

parents 03a3297b cc25f17a
...@@ -1300,7 +1300,6 @@ set(L2_SRC ...@@ -1300,7 +1300,6 @@ set(L2_SRC
) )
set(L2_SRC_UE set(L2_SRC_UE
${OPENAIR2_DIR}/LAYER2/openair2_proc.c
${PDCP_DIR}/pdcp.c ${PDCP_DIR}/pdcp.c
${PDCP_DIR}/pdcp_fifo.c ${PDCP_DIR}/pdcp_fifo.c
${PDCP_DIR}/pdcp_sequence_manager.c ${PDCP_DIR}/pdcp_sequence_manager.c
...@@ -2148,11 +2147,12 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr ...@@ -2148,11 +2147,12 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c ${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c
${XFORMS_SOURCE} ${XFORMS_SOURCE}
${T_SOURCE} ${T_SOURCE}
${CONFIG_SOURCES}
) )
target_link_libraries (${myExe} target_link_libraries (${myExe}
-Wl,--start-group SIMU UTIL SCHED_LIB PHY LFDS ${ITTI_LIB} LFDS7 -Wl,--end-group -Wl,--start-group SIMU UTIL SCHED_LIB PHY LFDS ${ITTI_LIB} LFDS7 -Wl,--end-group
pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
) )
endforeach(myExe) endforeach(myExe)
......
...@@ -109,7 +109,7 @@ crc24a (unsigned char * inptr, int bitlen) ...@@ -109,7 +109,7 @@ crc24a (unsigned char * inptr, int bitlen)
resbit = (bitlen % 8); resbit = (bitlen % 8);
while (octetlen-- > 0) { while (octetlen-- > 0) {
// printf("in %x => crc %x\n",crc,*inptr); // printf("crc24a: in %x => crc %x\n",crc,*inptr);
crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)];
} }
...@@ -128,6 +128,7 @@ unsigned int crc24b (unsigned char * inptr, int bitlen) ...@@ -128,6 +128,7 @@ unsigned int crc24b (unsigned char * inptr, int bitlen)
resbit = (bitlen % 8); resbit = (bitlen % 8);
while (octetlen-- > 0) { while (octetlen-- > 0) {
// printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]);
crc = (crc << 8) ^ crc24bTable[(*inptr++) ^ (crc >> 24)]; crc = (crc << 8) ^ crc24bTable[(*inptr++) ^ (crc >> 24)];
} }
......
...@@ -749,6 +749,10 @@ int lte_rate_matching_turbo_rx(uint32_t RTC, ...@@ -749,6 +749,10 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
for (; (ind<Ncb)&&(k<E); ind++) { for (; (ind<Ncb)&&(k<E); ind++) {
if (dummy_w[ind] != LTE_NULL) { if (dummy_w[ind] != LTE_NULL) {
/*
if ((w[ind]>0 && soft_input2[k]<0) ||
(w[ind]<0 && soft_input2[k]>0))
printf("ind %d: w %d => soft_in %d\n",ind,w[ind],soft_input2[k]);*/
w[ind] += soft_input2[k++]; w[ind] += soft_input2[k++];
#ifdef RM_DEBUG #ifdef RM_DEBUG
printf("RM_RX k%d Ind: %d (%d)\n",k-1,ind,w[ind]); printf("RM_RX k%d Ind: %d (%d)\n",k-1,ind,w[ind]);
......
...@@ -330,19 +330,25 @@ void init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms); ...@@ -330,19 +330,25 @@ void init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms);
//void copy_lte_parms_to_phy_framing(LTE_DL_FRAME_PARMS *frame_parm, PHY_FRAMING *phy_framing); //void copy_lte_parms_to_phy_framing(LTE_DL_FRAME_PARMS *frame_parm, PHY_FRAMING *phy_framing);
void lte_param_init(unsigned char N_tx_port_eNB, void lte_param_init(PHY_VARS_eNB **eNBp,
unsigned char N_tx, PHY_VARS_UE **UEp,
unsigned char N_rx, RU_t **rup,
unsigned char N_tx_port_eNB,
unsigned char N_tx_phy,
unsigned char N_rx_ru,
unsigned char N_rx_ue,
unsigned char transmission_mode, unsigned char transmission_mode,
uint8_t extended_prefix_flag, uint8_t extended_prefix_flag,
frame_t frame_type, frame_t frame_type,
uint16_t Nid_cell, uint16_t Nid_cell,
uint8_t tdd_config, uint8_t tdd_config,
uint8_t N_RB_DL, uint8_t N_RB_DL,
uint8_t pa,
uint8_t threequarter_fs, uint8_t threequarter_fs,
uint8_t osf, uint8_t osf,
uint32_t perfect_ce); uint32_t perfect_ce);
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
void phy_config_dedicated_scell_ue(uint8_t Mod_id, void phy_config_dedicated_scell_ue(uint8_t Mod_id,
uint8_t eNB_index, uint8_t eNB_index,
...@@ -367,18 +373,6 @@ void phy_config_request(PHY_Config_t *phy_config); ...@@ -367,18 +373,6 @@ void phy_config_request(PHY_Config_t *phy_config);
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);
void lte_param_init(unsigned char N_tx_port_eNB,
unsigned char N_tx_phy,
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
...@@ -882,11 +882,11 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -882,11 +882,11 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
AssertFatal(fp->N_RB_UL > 5, "fp->N_RB_UL %d < 6\n",fp->N_RB_UL); AssertFatal(fp->N_RB_UL > 5, "fp->N_RB_UL %d < 6\n",fp->N_RB_UL);
for (i=0; i<2; i++) { for (i=0; i<2; i++) {
// RK 2 times because of output format of FFT! // RK 2 times because of output format of FFT!
// FIXME We should get rid of this, consider also phy_free_lte_eNB() // FIXME We should get rid of this
pusch_vars[UE_id]->rxdataF_ext[i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti ); pusch_vars[UE_id]->rxdataF_ext[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
pusch_vars[UE_id]->rxdataF_ext2[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti ); pusch_vars[UE_id]->rxdataF_ext2[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
pusch_vars[UE_id]->drs_ch_estimates[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti ); pusch_vars[UE_id]->drs_ch_estimates[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
pusch_vars[UE_id]->drs_ch_estimates_time[i] = (int32_t*)malloc16_clear( 2*2*sizeof(int32_t)*fp->ofdm_symbol_size ); pusch_vars[UE_id]->drs_ch_estimates_time[i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*fp->ofdm_symbol_size );
pusch_vars[UE_id]->rxdataF_comp[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti ); pusch_vars[UE_id]->rxdataF_comp[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
pusch_vars[UE_id]->ul_ch_mag[i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 ); pusch_vars[UE_id]->ul_ch_mag[i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
pusch_vars[UE_id]->ul_ch_magb[i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 ); pusch_vars[UE_id]->ul_ch_magb[i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
......
...@@ -32,6 +32,11 @@ ...@@ -32,6 +32,11 @@
#include "assertions.h" #include "assertions.h"
#include <math.h> #include <math.h>
#undef LOG_I
#define LOG_I(A,B,C...) printf(B,C)
#undef LOG_D
#define LOG_D(A,B,C...) printf(B,C)
int phy_init_RU(RU_t *ru) { int phy_init_RU(RU_t *ru) {
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
...@@ -60,7 +65,7 @@ int phy_init_RU(RU_t *ru) { ...@@ -60,7 +65,7 @@ int phy_init_RU(RU_t *ru) {
} }
} // IF5 or local RF } // IF5 or local RF
else { else {
LOG_I(PHY,"No rxdata/txdata for RU\n"); // LOG_I(PHY,"No rxdata/txdata for RU\n");
ru->common.txdata = (int32_t**)NULL; ru->common.txdata = (int32_t**)NULL;
ru->common.rxdata = (int32_t**)NULL; ru->common.rxdata = (int32_t**)NULL;
...@@ -91,8 +96,8 @@ int phy_init_RU(RU_t *ru) { ...@@ -91,8 +96,8 @@ int phy_init_RU(RU_t *ru) {
} }
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */ /* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]), // AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]),
"nb_antennas_rx too large"); // "nb_antennas_rx too large");
ru->prach_rxsigF = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*)); ru->prach_rxsigF = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
for (j=0;j<4;j++) ru->prach_rxsigF_br[j] = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*)); for (j=0;j<4;j++) ru->prach_rxsigF_br[j] = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
......
...@@ -32,16 +32,22 @@ ...@@ -32,16 +32,22 @@
extern PHY_VARS_eNB *eNB; extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE; extern PHY_VARS_UE *UE;
extern RU_t *ru;
void lte_param_init(unsigned char N_tx_port_eNB, void lte_param_init(PHY_VARS_eNB **eNBp,
PHY_VARS_UE **UEp,
RU_t **rup,
unsigned char N_tx_port_eNB,
unsigned char N_tx_phy, unsigned char N_tx_phy,
unsigned char N_rx, unsigned char N_rx_ru,
unsigned char N_rx_ue,
unsigned char transmission_mode, unsigned char transmission_mode,
uint8_t extended_prefix_flag, uint8_t extended_prefix_flag,
frame_t frame_type, frame_t frame_type,
uint16_t Nid_cell, uint16_t Nid_cell,
uint8_t tdd_config, uint8_t tdd_config,
uint8_t N_RB_DL, uint8_t N_RB_DL,
uint8_t pa,
uint8_t threequarter_fs, uint8_t threequarter_fs,
uint8_t osf, uint8_t osf,
uint32_t perfect_ce) uint32_t perfect_ce)
...@@ -49,13 +55,27 @@ void lte_param_init(unsigned char N_tx_port_eNB, ...@@ -49,13 +55,27 @@ void lte_param_init(unsigned char N_tx_port_eNB,
LTE_DL_FRAME_PARMS *frame_parms; LTE_DL_FRAME_PARMS *frame_parms;
int i; int i;
PHY_VARS_eNB *eNB;
PHY_VARS_UE *UE;
RU_t *ru;
printf("Start lte_param_init\n"); printf("Start lte_param_init\n");
eNB = malloc(sizeof(PHY_VARS_eNB)); *eNBp = malloc(sizeof(PHY_VARS_eNB));
UE = malloc(sizeof(PHY_VARS_UE)); *UEp = malloc(sizeof(PHY_VARS_UE));
*rup = malloc(sizeof(RU_t));
eNB = *eNBp;
UE = *UEp;
ru = *rup;
printf("eNB %p, UE %p, ru %p\n",eNB,UE,ru);
memset((void*)eNB,0,sizeof(PHY_VARS_eNB)); memset((void*)eNB,0,sizeof(PHY_VARS_eNB));
memset((void*)UE,0,sizeof(PHY_VARS_UE)); memset((void*)UE,0,sizeof(PHY_VARS_UE));
memset((void*)ru,0,sizeof(RU_t));
ru->eNB_list[0] = eNB;
eNB->RU_list[0] = ru;
ru->num_eNB=1;
srand(0); srand(0);
randominit(0); randominit(0);
...@@ -71,7 +91,7 @@ void lte_param_init(unsigned char N_tx_port_eNB, ...@@ -71,7 +91,7 @@ void lte_param_init(unsigned char N_tx_port_eNB,
frame_parms->Nid_cell = Nid_cell; frame_parms->Nid_cell = Nid_cell;
frame_parms->nushift = Nid_cell%6; frame_parms->nushift = Nid_cell%6;
frame_parms->nb_antennas_tx = N_tx_phy; frame_parms->nb_antennas_tx = N_tx_phy;
frame_parms->nb_antennas_rx = N_rx; frame_parms->nb_antennas_rx = N_rx_ru;
frame_parms->nb_antenna_ports_eNB = N_tx_port_eNB; frame_parms->nb_antenna_ports_eNB = N_tx_port_eNB;
frame_parms->phich_config_common.phich_resource = oneSixth; frame_parms->phich_config_common.phich_resource = oneSixth;
frame_parms->phich_config_common.phich_duration = normal; frame_parms->phich_config_common.phich_duration = normal;
...@@ -90,12 +110,18 @@ void lte_param_init(unsigned char N_tx_port_eNB, ...@@ -90,12 +110,18 @@ void lte_param_init(unsigned char N_tx_port_eNB,
UE->is_secondary_ue = 0; UE->is_secondary_ue = 0;
UE->frame_parms = *frame_parms; UE->frame_parms = *frame_parms;
eNB->frame_parms = *frame_parms; UE->frame_parms.nb_antennas_rx=N_rx_ue;
// eNB->frame_parms = *frame_parms;
ru->frame_parms = *frame_parms;
ru->nb_tx = N_tx_phy;
ru->nb_rx = N_rx_ru;
ru->if_south = LOCAL_RF;
eNB->configured=1;
eNB->transmission_mode[0] = transmission_mode; eNB->transmission_mode[0] = transmission_mode;
UE->transmission_mode[0] = transmission_mode; UE->transmission_mode[0] = transmission_mode;
init_lte_top(frame_parms);
dump_frame_parms(frame_parms); dump_frame_parms(frame_parms);
UE->measurements.n_adj_cells=0; UE->measurements.n_adj_cells=0;
...@@ -105,23 +131,24 @@ void lte_param_init(unsigned char N_tx_port_eNB, ...@@ -105,23 +131,24 @@ void lte_param_init(unsigned char N_tx_port_eNB,
for (i=0; i<3; i++) for (i=0; i<3; i++)
lte_gold(frame_parms,UE->lte_gold_table[i],Nid_cell+i); lte_gold(frame_parms,UE->lte_gold_table[i],Nid_cell+i);
init_lte_ue(UE,1,0); printf("Calling init_lte_ue_signal\n");
init_lte_ue_signal(UE,1,0);
printf("Calling phy_init_lte_eNB\n");
phy_init_lte_eNB(eNB,0,0); phy_init_lte_eNB(eNB,0,0);
printf("Calling phy_init_RU (%p)\n",ru);
phy_init_RU(ru);
generate_pcfich_reg_mapping(&UE->frame_parms); generate_pcfich_reg_mapping(&UE->frame_parms);
generate_phich_reg_mapping(&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) {
UE->pdsch_config_dedicated->p_a = pa;
if (transmission_mode == 1 || transmission_mode ==7) { if (transmission_mode == 1 || transmission_mode ==7) {
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((eNB->frame_parms).pdsch_config_common).p_b = 0; ((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; ((UE->frame_parms).pdsch_config_common).p_b = 0;
} else { // rho_a = rhob } else { // rho_a = rhob
eNB->pdsch_config_dedicated->p_a = dBm3; // 4 = 0dB
((eNB->frame_parms).pdsch_config_common).p_b = 1; ((eNB->frame_parms).pdsch_config_common).p_b = 1;
UE->pdsch_config_dedicated->p_a = dBm3; // 4 = 0dB
((UE->frame_parms).pdsch_config_common).p_b = 1; ((UE->frame_parms).pdsch_config_common).p_b = 1;
} }
...@@ -130,6 +157,13 @@ void lte_param_init(unsigned char N_tx_port_eNB, ...@@ -130,6 +157,13 @@ void lte_param_init(unsigned char N_tx_port_eNB,
/* the UE code is multi-thread "aware", we need to setup this array */ /* the UE code is multi-thread "aware", we need to setup this array */
for (i = 0; i < 10; i++) UE->current_thread_id[i] = i % 2; for (i = 0; i < 10; i++) UE->current_thread_id[i] = i % 2;
if (eNB->frame_parms.frame_type == TDD) {
if (eNB->frame_parms.N_RB_DL == 100) ru->N_TA_offset = 624;
else if (eNB->frame_parms.N_RB_DL == 50) ru->N_TA_offset = 624/2;
else if (eNB->frame_parms.N_RB_DL == 25) ru->N_TA_offset = 624/4;
}
else ru->N_TA_offset=0;
printf("Done lte_param_init\n"); printf("Done lte_param_init\n");
......
...@@ -306,7 +306,7 @@ void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -306,7 +306,7 @@ void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms,
AssertFatal(symbol<frame_parms->symbols_per_tti,"symbol %d >= %d\n", AssertFatal(symbol<frame_parms->symbols_per_tti,"symbol %d >= %d\n",
symbol,frame_parms->symbols_per_tti); symbol,frame_parms->symbols_per_tti);
AssertFatal(Msc_RS<frame_parms->N_RB_UL*12,"Msc_RS %d >= %d\n", AssertFatal(Msc_RS<=frame_parms->N_RB_UL*12,"Msc_RS %d >= %d\n",
Msc_RS,frame_parms->N_RB_UL*12); Msc_RS,frame_parms->N_RB_UL*12);
for (re=0; re<(Msc_RS>>2); re++) { for (re=0; re<(Msc_RS>>2); re++) {
......
...@@ -34,6 +34,9 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32 ...@@ -34,6 +34,9 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
#define SCALE 0x3FFF #define SCALE 0x3FFF
//#undef LOG_D
//#define LOG_D(A,B,C...) printf(B,C)
int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB, int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc, eNB_rxtx_proc_t *proc,
uint8_t UE_id, uint8_t UE_id,
...@@ -100,7 +103,7 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32))); ...@@ -100,7 +103,7 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
return(-1); return(-1);
} }
// LOG_I(PHY,"subframe %d, Ns %d, l %d, Msc_RS = %d, Msc_RS_idx = %d, u %d, v %d, cyclic_shift %d\n",subframe,Ns,l,Msc_RS, Msc_RS_idx,u,v,cyclic_shift); LOG_D(PHY,"subframe %d, Ns %d, l %d, Msc_RS = %d, Msc_RS_idx = %d, u %d, v %d, cyclic_shift %d\n",subframe,Ns,l,Msc_RS, Msc_RS_idx,u,v,cyclic_shift);
#ifdef DEBUG_CH #ifdef DEBUG_CH
if (Ns==0) if (Ns==0)
......
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
//extern uint16_t phich_reg[MAX_NUM_PHICH_GROUPS][3]; //extern uint16_t phich_reg[MAX_NUM_PHICH_GROUPS][3];
//extern uint16_t pcfich_reg[4]; //extern uint16_t pcfich_reg[4];
//#undef LOG_D
//#define LOG_D(A,B,C...) printf(B,C)
uint32_t check_phich_reg(LTE_DL_FRAME_PARMS *frame_parms,uint32_t kprime,uint8_t lprime,uint8_t mi) uint32_t check_phich_reg(LTE_DL_FRAME_PARMS *frame_parms,uint32_t kprime,uint8_t lprime,uint8_t mi)
{ {
...@@ -177,7 +180,7 @@ void dci_encoding(uint8_t *a, ...@@ -177,7 +180,7 @@ void dci_encoding(uint8_t *a,
// encode dci // encode dci
#ifdef DEBUG_DCI_ENCODING #ifdef DEBUG_DCI_ENCODING
printf("Doing DCI encoding for %d bits, e %p, rnti %x\n",A,e,rnti); printf("Doing DCI encoding for %d bits, e %p, rnti %x, E %d\n",A,e,rnti,E);
#endif #endif
memset((void *)d,LTE_NULL,96); memset((void *)d,LTE_NULL,96);
...@@ -231,18 +234,23 @@ uint8_t *generate_dci0(uint8_t *dci, ...@@ -231,18 +234,23 @@ uint8_t *generate_dci0(uint8_t *dci,
coded_bits = 72 * aggregation_level; coded_bits = 72 * aggregation_level;
/*
#ifdef DEBUG_DCI_ENCODING #ifdef DEBUG_DCI_ENCODING
for (i=0;i<1+((DCI_LENGTH+16)/8);i++) for (int i=0;i<1+((DCI_LENGTH+16)/8);i++)
printf("i %d : %x\n",i,dci[i]); printf("i %d : %x\n",i,dci[i]);
#endif #endif
*/
if (DCI_LENGTH<=32) { if (DCI_LENGTH<=32) {
dci_flip[0] = dci[3]; dci_flip[0] = dci[3];
dci_flip[1] = dci[2]; dci_flip[1] = dci[2];
dci_flip[2] = dci[1]; dci_flip[2] = dci[1];
dci_flip[3] = dci[0]; dci_flip[3] = dci[0];
#ifdef DEBUG_DCI_ENCODING
printf("DCI => %x,%x,%x,%x\n",
dci_flip[0],dci_flip[1],dci_flip[2],dci_flip[3]);
#endif
} else { } else {
dci_flip[0] = dci[7]; dci_flip[0] = dci[7];
dci_flip[1] = dci[6]; dci_flip[1] = dci[6];
...@@ -2271,7 +2279,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2271,7 +2279,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
/* clear all bits, the above code may generate too much false detections /* clear all bits, the above code may generate too much false detections
* (not sure about this, to be checked somehow) * (not sure about this, to be checked somehow)
*/ */
// memset(e, 0, DCI_BITS_MAX); // memset(e, 0, DCI_BITS_MAX);
e_ptr = e; e_ptr = e;
...@@ -2285,11 +2293,11 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2285,11 +2293,11 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
if (dci_alloc[i].L == (uint8_t)L) { if (dci_alloc[i].L == (uint8_t)L) {
#ifdef DEBUG_DCI_ENCODING #ifdef DEBUG_DCI_ENCODING
if (dci_alloc[i].rnti==0x02) if (dci_alloc[i].rnti==0x1234)
LOG_I(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, LOG_D(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L,
*(unsigned int*)dci_alloc[i].dci_pdu, *(unsigned int*)dci_alloc[i].dci_pdu,
dci_alloc[i].rnti); dci_alloc[i].rnti);
//dump_dci(frame_parms,&dci_alloc[i]); dump_dci(frame_parms,&dci_alloc[i]);
#endif #endif
if (dci_alloc[i].firstCCE>=0) { if (dci_alloc[i].firstCCE>=0) {
...@@ -2894,17 +2902,17 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, ...@@ -2894,17 +2902,17 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
LOG_D(PHY,"[DCI search nPdcch %d - common] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x)\n", LOG_D(PHY,"[DCI search nPdcch %d - common] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x)\n",
pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask); pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask);
else else
LOG_D(PHY,"[DCI search nPdcch %d - ue spec] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x) format %d\n", LOG_D(PHY,"[DCI search nPdcch %d - ue spec %x] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x) format %d\n",
pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask,format_c); pdcch_vars[eNB_id]->num_pdcch_symbols,pdcch_vars[eNB_id]->crnti,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask,format_c);
dci_decoding(sizeof_bits, dci_decoding(sizeof_bits,
L, L,
&pdcch_vars[eNB_id]->e_rx[CCEind*72], &pdcch_vars[eNB_id]->e_rx[CCEind*72],
&dci_decoded_output[current_thread_id][0]); &dci_decoded_output[current_thread_id][0]);
/* /*
for (i=0;i<3+(sizeof_bits>>3);i++) for (i=0;i<3+(sizeof_bits>>3);i++)
printf("dci_decoded_output[%d] => %x\n",i,dci_decoded_output[i]); printf("dci_decoded_output[%d][%d] => %x\n",current_thread_id,i,dci_decoded_output[current_thread_id][i]);
*/ */
crc = (crc16(&dci_decoded_output[current_thread_id][0],sizeof_bits)>>16) ^ extract_crc(&dci_decoded_output[current_thread_id][0],sizeof_bits); crc = (crc16(&dci_decoded_output[current_thread_id][0],sizeof_bits)>>16) ^ extract_crc(&dci_decoded_output[current_thread_id][0],sizeof_bits);
#ifdef DEBUG_DCI_DECODING #ifdef DEBUG_DCI_DECODING
...@@ -3823,7 +3831,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ...@@ -3823,7 +3831,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
} else if (tmode == 3) { } else if (tmode == 3) {
LOG_D(PHY," Now check UE_SPEC format 2A_2A search aggregation 1 dci length: %d[bits] %d[bytes]\n",format2A_size_bits,format2A_size_bytes); // LOG_D(PHY," Now check UE_SPEC format 2A_2A search aggregation 1 dci length: %d[bits] %d[bytes]\n",format2A_size_bits,format2A_size_bytes);
// Now check UE_SPEC format 2A_2A search spaces at aggregation 1 // Now check UE_SPEC format 2A_2A search spaces at aggregation 1
old_dci_cnt=dci_cnt; old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode, dci_decoding_procedure0(pdcch_vars,0,mode,
...@@ -3895,7 +3903,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ...@@ -3895,7 +3903,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
return(dci_cnt); return(dci_cnt);
// Now check UE_SPEC format 2_2A search spaces at aggregation 4 // Now check UE_SPEC format 2_2A search spaces at aggregation 4
LOG_D(PHY," Now check UE_SPEC format 2_2A search spaces at aggregation 4 \n"); // LOG_D(PHY," Now check UE_SPEC format 2_2A search spaces at aggregation 4 \n");
old_dci_cnt=dci_cnt; old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode, dci_decoding_procedure0(pdcch_vars,0,mode,
subframe, subframe,
...@@ -4238,3 +4246,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ...@@ -4238,3 +4246,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
return(dci_cnt); return(dci_cnt);
} }
...@@ -44,6 +44,12 @@ ...@@ -44,6 +44,12 @@
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h" #include "LAYER2/MAC/defs.h"
/*#undef LOG_D
#define LOG_D(A,B,C...) printf(B,C)
#undef LOG_I
#define LOG_I(A,B,C...) printf(B,C)
*/
//#define DEBUG_DCI //#define DEBUG_DCI
uint32_t localRIV2alloc_LUT6[32]; uint32_t localRIV2alloc_LUT6[32];
...@@ -2660,11 +2666,12 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ...@@ -2660,11 +2666,12 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7) else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7)
ulsch->harq_processes[harq_pid]->n_DMRS2 = 9; ulsch->harq_processes[harq_pid]->n_DMRS2 = 9;
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d\n", LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d ulsch_pdu:rvidx:%d\n",
eNB->Mod_id,harq_pid,frame,subframe, eNB->Mod_id,harq_pid,frame,subframe,
ulsch->harq_processes[harq_pid]->n_DMRS2, ulsch->harq_processes[harq_pid]->n_DMRS2,
ulsch->harq_processes[harq_pid]->n_DMRS, ulsch->harq_processes[harq_pid]->n_DMRS,
ulsch->harq_processes[harq_pid]->ndi, ulsch_pdu->ulsch_pdu_rel8.new_data_indication, new_ulsch, ulsch->harq_processes[harq_pid]->status); ulsch->harq_processes[harq_pid]->ndi, ulsch_pdu->ulsch_pdu_rel8.new_data_indication, new_ulsch, ulsch->harq_processes[harq_pid]->status,
ulsch_pdu->ulsch_pdu_rel8.redundancy_version);
ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version; ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version;
ulsch->harq_processes[harq_pid]->Qm = ulsch_pdu->ulsch_pdu_rel8.modulation_type; ulsch->harq_processes[harq_pid]->Qm = ulsch_pdu->ulsch_pdu_rel8.modulation_type;
...@@ -4680,13 +4687,13 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format, ...@@ -4680,13 +4687,13 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
if(harq_pid>=8) if(harq_pid>=8)
{ {
LOG_I(PHY,"bad harq id \n"); // LOG_I(PHY,"bad harq id \n");
return(0); return(0);
} }
if(dci_format == format1 && ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) ) if(dci_format == format1 && ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) )
{ {
LOG_I(PHY,"bad dci format \n"); // LOG_I(PHY,"bad dci format \n");
return(0); return(0);
} }
...@@ -4695,13 +4702,13 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format, ...@@ -4695,13 +4702,13 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
{ {
if(pdlsch0_harq->round == 0) if(pdlsch0_harq->round == 0)
{ {
LOG_I(PHY,"bad dci mcs + round \n"); // LOG_I(PHY,"bad dci mcs + round \n");
return(0); return(0);
} }
if((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) if((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti))
{ {
LOG_I(PHY,"bad dci mcs + rnti \n"); // LOG_I(PHY,"bad dci mcs + rnti \n");
return(0); return(0);
} }
} }
...@@ -4767,7 +4774,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format, ...@@ -4767,7 +4774,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
if(rballoc > RIV_max) if(rballoc > RIV_max)
{ {
LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %lld \n",rballoc, RIV_max); // LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %lld \n",rballoc, RIV_max);
// DCI false detection // DCI false detection
return(0); return(0);
} }
...@@ -4775,7 +4782,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format, ...@@ -4775,7 +4782,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
if(NPRB == 0) if(NPRB == 0)
{ {
// DCI false detection // DCI false detection
LOG_I(PHY,"bad NPRB = 0 \n"); // LOG_I(PHY,"bad NPRB = 0 \n");
return(0); return(0);
} }
...@@ -4894,13 +4901,13 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, ...@@ -4894,13 +4901,13 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
// I- check dci content minimum coherency // I- check dci content minimum coherency
if(harq_pid>=8) if(harq_pid>=8)
{ {
LOG_I(PHY,"bad harq pid\n"); // LOG_I(PHY,"bad harq pid\n");
return(0); return(0);
} }
if( (rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti) ) if( (rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti) )
{ {
LOG_I(PHY,"bad rnti\n"); // LOG_I(PHY,"bad rnti\n");
return(0); return(0);
} }
...@@ -4909,7 +4916,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, ...@@ -4909,7 +4916,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
{ {
if(pdlsch0_harq->round == 0) if(pdlsch0_harq->round == 0)
{ {
LOG_I(PHY,"bad mcs1\n"); // LOG_I(PHY,"bad mcs1\n");
return(0); return(0);
} }
} }
...@@ -4918,7 +4925,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, ...@@ -4918,7 +4925,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
{ {
if(pdlsch1_harq->round == 0) if(pdlsch1_harq->round == 0)
{ {
LOG_I(PHY,"bad mcs2\n"); // LOG_I(PHY,"bad mcs2\n");
return(0); return(0);
} }
} }
...@@ -4927,14 +4934,14 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, ...@@ -4927,14 +4934,14 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
if((pdlsch0_harq->round == 0) && (rv1 > 0) && (mcs1 != 0)) if((pdlsch0_harq->round == 0) && (rv1 > 0) && (mcs1 != 0))
{ {
// DCI false detection // DCI false detection
LOG_I(PHY,"bad rv1\n"); // LOG_I(PHY,"bad rv1\n");
return(0); return(0);
} }
if((pdlsch1_harq->round == 0) && (rv2 > 0) && (mcs2 != 0)) if((pdlsch1_harq->round == 0) && (rv2 > 0) && (mcs2 != 0))
{ {
// DCI false detection // DCI false detection
LOG_I(PHY,"bad rv2\n"); // LOG_I(PHY,"bad rv2\n");
return(0); return(0);
} }
...@@ -4995,14 +5002,14 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, ...@@ -4995,14 +5002,14 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
if( (rballoc > RIV_max) && (rah == 1) ) if( (rballoc > RIV_max) && (rah == 1) )
{ {
// DCI false detection // DCI false detection
LOG_I(PHY,"bad rballoc %d RIV_max %lld\n", rballoc, RIV_max); // LOG_I(PHY,"bad rballoc %d RIV_max %lld\n", rballoc, RIV_max);
return(0); return(0);
} }
if(NPRB == 0) if(NPRB == 0)
{ {
// DCI false detection // DCI false detection
LOG_I(PHY,"bad NPRB\n"); // LOG_I(PHY,"bad NPRB\n");
return(0); return(0);
} }
...@@ -5026,7 +5033,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -5026,7 +5033,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_I(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;
...@@ -5056,15 +5063,15 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -5056,15 +5063,15 @@ 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_I(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_I(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_I(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_I(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_I(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]);
} }
} }
void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
...@@ -5179,7 +5186,7 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, ...@@ -5179,7 +5186,7 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
//packet was actually decoded in previous transmission (ACK was missed by eNB) //packet was actually decoded in previous transmission (ACK was missed by eNB)
//However, the round is not a good check as it might have been decoded in a retransmission prior to this one. //However, the round is not a good check as it might have been decoded in a retransmission prior to this one.
{ {
LOG_D(PHY,"skip pdsch decoding and report ack\n"); // LOG_D(PHY,"skip pdsch decoding and report ack\n");
// skip pdsch decoding and report ack // skip pdsch decoding and report ack
//pdlsch0_harq->status = SCH_IDLE; //pdlsch0_harq->status = SCH_IDLE;
pdlsch0->active = 0; pdlsch0->active = 0;
...@@ -5804,7 +5811,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, ...@@ -5804,7 +5811,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
//LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW0 subframe %d (pid %d, round %d)\n", //LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW0 subframe %d (pid %d, round %d)\n",
// subframe,harq_pid,dlsch0_harq->round); // subframe,harq_pid,dlsch0_harq->round);
if ( dlsch0_harq->first_tx==1) { if ( dlsch0_harq->first_tx==1) {
LOG_D(PHY,"Format 2 DCI First TX0: Clearing flag\n"); // LOG_D(PHY,"Format 2 DCI First TX0: Clearing flag\n");
dlsch0_harq->first_tx = 0; dlsch0_harq->first_tx = 0;
} }
} }
...@@ -5852,7 +5859,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, ...@@ -5852,7 +5859,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
//LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW1 subframe %d (pid %d, round %d)\n", //LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW1 subframe %d (pid %d, round %d)\n",
// subframe,harq_pid,dlsch0_harq->round); // subframe,harq_pid,dlsch0_harq->round);
if (dlsch1_harq->first_tx==1) { if (dlsch1_harq->first_tx==1) {
LOG_D(PHY,"Format 2 DCI First TX1: Clearing flag\n"); // LOG_D(PHY,"Format 2 DCI First TX1: Clearing flag\n");
dlsch1_harq->first_tx = 0; dlsch1_harq->first_tx = 0;
} }
} }
......
...@@ -579,7 +579,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -579,7 +579,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
// if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet // if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet
if (dlsch->harq_processes[harq_pid]->round == 0) { // this is a new packet if (dlsch->harq_processes[harq_pid]->round == 0) { // this is a new packet
#ifdef DEBUG_DLSCH_CODING #ifdef DEBUG_DLSCH_CODING
printf("encoding thinks this is a new packet \n"); printf("encoding thinks this is a new packet for harq_pid %d (%p) \n",harq_pid,dlsch->harq_processes[harq_pid]->b);
#endif #endif
/* /*
int i; int i;
...@@ -589,6 +589,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, ...@@ -589,6 +589,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
printf("\n"); printf("\n");
*/ */
// Add 24-bit crc (polynomial A) to payload // Add 24-bit crc (polynomial A) to payload
crc = crc24a(a, crc = crc24a(a,
A)>>8; A)>>8;
a[A>>3] = ((uint8_t*)&crc)[2]; a[A>>3] = ((uint8_t*)&crc)[2];
......
...@@ -37,6 +37,12 @@ ...@@ -37,6 +37,12 @@
#include "SCHED/extern.h" #include "SCHED/extern.h"
#include "SIMULATION/TOOLS/defs.h" #include "SIMULATION/TOOLS/defs.h"
//#define DEBUG_DLSCH_DECODING //#define DEBUG_DLSCH_DECODING
//#define UE_DEBUG_TRACE 1
//#undef LOG_D
//#define LOG_D(A,B,C...) printf(B,C)
//#undef LOG_I
//#define LOG_I(A,B,C...) printf(B,C)
extern double cpuf; extern double cpuf;
......
...@@ -49,12 +49,14 @@ int16_t interf_unaw_shift = 13; ...@@ -49,12 +49,14 @@ int16_t interf_unaw_shift = 13;
//#define DEBUG_HARQ //#define DEBUG_HARQ
//#undef LOG_D //#undef LOG_D
//#define LOG_D LOG_I //#define LOG_D(A,B,C...) printf(B,C)
//#undef LOG_I
//#define LOG_I(A,B,C...) printf(B,C)
//#define DEBUG_PHY 1 #define DEBUG_PHY 1
//#define DEBUG_DLSCH_DEMOD 1 //#define DEBUG_DLSCH_DEMOD 1
//#define DISABLE_LOG_X
// [MCS][i_mod (0,1,2) = (2,4,6)] // [MCS][i_mod (0,1,2) = (2,4,6)]
unsigned char offset_mumimo_llr_drange_fix=0; unsigned char offset_mumimo_llr_drange_fix=0;
...@@ -370,7 +372,7 @@ int rx_pdsch(PHY_VARS_UE *ue, ...@@ -370,7 +372,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
//printf("nb_rb = %d, eNB_id %d\n",nb_rb,eNB_id); //printf("nb_rb = %d, eNB_id %d\n",nb_rb,eNB_id);
if (nb_rb==0) { if (nb_rb==0) {
LOG_D(PHY,"dlsch_demodulation.c: nb_rb=0\n"); // LOG_D(PHY,"dlsch_demodulation.c: nb_rb=0\n");
return(-1); return(-1);
} }
...@@ -845,7 +847,7 @@ int rx_pdsch(PHY_VARS_UE *ue, ...@@ -845,7 +847,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
pllr_symbol_cw1 = (int8_t*)pdsch_vars[eNB_id]->llr[1]; pllr_symbol_cw1 = (int8_t*)pdsch_vars[eNB_id]->llr[1];
pllr_symbol_cw0 += llr_offset_symbol; pllr_symbol_cw0 += llr_offset_symbol;
pllr_symbol_cw1 += llr_offset_symbol; pllr_symbol_cw1 += llr_offset_symbol;
/*
LOG_I(PHY,"compute LLRs [AbsSubframe %d.%d-%d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n", LOG_I(PHY,"compute LLRs [AbsSubframe %d.%d-%d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n",
frame, subframe,symbol, frame, subframe,symbol,
nb_rb,dlsch0_harq->Qm, nb_rb,dlsch0_harq->Qm,
...@@ -853,7 +855,7 @@ int rx_pdsch(PHY_VARS_UE *ue, ...@@ -853,7 +855,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
pdsch_vars[eNB_id]->llr_offset[symbol], pdsch_vars[eNB_id]->llr_offset[symbol],
(int16_t*)pdsch_vars[eNB_id]->llr[0], (int16_t*)pdsch_vars[eNB_id]->llr[0],
pllr_symbol_cw0); pllr_symbol_cw0);
*/
switch (dlsch0_harq->Qm) { switch (dlsch0_harq->Qm) {
case 2 : case 2 :
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) { if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
......
...@@ -2125,6 +2125,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, ...@@ -2125,6 +2125,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
amp_rho_b = (int16_t)(((int32_t)amp*dlsch1->sqrt_rho_b)>>13); amp_rho_b = (int16_t)(((int32_t)amp*dlsch1->sqrt_rho_b)>>13);
} }
if (mod_order0 == 4) if (mod_order0 == 4)
for (i=0;i<4; i++) { for (i=0;i<4; i++) {
qam16_table_a0[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_a)>>15); qam16_table_a0[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_a)>>15);
......
...@@ -124,14 +124,18 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -124,14 +124,18 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
} }
#ifdef DEBUG_SCRAMBLING #ifdef DEBUG_SCRAMBLING
#ifdef Rel14
printf("scrambling: i0 %d rnti %x, q %d, Ns %d, Nid_cell %d, G %d x2 %x\n",dlsch->i0,dlsch->rnti,q,Ns,frame_parms->Nid_cell, G, x2); printf("scrambling: i0 %d rnti %x, q %d, Ns %d, Nid_cell %d, G %d x2 %x\n",dlsch->i0,dlsch->rnti,q,Ns,frame_parms->Nid_cell, G, x2);
#else
printf("scrambling: rnti %x, q %d, Ns %d, Nid_cell %d, G %d x2 %x\n",dlsch->rnti,q,Ns,frame_parms->Nid_cell, G, x2);
#endif
#endif #endif
s = lte_gold_scram(&x1, &x2, 1); s = lte_gold_scram(&x1, &x2, 1);
for (n=0; n<(1+(G>>5)); n++) { for (n=0; n<(1+(G>>5)); n++) {
#ifdef DEBUG_SCRAMBLING #ifdef DEBUG_SCRAMBLING
printf("scrambling %d : %d => ",k,e[k]); for (int k=0;k<32;k++) printf("scrambling %d : %d xor %d = %d\n",k+(n<<5),e[k],(s>>k)&1,e[k]^((s>>k)&1));
#endif #endif
...@@ -171,9 +175,8 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -171,9 +175,8 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
// This is not faster for some unknown reason // This is not faster for some unknown reason
// ((__m128i *)e)[0] = _mm_xor_si128(((__m128i *)e)[0],((__m128i *)scrambling_lut)[s&65535]); // ((__m128i *)e)[0] = _mm_xor_si128(((__m128i *)e)[0],((__m128i *)scrambling_lut)[s&65535]);
// ((__m128i *)e)[1] = _mm_xor_si128(((__m128i *)e)[1],((__m128i *)scrambling_lut)[s>>16]); // ((__m128i *)e)[1] = _mm_xor_si128(((__m128i *)e)[1],((__m128i *)scrambling_lut)[s>>16]);
#ifdef DEBUG_SCRAMBLING
printf("%d\n",e[k]);
#endif
s = lte_gold_scram(&x1, &x2, 0); s = lte_gold_scram(&x1, &x2, 0);
...@@ -213,7 +216,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -213,7 +216,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
for (i=0; i<(1+(G>>5)); i++) { for (i=0; i<(1+(G>>5)); i++) {
for (j=0; j<32; j++,k++) { for (j=0; j<32; j++,k++) {
#ifdef DEBUG_SCRAMBLING #ifdef DEBUG_SCRAMBLING
printf("unscrambling %d : %d => ",k,llr[k]); printf("unscrambling %d : %d xor %d =",k,llr[k],(s>>j)&1);
#endif #endif
llr[k] = ((2*((s>>j)&1))-1)*llr[k]; llr[k] = ((2*((s>>j)&1))-1)*llr[k];
#ifdef DEBUG_SCRAMBLING #ifdef DEBUG_SCRAMBLING
......
...@@ -94,8 +94,10 @@ int generate_drs_pusch(PHY_VARS_UE *ue, ...@@ -94,8 +94,10 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
l<frame_parms->symbols_per_tti; l<frame_parms->symbols_per_tti;
l += (7 - frame_parms->Ncp),u=u1,v=v1,cyclic_shift=cyclic_shift1) { l += (7 - frame_parms->Ncp),u=u1,v=v1,cyclic_shift=cyclic_shift1) {
drs_offset = 0; // printf("drs_modulation: Msc_RS = %d, Msc_RS_idx = %d\n",Msc_RS, Msc_RS_idx); drs_offset = 0;
#ifdef DEBUG_DRS
printf("drs_modulation: Msc_RS = %d, Msc_RS_idx = %d, u=%d,v=%d\n",Msc_RS, Msc_RS_idx,u,v);
#endif
re_offset = frame_parms->first_carrier_offset; re_offset = frame_parms->first_carrier_offset;
......
...@@ -33,20 +33,20 @@ double ratioPB[2][4]={{ 0.00000, -0.96910, -2.21849, -3.97940}, //in db ...@@ -33,20 +33,20 @@ double ratioPB[2][4]={{ 0.00000, -0.96910, -2.21849, -3.97940}, //in db
double pa_values[8]={-6.0,-4.77,-3.0,-1.77,0.0,1.0,2.0,3.0}; //reported by higher layers double pa_values[8]={-6.0,-4.77,-3.0,-1.77,0.0,1.0,2.0,3.0}; //reported by higher layers
double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated) double get_pa_dB(uint8_t pa)
{ {
if (pdsch_config_dedicated) AssertFatal(pa<8,"pa %d is not in (0...7)\n",pa);
return(pa_values[ pdsch_config_dedicated->p_a]);
else return(pa_values[pa]);
return(0.0);
} }
double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoA_eNB(uint8_t pa,
LTE_eNB_DLSCH_t *dlsch_eNB, int dl_power_off, uint8_t n_antenna_port){ LTE_eNB_DLSCH_t *dlsch_eNB, int dl_power_off, uint8_t n_antenna_port){
double rho_a_dB; double rho_a_dB;
double sqrt_rho_a_lin; double sqrt_rho_a_lin;
rho_a_dB = get_pa_dB(pdsch_config_dedicated); rho_a_dB = get_pa_dB(pa);
if(!dl_power_off) //if dl_power_offset is 0, this is for MU-interference, TM5 if(!dl_power_off) //if dl_power_offset is 0, this is for MU-interference, TM5
rho_a_dB-=10*log10(2); rho_a_dB-=10*log10(2);
...@@ -59,14 +59,14 @@ double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, ...@@ -59,14 +59,14 @@ double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
dlsch_eNB->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13)); dlsch_eNB->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13));
#if DEBUG_PC #if DEBUG_PC
printf("eNB: p_a=%d, value=%f, sqrt_rho_a=%d\n",pdsch_config_dedicated->p_a,pa_values[ pdsch_config_dedicated->p_a],dlsch_eNB->sqrt_rho_a); printf("eNB: p_a=%d, value=%f, sqrt_rho_a=%d\n",p_a,pa_values[ pdsch_config_dedicated->p_a],dlsch_eNB->sqrt_rho_a);
#endif #endif
return(rho_a_dB); return(rho_a_dB);
} }
double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoB_eNB(uint8_t pa,
PDSCH_CONFIG_COMMON *pdsch_config_common, uint8_t pb,
uint8_t n_antenna_port, uint8_t n_antenna_port,
LTE_eNB_DLSCH_t *dlsch_eNB, LTE_eNB_DLSCH_t *dlsch_eNB,
int dl_power_off) int dl_power_off)
...@@ -75,19 +75,21 @@ double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, ...@@ -75,19 +75,21 @@ double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
double rho_a_dB, rho_b_dB; double rho_a_dB, rho_b_dB;
double sqrt_rho_b_lin; double sqrt_rho_b_lin;
rho_a_dB= computeRhoA_eNB(pdsch_config_dedicated,dlsch_eNB,dl_power_off, n_antenna_port); AssertFatal(pa<8,"pa %d is not in (0...7)\n",pa);
AssertFatal(pb<4,"pb %d is not in (0...3)\n",pb);
rho_a_dB= computeRhoA_eNB(pa,dlsch_eNB,dl_power_off, n_antenna_port);
if(n_antenna_port>1) if(n_antenna_port>1)
rho_b_dB= ratioPB[1][pdsch_config_common->p_b] + rho_a_dB; rho_b_dB= ratioPB[1][pb] + rho_a_dB;
else else
rho_b_dB= ratioPB[0][pdsch_config_common->p_b] + rho_a_dB; rho_b_dB= ratioPB[0][pb] + rho_a_dB;
sqrt_rho_b_lin= pow(10,(0.05*rho_b_dB)); sqrt_rho_b_lin= pow(10,(0.05*rho_b_dB));
dlsch_eNB->sqrt_rho_b= (short) (sqrt_rho_b_lin*pow(2,13)); dlsch_eNB->sqrt_rho_b= (short) (sqrt_rho_b_lin*pow(2,13));
#ifdef DEBUG_PC #ifdef DEBUG_PC
printf("eNB: n_ant=%d, p_b=%d -> rho_b/rho_a=%f -> sqrt_rho_b=%d\n",n_antenna_port,pdsch_config_common->p_b,ratioPB[1][pdsch_config_common->p_b],dlsch_eNB->sqrt_rho_b); printf("eNB: n_ant=%d, p_b=%d -> rho_b/rho_a=%f -> sqrt_rho_b=%d\n",n_antenna_port,pb,ratioPB[1][pb],dlsch_eNB->sqrt_rho_b);
#endif #endif
return(rho_b_dB); return(rho_b_dB);
} }
...@@ -102,7 +104,7 @@ double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, ...@@ -102,7 +104,7 @@ double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
double rho_a_dB; double rho_a_dB;
double sqrt_rho_a_lin; double sqrt_rho_a_lin;
rho_a_dB = get_pa_dB(pdsch_config_dedicated); rho_a_dB = get_pa_dB(pdsch_config_dedicated->p_a);
if(!dl_power_off) if(!dl_power_off)
rho_a_dB-=10*log10(2); rho_a_dB-=10*log10(2);
......
...@@ -1789,7 +1789,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB, ...@@ -1789,7 +1789,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB,
uint8_t use_srs); uint8_t use_srs);
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNB,int frame, int subframe, uint8_t UE_id); void dump_ulsch(PHY_VARS_eNB *phy_vars_eNB,int frame, int subframe, uint8_t UE_id,int round);
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);
...@@ -2227,15 +2227,15 @@ uint32_t dlsch_decoding_abstraction(double *dlsch_MIPB, ...@@ -2227,15 +2227,15 @@ uint32_t dlsch_decoding_abstraction(double *dlsch_MIPB,
uint8_t num_pdcch_symbols); uint8_t num_pdcch_symbols);
// DL power control functions // DL power control functions
double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated); double get_pa_dB(uint8_t pa);
double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoA_eNB(uint8_t pa,
LTE_eNB_DLSCH_t *dlsch_eNB, LTE_eNB_DLSCH_t *dlsch_eNB,
int dl_power_off, int dl_power_off,
uint8_t n_antenna_port); uint8_t n_antenna_port);
double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoB_eNB(uint8_t pa,
PDSCH_CONFIG_COMMON *pdsch_config_common, uint8_t pb,
uint8_t n_antenna_port, uint8_t n_antenna_port,
LTE_eNB_DLSCH_t *dlsch_eNB, LTE_eNB_DLSCH_t *dlsch_eNB,
int dl_power_off); int dl_power_off);
......
...@@ -725,8 +725,8 @@ void ulsch_extract_rbs_single(int32_t **rxdataF, ...@@ -725,8 +725,8 @@ void ulsch_extract_rbs_single(int32_t **rxdataF,
//uint8_t symbol = l+Ns*frame_parms->symbols_per_tti/2; //uint8_t symbol = l+Ns*frame_parms->symbols_per_tti/2;
uint8_t symbol = l+((7-frame_parms->Ncp)*(Ns&1)); ///symbol within sub-frame uint8_t symbol = l+((7-frame_parms->Ncp)*(Ns&1)); ///symbol within sub-frame
AssertFatal((frame_parms->nb_antennas_rx>0) && (frame_parms->nb_antennas_rx<3), AssertFatal((frame_parms->nb_antennas_rx>0) && (frame_parms->nb_antennas_rx<5),
"nb_antennas_rx not in (1-2)\n"); "nb_antennas_rx not in (1-4)\n");
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
...@@ -1349,35 +1349,54 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB, ...@@ -1349,35 +1349,54 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB,
} }
void dump_ulsch(PHY_VARS_eNB *eNB,int frame,int subframe,uint8_t UE_id) { void dump_ulsch(PHY_VARS_eNB *eNB,int frame,int subframe,uint8_t UE_id,int round) {
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;
char fname[100],vname[100];
harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe); harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
printf("Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, TBS %d, Qm %d, N_symb %d\n", printf("Dumping ULSCH in subframe %d with harq_pid %d, round %d for NB_rb %d, TBS %d, Qm %d, N_symb %d\n",
subframe,harq_pid,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, subframe,harq_pid,round,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS,eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm, eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS,eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch); eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch);
write_output("/tmp/ulsch_d.m","ulsch_dseq",&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96], sprintf(fname,"/tmp/ulsch_r%d_d",round);
sprintf(vname,"/tmp/ulsch_r%d_dseq",round);
write_output(fname,vname,&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96],
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus*3,1,0); eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus*3,1,0);
if (eNB->common_vars.rxdata) write_output("/tmp/rxsig0.m","rxs0", &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1); if (eNB->common_vars.rxdata) {
sprintf(fname,"/tmp/rxsig0_r%d.m",round);
sprintf(vname,"rxs0_r%d",round);
write_output(fname,vname, &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1);
if (eNB->frame_parms.nb_antennas_rx>1) if (eNB->frame_parms.nb_antennas_rx>1)
if (eNB->common_vars.rxdata) write_output("/tmp/rxsig1.m","rxs1", &eNB->common_vars.rxdata[1][0],eNB->frame_parms.samples_per_tti*10,1,1); if (eNB->common_vars.rxdata) {
sprintf(fname,"/tmp/rxsig1_r%d.m",round);
sprintf(vname,"rxs1_r%d",round);
write_output("/tmp/rxsigF0.m","rxsF0", &eNB->common_vars.rxdataF[0][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1); write_output(fname,vname, &eNB->common_vars.rxdata[1][0],eNB->frame_parms.samples_per_tti*10,1,1);
}
}
if (eNB->frame_parms.nb_antennas_rx>1) sprintf(fname,"/tmp/rxsigF0_r%d.m",round);
write_output("/tmp/rxsigF1.m","rxsF1", &eNB->common_vars.rxdataF[1][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1); sprintf(vname,"rxsF0_r%d",round);
write_output(fname,vname, (void*)&eNB->common_vars.rxdataF[0][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
write_output("/tmp/rxsigF0_ext.m","rxsF0_ext", &eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); if (eNB->frame_parms.nb_antennas_rx>1) {
sprintf(fname,"/tmp/rxsigF1_r%d.m",round);
sprintf(vname,"rxsF1_r%d",round);
write_output(vname,fname, &eNB->common_vars.rxdataF[1][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
}
if (eNB->frame_parms.nb_antennas_rx>1) sprintf(fname,"/tmp/rxsigF0_ext_r%d.m",round);
write_output("/tmp/rxsigF1_ext.m","rxsF1_ext", &eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); sprintf(vname,"rxsF0_ext_r%d",round);
write_output(fname,vname, &eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
if (eNB->frame_parms.nb_antennas_rx>1) {
sprintf(fname,"/tmp/rxsigF1_ext_r%d.m",round);
sprintf(vname,"rxsF1_ext_r%d",round);
write_output(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
}
/* /*
if (eNB->srs_vars[UE_id].srs_ch_estimates) write_output("/tmp/srs_est0.m","srsest0",eNB->srs_vars[UE_id].srs_ch_estimates[0],eNB->frame_parms.ofdm_symbol_size,1,1); if (eNB->srs_vars[UE_id].srs_ch_estimates) write_output("/tmp/srs_est0.m","srsest0",eNB->srs_vars[UE_id].srs_ch_estimates[0],eNB->frame_parms.ofdm_symbol_size,1,1);
...@@ -1385,17 +1404,28 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB, ...@@ -1385,17 +1404,28 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB,
if (eNB->srs_vars[UE_id].srs_ch_estimates) write_output("/tmp/srs_est1.m","srsest1",eNB->srs_vars[UE_id].srs_ch_estimates[1],eNB->frame_parms.ofdm_symbol_size,1,1); if (eNB->srs_vars[UE_id].srs_ch_estimates) write_output("/tmp/srs_est1.m","srsest1",eNB->srs_vars[UE_id].srs_ch_estimates[1],eNB->frame_parms.ofdm_symbol_size,1,1);
*/ */
write_output("/tmp/drs_est0.m","drsest0",eNB->pusch_vars[UE_id]->drs_ch_estimates[0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); sprintf(fname,"/tmp/drs_est0_r%d.m",round);
sprintf(vname,"drsest0_r%d",round);
write_output(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
if (eNB->frame_parms.nb_antennas_rx>1) if (eNB->frame_parms.nb_antennas_rx>1) {
write_output("/tmp/drs_est1.m","drsest1",eNB->pusch_vars[UE_id]->drs_ch_estimates[1],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); sprintf(fname,"/tmp/drs_est1_r%d.m",round);
sprintf(vname,"drsest1_r%d",round);
write_output(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[1],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
}
write_output("/tmp/ulsch_rxF_comp0.m","ulsch0_rxF_comp0",&eNB->pusch_vars[UE_id]->rxdataF_comp[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); sprintf(fname,"/tmp/ulsch0_rxF_comp0_r%d.m",round);
sprintf(vname,"ulsch0_rxF_comp0_r%d",round);
write_output(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_comp[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
// write_output("ulsch_rxF_comp1.m","ulsch0_rxF_comp1",&eNB->pusch_vars[UE_id]->rxdataF_comp[0][1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); // write_output("ulsch_rxF_comp1.m","ulsch0_rxF_comp1",&eNB->pusch_vars[UE_id]->rxdataF_comp[0][1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
write_output("/tmp/ulsch_rxF_llr.m","ulsch_llr",eNB->pusch_vars[UE_id]->llr, sprintf(fname,"/tmp/ulsch_rxF_llr_r%d.m",round);
sprintf(vname,"ulsch_llr_r%d",round);
write_output(fname,vname,eNB->pusch_vars[UE_id]->llr,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm
*eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch,1,0); *eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch,1,0);
write_output("/tmp/ulsch_ch_mag.m","ulsch_ch_mag",&eNB->pusch_vars[UE_id]->ul_ch_mag[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); sprintf(fname,"/tmp/ulsch_ch_mag_r%d.m",round);
sprintf(vname,"ulsch_ch_mag_r%d",round);
write_output(fname,vname,&eNB->pusch_vars[UE_id]->ul_ch_mag[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
// write_output("ulsch_ch_mag1.m","ulsch_ch_mag1",&eNB->pusch_vars[UE_id]->ul_ch_mag[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1); // write_output("ulsch_ch_mag1.m","ulsch_ch_mag1",&eNB->pusch_vars[UE_id]->ul_ch_mag[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
//#endif //#endif
} }
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
#include "defs.h" #include "defs.h"
//#define DEBUG_FEP //#define DEBUG_FEP
//#undef LOG_D
//#define LOG_D(A,B,C...) printf(B,C)
int slot_fep_ul(RU_t *ru, int slot_fep_ul(RU_t *ru,
unsigned char l, unsigned char l,
unsigned char Ns, unsigned char Ns,
...@@ -134,7 +137,7 @@ int slot_fep_ul(RU_t *ru, ...@@ -134,7 +137,7 @@ int slot_fep_ul(RU_t *ru,
} }
#ifdef DEBUG_FEP #ifdef DEBUG_FEP
LOG_D(PHY,"slot_fep: done\n"); // LOG_D(PHY,"slot_fep: done\n");
#endif #endif
return(0); return(0);
} }
...@@ -188,7 +188,7 @@ void remove_7_5_kHz(RU_t *ru,uint8_t slot) ...@@ -188,7 +188,7 @@ void remove_7_5_kHz(RU_t *ru,uint8_t slot)
} }
slot_offset = (uint32_t)slot * frame_parms->samples_per_tti/2-ru->N_TA_offset; slot_offset = ((uint32_t)slot * frame_parms->samples_per_tti/2)-ru->N_TA_offset;
slot_offset2 = (uint32_t)(slot&1) * frame_parms->samples_per_tti/2; slot_offset2 = (uint32_t)(slot&1) * frame_parms->samples_per_tti/2;
len = frame_parms->samples_per_tti/2; len = frame_parms->samples_per_tti/2;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/defs.h" #include "PHY/defs.h"
#include "common/ran_context.h"
char* namepointer_chMag ; char* namepointer_chMag ;
char fmageren_name2[512]; char fmageren_name2[512];
......
...@@ -37,6 +37,12 @@ ...@@ -37,6 +37,12 @@
#include "nfapi_interface.h" #include "nfapi_interface.h"
#include "fapi_l1.h" #include "fapi_l1.h"
/*#undef LOG_D
#define LOG_D(A,B,C...) printf(B,C)
#undef LOG_I
#define LOG_I(A,B,C...) printf(B,C)
*/
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req); int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req);
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req); int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req);
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req); int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
...@@ -190,12 +196,12 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr ...@@ -190,12 +196,12 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
eNB->pdsch_config_dedicated[UE_id].p_a = rel8->pa; eNB->pdsch_config_dedicated[UE_id].p_a = rel8->pa;
if (dlsch0->active){ if (dlsch0->active){
computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch0,dlsch0_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB); computeRhoA_eNB(rel8->pa, dlsch0,dlsch0_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB);
computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(eNB->frame_parms.pdsch_config_common),eNB->frame_parms.nb_antenna_ports_eNB,dlsch0,dlsch0_harq->dl_power_off); computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch0,dlsch0_harq->dl_power_off);
} }
if (dlsch1->active){ if (dlsch1->active){
computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch1,dlsch1_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB); computeRhoA_eNB(rel8->pa, dlsch1,dlsch1_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB);
computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(eNB->frame_parms.pdsch_config_common),eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off); computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off);
} }
dlsch0_harq->pdsch_start = eNB->pdcch_vars[subframe & 1].num_pdcch_symbols; dlsch0_harq->pdsch_start = eNB->pdcch_vars[subframe & 1].num_pdcch_symbols;
...@@ -533,11 +539,11 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, ...@@ -533,11 +539,11 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
int8_t UE_id; int8_t UE_id;
// check if we have received a dci for this ue and ulsch descriptor is configured // check if we have received a dci for this ue and ulsch descriptor is configured
if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) {
AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
"No existing UE ULSCH for rnti %x\n",rel8->rnti); "No existing UE ULSCH for rnti %x\n",rel8->rnti);
//LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d\n", UE_id,rel8->rnti,frame,subframe); LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d, modulation %d, rvidx %d\n", UE_id,rel8->rnti,frame,subframe,rel8->modulation_type,rel8->redundancy_version);
fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe); fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe);
......
...@@ -50,6 +50,11 @@ ...@@ -50,6 +50,11 @@
# include "intertask_interface.h" # include "intertask_interface.h"
#endif #endif
/*
#undef LOG_D
#define LOG_D(A,B,C...) printf(B,C)
*/
extern uint8_t nfapi_mode; extern uint8_t nfapi_mode;
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind); int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
...@@ -395,6 +400,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, ...@@ -395,6 +400,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc, eNB_rxtx_proc_t *proc,
relaying_type_t r_type, relaying_type_t r_type,
...@@ -416,7 +422,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -416,7 +422,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
int offset = eNB->CC_id;//proc == &eNB->proc.proc_rxtx[0] ? 0 : 1; int offset = eNB->CC_id;//proc == &eNB->proc.proc_rxtx[0] ? 0 : 1;
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)==SF_UL)) return; if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)==SF_UL)) return;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,1);
...@@ -429,6 +435,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -429,6 +435,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
} }
if (nfapi_mode == 0 || nfapi_mode == 1) { if (nfapi_mode == 0 || nfapi_mode == 1) {
if (is_pmch_subframe(frame,subframe,fp)) { if (is_pmch_subframe(frame,subframe,fp)) {
pmch_procedures(eNB,proc,rn,r_type); pmch_procedures(eNB,proc,rn,r_type);
...@@ -439,6 +446,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -439,6 +446,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
} }
} }
// 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,frame,subframe); ul_frame = pdcch_alloc2ul_frame(fp,frame,subframe);
...@@ -1206,7 +1214,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1206,7 +1214,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
start_meas(&eNB->ulsch_demodulation_stats); start_meas(&eNB->ulsch_demodulation_stats);
rx_ulsch(eNB,proc, i); rx_ulsch(eNB,proc, i);
stop_meas(&eNB->ulsch_demodulation_stats); stop_meas(&eNB->ulsch_demodulation_stats);
...@@ -1259,12 +1267,12 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1259,12 +1267,12 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
eNB->Mod_id,harq_pid, eNB->Mod_id,harq_pid,
frame,subframe, i, frame,subframe, i,
ulsch_harq->round-1, ulsch_harq->round,
ulsch->Mlimit, ulsch->Mlimit,
ulsch_harq->o_ACK[0], ulsch_harq->o_ACK[0],
ulsch_harq->o_ACK[1]); ulsch_harq->o_ACK[1]);
if (ulsch_harq->round >= 3) { if (ulsch_harq->round >= 4) {
ulsch_harq->status = SCH_IDLE; ulsch_harq->status = SCH_IDLE;
ulsch_harq->handled = 0; ulsch_harq->handled = 0;
ulsch->harq_mask &= ~(1 << harq_pid); ulsch->harq_mask &= ~(1 << harq_pid);
......
...@@ -73,6 +73,10 @@ ...@@ -73,6 +73,10 @@
extern double cpuf; extern double cpuf;
//#undef LOG_D
//#define LOG_D(A,B,C...) printf(B,C)
void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id); void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
void Msg3_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id); void Msg3_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
...@@ -81,7 +85,7 @@ extern uint32_t downlink_frequency[MAX_NUM_CCs][4]; ...@@ -81,7 +85,7 @@ extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
#endif #endif
#define DEBUG_UE_TRACE 1 #define UE_DEBUG_TRACE 1
void dump_dlsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid) void dump_dlsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid)
{ {
...@@ -1266,7 +1270,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt ...@@ -1266,7 +1270,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
} }
//#endif //#endif
if ((frame_tx%100) == 0) // if ((frame_tx%100) == 0)
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, timing advance %d, TA_offset %d\n", LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, timing advance %d, TA_offset %d\n",
ue->Mod_id,frame_tx,subframe_tx, ue->Mod_id,frame_tx,subframe_tx,
ulsch_start, ulsch_start,
...@@ -1288,16 +1292,25 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt ...@@ -1288,16 +1292,25 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
nsymb, nsymb,
frame_parms->nb_prefix_samples, frame_parms->nb_prefix_samples,
CYCLIC_PREFIX); CYCLIC_PREFIX);
else else {
normal_prefix_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], normal_prefix_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
dummy_tx_buffer, dummy_tx_buffer,
#else #else
&ue->common_vars.txdata[aa][ulsch_start], &ue->common_vars.txdata[aa][ulsch_start],
#endif #endif
nsymb, nsymb>>1,
&ue->frame_parms); &ue->frame_parms);
normal_prefix_mod(&ue->common_vars.txdataF[aa][((subframe_tx*nsymb)+(nsymb>>1))*frame_parms->ofdm_symbol_size],
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
dummy_tx_buffer+(frame_parms->samples_per_tti>>1),
#else
&ue->common_vars.txdata[aa][ulsch_start+(frame_parms->samples_per_tti>>1)],
#endif
nsymb>>1,
&ue->frame_parms);
}
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
apply_7_5_kHz(ue,dummy_tx_buffer,0); apply_7_5_kHz(ue,dummy_tx_buffer,0);
...@@ -1373,7 +1386,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1373,7 +1386,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
if (ue->mac_enabled==1){ if (ue->mac_enabled==1){
// ask L2 for RACH transport // ask L2 for RACH transport
if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) { if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) {
LOG_D(PHY,"Getting PRACH resources\n"); //LOG_D(PHY,"Getting PRACH resources\n");
ue->prach_resources[eNB_id] = ue_get_rach(ue->Mod_id, ue->prach_resources[eNB_id] = ue_get_rach(ue->Mod_id,
ue->CC_id, ue->CC_id,
...@@ -1590,7 +1603,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ...@@ -1590,7 +1603,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,ue->ulsch[eNB_id]->Mlimit); LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,ue->ulsch[eNB_id]->Mlimit);
if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round >= (ue->ulsch[eNB_id]->Mlimit - 1)) if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round >= (ue->ulsch[eNB_id]->Mlimit - 1))
{ {
LOG_D(PHY,"PUSCH MAX Retransmission achieved ==> send last pusch\n"); // LOG_D(PHY,"PUSCH MAX Retransmission achieved ==> send last pusch\n");
ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0; ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0; ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0;
} }
...@@ -2070,10 +2083,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -2070,10 +2083,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
(bundling_flag==bundling) || (bundling_flag==bundling) ||
((frame_parms->frame_type==TDD)&&(frame_parms->tdd_config==1)&&((subframe_tx!=2)||(subframe_tx!=7)))) { ((frame_parms->frame_type==TDD)&&(frame_parms->tdd_config==1)&&((subframe_tx!=2)||(subframe_tx!=7)))) {
format = pucch_format1a; format = pucch_format1a;
LOG_D(PHY,"[UE] PUCCH 1a\n"); // LOG_D(PHY,"[UE] PUCCH 1a\n");
} else { } else {
format = pucch_format1b; format = pucch_format1b;
LOG_D(PHY,"[UE] PUCCH 1b\n"); // LOG_D(PHY,"[UE] PUCCH 1b\n");
} }
// Part - I // Part - I
...@@ -3108,7 +3121,7 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs ...@@ -3108,7 +3121,7 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
int ret=0; int ret=0;
if (is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms)) { if (is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms)) {
LOG_D(PHY,"ue calling pmch subframe ..\n "); // LOG_D(PHY,"ue calling pmch subframe ..\n ");
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Querying for PMCH demodulation\n", LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Querying for PMCH demodulation\n",
ue->Mod_id,(subframe_rx==9?-1:0)+frame_rx,subframe_rx); ue->Mod_id,(subframe_rx==9?-1:0)+frame_rx,subframe_rx);
......
...@@ -536,9 +536,10 @@ void fep_full(RU_t *ru) { ...@@ -536,9 +536,10 @@ void fep_full(RU_t *ru) {
start_meas(&ru->ofdm_demod_stats); start_meas(&ru->ofdm_demod_stats);
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 ); if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
remove_7_5_kHz(ru,proc->subframe_rx<<1); remove_7_5_kHz(ru,proc->subframe_rx<<1);
remove_7_5_kHz(ru,1+(proc->subframe_rx<<1)); remove_7_5_kHz(ru,1+(proc->subframe_rx<<1));
for (l=0; l<fp->symbols_per_tti/2; l++) { for (l=0; l<fp->symbols_per_tti/2; l++) {
slot_fep_ul(ru, slot_fep_ul(ru,
l, l,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
frame_t frameP, uint8_t new_Msg3,
sub_frame_t subframe){ return(NULL);}
void ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
sub_frame_t subframe, uint8_t eNB_index,
uint8_t * ulsch_buffer, uint16_t buflen,
uint8_t * access_mode){}
void Msg1_transmitted(module_id_t module_idP, uint8_t CC_id,
frame_t frameP, uint8_t eNB_id){}
void Msg3_transmitted(module_id_t module_idP, uint8_t CC_id,
frame_t frameP, uint8_t eNB_id){}
uint32_t ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP,
uint8_t eNB_id, rnti_t rnti, sub_frame_t subframe){ return(0);}
void rrc_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index)
{}
UE_L2_STATE_t ue_scheduler(const module_id_t module_idP,
const frame_t rxFrameP,
const sub_frame_t rxSubframe,
const frame_t txFrameP,
const sub_frame_t txSubframe,
const lte_subframe_t direction,
const uint8_t eNB_index, const int CC_id){ return(0);}
void ue_decode_p(module_id_t module_idP, int CC_id, frame_t frame,
uint8_t CH_index, void *pdu, uint16_t len){}
void ue_decode_si(module_id_t module_idP, int CC_id, frame_t frame,
uint8_t CH_index, void *pdu, uint16_t len){}
void ue_send_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frame,
sub_frame_t subframe, uint8_t * sdu, uint16_t sdu_len,
uint8_t CH_index){}
uint16_t
ue_process_rar(const module_id_t module_idP,
const int CC_id,
const frame_t frameP,
const rnti_t ra_rnti,
uint8_t * const dlsch_buffer,
rnti_t * const t_crnti,
const uint8_t preamble_index,
uint8_t * selected_rar_buffer){ return(0);}
void ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
uint8_t * sdu, uint16_t sdu_len, uint8_t eNB_index,
uint8_t sync_area){}
int ue_query_mch(uint8_t Mod_id, uint8_t CC_id, uint32_t frame,
sub_frame_t subframe, uint8_t eNB_index,
uint8_t * sync_area, uint8_t * mcch_active){ return(0);}
void dl_phy_sync_success(module_id_t module_idP,
frame_t frameP,
unsigned char eNB_index, uint8_t first_sync){}
uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn) { return(0);}
int32_t get_uldl_offset(int eutra_bandP) { return(0);}
IF_Module_t *IF_Module_init(int Mod_id) { return(NULL);}
int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP, uint8_t CC_id) { return(0);}
int8_t get_deltaP_rampup(module_id_t module_idP, uint8_t CC_id) { return(0);}
void thread_top_init(char *thread_name,
int affinity,
uint64_t runtime,
uint64_t deadline,
uint64_t period) {}
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0);}
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
This diff is collapsed.
...@@ -294,7 +294,7 @@ void config_mib(int Mod_idP, ...@@ -294,7 +294,7 @@ void config_mib(int Mod_idP,
#ifdef Rel14 #ifdef Rel14
,cfg->emtc_config.pbch_repetitions_enable_r13.value ,cfg->emtc_config.pbch_repetitions_enable_r13.value
#endif #endif
); );
} }
void config_sib1(int Mod_idP, int CC_idP, TDD_Config_t * tdd_ConfigP) void config_sib1(int Mod_idP, int CC_idP, TDD_Config_t * tdd_ConfigP)
...@@ -435,7 +435,6 @@ config_sib2(int Mod_idP, ...@@ -435,7 +435,6 @@ config_sib2(int Mod_idP,
cfg->srs_config.srs_acknack_srs_simultaneous_transmission.value = radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission; cfg->srs_config.srs_acknack_srs_simultaneous_transmission.value = radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
cfg->srs_config.srs_acknack_srs_simultaneous_transmission.tl.tag = NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG; cfg->srs_config.srs_acknack_srs_simultaneous_transmission.tl.tag = NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG;
cfg->num_tlv++; cfg->num_tlv++;
if (radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts) { if (radioResourceConfigCommonP->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts) {
cfg->srs_config.max_up_pts.value = 1; cfg->srs_config.max_up_pts.value = 1;
...@@ -992,5 +991,3 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -992,5 +991,3 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP,
return(0); return(0);
} }
...@@ -1084,7 +1084,7 @@ typedef struct eNB_MAC_INST_s { ...@@ -1084,7 +1084,7 @@ typedef struct eNB_MAC_INST_s {
/// Prealocated TX pdu list /// Prealocated TX pdu list
nfapi_tx_request_pdu_t nfapi_tx_request_pdu_t
tx_request_pdu[MAX_NUM_CCs][MAX_NUM_TX_REQUEST_PDU]; tx_request_pdu[MAX_NUM_CCs][MAX_NUM_TX_REQUEST_PDU];
/// NFAPI DL PDU structure /// NFAPI DL PDU structuree
nfapi_tx_request_t TX_req[MAX_NUM_CCs]; nfapi_tx_request_t TX_req[MAX_NUM_CCs];
/// UL handle /// UL handle
uint32_t ul_handle; uint32_t ul_handle;
......
...@@ -818,13 +818,14 @@ l2l1_task (void *args_p) ...@@ -818,13 +818,14 @@ l2l1_task (void *args_p)
} }
*/ */
#ifdef OPENAIR2 #ifdef OPENAIR2
/*
if (eNB_l2_stats) { if (eNB_l2_stats) {
len = dump_eNB_l2_stats (stats_buffer, 0); len = dump_eNB_l2_stats (stats_buffer, 0);
rewind (eNB_l2_stats); rewind (eNB_l2_stats);
fwrite (stats_buffer, 1, len, eNB_l2_stats); fwrite (stats_buffer, 1, len, eNB_l2_stats);
fflush(eNB_l2_stats); fflush(eNB_l2_stats);
} }
*/
#endif #endif
#endif #endif
......
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