Commit cec9cb76 authored by Bilel's avatar Bilel

fix compilation error for dlsim

parent b82b7781
......@@ -2098,14 +2098,14 @@ int main(int argc, char **argv)
}
for (i=0; i<2; i++) {
UE->dlsch[0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
UE->dlsch[subframe&0x1][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
if (!UE->dlsch[0][i]) {
if (!UE->dlsch[subframe&0x1][0][i]) {
printf("Can't get ue dlsch structures\n");
exit(-1);
}
UE->dlsch[0][i]->rnti = n_rnti;
UE->dlsch[subframe&0x1][0][i]->rnti = n_rnti;
}
UE->dlsch_SI[0] = new_ue_dlsch(1,1,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
......@@ -2254,7 +2254,7 @@ int main(int argc, char **argv)
reset_meas(&eNB->dlsch_rate_matching_stats);
reset_meas(&eNB->dlsch_turbo_encoding_stats);
reset_meas(&UE->phy_proc_rx); // total UE rx
reset_meas(&UE->phy_proc_rx[subframe&0x1]); // total UE rx
reset_meas(&UE->ofdm_demod_stats);
reset_meas(&UE->dlsch_channel_estimation_stats);
reset_meas(&UE->dlsch_freq_offset_estimation_stats);
......@@ -2488,7 +2488,7 @@ int main(int argc, char **argv)
if (n_frames==1) printf("Running phy_procedures_UE_RX\n");
phy_procedures_UE_RX(UE,proc,0,0,normal_txrx,no_relay,NULL);
if (UE->dlsch[0][0]->active == 0) {
if (UE->dlsch[subframe&0x1][0][0]->active == 0) {
//printf("DCI not received\n");
/*
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
......@@ -2543,7 +2543,7 @@ int main(int argc, char **argv)
//pdsch_vars
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round, UE->dlsch[0][0]->current_harq_pid);
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round, UE->dlsch[subframe&0x1][0][0]->current_harq_pid);
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
......@@ -2561,13 +2561,13 @@ int main(int argc, char **argv)
if (UE->dlsch_errors[0] == 0) {
avg_iter += UE->dlsch[eNB_id][0]->last_iteration_cnt;
avg_iter += UE->dlsch[subframe&0x1][eNB_id][0]->last_iteration_cnt;
iter_trials++;
if (n_frames==1)
printf("No DLSCH errors found (round %d),uncoded ber %f\n",round,uncoded_ber);
UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->TBS;
UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->TBS;
TB0_active = 0;
......@@ -2575,25 +2575,25 @@ int main(int argc, char **argv)
else {
errs[round]++;
avg_iter += UE->dlsch[eNB_id][0]->last_iteration_cnt-1;
avg_iter += UE->dlsch[subframe&0x1][eNB_id][0]->last_iteration_cnt-1;
iter_trials++;
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<UE->dlsch[0][0]->harq_processes[0]->C; s++) {
if (s<UE->dlsch[0][0]->harq_processes[0]->Cminus)
Kr = UE->dlsch[0][0]->harq_processes[0]->Kminus;
for (s=0; s<UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->C; s++) {
if (s<UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Cminus)
Kr = UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kminus;
else
Kr = UE->dlsch[0][0]->harq_processes[0]->Kplus;
Kr = UE->dlsch[subframe&0x1][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,UE->dlsch[0][0]->harq_processes[0]->c[s][i],UE->dlsch[0][0]->harq_processes[0]->c[s][i]^eNB->dlsch[0][0]->harq_processes[0]->c[s][i]);
printf("%d : %x (%x)\n",i,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->c[s][i],UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->c[s][i]^eNB->dlsch[0][0]->harq_processes[0]->c[s][i]);
}
sprintf(fname,"rxsig0_r%d.m",round);
......@@ -2644,13 +2644,13 @@ int main(int argc, char **argv)
}
//pdsch_vars
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round, UE->dlsch[0][0]->current_harq_pid);
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round, UE->dlsch[subframe&0x1][0][0]->current_harq_pid);
//write_output("dlsch_e.m","e",eNB->dlsch[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_w.m","w",eNB->dlsch[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,4);
//write_output("dlsch_w.m","w",UE->dlsch[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0);
//write_output("dlsch_w.m","w",UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0);
//pdcch_vars
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],300*3,1,1);
......@@ -2664,7 +2664,7 @@ int main(int argc, char **argv)
// printf("round %d errors %d/%d\n",round,errs[round],trials);
round++;
// UE->dlsch[0][0]->harq_processes[0]->round++;
// UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round++;
}
if (xforms==1) {
......@@ -2705,7 +2705,7 @@ int main(int argc, char **argv)
double t_tx_enc = (double)eNB->dlsch_encoding_stats.p_time/cpu_freq_GHz/1000.0;
double t_rx = (double)UE->phy_proc_rx.p_time/cpu_freq_GHz/1000.0;
double t_rx = (double)UE->phy_proc_rx[subframe&0x1].p_time/cpu_freq_GHz/1000.0;
double t_rx_fft = (double)UE->ofdm_demod_stats.p_time/cpu_freq_GHz/1000.0;
double t_rx_demod = (double)UE->dlsch_rx_pdcch_stats.p_time/cpu_freq_GHz/1000.0;
double t_rx_dec = (double)UE->dlsch_decoding_stats.p_time/cpu_freq_GHz/1000.0;
......@@ -2854,7 +2854,7 @@ int main(int argc, char **argv)
rate*effective_rate,
100*effective_rate,
rate,
rate*get_Qm(UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs),
rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][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)eNB->dlsch[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]));
......@@ -2894,10 +2894,10 @@ int main(int argc, char **argv)
eNB->dlsch_interleaving_stats.diff/eNB->dlsch_interleaving_stats.trials/cpu_freq_GHz/1000.0,eNB->dlsch_interleaving_stats.trials);
printf("\n\nUE RX function statistics (per 1ms subframe)\n\n");
std_phy_proc_rx = sqrt((double)UE->phy_proc_rx.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
2)/UE->phy_proc_rx.trials - pow((double)UE->phy_proc_rx.diff/UE->phy_proc_rx.trials/cpu_freq_GHz/1000,2));
printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx.diff/UE->phy_proc_rx.trials/cpu_freq_GHz/1000.0,
UE->phy_proc_rx.trials*2/3);
std_phy_proc_rx = sqrt((double)UE->phy_proc_rx[subframe&0x1].diff_square/pow(cpu_freq_GHz,2)/pow(1000,
2)/UE->phy_proc_rx[subframe&0x1].trials - pow((double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000,2));
printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000.0,
UE->phy_proc_rx[subframe&0x1].trials*2/3);
printf("|__Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n", std_phy_proc_rx, t_rx_max, t_rx_min, rx_median,
rx_q1, rx_q3, n_rx_dropped);
std_phy_proc_rx_fft = sqrt((double)UE->ofdm_demod_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
......@@ -2931,7 +2931,7 @@ int main(int argc, char **argv)
printf("|__ DLSCH Rate Unmatching :%f us (%d trials)\n",
(double)UE->dlsch_rate_unmatching_stats.diff/UE->dlsch_rate_unmatching_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_rate_unmatching_stats.trials);
printf("|__ DLSCH Turbo Decoding(%d bits) :%f us (%d trials)\n",
UE->dlsch[0][0]->harq_processes[0]->Cminus ? UE->dlsch[0][0]->harq_processes[0]->Kminus : UE->dlsch[0][0]->harq_processes[0]->Kplus,
UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Cminus ? UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kminus : UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kplus,
(double)UE->dlsch_turbo_decoding_stats.diff/UE->dlsch_turbo_decoding_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_turbo_decoding_stats.trials);
printf(" |__ init %f us (cycles/iter %f, %d trials)\n",
(double)UE->dlsch_tc_init_stats.diff/UE->dlsch_tc_init_stats.trials/cpu_freq_GHz/1000.0,
......@@ -3109,7 +3109,7 @@ int main(int argc, char **argv)
eNB->dlsch_modulation_stats.trials,
eNB->dlsch_scrambling_stats.trials,
eNB->dlsch_encoding_stats.trials,
UE->phy_proc_rx.trials,
UE->phy_proc_rx[subframe&0x1].trials,
UE->ofdm_demod_stats.trials,
UE->dlsch_rx_pdcch_stats.trials,
UE->dlsch_llr_stats.trials,
......@@ -3122,7 +3122,7 @@ int main(int argc, char **argv)
get_time_meas_us(&eNB->dlsch_modulation_stats),
get_time_meas_us(&eNB->dlsch_scrambling_stats),
get_time_meas_us(&eNB->dlsch_encoding_stats),
get_time_meas_us(&UE->phy_proc_rx),
get_time_meas_us(&UE->phy_proc_rx[subframe&0x1]),
nsymb*get_time_meas_us(&UE->ofdm_demod_stats),
get_time_meas_us(&UE->dlsch_rx_pdcch_stats),
3*get_time_meas_us(&UE->dlsch_llr_stats),
......@@ -3162,7 +3162,7 @@ int main(int argc, char **argv)
eNB->dlsch_modulation_stats.trials,
eNB->dlsch_scrambling_stats.trials,
eNB->dlsch_encoding_stats.trials,
UE->phy_proc_rx.trials,
UE->phy_proc_rx[subframe&0x1].trials,
UE->ofdm_demod_stats.trials,
UE->dlsch_rx_pdcch_stats.trials,
UE->dlsch_llr_stats.trials,
......@@ -3220,7 +3220,7 @@ int main(int argc, char **argv)
printf("eNB %d\n",i);
free_eNB_dlsch(eNB->dlsch[0][i]);
printf("UE %d\n",i);
free_ue_dlsch(UE->dlsch[0][i]);
free_ue_dlsch(UE->dlsch[subframe&0x1][0][i]);
}
......
......@@ -980,15 +980,15 @@ int main(int argc, char **argv)
}
for (i=0; i<2; i++) {
UE->dlsch[0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
UE->dlsch[subframe&0x1][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
if (!UE->dlsch[0][i]) {
if (!UE->dlsch[subframe&0x1][0][i]) {
printf("Can't get ue dlsch structures\n");
exit(-1);
}
UE->dlsch[0][i]->rnti = n_rnti;
UE->dlsch[subframe&0x1][0][i]->rnti = n_rnti;
}
// structure for SIC at UE
......@@ -2081,7 +2081,7 @@ int main(int argc, char **argv)
reset_meas(&eNB->dlsch_rate_matching_stats);
reset_meas(&eNB->dlsch_turbo_encoding_stats);
reset_meas(&UE->phy_proc_rx); // total UE rx
reset_meas(&UE->phy_proc_rx[subframe&0x1]); // total UE rx
reset_meas(&UE->ofdm_demod_stats);
reset_meas(&UE->dlsch_channel_estimation_stats);
reset_meas(&UE->dlsch_freq_offset_estimation_stats);
......@@ -2135,8 +2135,8 @@ int main(int argc, char **argv)
eNB2UE[0]->first_run = 1;
ret[0] = UE->dlsch[0][0]->max_turbo_iterations+1;
ret[1] = UE->dlsch[0][0]->max_turbo_iterations+1;
ret[0] = UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations+1;
ret[1] = UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations+1;
resend_cw0_cw1=1;
resend_cw1=0;
......@@ -2144,10 +2144,10 @@ int main(int argc, char **argv)
TB1_active=1;
while (((transmission_mode == 3 || transmission_mode == 4) &&
((round < num_rounds) && ((ret[0] > UE->dlsch[0][0]->max_turbo_iterations) ||
(ret[1] > UE->dlsch[0][0]->max_turbo_iterations)))) ||
((round < num_rounds) && ((ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) ||
(ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)))) ||
((transmission_mode!=4 && transmission_mode != 3) && ((round< num_rounds) &&
(ret[0] > UE->dlsch[0][0]->max_turbo_iterations)))) {
(ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)))) {
#ifdef DEBUG_HARQ
printf("\n [DLSIM] On top round is %d\n", round);
#endif
......@@ -2158,10 +2158,10 @@ int main(int argc, char **argv)
//printf("Trial %d, round %d , ret[0] %d, ret[1] %d, round_trials %d\n",trials,round, ret[0], ret[1], round_trials[round]);
/*if (ret[0] > UE->dlsch[0][0]->max_turbo_iterations) {
/*if (ret[0] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) {
round_trials[0][round]++;
round_trials[1][round]++;
} else if ((ret[1] > UE->dlsch[0][0]->max_turbo_iterations) && (ret[0] <= UE->dlsch[0][0]->max_turbo_iterations))
} else if ((ret[1] > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) && (ret[0] <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations))
round_trials[1][round]++;*/
......@@ -2624,7 +2624,7 @@ int main(int argc, char **argv)
SI_RNTI,
0,
P_RNTI,
UE->dlsch[0][1]->pmi_alloc,
UE->dlsch[subframe&0x1][0][1]->pmi_alloc,
transmission_mode>=7?transmission_mode:0
);
break;
......@@ -2852,7 +2852,7 @@ int main(int argc, char **argv)
SI_RNTI,
0,
P_RNTI,
UE->dlsch[0][1]->pmi_alloc,
UE->dlsch[subframe&0x1][0][1]->pmi_alloc,
transmission_mode>=7?transmission_mode:0
);
break;
......@@ -2983,7 +2983,7 @@ int main(int argc, char **argv)
// use the PMI from previous trial
if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) {
eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,eNB->frame_parms.N_RB_DL);
UE->dlsch[0][0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
UE->dlsch[subframe&0x1][0][0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
if (n_users>1)
eNB->dlsch[1][0]->harq_processes[0]->pmi_alloc = (eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc ^ 0x1555);
/*
......@@ -3007,7 +3007,7 @@ int main(int argc, char **argv)
printf ("[DLSIM] I am calling from the eNode B 2\n");
#endif
UE->dlsch[0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
}
else if (updated_csi == 0){
......@@ -3020,7 +3020,7 @@ int main(int argc, char **argv)
#ifdef DEBUG_HARQ
printf ("[DLSIM] I am calling from the eNode B 2\n");
#endif
UE->dlsch[0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[0][TB]->pmi_alloc,5,UE->frame_parms.N_RB_DL);
UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[subframe&0x1][0][TB]->pmi_alloc,5,UE->frame_parms.N_RB_DL);
}
else if (hold_rank1_precoder == 0 && ((((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 6) ||(((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 6))){
......@@ -3031,7 +3031,7 @@ int main(int argc, char **argv)
#ifdef DEBUG_HARQ
printf ("[DLSIM] I am calling from the eNode B 2\n");
#endif
UE->dlsch[0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[0][TB]->pmi_alloc,6,UE->frame_parms.N_RB_DL);
UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[subframe&0x1][0][TB]->pmi_alloc,6,UE->frame_parms.N_RB_DL);
}
} else if (updated_csi == 1){
......@@ -3050,11 +3050,11 @@ int main(int argc, char **argv)
#ifdef DEBUG_HARQ
printf ("[DLSIM] I quantize from ENodeB 2\n");
#endif
UE->dlsch[0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
#ifdef DEBUG_HARQ
printf ("[DLSIM] I convert pmi to rank1 eNode B 2\n");
#endif
UE->dlsch[0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[0][TB]->pmi_alloc,5,UE->frame_parms.N_RB_DL);
UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[subframe&0x1][0][TB]->pmi_alloc,5,UE->frame_parms.N_RB_DL);
}
else if (((((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 6) ||(((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 6))){
#ifdef DEBUG_HARQ
......@@ -3070,11 +3070,11 @@ int main(int argc, char **argv)
#ifdef DEBUG_HARQ
printf ("[DLSIM] I quantize from ENodeB 2\n");
#endif
UE->dlsch[0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
#ifdef DEBUG_HARQ
printf ("[DLSIM] I convert pmi to rank1 eNode B 2\n");
#endif
UE->dlsch[0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[0][TB]->pmi_alloc,6,UE->frame_parms.N_RB_DL);
UE->dlsch[subframe&0x1][0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(UE->dlsch[subframe&0x1][0][TB]->pmi_alloc,6,UE->frame_parms.N_RB_DL);
}
}
......@@ -3363,7 +3363,7 @@ int main(int argc, char **argv)
pilot3 = 9;
}
start_meas(&UE->phy_proc_rx);
start_meas(&UE->phy_proc_rx[subframe&0x1]);
// Inner receiver scheduling for 3 slots
for (Ns=(2*subframe);Ns<((2*subframe)+3);Ns++) {
for (l=0;l<pilot2;l++) {
......@@ -3525,10 +3525,10 @@ int main(int argc, char **argv)
//printf("Generating dlsch parameters for RNTI %x\n",dci_alloc_rx[i].rnti);
if (round == 0) {
UE->dlsch[0][0]->harq_processes[0]->first_tx=1;
UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx=1;
}
if ((transmission_mode == 3 || transmission_mode ==4) && (round == 0)) {
UE->dlsch[0][1]->harq_processes[0]->first_tx=1;
UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->first_tx=1;
}
if ((dci_alloc_rx[i].rnti == n_rnti) &&
......@@ -3537,7 +3537,7 @@ int main(int argc, char **argv)
dci_alloc_rx[i].dci_pdu,
dci_alloc_rx[i].rnti,
dci_alloc_rx[i].format,
UE->dlsch[0],
UE->dlsch[subframe&0x1][0],
&UE->frame_parms,
UE->pdsch_config_dedicated,
SI_RNTI,
......@@ -3547,30 +3547,30 @@ int main(int argc, char **argv)
UE->pdcch_vars[0]->crnti_is_temporary? UE->pdcch_vars[0]->crnti: 0)==0)) {
dump_dci(&UE->frame_parms,&dci_alloc_rx[i]);
coded_bits_per_codeword[0]= get_G(&eNB->frame_parms,
UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->nb_rb,
UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->rb_alloc_even,
get_Qm(UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs),
UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->Nl,
UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->nb_rb,
UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->rb_alloc_even,
get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs),
UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->Nl,
UE->pdcch_vars[0]->num_pdcch_symbols,
0,
subframe,
transmission_mode>=7?transmission_mode:0);
if (transmission_mode == 3 || transmission_mode == 4) {
coded_bits_per_codeword[1]= get_G(&eNB->frame_parms,
UE->dlsch[0][1]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->nb_rb,
UE->dlsch[0][1]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->rb_alloc_even,
get_Qm(UE->dlsch[0][1]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs),
UE->dlsch[0][1]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->Nl,
UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->nb_rb,
UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->rb_alloc_even,
get_Qm(UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs),
UE->dlsch[subframe&0x1][0][1]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->Nl,
UE->pdcch_vars[1]->num_pdcch_symbols,
0,
subframe,
transmission_mode>=7?transmission_mode:0);
}
/*
rate = (double)dlsch_tbs25[get_I_TBS(UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs)][UE->dlsch[0][0]->nb_rb-1]/(coded_bits_per_codeword);
rate*=get_Qm(UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs);
rate = (double)dlsch_tbs25[get_I_TBS(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs)][UE->dlsch[subframe&0x1][0][0]->nb_rb-1]/(coded_bits_per_codeword);
rate*=get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs);
*/
printf("num_pdcch_symbols %d, G %d, TBS %d\n",UE->pdcch_vars[0]->num_pdcch_symbols,coded_bits_per_codeword [0],UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->TBS);
printf("num_pdcch_symbols %d, G %d, TBS %d\n",UE->pdcch_vars[0]->num_pdcch_symbols,coded_bits_per_codeword [0],UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->TBS);
dlsch_active = 1; // what does it indicates???
} else {
......@@ -3594,8 +3594,8 @@ int main(int argc, char **argv)
UE->pdcch_vars[0]->crnti = n_rnti;
UE->pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols;
if (round == 0) {
UE->dlsch[0][0]->harq_processes[0]->first_tx=1;
UE->dlsch[0][1]->harq_processes[0]->first_tx=1;
UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx=1;
UE->dlsch[subframe&0x1][0][1]->harq_processes[0]->first_tx=1;
}
switch (transmission_mode) {
......@@ -3606,7 +3606,7 @@ int main(int argc, char **argv)
&DLSCH_alloc_pdu_1[0],
(common_flag==0)? C_RNTI : SI_RNTI,
(common_flag==0)? format1 : format1A,
UE->dlsch[0],
UE->dlsch[subframe&0x1][0],
&UE->frame_parms,
UE->pdsch_config_dedicated,
SI_RNTI,
......@@ -3617,14 +3617,14 @@ int main(int argc, char **argv)
break;
case 3:
//printf("Rate: TM3 (before) round %d (%d) first_tx %d\n",round,UE->dlsch[0][0]->harq_processes[0]->round,UE->dlsch[0][0]->harq_processes[0]->first_tx);
//printf("Rate: TM3 (before) round %d (%d) first_tx %d\n",round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx);
generate_ue_dlsch_params_from_dci(0,
subframe,
&DLSCH_alloc_pdu_1[0],
(common_flag==0)? C_RNTI : SI_RNTI,
(common_flag==0)? format2A : format1A,
UE->dlsch[0],
UE->dlsch[subframe&0x1][0],
&UE->frame_parms,
UE->pdsch_config_dedicated,
SI_RNTI,
......@@ -3632,7 +3632,7 @@ int main(int argc, char **argv)
P_RNTI,
transmission_mode<7?0:transmission_mode,
UE->pdcch_vars[0]->crnti_is_temporary? UE->pdcch_vars[0]->crnti: 0);
//printf("Rate: TM3 (after) round %d (%d) first_tx %d\n",round,UE->dlsch[0][0]->harq_processes[0]->round,UE->dlsch[0][0]->harq_processes[0]->first_tx);
//printf("Rate: TM3 (after) round %d (%d) first_tx %d\n",round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx);
break;
case 4:
generate_ue_dlsch_params_from_dci(0,
......@@ -3640,7 +3640,7 @@ int main(int argc, char **argv)
&DLSCH_alloc_pdu_1[0],
(common_flag==0)? C_RNTI : SI_RNTI,
(common_flag==0)? format2 : format1A,//format1A only for a codeblock
UE->dlsch[0],
UE->dlsch[subframe&0x1][0],
&UE->frame_parms,
UE->pdsch_config_dedicated,
SI_RNTI,
......@@ -3657,7 +3657,7 @@ int main(int argc, char **argv)
&DLSCH_alloc_pdu2_1E[0],
C_RNTI,
format1E_2A_M10PRB,
UE->dlsch[0],
UE->dlsch[subframe&0x1][0],
&UE->frame_parms,
UE->pdsch_config_dedicated,
SI_RNTI,
......@@ -3673,13 +3673,13 @@ int main(int argc, char **argv)
if (dlsch_active == 1) {
if (TB0_active==1)
cur_harq_pid =UE->dlsch[0][0]->current_harq_pid;
cur_harq_pid =UE->dlsch[subframe&0x1][0][0]->current_harq_pid;
else
cur_harq_pid =UE->dlsch[0][1]->current_harq_pid;
cur_harq_pid =UE->dlsch[subframe&0x1][0][1]->current_harq_pid;
if ((Ns==(1+(2*subframe))) && (l==0)) {// process PDSCH symbols 1,2,3,4,5,(6 Normal Prefix
/* if (transmission_mode == 5) {
if ((UE->dlsch[eNB_id][0]->harq_processes[cur_harq_pid]->dl_power_off==0) &&
if ((UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[cur_harq_pid]->dl_power_off==0) &&
(openair_daq_vars.use_ia_receiver ==1)) {
rx_type = rx_IC_single_stream;
} else {
......@@ -3701,7 +3701,7 @@ int main(int argc, char **argv)
(m==UE->pdcch_vars[0]->num_pdcch_symbols)?1:0,
rx_type,
i_mod,
UE->dlsch[0][0]->current_harq_pid)==-1){
UE->dlsch[subframe&0x1][0][0]->current_harq_pid)==-1){
dlsch_active = 0;
break;
}
......@@ -3788,7 +3788,7 @@ int main(int argc, char **argv)
break;
}
UE->dlsch[0][TB]->rnti = (common_flag==0) ? n_rnti: SI_RNTI;
UE->dlsch[subframe&0x1][0][TB]->rnti = (common_flag==0) ? n_rnti: SI_RNTI;
coded_bits_per_codeword[TB] = get_G(&eNB->frame_parms,
eNB->dlsch[0][TB]->harq_processes[0]->nb_rb,
eNB->dlsch[0][TB]->harq_processes[0]->rb_alloc,
......@@ -3798,12 +3798,12 @@ int main(int argc, char **argv)
0,subframe,
transmission_mode>=7?transmission_mode:0);
UE->dlsch[0][TB]->harq_processes[UE->dlsch[0][TB]->current_harq_pid]->G = coded_bits_per_codeword[TB];
UE->dlsch[0][TB]->harq_processes[UE->dlsch[0][TB]->current_harq_pid]->Qm = get_Qm(eNB->dlsch[0][TB]->harq_processes[0]->mcs);
UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->G = coded_bits_per_codeword[TB];
UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->Qm = get_Qm(eNB->dlsch[0][TB]->harq_processes[0]->mcs);
if (n_frames==2) {
printf("Kmimo=%d, TB=%d, G=%d, TBS=%d\n",Kmimo,TB,coded_bits_per_codeword[TB],
UE->dlsch[0][TB]->harq_processes[UE->dlsch[0][TB]->current_harq_pid]->TBS);
UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->TBS);
// calculate uncoded BER
uncoded_ber_bit = (short*) malloc(sizeof(short)*coded_bits_per_codeword[TB]);
......@@ -3812,7 +3812,7 @@ int main(int argc, char **argv)
sprintf(fname,"dlsch%d_rxF_r%d_cw%d_llr.m",eNB_id,round, TB);
sprintf(vname,"dl%d_r%d_cw%d_llr",eNB_id,round, TB);
write_output(fname,vname, UE->pdsch_vars[subframe&0x1][0]->llr[UE->dlsch[0][TB]->harq_processes[UE->dlsch[0][TB]->current_harq_pid]->codeword],coded_bits_per_codeword[TB],1,0);
write_output(fname,vname, UE->pdsch_vars[subframe&0x1][0]->llr[UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword],coded_bits_per_codeword[TB],1,0);
sprintf(fname,"dlsch_cw%d_e.m", TB);
sprintf(vname,"dlschcw%d_e", TB);
write_output(fname, vname,eNB->dlsch[0][TB]->harq_processes[0]->e,coded_bits_per_codeword[TB],1,4);
......@@ -3820,7 +3820,7 @@ int main(int argc, char **argv)
printf("trials=%d\n", trials);
for (i=0;i<coded_bits_per_codeword[TB];i++)
if (eNB->dlsch[0][TB]->harq_processes[0]->e[i] != (UE->pdsch_vars[subframe&0x1][0]->llr[UE->dlsch[0][TB]->harq_processes[UE->dlsch[0][TB]->current_harq_pid]->codeword][i]<0)) {
if (eNB->dlsch[0][TB]->harq_processes[0]->e[i] != (UE->pdsch_vars[subframe&0x1][0]->llr[UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword][i]<0)) {
uncoded_ber_bit[i] = 1;
uncoded_ber++;
}
......@@ -3842,22 +3842,22 @@ int main(int argc, char **argv)
start_meas(&UE->dlsch_unscrambling_stats);
dlsch_unscrambling(&UE->frame_parms,
0,
UE->dlsch[0][TB],
UE->dlsch[subframe&0x1][0][TB],
coded_bits_per_codeword[TB],
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[0][TB]->harq_processes[UE->dlsch[0][TB]->current_harq_pid]->codeword],
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword],
TB,
subframe<<1);
stop_meas(&UE->dlsch_unscrambling_stats);
start_meas(&UE->dlsch_decoding_stats);
ret[TB] = dlsch_decoding(UE,
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[0][TB]->harq_processes[UE->dlsch[0][TB]->current_harq_pid]->codeword],
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword],
&UE->frame_parms,
UE->dlsch[0][TB],
UE->dlsch[0][TB]->harq_processes[UE->dlsch[0][TB]->current_harq_pid],
UE->dlsch[subframe&0x1][0][TB],
UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid],
0,
subframe,
UE->dlsch[0][TB]->current_harq_pid,
UE->dlsch[subframe&0x1][0][TB]->current_harq_pid,
1,llr8_flag);
stop_meas(&UE->dlsch_decoding_stats);
#ifdef DEBUG_HARQ
......@@ -3865,11 +3865,11 @@ int main(int argc, char **argv)
#endif
//printf("retr cw 0 = %d\n", ret[0]);
//printf("current round = %d\n", UE->dlsch[0][cw_non_sic]->harq_processes[UE->dlsch[0][cw_non_sic]->current_harq_pid]->round);
//printf("current round = %d\n", UE->dlsch[subframe&0x1][0][cw_non_sic]->harq_processes[UE->dlsch[subframe&0x1][0][cw_non_sic]->current_harq_pid]->round);