Commit 669c8eb9 authored by knopp's avatar knopp

Additions for TM3 in eNB and partially in UE - RK

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6182 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent c753e7bc
......@@ -661,7 +661,8 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
int nulled=0;
#endif
if (Kmimo==0 || Mdlharq==0 || C==0 || Qm==0 || Nl==0) {
msg("lte_rate_matching.c: invalid paramters\n");
msg("lte_rate_matching.c: invalid parameters (Kmimo %d, Mdlharq %d, C %d, Qm %d, Nl %d\n",
Kmimo,Mdlharq,C,Qm,Nl);
return(-1);
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -109,10 +109,22 @@ typedef struct {
uint8_t rvidx;
/// MIMO mode for this DLSCH
MIMO_mode_t mimo_mode;
/// Number of layers for this PDSCH transmission
uint8_t Nlayers;
/// First layer for this PSCH transmission
uint8_t first_layer;
/// Current RB allocation
uint32_t rb_alloc[4];
/// Current subband PMI allocation
uint16_t pmi_alloc;
/// Current subband RI allocation
uint32_t ri_alloc;
/// Current subband CQI1 allocation
uint32_t cqi_alloc1;
/// Current subband CQI2 allocation
uint32_t cqi_alloc2;
/// Current Number of RBs
uint16_t nb_rb;
/// 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];
/// 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)
......@@ -129,8 +141,12 @@ typedef struct {
uint32_t Kplus;
/// Number of "Filler" bits (for definition see 36-212 V8.6 2009-03, p.10)
uint32_t F;
/// Number of MIMO layers (streams) (for definition see 36-212 V8.6 2009-03, p.17)
/// Number of MIMO layers (streams) (for definition see 36-212 V8.6 2009-03, p.17, TM3-4)
uint8_t Nl;
/// Number of layers for this PDSCH transmission (TM8-10)
uint8_t Nlayers;
/// First layer for this PSCH transmission
uint8_t first_layer;
} LTE_DL_eNB_HARQ_t;
typedef struct {
......@@ -221,34 +237,16 @@ typedef struct {
uint8_t ra_window_size;
/// First-round error threshold for fine-grain rate adaptation
uint8_t error_threshold;
/// Current RB allocation
uint32_t rb_alloc[4];
/// Current subband PMI allocation
uint16_t pmi_alloc;
/// Current subband RI allocation
uint32_t ri_alloc;
/// Current subband CQI1 allocation
uint32_t cqi_alloc1;
/// Current subband CQI2 allocation
uint32_t cqi_alloc2;
/// Current Number of RBs
uint16_t nb_rb;
/// Pointers to 8 HARQ processes for the DLSCH
LTE_DL_eNB_HARQ_t *harq_processes[8];
/// Number of soft channel bits
uint32_t G;
/// Layer index for this dlsch (0,1)
uint8_t layer_index;
/// Codebook index for this dlsch (0,1,2,3)
uint8_t codebook_index;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[MAX_NUM_CHANNEL_BITS];
/// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17)
uint8_t Mdlharq;
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
uint8_t Kmimo;
/// downlink power offset field
uint8_t dl_power_off;
/// amplitude of PDSCH (compared to RS) in symbols without pilots
int16_t sqrt_rho_a;
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
......@@ -637,8 +635,6 @@ typedef struct {
harq_status_t harq_ack[10];
/// Pointers to up to 8 HARQ processes
LTE_DL_UE_HARQ_t *harq_processes[8];
/// Layer index for this DLSCH
uint8_t layer_index;
/// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17
uint8_t Mdlharq;
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
......@@ -650,7 +646,6 @@ typedef struct {
typedef enum {format0,
format1,
format1A,
format1A_RA,
format1B,
format1C,
format1D,
......
......@@ -230,8 +230,9 @@ int dlsch_encoding(unsigned char *a,
unsigned int G;
unsigned int crc=1;
unsigned short iind;
unsigned short nb_rb = dlsch->nb_rb;
unsigned char harq_pid = dlsch->current_harq_pid;
unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb;
unsigned int A;
unsigned char mod_order;
unsigned int Kr=0,Kr_bytes,r,r_offset=0;
......@@ -243,7 +244,7 @@ int dlsch_encoding(unsigned char *a,
// printf("Encoder: A: %d\n",A);
mod_order = get_Qm(dlsch->harq_processes[harq_pid]->mcs);
G = get_G(frame_parms,nb_rb,dlsch->rb_alloc,mod_order,dlsch->harq_processes[harq_pid]->Nl,num_pdcch_symbols,frame,subframe);
G = get_G(frame_parms,nb_rb,dlsch->harq_processes[harq_pid]->rb_alloc,mod_order,dlsch->harq_processes[harq_pid]->Nl,num_pdcch_symbols,frame,subframe);
// if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet
......@@ -353,7 +354,7 @@ int dlsch_encoding(unsigned char *a,
r_offset += lte_rate_matching_turbo(dlsch->harq_processes[harq_pid]->RTC[r],
G, //G
dlsch->harq_processes[harq_pid]->w[r],
dlsch->e+r_offset,
dlsch->harq_processes[harq_pid]->e+r_offset,
dlsch->harq_processes[harq_pid]->C, // C
NSOFT, // Nsoft,
dlsch->Mdlharq,
......@@ -367,7 +368,7 @@ int dlsch_encoding(unsigned char *a,
stop_meas(rm_stats);
#ifdef DEBUG_DLSCH_CODING
if (r==dlsch->harq_processes[harq_pid]->C-1)
write_output("enc_output.m","enc",dlsch->e,r_offset,1,4);
write_output("enc_output.m","enc",dlsch->harq_processes[harq_pid]->e,r_offset,1,4);
#endif
}
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
......
......@@ -291,12 +291,13 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
(r==0) ? harq_process->F : 0);
#ifdef DEBUG_DLSCH_DECODING
msg("HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, mod_order %d, nb_rb %d, Nl %d)...\n",
msg("HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d)...\n",
harq_pid,r, G,
Kr*3,
get_Qm(harq_process->mcs),
harq_process->nb_rb,
harq_process->Nl);
Kr*3,
harq_process->TBS,
get_Qm(harq_process->mcs),
harq_process->nb_rb,
harq_process->Nl);
#endif
......@@ -675,7 +676,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
if (dlsch_abstraction_MIESM(phy_vars_ue->sinr_dB,
phy_vars_ue->transmission_mode[eNB_id],
dlsch_eNB->rb_alloc,
dlsch_eNB->harq_processes[harq_pid]->rb_alloc,
dlsch_eNB->harq_processes[harq_pid]->mcs,
PHY_vars_eNB_g[eNB_id][CC_id]->mu_mimo_mode[ue_id].dl_pow_off) == 1) {
// reset HARQ
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1063,7 +1063,7 @@ length = number of resource elements
xmm0 = _mm_xor_si128(xmm0,xmm0); // ZERO
// 1 term for nominator of LLR
// 1 term for numerator of LLR
xmm3 = _mm_subs_epi16(y1r_over2,rho_rpi);
A = _mm_abs_epi16(xmm3); // A = |y1r/2 - rho/sqrt(8)|
xmm2 = _mm_adds_epi16(A,y0i_over2); // = |y1r/2 - rho/sqrt(8)| + y0i/2
......@@ -1071,7 +1071,7 @@ length = number of resource elements
B = _mm_abs_epi16(xmm3); // B = |y1i/2 - rho*/sqrt(8)|
logmax_num_re0 = _mm_adds_epi16(B,xmm2); // = |y1r/2 - rho/sqrt(8)|+|y1i/2 - rho*/sqrt(8)| + y0i/2
// 2 term for nominator of LLR
// 2 term for numerator of LLR
xmm3 = _mm_subs_epi16(y1r_over2,rho_rmi);
C = _mm_abs_epi16(xmm3); // C = |y1r/2 - rho*/4|
xmm2 = _mm_subs_epi16(C,y0i_over2); // = |y1r/2 - rho*/4| - y0i/2
......
......@@ -58,7 +58,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
int i,j,k=0;
// uint8_t reset;
uint32_t x1, x2, s=0;
uint8_t *e=dlsch->e;
uint8_t *e=dlsch->harq_processes[dlsch->current_harq_pid]->e;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_SCRAMBLING, VCD_FUNCTION_IN);
......
......@@ -48,7 +48,7 @@
#include "gain_control.h"
#endif
//#define DEBUG_INITIAL_SYNCH
#define DEBUG_INITIAL_SYNCH
int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
......@@ -111,6 +111,7 @@ int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
frame_parms,
0,
SISO,
phy_vars_ue->high_speed_flag,
frame_mod4);
if ((pbch_tx_ant>0) && (pbch_tx_ant<=2)) {
pbch_decoded = 1;
......@@ -122,6 +123,7 @@ int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
frame_parms,
0,
ALAMOUTI,
phy_vars_ue->high_speed_flag,
frame_mod4);
if ((pbch_tx_ant>0) && (pbch_tx_ant<=2)) {
pbch_decoded = 1;
......
......@@ -70,6 +70,98 @@ extern __m128i zero;
#define PBCH_A 24
int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
mod_sym_t **txdataF,
uint32_t *jj,
uint16_t re_offset,
uint32_t symbol_offset,
uint8_t *x0,
uint8_t pilots,
int16_t amp,
uint32_t *re_allocated) {
MIMO_mode_t mimo_mode = (frame_parms->mode1_flag==1)?SISO:ALAMOUTI;
uint32_t tti_offset,aa;
uint8_t re;
int16_t gain_lin_QPSK;
int16_t re_off=re_offset;
uint8_t first_re,last_re;
int32_t tmp_sample1,tmp_sample2;
gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15)>>15);
first_re=0;
last_re=12;
for (re=first_re;re<last_re;re++) {
tti_offset = symbol_offset + re_off + re;
// check that RE is not from Cell-specific RS
if (is_not_pilot(pilots,re,frame_parms->nushift,0)==1) {
// printf("re %d (jj %d)\n",re,*jj);
if (mimo_mode == SISO) { //SISO mapping
*re_allocated = *re_allocated + 1;
// printf("%d(%d) : %d,%d => ",tti_offset,*jj,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
((int16_t*)&txdataF[aa][tti_offset])[0] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
}
*jj = *jj + 1;
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
((int16_t*)&txdataF[aa][tti_offset])[1] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //Q //b_{i+1}
}
*jj = *jj + 1;
}
else if (mimo_mode == ALAMOUTI){
*re_allocated = *re_allocated + 1;
((int16_t*)&tmp_sample1)[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
*jj=*jj+1;
((int16_t*)&tmp_sample1)[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
*jj=*jj+1;
// second antenna position n -> -x1*
((int16_t*)&tmp_sample2)[0] = (x0[*jj]==1) ? (gain_lin_QPSK) : -gain_lin_QPSK;
*jj=*jj+1;
((int16_t*)&tmp_sample2)[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
*jj=*jj+1;
// normalization for 2 tx antennas
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15)>>15);
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15)>>15);
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15)>>15);
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15)>>15);
// fill in the rest of the ALAMOUTI precoding
if (is_not_pilot(pilots,re + 1,frame_parms->nushift,0)==1) {
((int16_t *)&txdataF[0][tti_offset+1])[0] += -((int16_t *)&txdataF[1][tti_offset])[0]; //x1
((int16_t *)&txdataF[0][tti_offset+1])[1] += ((int16_t *)&txdataF[1][tti_offset])[1];
((int16_t *)&txdataF[1][tti_offset+1])[0] += ((int16_t *)&txdataF[0][tti_offset])[0]; //x0*
((int16_t *)&txdataF[1][tti_offset+1])[1] += -((int16_t *)&txdataF[0][tti_offset])[1];
}
else {
((int16_t *)&txdataF[0][tti_offset+2])[0] += -((int16_t *)&txdataF[1][tti_offset])[0]; //x1
((int16_t *)&txdataF[0][tti_offset+2])[1] += ((int16_t *)&txdataF[1][tti_offset])[1];
((int16_t *)&txdataF[1][tti_offset+2])[0] += ((int16_t *)&txdataF[0][tti_offset])[0]; //x0*
((int16_t *)&txdataF[1][tti_offset+2])[1] += -((int16_t *)&txdataF[0][tti_offset])[1];
}
re++; // adjacent carriers are taken care of by precoding
*re_allocated = *re_allocated + 1;
if (is_not_pilot(pilots,re,frame_parms->nushift,0)==0) { // skip pilots
re++;
*re_allocated = *re_allocated + 1;
}
}
}
}
return(0);
}
//uint8_t pbch_d[96+(3*(16+PBCH_A))], pbch_w[3*3*(16+PBCH_A)],pbch_e[1920]; //one bit per byte
int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
mod_sym_t **txdataF,
......@@ -260,62 +352,51 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
#endif
#ifdef IFFT_FPGA
re_offset = frame_parms->N_RB_DL*12-3*12;
symbol_offset = frame_parms->N_RB_DL*12*l;
#else
re_offset = frame_parms->ofdm_symbol_size-3*12;
symbol_offset = frame_parms->ofdm_symbol_size*l;
#endif
for (rb=0;rb<6;rb++) {
#ifdef DEBUG_PBCH
msg("RB %d, jj %d, re_offset %d, symbol_offset %d, pilots %d, nushift %d\n",rb,jj,re_offset, symbol_offset, pilots,frame_parms->nushift);
#endif
allocate_REs_in_RB(txdataF,
&jj,
re_offset,
symbol_offset,
&eNB_pbch->pbch_e[frame_mod4*(pbch_E>>2)],
(frame_parms->mode1_flag == 1) ? SISO : ALAMOUTI,
0,
pilots,
2,
0,
allocate_pbch_REs_in_RB(frame_parms,
txdataF,
&jj,
re_offset,
symbol_offset,
&eNB_pbch->pbch_e[frame_mod4*(pbch_E>>2)],
pilots,
#ifdef INTERFERENCE_MITIGATION
(pilots_2==1)?(amp/3):amp,
(pilots_2==1)?(amp/3):amp,
#else
amp,
amp,
#endif
NULL,
&re_allocated,
0,
0,
0,
1,
0,
frame_parms);
&re_allocated);
re_offset+=12; // go to next RB
// check if we crossed the symbol boundary and skip DC
#ifdef IFFT_FPGA
if (re_offset >= frame_parms->N_RB_DL*12)
re_offset = 0;
#else
if (re_offset >= frame_parms->ofdm_symbol_size)
re_offset=1;
#endif
}
// }
}
#ifdef DEBUG_PBCH
msg("[PBCH] txdataF=\n");
for (i=0;i<frame_parms->ofdm_symbol_size;i++)
msg("%d=>(%d,%d)\n",i,((short*)&txdataF[0][frame_parms->ofdm_symbol_size*(nsymb>>1)+i])[0],
((short*)&txdataF[0][frame_parms->ofdm_symbol_size*(nsymb>>1)+i])[1]);
printf("[PBCH] txdataF=\n");
for (i=0;i<frame_parms->ofdm_symbol_size;i++) {
printf("%d=>(%d,%d)",i,((short*)&txdataF[0][frame_parms->ofdm_symbol_size*(nsymb>>1)+i])[0],
((short*)&txdataF[0][frame_parms->ofdm_symbol_size*(nsymb>>1)+i])[1]);
if (frame_parms->mode1_flag==0) {
printf("(%d,%d)\n",((short*)&txdataF[1][frame_parms->ofdm_symbol_size*(nsymb>>1)+i])[0],
((short*)&txdataF[1][frame_parms->ofdm_symbol_size*(nsymb>>1)+i])[1]);
}
else {
printf("\n");
}
}
#endif
......@@ -332,11 +413,12 @@ int32_t generate_pbch_emul(PHY_VARS_eNB *phy_vars_eNB,uint8_t *pbch_pdu) {
}
uint16_t pbch_extract(int **rxdataF,
int **dl_ch_estimates,
int **rxdataF_ext,
int **dl_ch_estimates_ext,
uint32_t symbol,
LTE_DL_FRAME_PARMS *frame_parms) {
int **dl_ch_estimates,
int **rxdataF_ext,
int **dl_ch_estimates_ext,
uint32_t symbol,
uint32_t high_speed_flag,
LTE_DL_FRAME_PARMS *frame_parms) {
uint16_t rb,nb_rb=6;
......@@ -356,21 +438,14 @@ uint16_t pbch_extract(int **rxdataF,
(rx_offset + (symbol*(frame_parms->ofdm_symbol_size)))*2,
LTE_CE_OFFSET+ch_offset+(symbol_mod*(frame_parms->ofdm_symbol_size)));
*/
#ifndef NEW_FFT
rxF = &rxdataF[aarx][(rx_offset + (symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][(rx_offset + (symbol*(frame_parms->ofdm_symbol_size)))];
#endif
rxF_ext = &rxdataF_ext[aarx][symbol_mod*(6*12)];
for (rb=0; rb<nb_rb; rb++) {
// skip DC carrier
if (rb==3) {
#ifndef NEW_FFT
rxF = &rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))];
#endif
}
if ((symbol_mod==0) || (symbol_mod==1)) {
j=0;
......@@ -379,39 +454,26 @@ uint16_t pbch_extract(int **rxdataF,
(i!=(nushiftmod3+3)) &&
(i!=(nushiftmod3+6)) &&
(i!=(nushiftmod3+9))) {
#ifndef NEW_FFT
rxF_ext[j++]=rxF[i<<1];
#else
rxF_ext[j++]=rxF[i];
#endif
}
}
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
rxF_ext+=8;
}
else {
for (i=0;i<12;i++) {
#ifndef NEW_FFT
rxF_ext[i]=rxF[i<<1];
#else
rxF_ext[i]=rxF[i];
#endif
}
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
rxF_ext+=12;
}
}
for (aatx=0;aatx<4;aatx++) {//frame_parms->nb_antennas_tx_eNB;aatx++) {
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][LTE_CE_OFFSET+ch_offset+(symbol*(frame_parms->ofdm_symbol_size))];
if (high_speed_flag == 1)
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][LTE_CE_OFFSET+ch_offset+(symbol*(frame_parms->ofdm_symbol_size))];
else
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][LTE_CE_OFFSET+ch_offset];
dl_ch0_ext = &dl_ch_estimates_ext[(aatx<<1)+aarx][symbol_mod*(6*12)];
for (rb=0; rb<nb_rb; rb++) {
......@@ -737,11 +799,12 @@ static int8_t pbch_w_rx[3*3*(16+PBCH_A)],pbch_d_rx[96+(3*(16+PBCH_A))];
uint16_t rx_pbch(LTE_UE_COMMON *lte_ue_common_vars,
LTE_UE_PBCH *lte_ue_pbch_vars,
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t eNB_id,
MIMO_mode_t mimo_mode,
uint8_t frame_mod4) {
LTE_UE_PBCH *lte_ue_pbch_vars,
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t eNB_id,
MIMO_mode_t mimo_mode,
uint32_t high_speed_flag,
uint8_t frame_mod4) {
uint8_t log2_maxh;//,aatx,aarx;
int max_h=0;
......@@ -778,6 +841,7 @@ uint16_t rx_pbch(LTE_UE_COMMON *lte_ue_common_vars,
lte_ue_pbch_vars->rxdataF_ext,
lte_ue_pbch_vars->dl_ch_estimates_ext,
symbol,
high_speed_flag,
frame_parms);
#ifdef DEBUG_PBCH
msg("[PHY] PBCH Symbol %d\n",symbol);
......@@ -811,7 +875,7 @@ uint16_t rx_pbch(LTE_UE_COMMON *lte_ue_common_vars,
// msg("[PBCH][RX] Alamouti receiver not yet implemented!\n");
// return(-1);
}
else if ((mimo_mode != ANTCYCLING) && (mimo_mode != SISO)) {
else if (mimo_mode != SISO) {
msg("[PBCH][RX] Unsupported MIMO mode\n");
return(-1);
}
......@@ -911,7 +975,7 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
uint8_t eNB_id,
uint8_t pbch_phase) {
double bler=0.0, x=0.0;
double bler=0.0;//, x=0.0;
double sinr=0.0;
uint16_t nb_rb = phy_vars_ue->lte_frame_parms.N_RB_DL;
int16_t f;
......
......@@ -75,16 +75,16 @@ void dump_mch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_co
*/
sprintf(fname,"mch_rxF_comp0.m");
sprintf(vname,"pmch_rxF_comp0");
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars_MCH[eNB_id]->rxdataF_comp[0],12*N_RB_DL*nsymb_pmch,1,1);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars_MCH[eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb_pmch,1,1);
sprintf(fname,"mch_rxF_llr.m");
sprintf(vname,"pmch_llr");
write_output(fname,vname, phy_vars_ue->lte_ue_pdsch_vars_MCH[eNB_id]->llr[0],coded_bits_per_codeword,1,0);
sprintf(fname,"mch_mag1.m");
sprintf(vname,"pmch_mag1");
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars_MCH[eNB_id]->dl_ch_mag[0],12*N_RB_DL*nsymb_pmch,1,1);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars_MCH[eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb_pmch,1,1);
sprintf(fname,"mch_mag2.m");
sprintf(vname,"pmch_mag2");
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars_MCH[eNB_id]->dl_ch_magb[0],12*N_RB_DL*nsymb_pmch,1,1);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars_MCH[eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb_pmch,1,1);
write_output("mch00_ch0.m","pmch00_ch0",
&(phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][0][0]),
......@@ -186,24 +186,24 @@ void fill_eNB_dlsch_MCH(PHY_VARS_eNB *phy_vars_eNB,int mcs,int ndi,int rvidx, in
dlsch->harq_processes[0]->Nl = 1;
dlsch->harq_processes[0]->TBS = TBStable[get_I_TBS(dlsch->harq_processes[0]->mcs)][frame_parms->N_RB_DL-1];
dlsch->current_harq_pid = 0;
dlsch->nb_rb = frame_parms->N_RB_DL;
dlsch->harq_processes[0]->nb_rb = frame_parms->N_RB_DL;
switch(frame_parms->N_RB_DL) {
case 6:
dlsch->rb_alloc[0] = 0x3f;
dlsch->harq_processes[0]->rb_alloc[0] = 0x3f;
break;
case 25:
dlsch->rb_alloc[0] = 0x1ffffff;
dlsch->harq_processes[0]->rb_alloc[0] = 0x1ffffff;
break;
case 50:
dlsch->rb_alloc[0] = 0xffffffff;
dlsch->rb_alloc[1] = 0x3ffff;
dlsch->harq_processes[0]->rb_alloc[0] = 0xffffffff;
dlsch->harq_processes[0]->rb_alloc[1] = 0x3ffff;
break;
case 100:
dlsch->rb_alloc[0] = 0xffffffff;
dlsch->rb_alloc[1] = 0xffffffff;
dlsch->rb_alloc[2] = 0xffffffff;
dlsch->rb_alloc[3] = 0xf;
dlsch->harq_processes[0]->rb_alloc[0] = 0xffffffff;
dlsch->harq_processes[0]->rb_alloc[1] = 0xffffffff;
dlsch->harq_processes[0]->rb_alloc[2] = 0xffffffff;
dlsch->harq_processes[0]->rb_alloc[3] = 0xf;
break;
}
......@@ -277,7 +277,7 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN
}else {
G = get_G(&phy_vars_eNB->lte_frame_parms,
phy_vars_eNB->lte_frame_parms.N_RB_DL,
phy_vars_eNB->dlsch_eNB_MCH->rb_alloc,
phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->rb_alloc,
get_Qm(phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->mcs),1,
2,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
......@@ -820,9 +820,9 @@ int rx_pmch(PHY_VARS_UE *phy_vars_ue,
mch_channel_compensation(lte_ue_pdsch_vars[eNB_id]->rxdataF_ext,
lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext,
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag,
lte_ue_pdsch_vars[eNB_id]->dl_ch_magb,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp,
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag0,
lte_ue_pdsch_vars[eNB_id]->dl_ch_magb0,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
frame_parms,
symbol,
get_Qm(dlsch_ue[0]->harq_processes[0]->mcs),
......@@ -831,33 +831,33 @@ int rx_pmch(PHY_VARS_UE *phy_vars_ue,
if (frame_parms->nb_antennas_rx > 1)
mch_detection_mrc(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp,
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag,
lte_ue_pdsch_vars[eNB_id]->dl_ch_magb,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag0,
lte_ue_pdsch_vars[eNB_id]->dl_ch_magb0,
symbol);
switch (get_Qm(dlsch_ue[0]->harq_processes[0]->mcs)) {
case 2 :
mch_qpsk_llr(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->llr[0],
symbol,
lte_ue_pdsch_vars[eNB_id]->llr128);
break;
case 4:
mch_16qam_llr(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->llr[0],
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag,
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag0,
symbol,
lte_ue_pdsch_vars[eNB_id]->llr128);
break;
case 6:
mch_64qam_llr(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->llr[0],
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag,
lte_ue_pdsch_vars[eNB_id]->dl_ch_magb,
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag0,
lte_ue_pdsch_vars[eNB_id]->dl_ch_magb0,
symbol,
lte_ue_pdsch_vars[eNB_id]->llr128);
break;
......
......@@ -46,13 +46,13 @@ double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated) {
}
double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
LTE_eNB_DLSCH_t *dlsch_eNB ){
LTE_eNB_DLSCH_t *dlsch_eNB,int dl_power_off){
double rho_a_dB;
double sqrt_rho_a_lin;
rho_a_dB = pa_values[ pdsch_config_dedicated->p_a];
if(!dlsch_eNB->dl_power_off)
if(!dl_power_off)
rho_a_dB-=10*log10(2);
sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB));
......@@ -69,12 +69,13 @@ double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
PDSCH_CONFIG_COMMON *pdsch_config_common,
uint8_t n_antenna_port,
LTE_eNB_DLSCH_t *dlsch_eNB){
LTE_eNB_DLSCH_t *dlsch_eNB,
int dl_power_off){
double rho_a_dB, rho_b_dB;
double sqrt_rho_b_lin;
rho_a_dB= computeRhoA_eNB(pdsch_config_dedicated,dlsch_eNB);
rho_a_dB= computeRhoA_eNB(pdsch_config_dedicated,dlsch_eNB,dl_power_off);
if(n_antenna_port>1)
rho_b_dB= ratioPB[1][pdsch_config_common->p_b] + rho_a_dB;
......
This diff is collapsed.
......@@ -44,7 +44,7 @@
#ifdef DEBUG_UCI_TOOLS
#include "PHY/vars.h"
#endif
//#define DEBUG_UCI
#define DEBUG_UCI