Full Support for TM4 HARQ, excpept for PUSCH precoder at this moment.

This commit is contained in:
Elena_Lukashova
2016-11-16 16:20:00 +01:00
parent 630e39aea3
commit 9c65225869
11 changed files with 1769 additions and 1619 deletions
+48 -7
View File
@@ -44,6 +44,7 @@
#include "PHY/vars.h" #include "PHY/vars.h"
#endif #endif
#include "assertions.h" #include "assertions.h"
//#define DEBUG_HARQ
//#define DEBUG_DCI //#define DEBUG_DCI
@@ -1525,7 +1526,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch1_harq->status = ACTIVE; dlsch1_harq->status = ACTIVE;
dlsch0_harq->codeword=0; dlsch0_harq->codeword=0;
dlsch1_harq->codeword=1; dlsch1_harq->codeword=1;
#ifdef DEBUG_HARQ
printf("\n ENB: BOTH ACTIVE\n"); printf("\n ENB: BOTH ACTIVE\n");
#endif
} }
else if (TB0_active && TB1_active && tbswap==1) { else if (TB0_active && TB1_active && tbswap==1) {
dlsch0=dlsch[0]; dlsch0=dlsch[0];
@@ -1564,7 +1567,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch1_harq->codeword = 0; dlsch1_harq->codeword = 0;
dlsch0=NULL; dlsch0=NULL;
dlsch0_harq = NULL; dlsch0_harq = NULL;
#ifdef DEBUG_HARQ
printf("\n ENB: TB0 is deactivated, retransmit TB1 transmit in TM6\n"); printf("\n ENB: TB0 is deactivated, retransmit TB1 transmit in TM6\n");
#endif
} }
if (dlsch0 != NULL){ if (dlsch0 != NULL){
@@ -2800,8 +2805,15 @@ int generate_eNB_dlsch_params_from_dci(int frame,
#endif #endif
// compute DL power control parameters // compute DL power control parameters
if (dlsch0 != NULL){
computeRhoA_eNB(pdsch_config_dedicated, dlsch[0],dlsch0_harq->dl_power_off, frame_parms->nb_antennas_tx_eNB); computeRhoA_eNB(pdsch_config_dedicated, dlsch[0],dlsch0_harq->dl_power_off, frame_parms->nb_antennas_tx_eNB);
computeRhoB_eNB(pdsch_config_dedicated,&(frame_parms->pdsch_config_common),frame_parms->nb_antennas_tx_eNB,dlsch[0],dlsch0_harq->dl_power_off); computeRhoB_eNB(pdsch_config_dedicated,&(frame_parms->pdsch_config_common),frame_parms->nb_antennas_tx_eNB,dlsch[0],dlsch0_harq->dl_power_off);
}
if (dlsch1 != NULL){
computeRhoA_eNB(pdsch_config_dedicated, dlsch[1],dlsch1_harq->dl_power_off, frame_parms->nb_antennas_tx_eNB);
computeRhoB_eNB(pdsch_config_dedicated,&(frame_parms->pdsch_config_common),frame_parms->nb_antennas_tx_eNB,dlsch[1],dlsch1_harq->dl_power_off);
}
return(0); return(0);
} }
@@ -4879,6 +4891,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
if ((rv2 == 1) && (mcs2 == 0)) { if ((rv2 == 1) && (mcs2 == 0)) {
TB1_active=0; TB1_active=0;
} }
#ifdef DEBUG_HARQ
printf("[DCI UE]: TB0 status %d , TB1 status %d\n", TB0_active, TB1_active);
#endif
//printf("RV TB0 = %d\n", rv1); //printf("RV TB0 = %d\n", rv1);
@@ -4898,7 +4913,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch1_harq->status = ACTIVE; dlsch1_harq->status = ACTIVE;
dlsch0_harq->codeword=0; dlsch0_harq->codeword=0;
dlsch1_harq->codeword=1; dlsch1_harq->codeword=1;
//printf("\n UE: BOTH ACTIVE\n"); #ifdef DEBUG_HARQ
printf("[DCI UE]: BOTH ACTIVE\n");
#endif
} }
else if (TB0_active && TB1_active && tbswap==1) { else if (TB0_active && TB1_active && tbswap==1) {
dlsch0=dlsch[0]; dlsch0=dlsch[0];
@@ -4937,7 +4954,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch1_harq->codeword = 0; dlsch1_harq->codeword = 0;
dlsch0=NULL; dlsch0=NULL;
dlsch0_harq = NULL; dlsch0_harq = NULL;
//printf("\n UE: TB0 is deactivated, retransmit TB1 transmit in TM6\n"); #ifdef DEBUG_HARQ
printf("[DCI UE]: TB0 is deactivated, retransmit TB1 transmit in TM6\n");
#endif
} }
@@ -4990,7 +5009,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch1_harq->rb_alloc_odd[1]= dlsch1_harq->rb_alloc_even[1]; dlsch1_harq->rb_alloc_odd[1]= dlsch1_harq->rb_alloc_even[1];
dlsch1_harq->rb_alloc_odd[2]= dlsch1_harq->rb_alloc_even[2]; dlsch1_harq->rb_alloc_odd[2]= dlsch1_harq->rb_alloc_even[2];
dlsch1_harq->rb_alloc_odd[3]= dlsch1_harq->rb_alloc_even[3]; dlsch1_harq->rb_alloc_odd[3]= dlsch1_harq->rb_alloc_even[3];
dlsch1_harq->nb_rb = dlsch0_harq->nb_rb; dlsch1_harq->nb_rb = conv_nprb(rah,
rballoc,
frame_parms->N_RB_DL);
} }
@@ -5010,6 +5031,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
if (dlsch1_harq != NULL) if (dlsch1_harq != NULL)
dlsch1_harq->Nl = 1; dlsch1_harq->Nl = 1;
#ifdef DEBUG_HARQ
printf ("[DCI UE] tpmi = %d\n", tpmi);
#endif
if ((dlsch0 != NULL) && (dlsch1 != NULL)){ //two CW active if ((dlsch0 != NULL) && (dlsch1 != NULL)){ //two CW active
@@ -5112,7 +5136,10 @@ int generate_ue_dlsch_params_from_dci(int frame,
break; break;
} }
} }
#ifdef DEBUG_HARQ
printf("[DCI UE] harq1 MIMO mode = %d\n", dlsch1_harq->mimo_mode);
#endif
//printf(" UE DCI harq0 MIMO mode = %d\n", dlsch0_harq->mimo_mode);
if ((frame_parms->mode1_flag == 1) && (dlsch0_harq != NULL)) if ((frame_parms->mode1_flag == 1) && (dlsch0_harq != NULL))
dlsch0_harq->mimo_mode = SISO; dlsch0_harq->mimo_mode = SISO;
@@ -5196,6 +5223,12 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch1->rnti = rnti; dlsch1->rnti = rnti;
} }
#ifdef DEBUG_HARQ
if (dlsch0 != NULL)
printf("[DCI UE] dlsch0_harq status = %d, dlsch1_harq status = %d\n", dlsch0_harq->status, dlsch1_harq->status);
else
printf("[DCI UE] dlsch1_harq status = %d\n", dlsch1_harq->status);
#endif
break; break;
@@ -5869,11 +5902,19 @@ int generate_ue_dlsch_params_from_dci(int frame,
} }
#endif #endif
dlsch[0]->active=1; //dlsch[0]->active=1;
// compute DL power control parameters // compute DL power control parameters
computeRhoA_UE(pdsch_config_dedicated, dlsch[0],dlsch0_harq->dl_power_off, frame_parms->nb_antennas_tx_eNB); if (dlsch0_harq != NULL){
computeRhoB_UE(pdsch_config_dedicated,&(frame_parms->pdsch_config_common),frame_parms->nb_antennas_tx_eNB,dlsch[0],dlsch0_harq->dl_power_off); computeRhoA_UE(pdsch_config_dedicated, dlsch[0],dlsch0_harq->dl_power_off, frame_parms->nb_antennas_tx_eNB);
computeRhoB_UE(pdsch_config_dedicated,&(frame_parms->pdsch_config_common),frame_parms->nb_antennas_tx_eNB,dlsch[0],dlsch0_harq->dl_power_off);
}
if (dlsch1_harq != NULL) {
computeRhoA_UE(pdsch_config_dedicated, dlsch[1],dlsch1_harq->dl_power_off, frame_parms->nb_antennas_tx_eNB);
computeRhoB_UE(pdsch_config_dedicated,&(frame_parms->pdsch_config_common),frame_parms->nb_antennas_tx_eNB,dlsch[1],dlsch1_harq->dl_power_off);
}
return(0); return(0);
} }
+722 -697
View File
File diff suppressed because it is too large Load Diff
+32 -8
View File
@@ -156,7 +156,7 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t *x0 = NULL; //dlsch0_harq->e; uint8_t *x0 = NULL; //dlsch0_harq->e;
MIMO_mode_t mimo_mode = dlsch0_harq->mimo_mode; MIMO_mode_t mimo_mode;//= dlsch0_harq->mimo_mode;
int first_layer0; //= dlsch0_harq->first_layer; int first_layer0; //= dlsch0_harq->first_layer;
int Nlayers0; // = dlsch0_harq->Nlayers; int Nlayers0; // = dlsch0_harq->Nlayers;
@@ -1411,8 +1411,13 @@ int dlsch_modulation(int32_t **txdataF,
nsymb = (frame_parms->Ncp==0) ? 14:12; nsymb = (frame_parms->Ncp==0) ? 14:12;
if (dlsch0 != NULL){
amp_rho_a = (int16_t)(((int32_t)amp*dlsch0->sqrt_rho_a)>>13); //amp=512 in full scale; dlsch0->sqrt_rho_a=8192in Q2.13, 1 in full scale amp_rho_a = (int16_t)(((int32_t)amp*dlsch0->sqrt_rho_a)>>13); //amp=512 in full scale; dlsch0->sqrt_rho_a=8192in Q2.13, 1 in full scale
amp_rho_b = (int16_t)(((int32_t)amp*dlsch0->sqrt_rho_b)>>13); amp_rho_b = (int16_t)(((int32_t)amp*dlsch0->sqrt_rho_b)>>13);
} else{
amp_rho_a = (int16_t)(((int32_t)amp*dlsch1->sqrt_rho_a)>>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++) {
@@ -1445,6 +1450,7 @@ int dlsch_modulation(int32_t **txdataF,
// printf("num_pdcch_symbols %d, nsymb %d\n",num_pdcch_symbols,nsymb); // printf("num_pdcch_symbols %d, nsymb %d\n",num_pdcch_symbols,nsymb);
for (l=num_pdcch_symbols; l<nsymb; l++) { for (l=num_pdcch_symbols; l<nsymb; l++) {
if (dlsch0 != NULL ) {
#ifdef DEBUG_DLSCH_MODULATION #ifdef DEBUG_DLSCH_MODULATION
printf("Generating DLSCH (harq_pid %d,mimo %d, pmi_alloc0 %lx, mod0 %d, mod1 %d, rb_alloc[0] %d) in %d\n", printf("Generating DLSCH (harq_pid %d,mimo %d, pmi_alloc0 %lx, mod0 %d, mod1 %d, rb_alloc[0] %d) in %d\n",
harq_pid, harq_pid,
@@ -1455,6 +1461,7 @@ int dlsch_modulation(int32_t **txdataF,
rb_alloc[0], rb_alloc[0],
len); len);
#endif #endif
}
if (frame_parms->Ncp==0) { // normal prefix if (frame_parms->Ncp==0) { // normal prefix
if ((l==4)||(l==11)) if ((l==4)||(l==11))
@@ -1611,9 +1618,11 @@ int dlsch_modulation(int32_t **txdataF,
} }
} }
if (dlsch0_harq->Nlayers>1) { if (dlsch0) {
msg("Nlayers %d: re_offset %d, symbol %d offset %d\n",dlsch0_harq->Nlayers,re_offset,l,symbol_offset); if (dlsch0_harq->Nlayers>1) {
return(-1); msg("Nlayers %d: re_offset %d, symbol %d offset %d\n",dlsch0_harq->Nlayers,re_offset,l,symbol_offset);
return(-1);
}
} }
if (dlsch1) { if (dlsch1) {
@@ -1639,6 +1648,17 @@ int dlsch_modulation(int32_t **txdataF,
if (rb_alloc_ind > 0) { if (rb_alloc_ind > 0) {
// printf("Allocated rb %d/symbol %d, skip_half %d, subframe_offset %d, symbol_offset %d, re_offset %d, jj %d\n",rb,l,skip_half,subframe_offset,symbol_offset,re_offset,jj); // printf("Allocated rb %d/symbol %d, skip_half %d, subframe_offset %d, symbol_offset %d, re_offset %d, jj %d\n",rb,l,skip_half,subframe_offset,symbol_offset,re_offset,jj);
if (dlsch0 != NULL) {
get_pmi_temp = get_pmi(frame_parms->N_RB_DL,
dlsch0->harq_processes[harq_pid]->mimo_mode,
dlsch0->harq_processes[harq_pid]->pmi_alloc,
rb);
} else
get_pmi_temp = get_pmi(frame_parms->N_RB_DL,
dlsch1->harq_processes[harq_pid]->mimo_mode,
dlsch1->harq_processes[harq_pid]->pmi_alloc,
rb);
allocate_REs_in_RB(frame_parms, allocate_REs_in_RB(frame_parms,
txdataF, txdataF,
@@ -1646,11 +1666,11 @@ int dlsch_modulation(int32_t **txdataF,
&jj2, &jj2,
re_offset, re_offset,
symbol_offset, symbol_offset,
dlsch0->harq_processes[harq_pid], (dlsch0 == NULL) ? NULL : dlsch0->harq_processes[harq_pid],
(dlsch1==NULL) ? NULL : dlsch1->harq_processes[harq_pid], (dlsch1 == NULL) ? NULL : dlsch1->harq_processes[harq_pid],
pilots, pilots,
((pilots) ? amp_rho_b : amp_rho_a), ((pilots) ? amp_rho_b : amp_rho_a),
get_pmi(frame_parms->N_RB_DL,dlsch0->harq_processes[harq_pid]->mimo_mode,dlsch0->harq_processes[harq_pid]->pmi_alloc,rb), get_pmi_temp,
qam_table_s0, qam_table_s0,
qam_table_s1, qam_table_s1,
&re_allocated, &re_allocated,
@@ -1672,7 +1692,11 @@ int dlsch_modulation(int32_t **txdataF,
} }
#ifdef DEBUG_DLSCH_MODULATION #ifdef DEBUG_DLSCH_MODULATION
msg("generate_dlsch : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch0_harq->nb_rb,dlsch0_harq->rb_alloc,mod_order0,Nl0,2,0,subframe_offset)); if (dlsch0 != NULL){
msg("generate_dlsch : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch0_harq->nb_rb,dlsch0_harq->rb_alloc,mod_order0,Nl0,2,0,subframe_offset));
}else{
msg("generate_dlsch : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch1_harq->nb_rb,dlsch1_harq->rb_alloc,mod_order1,Nl1,2,0,subframe_offset));
}
#endif #endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, VCD_FUNCTION_OUT);
+24 -24
View File
@@ -34,9 +34,9 @@
double ratioPB[2][4]={{ 1.0,4.0/5.0,3.0/5.0,2.0/5.0}, double ratioPB[2][4]={{ 1.0,4.0/5.0,3.0/5.0,2.0/5.0},
{ 5.0/4.0,1.0,3.0/4.0,1.0/2.0}}; { 5.0/4.0,1.0,3.0/4.0,1.0/2.0}};
*/ */
double ratioPB[2][4]={{ 0.00000, -0.96910, -2.21849, -3.97940}, //in db double ratioPB[2][4]={{ 0.00000, -0.96910, -2.21849, -3.97940}, //in db
{ 0.96910, 0.00000, -1.24939, -3.01030}}; { 0.96910, 0.00000, -1.24939, -3.01030}};
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
@@ -45,21 +45,21 @@ double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated)
return(pa_values[pdsch_config_dedicated->p_a]); return(pa_values[pdsch_config_dedicated->p_a]);
} }
double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
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 = pa_values[ pdsch_config_dedicated->p_a]; rho_a_dB = pa_values[ pdsch_config_dedicated->p_a];
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);
if(n_antenna_port==4) // see TS 36.213 Section 5.2 if(n_antenna_port==4) // see TS 36.213 Section 5.2
rho_a_dB=+10*log10(2); rho_a_dB=+10*log10(2);
sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB)); sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB));
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
@@ -78,9 +78,9 @@ 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); rho_a_dB= computeRhoA_eNB(pdsch_config_dedicated,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][pdsch_config_common->p_b] + rho_a_dB;
else else
@@ -99,24 +99,24 @@ double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
LTE_UE_DLSCH_t *dlsch_ue, LTE_UE_DLSCH_t *dlsch_ue,
unsigned char dl_power_off, unsigned char dl_power_off,
uint8_t n_antenna_port 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 = pa_values[ pdsch_config_dedicated->p_a]; rho_a_dB = pa_values[ 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);
//if dl_power_offset is 0, this is for MU-interference, TM5. But in practice UE may assume 16 or 64QAM TM4 as multiuser //if dl_power_offset is 0, this is for MU-interference, TM5. But in practice UE may assume 16 or 64QAM TM4 as multiuser
if(n_antenna_port==4) // see TS 36.213 Section 5.2 if(n_antenna_port==4) // see TS 36.213 Section 5.2
rho_a_dB=+10*log10(2); rho_a_dB=+10*log10(2);
sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB)); sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB));
dlsch_ue->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13)); dlsch_ue->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13));
#ifdef DEBUG_PC #ifdef DEBUG_PC
@@ -135,9 +135,9 @@ double computeRhoB_UE(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_UE(pdsch_config_dedicated,dlsch_ue,dl_power_off, n_antenna_port); rho_a_dB= computeRhoA_UE(pdsch_config_dedicated,dlsch_ue,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][pdsch_config_common->p_b] + rho_a_dB;
else else
+93 -92
View File
@@ -217,7 +217,7 @@ int32_t dlsch_modulation_SIC(int32_t **sic_buffer,
uint8_t num_pdcch_symbols, uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch0, LTE_eNB_DLSCH_t *dlsch0,
LTE_eNB_DLSCH_t *dlsch1, LTE_eNB_DLSCH_t *dlsch1,
int G); int G);
/* /*
\brief This function is the top-level routine for generation of the sub-frame signal (frequency-domain) for MCH. \brief This function is the top-level routine for generation of the sub-frame signal (frequency-domain) for MCH.
@param txdataF Table of pointers for frequency-domain TX signals @param txdataF Table of pointers for frequency-domain TX signals
@@ -720,15 +720,15 @@ int32_t dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
int **rxdataF_comp, int **rxdataF_comp,
int32_t **sic_buffer, int32_t **sic_buffer,
int **rho_i, int **rho_i,
short *dlsch_llr, short *dlsch_llr,
uint8_t num_pdcch_symbols, uint8_t num_pdcch_symbols,
uint16_t nb_rb, uint16_t nb_rb,
uint8_t subframe, uint8_t subframe,
uint32_t rb_alloc, uint32_t rb_alloc,
uint16_t mod_order_0, uint16_t mod_order_0,
LTE_UE_DLSCH_t *dlsch0); LTE_UE_DLSCH_t *dlsch0);
void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms, void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t **rxdataF_comp,
@@ -753,30 +753,30 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
*/ */
void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t **rxdataF_comp,
int32_t **sic_buffer, //Q15 int32_t **sic_buffer, //Q15
int32_t **rho_i, int32_t **rho_i,
int16_t *dlsch_llr, int16_t *dlsch_llr,
uint8_t num_pdcch_symbols, uint8_t num_pdcch_symbols,
int32_t **dl_ch_mag, int32_t **dl_ch_mag,
uint16_t nb_rb, uint16_t nb_rb,
uint8_t subframe, uint8_t subframe,
uint32_t rb_alloc, uint32_t rb_alloc,
uint16_t mod_order_0, uint16_t mod_order_0,
LTE_UE_DLSCH_t *dlsch0); LTE_UE_DLSCH_t *dlsch0);
void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t **rxdataF_comp,
int32_t **sic_buffer, //Q15 int32_t **sic_buffer, //Q15
int32_t **rho_i, int32_t **rho_i,
int16_t *dlsch_llr, int16_t *dlsch_llr,
uint8_t num_pdcch_symbols, uint8_t num_pdcch_symbols,
int32_t **dl_ch_mag, int32_t **dl_ch_mag,
int32_t **dl_ch_magb, int32_t **dl_ch_magb,
uint16_t nb_rb, uint16_t nb_rb,
uint8_t subframe, uint8_t subframe,
uint32_t rb_alloc, uint32_t rb_alloc,
uint16_t mod_order_0, uint16_t mod_order_0,
LTE_UE_DLSCH_t *dlsch0); LTE_UE_DLSCH_t *dlsch0);
void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
@@ -889,12 +889,12 @@ void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t dual_stream_UE); uint8_t dual_stream_UE);
void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms, void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms,
LTE_UE_PDSCH *lte_ue_pdsch_vars, LTE_UE_PDSCH *lte_ue_pdsch_vars,
int harq_pid, int harq_pid,
int round, int round,
unsigned char symbol, unsigned char symbol,
unsigned short nb_rb, unsigned short nb_rb,
unsigned char dual_stream_UE); unsigned char dual_stream_UE);
/** \fn dlsch_extract_rbs_single(int32_t **rxdataF, /** \fn dlsch_extract_rbs_single(int32_t **rxdataF,
int32_t **dl_ch_estimates, int32_t **dl_ch_estimates,
@@ -966,8 +966,8 @@ uint16_t dlsch_extract_rbs_dual(int32_t **rxdataF,
uint8_t symbol, uint8_t symbol,
uint8_t subframe, uint8_t subframe,
uint32_t high_speed_flag, uint32_t high_speed_flag,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
MIMO_mode_t mimo_mode); MIMO_mode_t mimo_mode);
/** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation) /** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation)
@param rxdataF_ext Frequency-domain received signal in RBs to be demodulated @param rxdataF_ext Frequency-domain received signal in RBs to be demodulated
@@ -1013,7 +1013,7 @@ void dlsch_dual_stream_correlationTM34(LTE_DL_FRAME_PARMS *frame_parms,
int **dl_ch_estimates_ext_i, int **dl_ch_estimates_ext_i,
int **dl_ch_rho_ext, int **dl_ch_rho_ext,
unsigned char output_shift0, unsigned char output_shift0,
unsigned char output_shift1); unsigned char output_shift1);
void dlsch_channel_compensation_TM56(int **rxdataF_ext, void dlsch_channel_compensation_TM56(int **rxdataF_ext,
int **dl_ch_estimates_ext, int **dl_ch_estimates_ext,
@@ -1032,18 +1032,18 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms, void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
LTE_UE_PDSCH *lte_ue_pdsch_vars, LTE_UE_PDSCH *lte_ue_pdsch_vars,
PHY_MEASUREMENTS *phy_measurements, PHY_MEASUREMENTS *phy_measurements,
int eNB_id, int eNB_id,
unsigned char symbol, unsigned char symbol,
unsigned char mod_order0, unsigned char mod_order0,
unsigned char mod_order1, unsigned char mod_order1,
int harq_pid, int harq_pid,
int round, int round,
MIMO_mode_t mimo_mode, MIMO_mode_t mimo_mode,
unsigned short nb_rb, unsigned short nb_rb,
unsigned char output_shift0, unsigned char output_shift0,
unsigned char output_shift1); unsigned char output_shift1);
/** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal /** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal
@@ -1061,13 +1061,13 @@ void dlsch_channel_level(int32_t **dl_ch_estimates_ext,
void dlsch_channel_level_TM34(int **dl_ch_estimates_ext, void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
unsigned char *pmi_ext, unsigned char *pmi_ext,
int *avg_0, int *avg_0,
int *avg_1, int *avg_1,
uint8_t symbol, uint8_t symbol,
unsigned short nb_rb, unsigned short nb_rb,
MIMO_mode_t mimo_mode); MIMO_mode_t mimo_mode);
void dlsch_channel_level_TM56(int32_t **dl_ch_estimates_ext, void dlsch_channel_level_TM56(int32_t **dl_ch_estimates_ext,
@@ -1121,7 +1121,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
- RE extraction (pilot, PBCH, synch. signals) - RE extraction (pilot, PBCH, synch. signals)
- antenna combining (MRC, Alamouti, cycling) - antenna combining (MRC, Alamouti, cycling)
- LLR computation - LLR computation
This function supports TM1, 2, 3, 5, and 6. This function supports TM1, 2, 3, 5, and 6.
@param phy_vars_ue Pointer to PHY variables @param phy_vars_ue Pointer to PHY variables
@param type Type of PDSCH (SI_PDSCH,RA_PDSCH,PDSCH,PMCH) @param type Type of PDSCH (SI_PDSCH,RA_PDSCH,PDSCH,PMCH)
@param eNB_id eNb index (Nid1) 0,1,2 @param eNB_id eNb index (Nid1) 0,1,2
@@ -1129,19 +1129,19 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
@param subframe Subframe number @param subframe Subframe number
@param symbol Symbol on which to act (within sub-frame) @param symbol Symbol on which to act (within sub-frame)
@param first_symbol_flag set to 1 on first DLSCH symbol @param first_symbol_flag set to 1 on first DLSCH symbol
@param rx_type. rx_type=RX_IC_single_stream will enable interference cancellation of a second stream when decoding the first stream. In case of TM1, 2, 5, and this can cancel interference from a neighbouring cell given by eNB_id_i. In case of TM5, eNB_id_i should be set to n_connected_eNB to perform multi-user interference cancellation. In case of TM3, eNB_id_i should be set to eNB_id to perform co-channel interference cancellation; this option should be used together with an interference cancellation step [...]. In case of TM3, if rx_type=RX_IC_dual_stream, both streams will be decoded by applying the IC single stream receiver twice. @param rx_type. rx_type=RX_IC_single_stream will enable interference cancellation of a second stream when decoding the first stream. In case of TM1, 2, 5, and this can cancel interference from a neighbouring cell given by eNB_id_i. In case of TM5, eNB_id_i should be set to n_connected_eNB to perform multi-user interference cancellation. In case of TM3, eNB_id_i should be set to eNB_id to perform co-channel interference cancellation; this option should be used together with an interference cancellation step [...]. In case of TM3, if rx_type=RX_IC_dual_stream, both streams will be decoded by applying the IC single stream receiver twice.
@param i_mod Modulation order of the interfering stream @param i_mod Modulation order of the interfering stream
*/ */
int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue, int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue,
PDSCH_t type, PDSCH_t type,
uint8_t eNB_id, uint8_t eNB_id,
uint8_t eNB_id_i, uint8_t eNB_id_i,
uint8_t subframe, uint8_t subframe,
uint8_t symbol, uint8_t symbol,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
RX_type_t rx_type, RX_type_t rx_type,
uint8_t i_mod, uint8_t i_mod,
uint8_t harq_pid); uint8_t harq_pid);
int32_t rx_pdcch(LTE_UE_COMMON *lte_ue_common_vars, int32_t rx_pdcch(LTE_UE_COMMON *lte_ue_common_vars,
LTE_UE_PDCCH **lte_ue_pdcch_vars, LTE_UE_PDCCH **lte_ue_pdcch_vars,
@@ -1322,7 +1322,7 @@ uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb);
*/ */
uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap); uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap);
/* \brief Return prb for a given vrb index /* \brief Return prb for a given vrb index
@param vrb_type VRB type (0=localized,1=distributed) @param vrb_type VRB type (0=localized,1=distributed)
@param rb_alloc_dci rballoc field from DCI @param rb_alloc_dci rballoc field from DCI
*/ */
@@ -1437,7 +1437,7 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame,uint8_t
uint8_t subframe2harq_pid_eNBrx(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe); uint8_t subframe2harq_pid_eNBrx(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
int generate_ue_dlsch_params_from_dci(int frame, int generate_ue_dlsch_params_from_dci(int frame,
uint8_t subframe, uint8_t subframe,
void *dci_pdu, void *dci_pdu,
rnti_t rnti, rnti_t rnti,
DCI_format_t dci_format, DCI_format_t dci_format,
@@ -1676,7 +1676,7 @@ uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
/** \brief This routine expands a single (wideband) PMI to subband PMI bitmap similar to the one used in the UCI and in the dlsch_modulation routine /** \brief This routine expands a single (wideband) PMI to subband PMI bitmap similar to the one used in the UCI and in the dlsch_modulation routine
@param frame_parms Pointer to DL frame configuration parameters @param frame_parms Pointer to DL frame configuration parameters
@param wideband_pmi (0,1,2,3 for rank 0 and 0,1 for rank 1) @param wideband_pmi (0,1,2,3 for rank 0 and 0,1 for rank 1)
@param rank (0 or 1) @param rank (0 or 1)
@returns subband PMI bitmap @returns subband PMI bitmap
*/ */
@@ -1684,7 +1684,7 @@ uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi, uint8_
/** \brief This routine extracts a single subband PMI from a bitmap coming from UCI or the pmi_extend function /** \brief This routine extracts a single subband PMI from a bitmap coming from UCI or the pmi_extend function
@param N_RB_DL number of resource blocks @param N_RB_DL number of resource blocks
@param mimo_mode @param mimo_mode
@param pmi_alloc subband PMI bitmap @param pmi_alloc subband PMI bitmap
@param rb resource block for which to extract PMI @param rb resource block for which to extract PMI
@returns subband PMI @returns subband PMI
@@ -1692,11 +1692,11 @@ uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi, uint8_
uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb); uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb);
int get_nCCE_offset_l1(int *CCE_table, int get_nCCE_offset_l1(int *CCE_table,
const unsigned char L, const unsigned char L,
const int nCCE, const int nCCE,
const int common_dci, const int common_dci,
const unsigned short rnti, const unsigned short rnti,
const unsigned char subframe); const unsigned char subframe);
uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi); uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi);
@@ -1758,22 +1758,22 @@ void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
PUCCH_FMT_t fmt, PUCCH_FMT_t fmt,
uint8_t UE_id, uint8_t UE_id,
uint16_t n1_pucch, uint16_t n1_pucch,
uint16_t n2_pucch, uint16_t n2_pucch,
uint8_t shortened_format, uint8_t shortened_format,
uint8_t *payload, uint8_t *payload,
int frame, int frame,
uint8_t subframe, uint8_t subframe,
uint8_t pucch1_thres); uint8_t pucch1_thres);
int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB, int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t UE_index, uint8_t UE_index,
PUCCH_FMT_t fmt, PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel, uint8_t n1_pucch_sel,
uint8_t *payload, uint8_t *payload,
uint8_t subframe); uint8_t subframe);
/*! /*!
@@ -1865,18 +1865,19 @@ double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated);
double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
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(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
PDSCH_CONFIG_COMMON *pdsch_config_common, PDSCH_CONFIG_COMMON *pdsch_config_common,
uint8_t n_antenna_port, uint8_t n_antenna_port,
LTE_eNB_DLSCH_t *dlsch_eNB,int dl_power_off); LTE_eNB_DLSCH_t *dlsch_eNB,
int dl_power_off);
double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
LTE_UE_DLSCH_t *dlsch_ue, LTE_UE_DLSCH_t *dlsch_ue,
uint8_t dl_power_off, uint8_t dl_power_off,
uint8_t n_antenna_port); uint8_t n_antenna_port);
double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
PDSCH_CONFIG_COMMON *pdsch_config_common, PDSCH_CONFIG_COMMON *pdsch_config_common,
@@ -1890,7 +1891,7 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
LTE_UE_DLSCH_t *dlsch_ue); LTE_UE_DLSCH_t *dlsch_ue);
*/ */
uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms, uint8_t tdd_mapindex, uint16_t Nf); uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms, uint8_t tdd_mapindex, uint16_t Nf);
uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n); uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
+1 -1
View File
@@ -387,7 +387,7 @@ typedef struct PHY_VARS_eNB_s {
#ifdef LOCALIZATION #ifdef LOCALIZATION
/// time state for localization /// time state for localization
time_stats_t localization_stats; time_stats_t localization_stats;
#endif #endif
int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10]; int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10];
int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024]; int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024];
+1 -1
View File
@@ -793,7 +793,7 @@ typedef struct {
/// - first index: ? [0..7] (hard coded) accessed via \c harq_pid /// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
/// - second index: ? [0..7] (hard coded) accessed via \c round /// - second index: ? [0..7] (hard coded) accessed via \c round
/// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - fourth index: ? [0..168*N_RB_DL[ /// - fourth index: ? [0..168*N_RB_DL[
int32_t **rxdataF_comp1[8][8]; int32_t **rxdataF_comp1[8][8];
/// \brief Downlink channel estimates extracted in PRBS. /// \brief Downlink channel estimates extracted in PRBS.
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+13 -12
View File
@@ -46,7 +46,7 @@ static unsigned int seed, iy, ir[98];
#define a 1664525lu #define a 1664525lu
#define mod 4294967296.0 /* is 2**32 */ #define mod 4294967296.0 /* is 2**32 */
#if 1
void randominit(unsigned seed_init) void randominit(unsigned seed_init)
{ {
int i; int i;
@@ -69,17 +69,18 @@ void randominit(unsigned seed_init)
} }
iy=1; iy=1;
} }
#endif
#if 0
/*void randominit(unsigned seed_init) void randominit(unsigned seed_init)
{ {
int i; int i;
// this need to be integrated with the existing rng, like taus: navid // this need to be integrated with the existing rng, like taus: navid
msg("Initializing random number generator, seed %x\n",seed_init); msg("Initializing random number generator, seed %x\n",seed_init);
seed_init = 62110; seed_init = 62110;
if (seed_init == 0) { if (seed_init == 0) {
srand((unsigned)time(NULL)); srand((unsigned)time(NULL));
@@ -90,14 +91,14 @@ void randominit(unsigned seed_init)
if (seed % 2 == 0) seed += 1; /* seed and mod are relative prime */ if (seed % 2 == 0) seed += 1; /* seed and mod are relative prime */
// for (i=1; i<=97; i++) { for (i=1; i<=97; i++) {
// seed = a*seed; /* mod 2**32 */ seed = a*seed; /* mod 2**32 */
// ir[i]= seed; /* initialize the shuffle table */ ir[i]= seed; /* initialize the shuffle table */
// } }
// iy=1;
//}
iy=1;
}
#endif
/*!\brief Uniform linear congruential random number generator on \f$[0,1)\f$. Returns a double-precision floating-point number.*/ /*!\brief Uniform linear congruential random number generator on \f$[0,1)\f$. Returns a double-precision floating-point number.*/
double uniformrandom(void) double uniformrandom(void)
+17 -16
View File
@@ -58,7 +58,7 @@ unsigned int taus(void)
s2 = (((s2 & 0xFFFFFFF0) << 17)^ b); s2 = (((s2 & 0xFFFFFFF0) << 17)^ b);
return s0 ^ s1 ^ s2; return s0 ^ s1 ^ s2;
} }
#if 1
void set_taus_seed(unsigned int seed_init) void set_taus_seed(unsigned int seed_init)
{ {
@@ -87,9 +87,11 @@ void set_taus_seed(unsigned int seed_init)
s2 = result; s2 = result;
#endif #endif
} }
} }
#endif
/* void set_taus_seed(unsigned int seed_init)
#if 0
void set_taus_seed(unsigned int seed_init)
{ {
#ifdef USER_MODE #ifdef USER_MODE
@@ -113,18 +115,17 @@ void set_taus_seed(unsigned int seed_init)
s2 = (unsigned int)0xfe1a133e; s2 = (unsigned int)0xfe1a133e;
#else #else
// Use reentrant version of rand48 to ensure that no conflicts with other generators occur */ // Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
// srand48_r((long int)seed_init, &buffer); srand48_r((long int)seed_init, &buffer);
// mrand48_r(&buffer, (long int *)&result); mrand48_r(&buffer, (long int *)&result);
// s0 = result; s0 = result;
// mrand48_r(&buffer, (long int *)&result); mrand48_r(&buffer, (long int *)&result);
// s1 = result; s1 = result;
// mrand48_r(&buffer, (long int *)&result); mrand48_r(&buffer, (long int *)&result);
// s2 = result; s2 = result;
//#endif #endif
// } }
//} }
#endif
#ifdef MAIN #ifdef MAIN