Commit 90346d26 authored by knopp's avatar knopp

fixed issues in subframe 5 RE allocation when PDSCH overlaps PSS/SSS, Basic UE...

fixed issues in subframe 5 RE allocation when PDSCH overlaps PSS/SSS, Basic UE functionality on USRP, RK

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6596 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 5f7d6c7b
...@@ -78,7 +78,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -78,7 +78,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
max_pos_fil = ((max_pos_fil * coef) + (max_pos * ncoef)) >> 15; max_pos_fil = ((max_pos_fil * coef) + (max_pos * ncoef)) >> 15;
diff = max_pos_fil - 2; //frame_parms->nb_prefix_samples/8; diff = max_pos_fil - frame_parms->nb_prefix_samples/8;
if ( diff > SYNCH_HYST ) if ( diff > SYNCH_HYST )
phy_vars_ue->rx_offset++; phy_vars_ue->rx_offset++;
......
...@@ -2600,7 +2600,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) { ...@@ -2600,7 +2600,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) {
case 50: case 50:
msg("DCI format1A (TDD1-6, 10MHz), rnti %x (%x)\n",dci->rnti,((uint32_t*)&dci->dci_pdu[0])[0]); msg("DCI format1A (TDD1-6, 10MHz), rnti %x (%x)\n",dci->rnti,((uint32_t*)&dci->dci_pdu[0])[0]);
msg("VRB_TYPE %d\n",((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->vrb_type); msg("VRB_TYPE %d\n",((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->vrb_type);
msg("RB_ALLOC %x (NB_RB %d)\n",((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->rballoc,RIV2nb_rb_LUT25[((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->rballoc]); msg("RB_ALLOC %x (NB_RB %d)\n",((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->rballoc,RIV2nb_rb_LUT50[((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->rballoc]);
msg("MCS %d\n",((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->mcs); msg("MCS %d\n",((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->mcs);
msg("HARQ_PID %d\n",((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->harq_pid); msg("HARQ_PID %d\n",((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->harq_pid);
msg("NDI %d\n",((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->ndi); msg("NDI %d\n",((DCI1A_10MHz_TDD_1_6_t *)&dci->dci_pdu[0])->ndi);
...@@ -2611,7 +2611,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) { ...@@ -2611,7 +2611,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) {
case 100: case 100:
msg("DCI format1A (TDD1-6, 20MHz), rnti %x (%x)\n",dci->rnti,((uint32_t*)&dci->dci_pdu[0])[0]); msg("DCI format1A (TDD1-6, 20MHz), rnti %x (%x)\n",dci->rnti,((uint32_t*)&dci->dci_pdu[0])[0]);
msg("VRB_TYPE %d\n",((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->vrb_type); msg("VRB_TYPE %d\n",((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->vrb_type);
msg("RB_ALLOC %x (NB_RB %d)\n",((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->rballoc,RIV2nb_rb_LUT25[((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->rballoc]); msg("RB_ALLOC %x (NB_RB %d)\n",((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->rballoc,RIV2nb_rb_LUT100[((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->rballoc]);
msg("MCS %d\n",((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->mcs); msg("MCS %d\n",((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->mcs);
msg("HARQ_PID %d\n",((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->harq_pid); msg("HARQ_PID %d\n",((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->harq_pid);
msg("NDI %d\n",((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->ndi); msg("NDI %d\n",((DCI1A_20MHz_TDD_1_6_t *)&dci->dci_pdu[0])->ndi);
...@@ -2651,7 +2651,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) { ...@@ -2651,7 +2651,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) {
case 50: case 50:
msg("DCI format1A(FDD, 10MHz), rnti %x (%x)\n",dci->rnti,((uint32_t*)&dci->dci_pdu[0])[0]); msg("DCI format1A(FDD, 10MHz), rnti %x (%x)\n",dci->rnti,((uint32_t*)&dci->dci_pdu[0])[0]);
msg("VRB_TYPE %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->vrb_type); msg("VRB_TYPE %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->vrb_type);
msg("RB_ALLOC %x (NB_RB %d)\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->rballoc,RIV2nb_rb_LUT25[((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->rballoc]); msg("RB_ALLOC %x (NB_RB %d)\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->rballoc,RIV2nb_rb_LUT50[((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->rballoc]);
msg("MCS %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->mcs); msg("MCS %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->mcs);
msg("HARQ_PID %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->harq_pid); msg("HARQ_PID %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->harq_pid);
msg("NDI %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->ndi); msg("NDI %d\n",((DCI1A_10MHz_FDD_t *)&dci->dci_pdu[0])->ndi);
...@@ -2661,7 +2661,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) { ...@@ -2661,7 +2661,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) {
case 100: case 100:
msg("DCI format1A(FDD, 20MHz), rnti %x (%x)\n",dci->rnti,((uint32_t*)&dci->dci_pdu[0])[0]); msg("DCI format1A(FDD, 20MHz), rnti %x (%x)\n",dci->rnti,((uint32_t*)&dci->dci_pdu[0])[0]);
msg("VRB_TYPE %d\n",((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->vrb_type); msg("VRB_TYPE %d\n",((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->vrb_type);
msg("RB_ALLOC %x (NB_RB %d)\n",((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->rballoc,RIV2nb_rb_LUT25[((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->rballoc]); msg("RB_ALLOC %x (NB_RB %d)\n",((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->rballoc,RIV2nb_rb_LUT100[((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->rballoc]);
msg("MCS %d\n",((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->mcs); msg("MCS %d\n",((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->mcs);
msg("HARQ_PID %d\n",((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->harq_pid); msg("HARQ_PID %d\n",((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->harq_pid);
msg("NDI %d\n",((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->ndi); msg("NDI %d\n",((DCI1A_20MHz_FDD_t *)&dci->dci_pdu[0])->ndi);
...@@ -3490,7 +3490,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3490,7 +3490,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
ndi = ((DCI1A_10MHz_FDD_t *)dci_pdu)->ndi; ndi = ((DCI1A_10MHz_FDD_t *)dci_pdu)->ndi;
TPC = ((DCI1A_10MHz_FDD_t *)dci_pdu)->TPC; TPC = ((DCI1A_10MHz_FDD_t *)dci_pdu)->TPC;
harq_pid = ((DCI1A_10MHz_FDD_t *)dci_pdu)->harq_pid; harq_pid = ((DCI1A_10MHz_FDD_t *)dci_pdu)->harq_pid;
//printf("FDD 1A: mcs %d, rballoc %x,rv %d, TPC %d\n",mcs,rballoc,rv,TPC); //printf("FDD 1A: mcs %d, rballoc %x,ndi %d, rv %d, TPC %d\n",mcs,rballoc,ndi,rv,TPC);
} }
if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)){ // if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)){ //
...@@ -3588,7 +3588,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3588,7 +3588,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
return(-1); return(-1);
} }
// change the mcs limit from 7 to 8, supported by MAC // change the mcs limit from 7 to 8, supported by MAC
if (mcs > 8) { if (mcs > 10) {
LOG_E(PHY,"Format 1A: unlikely mcs for format 1A (%d)\n",mcs); LOG_E(PHY,"Format 1A: unlikely mcs for format 1A (%d)\n",mcs);
return(-1); return(-1);
} }
...@@ -3608,15 +3608,16 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, ...@@ -3608,15 +3608,16 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
LOG_D(PHY,"UE (%x/%d): Subframe %d Format1A 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 Format1A 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);
if ((rnti != si_rnti) && (rnti!=ra_rnti)) {
if ((ndi!=dlsch0_harq->DCINdi)|| // DCI has been toggled or this is the first transmission if ((ndi!=dlsch0_harq->DCINdi)|| // DCI has been toggled or this is the first transmission
(dlsch0_harq->first_tx==1)) { (dlsch0_harq->first_tx==1)) {
dlsch0_harq->round = 0; dlsch0_harq->round = 0;
if (dlsch0_harq->first_tx==1) { if (dlsch0_harq->first_tx==1) {
LOG_D(PHY,"[PDSCH %x/%d] Format 1A DCI First TX: Clearing flag\n"); LOG_I(PHY,"[PDSCH %x/%d] Format 1A DCI First TX: Clearing flag\n");
dlsch0_harq->first_tx = 0; dlsch0_harq->first_tx = 0;
} }
} }
}
dlsch0_harq->DCINdi = ndi; dlsch0_harq->DCINdi = ndi;
dlsch0_harq->mcs = mcs; dlsch0_harq->mcs = mcs;
......
...@@ -2355,12 +2355,10 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, ...@@ -2355,12 +2355,10 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
else if (rb < 96) else if (rb < 96)
rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1; rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1;
else if (rb < 100) else if (rb < 100)
rb_alloc_ind = (rb_alloc[0]>>(rb-96)) & 1; rb_alloc_ind = (rb_alloc[3]>>(rb-96)) & 1;
else else
rb_alloc_ind = 0; rb_alloc_ind = 0;
if (rb_alloc_ind==1)
nb_rb++;
// PBCH // PBCH
if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) { if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) {
...@@ -2412,13 +2410,10 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, ...@@ -2412,13 +2410,10 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
skip_half=2; skip_half=2;
} }
if (rb_alloc_ind==1) { if (rb_alloc_ind==1) {
/* // printf("rb %d/symbol %d (skip_half %d)\n",rb,l,skip_half);
printf("rb %d\n",rb);
for (i=0;i<12;i++)
printf("(%d %d)",((short *)dl_ch0)[i<<1],((short*)dl_ch0)[1+(i<<1)]);
printf("\n");
*/
if (pilots==0) { if (pilots==0) {
// printf("Extracting w/o pilots (symbol %d, rb %d, skip_half %d)\n",l,rb,skip_half); // printf("Extracting w/o pilots (symbol %d, rb %d, skip_half %d)\n",l,rb,skip_half);
if (skip_half==1) { if (skip_half==1) {
...@@ -2482,6 +2477,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, ...@@ -2482,6 +2477,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
rxF_ext+=10; rxF_ext+=10;
} }
} }
nb_rb++;
} }
dl_ch0+=12; dl_ch0+=12;
rxF+=12; rxF+=12;
...@@ -2496,24 +2492,23 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, ...@@ -2496,24 +2492,23 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
else if (rb < 96) else if (rb < 96)
rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1; rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1;
else if (rb < 100) else if (rb < 100)
rb_alloc_ind = (rb_alloc[0]>>(rb-96)) & 1; rb_alloc_ind = (rb_alloc[3]>>(rb-96)) & 1;
else else
rb_alloc_ind = 0; rb_alloc_ind = 0;
if (rb_alloc_ind==1)
nb_rb++;
// PBCH // PBCH
if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) { if ((subframe==0) && (rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) {
rb_alloc_ind = 0; rb_alloc_ind = 0;
} }
//SSS //SSS
if (((subframe==0)||(subframe==5)) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==sss_symb) ) { if (((subframe==0)||(subframe==5)) && (rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==sss_symb) ) {
rb_alloc_ind = 0; rb_alloc_ind = 0;
} }
if (frame_parms->frame_type == FDD) { if (frame_parms->frame_type == FDD) {
//PSS //PSS
if (((subframe==0)||(subframe==5)) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) { if (((subframe==0)||(subframe==5)) && (rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) {
rb_alloc_ind = 0; rb_alloc_ind = 0;
} }
} }
...@@ -2528,6 +2523,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, ...@@ -2528,6 +2523,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
// printf("dlch_ext %d\n",dl_ch0_ext-&dl_ch_estimates_ext[aarx][0]); // printf("dlch_ext %d\n",dl_ch0_ext-&dl_ch_estimates_ext[aarx][0]);
// printf("DC rb %d (%p)\n",rb,rxF); // printf("DC rb %d (%p)\n",rb,rxF);
if (rb_alloc_ind==1) { if (rb_alloc_ind==1) {
// printf("rb %d/symbol %d (skip_half %d)\n",rb,l,skip_half);
if (pilots==0) { if (pilots==0) {
for (i=0;i<6;i++) { for (i=0;i<6;i++) {
dl_ch0_ext[i]=dl_ch0[i]; dl_ch0_ext[i]=dl_ch0[i];
...@@ -2561,6 +2557,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, ...@@ -2561,6 +2557,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
dl_ch0_ext+=10; dl_ch0_ext+=10;
rxF_ext+=10; rxF_ext+=10;
} // symbol_mod==0 } // symbol_mod==0
nb_rb++;
} // rballoc==1 } // rballoc==1
else { else {
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))]; rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))];
...@@ -2580,12 +2577,11 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, ...@@ -2580,12 +2577,11 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
else if (rb < 96) else if (rb < 96)
rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1; rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1;
else if (rb < 100) else if (rb < 100)
rb_alloc_ind = (rb_alloc[0]>>(rb-96)) & 1; rb_alloc_ind = (rb_alloc[3]>>(rb-96)) & 1;
else else
rb_alloc_ind = 0; rb_alloc_ind = 0;
if (rb_alloc_ind==1)
nb_rb++;
// PBCH // PBCH
if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=nsymb>>1) && (l<((nsymb>>1) + 4))) { if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=nsymb>>1) && (l<((nsymb>>1) + 4))) {
...@@ -2630,6 +2626,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, ...@@ -2630,6 +2626,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
} }
if (rb_alloc_ind==1) { if (rb_alloc_ind==1) {
// printf("rb %d/symbol %d (skip_half %d)\n",rb,l,skip_half);
/* /*
printf("rb %d\n",rb); printf("rb %d\n",rb);
for (i=0;i<12;i++) for (i=0;i<12;i++)
...@@ -2700,6 +2697,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, ...@@ -2700,6 +2697,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
rxF_ext+=10; rxF_ext+=10;
} }
} // pilots=0 } // pilots=0
nb_rb++;
} }
dl_ch0+=12; dl_ch0+=12;
rxF+=12; rxF+=12;
...@@ -2777,7 +2775,7 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -2777,7 +2775,7 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
else if (rb < 96) else if (rb < 96)
rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1; rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1;
else if (rb < 100) else if (rb < 100)
rb_alloc_ind = (rb_alloc[0]>>(rb-96)) & 1; rb_alloc_ind = (rb_alloc[3]>>(rb-96)) & 1;
else else
rb_alloc_ind = 0; rb_alloc_ind = 0;
...@@ -2789,55 +2787,35 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -2789,55 +2787,35 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
} }
// PBCH // PBCH
if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) { if ((subframe==0) && (rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) {
rb_alloc_ind = 0; rb_alloc_ind = 0;
} }
//PBCH subframe 0, symbols nsymb>>1 ... nsymb>>1 + 3
if ((subframe==0) && (rb==((frame_parms->N_RB_DL>>1)-3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4)))
skip_half=1;
else if ((subframe==0) && (rb==((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4)))
skip_half=2;
//SSS //SSS
if (((subframe==0)||(subframe==5)) && if (((subframe==0)||(subframe==5)) &&
(rb>((frame_parms->N_RB_DL>>1)-3)) && (rb>=((frame_parms->N_RB_DL>>1)-3)) &&
(rb<((frame_parms->N_RB_DL>>1)+3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) &&
(l==sss_symb) ) { (l==sss_symb) ) {
rb_alloc_ind = 0; rb_alloc_ind = 0;
} }
//SSS
if (((subframe==0)||(subframe==5)) &&
(rb==((frame_parms->N_RB_DL>>1)-3)) &&
(l==sss_symb))
skip_half=1;
else if (((subframe==0)||(subframe==5)) &&
(rb==((frame_parms->N_RB_DL>>1)+3)) &&
(l==sss_symb))
skip_half=2;
//PSS in subframe 0/5 if FDD //PSS in subframe 0/5 if FDD
if (frame_parms->frame_type == FDD) { //FDD if (frame_parms->frame_type == FDD) { //FDD
if (((subframe==0)||(subframe==5)) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) { if (((subframe==0)||(subframe==5)) && (rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) {
rb_alloc_ind = 0; rb_alloc_ind = 0;
} }
if (((subframe==0)||(subframe==5)) && (rb==((frame_parms->N_RB_DL>>1)-3)) && (l==pss_symb))
skip_half=1;
else if (((subframe==0)||(subframe==5)) && (rb==((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb))
skip_half=2;
} }
if ((frame_parms->frame_type == TDD) && if ((frame_parms->frame_type == TDD) &&
(subframe==6)){ //TDD Subframe 6 (subframe==6)){ //TDD Subframe 6
if ((rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) { if ((rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) {
rb_alloc_ind = 0; rb_alloc_ind = 0;
} }
if ((rb==((frame_parms->N_RB_DL>>1)-3)) && (l==pss_symb))
skip_half=1;
else if ((rb==((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb))
skip_half=2;
} }
if (rb_alloc_ind==1) { if (rb_alloc_ind==1) {
...@@ -2862,7 +2840,6 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -2862,7 +2840,6 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
// printf("%d : (%d,%d)\n",(rxF+(2*i)-&rxdataF[(aatx<<1)+aarx][( (symbol*(frame_parms->ofdm_symbol_size)))*2])/2, // printf("%d : (%d,%d)\n",(rxF+(2*i)-&rxdataF[(aatx<<1)+aarx][( (symbol*(frame_parms->ofdm_symbol_size)))*2])/2,
// ((short*)&rxF[i<<1])[0],((short*)&rxF[i<<1])[0]); // ((short*)&rxF[i<<1])[0],((short*)&rxF[i<<1])[0]);
} }
nb_rb++;
dl_ch0_ext+=12; dl_ch0_ext+=12;
dl_ch1_ext+=12; dl_ch1_ext+=12;
rxF_ext+=12; rxF_ext+=12;
...@@ -2880,11 +2857,13 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -2880,11 +2857,13 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
dl_ch1_ext[j++]=dl_ch1[i]; dl_ch1_ext[j++]=dl_ch1[i];
} }
} }
nb_rb++;
dl_ch0_ext+=8; dl_ch0_ext+=8;
dl_ch1_ext+=8; dl_ch1_ext+=8;
rxF_ext+=8; rxF_ext+=8;
} // pilots==1 } // pilots==1
nb_rb++;
} }
dl_ch0+=12; dl_ch0+=12;
dl_ch1+=12; dl_ch1+=12;
...@@ -2900,12 +2879,12 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -2900,12 +2879,12 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
else if (rb < 96) else if (rb < 96)
rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1; rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1;
else if (rb < 100) else if (rb < 100)
rb_alloc_ind = (rb_alloc[0]>>(rb-96)) & 1; rb_alloc_ind = (rb_alloc[3]>>(rb-96)) & 1;
else else
rb_alloc_ind = 0; rb_alloc_ind = 0;
if (rb_alloc_ind == 1)
nb_rb++;
// PBCH // PBCH
if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) { if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) {
rb_alloc_ind = 0; rb_alloc_ind = 0;
...@@ -3045,6 +3024,7 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -3045,6 +3024,7 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
rxF_ext+=8; rxF_ext+=8;
} }
} }
nb_rb++;
} }
dl_ch0+=12; dl_ch0+=12;
...@@ -3065,8 +3045,8 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -3065,8 +3045,8 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
else else
rb_alloc_ind = 0; rb_alloc_ind = 0;
if (rb_alloc_ind==1)
nb_rb++;
// PBCH // PBCH
...@@ -3143,6 +3123,7 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -3143,6 +3123,7 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
dl_ch1_ext+=8; dl_ch1_ext+=8;
rxF_ext+=8; rxF_ext+=8;
} }
nb_rb++;
} }
else { else {
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))]; rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))];
...@@ -3162,12 +3143,10 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -3162,12 +3143,10 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
else if (rb < 96) else if (rb < 96)
rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1; rb_alloc_ind = (rb_alloc[2]>>(rb-64)) & 1;
else if (rb < 100) else if (rb < 100)
rb_alloc_ind = (rb_alloc[0]>>(rb-96)) & 1; rb_alloc_ind = (rb_alloc[3]>>(rb-96)) & 1;
else else
rb_alloc_ind = 0; rb_alloc_ind = 0;
if (rb_alloc_ind==1)
nb_rb++;
// PBCH // PBCH
if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) { if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) {
...@@ -3307,6 +3286,7 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -3307,6 +3286,7 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
} }
} }
nb_rb++;
} }
dl_ch0+=12; dl_ch0+=12;
dl_ch1+=12; dl_ch1+=12;
......
...@@ -662,14 +662,14 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -662,14 +662,14 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
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)
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3); len = (nb_rb*8);// - (2*pbch_pss_sss_adjust/3);
else else
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6); len = (nb_rb*10);// - (5*pbch_pss_sss_adjust/6);
} }
else { else {
len = (nb_rb*12) - pbch_pss_sss_adjust; len = (nb_rb*12);// - pbch_pss_sss_adjust;
} }
// printf("dlsch_qpsk_llr: symbol %d,len %d,pbch_pss_sss_adjust %d\n",symbol,len,pbch_pss_sss_adjust); // printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
for (i=0;i<len;i++) { for (i=0;i<len;i++) {
*llr32 = *rxF; *llr32 = *rxF;
rxF++; rxF++;
......
...@@ -1254,7 +1254,7 @@ int dlsch_modulation(mod_sym_t **txdataF, ...@@ -1254,7 +1254,7 @@ int dlsch_modulation(mod_sym_t **txdataF,
if (rb_alloc_ind > 0) if (rb_alloc_ind > 0)
{ {
// printf("Allocated rb %d, subframe_offset %d, symbol_offset %d, re_offset %d, jj %d\n",rb,subframe_offset,symbol_offset,re_offset,jj); // printf("Allocated rb %d/symbol %d, skip_half %d, subframe_offset %d, symbol_offset %d, re_offset %d, jj %d\n",rb,l,skip_half,subframe_offset,symbol_offset,re_offset,jj);
allocate_REs_in_RB(frame_parms, allocate_REs_in_RB(frame_parms,
txdataF, txdataF,
&jj, &jj,
......
...@@ -173,12 +173,7 @@ int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode) { ...@@ -173,12 +173,7 @@ int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
return -1; return -1;
break; break;