Commit 5519f661 authored by Younes's avatar Younes

UEspec-RS generation for TM8 is working. To run dlsim:

(25 RBs) : gdb --args ./dlsim -x8 -q2 -y2 -n1 -R1 -m1 -M1 -z1 -D -S7
(50 RBs) : gdb --args ./dlsim -x8 -q2 -y2 -n1 -R1 -m1 -M1 -z1 -D -S7 -B50
parent 437aa152
......@@ -612,7 +612,6 @@ int allocate_REs_in_RB(PHY_VARS_eNB *phy_vars_eNB,
uint8_t precoder_index0;
int use2ndpilots = (frame_parms->mode1_flag==1)?1:0;
int cnt;
uint32_t tti_offset; //,aa;
uint8_t re;
uint8_t qam64_table_offset_re = 0;
......@@ -632,7 +631,7 @@ int cnt;
int16_t gain_lin_QPSK;//,gain_lin_16QAM1,gain_lin_16QAM2;
int16_t re_off=re_offset;
uint8_t first_re,last_re;
int32_t tmp_sample1,tmp_sample2;
int16_t tmp_amp=amp;
......@@ -716,7 +715,7 @@ int cnt;
//check that RE is not from Cell-specific RS
if (is_not_pilot(pilots,re,frame_parms->nushift,use2ndpilots)==1) {
if (is_not_pilot(pilots,re,frame_parms->nushift,use2ndpilots)==1) {
//printf("re %d (jj %d)\n",re,*jj);
......@@ -1729,25 +1728,73 @@ int cnt;
}
}
else {
else {/* The following process is called 4 times (lprime=0,1,2,3), N_RB_DL times per lprime, 3 times per rb (re=1,6,11), 2 times per re (p=7,8) */
for (p=7; p<9; p++) {
if (p==first_layer0 || p==first_layer1) {
if (frame_parms->Ncp==0) { //normal CP
ind = 3*lprime*frame_parms->N_RB_DL+3*rb+mprime2;
ind_dword = ind>>4 ;
ind_qpsk_symb = ind&0xf ;
/* Here rb has to be 0 to N_RB_DL otherwise w does not get the right values in the case of p8 */
if (p==8) {
if (lprime==1) {
if (frame_parms->N_RB_DL==25) {
rb = rb-85;
} else if (frame_parms->N_RB_DL==50) {
rb = rb-60;
}
} else if (lprime==2) {
if (frame_parms->N_RB_DL==25) {
rb = rb-170;
} else if (frame_parms->N_RB_DL==50) {
rb = rb-120;
}
} else if (lprime==3) {
if (frame_parms->N_RB_DL==25) {
rb = rb-255;
} else if (frame_parms->N_RB_DL==50) {
rb = rb-180;
}
}
}
if (((mprime2+rb)%2)==0) {
w = Wbar_NCP[p-7][lprime] ;
w = Wbar_NCP[p-7][lprime];
} else {
w = Wbar_NCP[p-7][3-lprime] ;
w = Wbar_NCP[p-7][3-lprime];
}
/* Here we have to assign specific values to rb in order to produce the same ind values as the Matlab */
if ((re<2 && p==7) ||(p==8 && lprime>0)) {
if (lprime==1) {
if (frame_parms->N_RB_DL==25) {
rb = rb+85;
} else if (frame_parms->N_RB_DL==50) {
rb = rb+60;
}
} else if (lprime==2) {
if (frame_parms->N_RB_DL==25) {
rb = rb+170;
} else if (frame_parms->N_RB_DL==50) {
rb = rb+120;
}
} else if (lprime==3) {
if (frame_parms->N_RB_DL==25) {
rb = rb+255;
} else if (frame_parms->N_RB_DL==50) {
rb = rb+180;
}
}
}
ind = 3*lprime*frame_parms->N_RB_DL+3*rb+mprime2;
ind_dword = ind>>4 ;
ind_qpsk_symb = ind&0xf ;
} else { //extended CP
// this is very likely wrong as the Wbar table is different for extended CP
ind = 4*lprime*dlsch0_harq->nb_rb+4*rb+mprime2 ;
ind_dword = ind>>4 ;
ind_qpsk_symb = ind&0xf ;
int l = lprime%2 ;
int l = lprime%2;
if ((mprime2%2)==0) {
w = Wbar_NCP[p-7][l] ;
......@@ -1755,33 +1802,25 @@ int cnt;
w = Wbar_NCP[p-7][1-l] ;
}
}
qpsk_p = (w==1) ? qpsk : nqpsk;
/* pointer to the frequency domain Tx signal */
txdataF[p][tti_offset] = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[nscid][Ns][0][ind_dword]>>(2*ind_qpsk_symb))&3] ;
if (p==7){
if (lprime==0){
cnt++;
}
printf("information : p %d, lprime %d, w %d, mprime2 %d, qpsk_p[pos] %d , qpsk_p[re] %d, qpsk_p[im] %d\n", p, lprime, w, mprime2, (phy_vars_eNB->lte_gold_uespec_table[nscid][Ns][0][ind_dword]>>(2*ind_qpsk_symb))&3, ((int16_t *)&qpsk[phy_vars_eNB->lte_gold_uespec_table[nscid][Ns][0][ind_dword]>>(2*ind_qpsk_symb)&3])[0], ((int16_t *)&qpsk[phy_vars_eNB->lte_gold_uespec_table[nscid][Ns][0][ind_dword]>>(2*ind_qpsk_symb)&3])[1]);
printf("txdataF[re] %d, p %d, tti_offset %d\n", ((int16_t *)&txdataF[p][tti_offset])[0], p, tti_offset);
printf("txdataF[im] %d, p %d, tti_offset %d\n", ((int16_t *)&txdataF[p][tti_offset])[1], p, tti_offset);
printf("symbol_offset %d, re_off %d, re %d\n", symbol_offset, re_off, re);
printf("nscid %d, Ns %d, ind_dword %d\n", nscid, Ns, ind_dword);
}
}
}
mprime2++ ;
}
qpsk_p = (w==1) ? qpsk : nqpsk;
txdataF[p][tti_offset] = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[nscid][Ns][0][ind_dword]>>(2*ind_qpsk_symb))&3];
if (lprime==1) {
printf("p=%d, w=%d, txdataF = {%d %d}\n\n", p,w,((int16_t *)&txdataF[p][tti_offset])[0],((int16_t *)&txdataF[p][tti_offset])[1]);
}
}//end if p=first_layer
}// end for p=7
mprime2++ ; // mprime2 is the counter of UE-spec REs within an OFDM symbol
}//end for else
} else if (mimo_mode>=TM9_10) {
printf("allocate_REs_in_RB() [dlsch.c] : ERROR, unknown mimo_mode %d\n",mimo_mode);
return(-1);
}
}
}
printf("cnt %d\n", cnt);
}// end for is_not_pilot()
}// end for re=first_re
return(0);
}
}// end for allocate_REs_in_RB
int allocate_REs_in_RB_MCH(int32_t **txdataF,
......@@ -2365,9 +2404,9 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
else
lprime=-1;
} else {
if (l==13)
if (l==11)
lprime=3;
else if (l==12)
else if (l==10)
lprime=2;
else if (l==5)
lprime=1;
......
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