Commit 857fd74e authored by Florian Kaltenberger's avatar Florian Kaltenberger

commiting changes from svn branch SIC-receiver from revision 6836 to 7896...

commiting changes from svn branch SIC-receiver from revision 6836 to 7896 (current svn head). See svn log for details.
parent 89dc3c55
...@@ -882,33 +882,31 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS ...@@ -882,33 +882,31 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
pdsch->pmi_ext = (uint8_t*)malloc16_clear( frame_parms->N_RB_DL ); pdsch->pmi_ext = (uint8_t*)malloc16_clear( frame_parms->N_RB_DL );
pdsch->llr[0] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); pdsch->llr[0] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
pdsch->llr128 = (int16_t**)malloc16_clear( sizeof(int16_t*) ); pdsch->llr128 = (int16_t**)malloc16_clear( sizeof(int16_t*) );
pdsch->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) );
// FIXME! no further allocation for (int16_t*)pdsch->llr128 !!! expect SIGSEGV // FIXME! no further allocation for (int16_t*)pdsch->llr128 !!! expect SIGSEGV
// FK, 11-3-2015: this is only as a temporary pointer, no memory is stored there
pdsch->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rxdataF_comp0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->rxdataF_comp0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rho = (int32_t**)malloc16_clear( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
pdsch->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_mag0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->dl_ch_mag0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_magb0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->dl_ch_magb0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
// the allocated memory size is fixed: // the allocated memory size is fixed:
AssertFatal( frame_parms->nb_antennas_rx <= 2, "nb_antennas_rx > 2" ); AssertFatal( frame_parms->nb_antennas_rx <= 2, "nb_antennas_rx > 2" );
for (int i=0; i<frame_parms->nb_antennas_rx; i++) { for (int i=0; i<frame_parms->nb_antennas_rx; i++) {
pdsch->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*7*2) );
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++) for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
const int idx = (j<<1)+i; const int idx = (j<<1)+i;
const size_t num = 7*2*frame_parms->N_RB_DL*12; const size_t num = 7*2*frame_parms->N_RB_DL*12+4;
pdsch->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->rxdataF_comp0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->rxdataF_comp0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_mag0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_mag0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_magb0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_magb0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
} }
} }
} }
...@@ -943,7 +941,7 @@ void phy_init_lte_ue__PDSCH_FLP( LTE_UE_PDSCH_FLP* const pdsch_flp, const LTE_DL ...@@ -943,7 +941,7 @@ void phy_init_lte_ue__PDSCH_FLP( LTE_UE_PDSCH_FLP* const pdsch_flp, const LTE_DL
pdsch_flp->rho[i] = (double*)malloc16_clear( sizeof(double)*(frame_parms->N_RB_DL*12*7*2) ); pdsch_flp->rho[i] = (double*)malloc16_clear( sizeof(double)*(frame_parms->N_RB_DL*12*7*2) );
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++) for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
const int idx = (j<<1)+i; const int idx = (j<<1)+i;
const size_t num = 7*2*frame_parms->N_RB_DL*12; const size_t num = 7*2*frame_parms->N_RB_DL*12+4;
pdsch_flp->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch_flp->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch_flp->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch_flp->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch_flp->rxdataF_comp[idx] = (double*)malloc16_clear( sizeof(double) * num ); pdsch_flp->rxdataF_comp[idx] = (double*)malloc16_clear( sizeof(double) * num );
...@@ -970,7 +968,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue, ...@@ -970,7 +968,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
LTE_UE_PDCCH** const ue_pdcch_vars = phy_vars_ue->lte_ue_pdcch_vars; LTE_UE_PDCCH** const ue_pdcch_vars = phy_vars_ue->lte_ue_pdcch_vars;
LTE_UE_PRACH** const ue_prach_vars = phy_vars_ue->lte_ue_prach_vars; LTE_UE_PRACH** const ue_prach_vars = phy_vars_ue->lte_ue_prach_vars;
int i,j,k; int i,j,k,l;
int eNB_id; int eNB_id;
msg("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,frame_parms->nb_antennas_tx,frame_parms->nb_antennas_rx); msg("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,frame_parms->nb_antennas_tx,frame_parms->nb_antennas_rx);
...@@ -1064,25 +1062,42 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue, ...@@ -1064,25 +1062,42 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
ue_pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16_clear(sizeof(LTE_UE_PBCH)); ue_pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16_clear(sizeof(LTE_UE_PBCH));
if (abstraction_flag == 0) { if (abstraction_flag == 0) {
// init basic (common) variables
phy_init_lte_ue__PDSCH( ue_pdsch_vars[eNB_id], frame_parms ); phy_init_lte_ue__PDSCH( ue_pdsch_vars[eNB_id], frame_parms );
ue_pdsch_vars[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*frame_parms->N_RB_DL*12); // init variables only needed for standard PDSCH
ue_pdsch_vars[eNB_id]->llr_shifts_p = ue_pdsch_vars[eNB_id]->llr_shifts; ue_pdsch_vars[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*frame_parms->N_RB_DL*12);
ue_pdsch_vars[eNB_id]->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); ue_pdsch_vars[eNB_id]->llr_shifts_p = ue_pdsch_vars[eNB_id]->llr_shifts;
ue_pdsch_vars[eNB_id]->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); ue_pdsch_vars[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
ue_pdsch_vars[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); ue_pdsch_vars[eNB_id]->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) );
for (k=0;k<8;k++) ue_pdsch_vars[eNB_id]->rho = (int32_t**)malloc16_clear( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
ue_pdsch_vars[eNB_id]->rxdataF_comp1[k] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); for (int i=0; i<frame_parms->nb_antennas_rx; i++)
ue_pdsch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*7*2) );
ue_pdsch_vars[eNB_id]->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
for (i=0; i<frame_parms->nb_antennas_rx; i++) for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (j=0; j<4;j++) { for (j=0; j<4;j++) {
int idx = (j<<1)+i; const int idx = (j<<1)+i;
ue_pdsch_vars[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(frame_parms->N_RB_DL*12) ); const size_t num = 7*2*frame_parms->N_RB_DL*12+4;
ue_pdsch_vars[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(frame_parms->N_RB_DL*12) ); ue_pdsch_vars[eNB_id]->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
for (k=0;k<8;k++)
ue_pdsch_vars[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*14) );
} }
for (k=0;k<8;k++) { //harq_pid
for (l=0;l<8;l++) { //round
ue_pdsch_vars[eNB_id]->rxdataF_comp1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
for (int i=0; i<frame_parms->nb_antennas_rx; i++)
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
const int idx = (j<<1)+i;
const size_t num = 7*2*frame_parms->N_RB_DL*12+4;
ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
ue_pdsch_vars[eNB_id]->rxdataF_comp1[k][l][idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
}
}
}
#ifdef ENABLE_FULL_FLP #ifdef ENABLE_FULL_FLP
phy_init_lte_ue__PDSCH_FLP( ue_pdsch_vars_flp[eNB_id], frame_parms ); phy_init_lte_ue__PDSCH_FLP( ue_pdsch_vars_flp[eNB_id], frame_parms );
#endif #endif
...@@ -1106,7 +1121,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue, ...@@ -1106,7 +1121,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
ue_pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*7*2) ); ue_pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*7*2) );
for (j=0; j<4;j++) {//frame_parms->nb_antennas_tx; j++) for (j=0; j<4;j++) {//frame_parms->nb_antennas_tx; j++)
int idx = (j<<1)+i; int idx = (j<<1)+i;
size_t num = 7*2*frame_parms->N_RB_DL*12; size_t num = 7*2*frame_parms->N_RB_DL*12+4;
ue_pdcch_vars[eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); ue_pdcch_vars[eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
ue_pdcch_vars[eNB_id]->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); ue_pdcch_vars[eNB_id]->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
ue_pdcch_vars[eNB_id]->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); ue_pdcch_vars[eNB_id]->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
......
...@@ -1217,26 +1217,28 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe, ...@@ -1217,26 +1217,28 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
if (frame_parms->nb_antennas_tx == 2) { if (frame_parms->nb_antennas_tx == 2) {
if (dlsch1->active == 1) { // both TBs are active if (dlsch1->active == 1) { // both TBs are active
dlsch0_harq->dl_power_off = 1; //no power offset??
dlsch1_harq->dl_power_off = 1; //no power offset??
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1];
dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch0_harq->nb_rb-1]; dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch0_harq->nb_rb-1];
switch (tpmi) { switch (tpmi) {
case 0: case 0:
dlsch0_harq->mimo_mode = UNIFORM_PRECODING11; dlsch0_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODING1;
dlsch1_harq->mimo_mode = UNIFORM_PRECODING1m1; dlsch1_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODING1;
dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,0); dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,0);
dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,1); dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,1);
break; break;
case 1: case 1:
dlsch0_harq->mimo_mode = UNIFORM_PRECODING1j; dlsch0_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODINGj;
dlsch1_harq->mimo_mode = UNIFORM_PRECODING1mj; dlsch1_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODINGj;
dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,2); dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,2);
dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,3); dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,3);
break; break;
case 2: // PUSCH precoding case 2: // PUSCH precoding
dlsch0_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING; dlsch0_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING;
dlsch0_harq->pmi_alloc = DL_pmi_single; dlsch0_harq->pmi_alloc = DL_pmi_single;
dlsch1_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING; dlsch1_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING;
dlsch1_harq->pmi_alloc = DL_pmi_single; dlsch1_harq->pmi_alloc = DL_pmi_single;
break; break;
default: default:
break; break;
...@@ -1245,6 +1247,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe, ...@@ -1245,6 +1247,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1]; dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1];
} }
else { // only one is active else { // only one is active
dlsch0_harq->dl_power_off = 1; //???
switch (tpmi) { switch (tpmi) {
case 0 : case 0 :
dlsch0_harq->mimo_mode = ALAMOUTI; dlsch0_harq->mimo_mode = ALAMOUTI;
...@@ -1292,8 +1295,8 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe, ...@@ -1292,8 +1295,8 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
dlsch0->rnti = rnti; dlsch0->rnti = rnti;
dlsch1->rnti = rnti; dlsch1->rnti = rnti;
dlsch0_harq->dl_power_off = 0; // dlsch0_harq->dl_power_off = 1;
dlsch1_harq->dl_power_off = 0; // dlsch1_harq->dl_power_off = 1;
break; break;
...@@ -1513,7 +1516,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe, ...@@ -1513,7 +1516,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
// Flip the TB to codeword mapping as described in 5.3.3.1.5 of 36-212 V11.3.0 // Flip the TB to codeword mapping as described in 5.3.3.1.5 of 36-212 V11.3.0
// note that we must set tbswap=0 in eNB scheduler if one TB is deactivated // note that we must set tbswap=0 in eNB scheduler if one TB is deactivated
if (tbswap == 0) { if (tbswap == 0) {
dlsch0 = dlsch[0]; dlsch0 = dlsch[0];
dlsch1 = dlsch[1]; dlsch1 = dlsch[1];
} }
...@@ -1568,25 +1571,27 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe, ...@@ -1568,25 +1571,27 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
dlsch1->active = 0; dlsch1->active = 0;
} }
dlsch0_harq->dl_power_off = 0; // dlsch0_harq->dl_power_off = 0;
dlsch1_harq->dl_power_off = 0; // dlsch1_harq->dl_power_off = 0;
if (frame_parms->nb_antennas_tx == 2) { if (frame_parms->nb_antennas_tx == 2) {
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1];
dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch0_harq->nb_rb-1]; dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch0_harq->nb_rb-1];
if ((dlsch0->active==1) && (dlsch1->active==1)) { if ((dlsch0->active==1) && (dlsch1->active==1)) {
dlsch0_harq->mimo_mode = LARGE_CDD; dlsch0_harq->mimo_mode = LARGE_CDD;
dlsch1_harq->mimo_mode = LARGE_CDD; dlsch1_harq->mimo_mode = LARGE_CDD;
dlsch0_harq->dl_power_off = 1; dlsch0_harq->dl_power_off = 1;
dlsch1_harq->dl_power_off = 1; dlsch1_harq->dl_power_off = 1;
} }
else { else {
dlsch0_harq->dl_power_off = 1;
dlsch0_harq->mimo_mode = ALAMOUTI; dlsch0_harq->mimo_mode = ALAMOUTI;
dlsch1_harq->mimo_mode = ALAMOUTI; dlsch1_harq->mimo_mode = ALAMOUTI;
} }
} }
else if (frame_parms->nb_antennas_tx == 4) { // 4 antenna case else if (frame_parms->nb_antennas_tx == 4) {
if ((dlsch0->active==1) && (dlsch1->active==1)) { if ((dlsch0->active==1) && (dlsch1->active==1)) {
switch (tpmi) { switch (tpmi) {
case 0: // one layer per transport block case 0: // one layer per transport block
...@@ -1629,6 +1634,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe, ...@@ -1629,6 +1634,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
case 0: // one layer per transport block case 0: // one layer per transport block
dlsch0_harq->mimo_mode = ALAMOUTI; dlsch0_harq->mimo_mode = ALAMOUTI;
dlsch1_harq->mimo_mode = ALAMOUTI; dlsch1_harq->mimo_mode = ALAMOUTI;
dlsch0_harq->dl_power_off = 1;
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1];
break; break;
case 1: // two-layers on TB 0 case 1: // two-layers on TB 0
...@@ -1648,6 +1654,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe, ...@@ -1648,6 +1654,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
case 0: // one layer per transport block case 0: // one layer per transport block
dlsch0_harq->mimo_mode = ALAMOUTI; dlsch0_harq->mimo_mode = ALAMOUTI;
dlsch1_harq->mimo_mode = ALAMOUTI; dlsch1_harq->mimo_mode = ALAMOUTI;
dlsch1_harq->dl_power_off = 1;
dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1]; dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1];
break; break;
case 1: // two-layers on TB 0 case 1: // two-layers on TB 0
...@@ -2316,7 +2323,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe, ...@@ -2316,7 +2323,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
#endif #endif
// compute DL power control parameters // compute DL power control parameters
computeRhoA_eNB(pdsch_config_dedicated, dlsch[0],dlsch0_harq->dl_power_off); 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);
...@@ -3737,12 +3744,9 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3737,12 +3744,9 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch0_harq->dl_power_off = 1; //no power offset dlsch0_harq->dl_power_off = 1; //no power offset
LOG_D(PHY,"UE (%x/%d): Subframe %d Format2 DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d\n",dlsch[0]->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi, LOG_D(PHY,"UE (%x/%d): Subframe %d Format1 DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d\n",dlsch[0]->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi,
dlsch0_harq->first_tx,dlsch0_harq->status); dlsch0_harq->first_tx,dlsch0_harq->status);
// printf("Format2 DCI (UE, hard pid %d): ndi %d, old_ndi %d (first tx %d)\n",harq_pid,ndi,dlsch0_harq->DCINdi,
// dlsch0_harq->first_tx);
if ((ndi!=dlsch0_harq->DCINdi)|| if ((ndi!=dlsch0_harq->DCINdi)||
(dlsch0_harq->first_tx==1)) { (dlsch0_harq->first_tx==1)) {
// printf("Rate: setting round to zero (ndi %d, DCINdi %d,first_tx %d)\n",ndi,dlsch0_harq->DCINdi,dlsch0_harq->first_tx); // printf("Rate: setting round to zero (ndi %d, DCINdi %d,first_tx %d)\n",ndi,dlsch0_harq->DCINdi,dlsch0_harq->first_tx);
...@@ -3750,7 +3754,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3750,7 +3754,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
dlsch0_harq->DCINdi = ndi; dlsch0_harq->DCINdi = ndi;
if (dlsch0_harq->first_tx==1) { if (dlsch0_harq->first_tx==1) {
LOG_D(PHY,"[PDSCH %x/%d] Format 1 DCI First TX: Clearing flag\n"); LOG_D(PHY,"Format 1 DCI First TX: Clearing flag\n");
dlsch0_harq->first_tx = 0; dlsch0_harq->first_tx = 0;
} }
} }
...@@ -3792,6 +3796,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3792,6 +3796,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rballoc = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rballoc; rballoc = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rballoc;
rv1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tpmi;
...@@ -3802,6 +3808,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3802,6 +3808,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rballoc = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rballoc; rballoc = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rballoc;
rv1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tpmi;
...@@ -3814,6 +3822,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3814,6 +3822,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rballoc = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rballoc; rballoc = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rballoc;
rv1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tpmi;
...@@ -3824,6 +3834,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3824,6 +3834,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rballoc = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rballoc; rballoc = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rballoc;
rv1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tpmi;
...@@ -3842,6 +3854,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3842,6 +3854,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rah; rah = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tpmi;
...@@ -3853,6 +3867,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3853,6 +3867,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rah; rah = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tpmi;
...@@ -3866,6 +3882,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3866,6 +3882,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rah; rah = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tpmi;
...@@ -3877,6 +3895,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3877,6 +3895,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rah; rah = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tpmi;
...@@ -3895,6 +3915,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3895,6 +3915,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rah; rah = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tpmi;
...@@ -3906,6 +3928,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3906,6 +3928,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rah; rah = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tpmi;
...@@ -3919,6 +3943,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3919,6 +3943,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rah; rah = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tpmi;
...@@ -3930,6 +3956,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3930,6 +3956,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rah; rah = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tpmi;
...@@ -3949,6 +3977,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3949,6 +3977,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rah; rah = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tpmi;
...@@ -3960,6 +3990,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3960,6 +3990,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rah; rah = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tpmi;
...@@ -3973,6 +4005,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3973,6 +4005,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rah; rah = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tpmi;
...@@ -3984,6 +4018,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3984,6 +4018,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rah; rah = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv1; rv1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv2; rv2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv2;
ndi1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->ndi1;
ndi2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->ndi2;
harq_pid = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tpmi; tpmi = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tpmi;
...@@ -4001,9 +4037,6 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -4001,9 +4037,6 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
} }
dlsch[0]->current_harq_pid = harq_pid;
dlsch[0]->harq_ack[subframe].harq_id = harq_pid;
tbswap = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tb_swap; tbswap = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tb_swap;
if (tbswap == 0) { if (tbswap == 0) {
dlsch0 = dlsch[0]; dlsch0 = dlsch[0];
...@@ -4016,114 +4049,166 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -4016,114 +4049,166 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch0_harq = dlsch0->harq_processes[harq_pid]; dlsch0_harq = dlsch0->harq_processes[harq_pid];
dlsch1_harq = dlsch1->harq_processes[harq_pid]; dlsch1_harq = dlsch1->harq_processes[harq_pid];
dlsch0->current_harq_pid = harq_pid;
dlsch1->current_harq_pid = harq_pid;
dlsch0->harq_ack[subframe].harq_id = harq_pid;
dlsch1->harq_ack[subframe].harq_id = harq_pid;
conv_rballoc(rah, conv_rballoc(rah,
rballoc, rballoc,
frame_parms->N_RB_DL, frame_parms->N_RB_DL,
dlsch0_harq->rb_alloc); dlsch0_harq->rb_alloc);
dlsch1_harq->rb_alloc[0] = dlsch0_harq->rb_alloc[0]; dlsch1_harq->rb_alloc[0] = dlsch0_harq->rb_alloc[0];
dlsch0_harq->nb_rb = conv_nprb(rah, dlsch0_harq->nb_rb = conv_nprb(rah,
rballoc, rballoc,
frame_parms->N_RB_DL); frame_parms->N_RB_DL);
dlsch1_harq->nb_rb = dlsch0_harq->nb_rb; dlsch1_harq->nb_rb = dlsch0_harq->nb_rb;
dlsch0_harq->mcs = mcs1; dlsch0_harq->mcs = mcs1;
dlsch1_harq->mcs = mcs2;
dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3];
/* dlsch1_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3];
if (dlsch0_harq->mcs>20) {
msg("dci_tools.c: mcs > 20 disabled for now (asked %d)\n",dlsch0_harq->mcs);
return(-1);
}
*/
dlsch1_harq->mcs = mcs2;
dlsch0_harq->rvidx = rv1; dlsch0_harq->rvidx = rv1;
dlsch1_harq->rvidx = rv2; dlsch1_harq->rvidx = rv2;
// check if either TB is disabled (see 36-213 V8.6 p. 26) // check if either TB is disabled (see 36-213 V8.6 p. 26)
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0))
dlsch0->active = 0;
else
dlsch0->active = 1;
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0))
dlsch1->active = 0;
else
dlsch1->active = 1;
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) {
dlsch0_harq->status = DISABLED;
}
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) {
dlsch1_harq->status = DISABLED;
}
dlsch0_harq->Nl = 1; dlsch0_harq->Nl = 1;
dlsch1_harq->Nl = 1;
// dlsch0->layer_index = tbswap; // dlsch0->layer_index = tbswap;
// dlsch1->layer_index = 1-tbswap; // dlsch1->layer_index = 1-tbswap;
switch (tpmi) { if (dlsch1->active==1) { //two codewords
case 0 : dlsch0_harq->dl_power_off = 1; //no power offset??
dlsch0_harq->mimo_mode = ALAMOUTI; dlsch1_harq->dl_power_off = 1; //no power offset??
break; switch (tpmi) {
case 1: case 0:
dlsch0_harq->mimo_mode = UNIFORM_PRECODING11; dlsch0_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODING1;
dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,0); dlsch1_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODING1;
break; dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,0);
case 2: dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,1);
dlsch0_harq->mimo_mode = UNIFORM_PRECODING1m1; break;
dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,1); case 1:
break; dlsch0_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODINGj;
case 3: dlsch1_harq->mimo_mode = DUALSTREAM_UNIFORM_PRECODINGj;
dlsch0_harq->mimo_mode = UNIFORM_PRECODING1j; dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,2);
dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,2); dlsch1_harq->pmi_alloc = pmi_extend(frame_parms,3);
break; break;
case 4: case 2: // PUSCH precoding
dlsch0_harq->mimo_mode = UNIFORM_PRECODING1mj; dlsch0_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING;
dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,3); dlsch0_harq->pmi_alloc = 0; //TODO: DL_pmi_single;
break; dlsch1_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING;
case 5: dlsch1_harq->pmi_alloc = 0; //TODO: DL_pmi_single;
dlsch0_harq->mimo_mode = PUSCH_PRECODING0; break;
// pmi stored from ulsch allocation routine default:
dlsch0_harq->pmi_alloc = dlsch0->pmi_alloc; break;
//LOG_I(PHY,"XXX using PMI %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc)); }
break; }
case 6: else {
dlsch0_harq->mimo_mode = PUSCH_PRECODING1; dlsch0_harq->dl_power_off = 1;//????
LOG_E(PHY,"Unsupported TPMI\n"); switch (tpmi) {
return(-1); case 0 :
break; dlsch0_harq->mimo_mode = ALAMOUTI;
break;
case 1:
dlsch0_harq->mimo_mode = UNIFORM_PRECODING11;
dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,0);
break;
case 2:
dlsch0_harq->mimo_mode = UNIFORM_PRECODING1m1;
dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,1);
break;
case 3:
dlsch0_harq->mimo_mode = UNIFORM_PRECODING1j;
dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,2);
break;
case 4:
dlsch0_harq->mimo_mode = UNIFORM_PRECODING1mj;
dlsch0_harq->pmi_alloc = pmi_extend(frame_parms,3);
break;
case 5:
dlsch0_harq->mimo_mode = PUSCH_PRECODING0;
// pmi stored from ulsch allocation routine
dlsch0_harq->pmi_alloc = dlsch0->pmi_alloc;
//LOG_I(PHY,"XXX using PMI %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc));
break;
case 6:
dlsch0_harq->mimo_mode = PUSCH_PRECODING1;
LOG_E(PHY,"Unsupported TPMI\n");
return(-1);
break;
}
} }
if (frame_parms->mode1_flag == 1) if (frame_parms->mode1_flag == 1)
dlsch0_harq->mimo_mode = SISO; dlsch0_harq->mimo_mode = SISO;
if (ndi1!=dlsch0_harq->DCINdi) {
dlsch0_harq->round = 0; if (dlsch0->active == 1) {
dlsch0_harq->status = ACTIVE; if ((ndi1!=dlsch0_harq->DCINdi) ||
dlsch0_harq->DCINdi = ndi1; (dlsch0_harq->first_tx==1)) {
} dlsch0_harq->round = 0;
else if (dlsch0_harq->status == SCH_IDLE) { // we got an Ndi = 0 for a previously decoded process, dlsch0_harq->status = ACTIVE;
dlsch0_harq->DCINdi = ndi1;
if (dlsch0_harq->first_tx==1) {
LOG_D(PHY,"Format 2 DCI First TX0: Clearing flag\n");
dlsch0_harq->first_tx = 0;
}
}
else if (dlsch0_harq->status == SCH_IDLE) { // we got an Ndi = 0 for a previously decoded process,
// this happens if either another harq process in the same // this happens if either another harq process in the same
// is NAK or an ACK was not received // is NAK or an ACK was not received
dlsch0->harq_ack[subframe].ack = 1;
dlsch0->harq_ack[subframe].harq_id = harq_pid;
dlsch0->harq_ack[subframe].send_harq_status = 1;
dlsch0->active = 0;
}
}
dlsch0->harq_ack[subframe].ack = 1; if (dlsch1->active == 1) {
dlsch0->harq_ack[subframe].harq_id = harq_pid; if ((ndi2!=dlsch1_harq->DCINdi) ||
dlsch0->harq_ack[subframe].send_harq_status = 1; (dlsch1_harq->first_tx==1)) {
dlsch0->active = 0; dlsch1_harq->round = 0;
return(0); dlsch1_harq->status = ACTIVE;
dlsch1_harq->DCINdi = ndi2;
if (dlsch1_harq->first_tx==1) {
LOG_D(PHY,"Format 2 DCI First TX1: Clearing flag\n");
dlsch1_harq->first_tx = 0;
}
}
else if (dlsch1_harq->status == SCH_IDLE) { // we got an Ndi = 0 for a previously decoded process,
// this happens if either another harq process in the same
// is NAK or an ACK was not received
dlsch1->harq_ack[subframe].ack = 1;
dlsch1->harq_ack[subframe].harq_id = harq_pid;
dlsch1->harq_ack[subframe].send_harq_status = 1;
dlsch1->active = 0;
}
} }
dlsch0_harq->mcs = mcs1;
if (dlsch0_harq->nb_rb>1) { if (dlsch0_harq->nb_rb>1) {
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1]; dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1];
} }
else else
dlsch0_harq->TBS =0; dlsch0_harq->TBS = 0;
/*
if (dlsch0_harq->mcs > 18)
printf("mcs %d, TBS %d\n",dlsch0_harq->mcs,dlsch0_harq->TBS);
*/
if (dlsch1_harq->DCINdi != ndi2) {
dlsch1_harq->round=0;
dlsch1_harq->status = ACTIVE;
}
dlsch1_harq->DCINdi = ndi2;
dlsch1_harq->mcs = mcs2;
if (dlsch1_harq->nb_rb>1) { if (dlsch1_harq->nb_rb>1) {
dlsch1_harq->TBS = TBStable[dlsch1_harq->mcs][dlsch1_harq->nb_rb-1]; dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1];
} }
else else
dlsch1_harq->TBS = 0; dlsch1_harq->TBS = 0;
...@@ -4131,11 +4216,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -4131,11 +4216,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch0->rnti = rnti; dlsch0->rnti = rnti;
dlsch1->rnti = rnti; dlsch1->rnti = rnti;
dlsch0_harq->dl_power_off = 1; //no power offset // dlsch0_harq->dl_power_off = 1; //no power offset
dlsch1_harq->dl_power_off = 1; //no power offset // dlsch1_harq->dl_power_off = 1; //no power offset
dlsch0->active = 1;
dlsch1->active = 1;
break; break;
...@@ -4461,7 +4543,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -4461,7 +4543,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
dlsch0_harq->DCINdi = ndi1; dlsch0_harq->DCINdi = ndi1;
if (dlsch0_harq->first_tx==1) { if (dlsch0_harq->first_tx==1) {
LOG_D(PHY,"[PDSCH %x/%d] Format 2A DCI First TX0: Clearing flag\n"); LOG_D(PHY,"Format 2A DCI First TX0: Clearing flag\n");
dlsch0_harq->first_tx = 0; dlsch0_harq->first_tx = 0;
} }
} }
...@@ -4485,7 +4567,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -4485,7 +4567,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch1_harq->DCINdi = ndi2; dlsch1_harq->DCINdi = ndi2;
if (dlsch1_harq->first_tx==1) { if (dlsch1_harq->first_tx==1) {
LOG_D(PHY,"[PDSCH %x/%d] Format 2A DCI First TX1: Clearing flag\n",rnti,harq_pid); LOG_D(PHY,"Format 2A DCI First TX1: Clearing flag\n",rnti,harq_pid);
dlsch1_harq->first_tx = 0; dlsch1_harq->first_tx = 0;
} }
...@@ -4768,7 +4850,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -4768,7 +4850,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
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); 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); computeRhoB_UE(pdsch_config_dedicated,&(frame_parms->pdsch_config_common),frame_parms->nb_antennas_tx_eNB,dlsch[0],dlsch0_harq->dl_power_off);
......
...@@ -695,6 +695,12 @@ typedef enum { ...@@ -695,6 +695,12 @@ typedef enum {
PMCH PMCH
} PDSCH_t; } PDSCH_t;
typedef enum {
rx_standard=0,
rx_IC_single_stream,
rx_IC_dual_stream,
} RX_type_t;
typedef enum { typedef enum {
pucch_format1=0, pucch_format1=0,
pucch_format1a, pucch_format1a,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -642,7 +642,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -642,7 +642,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
short **llr32p) { short **llr32p) {
uint32_t *rxF = (uint32_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; uint32_t *rxF = (uint32_t*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
uint32_t *llr32; uint32_t *llr32;
int i,len; int i,len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
...@@ -698,7 +698,7 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -698,7 +698,7 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
int16_t **llr32p) { int16_t **llr32p) {
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; __m128i *rxF = (__m128i*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
__m128i *ch_mag; __m128i *ch_mag;
__m128i llr128[2]; __m128i llr128[2];
int i,len; int i,len;
...@@ -715,7 +715,7 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -715,7 +715,7 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)]; ch_mag = (__m128i*)&dl_ch_mag[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
if (frame_parms->mode1_flag==0) if (frame_parms->mode1_flag==0)
...@@ -774,7 +774,7 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -774,7 +774,7 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
short **llr_save) { short **llr_save) {
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; __m128i *rxF = (__m128i*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
__m128i *ch_mag,*ch_magb; __m128i *ch_mag,*ch_magb;
int i,len,len2; int i,len,len2;
unsigned char symbol_mod,len_mod4; unsigned char symbol_mod,len_mod4;
...@@ -788,8 +788,8 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -788,8 +788,8 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)]; ch_mag = (__m128i*)&dl_ch_mag[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
ch_magb = (__m128i*)&dl_ch_magb[0][(symbol*frame_parms->N_RB_DL*12)]; ch_magb = (__m128i*)&dl_ch_magb[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
if (frame_parms->mode1_flag==0) if (frame_parms->mode1_flag==0)
...@@ -902,9 +902,9 @@ int dlsch_qpsk_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -902,9 +902,9 @@ int dlsch_qpsk_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
short **llr16p) { short **llr16p) {
int16_t *rxF=(int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF=(int16_t*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rxF_i=(int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF_i=(int16_t*)&rxdataF_comp_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rho=(int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rho=(int16_t*)&rho_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *llr16; int16_t *llr16;
int len; int len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
...@@ -935,7 +935,7 @@ int dlsch_qpsk_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -935,7 +935,7 @@ int dlsch_qpsk_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
len = (nb_rb*12) - pbch_pss_sss_adjust; len = (nb_rb*12) - pbch_pss_sss_adjust;
} }
// printf("qpsk_qpsk: len %d, llr16 %p\n",len,llr16); //printf("qpsk_qpsk: len %d, llr16 %p, rho %p\n",len,llr16,rho);
qpsk_qpsk((short *)rxF, qpsk_qpsk((short *)rxF,
(short *)rxF_i, (short *)rxF_i,
(short *)llr16, (short *)llr16,
...@@ -981,6 +981,7 @@ length = number of resource elements ...@@ -981,6 +981,7 @@ length = number of resource elements
ONE_OVER_SQRT_8 = _mm_set1_epi16(23170); //round(2^16/sqrt(8)) ONE_OVER_SQRT_8 = _mm_set1_epi16(23170); //round(2^16/sqrt(8))
for (i=0;i<length>>2;i+=2) { for (i=0;i<length>>2;i+=2) {
//printf("%d.",i);
// in each iteration, we take 8 complex samples // in each iteration, we take 8 complex samples
xmm0 = rho01_128i[i]; // 4 symbols xmm0 = rho01_128i[i]; // 4 symbols
...@@ -1115,6 +1116,7 @@ length = number of resource elements ...@@ -1115,6 +1116,7 @@ length = number of resource elements
_mm_storeu_si128(&stream0_128i_out[i+1],_mm_unpackhi_epi16(y0r,y0i)); _mm_storeu_si128(&stream0_128i_out[i+1],_mm_unpackhi_epi16(y0r,y0i));
} }
//printf("\n");
_mm_empty(); _mm_empty();
_m_empty(); _m_empty();
} }
...@@ -1131,10 +1133,10 @@ int dlsch_qpsk_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -1131,10 +1133,10 @@ int dlsch_qpsk_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
short **llr16p) { short **llr16p) {
int16_t *rxF=(int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF=(int16_t*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rxF_i=(int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF_i=(int16_t*)&rxdataF_comp_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rho=(int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rho=(int16_t*)&rho_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *llr16; int16_t *llr16;
int len; int len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
...@@ -1390,10 +1392,10 @@ int dlsch_qpsk_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -1390,10 +1392,10 @@ int dlsch_qpsk_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
short **llr16p) { short **llr16p) {
int16_t *rxF=(int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF=(int16_t*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rxF_i=(int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF_i=(int16_t*)&rxdataF_comp_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rho=(int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rho=(int16_t*)&rho_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *llr16; int16_t *llr16;
int len; int len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
...@@ -2077,10 +2079,10 @@ int dlsch_16qam_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -2077,10 +2079,10 @@ int dlsch_16qam_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
short **llr16p) { short **llr16p) {
int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF = (int16_t*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rho = (int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rho = (int16_t*)&rho_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *llr16; int16_t *llr16;
int len; int len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
...@@ -2580,11 +2582,11 @@ int dlsch_16qam_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -2580,11 +2582,11 @@ int dlsch_16qam_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
short **llr16p) { short **llr16p) {
int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF = (int16_t*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rho = (int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rho = (int16_t*)&rho_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *llr16; int16_t *llr16;
int len; int len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
...@@ -3112,11 +3114,11 @@ int dlsch_16qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -3112,11 +3114,11 @@ int dlsch_16qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
short **llr16p) { short **llr16p) {
int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF = (int16_t*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rho = (int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rho = (int16_t*)&rho_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *llr16; int16_t *llr16;
int len; int len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
...@@ -4456,10 +4458,10 @@ int dlsch_64qam_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -4456,10 +4458,10 @@ int dlsch_64qam_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
short **llr16p) { short **llr16p) {
int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF = (int16_t*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rho = (int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rho = (int16_t*)&rho_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *llr16; int16_t *llr16;
int len; int len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
...@@ -5718,11 +5720,11 @@ int dlsch_64qam_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -5718,11 +5720,11 @@ int dlsch_64qam_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
short **llr16p) { short **llr16p) {
int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF = (int16_t*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rho = (int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rho = (int16_t*)&rho_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *llr16; int16_t *llr16;
int len; int len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
...@@ -7108,11 +7110,11 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -7108,11 +7110,11 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust, uint16_t pbch_pss_sss_adjust,
short **llr16p) { short **llr16p) {
int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF = (int16_t*)&rxdataF_comp[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *rho = (int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)]; int16_t *rho = (int16_t*)&rho_i[0][(((int)symbol)*((int)frame_parms->N_RB_DL)*12)];
int16_t *llr16; int16_t *llr16;
int len; int len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol; uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
......
...@@ -155,15 +155,14 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -155,15 +155,14 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
int first_layer0 = dlsch0_harq->first_layer; int first_layer0 = dlsch0_harq->first_layer;
int Nlayers0 = dlsch0_harq->Nlayers; int Nlayers0 = dlsch0_harq->Nlayers;
uint8_t mod_order0 = get_Qm(dlsch0_harq->mcs); uint8_t mod_order0 = get_Qm(dlsch0_harq->mcs);
uint8_t mod_order1=2;
uint8_t precoder_index0,precoder_index1;
uint8_t *x1=NULL; uint8_t *x1=NULL;
uint8_t mod_order1=2;
// Fill these in later for TM8-10 // Fill these in later for TM8-10
// int Nlayers1; // int Nlayers1;
// int first_layer1; // int first_layer1;
int use2ndpilots = (frame_parms->mode1_flag==1)?1:0; int use2ndpilots = (frame_parms->mode1_flag==1)?1:0;
uint32_t tti_offset,aa; uint32_t tti_offset,aa;
...@@ -642,7 +641,7 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -642,7 +641,7 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
} }
} }
else if ((mimo_mode >= UNIFORM_PRECODING11)&&(mimo_mode <= PUSCH_PRECODING1)) { else if ((mimo_mode >= UNIFORM_PRECODING11)&&(mimo_mode <= PUSCH_PRECODING1)) {
// this is for transmission modes 4-6 (1 layer) // this is for transmission modes 5-6 (1 layer)
*re_allocated = *re_allocated + 1; *re_allocated = *re_allocated + 1;
amp = (int16_t)(((int32_t)tmp_amp*ONE_OVER_SQRT2_Q15)>>15); amp = (int16_t)(((int32_t)tmp_amp*ONE_OVER_SQRT2_Q15)>>15);
...@@ -740,6 +739,214 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -740,6 +739,214 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
} }
} }
else if ((mimo_mode >= DUALSTREAM_UNIFORM_PRECODING1)&&(mimo_mode <= DUALSTREAM_PUSCH_PRECODING)) {
// this is for transmission mode 4 (1 layer)
*re_allocated = *re_allocated + 1;
//amp = (int16_t)(((int32_t)tmp_amp*ONE_OVER_SQRT2_Q15)>>15);
amp = tmp_amp/2;
gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15)>>15);
if (precoder_index==0) {
precoder_index0 = 0; //[1 1]
precoder_index1 = 1; //[1 -1]
}
else if (precoder_index==1) {
precoder_index0 = 2; //[1 j]
precoder_index1 = 3; //[1 -j]
}
else {
LOG_E(PHY,"problem with precoder in TM4\n");
return(-1);
}
switch (mod_order0) {
case 2: //QPSK
((int16_t*)&tmp_sample1)[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
*jj = *jj + 1;
((int16_t*)&tmp_sample1)[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
*jj = *jj + 1;
// normalization for 2 tx antennas
((int16_t*)&txdataF[0][tti_offset])[0] += ((int16_t*)&tmp_sample1)[0];
((int16_t*)&txdataF[0][tti_offset])[1] += ((int16_t*)&tmp_sample1)[1];
if (frame_parms->nb_antennas_tx == 2) {
layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index0);
((int16_t*)&txdataF[1][tti_offset])[0] += ((int16_t*)&tmp_sample2)[0];
((int16_t*)&txdataF[1][tti_offset])[1] += ((int16_t*)&tmp_sample2)[1];
}
break;
case 4: //16QAM
qam16_table_offset_re = 0;
qam16_table_offset_im = 0;
if (x0[*jj] == 1)
qam16_table_offset_re+=2;
*jj=*jj+1;
if (x0[*jj] == 1)
qam16_table_offset_im+=2;
*jj=*jj+1;
if (x0[*jj] == 1)
qam16_table_offset_re+=1;
*jj=*jj+1;
if (x0[*jj] == 1)
qam16_table_offset_im+=1;
*jj=*jj+1;
((int16_t*)&tmp_sample1)[0] = (int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
((int16_t*)&tmp_sample1)[1] = (int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
((int16_t *)&txdataF[0][tti_offset])[0] += ((int16_t*)&tmp_sample1)[0];
((int16_t *)&txdataF[0][tti_offset])[1] += ((int16_t*)&tmp_sample1)[1];
if (frame_parms->nb_antennas_tx == 2) {
layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index0);
((int16_t*)&txdataF[1][tti_offset])[0] += ((int16_t*)&tmp_sample2)[0];
((int16_t*)&txdataF[1][tti_offset])[1] += ((int16_t*)&tmp_sample2)[1];
}
break;
case 6: //64QAM
qam64_table_offset_re = 0;
qam64_table_offset_im = 0;
if (x0[*jj] == 1)
qam64_table_offset_re+=4;
*jj=*jj+1;
if (x0[*jj] == 1)
qam64_table_offset_im+=4;
*jj=*jj+1;
if (x0[*jj] == 1)
qam64_table_offset_re+=2;
*jj=*jj+1;
if (x0[*jj] == 1)
qam64_table_offset_im+=2;
*jj=*jj+1;
if (x0[*jj] == 1)
qam64_table_offset_re+=1;
*jj=*jj+1;
if (x0[*jj] == 1)
qam64_table_offset_im+=1;
*jj=*jj+1;
((int16_t*)&tmp_sample1)[0] = (int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15);
((int16_t*)&tmp_sample1)[1] = (int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15);
((int16_t *)&txdataF[0][tti_offset])[0] += ((int16_t*)&tmp_sample1)[0];
((int16_t *)&txdataF[0][tti_offset])[1] += ((int16_t*)&tmp_sample1)[1];
if (frame_parms->nb_antennas_tx == 2) {
layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index0);
((int16_t*)&txdataF[1][tti_offset])[0] += ((int16_t*)&tmp_sample2)[0];
((int16_t*)&txdataF[1][tti_offset])[1] += ((int16_t*)&tmp_sample2)[1];
}
break;
}
switch (mod_order1) {
case 2: //QPSK
((int16_t*)&tmp_sample1)[0] = (x1[*jj2]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
*jj2 = *jj2 + 1;
((int16_t*)&tmp_sample1)[1] = (x1[*jj2]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
*jj2 = *jj2 + 1;
// normalization for 2 tx antennas
((int16_t*)&txdataF[0][tti_offset])[0] += ((int16_t*)&tmp_sample1)[0];
((int16_t*)&txdataF[0][tti_offset])[1] += ((int16_t*)&tmp_sample1)[1];
if (frame_parms->nb_antennas_tx == 2) {
layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index1);
((int16_t*)&txdataF[1][tti_offset])[0] += ((int16_t*)&tmp_sample2)[0];
((int16_t*)&txdataF[1][tti_offset])[1] += ((int16_t*)&tmp_sample2)[1];
}
break;
case 4: //16QAM
qam16_table_offset_re = 0;
qam16_table_offset_im = 0;
if (x1[*jj2] == 1)
qam16_table_offset_re+=2;
*jj2=*jj2+1;
if (x1[*jj2] == 1)
qam16_table_offset_im+=2;
*jj2=*jj2+1;
if (x1[*jj2] == 1)
qam16_table_offset_re+=1;
*jj2=*jj2+1;
if (x1[*jj2] == 1)
qam16_table_offset_im+=1;
*jj2=*jj2+1;
((int16_t*)&tmp_sample1)[0] = (int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
((int16_t*)&tmp_sample1)[1] = (int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
((int16_t *)&txdataF[0][tti_offset])[0] += ((int16_t*)&tmp_sample1)[0];
((int16_t *)&txdataF[0][tti_offset])[1] += ((int16_t*)&tmp_sample1)[1];
if (frame_parms->nb_antennas_tx == 2) {
layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index1);
((int16_t*)&txdataF[1][tti_offset])[0] += ((int16_t*)&tmp_sample2)[0];
((int16_t*)&txdataF[1][tti_offset])[1] += ((int16_t*)&tmp_sample2)[1];
}
break;
case 6: //64QAM
qam64_table_offset_re = 0;
qam64_table_offset_im = 0;
if (x1[*jj2] == 1)
qam64_table_offset_re+=4;
*jj2=*jj2+1;
if (x1[*jj2] == 1)
qam64_table_offset_im+=4;
*jj2=*jj2+1;
if (x1[*jj2] == 1)
qam64_table_offset_re+=2;
*jj2=*jj2+1;
if (x1[*jj2] == 1)
qam64_table_offset_im+=2;
*jj2=*jj2+1;
if (x1[*jj2] == 1)
qam64_table_offset_re+=1;
*jj2=*jj2+1;
if (x1[*jj2] == 1)
qam64_table_offset_im+=1;
*jj2=*jj2+1;
((int16_t*)&tmp_sample1)[0] = (int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15);
((int16_t*)&tmp_sample1)[1] = (int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15);
((int16_t *)&txdataF[0][tti_offset])[0] += ((int16_t*)&tmp_sample1)[0];
((int16_t *)&txdataF[0][tti_offset])[1] += ((int16_t*)&tmp_sample1)[1];
if (frame_parms->nb_antennas_tx == 2) {
layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index1);
((int16_t*)&txdataF[1][tti_offset])[0] += ((int16_t*)&tmp_sample2)[0];
((int16_t*)&txdataF[1][tti_offset])[1] += ((int16_t*)&tmp_sample2)[1];
}
break;
}
}
if (mimo_mode == ALAMOUTI) { if (mimo_mode == ALAMOUTI) {
re++; // adjacent carriers are taken care of by precoding re++; // adjacent carriers are taken care of by precoding
*re_allocated = *re_allocated + 1; *re_allocated = *re_allocated + 1;
......
...@@ -36,24 +36,27 @@ double ratioPB[2][4]={{ 1.0,4.0/5.0,3.0/5.0,2.0/5.0}, ...@@ -36,24 +36,27 @@ 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}, 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}; 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(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){ 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_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
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));
...@@ -75,7 +78,7 @@ double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, ...@@ -75,7 +78,7 @@ 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); 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;
...@@ -95,7 +98,9 @@ double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, ...@@ -95,7 +98,9 @@ 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
){
double rho_a_dB; double rho_a_dB;
double sqrt_rho_a_lin; double sqrt_rho_a_lin;
...@@ -103,7 +108,11 @@ double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, ...@@ -103,7 +108,11 @@ double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
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(n_antenna_port==4) // see TS 36.213 Section 5.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));
...@@ -125,7 +134,7 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, ...@@ -125,7 +134,7 @@ 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); 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;
......
...@@ -145,7 +145,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB, ...@@ -145,7 +145,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
\brief Fills RB with data \brief Fills RB with data
\param txdataF pointer to output data (frequency domain signal) \param txdataF pointer to output data (frequency domain signal)
\param jj index to output (from CW 1) \param jj index to output (from CW 1)
\param jj index to output (from CW 2) \param jj2 index to output (from CW 2)
\param re_offset index of the first RE of the RB \param re_offset index of the first RE of the RB
\param symbol_offset index to the OFDM symbol \param symbol_offset index to the OFDM symbol
\param dlsch0_harq Pointer to Transport block 0 HARQ structure \param dlsch0_harq Pointer to Transport block 0 HARQ structure
...@@ -833,6 +833,14 @@ void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -833,6 +833,14 @@ void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t nb_rb, uint16_t nb_rb,
uint8_t dual_stream_UE); uint8_t dual_stream_UE);
void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms,
LTE_UE_PDSCH *lte_ue_pdsch_vars,
int harq_pid,
int round,
unsigned char symbol,
unsigned short nb_rb,
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,
int32_t **rxdataF_ext, int32_t **rxdataF_ext,
...@@ -956,14 +964,16 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext, ...@@ -956,14 +964,16 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
unsigned char output_shift, unsigned char output_shift,
unsigned char dl_power_off); unsigned char dl_power_off);
void dlsch_channel_compensation_TM3(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 round, int round,
MIMO_mode_t mimo_mode,
unsigned short nb_rb, unsigned short nb_rb,
unsigned char output_shift); unsigned char output_shift);
...@@ -981,11 +991,12 @@ void dlsch_channel_level(int32_t **dl_ch_estimates_ext, ...@@ -981,11 +991,12 @@ void dlsch_channel_level(int32_t **dl_ch_estimates_ext,
uint8_t pilots_flag, uint8_t pilots_flag,
uint16_t nb_rb); uint16_t nb_rb);
void dlsch_channel_level_TM3(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,
int *avg, int *avg,
uint8_t symbol, uint8_t symbol,
unsigned short nb_rb); unsigned short nb_rb,
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,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
...@@ -1038,6 +1049,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -1038,6 +1049,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.
@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
...@@ -1045,7 +1057,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -1045,7 +1057,7 @@ 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 dual_stream_UE Flag to indicate dual-stream interference cancellation @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,
...@@ -1055,7 +1067,7 @@ int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -1055,7 +1067,7 @@ int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue,
uint8_t subframe, uint8_t subframe,
uint8_t symbol, uint8_t symbol,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint8_t dual_stream_UE, RX_type_t rx_type,
uint8_t i_mod, uint8_t i_mod,
uint8_t harq_pid); uint8_t harq_pid);
...@@ -1407,7 +1419,7 @@ void dump_dlsch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint8_t ...@@ -1407,7 +1419,7 @@ void dump_dlsch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint8_t
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe); void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe); void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round); void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round,uint8_t harq_pid );
#endif #endif
int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci); int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci);
...@@ -1740,7 +1752,8 @@ double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated); ...@@ -1740,7 +1752,8 @@ 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);
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,
...@@ -1749,7 +1762,8 @@ double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, ...@@ -1749,7 +1762,8 @@ 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,
uint8_t dl_power_off); uint8_t dl_power_off,
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,
......
...@@ -319,10 +319,10 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) { ...@@ -319,10 +319,10 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) {
FD_lte_phy_scope_ue *fdui = fl_malloc( sizeof *fdui ); FD_lte_phy_scope_ue *fdui = fl_malloc( sizeof *fdui );
// Define form // Define form
fdui->lte_phy_scope_ue = fl_bgn_form( FL_NO_BOX, 800, 900 ); fdui->lte_phy_scope_ue = fl_bgn_form( FL_NO_BOX, 800, 1000 );
// This the whole UI box // This the whole UI box
obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 900, "" ); obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 1000, "" );
fl_set_object_color( obj, FL_BLACK, FL_BLACK ); fl_set_object_color( obj, FL_BLACK, FL_BLACK );
// Received signal // Received signal
...@@ -345,6 +345,7 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) { ...@@ -345,6 +345,7 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) {
fl_set_object_lcolor( fdui->chest_f, FL_WHITE ); // Label color fl_set_object_lcolor( fdui->chest_f, FL_WHITE ); // Label color
fl_set_xyplot_ybounds( fdui->chest_f,30,70); fl_set_xyplot_ybounds( fdui->chest_f,30,70);
/*
// LLR of PBCH // LLR of PBCH
fdui->pbch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 260, 500, 100, "PBCH Log-Likelihood Ratios (LLR, mag)" ); fdui->pbch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 260, 500, 100, "PBCH Log-Likelihood Ratios (LLR, mag)" );
fl_set_object_boxtype( fdui->pbch_llr, FL_EMBOSSED_BOX ); fl_set_object_boxtype( fdui->pbch_llr, FL_EMBOSSED_BOX );
...@@ -377,9 +378,11 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) { ...@@ -377,9 +378,11 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) {
fl_set_object_lcolor( fdui->pdcch_comp, FL_WHITE ); // Label color fl_set_object_lcolor( fdui->pdcch_comp, FL_WHITE ); // Label color
fl_set_xyplot_symbolsize( fdui->pdcch_comp,2); fl_set_xyplot_symbolsize( fdui->pdcch_comp,2);
fl_set_xyplot_xgrid( fdui->pdcch_llr,FL_GRID_MAJOR); fl_set_xyplot_xgrid( fdui->pdcch_llr,FL_GRID_MAJOR);
*/
int offset=240;
// LLR of PDSCH // LLR of PDSCH
fdui->pdsch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 500, 500, 200, "PDSCH Log-Likelihood Ratios (LLR, mag)" ); fdui->pdsch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 500-offset, 500, 200, "PDSCH Log-Likelihood Ratios (LLR, mag)" );
fl_set_object_boxtype( fdui->pdsch_llr, FL_EMBOSSED_BOX ); fl_set_object_boxtype( fdui->pdsch_llr, FL_EMBOSSED_BOX );
fl_set_object_color( fdui->pdsch_llr, FL_BLACK, FL_YELLOW ); fl_set_object_color( fdui->pdsch_llr, FL_BLACK, FL_YELLOW );
fl_set_object_lcolor( fdui->pdsch_llr, FL_WHITE ); // Label color fl_set_object_lcolor( fdui->pdsch_llr, FL_WHITE ); // Label color
...@@ -387,12 +390,28 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) { ...@@ -387,12 +390,28 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) {
fl_set_xyplot_xgrid( fdui->pdsch_llr,FL_GRID_MAJOR); fl_set_xyplot_xgrid( fdui->pdsch_llr,FL_GRID_MAJOR);
// I/Q PDSCH comp // I/Q PDSCH comp
fdui->pdsch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 500, 240, 200, "PDSCH I/Q of MF Output" ); fdui->pdsch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 500-offset, 240, 200, "PDSCH I/Q of MF Output" );
fl_set_object_boxtype( fdui->pdsch_comp, FL_EMBOSSED_BOX ); fl_set_object_boxtype( fdui->pdsch_comp, FL_EMBOSSED_BOX );
fl_set_object_color( fdui->pdsch_comp, FL_BLACK, FL_YELLOW ); fl_set_object_color( fdui->pdsch_comp, FL_BLACK, FL_YELLOW );
fl_set_object_lcolor( fdui->pdsch_comp, FL_WHITE ); // Label color fl_set_object_lcolor( fdui->pdsch_comp, FL_WHITE ); // Label color
fl_set_xyplot_symbolsize( fdui->pdsch_comp,2); fl_set_xyplot_symbolsize( fdui->pdsch_comp,2);
// LLR of PDSCH
fdui->pdsch_llr1 = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 720-offset, 500, 200, "PDSCH Log-Likelihood Ratios (LLR, mag)" );
fl_set_object_boxtype( fdui->pdsch_llr1, FL_EMBOSSED_BOX );
fl_set_object_color( fdui->pdsch_llr1, FL_BLACK, FL_YELLOW );
fl_set_object_lcolor( fdui->pdsch_llr1, FL_WHITE ); // Label color
fl_set_xyplot_symbolsize( fdui->pdsch_llr1,2);
fl_set_xyplot_xgrid( fdui->pdsch_llr1,FL_GRID_MAJOR);
// I/Q PDSCH comp
fdui->pdsch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 720-offset, 240, 200, "PDSCH I/Q of MF Output" );
fl_set_object_boxtype( fdui->pdsch_comp1, FL_EMBOSSED_BOX );
fl_set_object_color( fdui->pdsch_comp1, FL_BLACK, FL_YELLOW );
fl_set_object_lcolor( fdui->pdsch_comp1, FL_WHITE ); // Label color
fl_set_xyplot_symbolsize( fdui->pdsch_comp1,2);
/*
// Throughput on PDSCH // Throughput on PDSCH
fdui->pdsch_tput = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 720, 500, 100, "PDSCH Throughput [frame]/[kbit/s]" ); fdui->pdsch_tput = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 720, 500, 100, "PDSCH Throughput [frame]/[kbit/s]" );
fl_set_object_boxtype( fdui->pdsch_tput, FL_EMBOSSED_BOX ); fl_set_object_boxtype( fdui->pdsch_tput, FL_EMBOSSED_BOX );
...@@ -408,6 +427,7 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) { ...@@ -408,6 +427,7 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) {
fl_set_object_color(fdui->button_0, FL_RED, FL_RED); fl_set_object_color(fdui->button_0, FL_RED, FL_RED);
fl_set_object_callback(fdui->button_0, ia_receiver_on_off, 0 ); fl_set_object_callback(fdui->button_0, ia_receiver_on_off, 0 );
fl_hide_object(fdui->button_0); fl_hide_object(fdui->button_0);
*/
fl_end_form( ); fl_end_form( );
fdui->lte_phy_scope_ue->fdui = fdui; fdui->lte_phy_scope_ue->fdui = fdui;
...@@ -428,8 +448,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -428,8 +448,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
int16_t **rxsig_t; int16_t **rxsig_t;
int16_t **chest_t; int16_t **chest_t;
int16_t **chest_f; int16_t **chest_f;
int16_t *pdsch_llr; int16_t *pdsch_llr,*pdsch_llr1;
int16_t *pdsch_comp; int16_t *pdsch_comp,*pdsch_comp1;
int16_t *pdsch_mag0,*pdsch_mag1,*pdsch_magb0,*pdsch_magb1;
int8_t *pdcch_llr; int8_t *pdcch_llr;
int16_t *pdcch_comp; int16_t *pdcch_comp;
int8_t *pbch_llr; int8_t *pbch_llr;
...@@ -444,19 +465,20 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -444,19 +465,20 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx]; float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
int frame = phy_vars_ue->frame_rx; int frame = phy_vars_ue->frame_rx;
uint32_t total_dlsch_bitrate = phy_vars_ue->bitrate[eNB_id]; uint32_t total_dlsch_bitrate = phy_vars_ue->bitrate[eNB_id];
int coded_bits_per_codeword = 0; int coded_bits_per_codeword=0,coded_bits_per_codeword1=1;
int mcs = 0; int mod,mod1;
unsigned char harq_pid = 0; unsigned char harq_pid = 0;
if (phy_vars_ue->dlsch_ue[eNB_id][0]!=NULL) { if (phy_vars_ue->dlsch_ue[eNB_id][0]!=NULL) {
harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid; harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid;
if (harq_pid>=8) if (harq_pid>=8)
return; return;
mcs = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs;
// Button 0 // Button 0
/*
if(!phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->dl_power_off) { if(!phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->dl_power_off) {
// we are in TM5 // we are in TM5
fl_show_object(form->button_0); fl_show_object(form->button_0);
} }
*/
} }
if (phy_vars_ue->lte_ue_pdcch_vars[eNB_id]!=NULL) { if (phy_vars_ue->lte_ue_pdcch_vars[eNB_id]!=NULL) {
...@@ -465,16 +487,32 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -465,16 +487,32 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
// coded_bits_per_codeword = frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti); // coded_bits_per_codeword = frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
if (phy_vars_ue->dlsch_ue[eNB_id][0]!=NULL) { if (phy_vars_ue->dlsch_ue[eNB_id][0]!=NULL) {
coded_bits_per_codeword = get_G(frame_parms, mod = get_Qm(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs);
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->nb_rb, coded_bits_per_codeword = get_G(frame_parms,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rb_alloc, phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->nb_rb,
get_Qm(mcs), phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rb_alloc,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Nl, get_Qm(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs),
num_pdcch_symbols, phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Nl,
frame, num_pdcch_symbols,
subframe); frame,
subframe);
} else { } else {
coded_bits_per_codeword = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti); coded_bits_per_codeword = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
mod=0;
}
if (phy_vars_ue->dlsch_ue[eNB_id][1]!=NULL) {
mod1 = get_Qm(phy_vars_ue->dlsch_ue[eNB_id][1]->harq_processes[harq_pid]->mcs);
coded_bits_per_codeword1 = get_G(frame_parms,
phy_vars_ue->dlsch_ue[eNB_id][1]->harq_processes[harq_pid]->nb_rb,
phy_vars_ue->dlsch_ue[eNB_id][1]->harq_processes[harq_pid]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue[eNB_id][1]->harq_processes[harq_pid]->mcs),
phy_vars_ue->dlsch_ue[eNB_id][1]->harq_processes[harq_pid]->Nl,
num_pdcch_symbols,
frame,
subframe);
} else {
coded_bits_per_codeword1 = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
mod1=0;
} }
I = (float*) calloc(nsymb_ce*2,sizeof(float)); I = (float*) calloc(nsymb_ce*2,sizeof(float));
...@@ -497,9 +535,19 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -497,9 +535,19 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
pdcch_llr = (int8_t*) phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->llr; pdcch_llr = (int8_t*) phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->llr;
pdcch_comp = (int16_t*) phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->rxdataF_comp[0]; pdcch_comp = (int16_t*) phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->rxdataF_comp[0];
pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->llr[0]; // stream 0 pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->llr[0]; // stream 0
// pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0 pdsch_llr1 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->llr[1]; // stream 1
pdsch_comp = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0[0]; pdsch_comp = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0[0];
//pdsch_comp = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_ext[0];
//pdsch_comp1 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_ext[1];
pdsch_comp1 = (int16_t*) (phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[0][0])[0];
//pdsch_comp1 = (int16_t*) (phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[0][0])[0];
pdsch_mag0 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_mag0[0];
pdsch_mag1 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_mag1[0];
pdsch_magb0 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_magb0[0];
pdsch_magb1 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_magb1[0];
fl_freeze_form(form);
// Received signal in time domain of receive antenna 0 // Received signal in time domain of receive antenna 0
if (rxsig_t != NULL) { if (rxsig_t != NULL) {
if (rxsig_t[0] != NULL) { if (rxsig_t[0] != NULL) {
...@@ -590,6 +638,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -590,6 +638,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
} }
} }
/*
// PBCH LLRs // PBCH LLRs
if (pbch_llr != NULL) { if (pbch_llr != NULL) {
for (i=0; i<1920;i++) { for (i=0; i<1920;i++) {
...@@ -630,16 +679,17 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -630,16 +679,17 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_data(form->pdcch_comp,I,Q,12*frame_parms->N_RB_DL*num_pdcch_symbols,"","",""); fl_set_xyplot_data(form->pdcch_comp,I,Q,12*frame_parms->N_RB_DL*num_pdcch_symbols,"","","");
} }
*/
// PDSCH LLRs // PDSCH LLRs
if (pdsch_llr != NULL) { if (pdsch_llr != NULL) {
for (i=0; i<coded_bits_per_codeword/4; i++) { for (i=0; i<coded_bits_per_codeword/mod; i++) {
llr[i] = (float) pdsch_llr[4*i]; llr[i] = (float) pdsch_llr[mod*i];
bit[i] = (float) i; bit[i] = (float) i;
} }
fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword/4); fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword/mod);
fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword/4,"","",""); fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword/mod,"","","");
} }
// PDSCH I/Q of MF Output // PDSCH I/Q of MF Output
...@@ -654,7 +704,116 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -654,7 +704,116 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
} }
fl_set_xyplot_data(form->pdsch_comp,I,Q,ind,"","",""); fl_set_xyplot_data(form->pdsch_comp,I,Q,ind,"","","");
} }
if (pdsch_mag0 != NULL) {
ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_mag0[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
Q[ind] = pdsch_mag0[(2*frame_parms->N_RB_DL*12*k)+4*i+1]*sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
ind++;
}
}
fl_add_xyplot_overlay(form->pdsch_comp,1,I,Q,ind,FL_GREEN);
}
if (pdsch_magb0 != NULL) {
ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_magb0[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
Q[ind] = pdsch_magb0[(2*frame_parms->N_RB_DL*12*k)+4*i+1]*sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
ind++;
}
}
fl_add_xyplot_overlay(form->pdsch_comp,2,I,Q,ind,FL_RED);
}
if ((pdsch_mag0 != NULL) && (pdsch_magb0 != NULL)) {
ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] =
(pdsch_mag0[(2*frame_parms->N_RB_DL*12*k)+4*i]+
pdsch_magb0[(2*frame_parms->N_RB_DL*12*k)+4*i])*
cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
Q[ind] =
(pdsch_mag0[(2*frame_parms->N_RB_DL*12*k)+4*i+1]+
pdsch_magb0[(2*frame_parms->N_RB_DL*12*k)+4*i+1])*
sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
ind++;
}
}
fl_add_xyplot_overlay(form->pdsch_comp,3,I,Q,ind,FL_BLUE);
}
// PDSCH LLRs
if (pdsch_llr1 != NULL) {
for (i=0; i<coded_bits_per_codeword1/mod1; i++) {
llr[i] = (float) pdsch_llr1[mod1*i];
bit[i] = (float) i;
}
fl_set_xyplot_xbounds(form->pdsch_llr1,0,coded_bits_per_codeword1/mod1);
fl_set_xyplot_data(form->pdsch_llr1,bit,llr,coded_bits_per_codeword1/mod1,"","","");
}
// PDSCH I/Q of MF Output
if (pdsch_comp1!=NULL) {
ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_comp1[(2*frame_parms->N_RB_DL*12*k)+4*i];
Q[ind] = pdsch_comp1[(2*frame_parms->N_RB_DL*12*k)+4*i+1];
ind++;
}
}
fl_set_xyplot_data(form->pdsch_comp1,I,Q,ind,"","","");
}
if (pdsch_mag1 != NULL) {
ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_mag1[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
Q[ind] = pdsch_mag1[(2*frame_parms->N_RB_DL*12*k)+4*i+1]*sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
ind++;
}
}
fl_add_xyplot_overlay(form->pdsch_comp1,1,I,Q,ind,FL_GREEN);
}
if (pdsch_magb1 != NULL) {
ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_magb1[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
Q[ind] = pdsch_magb1[(2*frame_parms->N_RB_DL*12*k)+4*i+1]*sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
ind++;
}
}
fl_add_xyplot_overlay(form->pdsch_comp1,2,I,Q,ind,FL_RED);
}
if ((pdsch_mag1 != NULL) && (pdsch_magb1 != NULL)) {
ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] =
(pdsch_mag1[(2*frame_parms->N_RB_DL*12*k)+4*i]+
pdsch_magb1[(2*frame_parms->N_RB_DL*12*k)+4*i])*
cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
Q[ind] =
(pdsch_mag1[(2*frame_parms->N_RB_DL*12*k)+4*i+1]+
pdsch_magb1[(2*frame_parms->N_RB_DL*12*k)+4*i+1])*
sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
ind++;
}
}
fl_add_xyplot_overlay(form->pdsch_comp1,3,I,Q,ind,FL_BLUE);
}
/*
// PDSCH Throughput // PDSCH Throughput
memcpy((void*)tput_time_ue[UE_id],(void*)&tput_time_ue[UE_id][1],(TPUT_WINDOW_LENGTH-1)*sizeof(float)); memcpy((void*)tput_time_ue[UE_id],(void*)&tput_time_ue[UE_id][1],(TPUT_WINDOW_LENGTH-1)*sizeof(float));
memcpy((void*)tput_ue[UE_id],(void*)&tput_ue[UE_id][1],(TPUT_WINDOW_LENGTH-1)*sizeof(float)); memcpy((void*)tput_ue[UE_id],(void*)&tput_ue[UE_id][1],(TPUT_WINDOW_LENGTH-1)*sizeof(float));
...@@ -669,6 +828,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -669,6 +828,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_data(form->pdsch_tput,tput_time_ue[UE_id],tput_ue[UE_id],TPUT_WINDOW_LENGTH,"","",""); fl_set_xyplot_data(form->pdsch_tput,tput_time_ue[UE_id],tput_ue[UE_id],TPUT_WINDOW_LENGTH,"","","");
fl_set_xyplot_ybounds(form->pdsch_tput,0,tput_ue_max[UE_id]); fl_set_xyplot_ybounds(form->pdsch_tput,0,tput_ue_max[UE_id]);
*/
fl_unfreeze_form(form);
fl_check_forms(); fl_check_forms();
......
...@@ -62,6 +62,8 @@ typedef struct { ...@@ -62,6 +62,8 @@ typedef struct {
FL_OBJECT * pdcch_llr; FL_OBJECT * pdcch_llr;
FL_OBJECT * pdsch_comp; FL_OBJECT * pdsch_comp;
FL_OBJECT * pdsch_llr; FL_OBJECT * pdsch_llr;
FL_OBJECT * pdsch_comp1;
FL_OBJECT * pdsch_llr1;
FL_OBJECT * pdsch_tput; FL_OBJECT * pdsch_tput;
FL_OBJECT * button_0; FL_OBJECT * button_0;
} FD_lte_phy_scope_ue; } FD_lte_phy_scope_ue;
......
...@@ -795,19 +795,22 @@ typedef struct { ...@@ -795,19 +795,22 @@ typedef struct {
/// - 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
/// - second index: ? [0..168*N_RB_DL[ /// - second index: ? [0..168*N_RB_DL[
int32_t **rxdataF_comp0; int32_t **rxdataF_comp0;
/// \brief Received frequency-domain signal after extraction and channel compensation. /// \brief Received frequency-domain signal after extraction and channel compensation for the second stream. For the SIC receiver we need to store the history of this for each harq process and round
/// - first index: ? [0..7] (hard coded) accessed via \c round /// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - second index: ? [0..7] (hard coded) accessed via \c round
/// - third index: ? [0..168*N_RB_DL[ /// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
int32_t **rxdataF_comp1[8]; /// - fourth index: ? [0..168*N_RB_DL[
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
/// - second index: ? [0..168*N_RB_DL[ /// - second index: ? [0..168*N_RB_DL[
int32_t **dl_ch_estimates_ext; int32_t **dl_ch_estimates_ext;
/// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. /// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. For the SIC receiver we need to store the history of this for each harq process and round
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
/// - second index: ? [0..168*N_RB_DL[ /// - second index: ? [0..7] (hard coded) accessed via \c round
int32_t **dl_ch_rho_ext; /// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - fourth index: ? [0..168*N_RB_DL[
int32_t **dl_ch_rho_ext[8][8];
/// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. /// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) 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
/// - second index: ? [0..168*N_RB_DL[ /// - second index: ? [0..168*N_RB_DL[
......
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
#include "SCHED/defs.h" #include "SCHED/defs.h"
#include "SCHED/vars.h" #include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h" #include "LAYER2/MAC/vars.h"
#include "OCG_vars.h" #include "OCG_vars.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "UTIL/LISTS/list.h" #include "UTIL/LISTS/list.h"
...@@ -65,7 +64,7 @@ extern unsigned char offset_mumimo_llr_drange_fix; ...@@ -65,7 +64,7 @@ extern unsigned char offset_mumimo_llr_drange_fix;
#include "PHY/TOOLS/lte_phy_scope.h" #include "PHY/TOOLS/lte_phy_scope.h"
#endif #endif
#define PRINT_BYTES
//#define AWGN //#define AWGN
//#define NO_DCI //#define NO_DCI
...@@ -248,17 +247,19 @@ int main(int argc, char **argv) { ...@@ -248,17 +247,19 @@ int main(int argc, char **argv) {
double forgetting_factor=0.0; //in [0,1] 0 means a new channel every time, 1 means keep the same channel double forgetting_factor=0.0; //in [0,1] 0 means a new channel every time, 1 means keep the same channel
double iqim=0.0; double iqim=0.0;
uint8_t extended_prefix_flag=0,transmission_mode=1,n_tx=1,n_rx=2; uint8_t extended_prefix_flag=0,transmission_mode=1,n_tx=1,n_rx=1;
uint16_t Nid_cell=0; uint16_t Nid_cell=0;
int eNB_id = 0, eNB_id_i = 1; int8_t eNB_id = 0, eNB_id_i = 1;
unsigned char mcs1=0,mcs2=0,mcs_i=0,dual_stream_UE = 0,awgn_flag=0,round,dci_flag=0; unsigned char mcs1=0,mcs2=0,mcs_i=0,awgn_flag=0,round,dci_flag=0;
unsigned char i_mod = 2; unsigned char i_mod = 2;
unsigned short NB_RB; unsigned short NB_RB;
unsigned char Ns,l,m; unsigned char Ns,l,m;
uint16_t tdd_config=3; uint16_t tdd_config=3;
uint16_t n_rnti=0x1234; uint16_t n_rnti=0x1234;
int n_users = 1; int n_users = 1;
RX_type_t rx_type=rx_standard;
SCM_t channel_model=Rayleigh1; SCM_t channel_model=Rayleigh1;
// unsigned char *input_data,*decoded_output; // unsigned char *input_data,*decoded_output;
...@@ -268,15 +269,15 @@ int main(int argc, char **argv) { ...@@ -268,15 +269,15 @@ int main(int argc, char **argv) {
unsigned int ret; unsigned int ret;
unsigned int coded_bits_per_codeword=0,nsymb,dci_cnt,tbs=0; unsigned int coded_bits_per_codeword=0,nsymb,dci_cnt,tbs=0;
unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]={0,0,0,0},errs2[4]={0,0,0,0},round_trials[4]={0,0,0,0},dci_errors=0,dlsch_active=0,num_layers; unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[2][4],round_trials[4]={0,0,0,0},dci_errors=0,dlsch_active=0,num_layers;
int re_allocated; int re_allocated;
char fname[32],vname[32]; char fname[32],vname[32];
FILE *bler_fd; FILE *bler_fd;
char bler_fname[256]; char bler_fname[256];
FILE *time_meas_fd; FILE *time_meas_fd;
char time_meas_fname[256]; char time_meas_fname[256];
FILE *tikz_fd; //FILE *tikz_fd;
char tikz_fname[256]; //char tikz_fname[256];
FILE *input_trch_fd=NULL; FILE *input_trch_fd=NULL;
unsigned char input_trch_file=0; unsigned char input_trch_file=0;
...@@ -302,7 +303,7 @@ int main(int argc, char **argv) { ...@@ -302,7 +303,7 @@ int main(int argc, char **argv) {
uint8_t rx_sample_offset = 0; uint8_t rx_sample_offset = 0;
//char stats_buffer[4096]; //char stats_buffer[4096];
//int len; //int len;
uint8_t num_rounds = 4,fix_rounds=0; uint8_t num_rounds = 4;
uint8_t subframe=7; uint8_t subframe=7;
int u; int u;
int n=0; int n=0;
...@@ -317,18 +318,19 @@ int main(int argc, char **argv) { ...@@ -317,18 +318,19 @@ int main(int argc, char **argv) {
// void *data; // void *data;
// int ii; // int ii;
int bler; int bler;
double blerr[4],uncoded_ber,avg_ber; double blerr[2][4],uncoded_ber,avg_ber;
short *uncoded_ber_bit=NULL; short *uncoded_ber_bit=NULL;
uint8_t N_RB_DL=25,osf=1; uint8_t N_RB_DL=25,osf=1;
uint8_t fdd_flag = 0; uint8_t fdd_flag = 0;
#ifdef XFORMS #ifdef XFORMS
FD_lte_phy_scope_ue *form_ue; FD_lte_phy_scope_ue *form_ue;
char title[255]; char title[255];
int xforms = 0;
#endif #endif
uint32_t DLSCH_RB_ALLOC = 0x1fff; uint32_t DLSCH_RB_ALLOC = 0x1fff;
int numCCE=0; int numCCE=0;
int dci_length_bytes=0,dci_length=0; int dci_length_bytes=0,dci_length=0;
double BW = 5.0; double BW = 7.68;
int common_flag=0,TPC=0; int common_flag=0,TPC=0;
double cpu_freq_GHz; double cpu_freq_GHz;
...@@ -341,7 +343,7 @@ int main(int argc, char **argv) { ...@@ -341,7 +343,7 @@ int main(int argc, char **argv) {
int llr8_flag=0; int llr8_flag=0;
double effective_rate=0.0; double effective_rate=0.0;
char channel_model_input[10]="I"; char channel_model_input[17]="I";
int TB0_active = 1; int TB0_active = 1;
uint32_t perfect_ce = 0; uint32_t perfect_ce = 0;
...@@ -350,6 +352,7 @@ int main(int argc, char **argv) { ...@@ -350,6 +352,7 @@ int main(int argc, char **argv) {
LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq; LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq;
uint8_t Kmimo; uint8_t Kmimo;
mod_sym_t **sic_buffer;
opp_enabled=1; // to enable the time meas opp_enabled=1; // to enable the time meas
...@@ -361,6 +364,7 @@ int main(int argc, char **argv) { ...@@ -361,6 +364,7 @@ int main(int argc, char **argv) {
//signal(SIGABRT, handler); //signal(SIGABRT, handler);
logInit(); logInit();
set_glog(LOG_INFO, LOG_MED);
// default parameters // default parameters
n_frames = 1000; n_frames = 1000;
...@@ -368,7 +372,7 @@ int main(int argc, char **argv) { ...@@ -368,7 +372,7 @@ int main(int argc, char **argv) {
num_layers = 1; num_layers = 1;
perfect_ce = 0; perfect_ce = 0;
while ((c = getopt (argc, argv, "ahdpZDe:m:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:Y")) != -1) { while ((c = getopt (argc, argv, "aAb:B:c:C:dDe:f:F:g:hi:I:l:Lm:M:n:N:o:O:pPr:R:s:S:t:T:u:v:w:x:Xy:Yz:Z")) != -1) {
switch (c) switch (c)
{ {
case 'a': case 'a':
...@@ -435,7 +439,7 @@ int main(int argc, char **argv) { ...@@ -435,7 +439,7 @@ int main(int argc, char **argv) {
num_pdcch_symbols=atoi(optarg); num_pdcch_symbols=atoi(optarg);
break; break;
case 'g': case 'g':
memcpy(channel_model_input,optarg,10); memcpy(channel_model_input,optarg,17);
switch((char)*optarg) { switch((char)*optarg) {
case 'A': case 'A':
channel_model=SCM_A; channel_model=SCM_A;
...@@ -479,6 +483,24 @@ int main(int argc, char **argv) { ...@@ -479,6 +483,24 @@ int main(int argc, char **argv) {
case 'N': case 'N':
channel_model=AWGN; channel_model=AWGN;
break; break;
case 'P':
channel_model=Rayleigh1_orthogonal;
break;
case 'Q':
channel_model=Rayleigh1_orth_eff_ch_TM4_prec_real; // for DUALSTREAM_UNIFORM_PRECODING1 when interf is precancelled
break;
case 'R':
channel_model=Rayleigh1_orth_eff_ch_TM4_prec_imag; // for DUALSTREAM_UNIFORM_PRECODINGj when interf is precancelled
break;
case 'S':
channel_model=Rayleigh8_orth_eff_ch_TM4_prec_real;//when interf is precancelled
break;
case 'T':
channel_model=Rayleigh8_orth_eff_ch_TM4_prec_imag;//when interf is precancelled
break;
case 'U':
channel_model = TS_SHIFT;
break;
default: default:
msg("Unsupported channel model!\n"); msg("Unsupported channel model!\n");
exit(-1); exit(-1);
...@@ -489,6 +511,7 @@ int main(int argc, char **argv) { ...@@ -489,6 +511,7 @@ int main(int argc, char **argv) {
if ((transmission_mode!=1) && if ((transmission_mode!=1) &&
(transmission_mode!=2) && (transmission_mode!=2) &&
(transmission_mode!=3) && (transmission_mode!=3) &&
(transmission_mode!=4) &&
(transmission_mode!=5) && (transmission_mode!=5) &&
(transmission_mode!=6)) { (transmission_mode!=6)) {
msg("Unsupported transmission mode %d\n",transmission_mode); msg("Unsupported transmission mode %d\n",transmission_mode);
...@@ -536,10 +559,9 @@ int main(int argc, char **argv) { ...@@ -536,10 +559,9 @@ int main(int argc, char **argv) {
n_rnti=atoi(optarg); n_rnti=atoi(optarg);
break; break;
case 'u': case 'u':
dual_stream_UE=1; rx_type = (RX_type_t) atoi(optarg);
openair_daq_vars.use_ia_receiver = 1; if (rx_type<rx_standard || rx_type>rx_IC_dual_stream) {
if ((n_tx!=2) || (transmission_mode!=5)) { printf("Unsupported rx type %d\n",rx_type);
msg("IA receiver only supported for TM5!");
exit(-1); exit(-1);
} }
break; break;
...@@ -563,6 +585,9 @@ int main(int argc, char **argv) { ...@@ -563,6 +585,9 @@ int main(int argc, char **argv) {
test_perf=atoi(optarg); test_perf=atoi(optarg);
//print_perf =1; //print_perf =1;
break; break;
case 'X':
xforms = 1;
break;
case 'Z': case 'Z':
dump_table=1; dump_table=1;
break; break;
...@@ -571,7 +596,7 @@ int main(int argc, char **argv) { ...@@ -571,7 +596,7 @@ int main(int argc, char **argv) {
break; break;
case 'h': case 'h':
default: default:
printf("%s -h(elp) -a(wgn on) -d(ci decoding on) -p(extended prefix on) -m mcs1 -M mcs2 -n n_frames -s snr0 -x transmission mode (1,2,5,6) -y TXant -z RXant -I trch_file\n",argv[0]); printf("%s -h(elp) -a(wgn on) -d(ci decoding on) -p(extended prefix on) -m mcs1 -M mcs2 -n n_frames -s snr0 -x transmission mode (1,2,3,5,6) -y TXant -z RXant -I trch_file\n",argv[0]);
printf("-h This message\n"); printf("-h This message\n");
printf("-a Use AWGN channel and not multipath\n"); printf("-a Use AWGN channel and not multipath\n");
printf("-c Number of PDCCH symbols\n"); printf("-c Number of PDCCH symbols\n");
...@@ -584,18 +609,20 @@ int main(int argc, char **argv) { ...@@ -584,18 +609,20 @@ int main(int argc, char **argv) {
printf("-s Starting SNR, runs from SNR to SNR+%.1fdB in steps of %.1fdB. If n_frames is 1 then just SNR is simulated and MATLAB/OCTAVE output is generated\n", snr_int, snr_step); printf("-s Starting SNR, runs from SNR to SNR+%.1fdB in steps of %.1fdB. If n_frames is 1 then just SNR is simulated and MATLAB/OCTAVE output is generated\n", snr_int, snr_step);
printf("-f step size of SNR, default value is 1.\n"); printf("-f step size of SNR, default value is 1.\n");
printf("-r ressource block allocation (see section 7.1.6.3 in 36.213\n"); printf("-r ressource block allocation (see section 7.1.6.3 in 36.213\n");
printf("-g [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M')\n"); printf("-g Channel model, possible values are 3GPP 25.814 SCM-A/B/C/D('A','B','C','D'), 36-101 EPA('E'), EVA ('F'),ETU('G'), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr('K'), Rice8('L'), Rice1('M'), AWGN('N'), Rayleigh1_orthogonal('P'), Rayleigh1_orth_eff_ch_TM4_prec_real ('Q'), Rayleigh1_orth_eff_ch_TM4_prec_imag ('R'), Rayleigh8_orth_eff_ch_TM4_prec_real ('S'),Rayleigh8_orth_eff_ch_TM4_prec_imag ('T') \n");
//printf("-g Channel model, possible values are 3GPP 25.814 SCM-A/B/C/D('A','B','C','D'), 36-101 EPA('E'), EVA ('F'),ETU('G'), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr('K'), Rice8('L'), Rice1('M'), AWGN('N'), Rayleigh1_orthogonal('P'), Rayleigh1_orth_eff_ch_TM4_prec_real22 ('Q'), Rayleigh1_orth_eff_ch_TM4_prec_imag ('R'), \n");
printf("-F forgetting factor (0 new channel every trial, 1 channel constant\n"); printf("-F forgetting factor (0 new channel every trial, 1 channel constant\n");
printf("-x Transmission mode (1,2,6 for the moment)\n"); printf("-x Transmission mode (1,2,6 for the moment)\n");
printf("-y Number of TX antennas used in eNB\n"); printf("-y Number of TX antennas used in eNB\n");
printf("-z Number of RX antennas used in UE\n"); printf("-z Number of RX antennas used in UE\n");
printf("-t MCS of interfering UE\n"); printf("-t MCS of interfering UE\n");
printf("-R Number of HARQ rounds (fixed)\n"); printf("-R Number of HARQ rounds (fixed)\n");
printf("-M Turns on calibration mode for abstraction.\n"); printf("-A Turns on calibration mode for abstraction.\n");
printf("-N Determines the number of Channel Realizations in Abstraction mode. Default value is 1. \n"); printf("-N Determines the number of Channel Realizations in Abstraction mode. Default value is 1. \n");
printf("-O Set the percenatge of effective rate to testbench the modem performance (typically 30 and 70, range 1-100) \n"); printf("-O Set the percenatge of effective rate to testbench the modem performance (typically 30 and 70, range 1-100) \n");
printf("-I Input filename for TrCH data (binary)\n"); printf("-I Input filename for TrCH data (binary)\n");
printf("-u Enables the Interference Aware Receiver for TM5 (default is normal receiver)\n"); printf("-u Receiver type: 0=standard, 1 = single stream IC (for TM3,4,5,6), 2 = dual stream IC (for TM3,4), 3 = SIC (for TM3,4) \n");
exit(1); exit(1);
break; break;
} }
...@@ -605,20 +632,20 @@ int main(int argc, char **argv) { ...@@ -605,20 +632,20 @@ int main(int argc, char **argv) {
switch (N_RB_DL) { switch (N_RB_DL) {
case 6: case 6:
if (rballocset==0) DLSCH_RB_ALLOC = 0x3f; if (rballocset==0) DLSCH_RB_ALLOC = 0x3f;
BW = 1.25; BW = 30.72/16;
num_pdcch_symbols = 3; num_pdcch_symbols = 3;
break; break;
case 25: case 25:
if (rballocset==0) DLSCH_RB_ALLOC = 0x1fff; if (rballocset==0) DLSCH_RB_ALLOC = 0x1fff;
BW = 5.00; BW = 30.72/4;
break; break;
case 50: case 50:
if (rballocset==0) DLSCH_RB_ALLOC = 0x1ffff; if (rballocset==0) DLSCH_RB_ALLOC = 0x1ffff;
BW = 10.00; BW = 30.72/2;
break; break;
case 100: case 100:
if (rballocset==0) DLSCH_RB_ALLOC = 0x1ffffff; if (rballocset==0) DLSCH_RB_ALLOC = 0x1ffffff;
BW = 20.00; BW = 30.72;
break; break;
} }
NB_RB=conv_nprb(0,DLSCH_RB_ALLOC,N_RB_DL); NB_RB=conv_nprb(0,DLSCH_RB_ALLOC,N_RB_DL);
...@@ -628,37 +655,55 @@ int main(int argc, char **argv) { ...@@ -628,37 +655,55 @@ int main(int argc, char **argv) {
NB_RB=conv_nprb(0,DLSCH_RB_ALLOC,N_RB_DL); NB_RB=conv_nprb(0,DLSCH_RB_ALLOC,N_RB_DL);
if ((transmission_mode > 1) && (n_tx != 2)) if ((transmission_mode > 1) && (n_tx != 2)) {
printf("n_tx must be >1 for transmission_mode %d\n",transmission_mode); printf("n_tx must be >1 for transmission_mode %d\n",transmission_mode);
exit(-1);
}
if (((transmission_mode==1) || (transmission_mode==2)) && (rx_type != rx_standard)) {
printf("only standard rx available for TM1 and TM2\n");
exit(-1);
}
if (((transmission_mode==5) || (transmission_mode==6)) && (rx_type == rx_IC_dual_stream)) {
printf("only standard rx or single stream IC available for TM5 and TM6\n");
exit(-1);
}
#ifdef XFORMS #ifdef XFORMS
if (xforms==1) {
fl_initialize (&argc, argv, NULL, 0, 0); fl_initialize (&argc, argv, NULL, 0, 0);
form_ue = create_lte_phy_scope_ue(); form_ue = create_lte_phy_scope_ue();
sprintf (title, "LTE PHY SCOPE eNB"); sprintf (title, "LTE PHY SCOPE eNB");
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
if (!dual_stream_UE==0) { /*
if (rx_type==rx_IC_single_stream) {
openair_daq_vars.use_ia_receiver = 1; openair_daq_vars.use_ia_receiver = 1;
fl_set_button(form_ue->button_0,1); fl_set_button(form_ue->button_0,1);
fl_set_object_label(form_ue->button_0, "IA Receiver ON"); fl_set_object_label(form_ue->button_0, "IA Receiver ON");
fl_set_object_color(form_ue->button_0, FL_GREEN, FL_GREEN); fl_set_object_color(form_ue->button_0, FL_GREEN, FL_GREEN);
} }
*/
}
#endif #endif
if (transmission_mode==5) { if (transmission_mode==5) {
n_users = 2; n_users = 2;
printf("dual_stream_UE=%d\n", dual_stream_UE); eNB_id_i = PHY_vars_UE->n_connected_eNB;
} }
else
eNB_id_i = eNB_id;
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,fdd_flag,Nid_cell,tdd_config,N_RB_DL,osf,perfect_ce); lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,fdd_flag,Nid_cell,tdd_config,N_RB_DL,osf,perfect_ce);
eNB_id_i = PHY_vars_UE->n_connected_eNB;
printf("Setting mcs1 = %d\n",mcs1); printf("Setting mcs1 = %d\n",mcs1);
printf("Setting mcs2 = %d\n",mcs2); printf("Setting mcs2 = %d\n",mcs2);
printf("NPRB = %d\n",NB_RB); printf("NPRB = %d\n",NB_RB);
printf("n_frames = %d\n",n_frames); printf("n_frames = %d\n",n_frames);
printf("Transmission mode %d with %dx%d antenna configuration, Extended Prefix %d\n",transmission_mode,n_tx,n_rx,extended_prefix_flag); printf("Transmission mode %d with %dx%d antenna configuration, Extended Prefix %d\n",transmission_mode,n_tx,n_rx,extended_prefix_flag);
printf("Using receiver type %d\n", rx_type);
snr1 = snr0+snr_int; snr1 = snr0+snr_int;
printf("SNR0 %f, SNR1 %f\n",snr0,snr1); printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
...@@ -675,26 +720,35 @@ int main(int argc, char **argv) { ...@@ -675,26 +720,35 @@ int main(int argc, char **argv) {
frame_parms = &PHY_vars_eNB->lte_frame_parms; frame_parms = &PHY_vars_eNB->lte_frame_parms;
s_re = malloc(2*sizeof(double*)); s_re = malloc(2*sizeof(double*)); //transmitted signal (Sent)
s_im = malloc(2*sizeof(double*)); s_im = malloc(2*sizeof(double*));
r_re = malloc(2*sizeof(double*)); r_re = malloc(2*sizeof(double*)); //received signal
r_im = malloc(2*sizeof(double*)); r_im = malloc(2*sizeof(double*));
// r_re0 = malloc(2*sizeof(double*)); // r_re0 = malloc(2*sizeof(double*));
// r_im0 = malloc(2*sizeof(double*)); // r_im0 = malloc(2*sizeof(double*));
nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12; nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12;
printf("Channel Model= (%s,%d)\n",channel_model_input, channel_model); printf("Channel Model= (%s,%d)\n",channel_model_input, channel_model);
printf("SCM-A=%d, SCM-B=%d, SCM-C=%d, SCM-D=%d, EPA=%d, EVA=%d, ETU=%d, Rayleigh8=%d, Rayleigh1=%d, Rayleigh1_corr=%d, Rayleigh1_anticorr=%d, Rice1=%d, Rice8=%d\n", printf("SCM-A=%d, SCM-B=%d, SCM-C=%d, SCM-D=%d, EPA=%d, EVA=%d, ETU=%d, Rayleigh8=%d, Rayleigh1=%d, Rayleigh1_corr=%d, Rayleigh1_anticorr=%d, Rice1=%d, Rice8=%d, Rayleigh1_orthogonal=%d, Rayleigh1_orth_eff_ch_TM4_prec_real22=%d, Rayleigh1_orth_eff_ch_TM4_prec_imag=%d, Rayleigh8_orth_eff_ch_TM4_prec_real=%d, Rayleigh8_orth_eff_ch_TM4_prec_imag=%d , TS_SHIFT=%d\n",
SCM_A, SCM_B, SCM_C, SCM_D, EPA, EVA, ETU, Rayleigh8, Rayleigh1, Rayleigh1_corr, Rayleigh1_anticorr, Rice1, Rice8); SCM_A, SCM_B, SCM_C, SCM_D, EPA, EVA, ETU, Rayleigh8, Rayleigh1, Rayleigh1_corr, Rayleigh1_anticorr, Rice1, Rice8, Rayleigh1_orthogonal, Rayleigh1_orth_eff_ch_TM4_prec_real, Rayleigh1_orth_eff_ch_TM4_prec_imag, Rayleigh8_orth_eff_ch_TM4_prec_real, Rayleigh8_orth_eff_ch_TM4_prec_imag, TS_SHIFT);
if(transmission_mode==5) if(transmission_mode==5)
sprintf(bler_fname,"bler_tx%d_chan%d_nrx%d_mcs%d_mcsi%d_u%d_imod%d.csv",transmission_mode,channel_model,n_rx,mcs1,mcs_i,dual_stream_UE,i_mod); sprintf(bler_fname,"bler_tx%d_rec%d_chan%d_nrx%d_mcs%d_mcsi%d_u%d_imod%d.csv",transmission_mode,rx_type,channel_model,n_rx,mcs1,mcs_i,rx_type,i_mod);
else if (abstx == 1)
if (perfect_ce==1)
sprintf(bler_fname,"bler_tx%d_rec%d_chan%d_nrx%d_mcs%d_mcsi%d_abstr_perf_ce.csv",transmission_mode,rx_type,channel_model,n_rx,mcs1, mcs2);
else
sprintf(bler_fname,"bler_tx%d_rec%d_chan%d_nrx%d_mcs%d_mcsi%d_abstr.csv",transmission_mode,rx_type,channel_model,n_rx,mcs1, mcs2);
else else
sprintf(bler_fname,"bler_tx%d_chan%d_nrx%d_mcs%d.csv",transmission_mode,channel_model,n_rx,mcs1); if (perfect_ce==1)
sprintf(bler_fname,"bler_tx%d_rec%d_chan%d_nrx%d_mcs%d_mcsi%d_perf_ce.csv",transmission_mode,rx_type,channel_model,n_rx,mcs1, mcs2);
else
sprintf(bler_fname,"bler_tx%d_rec%d_chan%d_nrx%d_mcs%d_mcsi%d.csv",transmission_mode,rx_type,channel_model,n_rx,mcs1, mcs2);
bler_fd = fopen(bler_fname,"w"); bler_fd = fopen(bler_fname,"w");
fprintf(bler_fd,"SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err\n"); fprintf(bler_fd,"SNR; MCS1; MCS2; TBS1; TBS2; rate; err0_st1; err0_st2 trials0; err1_st1; err1_st2; trials1; err2_st1; err2_st2; trials2; err3_st1; err3_st2; trials3; dci_err\n");
if (test_perf != 0) { if (test_perf != 0) {
char hostname[1024]; char hostname[1024];
...@@ -710,8 +764,18 @@ int main(int argc, char **argv) { ...@@ -710,8 +764,18 @@ int main(int argc, char **argv) {
} }
if(abstx){ if(abstx){
// CSV file // CSV file // add here second stream mcs
sprintf(csv_fname,"dataout_tx%d_u2%d_mcs%d_chan%d_nsimus%d_R%d.m",transmission_mode,dual_stream_UE,mcs1,channel_model,n_frames,num_rounds);
if (transmission_mode == 5)
sprintf(csv_fname,"dataout_tx%d_u2%d_mcs%d_chan%d_nsimus%d_R%d_abstr.m",transmission_mode,rx_type,mcs1,channel_model,n_frames,num_rounds);
else
if (perfect_ce==1)
sprintf(csv_fname,"dataout_tx%d_mcs%d_mcsi%d_chan%d_nsimus%d_R%d_abstr_perf_ce.m",transmission_mode,mcs1,mcs2,channel_model,n_frames,num_rounds);
else
sprintf(csv_fname,"dataout_tx%d_mcs%d_mcsi%d_chan%d_nsimus%d_R%d_abstr.m",transmission_mode,mcs1,mcs2,channel_model,n_frames,num_rounds);
// sprintf(csv_fname,"dataout_tx%d_mcs%d_mcs_interf%d_chan%d_nsimus%d_R%d_abstr_old.m",transmission_mode,mcs1,mcs2,channel_model,n_frames,num_rounds);
csv_fd = fopen(csv_fname,"w"); csv_fd = fopen(csv_fname,"w");
fprintf(csv_fd,"data_all%d=[",mcs1); fprintf(csv_fd,"data_all%d=[",mcs1);
} }
...@@ -719,7 +783,8 @@ int main(int argc, char **argv) { ...@@ -719,7 +783,8 @@ int main(int argc, char **argv) {
/* /*
//sprintf(tikz_fname, "second_bler_tx%d_u2=%d_mcs%d_chan%d_nsimus%d.tex",transmission_mode,dual_stream_UE,mcs,channel_model,n_frames); //sprintf(tikz_fname, "second_bler_tx%d_u2=%d_mcs%d_chan%d_nsimus%d.tex",transmission_mode,dual_stream_UE,mcs,channel_model,n_frames);
sprintf(tikz_fname, "second_bler_tx%d_u2%d_mcs%d_chan%d_nsimus%d",transmission_mode,dual_stream_UE,mcs,channel_model,n_frames); sprintf(tikz_fname, "second_bler_tx%d_u2%d_mcs%d_chan%d_nsimus%d",transmission_mode,dual_stream_UE,mcs,channel_model,n_frames);
tikz_fd = fopen(tikz_fname,"w"); tikz_fd = fopesprintf(csv_fname,"dataout_tx%d_mcs%d_mcs_interf%d_chan%d_nsimus%d_R%d_abstr_old_perf_ce_llr.m",transmission_mode,mcs1,mcs2,channel_model,n_frames,num_rounds);
n(tikz_fname,"w");
//fprintf(tikz_fd,"\\addplot[color=red, mark=o] plot coordinates {"); //fprintf(tikz_fd,"\\addplot[color=red, mark=o] plot coordinates {");
switch (mcs) switch (mcs)
{ {
...@@ -835,7 +900,7 @@ int main(int argc, char **argv) { ...@@ -835,7 +900,7 @@ int main(int argc, char **argv) {
UL_alloc_pdu.ndi = 1; UL_alloc_pdu.ndi = 1;
UL_alloc_pdu.TPC = 0; UL_alloc_pdu.TPC = 0;
UL_alloc_pdu.cqi_req = 1; UL_alloc_pdu.cqi_req = 1;
CCCH_alloc_pdu.type = 0; CCCH_alloc_pdu.type = 0;
CCCH_alloc_pdu.vrb_type = 0; CCCH_alloc_pdu.vrb_type = 0;
CCCH_alloc_pdu.rballoc = CCCH_RB_ALLOC; CCCH_alloc_pdu.rballoc = CCCH_RB_ALLOC;
...@@ -891,14 +956,14 @@ int main(int argc, char **argv) { ...@@ -891,14 +956,14 @@ int main(int argc, char **argv) {
exit(-1); exit(-1);
} }
if ((transmission_mode == 3) || (transmission_mode==4)) if ((transmission_mode == 3) || (transmission_mode==4) || (transmission_mode==8))
Kmimo=2; Kmimo=2;
else else
Kmimo=1; Kmimo=1;
for (k=0;k<n_users;k++) { for (k=0;k<n_users;k++) {
// Create transport channel structures for 2 transport blocks (MIMO) // Create transport channel structures for 2 transport blocks (MIMO)
for (i=0;i<2;i++) { for (i=0;i<2;i++) { //i is a number of spatial streams
PHY_vars_eNB->dlsch_eNB[k][i] = new_eNB_dlsch(Kmimo,8,N_RB_DL,0); PHY_vars_eNB->dlsch_eNB[k][i] = new_eNB_dlsch(Kmimo,8,N_RB_DL,0);
if (!PHY_vars_eNB->dlsch_eNB[k][i]) { if (!PHY_vars_eNB->dlsch_eNB[k][i]) {
printf("Can't get eNB dlsch structures\n"); printf("Can't get eNB dlsch structures\n");
...@@ -932,6 +997,11 @@ int main(int argc, char **argv) { ...@@ -932,6 +997,11 @@ int main(int argc, char **argv) {
} }
sic_buffer = (mod_sym_t **) malloc16(frame_parms->nb_antennas_tx*sizeof(mod_sym_t*) );
for (i=0; i<frame_parms->nb_antennas_tx; i++) {
sic_buffer[i] = malloc16_clear(FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
}
if (input_fd==NULL) { if (input_fd==NULL) {
...@@ -1005,7 +1075,7 @@ int main(int argc, char **argv) { ...@@ -1005,7 +1075,7 @@ int main(int argc, char **argv) {
break; break;
} }
} }
else { else { //fdd
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) { switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
case 6: case 6:
dci_length = sizeof_DCI1_1_5MHz_FDD_t; dci_length = sizeof_DCI1_1_5MHz_FDD_t;
...@@ -1076,7 +1146,7 @@ int main(int argc, char **argv) { ...@@ -1076,7 +1146,7 @@ int main(int argc, char **argv) {
num_dci++; num_dci++;
num_ue_spec_dci++; num_ue_spec_dci++;
} }
else { else { //common flag =1
if (PHY_vars_eNB->lte_frame_parms.frame_type == TDD) { if (PHY_vars_eNB->lte_frame_parms.frame_type == TDD) {
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) { switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
...@@ -1134,7 +1204,7 @@ int main(int argc, char **argv) { ...@@ -1134,7 +1204,7 @@ int main(int argc, char **argv) {
break; break;
} }
} }
else { else { // fdd
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) { switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
case 6: case 6:
dci_length = sizeof_DCI1A_1_5MHz_FDD_t; dci_length = sizeof_DCI1A_1_5MHz_FDD_t;
...@@ -1212,10 +1282,10 @@ int main(int argc, char **argv) { ...@@ -1212,10 +1282,10 @@ int main(int argc, char **argv) {
} }
break; break;
case 3: case 3: //LARGE CDD
if (common_flag == 0) { if (common_flag == 0) {
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx == 2) { if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx == 2) {// here DCI does not contain any precoder information. matrix is fixed as identity, but dont forget aboy cycling
if (PHY_vars_eNB->lte_frame_parms.frame_type == TDD) { if (PHY_vars_eNB->lte_frame_parms.frame_type == TDD) {
...@@ -1281,8 +1351,8 @@ int main(int argc, char **argv) { ...@@ -1281,8 +1351,8 @@ int main(int argc, char **argv) {
break; break;
} }
} }
else { else { // fdd
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) { switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
case 6: case 6:
dci_length = sizeof_DCI2A_1_5MHz_2A_FDD_t; dci_length = sizeof_DCI2A_1_5MHz_2A_FDD_t;
...@@ -1342,7 +1412,7 @@ int main(int argc, char **argv) { ...@@ -1342,7 +1412,7 @@ int main(int argc, char **argv) {
} }
} }
} }
else if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx == 4) { else if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx == 4) { //4 antenna, needs diff precoding codebook index depeneding on layers
} }
...@@ -1369,8 +1439,8 @@ int main(int argc, char **argv) { ...@@ -1369,8 +1439,8 @@ int main(int argc, char **argv) {
num_dci++; num_dci++;
num_ue_spec_dci++; num_ue_spec_dci++;
} }
else { else { //commonn flag 1
if (PHY_vars_eNB->lte_frame_parms.frame_type == TDD) { if (PHY_vars_eNB->lte_frame_parms.frame_type == TDD) { //tdd
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) { switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
case 6: case 6:
...@@ -1427,7 +1497,7 @@ int main(int argc, char **argv) { ...@@ -1427,7 +1497,7 @@ int main(int argc, char **argv) {
break; break;
} }
} }
else { else { //fdd
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) { switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
case 6: case 6:
dci_length = sizeof_DCI1A_1_5MHz_FDD_t; dci_length = sizeof_DCI1A_1_5MHz_FDD_t;
...@@ -1507,7 +1577,7 @@ int main(int argc, char **argv) { ...@@ -1507,7 +1577,7 @@ int main(int argc, char **argv) {
printf("Generated DCI format 2A (Transmission Mode 3)\n"); printf("Generated DCI format 2A (Transmission Mode 3)\n");
break; break;
case 4: case 4: // !!! this dci format contains precoder information
if (common_flag == 0) { if (common_flag == 0) {
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx == 2) { if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx == 2) {
...@@ -1516,7 +1586,7 @@ int main(int argc, char **argv) { ...@@ -1516,7 +1586,7 @@ int main(int argc, char **argv) {
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) { switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
case 6: case 6:
dci_length = sizeof_DCI2_1_5MHz_2A_TDD_t; dci_length = sizeof_DCI2_1_5MHz_2A_TDD_t;
dci_length_bytes = sizeof(DCI2_1_5MHz_2A_TDD_t); dci_length_bytes = sizeof(DCI2_1_5MHz_2A_TDD_t);
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rballoc = DLSCH_RB_ALLOC; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rballoc = DLSCH_RB_ALLOC;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->TPC = 0; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->TPC = 0;
...@@ -1528,14 +1598,16 @@ int main(int argc, char **argv) { ...@@ -1528,14 +1598,16 @@ int main(int argc, char **argv) {
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
break; break;
case 25: case 25:
dci_length = sizeof_DCI2_5MHz_2A_TDD_t; dci_length = sizeof_DCI2_5MHz_2A_TDD_t;
dci_length_bytes = sizeof(DCI2_5MHz_2A_TDD_t); dci_length_bytes = sizeof(DCI2_5MHz_2A_TDD_t);
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rah = 0; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rah = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rballoc = DLSCH_RB_ALLOC; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rballoc = DLSCH_RB_ALLOC;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->TPC = 0; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->TPC = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->dai = 0; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->dai = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->harq_pid = 0; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->harq_pid = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->mcs1 = mcs1; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->mcs1 = mcs1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi1 = 1; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi1 = 1;
...@@ -1543,6 +1615,9 @@ int main(int argc, char **argv) { ...@@ -1543,6 +1615,9 @@ int main(int argc, char **argv) {
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
break; break;
case 50: case 50:
dci_length = sizeof_DCI2_10MHz_2A_TDD_t; dci_length = sizeof_DCI2_10MHz_2A_TDD_t;
...@@ -1558,6 +1633,9 @@ int main(int argc, char **argv) { ...@@ -1558,6 +1633,9 @@ int main(int argc, char **argv) {
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
break; break;
case 100: case 100:
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rah = 0; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rah = 0;
...@@ -1571,6 +1649,8 @@ int main(int argc, char **argv) { ...@@ -1571,6 +1649,8 @@ int main(int argc, char **argv) {
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
dci_length = sizeof_DCI2_20MHz_2A_TDD_t; dci_length = sizeof_DCI2_20MHz_2A_TDD_t;
dci_length_bytes = sizeof(DCI2_20MHz_2A_TDD_t); dci_length_bytes = sizeof(DCI2_20MHz_2A_TDD_t);
break; break;
...@@ -1591,6 +1671,8 @@ int main(int argc, char **argv) { ...@@ -1591,6 +1671,8 @@ int main(int argc, char **argv) {
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2; ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1; ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0; ((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
break; break;
case 25: case 25:
dci_length = sizeof_DCI2_5MHz_2A_FDD_t; dci_length = sizeof_DCI2_5MHz_2A_FDD_t;
...@@ -1605,6 +1687,8 @@ int main(int argc, char **argv) { ...@@ -1605,6 +1687,8 @@ int main(int argc, char **argv) {
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2; ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1; ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0; ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
break; break;
case 50: case 50:
dci_length = sizeof_DCI2_10MHz_2A_FDD_t; dci_length = sizeof_DCI2_10MHz_2A_FDD_t;
...@@ -1619,6 +1703,8 @@ int main(int argc, char **argv) { ...@@ -1619,6 +1703,8 @@ int main(int argc, char **argv) {
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2; ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1; ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0; ((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
break; break;
case 100: case 100:
dci_length = sizeof_DCI2_20MHz_2A_FDD_t; dci_length = sizeof_DCI2_20MHz_2A_FDD_t;
...@@ -1633,6 +1719,8 @@ int main(int argc, char **argv) { ...@@ -1633,6 +1719,8 @@ int main(int argc, char **argv) {
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2; ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->mcs2 = mcs2;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1; ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0; ((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
break; break;
} }
} }
...@@ -1664,7 +1752,7 @@ int main(int argc, char **argv) { ...@@ -1664,7 +1752,7 @@ int main(int argc, char **argv) {
num_dci++; num_dci++;
num_ue_spec_dci++; num_ue_spec_dci++;
} }
else { else { //common_flag==1
if (PHY_vars_eNB->lte_frame_parms.frame_type == TDD) { if (PHY_vars_eNB->lte_frame_parms.frame_type == TDD) {
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) { switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
...@@ -1895,18 +1983,6 @@ int main(int argc, char **argv) { ...@@ -1895,18 +1983,6 @@ int main(int argc, char **argv) {
} }
} }
// this is for user 0 only
coded_bits_per_codeword = get_G(&PHY_vars_eNB->lte_frame_parms,
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->nb_rb,
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->rb_alloc,
get_Qm(PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->mcs),
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->Nl,
num_pdcch_symbols,
0,subframe);
uncoded_ber_bit = (short*) malloc(sizeof(short)*coded_bits_per_codeword);
printf("uncoded_ber_bit=%p\n",uncoded_ber_bit);
snr_step = input_snr_step; snr_step = input_snr_step;
PHY_vars_UE->high_speed_flag = 1; PHY_vars_UE->high_speed_flag = 1;
PHY_vars_UE->ch_est_alpha=0; PHY_vars_UE->ch_est_alpha=0;
...@@ -1918,19 +1994,11 @@ int main(int argc, char **argv) { ...@@ -1918,19 +1994,11 @@ int main(int argc, char **argv) {
for (SNR=snr0;SNR<snr1;SNR+=snr_step) { for (SNR=snr0;SNR<snr1;SNR+=snr_step) {
PHY_vars_UE->frame_rx=0; PHY_vars_UE->frame_rx=0;
errs[0]=0; for (i=0; i<4; i++) {
errs[1]=0; errs[0][i]=0;
errs[2]=0; errs[1][i]=0;
errs[3]=0; round_trials[i] = 0;
errs2[0]=0; }
errs2[1]=0;
errs2[2]=0;
errs2[3]=0;
round_trials[0] = 0;
round_trials[1] = 0;
round_trials[2] = 0;
round_trials[3] = 0;
dci_errors=0; dci_errors=0;
avg_ber = 0; avg_ber = 0;
...@@ -2086,6 +2154,39 @@ int main(int argc, char **argv) { ...@@ -2086,6 +2154,39 @@ int main(int argc, char **argv) {
break; break;
} }
break; break;
case 4:
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
case 6:
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_TDD_t));
break;
case 25:
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_TDD_t));
break;
case 50:
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_TDD_t));
break;
case 100:
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_TDD_t));
break;
}
break;
case 5: case 5:
DLSCH_alloc_pdu2_1E[0].ndi = trials&1; DLSCH_alloc_pdu2_1E[0].ndi = trials&1;
DLSCH_alloc_pdu2_1E[0].rv = 0; DLSCH_alloc_pdu2_1E[0].rv = 0;
...@@ -2152,6 +2253,38 @@ int main(int argc, char **argv) { ...@@ -2152,6 +2253,38 @@ int main(int argc, char **argv) {
break; break;
} }
break; break;
case 4:
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
case 6:
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_FDD_t));
break;
case 25:
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_FDD_t));
break;
case 50:
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_FDD_t));
break;
case 100:
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 0;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 0;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_FDD_t));
break;
}
break;
case 5: case 5:
DLSCH_alloc_pdu2_1E[0].ndi = trials&1; DLSCH_alloc_pdu2_1E[0].ndi = trials&1;
DLSCH_alloc_pdu2_1E[0].rv = 0; DLSCH_alloc_pdu2_1E[0].rv = 0;
...@@ -2257,6 +2390,71 @@ int main(int argc, char **argv) { ...@@ -2257,6 +2390,71 @@ int main(int argc, char **argv) {
break; break;
} }
break; break;
case 4:
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
case 6:
if (TB0_active==1) {
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
else { // deactivate TB0
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_TDD_t));
break;
case 25:
if (TB0_active==1) {
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
else { // deactivate TB0
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_TDD_t));
break;
case 50:
if (TB0_active==1) {
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
else { // deactivate TB0
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_TDD_t));
break;
case 100:
if (TB0_active==1) {
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
else { // deactivate TB0
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_TDD_t));
break;
}
break;
case 5: case 5:
DLSCH_alloc_pdu2_1E[0].ndi = trials&1; DLSCH_alloc_pdu2_1E[0].ndi = trials&1;
DLSCH_alloc_pdu2_1E[0].rv = round&3; DLSCH_alloc_pdu2_1E[0].rv = round&3;
...@@ -2355,6 +2553,72 @@ int main(int argc, char **argv) { ...@@ -2355,6 +2553,72 @@ int main(int argc, char **argv) {
break; break;
} }
break; break;
case 4:
switch (PHY_vars_eNB->lte_frame_parms.N_RB_DL) {
case 6:
if (TB0_active==1) {
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
else { // deactivate TB0
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_FDD_t));
break;
case 25:
if (TB0_active==1) {
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
else { // deactivate TB0
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_FDD_t));
break;
case 50:
if (TB0_active==1) {
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
else { // deactivate TB0
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_FDD_t));
break;
case 100:
if (TB0_active==1) {
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
else { // deactivate TB0
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
}
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_FDD_t));
break;
}
break;
case 5: case 5:
DLSCH_alloc_pdu2_1E[0].ndi = trials&1; DLSCH_alloc_pdu2_1E[0].ndi = trials&1;
DLSCH_alloc_pdu2_1E[0].rv = round&3; DLSCH_alloc_pdu2_1E[0].rv = round&3;
...@@ -2398,12 +2662,12 @@ int main(int argc, char **argv) { ...@@ -2398,12 +2662,12 @@ int main(int argc, char **argv) {
if ((SNR==snr0) && (trials==0) && (round==0)) if ((SNR==snr0) && (trials==0) && (round==0))
printf("User %d, cw %d: Rate = %f (%f bits/dim) (G %d, TBS %d, mod %d, pdcch_sym %d, ndi %d)\n", printf("User %d, cw %d: Rate = %f (%f bits/dim) (G %d, TBS %d, mod %d, pdcch_sym %d, ndi %d)\n",
k,cw,rate,rate*get_Qm(PHY_vars_eNB->dlsch_eNB[k][0]->harq_processes[0]->mcs), k,cw,rate,rate*get_Qm(PHY_vars_eNB->dlsch_eNB[k][cw]->harq_processes[0]->mcs),
coded_bits_per_codeword, coded_bits_per_codeword,
tbs, tbs,
get_Qm(PHY_vars_eNB->dlsch_eNB[k][0]->harq_processes[0]->mcs), get_Qm(PHY_vars_eNB->dlsch_eNB[k][cw]->harq_processes[0]->mcs), //changed dlsch_eNB[k][0]
num_pdcch_symbols, num_pdcch_symbols,
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->round); PHY_vars_eNB->dlsch_eNB[k][cw]->harq_processes[0]->round);//changed dlsch_eNB[k][0]
// use the PMI from previous trial // use the PMI from previous trial
if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) { if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) {
...@@ -2454,10 +2718,11 @@ int main(int argc, char **argv) { ...@@ -2454,10 +2718,11 @@ int main(int argc, char **argv) {
0, 0,
PHY_vars_eNB->dlsch_eNB[k][cw], PHY_vars_eNB->dlsch_eNB[k][cw],
coded_bits_per_codeword, coded_bits_per_codeword,
0, cw,
subframe<<1); subframe<<1);
stop_meas(&PHY_vars_eNB->dlsch_scrambling_stats); stop_meas(&PHY_vars_eNB->dlsch_scrambling_stats);
#ifdef PRINT_BYTES
if (n_frames==1) { if (n_frames==1) {
for (s=0;s<PHY_vars_eNB->dlsch_eNB[k][cw]->harq_processes[0]->C;s++) { for (s=0;s<PHY_vars_eNB->dlsch_eNB[k][cw]->harq_processes[0]->C;s++) {
if (s<PHY_vars_eNB->dlsch_eNB[k][cw]->harq_processes[0]->Cminus) if (s<PHY_vars_eNB->dlsch_eNB[k][cw]->harq_processes[0]->Cminus)
...@@ -2468,9 +2733,10 @@ int main(int argc, char **argv) { ...@@ -2468,9 +2733,10 @@ int main(int argc, char **argv) {
Kr_bytes = Kr>>3; Kr_bytes = Kr>>3;
for (i=0;i<Kr_bytes;i++) for (i=0;i<Kr_bytes;i++)
printf("%d : (%x)\n",i,PHY_vars_eNB->dlsch_eNB[k][cw]->harq_processes[0]->c[s][i]); printf("cw%d %d : (%x)\n",cw,i,PHY_vars_eNB->dlsch_eNB[k][cw]->harq_processes[0]->c[s][i]);
} }
} }
#endif
} }
start_meas(&PHY_vars_eNB->dlsch_modulation_stats); start_meas(&PHY_vars_eNB->dlsch_modulation_stats);
...@@ -2568,6 +2834,28 @@ int main(int argc, char **argv) { ...@@ -2568,6 +2834,28 @@ int main(int argc, char **argv) {
s_im[aa][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1]); s_im[aa][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1]);
} }
else { else {
if (transmission_mode==4) {
r_re[0][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][0]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)])+((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][1]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)]);
r_im[0][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][0]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1])+((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][1]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1]);
r_re[1][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][0]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)])-((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][1]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)]);
r_im[1][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][0]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1])-((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][1]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1]);
// printf("r_re0 = %d\n",r_re[0][i]);
//printf("r_im0 = %d\n",r_im[0][i]);
//printf("r_re1 = %d\n",r_re[1][i]);
//printf("r_im1 = %d\n",r_im[1][i]);
// r_re[0][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][0]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)]);
// r_im[0][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][0]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1]);
// r_re[1][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][1]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)]);
// r_im[1][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][1]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1]);
// printf("r_re0 = %d\n",r_re[0][i]);
// printf("r_im0 = %d\n",r_im[0][i]);
// printf("r_re1 = %d\n",r_re[1][i]);
// printf("r_im1 = %d\n",r_im[1][i]);
}
else {
for (aarx=0;aarx<PHY_vars_UE->lte_frame_parms.nb_antennas_rx;aarx++) { for (aarx=0;aarx<PHY_vars_UE->lte_frame_parms.nb_antennas_rx;aarx++) {
if (aa==0) { if (aa==0) {
r_re[aarx][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)]); r_re[aarx][i] = ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)]);
...@@ -2577,7 +2865,7 @@ int main(int argc, char **argv) { ...@@ -2577,7 +2865,7 @@ int main(int argc, char **argv) {
r_re[aarx][i] += ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)]); r_re[aarx][i] += ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)]);
r_im[aarx][i] += ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1]); r_im[aarx][i] += ((double)(((short *)PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id][aa]))[(2*subframe*PHY_vars_UE->lte_frame_parms.samples_per_tti) +(i<<1)+1]);
} }
}
} }
} }
} }
...@@ -2597,6 +2885,7 @@ int main(int argc, char **argv) { ...@@ -2597,6 +2885,7 @@ int main(int argc, char **argv) {
} }
// freq_channel(eNB2UE[0], NB_RB,12*NB_RB + 1);
if(abstx){ if(abstx){
if (trials==0 && round==0) { if (trials==0 && round==0) {
// calculate freq domain representation to compute SINR // calculate freq domain representation to compute SINR
...@@ -2830,18 +3119,18 @@ int main(int argc, char **argv) { ...@@ -2830,18 +3119,18 @@ int main(int argc, char **argv) {
dci_alloc_rx,1, dci_alloc_rx,1,
eNB_id, eNB_id,
subframe); subframe);
//printf("dci_cnt %d\n",dci_cnt); printf("dci_cnt %d\n",dci_cnt);
if (dci_cnt==0) { if (dci_cnt==0) {
dlsch_active = 0; dlsch_active = 0;
if (round==0) { if (round==0) {
dci_errors++; dci_errors++;
round=5; round=5;
errs[0]++; errs[0][0]++;
//round_trials[0]++; //round_trials[0]++;
if (n_frames==1) if (n_frames==1)
printf("DCI error trial %d errs[0] %d\n",trials,errs[0]); printf("DCI error trial %d errs[0][0] %d\n",trials,errs[0][0]);
} }
// for (i=1;i<=round;i++) // for (i=1;i<=round;i++)
// round_trials[i]--; // round_trials[i]--;
...@@ -2850,7 +3139,10 @@ int main(int argc, char **argv) { ...@@ -2850,7 +3139,10 @@ int main(int argc, char **argv) {
for (i=0;i<dci_cnt;i++) { for (i=0;i<dci_cnt;i++) {
// printf("Generating dlsch parameters for RNTI %x\n",dci_alloc_rx[i].rnti); // printf("Generating dlsch parameters for RNTI %x\n",dci_alloc_rx[i].rnti);
if (round == 0) PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->first_tx=1; if (round == 0) {
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->first_tx=1;
PHY_vars_UE->dlsch_ue[0][1]->harq_processes[PHY_vars_UE->dlsch_ue[0][1]->current_harq_pid]->first_tx=1;
}
if ((dci_alloc_rx[i].rnti == n_rnti) && if ((dci_alloc_rx[i].rnti == n_rnti) &&
(generate_ue_dlsch_params_from_dci(0, (generate_ue_dlsch_params_from_dci(0,
dci_alloc_rx[i].dci_pdu, dci_alloc_rx[i].dci_pdu,
...@@ -2862,13 +3154,13 @@ int main(int argc, char **argv) { ...@@ -2862,13 +3154,13 @@ int main(int argc, char **argv) {
SI_RNTI, SI_RNTI,
0, 0,
P_RNTI)==0)) { P_RNTI)==0)) {
//dump_dci(&PHY_vars_UE->lte_frame_parms,&dci_alloc_rx[i]); dump_dci(&PHY_vars_UE->lte_frame_parms,&dci_alloc_rx[i]);
coded_bits_per_codeword = get_G(&PHY_vars_eNB->lte_frame_parms, coded_bits_per_codeword = get_G(&PHY_vars_eNB->lte_frame_parms,
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->nb_rb, PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->nb_rb,
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->rb_alloc, PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->rb_alloc,
get_Qm(PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->mcs), get_Qm(PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->mcs),
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->Nl, PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->Nl,
PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
0,subframe); 0,subframe);
/* /*
rate = (double)dlsch_tbs25[get_I_TBS(PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->mcs)][PHY_vars_UE->dlsch_ue[0][0]->nb_rb-1]/(coded_bits_per_codeword); rate = (double)dlsch_tbs25[get_I_TBS(PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->mcs)][PHY_vars_UE->dlsch_ue[0][0]->nb_rb-1]/(coded_bits_per_codeword);
...@@ -2882,7 +3174,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -2882,7 +3174,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
dlsch_active = 0; dlsch_active = 0;
if (round==0) { if (round==0) {
dci_errors++; dci_errors++;
errs[0]++; errs[0][0]++;
//round_trials[0]++; //round_trials[0]++;
round=5; round=5;
...@@ -2900,7 +3192,10 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -2900,7 +3192,10 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
PHY_vars_UE->lte_ue_pdcch_vars[0]->crnti = n_rnti; PHY_vars_UE->lte_ue_pdcch_vars[0]->crnti = n_rnti;
PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols; PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols;
if (round == 0) PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->first_tx=1; if (round == 0) {
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->first_tx=1;
PHY_vars_UE->dlsch_ue[0][1]->harq_processes[0]->first_tx=1;
}
switch (transmission_mode) { switch (transmission_mode) {
case 1: case 1:
case 2: case 2:
...@@ -2933,13 +3228,14 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -2933,13 +3228,14 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
generate_ue_dlsch_params_from_dci(0, generate_ue_dlsch_params_from_dci(0,
&DLSCH_alloc_pdu_1[0], &DLSCH_alloc_pdu_1[0],
(common_flag==0)? C_RNTI : SI_RNTI, (common_flag==0)? C_RNTI : SI_RNTI,
(common_flag==0)? format2 : format1A, (common_flag==0)? format2 : format1A,//format1A only for a codeblock
PHY_vars_UE->dlsch_ue[0], PHY_vars_UE->dlsch_ue[0],
&PHY_vars_UE->lte_frame_parms, &PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->pdsch_config_dedicated, PHY_vars_UE->pdsch_config_dedicated,
SI_RNTI, SI_RNTI,
0, 0,
P_RNTI); P_RNTI);
break; break;
case 5: case 5:
case 6: case 6:
...@@ -2963,12 +3259,14 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -2963,12 +3259,14 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
if (dlsch_active == 1) { if (dlsch_active == 1) {
if ((Ns==(1+(2*subframe))) && (l==0)) {// process PDSCH symbols 1,2,3,4,5,(6 Normal Prefix) if ((Ns==(1+(2*subframe))) && (l==0)) {// process PDSCH symbols 1,2,3,4,5,(6 Normal Prefix)
if ((transmission_mode == 5) &&
(PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->dl_power_off==0) && if (transmission_mode == 5) {
(openair_daq_vars.use_ia_receiver ==1)) { if ((PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->dl_power_off==0) &&
dual_stream_UE = 1; (openair_daq_vars.use_ia_receiver ==1)) {
} else { rx_type = rx_IC_single_stream;
dual_stream_UE = 0; } else {
rx_type = rx_standard;
}
} }
...@@ -2985,7 +3283,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -2985,7 +3283,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
subframe, subframe,
m, m,
(m==PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols)?1:0, (m==PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols)?1:0,
dual_stream_UE, rx_type,
i_mod, i_mod,
PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid)==-1) PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid)==-1)
{ {
...@@ -3010,7 +3308,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3010,7 +3308,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
subframe, subframe,
m, m,
0, 0,
dual_stream_UE, rx_type,
i_mod, i_mod,
PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid)==-1) PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid)==-1)
{ {
...@@ -3035,7 +3333,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3035,7 +3333,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
subframe, subframe,
m, m,
0, 0,
dual_stream_UE, rx_type,
i_mod, i_mod,
PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid)==-1) PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid)==-1)
{ {
...@@ -3047,10 +3345,33 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3047,10 +3345,33 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
} }
if (test_perf ==0 ) { if (test_perf ==0 ) {
if ((n_frames==1) && (Ns==(2+(2*subframe))) && (l==0)) { if ((n_frames==1) && (Ns==(2+(2*subframe))) && (l==0)) {
write_output("ch0.m","ch0",eNB2UE[0]->ch[0],eNB2UE[0]->channel_length,1,8);
write_output("chanF11.m","chF11",eNB2UE[0]->chF[0],12*NB_RB,1,8);
write_output("chan11.m","ch11",eNB2UE[0]->ch[0],eNB2UE[0]->channel_length,1,8);
if ( PHY_vars_eNB->lte_frame_parms.nb_antennas_rx==2 && PHY_vars_eNB->lte_frame_parms.nb_antennas_tx==1 ){
write_output("chan21.m","ch21",eNB2UE[0]->ch[1],eNB2UE[0]->channel_length,1,8);
}
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1){
write_output("chan12.m","ch12",eNB2UE[0]->ch[1],eNB2UE[0]->channel_length,1,8);
if ( PHY_vars_eNB->lte_frame_parms.nb_antennas_rx>1){
write_output("chan21.m","ch21",eNB2UE[0]->ch[2],eNB2UE[0]->channel_length,1,8);
write_output("chan22.m","ch22",eNB2UE[0]->ch[3],eNB2UE[0]->channel_length,1,8);
}
}
/*for (aarx=0;aarx<PHY_vars_UE->lte_frame_parms.nb_antennas_rx; aarx++) {
for (aa=0;aa<PHY_vars_UE->lte_frame_parms.nb_antennas_tx; aa++) {
sprintf(fname,"ch%d%d.m",(aarx+1), (aa+1));
write_output(fname,"ch",eNB2UE[0]->ch[2*aarx+aa],eNB2UE[0]->channel_length,1,8);
}
} */
/*write_output("ch0.m","ch0",eNB2UE[0]->ch[0],eNB2UE[0]->channel_length,1,8);
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1) if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)
write_output("ch1.m","ch1",eNB2UE[0]->ch[PHY_vars_eNB->lte_frame_parms.nb_antennas_rx],eNB2UE[0]->channel_length,1,8); write_output("ch1.m","ch1",eNB2UE[0]->ch[PHY_vars_eNB->lte_frame_parms.nb_antennas_rx],eNB2UE[0]->channel_length,1,8);*/
//common vars //common vars
write_output("rxsig0.m","rxs0", &PHY_vars_UE->lte_ue_common_vars.rxdata[0][0],10*PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1); write_output("rxsig0.m","rxs0", &PHY_vars_UE->lte_ue_common_vars.rxdata[0][0],10*PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1);
write_output("rxsigF0.m","rxsF0", &PHY_vars_UE->lte_ue_common_vars.rxdataF[0][0],PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1); write_output("rxsigF0.m","rxsF0", &PHY_vars_UE->lte_ue_common_vars.rxdataF[0][0],PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1);
...@@ -3076,9 +3397,10 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3076,9 +3397,10 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1); PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
//pdsch_vars //pdsch_vars
dump_dlsch2(PHY_vars_UE,eNB_id,coded_bits_per_codeword,round); dump_dlsch2(PHY_vars_UE,eNB_id,coded_bits_per_codeword,round,PHY_vars_UE->dlsch_ue[0][1]->current_harq_pid );
//dump_dlsch2(PHY_vars_UE,eNB_id_i,coded_bits_per_codeword); //dump_dlsch2(PHY_vars_UE,eNB_id_i,coded_bits_per_codeword);
write_output("dlsch_e.m","e",PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4); // write_output("dlsch_e.m","e",PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
//pdcch_vars //pdcch_vars
write_output("pdcchF0_ext.m","pdcchF_ext", PHY_vars_UE->lte_ue_pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size,1,1); write_output("pdcchF0_ext.m","pdcchF_ext", PHY_vars_UE->lte_ue_pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size,1,1);
...@@ -3105,211 +3427,303 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3105,211 +3427,303 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
} }
} }
for (int cw=Kmimo-1;cw>=0;cw--){ for (int cw=0; cw<Kmimo;cw++){
PHY_vars_UE->dlsch_ue[0][cw]->rnti = (common_flag==0) ? n_rnti: SI_RNTI; PHY_vars_UE->dlsch_ue[0][cw]->rnti = (common_flag==0) ? n_rnti: SI_RNTI;
coded_bits_per_codeword = get_G(&PHY_vars_eNB->lte_frame_parms, coded_bits_per_codeword = get_G(&PHY_vars_eNB->lte_frame_parms,
PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->nb_rb, PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->nb_rb,
PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->rb_alloc, PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->rb_alloc,
get_Qm(PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->mcs), get_Qm(PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->mcs),
PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->Nl, PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->Nl,
num_pdcch_symbols, num_pdcch_symbols,
0,subframe); 0,subframe);
PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw]->current_harq_pid]->G = coded_bits_per_codeword;
PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw]->current_harq_pid]->G = coded_bits_per_codeword;
/* if (n_frames==1) {
// calculate uncoded BLER printf("Kmimo=%d, cw=%d, G=%d, TBS=%d\n",Kmimo,cw,coded_bits_per_codeword,
uncoded_ber=0; PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw]->current_harq_pid]->TBS);
for (i=0;i<coded_bits_per_codeword;i++)
if (PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->e[i] != (PHY_vars_UE->lte_ue_pdsch_vars[0]->llr[0][i]<0)) { // calculate uncoded BER
uncoded_ber_bit[i] = 1; uncoded_ber_bit = (short*) malloc(sizeof(short)*coded_bits_per_codeword);
uncoded_ber++; AssertFatal(uncoded_ber_bit, "uncoded_ber_bit==NULL");
} sprintf(fname,"dlsch%d_rxF_r%d_cw%d_llr.m",eNB_id,round, cw);
else sprintf(vname,"dl%d_r%d_cw%d_llr",eNB_id,round, cw);
uncoded_ber_bit[i] = 0; write_output(fname,vname, PHY_vars_UE->lte_ue_pdsch_vars[0]->llr[cw],coded_bits_per_codeword,1,0);
sprintf(fname,"dlsch_cw%d_e.m", cw);
sprintf(vname,"dlsch_cw%d_e", cw);
write_output(fname, vname,PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
uncoded_ber=0;
for (i=0;i<coded_bits_per_codeword;i++)
if (PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->e[i] != (PHY_vars_UE->lte_ue_pdsch_vars[0]->llr[cw][i]<0)) {
uncoded_ber_bit[i] = 1;
uncoded_ber++;
}
else
uncoded_ber_bit[i] = 0;
uncoded_ber/=coded_bits_per_codeword;
avg_ber += uncoded_ber;
sprintf(fname,"cw%d_uncoded_ber_bit.m", cw);
sprintf(vname,"uncoded_ber_bit_cw%d", cw);
write_output(fname, vname,uncoded_ber_bit,coded_bits_per_codeword,1,0);
printf("cw %d, uncoded ber %f\n",cw,uncoded_ber);
uncoded_ber/=coded_bits_per_codeword; free(uncoded_ber_bit);
avg_ber += uncoded_ber; uncoded_ber_bit = NULL;
if (n_frames==1)
write_output("uncoded_ber_bit.m","uncoded_ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
*/
start_meas(&PHY_vars_UE->dlsch_unscrambling_stats);
dlsch_unscrambling(&PHY_vars_UE->lte_frame_parms,
0,
PHY_vars_UE->dlsch_ue[0][cw],
coded_bits_per_codeword,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->llr[cw],
0,
subframe<<1);
stop_meas(&PHY_vars_UE->dlsch_unscrambling_stats);
start_meas(&PHY_vars_UE->dlsch_decoding_stats);
ret = dlsch_decoding(PHY_vars_UE,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->llr[cw],
&PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->dlsch_ue[0][cw],
PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw]->current_harq_pid],
subframe,
PHY_vars_UE->dlsch_ue[0][cw]->current_harq_pid,
1,llr8_flag);
stop_meas(&PHY_vars_UE->dlsch_decoding_stats);
if (cw==1) {
if (ret <= PHY_vars_UE->dlsch_ue[0][cw]->max_turbo_iterations) {
}
else {
errs2[round]++;
} }
}
}
stop_meas(&PHY_vars_UE->phy_proc_rx); start_meas(&PHY_vars_UE->dlsch_unscrambling_stats);
dlsch_unscrambling(&PHY_vars_UE->lte_frame_parms,
0,
PHY_vars_UE->dlsch_ue[0][cw],
coded_bits_per_codeword,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->llr[cw],
cw,
subframe<<1);
stop_meas(&PHY_vars_UE->dlsch_unscrambling_stats);
start_meas(&PHY_vars_UE->dlsch_decoding_stats);
ret = dlsch_decoding(PHY_vars_UE,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->llr[cw],
&PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->dlsch_ue[0][cw],
PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw]->current_harq_pid],
subframe,
PHY_vars_UE->dlsch_ue[0][cw]->current_harq_pid,
1,llr8_flag);
stop_meas(&PHY_vars_UE->dlsch_decoding_stats);
if (ret <= PHY_vars_UE->dlsch_ue[0][cw]->max_turbo_iterations ) {
if (cw==0) {
avg_iter += ret;
iter_trials++;
}
if (n_frames==1) {
printf("cw %d, round %d: No DLSCH errors found, uncoded ber %f\n",cw,round,uncoded_ber);
#ifdef PRINT_BYTES
for (s=0;s<PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->C;s++) {
if (s<PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->Cminus)
Kr = PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->Kminus;
else
Kr = PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->Kplus;
Kr_bytes = Kr>>3;
printf("Decoded_output (Segment %d):\n",s);
for (i=0;i<Kr_bytes;i++)
printf("%d : %x (%x)\n",i,PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->c[s][i],
PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->c[s][i]^PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->c[s][i]);
}
#endif
}
PHY_vars_UE->total_TBS[eNB_id] = PHY_vars_UE->total_TBS[eNB_id] + PHY_vars_UE->dlsch_ue[eNB_id][cw]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][cw]->current_harq_pid]->TBS;
if (ret <= PHY_vars_UE->dlsch_ue[0][0]->max_turbo_iterations) { if (PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->mimo_mode == LARGE_CDD) { //try to decode second stream using SIC
avg_iter += ret;
iter_trials++;
if (n_frames==1)
printf("No DLSCH errors found (round %d),uncoded ber %f\n",round,uncoded_ber);
PHY_vars_UE->total_TBS[eNB_id] = PHY_vars_UE->total_TBS[eNB_id] + PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->TBS;
TB0_active = 0;
if (PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->mimo_mode == LARGE_CDD) { //try to decode second stream using SIC
/* /*
for (round = 0 ; round < PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->round ; round++) { //for (round = 0 ; round < PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->round ; round++) {
// re-encoding of first stream // we assume here that the second stream has a lower MCS and is thus more likely to be decoded
dlsch0_ue_harq = PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]; // re-encoding of second stream
dlsch0_eNB_harq = PHY_vars_UE->dlsch_eNB[eNB_id]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]; dlsch0_ue_harq = PHY_vars_UE->dlsch_ue[eNB_id][1]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid];
dlsch0_eNB_harq->mimo_mode = LARGE_CDD; dlsch0_eNB_harq = PHY_vars_UE->dlsch_eNB[eNB_id]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid];
dlsch0_eNB_harq->rb_alloc[0] = dlsch0_ue_harq->rb_alloc[0]; dlsch0_eNB_harq->mimo_mode = LARGE_CDD;
dlsch0_eNB_harq->nb_rb = dlsch0_ue_harq->nb_rb; dlsch0_eNB_harq->rb_alloc[0] = dlsch0_ue_harq->rb_alloc[0];
dlsch0_eNB_harq->mcs = dlsch0_ue_harq->mcs; dlsch0_eNB_harq->nb_rb = dlsch0_ue_harq->nb_rb;
dlsch0_eNB_harq->rvidx = dlsch0_ue_harq->rvidx; dlsch0_eNB_harq->mcs = dlsch0_ue_harq->mcs;
dlsch0_eNB_harq->Nl = dlsch0_ue_harq->Nl; dlsch0_eNB_harq->rvidx = dlsch0_ue_harq->rvidx;
dlsch0_eNB_harq->Nl = dlsch0_ue_harq->Nl;
dlsch0_eNB_harq->TBS = dlsch0_ue_harq->TBS; dlsch0_eNB_harq->round = dlsch0_ue_harq->round;
dlsch0_eNB_harq->dl_power_off = dlsch0_ue_harq->dl_power_off;
dlsch0_eNB_harq->status = dlsch0_ue_harq->status; dlsch0_eNB_harq->TBS = dlsch0_ue_harq->TBS;
dlsch0_eNB_harq->dl_power_off = dlsch0_ue_harq->dl_power_off;
PHY_vars_UE->dlsch_eNB[eNB_id]->active = PHY_vars_UE->dlsch_ue[eNB_id][0]->active; dlsch0_eNB_harq->status = dlsch0_ue_harq->status;
PHY_vars_UE->dlsch_eNB[eNB_id]->rnti = PHY_vars_UE->dlsch_ue[eNB_id][0]->rnti;
PHY_vars_UE->dlsch_eNB[eNB_id]->active = PHY_vars_UE->dlsch_ue[eNB_id][1]->active;
dlsch_encoding(PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->b, PHY_vars_UE->dlsch_eNB[eNB_id]->rnti = PHY_vars_UE->dlsch_ue[eNB_id][1]->rnti;
&PHY_vars_UE->lte_frame_parms, PHY_vars_UE->dlsch_eNB[eNB_id]->current_harq_pid = PHY_vars_UE->dlsch_ue[eNB_id][1]->current_harq_pid;
num_pdcch_symbols,
PHY_vars_UE->dlsch_eNB[0], dlsch_encoding(PHY_vars_UE->dlsch_ue[eNB_id][1]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][1]->current_harq_pid]->b,
0,subframe, &PHY_vars_UE->lte_frame_parms,
&PHY_vars_UE->dlsch_rate_matching_stats, num_pdcch_symbols,
&PHY_vars_UE->dlsch_turbo_encoding_stats, PHY_vars_UE->dlsch_eNB[eNB_id],
&PHY_vars_UE->dlsch_interleaving_stats 0,subframe,
); &PHY_vars_UE->dlsch_rate_matching_stats,
&PHY_vars_UE->dlsch_turbo_encoding_stats,
//scrambling &PHY_vars_UE->dlsch_interleaving_stats
);
//modulation
coded_bits_per_codeword = get_G(&PHY_vars_UE->lte_frame_parms,
//stripping (from matched filter output?) PHY_vars_UE->dlsch_eNB[eNB_id]->harq_processes[PHY_vars_UE->dlsch_eNB[eNB_id]->current_harq_pid]->nb_rb,
PHY_vars_UE->dlsch_eNB[eNB_id]->harq_processes[PHY_vars_UE->dlsch_eNB[eNB_id]->current_harq_pid]->rb_alloc,
//detection of second stream get_Qm(PHY_vars_UE->dlsch_eNB[eNB_id]->harq_processes[PHY_vars_UE->dlsch_eNB[eNB_id]->current_harq_pid]->mcs),
} PHY_vars_UE->dlsch_eNB[eNB_id]->harq_processes[PHY_vars_UE->dlsch_eNB[eNB_id]->current_harq_pid]->Nl,
num_pdcch_symbols,
0,subframe);
//scrambling
dlsch_scrambling(&PHY_vars_UE->lte_frame_parms,
0,
PHY_vars_UE->dlsch_eNB[eNB_id],
coded_bits_per_codeword,
0,
subframe<<1);
//modulation
re_allocated = dlsch_modulation(sic_buffer,
AMP,
subframe,
&PHY_vars_UE->lte_frame_parms,
num_pdcch_symbols,
&PHY_vars_UE->dlsch_eNB[0][0],
NULL);
// sic_buffer is a vector of size nb_antennas_tx, but both contain the same signal, since we do modulation without precoding
// precoding is contained in effective channel estimate
// compute the norm of the effective channel for both receive antennas -> alphha[0], alphha[2]
// multiply with the norm of the effective channnel
*/ */
}
} //stripping (from matched filter output of first stream = rxdataF_comp0)
else { // this is pseudocode
errs[round]++; /*
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id].rxdataF_ext[i] -= alpha[i].*sic_buffer[i];
}
*/
//apply rho to output
/*
dlsch_channel_compensation(PHY_vars_UE->lte_ue_pdsch_vars[eNB_id].rxdataF_ext,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id].dl_ch_rho_ext[harq_pid][round],
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->dl_ch_mag1,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->dl_ch_magb1,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1,
NULL,
frame_parms,
symbol,
first_symbol_flag,
i_mod,
nb_rb,
lte_ue_pdsch_vars[eNB_id]->log2_maxh,
phy_measurements); // log2_maxh+I0_shift
*/
avg_iter += ret-1;
iter_trials++; //detection of second stream
//}
if (n_frames==1) {
//if ((n_frames==1) || (SNR>=30)) {
printf("DLSCH errors found (round %d), uncoded ber %f\n",round,uncoded_ber);
for (s=0;s<PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->C;s++) {
if (s<PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->Cminus)
Kr = PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->Kminus;
else
Kr = PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->Kplus;
Kr_bytes = Kr>>3;
printf("Decoded_output (Segment %d):\n",s);
for (i=0;i<Kr_bytes;i++)
printf("%d : %x (%x)\n",i,PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->c[s][i],PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->c[s][i]^PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->c[s][i]);
}
sprintf(fname,"rxsig0_r%d.m",round);
sprintf(vname,"rxs0_r%d.m",round);
write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdata[0][0],10*PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1);
sprintf(fname,"rxsigF0_r%d.m",round);
sprintf(vname,"rxs0F_r%d.m",round);
write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdataF[0][0],2*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,2,1);
if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) {
sprintf(fname,"rxsig1_r%d.m",round);
sprintf(vname,"rxs1_r%d.m",round);
write_output(fname,vname, PHY_vars_UE->lte_ue_common_vars.rxdata[1],PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1);
sprintf(fname,"rxsig1F_r%d.m",round);
sprintf(vname,"rxs1F_r%d.m",round);
write_output(fname,vname, PHY_vars_UE->lte_ue_common_vars.rxdataF[1],2*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,2,1);
} }
sprintf(fname,"dlsch00_r%d.m",round); }
sprintf(vname,"dl00_r%d.m",round); else {
write_output(fname,vname, errs[cw][round]++;
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][0][0]),
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1); if (cw==0) {
if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) { avg_iter += ret-1;
sprintf(fname,"dlsch01_r%d.m",round); iter_trials++;
sprintf(vname,"dl01_r%d.m",round);
write_output(fname,vname,
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][1][0]),
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
} }
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1) {
sprintf(fname,"dlsch10_r%d.m",round); if (cw==1) {
sprintf(vname,"dl10_r%d.m",round); avg_iter += ret-1;
write_output(fname,vname, iter_trials++;
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][2][0]),
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
} }
if ((PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) && (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)) {
sprintf(fname,"dlsch11_r%d.m",round); if (n_frames==1) {
sprintf(vname,"dl11_r%d.m",round); //if ((n_frames==1) || (SNR>=30)) {
write_output(fname,vname, printf("cw %d, round %d: DLSCH errors found, uncoded ber %f\n",cw,round,uncoded_ber);
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][3][0]), #ifdef PRINT_BYTES
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1); for (s=0;s<PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->C;s++) {
if (s<PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->Cminus)
Kr = PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->Kminus;
else
Kr = PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->Kplus;
Kr_bytes = Kr>>3;
printf("Decoded_output (Segment %d):\n",s);
for (i=0;i<Kr_bytes;i++)
printf("%d : %x (%x)\n",i,PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->c[s][i],
PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[0]->c[s][i]^PHY_vars_eNB->dlsch_eNB[0][cw]->harq_processes[0]->c[s][i]);
}
#endif
} }
//pdsch_vars }
dump_dlsch2(PHY_vars_UE,eNB_id,coded_bits_per_codeword,round); }
/*
stop_meas(&PHY_vars_UE->phy_proc_rx);
if (n_frames==1) {
sprintf(fname,"rxsig0_r%d.m",round);
sprintf(vname,"rxs0_r%d",round);
write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdata[0][0],10*PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1);
sprintf(fname,"rxsigF0_r%d.m",round);
sprintf(vname,"rxs0F_r%d",round);
write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdataF[0][0],2*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,2,1);
if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) {
sprintf(fname,"rxsig1_r%d.m",round);
sprintf(vname,"rxs1_r%d",round);
write_output(fname,vname, PHY_vars_UE->lte_ue_common_vars.rxdata[1],PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1);
sprintf(fname,"rxsig1F_r%d.m",round);
sprintf(vname,"rxs1F_r%d",round);
write_output(fname,vname, PHY_vars_UE->lte_ue_common_vars.rxdataF[1],2*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,2,1);
}
sprintf(fname,"dlsch00_r%d.m",round);
sprintf(vname,"dl00_r%d",round);
write_output(fname,vname,
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][0][0]),
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1);
if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) {
sprintf(fname,"dlsch01_r%d.m",round);
sprintf(vname,"dl01_r%d",round);
write_output(fname,vname,
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][1][0]),
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
}
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1) {
sprintf(fname,"dlsch10_r%d.m",round);
sprintf(vname,"dl10_r%d",round);
write_output(fname,vname,
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][2][0]),
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
}
if ((PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) && (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)) {
sprintf(fname,"dlsch11_r%d.m",round);
sprintf(vname,"dl11_r%d",round);
write_output(fname,vname,
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][3][0]),
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
}
//pdsch_vars
dump_dlsch2(PHY_vars_UE,eNB_id,coded_bits_per_codeword,round,PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid);
/*
write_output("dlsch_e.m","e",PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4); write_output("dlsch_e.m","e",PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0); write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
write_output("dlsch_eNB_w.m","w",PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,4); write_output("dlsch_eNB_w.m","w",PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,4);
write_output("dlsch_UE_w.m","w",PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0); write_output("dlsch_UE_w.m","w",PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0);
*/ */
if (round == 3) exit(-1); if (round == 3) exit(-1);
}
// printf("round %d errors %d/%d\n",round,errs[round],trials);
round++;
// PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->round++;
} }
#ifdef XFORMS #ifdef XFORMS
phy_scope_UE(form_ue, if (xforms==1) {
PHY_vars_UE, phy_scope_UE(form_ue,
eNB_id, PHY_vars_UE,
0,// UE_id eNB_id,
subframe); 0,// UE_id
subframe);
}
#endif #endif
round++;
} //round } //round
// printf("\n");
if ((errs[0]>=n_frames/10) && (trials>(n_frames/2))) //if ((errs[0][0]>=n_frames/10) && (trials>(n_frames/2)) )
break; // break;
//len = chbch_stats_read(stats_buffer,NULL,0,4096); //len = chbch_stats_read(stats_buffer,NULL,0,4096);
//printf("%s\n\n",stats_buffer); //printf("%s\n\n",stats_buffer);
...@@ -3327,34 +3741,34 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3327,34 +3741,34 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
* get the max, min, and number of packets that exceed t>2000us * get the max, min, and number of packets that exceed t>2000us
*/ */
double t_tx = (double)PHY_vars_eNB->phy_proc_tx.p_time/cpu_freq_GHz/1000.0; double t_tx = (double)PHY_vars_eNB->phy_proc_tx.p_time/cpu_freq_GHz/1000.0;
double t_tx_ifft = (double)PHY_vars_eNB->ofdm_mod_stats.p_time/cpu_freq_GHz/1000.0; double t_tx_ifft = (double)PHY_vars_eNB->ofdm_mod_stats.p_time/cpu_freq_GHz/1000.0;
double t_tx_mod = (double)PHY_vars_eNB->dlsch_modulation_stats.p_time/cpu_freq_GHz/1000.0; double t_tx_mod = (double)PHY_vars_eNB->dlsch_modulation_stats.p_time/cpu_freq_GHz/1000.0;
double t_tx_enc = (double)PHY_vars_eNB->dlsch_encoding_stats.p_time/cpu_freq_GHz/1000.0; double t_tx_enc = (double)PHY_vars_eNB->dlsch_encoding_stats.p_time/cpu_freq_GHz/1000.0;
double t_rx = (double)PHY_vars_UE->phy_proc_rx.p_time/cpu_freq_GHz/1000.0; double t_rx = (double)PHY_vars_UE->phy_proc_rx.p_time/cpu_freq_GHz/1000.0;
double t_rx_fft = (double)PHY_vars_UE->ofdm_demod_stats.p_time/cpu_freq_GHz/1000.0; double t_rx_fft = (double)PHY_vars_UE->ofdm_demod_stats.p_time/cpu_freq_GHz/1000.0;
double t_rx_demod = (double)PHY_vars_UE->dlsch_rx_pdcch_stats.p_time/cpu_freq_GHz/1000.0; double t_rx_demod = (double)PHY_vars_UE->dlsch_rx_pdcch_stats.p_time/cpu_freq_GHz/1000.0;
double t_rx_dec = (double)PHY_vars_UE->dlsch_decoding_stats.p_time/cpu_freq_GHz/1000.0; double t_rx_dec = (double)PHY_vars_UE->dlsch_decoding_stats.p_time/cpu_freq_GHz/1000.0;
if (t_tx > t_tx_max) if (t_tx > t_tx_max)
t_tx_max = t_tx; t_tx_max = t_tx;
if (t_tx < t_tx_min) if (t_tx < t_tx_min)
t_tx_min = t_tx; t_tx_min = t_tx;
if (t_rx > t_rx_max) if (t_rx > t_rx_max)
t_rx_max = t_rx; t_rx_max = t_rx;
if (t_rx < t_rx_min) if (t_rx < t_rx_min)
t_rx_min = t_rx; t_rx_min = t_rx;
if (t_tx > 2000) if (t_tx > 2000)
n_tx_dropped++; n_tx_dropped++;
if (t_rx > 2000) if (t_rx > 2000)
n_rx_dropped++; n_rx_dropped++;
push_front(&time_vector_tx, t_tx); push_front(&time_vector_tx, t_tx);
push_front(&time_vector_tx_ifft, t_tx_ifft); push_front(&time_vector_tx_ifft, t_tx_ifft);
push_front(&time_vector_tx_mod, t_tx_mod); push_front(&time_vector_tx_mod, t_tx_mod);
push_front(&time_vector_tx_enc, t_tx_enc); push_front(&time_vector_tx_enc, t_tx_enc);
push_front(&time_vector_rx, t_rx); push_front(&time_vector_rx, t_rx);
push_front(&time_vector_rx_fft, t_rx_fft); push_front(&time_vector_rx_fft, t_rx_fft);
push_front(&time_vector_rx_demod, t_rx_demod); push_front(&time_vector_rx_demod, t_rx_demod);
...@@ -3451,20 +3865,27 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3451,20 +3865,27 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
(double)tx_lev_dB+10*log10(PHY_vars_UE->lte_frame_parms.ofdm_symbol_size/(NB_RB*12)), (double)tx_lev_dB+10*log10(PHY_vars_UE->lte_frame_parms.ofdm_symbol_size/(NB_RB*12)),
sigma2_dB); sigma2_dB);
printf("Errors (%d(%d)/%d %d/%d %d/%d %d/%d), Pe = (%e,%e,%e,%e), dci_errors %d/%d, Pe = %e => effective rate %f (%2.1f%%,%f, %f), normalized delay %f (%f)\n", printf("Errors (%d(%d)/%d %d(%d)/%d %d(%d)/%d %d(%d)/%d), Pe = (%e(%e),%e(%e),%e(%e),%e(%e)), dci_errors %d/%d, Pe = %e => effective rate %f (%2.1f%%,%f, %f), normalized delay %f (%f)\n",
errs[0], errs[0][0],
errs2[0], errs[1][0],
round_trials[0], round_trials[0],
errs[1], errs[0][1],
round_trials[0], errs[1][1],
errs[2], round_trials[1],
round_trials[0], errs[0][2],
errs[3], errs[1][2],
round_trials[0], round_trials[2],
(double)errs[0]/(round_trials[0]), errs[0][3],
(double)errs[1]/(round_trials[0]), errs[1][3],
(double)errs[2]/(round_trials[0]), round_trials[3],
(double)errs[3]/(round_trials[0]), (double)errs[0][0]/(round_trials[0]),
(double)errs[1][0]/(round_trials[0]),
(double)errs[0][1]/(round_trials[1]),
(double)errs[1][1]/(round_trials[1]),
(double)errs[0][2]/(round_trials[2]),
(double)errs[1][2]/(round_trials[2]),
(double)errs[0][3]/(round_trials[3]),
(double)errs[1][3]/(round_trials[3]),
dci_errors, dci_errors,
round_trials[0], round_trials[0],
(double)dci_errors/(round_trials[0]), (double)dci_errors/(round_trials[0]),
...@@ -3472,8 +3893,8 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3472,8 +3893,8 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
100*effective_rate, 100*effective_rate,
rate, rate,
rate*get_Qm(PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->mcs), rate*get_Qm(PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->mcs),
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/(double)PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS, (1.0*(round_trials[0]-errs[0][0])+2.0*(round_trials[1]-errs[0][1])+3.0*(round_trials[2]-errs[0][2])+4.0*(round_trials[3]-errs[0][3]))/((double)round_trials[0])/(double)PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS,
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); (1.0*(round_trials[0]-errs[0][0])+2.0*(round_trials[1]-errs[0][1])+3.0*(round_trials[2]-errs[0][2])+4.0*(round_trials[3]-errs[0][3]))/((double)round_trials[0]));
if (print_perf==1) { if (print_perf==1) {
printf("eNB TX function statistics (per 1ms subframe)\n\n"); printf("eNB TX function statistics (per 1ms subframe)\n\n");
...@@ -3547,54 +3968,80 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3547,54 +3968,80 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
PHY_vars_UE->dlsch_tc_intl2_stats.trials); PHY_vars_UE->dlsch_tc_intl2_stats.trials);
} }
if ((transmission_mode != 3) && (transmission_mode != 4)) { if ((transmission_mode != 3) && (transmission_mode != 4)) {
fprintf(bler_fd,"%f;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n", fprintf(bler_fd,"%f;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n",
SNR, SNR,
mcs1, mcs1,
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS, PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS,
rate, rate,
errs[0], errs[0][0],
round_trials[0], round_trials[0],
errs[1], errs[0][1],
round_trials[1], round_trials[1],
errs[2], errs[0][2],
round_trials[2], round_trials[2],
errs[3], errs[0][3],
round_trials[3], round_trials[3],
dci_errors); dci_errors);
} }
else { else {
fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n", fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d\n",
SNR, SNR,
mcs1,mcs2, mcs1,mcs2,
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS, PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS,
PHY_vars_eNB->dlsch_eNB[0][1]->harq_processes[0]->TBS, PHY_vars_eNB->dlsch_eNB[0][1]->harq_processes[0]->TBS,
rate, rate,
errs[0], errs[0][0],
errs[1][0],
round_trials[0], round_trials[0],
errs[1], errs[0][1],
errs[1][1],
round_trials[1], round_trials[1],
errs[2], errs[0][2],
errs[1][2],
round_trials[2], round_trials[2],
errs[3], errs[0][3],
errs[1][3],
round_trials[3], round_trials[3],
dci_errors); dci_errors);
} }
if(abstx){ //ABSTRACTION if(abstx){ //ABSTRACTION
blerr[0] = (double)errs[0]/(round_trials[0]); if ((transmission_mode != 3)&& (transmission_mode != 4)) {
if(num_rounds>1){ blerr[0][0] = (double)errs[0][0]/(round_trials[0]);
blerr[1] = (double)errs[1]/(round_trials[1]);
blerr[2] = (double)errs[2]/(round_trials[2]); if(num_rounds>1){
blerr[3] = (double)errs[3]/(round_trials[3]); blerr[0][1] = (double)errs[0][1]/(round_trials[1]);
fprintf(csv_fd,"%e,%e,%e,%e;\n",blerr[0],blerr[1],blerr[2],blerr[3]);
blerr[0][2] = (double)errs[0][2]/(round_trials[2]);
blerr[0][3] = (double)errs[0][3]/(round_trials[3]);
fprintf(csv_fd,"%e;%e;%e;%e;\n",blerr[0][0],blerr[0][1],blerr[0][2],blerr[0][3]);
}
else {
fprintf(csv_fd,"%e;\n",blerr[0][0]);
}
} }
else { else {
fprintf(csv_fd,"%e;\n",blerr[0]); blerr[0][0] = (double)errs[0][0]/(round_trials[0]);
blerr[1][0] = (double)errs[1][0]/(round_trials[0]);
if(num_rounds>1){
blerr[0][1] = (double)errs[0][1]/(round_trials[1]);
blerr[1][1] = (double)errs[1][1]/(round_trials[1]);
blerr[0][2] = (double)errs[0][2]/(round_trials[2]);
blerr[1][2] = (double)errs[1][2]/(round_trials[2]);
blerr[0][3] = (double)errs[0][3]/(round_trials[3]);
blerr[1][3] = (double)errs[1][3]/(round_trials[3]);
fprintf(csv_fd,"%e;%e;%e;%e;%e;%e;%e;%e;\n",blerr[0][0],blerr[1][0],blerr[0][1],blerr[1][1],blerr[0][2],blerr[1][2], blerr[0][3], blerr[1][3]);
}
else {
fprintf(csv_fd,"%e,%e;\n",blerr[0][0], blerr[1][0]);
}
} }
} //ABStraction }
if ( (test_perf != 0) && (100 * effective_rate > test_perf )) { if ( (test_perf != 0) && (100 * effective_rate > test_perf )) {
//fprintf(time_meas_fd,"SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err\n"); //fprintf(time_meas_fd,"SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err\n");
if ((transmission_mode != 3) && (transmission_mode != 4)) { if ((transmission_mode != 3) && (transmission_mode != 4)) {
...@@ -3603,13 +4050,13 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3603,13 +4050,13 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
mcs1, mcs1,
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS, PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS,
rate, rate,
errs[0], errs[0][0],
round_trials[0], round_trials[0],
errs[1], errs[0][1],
round_trials[1], round_trials[1],
errs[2], errs[0][2],
round_trials[2], round_trials[2],
errs[3], errs[0][3],
round_trials[3], round_trials[3],
dci_errors); dci_errors);
...@@ -3622,23 +4069,23 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3622,23 +4069,23 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
100*effective_rate, 100*effective_rate,
rate, rate,
(double)avg_iter/iter_trials, (double)avg_iter/iter_trials,
errs[0], errs[0][0],
round_trials[0], round_trials[0],
errs[1], errs[0][1],
round_trials[1], round_trials[1],
errs[2], errs[0][2],
round_trials[2], round_trials[2],
errs[3], errs[0][3],
round_trials[3], round_trials[3],
(double)errs[0]/(round_trials[0]), (double)errs[0][0]/(round_trials[0]),
(double)errs[1]/(round_trials[0]), (double)errs[0][1]/(round_trials[0]),
(double)errs[2]/(round_trials[0]), (double)errs[0][2]/(round_trials[0]),
(double)errs[3]/(round_trials[0]), (double)errs[0][3]/(round_trials[0]),
dci_errors, dci_errors,
round_trials[0], round_trials[0],
(double)dci_errors/(round_trials[0]), (double)dci_errors/(round_trials[0]),
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/(double)PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS, (1.0*(round_trials[0]-errs[0][0])+2.0*(round_trials[1]-errs[0][1])+3.0*(round_trials[2]-errs[0][2])+4.0*(round_trials[3]-errs[0][3]))/((double)round_trials[0])/(double)PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS,
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); (1.0*(round_trials[0]-errs[0][0])+2.0*(round_trials[1]-errs[0][1])+3.0*(round_trials[2]-errs[0][2])+4.0*(round_trials[3]-errs[0][3]))/((double)round_trials[0]));
} }
else { else {
fprintf(time_meas_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;", fprintf(time_meas_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;",
...@@ -3647,13 +4094,13 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3647,13 +4094,13 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS, PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS,
PHY_vars_eNB->dlsch_eNB[0][1]->harq_processes[0]->TBS, PHY_vars_eNB->dlsch_eNB[0][1]->harq_processes[0]->TBS,
rate, rate,
errs[0], errs[0][0],
round_trials[0], round_trials[0],
errs[1], errs[0][1],
round_trials[1], round_trials[1],
errs[2], errs[0][2],
round_trials[2], round_trials[2],
errs[3], errs[0][3],
round_trials[3], round_trials[3],
dci_errors); dci_errors);
...@@ -3667,23 +4114,23 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3667,23 +4114,23 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
100*effective_rate, 100*effective_rate,
rate, rate,
(double)avg_iter/iter_trials, (double)avg_iter/iter_trials,
errs[0], errs[0][0],
round_trials[0], round_trials[0],
errs[1], errs[0][1],
round_trials[1], round_trials[1],
errs[2], errs[0][2],
round_trials[2], round_trials[2],
errs[3], errs[0][3],
round_trials[3], round_trials[3],
(double)errs[0]/(round_trials[0]), (double)errs[0][0]/(round_trials[0]),
(double)errs[1]/(round_trials[0]), (double)errs[0][1]/(round_trials[0]),
(double)errs[2]/(round_trials[0]), (double)errs[0][2]/(round_trials[0]),
(double)errs[3]/(round_trials[0]), (double)errs[0][3]/(round_trials[0]),
dci_errors, dci_errors,
round_trials[0], round_trials[0],
(double)dci_errors/(round_trials[0]), (double)dci_errors/(round_trials[0]),
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/(double)PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS, (1.0*(round_trials[0]-errs[0][0])+2.0*(round_trials[1]-errs[0][1])+3.0*(round_trials[2]-errs[0][2])+4.0*(round_trials[3]-errs[0][3]))/((double)round_trials[0])/(double)PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS,
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); (1.0*(round_trials[0]-errs[0][0])+2.0*(round_trials[1]-errs[0][1])+3.0*(round_trials[2]-errs[0][2])+4.0*(round_trials[3]-errs[0][3]))/((double)round_trials[0]));
} }
//fprintf(time_meas_fd,"eNB_PROC_TX(%d); OFDM_MOD(%d); DL_MOD(%d); DL_SCR(%d); DL_ENC(%d); UE_PROC_RX(%d); OFDM_DEMOD_CH_EST(%d); RX_PDCCH(%d); CH_COMP_LLR(%d); DL_USCR(%d); DL_DECOD(%d);\n", //fprintf(time_meas_fd,"eNB_PROC_TX(%d); OFDM_MOD(%d); DL_MOD(%d); DL_SCR(%d); DL_ENC(%d); UE_PROC_RX(%d); OFDM_DEMOD_CH_EST(%d); RX_PDCCH(%d); CH_COMP_LLR(%d); DL_USCR(%d); DL_DECOD(%d);\n",
fprintf(time_meas_fd,"%d; %d; %d; %d; %d; %d; %d; %d; %d; %d; %d;", fprintf(time_meas_fd,"%d; %d; %d; %d; %d; %d; %d; %d; %d; %d; %d;",
...@@ -3738,7 +4185,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3738,7 +4185,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
fprintf(time_meas_fd,"%f;%f;%f;%f\n", std_phy_proc_rx_dec, rx_dec_median, rx_dec_q1, rx_dec_q3); fprintf(time_meas_fd,"%f;%f;%f;%f\n", std_phy_proc_rx_dec, rx_dec_median, rx_dec_q1, rx_dec_q3);
/* /*
fprintf(time_meas_fd,"%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;", fprintf(time_meas_fd,"%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;",
PHY_vars_eNB->phy_proc_tx.trials, PHY_vars_eNB->phy_proc_tx.trials,
PHY_vars_eNB->ofdm_mod_stats.trials, PHY_vars_eNB->ofdm_mod_stats.trials,
...@@ -3754,16 +4201,19 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3754,16 +4201,19 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
*/ */
printf("[passed] effective rate : %f (%2.1f%%,%f)): log and break \n",rate*effective_rate, 100*effective_rate, rate ); printf("[passed] effective rate : %f (%2.1f%%,%f)): log and break \n",rate*effective_rate, 100*effective_rate, rate );
break; break;
} else if (test_perf !=0 ){ } else if (test_perf !=0 ){
printf("[continue] effective rate : %f (%2.1f%%,%f)): increase snr \n",rate*effective_rate, 100*effective_rate, rate); printf("[continue] effective rate : %f (%2.1f%%,%f)): increase snr \n",rate*effective_rate, 100*effective_rate, rate);
} }
if (((double)errs[0]/(round_trials[0]))<1e-2) if (((double)errs[0][0]/(round_trials[0]))<1e-2 && ((double)errs[1][0]/(round_trials[0]))<1e-2)
break; break;
}// SNR
if (n_frames==1)
break;
}// SNR
} //ch_realization } //ch_realization
fclose(bler_fd); fclose(bler_fd);
...@@ -3781,9 +4231,6 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, ...@@ -3781,9 +4231,6 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
fclose(csv_fd); fclose(csv_fd);
} }
if (uncoded_ber_bit)
free(uncoded_ber_bit);
uncoded_ber_bit = NULL;
for (k=0;k<n_users;k++) { for (k=0;k<n_users;k++) {
free(input_buffer0[k]); free(input_buffer0[k]);
free(input_buffer1[k]); free(input_buffer1[k]);
......
...@@ -174,7 +174,13 @@ typedef enum { ...@@ -174,7 +174,13 @@ typedef enum {
Rice1, Rice1,
Rice1_corr, Rice1_corr,
Rice1_anticorr, Rice1_anticorr,
AWGN AWGN,
Rayleigh1_orthogonal,
Rayleigh1_orth_eff_ch_TM4_prec_real,
Rayleigh1_orth_eff_ch_TM4_prec_imag,
Rayleigh8_orth_eff_ch_TM4_prec_real,
Rayleigh8_orth_eff_ch_TM4_prec_imag,
TS_SHIFT,
} SCM_t; } SCM_t;
/** /**
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
//#define DEBUG_CH //#define DEBUG_CH
extern void print_shorts(char *s,__m128i *x);
void fill_channel_desc(channel_desc_t *chan_desc, void fill_channel_desc(channel_desc_t *chan_desc,
uint8_t nb_tx, uint8_t nb_tx,
uint8_t nb_rx, uint8_t nb_rx,
...@@ -119,7 +121,12 @@ void fill_channel_desc(channel_desc_t *chan_desc, ...@@ -119,7 +121,12 @@ void fill_channel_desc(channel_desc_t *chan_desc,
} }
} }
else { else {
chan_desc->R_sqrt = R_sqrt; chan_desc->R_sqrt = (struct complex**) calloc(nb_taps,sizeof(struct complex*));
for (i = 0; i<nb_taps; i++) {
chan_desc->R_sqrt[i] = (struct complex*) calloc(nb_tx*nb_rx*nb_tx*nb_rx,sizeof(struct complex));
//chan_desc->R_sqrt = (struct complex*)&R_sqrt[i][0];
chan_desc->R_sqrt[i] = R_sqrt[0];
}
} }
for (i = 0; i<nb_taps; i++) { for (i = 0; i<nb_taps; i++) {
...@@ -159,6 +166,9 @@ double etu_amps_dB[] = {-1.0,-1.0,-1.0,0.0,0.0,0.0,-3.0,-5.0,-7.0}; ...@@ -159,6 +166,9 @@ double etu_amps_dB[] = {-1.0,-1.0,-1.0,0.0,0.0,0.0,-3.0,-5.0,-7.0};
double default_amps_lin[] = {0.3868472 , 0.3094778 , 0.1547389 , 0.0773694 , 0.0386847 , 0.0193424 , 0.0096712 , 0.0038685}; double default_amps_lin[] = {0.3868472 , 0.3094778 , 0.1547389 , 0.0773694 , 0.0386847 , 0.0193424 , 0.0096712 , 0.0038685};
double default_amp_lin[] = {1}; double default_amp_lin[] = {1};
double ts_shift_delays[] = {0, 1/7.68};
double ts_shift_amps[] = {0, 1};
//correlation matrix for a 2x2 channel with full Tx correlation //correlation matrix for a 2x2 channel with full Tx correlation
struct complex R_sqrt_22_corr_tap[16] = {{0.70711,0}, {0.0, 0.0}, {0.70711,0}, {0.0, 0.0}, struct complex R_sqrt_22_corr_tap[16] = {{0.70711,0}, {0.0, 0.0}, {0.70711,0}, {0.0, 0.0},
{0.0, 0.0}, {0.70711,0}, {0.0, 0.0}, {0.70711,0}, {0.0, 0.0}, {0.70711,0}, {0.0, 0.0}, {0.70711,0},
...@@ -183,6 +193,36 @@ struct complex *R_sqrt_21_anticorr[1] = {R_sqrt_21_anticorr_tap}; ...@@ -183,6 +193,36 @@ struct complex *R_sqrt_21_anticorr[1] = {R_sqrt_21_anticorr_tap};
struct complex **R_sqrt_ptr2; struct complex **R_sqrt_ptr2;
// full correlation matrix in vectorized form for 2x2 channel, where h1 is perfectly orthogonal to h2
struct complex R_sqrt_22_orthogonal_tap[16] = {{0.70711,0.0}, {0.0, 0.0}, {0.0,0.0}, {0.0, 0.0},
{0.0, 0.0}, {0.0,0.0}, {0.0, 0.0}, {0.0,0.0},
{0.0,0.0}, {0.0, 0.0}, {0.0,0.0}, {0.0, 0.0},
{0.0, 0.0}, {0.0,0.0}, {0.0, 0.0}, {0.70711,0.0}};
struct complex *R_sqrt_22_orthogonal[1] = {R_sqrt_22_orthogonal_tap};
// full correlation matrix for TM4 to make orthogonal effective channel
struct complex R_sqrt_22_orth_eff_ch_TM4_prec_real_tap[16] = {{0.70711,0.0}, {0.0, 0.0}, {0.70711,0.0}, {0.0, 0.0},
{0.0, 0.0}, {0.70711,0.0}, {0.0, 0.0}, {-0.70711,0.0},
{0.70711,0.0}, {0.0, 0.0}, {0.70711,0.0}, {0.0, 0.0},
{0.0, 0.0}, {-0.70711,0.0}, {0.0, 0.0}, {0.70711,0.0}};
struct complex *R_sqrt_22_orth_eff_ch_TM4_prec_real[1] = {R_sqrt_22_orth_eff_ch_TM4_prec_real_tap};
struct complex R_sqrt_22_orth_eff_ch_TM4_prec_imag_tap[16] = {{0.70711,0.0}, {0.0,0.0}, {0.0, -0.70711}, {0.0,0.0},
{0.0, 0.0}, {0.70711,0.0}, {0.0, 0.0}, {0.0,0.70711},
{0.0,-0.70711}, {0.0, 0.0}, {-0.70711,0.0}, {0.0, 0.0},
{0.0, 0.0}, {0.0,0.70711}, {0.0, 0.70711}, {-0.70711,0.0}};
struct complex *R_sqrt_22_orth_eff_ch_TM4_prec_imag[1] = {R_sqrt_22_orth_eff_ch_TM4_prec_imag_tap};
//Rayleigh1_orth_eff_ch_TM4
channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
uint8_t nb_rx, uint8_t nb_rx,
...@@ -629,7 +669,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, ...@@ -629,7 +669,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
aoa = .03; aoa = .03;
maxDoppler = 0; maxDoppler = 0;
if ((nb_tx==2) && (nb_rx==1)) { if ((nb_tx==2) && (nb_rx==1)) { //check this
R_sqrt_ptr2 = R_sqrt_21_anticorr; R_sqrt_ptr2 = R_sqrt_21_anticorr;
} }
else if ((nb_tx==2) && (nb_rx==2)) { else if ((nb_tx==2) && (nb_rx==2)) {
...@@ -710,6 +750,34 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, ...@@ -710,6 +750,34 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
break; break;
case TS_SHIFT:
nb_taps = 2;
Td = ts_shift_delays[1];
channel_length = 10;
ricean_factor = 0.0;
aoa = 0.0;
maxDoppler = 0;
fill_channel_desc(chan_desc,nb_tx,
nb_rx,
nb_taps,
channel_length,
ts_shift_amps,
ts_shift_delays,
NULL,
Td,
BW,
ricean_factor,
aoa,
forgetting_factor,
maxDoppler,
channel_offset,
path_loss_dB,
0);
printf("TS_SHIFT: ricean_factor %f\n",chan_desc->ricean_factor);
break;
case Rice1_corr: case Rice1_corr:
nb_taps = 1; nb_taps = 1;
Td = 0; Td = 0;
...@@ -779,7 +847,176 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, ...@@ -779,7 +847,176 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
path_loss_dB, path_loss_dB,
1); 1);
break; break;
case Rayleigh1_orthogonal:
nb_taps = 1;
Td = 0;
channel_length = 1;
ricean_factor = 1;
aoa = 0.03;
maxDoppler = 0;
if ((nb_tx==2) && (nb_rx==2)) {
R_sqrt_ptr2 = R_sqrt_22_orthogonal;
}
else
R_sqrt_ptr2 = NULL;
fill_channel_desc(chan_desc,nb_tx,
nb_rx,
nb_taps,
channel_length,
default_amp_lin,
NULL,
R_sqrt_ptr2,
Td,
BW,
ricean_factor,
aoa,
forgetting_factor,
maxDoppler,
channel_offset,
path_loss_dB,
0);
break;
case Rayleigh1_orth_eff_ch_TM4_prec_real:
nb_taps = 1;
Td = 0;
channel_length = 1;
ricean_factor = 1;
aoa = 0.03;
maxDoppler = 0;
if ((nb_tx==2) && (nb_rx==2)) {
R_sqrt_ptr2 = R_sqrt_22_orth_eff_ch_TM4_prec_real;
}
else
R_sqrt_ptr2 = NULL;
fill_channel_desc(chan_desc,nb_tx,
nb_rx,
nb_taps,
channel_length,
default_amp_lin,
NULL,
R_sqrt_ptr2,
Td,
BW,
ricean_factor,
aoa,
forgetting_factor,
maxDoppler,
channel_offset,
path_loss_dB,
0);
break;
case Rayleigh1_orth_eff_ch_TM4_prec_imag:
nb_taps = 1;
Td = 0;
channel_length = 1;
ricean_factor = 1;
aoa = 0.03;
maxDoppler = 0;
if ((nb_tx==2) && (nb_rx==2)) {
R_sqrt_ptr2 = R_sqrt_22_orth_eff_ch_TM4_prec_imag;
}
else
R_sqrt_ptr2 = NULL;
fill_channel_desc(chan_desc,nb_tx,
nb_rx,
nb_taps,
channel_length,
default_amp_lin,
NULL,
R_sqrt_ptr2,
Td,
BW,
ricean_factor,
aoa,
forgetting_factor,
maxDoppler,
channel_offset,
path_loss_dB,
0);
break;
case Rayleigh8_orth_eff_ch_TM4_prec_real:
if ((nb_tx==2) && (nb_rx==2)) {
R_sqrt_ptr2 = R_sqrt_22_orth_eff_ch_TM4_prec_real;
//R_sqrt_ptr2 = NULL;
}
else
R_sqrt_ptr2 = NULL;
nb_taps = 8;
Td = 0.8;
channel_length = (int)11+2*BW*Td;
ricean_factor = 1;
aoa = .03;
maxDoppler = 0;
fill_channel_desc(chan_desc,
nb_tx,
nb_rx,
nb_taps,
channel_length,
default_amps_lin,
NULL,
R_sqrt_ptr2,
Td,
BW,
ricean_factor,
aoa,
forgetting_factor,
maxDoppler,
channel_offset,
path_loss_dB,
0);
break;
case Rayleigh8_orth_eff_ch_TM4_prec_imag:
nb_taps = 8;
Td = 0.8;
channel_length = (int)11+2*BW*Td;
ricean_factor = 1;
aoa = .03;
maxDoppler = 0;
if ((nb_tx==2) && (nb_rx==2)) {
R_sqrt_ptr2 = R_sqrt_22_orth_eff_ch_TM4_prec_imag;
}
else
R_sqrt_ptr2 = NULL;
fill_channel_desc(chan_desc,
nb_tx,
nb_rx,
nb_taps,
channel_length,
default_amps_lin,
NULL,
R_sqrt_ptr2,
Td,
BW,
ricean_factor,
aoa,
forgetting_factor,
maxDoppler,
channel_offset,
path_loss_dB,
0);
break;
default: default:
LOG_W(OCM,"channel model not yet supported\n"); LOG_W(OCM,"channel model not yet supported\n");
free(chan_desc); free(chan_desc);
...@@ -906,6 +1143,11 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { ...@@ -906,6 +1143,11 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) {
if (desc->channel_length == 1) { if (desc->channel_length == 1) {
desc->ch[aarx+(aatx*desc->nb_rx)][0].x = desc->a[0][aarx+(aatx*desc->nb_rx)].x; desc->ch[aarx+(aatx*desc->nb_rx)][0].x = desc->a[0][aarx+(aatx*desc->nb_rx)].x;
desc->ch[aarx+(aatx*desc->nb_rx)][0].y = desc->a[0][aarx+(aatx*desc->nb_rx)].y; desc->ch[aarx+(aatx*desc->nb_rx)][0].y = desc->a[0][aarx+(aatx*desc->nb_rx)].y;
#ifdef DEBUG_CH
k=0;
printf("(%d,%d,%d)->(%f,%f)\n",k,aarx,aatx,desc->ch[aarx+(aatx*desc->nb_rx)][k].x,desc->ch[aarx+(aatx*desc->nb_rx)][k].y);
#endif
} }
else { else {
......
...@@ -134,7 +134,7 @@ int logInit (void) ...@@ -134,7 +134,7 @@ int logInit (void)
} }
g_log->log_component[PHY].name = "PHY"; g_log->log_component[PHY].name = "PHY";
g_log->log_component[PHY].level = LOG_EMERG; g_log->log_component[PHY].level = LOG_DEBUG;
g_log->log_component[PHY].flag = LOG_MED; g_log->log_component[PHY].flag = LOG_MED;
g_log->log_component[PHY].interval = 1; g_log->log_component[PHY].interval = 1;
g_log->log_component[PHY].fd = 0; g_log->log_component[PHY].fd = 0;
...@@ -142,7 +142,7 @@ int logInit (void) ...@@ -142,7 +142,7 @@ int logInit (void)
g_log->log_component[PHY].filelog_name = "/tmp/phy.log"; g_log->log_component[PHY].filelog_name = "/tmp/phy.log";
g_log->log_component[MAC].name = "MAC"; g_log->log_component[MAC].name = "MAC";
g_log->log_component[MAC].level = LOG_EMERG; g_log->log_component[MAC].level = LOG_DEBUG;
g_log->log_component[MAC].flag = LOG_MED; g_log->log_component[MAC].flag = LOG_MED;
g_log->log_component[MAC].interval = 1; g_log->log_component[MAC].interval = 1;
g_log->log_component[MAC].fd = 0; g_log->log_component[MAC].fd = 0;
...@@ -150,7 +150,7 @@ int logInit (void) ...@@ -150,7 +150,7 @@ int logInit (void)
g_log->log_component[MAC].filelog_name = "/tmp/mac.log"; g_log->log_component[MAC].filelog_name = "/tmp/mac.log";
g_log->log_component[OPT].name = "OPT"; g_log->log_component[OPT].name = "OPT";
g_log->log_component[OPT].level = LOG_EMERG; g_log->log_component[OPT].level = LOG_DEBUG;
g_log->log_component[OPT].flag = LOG_MED; g_log->log_component[OPT].flag = LOG_MED;
g_log->log_component[OPT].interval = 1; g_log->log_component[OPT].interval = 1;
g_log->log_component[OPT].fd = 0; g_log->log_component[OPT].fd = 0;
...@@ -158,7 +158,7 @@ int logInit (void) ...@@ -158,7 +158,7 @@ int logInit (void)
g_log->log_component[OPT].filelog_name = ""; g_log->log_component[OPT].filelog_name = "";
g_log->log_component[RLC].name = "RLC"; g_log->log_component[RLC].name = "RLC";
g_log->log_component[RLC].level = LOG_INFO; g_log->log_component[RLC].level = LOG_DEBUG;
g_log->log_component[RLC].flag = LOG_MED; g_log->log_component[RLC].flag = LOG_MED;
g_log->log_component[RLC].interval = 1; g_log->log_component[RLC].interval = 1;
g_log->log_component[RLC].fd = 0; g_log->log_component[RLC].fd = 0;
...@@ -166,7 +166,7 @@ int logInit (void) ...@@ -166,7 +166,7 @@ int logInit (void)
g_log->log_component[RLC].filelog_name = "/tmp/rlc.log"; g_log->log_component[RLC].filelog_name = "/tmp/rlc.log";
g_log->log_component[PDCP].name = "PDCP"; g_log->log_component[PDCP].name = "PDCP";
g_log->log_component[PDCP].level = LOG_INFO; g_log->log_component[PDCP].level = LOG_DEBUG;
g_log->log_component[PDCP].flag = LOG_MED; g_log->log_component[PDCP].flag = LOG_MED;
g_log->log_component[PDCP].interval = 1; g_log->log_component[PDCP].interval = 1;
g_log->log_component[PDCP].fd = 0; g_log->log_component[PDCP].fd = 0;
...@@ -174,7 +174,7 @@ int logInit (void) ...@@ -174,7 +174,7 @@ int logInit (void)
g_log->log_component[PDCP].filelog_name = "/tmp/pdcp.log"; g_log->log_component[PDCP].filelog_name = "/tmp/pdcp.log";
g_log->log_component[RRC].name = "RRC"; g_log->log_component[RRC].name = "RRC";
g_log->log_component[RRC].level = LOG_TRACE; g_log->log_component[RRC].level = LOG_DEBUG;
g_log->log_component[RRC].flag = LOG_MED; g_log->log_component[RRC].flag = LOG_MED;
g_log->log_component[RRC].interval = 1; g_log->log_component[RRC].interval = 1;
g_log->log_component[RRC].fd = 0; g_log->log_component[RRC].fd = 0;
...@@ -182,7 +182,7 @@ int logInit (void) ...@@ -182,7 +182,7 @@ int logInit (void)
g_log->log_component[RRC].filelog_name = "/tmp/rrc.log"; g_log->log_component[RRC].filelog_name = "/tmp/rrc.log";
g_log->log_component[NAS].name = "NAS"; g_log->log_component[NAS].name = "NAS";
g_log->log_component[NAS].level = LOG_TRACE; g_log->log_component[NAS].level = LOG_DEBUG;
g_log->log_component[NAS].flag = LOG_MED; g_log->log_component[NAS].flag = LOG_MED;
g_log->log_component[NAS].interval = 1; g_log->log_component[NAS].interval = 1;
g_log->log_component[NAS].fd = 0; g_log->log_component[NAS].fd = 0;
...@@ -190,7 +190,7 @@ int logInit (void) ...@@ -190,7 +190,7 @@ int logInit (void)
g_log->log_component[NAS].filelog_name = "/tmp/nas.log"; g_log->log_component[NAS].filelog_name = "/tmp/nas.log";
g_log->log_component[EMU].name = "EMU"; g_log->log_component[EMU].name = "EMU";
g_log->log_component[EMU].level = LOG_EMERG; g_log->log_component[EMU].level = LOG_DEBUG;
g_log->log_component[EMU].flag = LOG_MED; g_log->log_component[EMU].flag = LOG_MED;
g_log->log_component[EMU].interval = 1; g_log->log_component[EMU].interval = 1;
g_log->log_component[EMU].fd = 0; g_log->log_component[EMU].fd = 0;
...@@ -198,7 +198,7 @@ int logInit (void) ...@@ -198,7 +198,7 @@ int logInit (void)
g_log->log_component[EMU].filelog_name = ""; g_log->log_component[EMU].filelog_name = "";
g_log->log_component[OMG].name = "OMG"; g_log->log_component[OMG].name = "OMG";
g_log->log_component[OMG].level = LOG_EMERG; g_log->log_component[OMG].level = LOG_DEBUG;
g_log->log_component[OMG].flag = LOG_MED; g_log->log_component[OMG].flag = LOG_MED;
g_log->log_component[OMG].interval = 1; g_log->log_component[OMG].interval = 1;
g_log->log_component[OMG].fd = 0; g_log->log_component[OMG].fd = 0;
...@@ -206,7 +206,7 @@ int logInit (void) ...@@ -206,7 +206,7 @@ int logInit (void)
g_log->log_component[OMG].filelog_name = "/tmp/omg.csv"; g_log->log_component[OMG].filelog_name = "/tmp/omg.csv";
g_log->log_component[OTG].name = "OTG"; g_log->log_component[OTG].name = "OTG";
g_log->log_component[OTG].level = LOG_EMERG; g_log->log_component[OTG].level = LOG_DEBUG;
g_log->log_component[OTG].flag = LOG_MED; g_log->log_component[OTG].flag = LOG_MED;
g_log->log_component[OTG].interval = 1; g_log->log_component[OTG].interval = 1;
g_log->log_component[OTG].fd = 0; g_log->log_component[OTG].fd = 0;
...@@ -214,7 +214,7 @@ int logInit (void) ...@@ -214,7 +214,7 @@ int logInit (void)
g_log->log_component[OTG].filelog_name = "/tmp/otg.log"; g_log->log_component[OTG].filelog_name = "/tmp/otg.log";
g_log->log_component[OTG_LATENCY].name = "OTG_LATENCY"; g_log->log_component[OTG_LATENCY].name = "OTG_LATENCY";
g_log->log_component[OTG_LATENCY].level = LOG_EMERG; g_log->log_component[OTG_LATENCY].level = LOG_DEBUG;
g_log->log_component[OTG_LATENCY].flag = LOG_MED; g_log->log_component[OTG_LATENCY].flag = LOG_MED;
g_log->log_component[OTG_LATENCY].interval = 1; g_log->log_component[OTG_LATENCY].interval = 1;
g_log->log_component[OTG_LATENCY].fd = 0; g_log->log_component[OTG_LATENCY].fd = 0;
...@@ -222,7 +222,7 @@ int logInit (void) ...@@ -222,7 +222,7 @@ int logInit (void)
g_log->log_component[OTG_LATENCY].filelog_name = "/tmp/otg_latency.dat"; g_log->log_component[OTG_LATENCY].filelog_name = "/tmp/otg_latency.dat";
g_log->log_component[OTG_LATENCY_BG].name = "OTG_LATENCY_BG"; g_log->log_component[OTG_LATENCY_BG].name = "OTG_LATENCY_BG";
g_log->log_component[OTG_LATENCY_BG].level = LOG_EMERG; g_log->log_component[OTG_LATENCY_BG].level = LOG_DEBUG;
g_log->log_component[OTG_LATENCY_BG].flag = LOG_MED; g_log->log_component[OTG_LATENCY_BG].flag = LOG_MED;
g_log->log_component[OTG_LATENCY_BG].interval = 1; g_log->log_component[OTG_LATENCY_BG].interval = 1;
g_log->log_component[OTG_LATENCY_BG].fd = 0; g_log->log_component[OTG_LATENCY_BG].fd = 0;
...@@ -230,7 +230,7 @@ int logInit (void) ...@@ -230,7 +230,7 @@ int logInit (void)
g_log->log_component[OTG_LATENCY_BG].filelog_name = "/tmp/otg_latency_bg.dat"; g_log->log_component[OTG_LATENCY_BG].filelog_name = "/tmp/otg_latency_bg.dat";
g_log->log_component[OTG_GP].name = "OTG_GP"; g_log->log_component[OTG_GP].name = "OTG_GP";
g_log->log_component[OTG_GP].level = LOG_EMERG; g_log->log_component[OTG_GP].level = LOG_DEBUG;
g_log->log_component[OTG_GP].flag = LOG_MED; g_log->log_component[OTG_GP].flag = LOG_MED;
g_log->log_component[OTG_GP].interval = 1; g_log->log_component[OTG_GP].interval = 1;
g_log->log_component[OTG_GP].fd = 0; g_log->log_component[OTG_GP].fd = 0;
...@@ -238,7 +238,7 @@ int logInit (void) ...@@ -238,7 +238,7 @@ int logInit (void)
g_log->log_component[OTG_GP].filelog_name = "/tmp/otg_goodput.dat"; g_log->log_component[OTG_GP].filelog_name = "/tmp/otg_goodput.dat";
g_log->log_component[OTG_GP_BG].name = "OTG_GP_BG"; g_log->log_component[OTG_GP_BG].name = "OTG_GP_BG";
g_log->log_component[OTG_GP_BG].level = LOG_EMERG; g_log->log_component[OTG_GP_BG].level = LOG_DEBUG;
g_log->log_component[OTG_GP_BG].flag = LOG_MED; g_log->log_component[OTG_GP_BG].flag = LOG_MED;
g_log->log_component[OTG_GP_BG].interval = 1; g_log->log_component[OTG_GP_BG].interval = 1;
g_log->log_component[OTG_GP_BG].fd = 0; g_log->log_component[OTG_GP_BG].fd = 0;
...@@ -246,7 +246,7 @@ int logInit (void) ...@@ -246,7 +246,7 @@ int logInit (void)
g_log->log_component[OTG_GP_BG].filelog_name = "/tmp/otg_goodput_bg.dat"; g_log->log_component[OTG_GP_BG].filelog_name = "/tmp/otg_goodput_bg.dat";
g_log->log_component[OTG_JITTER].name = "OTG_JITTER"; g_log->log_component[OTG_JITTER].name = "OTG_JITTER";
g_log->log_component[OTG_JITTER].level = LOG_EMERG; g_log->log_component[OTG_JITTER].level = LOG_DEBUG;
g_log->log_component[OTG_JITTER].flag = LOG_MED; g_log->log_component[OTG_JITTER].flag = LOG_MED;
g_log->log_component[OTG_JITTER].interval = 1; g_log->log_component[OTG_JITTER].interval = 1;
g_log->log_component[OTG_JITTER].fd = 0; g_log->log_component[OTG_JITTER].fd = 0;
...@@ -254,7 +254,7 @@ int logInit (void) ...@@ -254,7 +254,7 @@ int logInit (void)
g_log->log_component[OTG_JITTER].filelog_name = "/tmp/otg_jitter.dat"; g_log->log_component[OTG_JITTER].filelog_name = "/tmp/otg_jitter.dat";
g_log->log_component[OCG].name = "OCG"; g_log->log_component[OCG].name = "OCG";
g_log->log_component[OCG].level = LOG_EMERG; g_log->log_component[OCG].level = LOG_DEBUG;
g_log->log_component[OCG].flag = LOG_MED; g_log->log_component[OCG].flag = LOG_MED;
g_log->log_component[OCG].interval = 1; g_log->log_component[OCG].interval = 1;
g_log->log_component[OCG].fd = 0; g_log->log_component[OCG].fd = 0;
...@@ -262,7 +262,7 @@ int logInit (void) ...@@ -262,7 +262,7 @@ int logInit (void)
g_log->log_component[OCG].filelog_name = ""; g_log->log_component[OCG].filelog_name = "";
g_log->log_component[PERF].name = "PERF"; g_log->log_component[PERF].name = "PERF";
g_log->log_component[PERF].level = LOG_EMERG; g_log->log_component[PERF].level = LOG_DEBUG;
g_log->log_component[PERF].flag = LOG_MED; g_log->log_component[PERF].flag = LOG_MED;
g_log->log_component[PERF].interval = 1; g_log->log_component[PERF].interval = 1;
g_log->log_component[PERF].fd = 0; g_log->log_component[PERF].fd = 0;
...@@ -270,7 +270,7 @@ int logInit (void) ...@@ -270,7 +270,7 @@ int logInit (void)
g_log->log_component[PERF].filelog_name = ""; g_log->log_component[PERF].filelog_name = "";
g_log->log_component[OIP].name = "OIP"; g_log->log_component[OIP].name = "OIP";
g_log->log_component[OIP].level = LOG_EMERG; g_log->log_component[OIP].level = LOG_DEBUG;
g_log->log_component[OIP].flag = LOG_MED; g_log->log_component[OIP].flag = LOG_MED;
g_log->log_component[OIP].interval = 1; g_log->log_component[OIP].interval = 1;
g_log->log_component[OIP].fd = 0; g_log->log_component[OIP].fd = 0;
...@@ -278,7 +278,7 @@ int logInit (void) ...@@ -278,7 +278,7 @@ int logInit (void)
g_log->log_component[OIP].filelog_name = ""; g_log->log_component[OIP].filelog_name = "";
g_log->log_component[CLI].name = "CLI"; g_log->log_component[CLI].name = "CLI";
g_log->log_component[CLI].level = LOG_EMERG; g_log->log_component[CLI].level = LOG_DEBUG;
g_log->log_component[CLI].flag = LOG_MED; g_log->log_component[CLI].flag = LOG_MED;
g_log->log_component[CLI].interval = 1; g_log->log_component[CLI].interval = 1;
g_log->log_component[CLI].fd = 0; g_log->log_component[CLI].fd = 0;
...@@ -286,7 +286,7 @@ int logInit (void) ...@@ -286,7 +286,7 @@ int logInit (void)
g_log->log_component[CLI].filelog_name = ""; g_log->log_component[CLI].filelog_name = "";
g_log->log_component[MSC].name = "MSC"; g_log->log_component[MSC].name = "MSC";
g_log->log_component[MSC].level = LOG_EMERG; g_log->log_component[MSC].level = LOG_DEBUG;
g_log->log_component[MSC].flag = LOG_MED; g_log->log_component[MSC].flag = LOG_MED;
g_log->log_component[MSC].interval = 1; g_log->log_component[MSC].interval = 1;
g_log->log_component[MSC].fd = 0; g_log->log_component[MSC].fd = 0;
...@@ -294,7 +294,7 @@ int logInit (void) ...@@ -294,7 +294,7 @@ int logInit (void)
g_log->log_component[MSC].filelog_name = "/tmp/msc.log"; g_log->log_component[MSC].filelog_name = "/tmp/msc.log";
g_log->log_component[OCM].name = "OCM"; g_log->log_component[OCM].name = "OCM";
g_log->log_component[OCM].level = LOG_EMERG; g_log->log_component[OCM].level = LOG_DEBUG;
g_log->log_component[OCM].flag = LOG_MED; g_log->log_component[OCM].flag = LOG_MED;
g_log->log_component[OCM].interval = 1; g_log->log_component[OCM].interval = 1;
g_log->log_component[OCM].fd = 0; g_log->log_component[OCM].fd = 0;
...@@ -302,7 +302,7 @@ int logInit (void) ...@@ -302,7 +302,7 @@ int logInit (void)
g_log->log_component[OCM].filelog_name = "/tmp/ocm.log"; g_log->log_component[OCM].filelog_name = "/tmp/ocm.log";
g_log->log_component[UDP_].name = "UDP"; g_log->log_component[UDP_].name = "UDP";
g_log->log_component[UDP_].level = LOG_EMERG; g_log->log_component[UDP_].level = LOG_DEBUG;
g_log->log_component[UDP_].flag = LOG_FULL; g_log->log_component[UDP_].flag = LOG_FULL;
g_log->log_component[UDP_].interval = 1; g_log->log_component[UDP_].interval = 1;
g_log->log_component[UDP_].fd = 0; g_log->log_component[UDP_].fd = 0;
...@@ -310,7 +310,7 @@ int logInit (void) ...@@ -310,7 +310,7 @@ int logInit (void)
g_log->log_component[UDP_].filelog_name = ""; g_log->log_component[UDP_].filelog_name = "";
g_log->log_component[GTPU].name = "GTPV1U"; g_log->log_component[GTPU].name = "GTPV1U";
g_log->log_component[GTPU].level = LOG_EMERG; g_log->log_component[GTPU].level = LOG_DEBUG;
g_log->log_component[GTPU].flag = LOG_FULL; g_log->log_component[GTPU].flag = LOG_FULL;
g_log->log_component[GTPU].interval = 1; g_log->log_component[GTPU].interval = 1;
g_log->log_component[GTPU].fd = 0; g_log->log_component[GTPU].fd = 0;
...@@ -318,7 +318,7 @@ int logInit (void) ...@@ -318,7 +318,7 @@ int logInit (void)
g_log->log_component[GTPU].filelog_name = ""; g_log->log_component[GTPU].filelog_name = "";
g_log->log_component[S1AP].name = "S1AP"; g_log->log_component[S1AP].name = "S1AP";
g_log->log_component[S1AP].level = LOG_EMERG; g_log->log_component[S1AP].level = LOG_DEBUG;
g_log->log_component[S1AP].flag = LOG_FULL; g_log->log_component[S1AP].flag = LOG_FULL;
g_log->log_component[S1AP].interval = 1; g_log->log_component[S1AP].interval = 1;
g_log->log_component[S1AP].fd = 0; g_log->log_component[S1AP].fd = 0;
...@@ -326,7 +326,7 @@ int logInit (void) ...@@ -326,7 +326,7 @@ int logInit (void)
g_log->log_component[S1AP].filelog_name = ""; g_log->log_component[S1AP].filelog_name = "";
g_log->log_component[SCTP].name = "SCTP"; g_log->log_component[SCTP].name = "SCTP";
g_log->log_component[SCTP].level = LOG_EMERG; g_log->log_component[SCTP].level = LOG_DEBUG;
g_log->log_component[SCTP].flag = LOG_MED; g_log->log_component[SCTP].flag = LOG_MED;
g_log->log_component[SCTP].interval = 1; g_log->log_component[SCTP].interval = 1;
g_log->log_component[SCTP].fd = 0; g_log->log_component[SCTP].fd = 0;
...@@ -334,7 +334,7 @@ int logInit (void) ...@@ -334,7 +334,7 @@ int logInit (void)
g_log->log_component[SCTP].filelog_name = ""; g_log->log_component[SCTP].filelog_name = "";
g_log->log_component[HW].name = "HW"; g_log->log_component[HW].name = "HW";
g_log->log_component[HW].level = LOG_EMERG; g_log->log_component[HW].level = LOG_DEBUG;
g_log->log_component[HW].flag = LOG_MED; g_log->log_component[HW].flag = LOG_MED;
g_log->log_component[HW].interval = 1; g_log->log_component[HW].interval = 1;
g_log->log_component[HW].fd = 0; g_log->log_component[HW].fd = 0;
...@@ -342,7 +342,7 @@ int logInit (void) ...@@ -342,7 +342,7 @@ int logInit (void)
g_log->log_component[HW].filelog_name = ""; g_log->log_component[HW].filelog_name = "";
g_log->log_component[OSA].name = "OSA"; g_log->log_component[OSA].name = "OSA";
g_log->log_component[OSA].level = LOG_EMERG; g_log->log_component[OSA].level = LOG_DEBUG;
g_log->log_component[OSA].flag = LOG_MED; g_log->log_component[OSA].flag = LOG_MED;
g_log->log_component[OSA].interval = 1; g_log->log_component[OSA].interval = 1;
g_log->log_component[OSA].fd = 0; g_log->log_component[OSA].fd = 0;
...@@ -350,7 +350,7 @@ int logInit (void) ...@@ -350,7 +350,7 @@ int logInit (void)
g_log->log_component[OSA].filelog_name = ""; g_log->log_component[OSA].filelog_name = "";
g_log->log_component[RAL_ENB].name = "eRAL"; g_log->log_component[RAL_ENB].name = "eRAL";
g_log->log_component[RAL_ENB].level = LOG_EMERG; g_log->log_component[RAL_ENB].level = LOG_DEBUG;
g_log->log_component[RAL_ENB].flag = LOG_MED; g_log->log_component[RAL_ENB].flag = LOG_MED;
g_log->log_component[RAL_ENB].interval = 1; g_log->log_component[RAL_ENB].interval = 1;
g_log->log_component[RAL_ENB].fd = 0; g_log->log_component[RAL_ENB].fd = 0;
...@@ -358,7 +358,7 @@ int logInit (void) ...@@ -358,7 +358,7 @@ int logInit (void)
g_log->log_component[RAL_ENB].filelog_name = ""; g_log->log_component[RAL_ENB].filelog_name = "";
g_log->log_component[RAL_UE].name = "mRAL"; g_log->log_component[RAL_UE].name = "mRAL";
g_log->log_component[RAL_UE].level = LOG_EMERG; g_log->log_component[RAL_UE].level = LOG_DEBUG;
g_log->log_component[RAL_UE].flag = LOG_MED; g_log->log_component[RAL_UE].flag = LOG_MED;
g_log->log_component[RAL_UE].interval = 1; g_log->log_component[RAL_UE].interval = 1;
g_log->log_component[RAL_UE].fd = 0; g_log->log_component[RAL_UE].fd = 0;
...@@ -366,7 +366,7 @@ int logInit (void) ...@@ -366,7 +366,7 @@ int logInit (void)
g_log->log_component[RAL_UE].filelog_name = ""; g_log->log_component[RAL_UE].filelog_name = "";
g_log->log_component[ENB_APP].name = "ENB_APP"; g_log->log_component[ENB_APP].name = "ENB_APP";
g_log->log_component[ENB_APP].level = LOG_EMERG; g_log->log_component[ENB_APP].level = LOG_DEBUG;
g_log->log_component[ENB_APP].flag = LOG_MED; g_log->log_component[ENB_APP].flag = LOG_MED;
g_log->log_component[ENB_APP].interval = 1; g_log->log_component[ENB_APP].interval = 1;
g_log->log_component[ENB_APP].fd = 0; g_log->log_component[ENB_APP].fd = 0;
...@@ -374,7 +374,7 @@ int logInit (void) ...@@ -374,7 +374,7 @@ int logInit (void)
g_log->log_component[ENB_APP].filelog_name = ""; g_log->log_component[ENB_APP].filelog_name = "";
g_log->log_component[TMR].name = "TMR"; g_log->log_component[TMR].name = "TMR";
g_log->log_component[TMR].level = LOG_EMERG; g_log->log_component[TMR].level = LOG_DEBUG;
g_log->log_component[TMR].flag = LOG_MED; g_log->log_component[TMR].flag = LOG_MED;
g_log->log_component[TMR].interval = 1; g_log->log_component[TMR].interval = 1;
g_log->log_component[TMR].fd = 0; g_log->log_component[TMR].fd = 0;
...@@ -391,7 +391,7 @@ int logInit (void) ...@@ -391,7 +391,7 @@ int logInit (void)
/* following log component are used for the localization*/ /* following log component are used for the localization*/
g_log->log_component[LOCALIZE].name = "LOCALIZE"; g_log->log_component[LOCALIZE].name = "LOCALIZE";
g_log->log_component[LOCALIZE].level = LOG_EMERG; g_log->log_component[LOCALIZE].level = LOG_DEBUG;
g_log->log_component[LOCALIZE].flag = LOG_MED; g_log->log_component[LOCALIZE].flag = LOG_MED;
g_log->log_component[LOCALIZE].interval = 1; g_log->log_component[LOCALIZE].interval = 1;
g_log->log_component[LOCALIZE].fd = 0; g_log->log_component[LOCALIZE].fd = 0;
......
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