Commit 93c1315b authored by Elena_Lukashova's avatar Elena_Lukashova

Adequate throughput computation for rank adaptation.

parent b596ede7
Branches unavailable
2024.w43 2024.w42 2024.w41 2024.w40 2024.w39 2024.w38 2024.w36 2024.w35 2024.w34 2024.w33 2024.w32 2024.w31 2024.w30 2024.w29 2024.w28 2024.w27 2024.w26 2024.w25 2024.w24 2024.w23 2024.w22 2024.w21 2024.w18 2024.w17 2024.w16 2024.w15 2024.w14 2024.w13 2024.w12 2024.w11 2024.w10 2024.w09 2024.w08 2024.w06 2024.w05 2024.w04 2024.w03 2024.w02 2024.w01 2023.w51 2023.w50 2023.w49 2023.w48 2023.w47 2023.w45 2023.w43 2023.w42 2023.w41 2023.w40 2023.w39 2023.w38 2023.w37 2023.w36 2023.w34 2023.w33 2023.w32 2023.w31 2023.w30 2023.w29 2023.w28 2023.w27 2023.w26 2023.w25 2023.w24 2023.w23 2023.w22 2023.w21 2023.w20 2023.w19 2023.w18 2023.w18b 2023.w16 2023.w15 2023.w14 2023.w13 2023.w12 2023.w11 2023.w11b 2023.w10 2023.w10b 2023.w09 2023.w08 2023.w08b 2023.w07 2023.w06 2023.w05 2023.w03 2023.w02 2022.42 2022.41 2022.w51 2022.w50 2022.w49 2022.w48 2022.w47 2022.w46 2022.w45 2022.w43 2022.w42 2022.w42b 2022.w41 2022.w40 2022.w39 2022.w38 2022.w37 2022.w37b 2022.w36 2022.w35 2022.w33 2022.w32 2022.w31 2022.w31b 2022.w30 2022.w29 2022.w26 2022.w25 2022.w24 2022.w24b 2022.w23 2022.w22 2022.w21 2022.w20 2022.w19 2022.w18 2022.w17 2022.w15 2022.w15b 2022.w14a 2022.w13 2022.w13b 2022.w13a 2022.w12 2022.w10 2022.w09 2022.w09b 2022.w08 2022.w08b 2022.w07 2022.w07b 2022.w06 2022.w06a 2022.w05 2022.w05b 2022.w03_hotfix 2022.w03_b 2022.w02 2022.w01 2021.wk46 2021.wk14_a 2021.wk13_d 2021.wk13_c 2021.w51_c 2021.w51_a 2021.w50_a 2021.w49_b 2021.w49_a 2021.w48 2021.w47 2021.w46 2021.w46-powder 2021.w45 2021.w45_b 2021.w44 2021.w43 2021.w42 2021.w37 2021.w36 2021.w35 2021.w34 2021.w33 2021.w32 2021.w31 2021.w30 2021.w29 2021.w28 2021.w27 2021.w26 2021.w25 2021.w24 2021.w23 2021.w22 2021.w20 2021.w19 2021.w18_b 2021.w18_a 2021.w17_b 2021.w16 2021.w15 2021.w14 2021.w13_a 2021.w12 2021.w11 2021.w10 2021.w09 2021.w08 2021.w06 2021.w05 2021.w04 2021.w02 2020.w51_2 2020.w51 2020.w50 2020.w49 2020.w48_2 2020.w48 2020.w47 2020.w46_2 2020.w46 2020.w45_2 2020.w45 2020.w44 2020.w42_2 2020.w42 2020.w41 2020.w39 2020.w38 2020.w37 2020.w36 2020.w34 2020.w33 2020.w31 2020.w30 2020.w29 2020.w28 2020.w26 2020.w25 2020.w24 2020.w23 2020.w22 2020.w19 2020.w17 2020.w16 2020.w15 2020.w11 2020.w09 2020.w06 2020.w05 2020.w04 2020.w03 2019.w51 2019.w44 2019.w41 2019.w36 2019.w30 2019.w28 2019.w27 2019.w25 2019.w23 2019.w21 2019.w17 2019.w15 2019.w13 2019.w11 2019.w10 2019.w09 2019.w08 2019.w07 2019.w06 2019.w04 2019.w03 2018.w51 2018.w48 2018.w47 2018.w46 2018.w44 2018.w41 2018.w40 2018.w39 2018.w36 2018.w33 2018.w31 2018.w29 2018.w25 2018.w19 2018.w15 2018.w12 2018.w11 2018.w10 2018.w09 2018.w08 2018.w07 2018.w06 2018.w05 2018.w04 2018.w03 2018.w02 2017.w48 2017.w46 2017.w43 2017.w42 2017.w34 2017.w30 2017.w25 2017.w24 v2.1.0 v2.0.0 v1.2.2 v1.2.1 v1.2.0 v1.1.1 v1.1.0 v1.0.3 v1.0.2 v1.0.1 v1.0.0 v0.6.1 v0.6.1_tdd setparam osa-etsi-ws-ue osa-etsi-ws-try2 osa-etsi-ws-try1 osa-etsi-ws-gNB oai_nr_sync nr-ip-over-lte nr-ip-over-lte-v.1.5 nr-ip-over-lte-v.1.4 nr-ip-over-lte-v.1.3 nr-ip-over-lte-v.1.2 nr-ip-over-lte-v.1.1 nr-ip-over-lte-v.1.0 flexran-eol develop-nr-pdcch develop-nr-2020w03 develop-nr-2020w02 develop-nr-2019w51 develop-nr-2019w50 develop-nr-2019w48 develop-nr-2019w47 develop-nr-2019w45 develop-nr-2019w43 develop-nr-2019w42 develop-nr-2019w40 develop-nr-2019w28 develop-nr-2019w23 benetel_phase_rotation benetel_gnb_rel_2.0 benetel_gnb_rel_1.0 benetel_enb_rel_2.0 benetel_enb_rel_1.0 ARC_1.3
No related merge requests found
...@@ -162,14 +162,17 @@ int main(int argc, char **argv) ...@@ -162,14 +162,17 @@ int main(int argc, char **argv)
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;
int active_tb0_sent[4]={0,0,0,0};
int active_tb1_sent[4]={0,0,0,0};
int TB=0; int TB=0;
RX_type_t rx_type=rx_standard; RX_type_t rx_type=rx_standard;
unsigned char cur_harq_pid; unsigned char cur_harq_pid;
int hold_rank1_precoder=0; int hold_rank1_precoder=0;
int tpmi_retr=0; int tpmi_retr=0;
bool is_first_time; bool is_first_time;
int rank_adapt =0; int rank_adapt =1;
int updated_csi = 0; int updated_csi = 0;
SCM_t channel_model=Rayleigh1; SCM_t channel_model=Rayleigh1;
...@@ -196,6 +199,8 @@ int main(int argc, char **argv) ...@@ -196,6 +199,8 @@ int main(int argc, char **argv)
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 *rankadapt_fd;
char rankadapt_fname[256];
FILE *input_trch_fd=NULL; FILE *input_trch_fd=NULL;
unsigned char input_trch_file=0; unsigned char input_trch_file=0;
...@@ -268,7 +273,8 @@ int main(int argc, char **argv) ...@@ -268,7 +273,8 @@ int main(int argc, char **argv)
double effective_rate=0.0; double effective_rate=0.0;
double thr_cw0_tm4 = 0.0; double thr_cw0_tm4 = 0.0, throug_tb0=0.0, throug_tb1=0.0, throug_tb0_acc[4]={0,0,0,0}, throug_tb1_acc[4]={0,0,0,0}, throug_tb0_acc_aver[4]={0,0,0,0}, throug_tb1_acc_aver[4]={0,0,0,0};
double throug_tot_acc_aver[4]={0,0,0,0}, throug_tot_acc_aver_all_rounds=0;
double thr_cw0_tm4_nonconst = 0.0; double thr_cw0_tm4_nonconst = 0.0;
double thr_cw0[4]={0,0,0,0}, thr_cw1[4]={0,0,0,0}, thr_cw0_tot = 0.0, thr_cw1_tot = 0.0; double thr_cw0[4]={0,0,0,0}, thr_cw1[4]={0,0,0,0}, thr_cw0_tot = 0.0, thr_cw1_tot = 0.0;
unsigned int tbs0_init=0, tbs1_init=0; unsigned int tbs0_init=0, tbs1_init=0;
...@@ -278,6 +284,7 @@ int main(int argc, char **argv) ...@@ -278,6 +284,7 @@ int main(int argc, char **argv)
int TB0_active = 1; int TB0_active = 1;
int TB1_active = 1; int TB1_active = 1;
int decoded_tb[2]={0,0};
uint32_t perfect_ce = 0; uint32_t perfect_ce = 0;
...@@ -807,6 +814,27 @@ int main(int argc, char **argv) ...@@ -807,6 +814,27 @@ int main(int argc, char **argv)
} }
} }
if (transmission_mode==3 || transmission_mode==4){
if (rank_adapt==1){
if (perfect_ce==1)
sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift);
else
sprintf(rankadapt_fname,"rank_adapt1_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift);
} else {
if (perfect_ce==1)
sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_pce_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift);
else
sprintf(rankadapt_fname,"rank_adapt0_tx%d_r%d_ch%d_%d_nrx%d_rnd%d_mcs%d_mcsi%d_sh%d.csv",transmission_mode,rx_type,channel_model,n_frames, n_rx, num_rounds, mcs1, mcs2, interf_unaw_shift);
}
rankadapt_fd = fopen(rankadapt_fname,"w");
if (rankadapt_fd==NULL) {
fprintf(stderr,"Cannot create file %s!\n",rankadapt_fname);
exit(-1);
}
fprintf(rankadapt_fd,"SNR; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; rank; throug_tb0_acc_aver[0]; throug_tb1_acc_aver[0]; throug_tb0_acc_aver[1]; throug_tb1_acc_aver[1]; throug_tb0_acc_aver[2]; throug_tb1_acc_aver[2]; throug_tb0_acc_aver[3]; throug_tb1_acc_aver[3]; throug_tot_acc_aver[0]; throug_tot_acc_aver[1]; throug_tot_acc_aver[2]; throug_tot_acc_aver[2]; throug_tot_acc_aver[3]; throug_tot_acc_aver[3]; throug_tot_acc_aver_all_rounds\n");
}
bler_fd = fopen(bler_fname,"w"); bler_fd = fopen(bler_fname,"w");
if (bler_fd==NULL) { if (bler_fd==NULL) {
fprintf(stderr,"Cannot create file %s!\n",bler_fname); fprintf(stderr,"Cannot create file %s!\n",bler_fname);
...@@ -820,6 +848,8 @@ int main(int argc, char **argv) ...@@ -820,6 +848,8 @@ int main(int argc, char **argv)
else else
fprintf(bler_fd,"SNR; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; deact_tb0_r0; deact_tb1_r0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; deact_tb0_r1; deact_tb1_r1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; deact_tb0_r2; deact_tb1_r2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n"); fprintf(bler_fd,"SNR; MCS1; MCS2; TBS1; TBS2; rate 0; rate 1; err0_tb0; err0_tb1; trials_tb0_r0; trials_tb1_r0; deact_tb0_r0; deact_tb1_r0; ret_both0; ret_one0; err1_tb0; err1_tb1; trials_tb0_r1; trials_tb1_r1; deact_tb0_r1; deact_tb1_r1; ret_both1; ret_one1; err2_tb0; err2_tb1; trials_tb0_r2; trials1_tb1_r2; deact_tb0_r2; deact_tb1_r2; ret_both2; ret_one2; err3_tb0; err3_tb1; trials_tb0_r3; trials_tb1_r3; th_tb0_r0; th_tb1_r0; th_sum_r0; th_tb0_r1; th_tb1_r1; th_sum_r1; th_tb0_r2; th_tb1_r2; th_sum_r2; th_tb0_r3; th_tb1_r3; th_sum_r3; tot_th\n");
if (test_perf != 0) { if (test_perf != 0) {
char hostname[1024]; char hostname[1024];
...@@ -2068,6 +2098,15 @@ int main(int argc, char **argv) ...@@ -2068,6 +2098,15 @@ int main(int argc, char **argv)
round_trials[1][i] = 0; // CW_1 round_trials[1][i] = 0; // CW_1
TB0_deact[i]=0; TB0_deact[i]=0;
TB1_deact[i]=0; TB1_deact[i]=0;
throug_tb0_acc[i] = 0;
throug_tb1_acc[i] = 0;
throug_tb0_acc_aver[i]=0;
throug_tb1_acc_aver[i]=0;
throug_tot_acc_aver[i]=0;
active_tb0_sent[i]=0;
active_tb1_sent[i]=0;
throug_tot_acc_aver_all_rounds=0;
} }
dci_errors=0; dci_errors=0;
...@@ -2151,21 +2190,28 @@ int main(int argc, char **argv) ...@@ -2151,21 +2190,28 @@ int main(int argc, char **argv)
TB0_active=1; TB0_active=1;
TB1_active=1; TB1_active=1;
if (transmission_mode == 3 || transmission_mode == 4) if (transmission_mode == 3 || transmission_mode == 4)
rank_indc[0]=1; rank_indc[0]=1;
while (((transmission_mode == 3 || transmission_mode == 4) && while (((transmission_mode == 3 || transmission_mode == 4) &&
((round < num_rounds) && ((ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) || ((round < num_rounds) && (((rank_indc[0] == 1) ||((rank_indc[0] == 0) && (rank_adapt==0))) &&
(ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)))) || ((ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) ||
(ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations))||
(rank_indc[0] ==0 && rank_adapt==1 && ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations )))) ||
((transmission_mode!=4 && transmission_mode != 3) && ((round< num_rounds) && ((transmission_mode!=4 && transmission_mode != 3) && ((round< num_rounds) &&
(ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)))) { (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)))) {
// printf("ret[0] =% d UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations = %d\n", ret[0], UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations);
// printf("ret[1] =% d UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations = %d\n", ret[1], UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations);
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
printf("\n [DLSIM] On top round is %d\n", round); printf("\n [DLSIM] On top round is %d\n", round);
#endif #endif
round_trials[0][round]++; round_trials[0][round]++;
round_trials[1][round]++; round_trials[1][round]++;
decoded_tb[0]=0;
decoded_tb[1]=0;
//printf("Trial %d, round %d , ret[0] %d, ret[1] %d, round_trials %d\n",trials,round, ret[0], ret[1], round_trials[round]); //printf("Trial %d, round %d , ret[0] %d, ret[1] %d, round_trials %d\n",trials,round, ret[0], ret[1], round_trials[round]);
...@@ -2678,128 +2724,179 @@ int main(int argc, char **argv) ...@@ -2678,128 +2724,179 @@ int main(int argc, char **argv)
} }
break; break;
case 4: case 4:
switch (eNB->frame_parms.N_RB_DL) { if ((rank_indc[0]==1 )|| ((rank_indc[0]==0) && (rank_adapt==0))){
case 6: switch (eNB->frame_parms.N_RB_DL) {
if (TB0_active == 1 && TB1_active == 1) { case 6:
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; if (TB0_active == 1 && TB1_active == 1) {
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; // you have choice
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1;
((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])->mcs2 = mcs2;
((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])->ndi1 = trials&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])->rv1 = round&3;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 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 if (TB0_active == 0){ // deactivate TB0
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr;
((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;
} }
else { // deactivate TB1 else if (TB0_active == 0){ // deactivate TB0
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr;
((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])->mcs1 = 0;
((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])->rv1 = 1;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 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 = 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)); else { // deactivate TB1
break; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr;
case 25: ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
if (TB0_active == 1 && TB1_active == 1) { ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; }
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_1_5MHz_2A_TDD_t));
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; break;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1; case 25:
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; if (TB0_active == 1 && TB1_active == 1) {
} ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2;
else if (TB0_active == 0){ // deactivate TB0 ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 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])->ndi2 = trials&1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
} }
else { // deactivate TB1 else if (TB0_active == 0){ // deactivate TB0
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 1;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 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 = 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)); else { // deactivate TB1
generate_eNB_dlsch_params_from_dci(0, ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr;
subframe, ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
&DLSCH_alloc_pdu_1[0], ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
n_rnti+k, ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0;
format2, ((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
eNB->dlsch[0], }
&eNB->frame_parms, memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_TDD_t));
eNB->pdsch_config_dedicated, break;
SI_RNTI, case 50:
0, if (TB0_active == 1 && TB1_active == 1) {
P_RNTI, ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2;
UE->dlsch[subframe&0x1][0][1]->pmi_alloc, ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1;
transmission_mode>=7?transmission_mode:0 ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2;
); ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
break; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
case 50: ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
if (TB0_active == 1 && TB1_active == 1) { ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; }
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; else if (TB0_active == 0){ // deactivate TB0
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; ((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])->ndi2 = trials&1;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
} }
else if (TB0_active == 0){ // deactivate TB0 else { // deactivate TB1
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 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])->mcs2 = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
} }
else { // deactivate TB1 memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_TDD_t));
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; break;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; case 100:
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; if (TB0_active == 1 && TB1_active == 1) {
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1;
} ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_10MHz_2A_TDD_t)); ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
break; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3;
case 100: ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi2 = trials&1;
if (TB0_active == 1 && TB1_active == 1) { ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 2; }
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = mcs1; else if (TB0_active == 0){ // deactivate TB0
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = mcs2; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = round&3; ((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])->ndi2 = trials&1;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3;
} }
else if (TB0_active == 0){ // deactivate TB0 else { // deactivate TB1
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->mcs1 = 0; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->ndi1 = trials&1;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv1 = 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])->mcs2 = 0;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = round&3; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
} }
else { // deactivate TB1 memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_TDD_t));
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = tpmi_retr; break;
((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])->mcs2 = 0;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
} }
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_TDD_t)); generate_eNB_dlsch_params_from_dci(0,
break; subframe,
&DLSCH_alloc_pdu_1[0],
n_rnti+k,
format2,
eNB->dlsch[0],
&eNB->frame_parms,
eNB->pdsch_config_dedicated,
SI_RNTI,
0,
P_RNTI,
UE->dlsch[subframe&0x1][0][1]->pmi_alloc,
transmission_mode>=7?transmission_mode:0
);
} else if (rank_indc[0]==0 && rank_adapt==1) {
//in this case only TB0 is active for the retransmissions, deactivatiing TB1
switch (eNB->frame_parms.N_RB_DL) {
case 6:
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; //no choice, only alamouti
((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])->mcs2 = 0;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
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])->tpmi = 0;
((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])->mcs2 = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
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])->tpmi = 0;
((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])->mcs2 = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
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])->tpmi = 0;
((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])->mcs2 = 0;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_TDD_t));
break;
} }
generate_eNB_dlsch_params_from_dci(0,
subframe,
&DLSCH_alloc_pdu_1[0],
n_rnti+k,
format2,
eNB->dlsch[0],
&eNB->frame_parms,
eNB->pdsch_config_dedicated,
SI_RNTI,
0,
P_RNTI,
UE->dlsch[subframe&0x1][0][1]->pmi_alloc,
transmission_mode>=7?transmission_mode:0
);
}
break; break;
case 5: case 5:
case 6: case 6:
DLSCH_alloc_pdu2_1E[0].ndi = trials&1; DLSCH_alloc_pdu2_1E[0].ndi = trials&1;
...@@ -2900,6 +2997,7 @@ int main(int argc, char **argv) ...@@ -2900,6 +2997,7 @@ int main(int argc, char **argv)
} }
break; break;
case 4: case 4:
if ((rank_indc[0]==1 )|| ((rank_indc[0]==0) && (rank_adapt==0))){
switch (eNB->frame_parms.N_RB_DL) { switch (eNB->frame_parms.N_RB_DL) {
case 6: case 6:
if (TB0_active == 1 && TB1_active == 1) { if (TB0_active == 1 && TB1_active == 1) {
...@@ -2952,20 +3050,6 @@ int main(int argc, char **argv) ...@@ -2952,20 +3050,6 @@ int main(int argc, char **argv)
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1; ((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
} }
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_FDD_t)); memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_5MHz_2A_FDD_t));
generate_eNB_dlsch_params_from_dci(0,
subframe,
&DLSCH_alloc_pdu_1[0],
n_rnti+k,
format2,
eNB->dlsch[0],
&eNB->frame_parms,
eNB->pdsch_config_dedicated,
SI_RNTI,
0,
P_RNTI,
UE->dlsch[subframe&0x1][0][1]->pmi_alloc,
transmission_mode>=7?transmission_mode:0
);
break; break;
case 50: case 50:
if (TB0_active == 1 && TB1_active == 1) { if (TB0_active == 1 && TB1_active == 1) {
...@@ -3020,9 +3104,72 @@ int main(int argc, char **argv) ...@@ -3020,9 +3104,72 @@ int main(int argc, char **argv)
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_FDD_t)); memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_FDD_t));
break; break;
} }
break; generate_eNB_dlsch_params_from_dci(0,
subframe,
&DLSCH_alloc_pdu_1[0],
n_rnti+k,
format2,
eNB->dlsch[0],
&eNB->frame_parms,
eNB->pdsch_config_dedicated,
SI_RNTI,
0,
P_RNTI,
UE->dlsch[subframe&0x1][0][1]->pmi_alloc,
transmission_mode>=7?transmission_mode:0
);
} else if (rank_indc[0]==0 && rank_adapt==1) {
//in this case only TB0 is active for the retransmissions, deactivatiing TB1
switch (eNB->frame_parms.N_RB_DL) {
case 6:
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->tpmi = 0; //no choice, only alamouti
((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])->mcs2 = 0;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
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])->tpmi = 0;
((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])->mcs2 = 0;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
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])->tpmi = 0;
((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])->mcs2 = 0;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
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])->tpmi = 0;
((DCI2_20MHz_2A_FDD_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_FDD_t *)&DLSCH_alloc_pdu_1[0])->mcs2 = 0;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[0])->rv2 = 1;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu_1[0],sizeof(DCI2_20MHz_2A_FDD_t));
break;
}
generate_eNB_dlsch_params_from_dci(0,
subframe,
&DLSCH_alloc_pdu_1[0],
n_rnti+k,
format2,
eNB->dlsch[0],
&eNB->frame_parms,
eNB->pdsch_config_dedicated,
SI_RNTI,
0,
P_RNTI,
UE->dlsch[subframe&0x1][0][1]->pmi_alloc,
transmission_mode>=7?transmission_mode:0
);
}
break;
case 5: case 5:
case 6: case 6:
DLSCH_alloc_pdu2_1E[0].ndi = trials&1; DLSCH_alloc_pdu2_1E[0].ndi = trials&1;
...@@ -3910,15 +4057,14 @@ int main(int argc, char **argv) ...@@ -3910,15 +4057,14 @@ int main(int argc, char **argv)
printf("[DLSIM] Skip TB0 \n"); printf("[DLSIM] Skip TB0 \n");
#endif #endif
TB++; TB++;
} }
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
printf("[DLSIM] process TB %d \n", TB); printf("[DLSIM] process TB %d Kmimo %d \n", TB, Kmimo);
#endif #endif
if (TB==1 && TB1_active == 0){ if (TB==1 && TB1_active == 0){
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
printf("[DLSIM] Skip TB1 \n"); printf("[DLSIM] Skip TB1 round %d\n", round);
#endif #endif
break; break;
} }
...@@ -4005,6 +4151,7 @@ int main(int argc, char **argv) ...@@ -4005,6 +4151,7 @@ int main(int argc, char **argv)
if (ret[TB] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ) { //if CW0 is decoded, approach CW1 if (ret[TB] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ) { //if CW0 is decoded, approach CW1
decoded_tb[TB]=1;
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
printf("[DLSIM] TB%d is decoded\n", TB); printf("[DLSIM] TB%d is decoded\n", TB);
#endif #endif
...@@ -4349,6 +4496,7 @@ int main(int argc, char **argv) ...@@ -4349,6 +4496,7 @@ int main(int argc, char **argv)
//printf("ret TB 1 = %d round %d \n", ret[1], round); //printf("ret TB 1 = %d round %d \n", ret[1], round);
if (ret[1] <=UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ) { if (ret[1] <=UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ) {
decoded_tb[1]=1;
decoded_in_sic[round]++; decoded_in_sic[round]++;
round_sic = round+1; // to exit round_sic round_sic = round+1; // to exit round_sic
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
...@@ -4383,6 +4531,7 @@ int main(int argc, char **argv) ...@@ -4383,6 +4531,7 @@ int main(int argc, char **argv)
if (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ){ if (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations ){
decoded_tb[1]=0;
errs[1][round]++; errs[1][round]++;
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
printf("[DLSIM] TB1 is not decoded in SIC loop, errs[TB1][round %d] = %d\n",round, errs[1][round]); printf("[DLSIM] TB1 is not decoded in SIC loop, errs[TB1][round %d] = %d\n",round, errs[1][round]);
...@@ -4416,7 +4565,7 @@ int main(int argc, char **argv) ...@@ -4416,7 +4565,7 @@ int main(int argc, char **argv)
} //if (ret > UE->dlsch[subframe&0x1][0][1]->max_turbo_iterations ) } //if (ret > UE->dlsch[subframe&0x1][0][1]->max_turbo_iterations )
}//if SIC }//if SIC
} else { } else {
decoded_tb[TB]=0;
errs[TB][round]++; errs[TB][round]++;
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
printf("[DLSIM] TB%d is not decoded outside SIC loop, errs[TB%d][round %d] = %d\n", TB, TB, round, errs[TB][round]); printf("[DLSIM] TB%d is not decoded outside SIC loop, errs[TB%d][round %d] = %d\n", TB, TB, round, errs[TB][round]);
...@@ -4565,66 +4714,125 @@ int main(int argc, char **argv) ...@@ -4565,66 +4714,125 @@ int main(int argc, char **argv)
round++; round++;
} }
/* if ((rank_indc[0]==0) && (rank_adapt==1))
errs[1][0]++;*/
if (transmission_mode == 3 || transmission_mode == 4 ) { if (transmission_mode == 3 || transmission_mode == 4 ) {
if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations &&
ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ if (TB0_active==1)
resend_both[round]++; active_tb0_sent[round]++;
round++;
resend_cw0_cw1=1; //resend both cws if (TB1_active==1)
resend_cw1=0; active_tb1_sent[round]++;
TB0_active=1;
TB1_active=1; if (rank_indc[0]==1 || (rank_indc[0]==0 && rank_adapt==0)){
} if ((TB0_active==1) && (decoded_tb[0]==1)){
else if (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations && throug_tb0=rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs)/(round+1);
ret[0] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ #ifdef DEBUG_HARQ
resend_one[round]++; printf("rank 2 round %d, TB0 contributes to throughput throug_tb0 %f \n", round, throug_tb0 );
resend_cw0_cw1=0; #endif
TB0_active=0; } else if (((TB0_active==1) && (decoded_tb[0]==0)) || (TB0_active==0)){
TB1_active=1; throug_tb0=0;
if (rx_type == rx_IC_dual_stream) }
TB0_deact[round]++; throug_tb0_acc[round]+=throug_tb0;
if(is_first_time) { } else if ((rank_indc[0]==0) && (rank_adapt==1)){
hold_rank1_precoder = 0; if ((TB0_active==1) && (decoded_tb[0]==1)){
is_first_time = false; throug_tb0=rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs)/(round+1);
#ifdef DEBUG_HARQ
printf("rank 1 round %d, TB0 contributes to throughput throug_tb0 %f \n", round, throug_tb0 );
#endif
} else if (((TB0_active==1) && (decoded_tb[0]==0)) || (TB0_active==0)){
throug_tb0=0;
}
throug_tb0_acc[round]+=throug_tb0;
} }
else
hold_rank1_precoder = 1;
if (rank_indc[0]==1 || (rank_indc[0]==0 && rank_adapt==0)){
if ((TB1_active==1) && (decoded_tb[1]==1)){
throug_tb1=rate1_init*get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs)/(round+1);
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
printf("[DLSIM] ret[TB0] =%d, ret[TB1] =%d, trial %d \n", ret[0], ret[1], trials); printf("rank 2 round %d, TB1 contributes to throughput throug_tb1 %f \n", round, throug_tb1 );
printf("[DLSIM] TB0 deactivated\n");
#endif #endif
round++; } else if (((TB1_active==1) && (decoded_tb[1]==0)) || (TB1_active==0)){
} throug_tb1=0;
else if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations && }
ret[1] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){ throug_tb1_acc[round]+=throug_tb1;
resend_one[round]++;
resend_cw0_cw1=0;
TB0_active=1;
TB1_active=0;
if (rx_type == rx_IC_dual_stream)
TB1_deact[round]++;
if(is_first_time) {
hold_rank1_precoder = 0;
is_first_time = false;
} }
else
hold_rank1_precoder = 1; if (rank_indc[0] == 1 || (rank_indc[0] == 0 && rank_adapt==0)) {
if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations &&
ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){
resend_both[round]++;
round++;
resend_cw0_cw1=1; //resend both cws
resend_cw1=0;
TB0_active=1;
TB1_active=1;
}
else if (ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations &&
ret[0] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){
resend_one[round]++;
resend_cw0_cw1=0;
TB0_active=0;
TB1_active=1;
if (rx_type == rx_IC_dual_stream)
TB0_deact[round]++;
if(is_first_time) {
hold_rank1_precoder = 0;
is_first_time = false;
}
else
hold_rank1_precoder = 1;
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
printf("[DLSIM] ret[TB0] =%d, ret[TB1] =%d, trial %d \n", ret[0], ret[1], trials); printf("[DLSIM] ret[TB0] =%d, ret[TB1] =%d, trial %d \n", ret[0], ret[1], trials);
printf("[DLSIM] TB1 deactivated\n"); printf("[DLSIM] TB0 deactivated\n");
#endif #endif
round++; round++;
}
else if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations &&
ret[1] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){
resend_one[round]++;
resend_cw0_cw1=0;
TB0_active=1;
TB1_active=0;
if (rx_type == rx_IC_dual_stream)
TB1_deact[round]++;
if(is_first_time) {
hold_rank1_precoder = 0;
is_first_time = false;
}
else
hold_rank1_precoder = 1;
#ifdef DEBUG_HARQ
printf("[DLSIM] ret[TB0] =%d, ret[TB1] =%d, trial %d \n", ret[0], ret[1], trials);
printf("[DLSIM] TB1 deactivated\n");
#endif
round++;
}
} else if (rank_indc[0] == 0 && rank_adapt == 1){
#ifdef DEBUG_HARQ
printf("I am in case rank_indc[0] == 0 && rank_adapt == 1, decoded_tb[0] = %d\n", decoded_tb[0]);
#endif
if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations){
resend_one[round]++;
round++;
resend_cw0_cw1=0; //resend both cws
resend_cw1=0;
TB0_active=1;
TB1_active=0;
}
} }
} }
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
printf("[DLSIM] Now round is %d, trial %d\n" , round, trials); printf("[DLSIM] Now round is %d, trial %d\n" , round, trials);
#endif #endif
}
}
if(transmission_mode != 3 && transmission_mode !=4 ){ if(transmission_mode != 3 && transmission_mode !=4 ){
if ((errs[0][0]>=n_frames/10) && (trials>(n_frames/2)) ) if ((errs[0][0]>=n_frames/10) && (trials>(n_frames/2)) )
...@@ -4801,6 +5009,31 @@ int main(int argc, char **argv) ...@@ -4801,6 +5009,31 @@ int main(int argc, char **argv)
*/ */
if (transmission_mode == 3 || transmission_mode == 4) { if (transmission_mode == 3 || transmission_mode == 4) {
throug_tb0_acc_aver[0]=throug_tb0_acc[0]/(double)round_trials[1][0];//active_tb0_sent[0];
throug_tb0_acc_aver[1]=throug_tb0_acc[1]/(double)round_trials[1][0];//active_tb0_sent[1];
throug_tb0_acc_aver[2]=throug_tb0_acc[2]/(double)round_trials[1][0];//active_tb0_sent[2];
throug_tb0_acc_aver[3]=throug_tb0_acc[3]/(double)round_trials[1][0];//active_tb0_sent[3];
throug_tb1_acc_aver[0]=throug_tb1_acc[0]/(double)round_trials[1][0];//active_tb1_sent[0];
throug_tb1_acc_aver[1]=throug_tb1_acc[1]/(double)round_trials[1][0];//active_tb1_sent[1];
throug_tb1_acc_aver[2]=throug_tb1_acc[2]/(double)round_trials[1][0];//active_tb1_sent[2];
throug_tb1_acc_aver[3]=throug_tb1_acc[3]/(double)round_trials[1][0];//active_tb1_sent[3];
throug_tot_acc_aver[0]= throug_tb0_acc_aver[0]+throug_tb1_acc_aver[0];
throug_tot_acc_aver[1]= throug_tb0_acc_aver[1]+throug_tb1_acc_aver[1];
throug_tot_acc_aver[2]= throug_tb0_acc_aver[2]+throug_tb1_acc_aver[2];
throug_tot_acc_aver[3]= throug_tb0_acc_aver[3]+throug_tb1_acc_aver[3];
throug_tot_acc_aver_all_rounds= throug_tot_acc_aver[0]+throug_tot_acc_aver[1]+throug_tot_acc_aver[2]+throug_tot_acc_aver[3];
// FOR CW0 // FOR CW0
thr_cw0[0] = rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs)*(1-((double)errs[0][0]/(double)round_trials[0][0])); thr_cw0[0] = rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs)*(1-((double)errs[0][0]/(double)round_trials[0][0]));
if (num_rounds > 1) if (num_rounds > 1)
...@@ -4819,17 +5052,25 @@ int main(int argc, char **argv) ...@@ -4819,17 +5052,25 @@ int main(int argc, char **argv)
#ifdef PRINT_THROUGHPUT #ifdef PRINT_THROUGHPUT
printf("rate %f \n", rate0_init); printf("rate %f \n", rate0_init);
printf("rate*mod_order %f \n", rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs)); printf("rate*mod_order %f \n", rate0_init*get_Qm(eNB->dlsch[0][0]->harq_processes[0]->mcs));
printf("Probability %f \n", (1-((double)errs[0][0]/(double)round_trials[0][0])));
printf("Throughput cw0 sum = %f \n", thr_cw0_tot); printf("Throughput cw0 sum = %f \n", thr_cw0_tot);
printf("Throughput cw0 round 0 = %f \n", thr_cw0[0]); printf("Throughput cw0 round 0 = %f \n", thr_cw0[0]);
printf("Throughput cw0 round 1 = %f \n", thr_cw0[1]); printf("Throughput cw0 round 1 = %f \n", thr_cw0[1]);
printf("Throughput cw0 round 2 = %f \n", thr_cw0[2]); printf("Throughput cw0 round 2 = %f \n", thr_cw0[2]);
printf("Throughput cw0 round 3 = %f \n", thr_cw0[3]); printf("Throughput cw0 round 3 = %f \n", thr_cw0[3]);
printf("Accumulated throughput TB0 round 0 = %f \n", throug_tb0_acc_aver[0]);
printf("Accumulated throughput TB0 round 1 = %f \n", throug_tb0_acc_aver[1]);
printf("Accumulated throughput TB0 round 2 = %f \n", throug_tb0_acc_aver[2]);
printf("Accumulated throughput TB0 round 3 = %f \n", throug_tb0_acc_aver[3]);
printf("Accumulated throughput TB1 round 0 = %f \n", throug_tb1_acc_aver[0]);
printf("Accumulated throughput TB1 round 1 = %f \n", throug_tb1_acc_aver[1]);
printf("Accumulated throughput TB1 round 2 = %f \n", throug_tb1_acc_aver[2]);
printf("Accumulated throughput TB1 round 3 = %f \n", throug_tb1_acc_aver[3]);
printf("round_trials = %d, errs[0][0] = %d, round_trials[0][1] = %d, errs[0][1] = %d, round_trials[0][2] = %d, errs[0][2] = %d, \ printf("round_trials = %d, errs[0][0] = %d, round_trials[0][1] = %d, errs[0][1] = %d, round_trials[0][2] = %d, errs[0][2] = %d, \
round_trials[0][3] = %d, errs[0][3] = %d \n", round_trials[0][0], errs[0][0],round_trials[0][1], errs[0][1], round_trials[0][2], \ round_trials[0][3] = %d, errs[0][3] = %d \n", round_trials[0][0], errs[0][0],round_trials[0][1], errs[0][1], round_trials[0][2], \
errs[0][2], round_trials[0][3], errs[0][3]); errs[0][2], round_trials[0][3], errs[0][3]);
#endif #endif
thr_cw1[0] = rate1_init*get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs)*(1-((double)errs[1][0]/(double)round_trials[1][0])); thr_cw1[0] = rate1_init*get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs)*(1-((double)errs[1][0]/(double)round_trials[1][0]));
if (num_rounds > 1) if (num_rounds > 1)
thr_cw1[1] = (rate1_init*get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs)/2)*(((double)errs[1][0] - (double)errs[1][1])/(double)round_trials[1][0]); thr_cw1[1] = (rate1_init*get_Qm(eNB->dlsch[0][1]->harq_processes[0]->mcs)/2)*(((double)errs[1][0] - (double)errs[1][1])/(double)round_trials[1][0]);
...@@ -5175,6 +5416,31 @@ int main(int argc, char **argv) ...@@ -5175,6 +5416,31 @@ int main(int argc, char **argv)
thr_cw0[0]+thr_cw0[1]+thr_cw0[2]+thr_cw0[3]+thr_cw1[0]+thr_cw1[1]+thr_cw1[2]+ thr_cw1[3]); thr_cw0[0]+thr_cw0[1]+thr_cw0[2]+thr_cw0[3]+thr_cw1[0]+thr_cw1[1]+thr_cw1[2]+ thr_cw1[3]);
} }
if (transmission_mode==3 || transmission_mode==4){
fprintf(rankadapt_fd,"%f;%d;%d;%d;%d;%f;%f;%d;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f\n",
SNR,
mcs1,
mcs2,
tbs0_init,
tbs1_init,
rate0_init,
rate1_init,
rank_indc[0],
throug_tb0_acc_aver[0],
throug_tb1_acc_aver[0],
throug_tb0_acc_aver[1],
throug_tb1_acc_aver[1],
throug_tb0_acc_aver[2],
throug_tb1_acc_aver[2],
throug_tb0_acc_aver[3],
throug_tb1_acc_aver[3],
throug_tot_acc_aver[0],
throug_tot_acc_aver[1],
throug_tot_acc_aver[2],
throug_tot_acc_aver[3],
throug_tot_acc_aver_all_rounds);
}
if(abstx){ //ABSTRACTION if(abstx){ //ABSTRACTION
if ((transmission_mode != 3)&& (transmission_mode != 4)) { if ((transmission_mode != 3)&& (transmission_mode != 4)) {
......
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