Commit cce0b45f authored by Florian Kaltenberger's avatar Florian Kaltenberger
Browse files

a few small bugfixes, but not yet finished

parent e24847b1
......@@ -5843,20 +5843,19 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb)
}
if (pmi_re > pmi_im)
pmiq = PMI_2A_R1_11;
else if (pmi_re < pmi_im)
else //if (pmi_re < pmi_im)
pmiq = PMI_2A_R1_1j;
printf("subband %d, pmi%d \n",i,pmiq);
printf("subband %d, pmi_re %d, pmi_in %d, pmiq %d \n",i,pmi_re,pmi_im,pmiq);
//According to Section 7.2.4 of 36.213
pmivect |= ((pmiq-1)<<(i)); //shift 1 since only one bit
printf("subband %d pmivect %d \n",i, pmivect);
}
else {
// This needs to be done properly!!!
msg("PMI feedback for rank>1 not supported!\n");
LOG_E(PHY,"PMI feedback for rank>1 not supported!\n");
pmivect = 0;
}
}
printf("subband %d pmivect %d \n",i, pmivect);
return(pmivect);
}
......
......@@ -190,9 +190,6 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
//printf("rx_pdsch: harq_pid=%d, round=%d\n",harq_pid,round);
if (frame_parms->nb_antennas_tx_eNB>1) {
//#ifdef DEBUG_DLSCH_MOD
//printf("dlsch: using pmi %x (%p), rb_alloc %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),dlsch_ue[0],dlsch0_harq->rb_alloc_even[0]);
//#endif
nb_rb = dlsch_extract_rbs_dual(lte_ue_common_vars->rxdataF,
lte_ue_common_vars->dl_ch_estimates[eNB_id],
lte_ue_pdsch_vars[eNB_id]->rxdataF_ext,
......@@ -205,6 +202,9 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue->high_speed_flag,
frame_parms,
dlsch0_harq->mimo_mode);
//#ifdef DEBUG_DLSCH_MOD
printf("dlsch: using pmi %lx, rb_alloc %x, pmi_ext %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),*rballoc,*lte_ue_pdsch_vars[eNB_id]->pmi_ext);
//#endif
if (rx_type==rx_IC_single_stream) {
if (eNB_id_i<phy_vars_ue->n_connected_eNB) // we are in TM5
......@@ -1830,7 +1830,7 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
int **dl_ch_magb1 = lte_ue_pdsch_vars->dl_ch_magb1;
int **rxdataF_comp0 = lte_ue_pdsch_vars->rxdataF_comp0;
int **rxdataF_comp1 = lte_ue_pdsch_vars->rxdataF_comp1[harq_pid][round];
unsigned char **pmi_ext = lte_ue_pdsch_vars->pmi_ext;
unsigned char *pmi_ext = lte_ue_pdsch_vars->pmi_ext;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp0_128,QAM_amp0_128b,QAM_amp1_128,QAM_amp1_128b;
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
......@@ -4016,14 +4016,6 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
LTE_DL_FRAME_PARMS *frame_parms,
MIMO_mode_t mimo_mode) {
/*uint8_t get_pmi(uint8_t N_RB_DL,LTE_DL_eNB_HARQ_t *dlsch_harq,uint16_t rb)
{
MIMO_mode_t mode = dlsch_harq->mimo_mode;*/
//PHY_VARS_UE *phy_vars_ue,
int prb,nb_rb=0;
int prb_off,prb_off2;
int rb_alloc_ind,skip_half=0,sss_symb,pss_symb=0,nsymb,l;
......
......@@ -1254,7 +1254,6 @@ uint8_t get_pmi(uint8_t N_RB_DL,LTE_DL_eNB_HARQ_t *dlsch_harq,uint16_t rb)
MIMO_mode_t mode = dlsch_harq->mimo_mode;
uint32_t pmi_alloc = dlsch_harq->pmi_alloc;
printf("Getting pmi for RB %d => %d\n",rb,((pmi_alloc>>rb)&1));
switch (N_RB_DL) {
case 6: // 1 PRB per subband
if (mode <= PUSCH_PRECODING1) //single layer
......@@ -1268,9 +1267,10 @@ uint8_t get_pmi(uint8_t N_RB_DL,LTE_DL_eNB_HARQ_t *dlsch_harq,uint16_t rb)
case 25: // 4 PRBs per subband
if (mode <= PUSCH_PRECODING1)
return((pmi_alloc>>((rb>>2)<<1))&3);
else
else {
printf("Getting pmi for RB %d => %d\n",rb,((pmi_alloc>>(rb>>2))&1));
return((pmi_alloc>>(rb>>2))&1);
}
break;
case 50: // 6 PRBs per subband
......@@ -1369,7 +1369,7 @@ int dlsch_modulation(mod_sym_t **txdataF,
for (l=num_pdcch_symbols; l<nsymb; l++) {
#ifdef DEBUG_DLSCH_MODULATION
printf("Generating DLSCH (harq_pid %d,mimo %d, pmi_alloc0 %llx, mod0 %d, mod1 %d, rb_alloc[0] %d) in %d\n",
printf("Generating DLSCH (harq_pid %d,mimo %d, pmi_alloc0 %lx, mod0 %d, mod1 %d, rb_alloc[0] %d) in %d\n",
harq_pid,
dlsch0_harq->mimo_mode,
pmi2hex_2Ar2(dlsch0_harq->pmi_alloc),
......
......@@ -1712,8 +1712,8 @@ n(tikz_fname,"w");
((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])->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 = 2;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 2;
dci_length = sizeof_DCI2_20MHz_2A_TDD_t;
dci_length_bytes = sizeof(DCI2_20MHz_2A_TDD_t);
break;
......@@ -1735,7 +1735,7 @@ n(tikz_fname,"w");
((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])->tb_swap = 0;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
((DCI2_1_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
break;
case 25:
dci_length = sizeof_DCI2_5MHz_2A_FDD_t;
......@@ -1751,7 +1751,7 @@ n(tikz_fname,"w");
((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])->tb_swap = 0;
((DCI2_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
((DCI2_5MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
break;
case 50:
dci_length = sizeof_DCI2_10MHz_2A_FDD_t;
......@@ -1767,7 +1767,7 @@ n(tikz_fname,"w");
((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])->tb_swap = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
((DCI2_10MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
break;
case 100:
dci_length = sizeof_DCI2_20MHz_2A_FDD_t;
......@@ -1783,7 +1783,7 @@ n(tikz_fname,"w");
((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])->tb_swap = 0;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
((DCI2_20MHz_2A_FDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 0;
break;
}
}
......@@ -2149,7 +2149,7 @@ n(tikz_fname,"w");
// printf("Trial %d, round %d\n",trials,round);
round_trials[round]++;
if(transmission_mode>=5)
if (transmission_mode == 4 || transmission_mode == 5 || transmission_mode == 6)
pmi_feedback=1;
else
pmi_feedback=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