Commit ece7bcb7 authored by Elena_Lukashova's avatar Elena_Lukashova

Adding the updated CSI option for retransmission of TB1 in TM4. Pass -U from...

Adding the updated CSI option for retransmission of TB1 in TM4. Pass -U from the command line to enable.
parent 33215ee3
......@@ -169,6 +169,8 @@ int main(int argc, char **argv)
unsigned char cur_harq_pid;
int hold_rank1_precoder=0;
int tpmi_retr=2;
bool is_first_time;
int updated_csi = 0;
SCM_t channel_model=Rayleigh1;
......@@ -234,7 +236,7 @@ int main(int argc, char **argv)
int ch_realization;
int pmi_feedback=0;
int hold_channel=0;
bool is_first_time;
// temporarily for retransmissions:
unsigned char resend_cw1=0; //if 0 resend only cw0
......@@ -330,7 +332,7 @@ int main(int argc, char **argv)
// num_layers = 1;
perfect_ce = 0;
while ((c = getopt (argc, argv, "ahdpZDe:Em: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:XYv:W:J:K:")) != -1) {
while ((c = getopt (argc, argv, "ahdpZDe:Em: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:XYv:W:J:K:U")) != -1) {
switch (c) {
case 'a':
......@@ -598,6 +600,9 @@ int main(int argc, char **argv)
tpmi_retr = atoi(optarg);
//i_mod = get_Qm(mcs2); /// think here again!!!
break;
case 'U':
updated_csi=1;
break;
case 'h':
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,3,5,6) -y TXant -z RXant -I trch_file\n",argv[0]);
......@@ -2835,10 +2840,20 @@ int main(int argc, char **argv)
//Here need to add cases for TPMI 6 and TPMI 5 and check for both TB.
if (transmission_mode == 4 && ((((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 2) ||(((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 2))){
#ifdef DEBUG_HARQ
printf ("[DLSIM] I am calling from the eNode B 1\n");
#endif
PHY_vars_eNB->dlsch_eNB[0][TB]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&PHY_vars_UE->PHY_measurements,0,PHY_vars_eNB->lte_frame_parms.N_RB_DL);
#ifdef DEBUG_HARQ
printf ("[DLSIM] I am calling from the eNode B 2\n");
#endif
PHY_vars_UE->dlsch_ue[0][TB]->pmi_alloc = quantize_subband_pmi(&PHY_vars_UE->PHY_measurements,0,PHY_vars_UE->lte_frame_parms.N_RB_DL);
}
if (updated_csi == 0){
if ((transmission_mode == 4) && (hold_rank1_precoder == 0) && ((((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 5) ||(((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 5))){
#ifdef DEBUG_HARQ
printf ("[DLSIM] I am calling from the eNode B 1\n");
......@@ -2860,6 +2875,53 @@ int main(int argc, char **argv)
#endif
PHY_vars_UE->dlsch_ue[0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(PHY_vars_UE->dlsch_ue[0][TB]->pmi_alloc,6,PHY_vars_UE->lte_frame_parms.N_RB_DL);
}
} else if (updated_csi == 1){
if ((transmission_mode == 4) && ((((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 5) ||(((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi == 5))){
#ifdef DEBUG_HARQ
printf ("[DLSIM] Updating CSI\n");
printf ("[DLSIM] I quantize from ENodeB 1\n");
#endif
PHY_vars_eNB->dlsch_eNB[0][TB]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&PHY_vars_UE->PHY_measurements,0,PHY_vars_eNB->lte_frame_parms.N_RB_DL);
#ifdef DEBUG_HARQ
printf ("[DLSIM] I convert pmi to rank1 eNode B 1\n");
#endif
PHY_vars_eNB->dlsch_eNB[0][TB]->harq_processes[0]->pmi_alloc = pmi_convert_rank1_from_rank2(PHY_vars_eNB->dlsch_eNB[0][TB]->harq_processes[0]->pmi_alloc,5,PHY_vars_eNB->lte_frame_parms.N_RB_DL);
#ifdef DEBUG_HARQ
printf ("[DLSIM] I quantize from ENodeB 2\n");
#endif
PHY_vars_UE->dlsch_ue[0][TB]->pmi_alloc = quantize_subband_pmi(&PHY_vars_UE->PHY_measurements,0,PHY_vars_UE->lte_frame_parms.N_RB_DL);
#ifdef DEBUG_HARQ
printf ("[DLSIM] I convert pmi to rank1 eNode B 2\n");
#endif
PHY_vars_UE->dlsch_ue[0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(PHY_vars_UE->dlsch_ue[0][TB]->pmi_alloc,5,PHY_vars_UE->lte_frame_parms.N_RB_DL);
}
if ((transmission_mode == 4) && ((((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
printf ("[DLSIM] Updating CSI\n");
printf ("[DLSIM] I quantize from ENodeB 1\n");
#endif
PHY_vars_eNB->dlsch_eNB[0][TB]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&PHY_vars_UE->PHY_measurements,0,PHY_vars_eNB->lte_frame_parms.N_RB_DL);
#ifdef DEBUG_HARQ
printf ("[DLSIM] I convert pmi to rank1 eNode B 1\n");
#endif
PHY_vars_eNB->dlsch_eNB[0][TB]->harq_processes[0]->pmi_alloc = pmi_convert_rank1_from_rank2(PHY_vars_eNB->dlsch_eNB[0][TB]->harq_processes[0]->pmi_alloc,6,PHY_vars_eNB->lte_frame_parms.N_RB_DL);
#ifdef DEBUG_HARQ
printf ("[DLSIM] I quantize from ENodeB 2\n");
#endif
PHY_vars_UE->dlsch_ue[0][TB]->pmi_alloc = quantize_subband_pmi(&PHY_vars_UE->PHY_measurements,0,PHY_vars_UE->lte_frame_parms.N_RB_DL);
#ifdef DEBUG_HARQ
printf ("[DLSIM] I convert pmi to rank1 eNode B 2\n");
#endif
PHY_vars_UE->dlsch_ue[0][TB]->pmi_alloc = pmi_convert_rank1_from_rank2(PHY_vars_UE->dlsch_ue[0][TB]->pmi_alloc,6,PHY_vars_UE->lte_frame_parms.N_RB_DL);
}
}
start_meas(&PHY_vars_eNB->dlsch_encoding_stats);
if (dlsch_encoding(((TB==0) ? input_buffer0[k] : input_buffer1[k]),
......@@ -3269,8 +3331,11 @@ int main(int argc, char **argv)
if (pmi_feedback == 1) {
pmi_feedback = 0;
hold_channel = 1;
if (updated_csi==0) {
if (hold_rank1_precoder == 0)
hold_rank1_precoder = 1;
}
//printf ("trial %d pmi_feedback %d \n", trials, pmi_feedback);
//printf ("go to PMI feedback\n");
#ifdef DEBUG_HARQ
......
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