Commit 75a2c3cf authored by knopp's avatar knopp

Merge branch 'enhancement-10-harmony' of...

Merge branch 'enhancement-10-harmony' of https://gitlab.eurecom.fr/oai/openairinterface5g into enhancement-10-harmony

Conflicts:
	openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
parents 862e480e 4b022799
......@@ -132,18 +132,18 @@ void log_map8(llr_t* systematic,
msg("log_map, frame_length %d\n",frame_length);
#endif
start_meas(gamma_stats) ;
if (gamma_stats) start_meas(gamma_stats) ;
compute_gamma8(m11,m10,systematic,y_parity,frame_length,term_flag) ;
stop_meas(gamma_stats);
start_meas(alpha_stats) ;
if (gamma_stats) stop_meas(gamma_stats);
if (alpha_stats) start_meas(alpha_stats) ;
compute_alpha8(alpha,beta,m11,m10,frame_length,F) ;
stop_meas(alpha_stats);
start_meas(beta_stats) ;
if (alpha_stats) stop_meas(alpha_stats);
if (beta_stats) start_meas(beta_stats) ;
compute_beta8(alpha,beta,m11,m10,frame_length,F,offset8_flag) ;
stop_meas(beta_stats);
start_meas(ext_stats) ;
if (beta_stats) stop_meas(beta_stats);
if (ext_stats) start_meas(ext_stats) ;
compute_ext8(alpha,beta,m11,m10,ext,systematic,frame_length) ;
stop_meas(ext_stats);
if (ext_stats) stop_meas(ext_stats);
}
......@@ -963,7 +963,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
}
start_meas(init_stats);
if (init_stats) start_meas(init_stats);
if ((n&15)>0) {
......@@ -1326,7 +1326,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
msg("\n");
#endif //DEBUG_LOGMAP
stop_meas(init_stats);
if (init_stats) stop_meas(init_stats);
// do log_map from first parity bit
......@@ -1338,7 +1338,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
printf("\n*******************ITERATION %d (n %d, n2 %d), ext %p\n\n",iteration_cnt,n,n2,ext);
#endif //DEBUG_LOGMAP
start_meas(intl1_stats);
if (intl1_stats) start_meas(intl1_stats);
pi4_p=pi4tab8[iind];
for (i=0; i<(n2>>4); i++) { // steady-state portion
......@@ -1379,7 +1379,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
#endif
}
stop_meas(intl1_stats);
if (intl1_stats) stop_meas(intl1_stats);
// do log_map from second parity bit
......@@ -1484,7 +1484,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
// Check if we decoded the block
if (iteration_cnt>1) {
start_meas(intl2_stats);
if (intl2_stats) start_meas(intl2_stats);
if ((n2&0x7f) == 0) { // n2 is a multiple of 128 bits
......@@ -1623,7 +1623,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
break;
}
stop_meas(intl2_stats);
if (intl2_stats) stop_meas(intl2_stats);
if ((crc == oldcrc) && (crc!=0)) {
return(iteration_cnt);
......
......@@ -864,7 +864,8 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
generate_16qam_table();
generate_RIV_tables();
init_unscrambling_lut();
init_scrambling_lut();
//set_taus_seed(1328);
}
......@@ -1107,6 +1108,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
init_prach_tables(839);
return 0;
}
......
......@@ -143,7 +143,7 @@ typedef struct {
/// downlink power offset field
uint8_t dl_power_off;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[MAX_NUM_CHANNEL_BITS];
uint8_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32)));
/// Turbo-code outputs (36-212 V8.6 2009-03, p.12
uint8_t *d[MAX_NUM_DLSCH_SEGMENTS];//[(96+3+(3*6144))];
/// Sub-block interleaver outputs (36-212 V8.6 2009-03, p.16-17)
......@@ -407,7 +407,7 @@ typedef struct {
/// coded RI bits
int16_t q_RI[MAX_RI_PAYLOAD];
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
int16_t e[MAX_NUM_CHANNEL_BITS];
int16_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32)));
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
uint8_t h[MAX_NUM_CHANNEL_BITS];
/// Pointer to the payload
......
This diff is collapsed.
......@@ -325,47 +325,74 @@ int allocate_REs_in_RB_no_pilots_64QAM_siso(LTE_DL_FRAME_PARMS *frame_parms,
if (skip_dc == 0) {
x0p=&x0[*jj],tti_offset=symbol_offset+re_offset;
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset,re=0;
/* for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset,re=0;
re<12;
re+=4,x0p+=24,tti_offset+=4) {
re+=4,x0p+=24,tti_offset+=4) {*/
qam64_table_offset_re=FOUR[x0p[0]];
qam64_table_offset_im=FOUR[x0p[1]];
qam64_table_offset_re+=TWO[x0p[2]];
qam64_table_offset_im+=TWO[x0p[3]];
qam64_table_offset_re+=x0p[4];
qam64_table_offset_im+=x0p[5];
qam64_table_offset_re=(x0p[0]<<2)|(x0p[2]<<1)|x0p[4];
qam64_table_offset_im=(x0p[1]<<2)|(x0p[3]<<1)|x0p[5];
((int16_t *)&txdataF[0][tti_offset])[0]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[1]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=FOUR[x0p[6]];
qam64_table_offset_im=FOUR[x0p[7]];
qam64_table_offset_re+=TWO[x0p[8]];
qam64_table_offset_im+=TWO[x0p[9]];
qam64_table_offset_re+=x0p[10];
qam64_table_offset_im+=x0p[11];
qam64_table_offset_re=(x0p[6]<<2)|(x0p[8]<<1)|x0p[10];
qam64_table_offset_im=(x0p[7]<<2)|(x0p[9]<<1)|x0p[11];
((int16_t *)&txdataF[0][tti_offset])[2]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[3]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=FOUR[x0p[12]];
qam64_table_offset_im=FOUR[x0p[13]];
qam64_table_offset_re+=TWO[x0p[14]];
qam64_table_offset_im+=TWO[x0p[15]];
qam64_table_offset_re+=x0p[16];
qam64_table_offset_im+=x0p[17];
qam64_table_offset_re=(x0p[12]<<2)|(x0p[14]<<1)|x0p[16];
qam64_table_offset_im=(x0p[13]<<2)|(x0p[15]<<1)|x0p[17];
((int16_t *)&txdataF[0][tti_offset])[4]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[5]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=FOUR[x0p[18]];
qam64_table_offset_im=FOUR[x0p[19]];
qam64_table_offset_re+=TWO[x0p[20]];
qam64_table_offset_im+=TWO[x0p[21]];
qam64_table_offset_re+=x0p[22];
qam64_table_offset_im+=x0p[23];
qam64_table_offset_re=(x0p[18]<<2)|(x0p[20]<<1)|x0p[22];
qam64_table_offset_im=(x0p[19]<<2)|(x0p[21]<<1)|x0p[23];
((int16_t *)&txdataF[0][tti_offset])[6]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[7]=qam_table_s0[qam64_table_offset_im];
}
qam64_table_offset_re=(x0p[24]<<2)|(x0p[26]<<1)|x0p[28];
qam64_table_offset_im=(x0p[25]<<2)|(x0p[27]<<1)|x0p[29];
((int16_t *)&txdataF[0][tti_offset])[8]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[9]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[30]<<2)|(x0p[32]<<1)|x0p[34];
qam64_table_offset_im=(x0p[31]<<2)|(x0p[33]<<1)|x0p[35];
((int16_t *)&txdataF[0][tti_offset])[10]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[11]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[36]<<2)|(x0p[38]<<1)|x0p[40];
qam64_table_offset_im=(x0p[37]<<2)|(x0p[39]<<1)|x0p[41];
((int16_t *)&txdataF[0][tti_offset])[12]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[13]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[42]<<2)|(x0p[44]<<1)|x0p[46];
qam64_table_offset_im=(x0p[43]<<2)|(x0p[45]<<1)|x0p[47];
((int16_t *)&txdataF[0][tti_offset])[14]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[15]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[48]<<2)|(x0p[50]<<1)|x0p[52];
qam64_table_offset_im=(x0p[49]<<2)|(x0p[51]<<1)|x0p[53];
((int16_t *)&txdataF[0][tti_offset])[16]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[17]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[54]<<2)|(x0p[56]<<1)|x0p[58];
qam64_table_offset_im=(x0p[55]<<2)|(x0p[57]<<1)|x0p[59];
((int16_t *)&txdataF[0][tti_offset])[18]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[19]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[60]<<2)|(x0p[62]<<1)|x0p[64];
qam64_table_offset_im=(x0p[61]<<2)|(x0p[63]<<1)|x0p[65];
((int16_t *)&txdataF[0][tti_offset])[20]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[21]=qam_table_s0[qam64_table_offset_im];
qam64_table_offset_re=(x0p[66]<<2)|(x0p[68]<<1)|x0p[70];
qam64_table_offset_im=(x0p[67]<<2)|(x0p[69]<<1)|x0p[71];
((int16_t *)&txdataF[0][tti_offset])[22]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[23]=qam_table_s0[qam64_table_offset_im];
// }
}
else {
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset,re=0;
......@@ -1668,6 +1695,69 @@ int dlsch_modulation(int32_t **txdataF,
re_offset = frame_parms->first_carrier_offset;
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*(l+(subframe_offset*nsymb));
allocate_REs = allocate_REs_in_RB;
switch (mod_order0) {
case 2:
qam_table_s0 = NULL;
break;
case 4:
if (pilots) {
qam_table_s0 = qam16_table_b0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_pilots_16QAM_siso :
allocate_REs_in_RB;
}
else {
qam_table_s0 = qam16_table_a0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_no_pilots_16QAM_siso :
allocate_REs_in_RB;
}
break;
case 6:
if (pilots) {
qam_table_s0 = qam64_table_b0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_pilots_64QAM_siso :
allocate_REs_in_RB;
}
else {
qam_table_s0 = qam64_table_a0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_no_pilots_64QAM_siso :
allocate_REs_in_RB;
}
break;
}
switch (mod_order1) {
case 2:
qam_table_s1 = NULL;
allocate_REs = allocate_REs_in_RB;
break;
case 4:
if (pilots) {
qam_table_s1 = qam16_table_b1;
}
else {
qam_table_s1 = qam16_table_a1;
}
break;
case 6:
if (pilots) {
qam_table_s1 = qam64_table_b1;
}
else {
qam_table_s1 = qam64_table_a1;
}
break;
}
//for (aa=0;aa<frame_parms->nb_antennas_tx;aa++)
// memset(&txdataF[aa][symbol_offset],0,frame_parms->ofdm_symbol_size<<2);
//printf("symbol_offset %d,subframe offset %d : pilots %d\n",symbol_offset,subframe_offset,pilots);
......@@ -1816,68 +1906,7 @@ int dlsch_modulation(int32_t **txdataF,
}
}
allocate_REs = allocate_REs_in_RB;
switch (mod_order0) {
case 2:
qam_table_s0 = NULL;
break;
case 4:
if (pilots) {
qam_table_s0 = qam16_table_b0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_pilots_16QAM_siso :
allocate_REs_in_RB;
}
else {
qam_table_s0 = qam16_table_a0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_no_pilots_16QAM_siso :
allocate_REs_in_RB;
}
break;
case 6:
if (pilots) {
qam_table_s0 = qam64_table_b0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_pilots_64QAM_siso :
allocate_REs_in_RB;
}
else {
qam_table_s0 = qam64_table_a0;
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_no_pilots_64QAM_siso :
allocate_REs_in_RB;
}
break;
}
switch (mod_order1) {
case 2:
qam_table_s1 = NULL;
allocate_REs = allocate_REs_in_RB;
break;
case 4:
if (pilots) {
qam_table_s1 = qam16_table_b1;
}
else {
qam_table_s1 = qam16_table_a1;
}
break;
case 6:
if (pilots) {
qam_table_s1 = qam64_table_b1;
}
else {
qam_table_s1 = qam64_table_a1;
}
break;
}
if (rb_alloc_ind > 0) {
// 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);
......
......@@ -48,6 +48,34 @@
#include "PHY/extern.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
static inline unsigned int lte_gold_scram(unsigned int *x1, unsigned int *x2, unsigned char reset) __attribute__((always_inline));
static inline unsigned int lte_gold_scram(unsigned int *x1, unsigned int *x2, unsigned char reset)
{
int n;
if (reset) {
*x1 = 1+ (1<<31);
*x2=*x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31);
// skip first 50 double words (1600 bits)
// printf("n=0 : x1 %x, x2 %x\n",x1,x2);
for (n=1; n<50; n++) {
*x1 = (*x1>>1) ^ (*x1>>4);
*x1 = *x1 ^ (*x1<<31) ^ (*x1<<28);
*x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4);
*x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28);
}
}
*x1 = (*x1>>1) ^ (*x1>>4);
*x1 = *x1 ^ (*x1<<31) ^ (*x1<<28);
*x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4);
*x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28);
return(*x1^*x2);
// printf("n=%d : c %x\n",n,x1^x2);
}
void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
int mbsfn_flag,
LTE_eNB_DLSCH_t *dlsch,
......@@ -75,53 +103,57 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
#ifdef DEBUG_SCRAMBLING
printf("scrambling: rnti %x, q %d, Ns %d, Nid_cell %d, length %d\n",dlsch->rnti,q,Ns,frame_parms->Nid_cell, G);
#endif
s = lte_gold_generic(&x1, &x2, 1);
s = lte_gold_scram(&x1, &x2, 1);
for (i=0; i<(1+(G>>5)); i++) {
#ifdef DEBUG_SCRAMBLING
printf("scrambling %d : %d => ",k,e[k]);
#endif
e[0] = (e[0]) ^ (s&1);
e[1] = (e[1]) ^ ((s>>1)&1);
e[2] = (e[2]) ^ ((s>>2)&1);
e[3] = (e[3]) ^ ((s>>3)&1);
e[4] = (e[4]) ^ ((s>>4)&1);
e[5] = (e[5]) ^ ((s>>5)&1);
e[6] = (e[6]) ^ ((s>>6)&1);
e[7] = (e[7]) ^ ((s>>7)&1);
e[8] = (e[8]) ^ ((s>>8)&1);
e[9] = (e[9]) ^ ((s>>9)&1);
e[10] = (e[10]) ^ ((s>>10)&1);
e[11] = (e[11]) ^ ((s>>11)&1);
e[12] = (e[12]) ^ ((s>>12)&1);
e[13] = (e[13]) ^ ((s>>13)&1);
e[14] = (e[14]) ^ ((s>>14)&1);
e[15] = (e[15]) ^ ((s>>15)&1);
e[16] = (e[16]) ^ ((s>>16)&1);
e[17] = (e[17]) ^ ((s>>17)&1);
e[18] = (e[18]) ^ ((s>>18)&1);
e[19] = (e[19]) ^ ((s>>19)&1);
e[20] = (e[20]) ^ ((s>>20)&1);
e[21] = (e[21]) ^ ((s>>21)&1);
e[22] = (e[22]) ^ ((s>>22)&1);
e[23] = (e[23]) ^ ((s>>23)&1);
e[24] = (e[24]) ^ ((s>>24)&1);
e[25] = (e[25]) ^ ((s>>25)&1);
e[26] = (e[26]) ^ ((s>>26)&1);
e[27] = (e[27]) ^ ((s>>27)&1);
e[28] = (e[28]) ^ ((s>>28)&1);
e[29] = (e[29]) ^ ((s>>29)&1);
e[30] = (e[30]) ^ ((s>>30)&1);
e[31] = (e[31]) ^ ((s>>31)&1);
e[0] = (e[0]&1) ^ (s&1);
e[1] = (e[1]&1) ^ ((s>>1)&1);
e[2] = (e[2]&1) ^ ((s>>2)&1);
e[3] = (e[3]&1) ^ ((s>>3)&1);
e[4] = (e[4]&1) ^ ((s>>4)&1);
e[5] = (e[5]&1) ^ ((s>>5)&1);
e[6] = (e[6]&1) ^ ((s>>6)&1);
e[7] = (e[7]&1) ^ ((s>>7)&1);
e[8] = (e[8]&1) ^ ((s>>8)&1);
e[9] = (e[9]&1) ^ ((s>>9)&1);
e[10] = (e[10]&1) ^ ((s>>10)&1);
e[11] = (e[11]&1) ^ ((s>>11)&1);
e[12] = (e[12]&1) ^ ((s>>12)&1);
e[13] = (e[13]&1) ^ ((s>>13)&1);
e[14] = (e[14]&1) ^ ((s>>14)&1);
e[15] = (e[15]&1) ^ ((s>>15)&1);
e[16] = (e[16]&1) ^ ((s>>16)&1);
e[17] = (e[17]&1) ^ ((s>>17)&1);
e[18] = (e[18]&1) ^ ((s>>18)&1);
e[19] = (e[19]&1) ^ ((s>>19)&1);
e[20] = (e[20]&1) ^ ((s>>20)&1);
e[21] = (e[21]&1) ^ ((s>>21)&1);
e[22] = (e[22]&1) ^ ((s>>22)&1);
e[23] = (e[23]&1) ^ ((s>>23)&1);
e[24] = (e[24]&1) ^ ((s>>24)&1);
e[25] = (e[25]&1) ^ ((s>>25)&1);
e[26] = (e[26]&1) ^ ((s>>26)&1);
e[27] = (e[27]&1) ^ ((s>>27)&1);
e[28] = (e[28]&1) ^ ((s>>28)&1);
e[29] = (e[29]&1) ^ ((s>>29)&1);
e[30] = (e[30]&1) ^ ((s>>30)&1);
e[31] = (e[31]&1) ^ ((s>>31)&1);
// This is not faster for some unknown reason
// ((__m128i *)e)[0] = _mm_xor_si128(((__m128i *)e)[0],((__m128i *)scrambling_lut)[s&65535]);
// ((__m128i *)e)[1] = _mm_xor_si128(((__m128i *)e)[1],((__m128i *)scrambling_lut)[s>>16]);
#ifdef DEBUG_SCRAMBLING
printf("%d\n",e[k]);
#endif
s = lte_gold_generic(&x1, &x2, 0);
s = lte_gold_scram(&x1, &x2, 0);
e += 32;
}
......@@ -153,7 +185,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
#ifdef DEBUG_SCRAMBLING
printf("unscrambling: rnti %x, q %d, Ns %d, Nid_cell %d length %d\n",dlsch->rnti,q,Ns,frame_parms->Nid_cell,G);
#endif
s = lte_gold_generic(&x1, &x2, 1);
s = lte_gold_scram(&x1, &x2, 1);
for (i=0; i<(1+(G>>5)); i++) {
for (j=0; j<32; j++,k++) {
......@@ -166,6 +198,30 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
#endif
}
s = lte_gold_generic(&x1, &x2, 0);
s = lte_gold_scram(&x1, &x2, 0);
}
}
void init_unscrambling_lut() {
uint32_t s;
int i=0,j;
for (s=0;s<=65535;s++) {
for (j=0;j<16;j++) {
unscrambling_lut[i++] = (int16_t)((((s>>j)&1)<<1)-1);
}
}
}
void init_scrambling_lut() {
uint32_t s;
int i=0,j;
for (s=0;s<=65535;s++) {
for (j=0;j<16;j++) {
scrambling_lut[i++] = (uint8_t)((s>>j)&1);
}
}
}
......@@ -93,7 +93,8 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uin
LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag);
/** \fn dlsch_encoding(uint8_t *input_buffer,
/** \fn dlsch_encoding(PHY_VARS_eNB *eNB,
uint8_t *input_buffer,
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch,
......@@ -105,6 +106,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag);
- Channel coding (Turbo coding)
- Rate matching (sub-block interleaving, bit collection, selection and transmission
- Code block concatenation
@param eNB Pointer to eNB PHY context
@param input_buffer Pointer to input buffer for sub-frame
@param frame_parms Pointer to frame descriptor structure
@param num_pdcch_symbols Number of PDCCH symbols in this subframe
......@@ -116,8 +118,8 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag);
@param i_stats Time statistics for interleaving
@returns status
*/
int32_t dlsch_encoding(uint8_t *a,
LTE_DL_FRAME_PARMS *frame_parms,
int32_t dlsch_encoding(PHY_VARS_eNB *eNB,
uint8_t *a,
uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch,
int frame,
......@@ -126,6 +128,39 @@ int32_t dlsch_encoding(uint8_t *a,
time_stats_t *te_stats,
time_stats_t *i_stats);
/** \fn dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
uint8_t *input_buffer,
uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch,
int frame,
uint8_t subframe)
\brief This function performs a subset of the bit-coding functions for LTE as described in 36-212, Release 8.Support is limited to turbo-coded channels (DLSCH/ULSCH). This version spawns 1 worker thread. The implemented functions are:
- CRC computation and addition
- Code block segmentation and sub-block CRC addition
- Channel coding (Turbo coding)
- Rate matching (sub-block interleaving, bit collection, selection and transmission
- Code block concatenation
@param eNB Pointer to eNB PHY context
@param input_buffer Pointer to input buffer for sub-frame
@param num_pdcch_symbols Number of PDCCH symbols in this subframe
@param dlsch Pointer to dlsch to be encoded
@param frame Frame number
@param subframe Subframe number
@param rm_stats Time statistics for rate-matching
@param te_stats Time statistics for turbo-encoding
@param i_stats Time statistics for interleaving
@returns status
*/
int32_t dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
uint8_t *a,
uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch,
int frame,
uint8_t subframe,
time_stats_t *rm_stats,
time_stats_t *te_stats,
time_stats_t *i_stats);
void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t *DLSCH_pdu,
LTE_eNB_DLSCH_t *dlsch);
......@@ -1544,6 +1579,32 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
uint8_t Nbundled,
uint8_t llr8_flag);
/*!
\brief Decoding of ULSCH data component from 36-212. This one spawns 1 worker thread in parallel,half of the segments in each thread.
@param phy_vars_eNB Pointer to eNB top-level descriptor
@param UE_id ID of UE transmitting this PUSCH
@param harq_pid HARQ process ID
@param llr8_flag If 1, indicate that the 8-bit turbo decoder should be used
@returns 0 on success
*/
int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,
int UE_id,
int harq_pid,
int llr8_flag);
/*!
\brief Decoding of ULSCH data component from 36-212. This one is single thread.
@param phy_vars_eNB Pointer to eNB top-level descriptor
@param UE_id ID of UE transmitting this PUSCH
@param harq_pid HARQ process ID
@param llr8_flag If 1, indicate that the 8-bit turbo decoder should be used
@returns 0 on success
*/
int ulsch_decoding_data(PHY_VARS_eNB *eNB,
int UE_id,
int harq_pid,
int llr8_flag);
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc,
uint8_t UE_index,
......@@ -1755,6 +1816,9 @@ void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common,
void init_prach_tables(int N_ZC);
void init_unscrambling_lut(void);
void init_scrambling_lut(void);
/*!
\brief Return the status of MBSFN in this frame/subframe
@param frame Frame index
......
This diff is collapsed.
......@@ -211,6 +211,21 @@ typedef struct {
/// scheduling parameters for RXn-TXnp4 thread
struct sched_param sched_param_rxtx;
} eNB_rxtx_proc_t;
typedef struct {
struct PHY_VARS_eNB_s *eNB;
int UE_id;
int harq_pid;
int llr8_flag;
int ret;
} td_params;
typedef struct {
struct PHY_VARS_eNB_s *eNB;
LTE_eNB_DLSCH_t *dlsch;
int G;
} te_params;
/// Context data structure for eNB subframe processing
typedef struct eNB_proc_t_s {
/// Component Carrier index
......@@ -229,6 +244,10 @@ typedef struct eNB_proc_t_s {
int frame_prach;
/// \internal This variable is protected by \ref mutex_fep.
int instance_cnt_fep;
/// \internal This variable is protected by \ref mutex_td.
int instance_cnt_td;
/// \internal This variable is protected by \ref mutex_te.
int instance_cnt_te;
/// \brief Instance count for FH processing thread.
/// \internal This variable is protected by \ref mutex_FH.
int instance_cnt_FH;
......@@ -249,6 +268,10 @@ typedef struct eNB_proc_t_s {
int first_tx;
/// pthread attributes for parallel fep thread
pthread_attr_t attr_fep;
/// pthread attributes for parallel turbo-decoder thread
pthread_attr_t attr_td;
/// pthread attributes for parallel turbo-encoder thread
pthread_attr_t attr_te;
/// pthread attributes for FH processing thread
pthread_attr_t attr_FH;
/// pthread attributes for single eNB processing thread
......@@ -259,6 +282,10 @@ typedef struct eNB_proc_t_s {
pthread_attr_t attr_asynch_rxtx;
/// scheduling parameters for parallel fep thread