Commit 556346dd authored by knopp's avatar knopp

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5351 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent a897eada
......@@ -6,7 +6,7 @@ CPUFLAGS = -mmmx -msse -msse2 -mssse3 -msse4
#CPUFLAGS += $(shell if [ -z $(SSE3PROC)]; then echo "" ; else echo "-mssse3"; fi)
#CPUFLAGS += $(shell if [ -z $(SSE4PROC)]; then echo "" ; else echo "-msse4"; fi)
COMMON_UTILS_DIR = $(OPENAIR_HOME)/common/utils
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
......@@ -40,6 +40,7 @@ ifeq "$(GCCVERSION)" "4.6.1"
CFLAGS += -Wno-packed-bitfield-compat
endif
include $(COMMON_UTILS_DIR)/Makefile.inc
include $(TOP_DIR)/PHY/Makefile.inc
#include $(TOP_DIR)/SCHED/Makefile.inc
SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o
......@@ -53,7 +54,7 @@ LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS) #$(ASN1_MSG_OBJS)
CFLAGS += -I$(TOP_DIR) $(L2_incl) -I$(ASN1_MSG_INC) -I$(OPENAIR3) $(UTIL_incl)
CFLAGS += -I$(TOP_DIR) $(L2_incl) -I$(ASN1_MSG_INC) -I$(OPENAIR3) $(UTIL_incl) $(UTILS_incl)
CFLAGS += -DNO_RRM
all: ltetest
......
......@@ -143,8 +143,6 @@ char quantize(double D,double x,unsigned char B) {
}
#define MAX_BLOCK_LENGTH 6000
static char channel_output[2*MAX_BLOCK_LENGTH]__attribute__ ((aligned(16)));
static unsigned char decoded_output[MAX_BLOCK_LENGTH/8];
int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
LTE_UE_DLSCH_t *dlsch_ue,
......@@ -163,8 +161,6 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
unsigned int subframe) {
unsigned char test_input[block_length+1];
//_declspec(align(16)) char channel_output[512];
//_declspec(align(16)) unsigned char output[512],decoded_output[16], *inPtr, *outPtr;
short *channel_output;
......@@ -186,7 +182,7 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
// printf("dlsch_eNB->TBS= %d\n",dlsch_eNB->harq_processes[0]->TBS);
// printf("dlsch_eNB->TBS= %d, block_length %d\n",dlsch_eNB->harq_processes[0]->TBS,block_length);
while (trial++ < ntrials) {
......@@ -201,6 +197,7 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
&PHY_vars_eNB->lte_frame_parms,
num_pdcch_symbols,
PHY_vars_eNB->dlsch_eNB[0][0],
0,
subframe,
&PHY_vars_eNB->dlsch_rate_matching_stats,
&PHY_vars_eNB->dlsch_turbo_encoding_stats,
......@@ -216,6 +213,8 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
printf("%d.",PHY_vars_eNB->dlsch_eNB[0][0]->e[i]);
#endif
channel_output[i] = (short)quantize(sigma/4.0,(2.0*PHY_vars_eNB->dlsch_eNB[0][0]->e[i]) - 1.0 + sigma*gaussdouble(0.0,1.0),qbits);
// printf("input %d, output %f\n",(2*PHY_vars_eNB->dlsch_eNB[0][0]->e[i]) - 1,
// (2.0*PHY_vars_eNB->dlsch_eNB[0][0]->e[i]) - 1.0 + sigma*gaussdouble(0.0,1.0));
}
#ifdef DEBUG_CODER
printf("\n");
......@@ -223,13 +222,15 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
#endif
// memset(decoded_output,0,16);
// printf("decoding %d\n",trial);
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->G = coded_bits;
ret = dlsch_decoding(PHY_vars_UE,
channel_output,
&PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->dlsch_ue[0][0],
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid],
subframe,
PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid,
num_pdcch_symbols,1);
/* int diffs = 0,puncts=0;
......@@ -246,15 +247,15 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
printf("%d same (%d,%d)\n",i,dlsch_ue->harq_processes[0]->d[0][96+i],dlsch_eNb->harq_processes[0]->d[0][96+i]);
}
printf("diffs %d puncts %d(%d,%d,%d,%d,%d)\n",diffs,puncts,dlsch_ue->harq_processes[0]->F,coded_bits,3*(block_length<<3),3*dlsch_ue->harq_processes[0]->Kplus,3*dlsch_ue->harq_processes[0]->F+3*(block_length<<3)-coded_bits);
*/
// printf("ret %d\n",ret);
// printf("trial %d : i %d/%d : Input %x, Output %x (%x, F %d)\n",trial,0,block_length,test_input[0],
// dlsch_ue->harq_processes[0]->b[0],
// dlsch_ue->harq_processes[0]->c[0][0],
// (dlsch_ue->harq_processes[0]->F>>3));
if (ret < MAX_TURBO_ITERATIONS+1) {
printf("ret %d (max %d)\n",ret,dlsch_ue->max_turbo_iterations);
printf("trial %d : i %d/%d : Input %x, Output %x (%x, F %d)\n",trial,0,block_length,test_input[0],
dlsch_ue->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->b[0],
dlsch_ue->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->c[0][0],
(dlsch_ue->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->F>>3));
*/
if (ret < dlsch_ue->max_turbo_iterations+1) {
*iterations = (*iterations) + ret;
// if (ret>1)
// printf("ret %d\n",ret);
......@@ -267,20 +268,21 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
for (i=0;i<block_length;i++) {
if (dlsch_ue->harq_processes[0]->b[i] != test_input[i]) {
/*
if (dlsch_ue->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->c[0][i] != test_input[i]) {
/*
printf("i %d/%d : Input %x, Output %x (%x, F %d)\n",i,block_length,test_input[i],
dlsch_ue->harq_processes[0]->b[i],
dlsch_ue->harq_processes[0]->c[0][i],
(dlsch_ue->harq_processes[0]->F>>3));
*/
dlsch_ue->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->b[i],
dlsch_ue->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->c[0][i],
(dlsch_ue->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->F>>3));
*/
*errors = (*errors) + 1;
// printf("*%d, ret %d\n",*errors,ret);
if (ret < MAX_TURBO_ITERATIONS+1)
if (ret < dlsch_ue->max_turbo_iterations+1)
*crc_misses = (*crc_misses)+1;
break;
}
......@@ -288,10 +290,12 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
}
if (ret == MAX_TURBO_ITERATIONS+1) {
if (ret == dlsch_ue->max_turbo_iterations+1) {
// exit(-1);
}
/*
/*
else {
for (i=0;i<block_length;i++) {
if (dlsch_ue->harq_processes[0]->b[i] != test_input[i]) {
......@@ -303,10 +307,10 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
}
}
}
*/
}*/
if (*errors == 100) {
//printf("\n");
printf("trials %d\n",trial);
break;
}
}
......@@ -316,7 +320,7 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
return(0);
}
#define NTRIALS 1000
#define NTRIALS 10000
#define DLSCH_RB_ALLOC 0x1fff//0x1fbf // igore DC component,RB13
int main(int argc, char *argv[]) {
......@@ -340,10 +344,10 @@ int main(int argc, char *argv[]) {
logInit();
lte_param_init(1,1,1,0,0,3);
PHY_vars_eNB->dlsch_eNB[0][0] = new_eNB_dlsch(1,8,0);
PHY_vars_UE->dlsch_ue[0][0] = new_ue_dlsch(1,8,0);
PHY_vars_eNB->dlsch_eNB[0][1] = new_eNB_dlsch(1,8,0);
PHY_vars_UE->dlsch_ue[0][1] = new_ue_dlsch(1,8,0);
PHY_vars_eNB->dlsch_eNB[0][0] = new_eNB_dlsch(1,8,NB_RB,0);
PHY_vars_UE->dlsch_ue[0][0] = new_ue_dlsch(1,8,4,NB_RB,0);
PHY_vars_eNB->dlsch_eNB[0][1] = new_eNB_dlsch(1,8,NB_RB,0);
PHY_vars_UE->dlsch_ue[0][1] = new_ue_dlsch(1,8,4,NB_RB,0);
if (argc>1)
mcs = atoi(argv[1]);
......@@ -390,8 +394,14 @@ int main(int argc, char *argv[]) {
0,
P_RNTI);
coded_bits = get_G(&PHY_vars_eNB->lte_frame_parms,NB_RB,PHY_vars_eNB->dlsch_eNB[0][0]->rb_alloc,
get_Qm(mcs),num_pdcch_symbols,subframe);
coded_bits = get_G(&PHY_vars_eNB->lte_frame_parms,
PHY_vars_eNB->dlsch_eNB[0][0]->nb_rb,
PHY_vars_eNB->dlsch_eNB[0][0]->rb_alloc,
get_Qm(mcs),
1,
num_pdcch_symbols,
0,
subframe);
printf("Coded_bits (G) = %d\n",coded_bits);
......@@ -400,22 +410,13 @@ int main(int argc, char *argv[]) {
dlsch_tbs25[get_I_TBS(mcs)][NB_RB-1],(double)dlsch_tbs25[get_I_TBS(mcs)][NB_RB-1]/coded_bits,
mcs,get_I_TBS(mcs),PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->F,NB_RB);
// Test Openair0 3GPP encoder
/*
test_encoder(block_length,
f1f2mat[(block_length-5)*2], // f1 (see 36121-820, page 14)
f1f2mat[((block_length-5)*2)+1], // f2 (see 36121-820, page 14)
3);
*/ // exit(0);
for (SNR=-5;SNR<5;SNR+=.1) {
// printf("\n\nSNR %f dB\n",SNR);
sigma = pow(10.0,-.05*SNR);
printf("\n\nSNR %f dB => sigma %f\n",SNR,sigma);
errors=0;
crc_misses=0;
......@@ -445,49 +446,11 @@ int main(int argc, char *argv[]) {
subframe);
if (ret>=0)
// printf("ref: Errors %d (%f), Uerrors %d (%f), CRC Misses %d (%f), Avg iterations %f\n",errors,(double)errors/trials,uerrors,(double)uerrors/trials,crc_misses,(double)crc_misses/trials,(double)iterations/trials);
printf("%f,%f,%f,%f\n",SNR,(double)errors/trials,(double)crc_misses/trials,(double)iterations/trials);
if (((double)errors/trials) < 1e-2)
done0=1;
}
/*
if (done1 == 0) {
printf("exmimo\n");
ret = test_logmapexmimo(rate, // code rate
sigma, // noise standard deviation
qbits,
block_length, // block length bytes
f1f2mat[iind*2], // f1 (see 36121-820, page 14)
f1f2mat[(iind*2)+1], // f2 (see 36121-820, page 14)
3,
NTRIALS,
&errors3,
&trials3);
if (ret>=0)
printf("exmimo : Errors %d (%f)\n",errors3,(double)errors3/trials3);
if (((double)errors3/trials3) < 1e-3)
done1=1;
}
if (done2 == 0) {
printf("Viterbi ...\n");
ret2 = test_viterbi(sigma,
8*block_length,
NTRIALS,
&errors2,
&trials2,
rate);
if (ret2>=0)
printf("viterbi : Errors %d (%f)\n",errors2,(double)errors2/trials2);
if (((double)errors2/trials2) < 1e-3)
done2=1;
}
*/
if ((done0==1) && (done1==1) && (done2==1)) {
printf("done\n");
break;
......
......@@ -691,8 +691,7 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
if (clear==1)
memset(w,0,Ncb*sizeof(int16_t));
//soft_input2 = soft_input + (r*E);
soft_input2 = soft_input; // navid
soft_input2 = soft_input;// + (r*E);
k=0;
for (;(ind<Ncb)&&(k<E);ind++) {
......@@ -719,7 +718,7 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
else {
printf("RM_RX Ind: %d NULL %d\n",ind,nulled);
nulled++;
}
}
#endif
}
}
......
......@@ -24,6 +24,13 @@ unsigned int lte_gold_generic(unsigned int *x1, unsigned int *x2, unsigned char
void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14],uint16_t Nid_cell);
/*!\brief This function generates the LTE Gold sequence (36-211, Sec 7.2), specifically for DL UE-specific reference signals for antenna ports 7..14.
@param frame_parms LTE DL Frame parameters
@param lte_gold_uespec_table pointer to table where sequences are stored
@param Nid_cell Cell Id (to compute sequences for local and adjacent cells)
@param n_idDMRS Scrambling identity for TM10*/
void lte_gold_ue_spec(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_uespec_table[2][20][2][21],uint16_t Nid_cell, uint16_t *n_idDMRS);
void lte_gold_mbsfn(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_mbsfn_table[10][3][42],uint16_t Nid_MBSFN);
......@@ -44,6 +51,22 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
unsigned char l,
unsigned char p);
/*! \brief This function generates the UE-specific reference signal sequence (36-211, Sec 6.10.3.2)
@param phy_vars_eNB Pointer to eNB variables
@param output Output vector for OFDM symbol (Frequency Domain)
@param amp Q15 amplitude
@param Ns Slot number (0..19)
@param p antenna index
@param SS_flag Flag to indicate special subframe
*/
int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
uint8_t UE_id,
mod_sym_t *output,
short amp,
uint8_t Ns,
uint8_t p,
int SS_flag );
/*! \brief This function generates the MBSFN reference signal sequence (36-211, Sec 6.10.1.2)
@param phy_vars_eNB Pointer to eNB variables
@param output Output vector for OFDM symbol (Frequency Domain)
......
......@@ -23,36 +23,16 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
unsigned short k,a;
mod_sym_t qpsk[4];
#ifdef IFFT_FPGA
// new mod table
qpsk[0] = 1;
qpsk[1] = 3;
qpsk[2] = 2;
qpsk[3] = 4;
/* old mod table
qpsk[0] = 4;
qpsk[1] = 2;
qpsk[2] = 3;
qpsk[3] = 1;
*/
#else
a = (amp*ONE_OVER_SQRT2_Q15)>>15;
((short *)&qpsk[0])[0] = a;
((short *)&qpsk[0])[1] = a;
// new mod table
((short *)&qpsk[1])[0] = -a;
((short *)&qpsk[1])[1] = a;
((short *)&qpsk[2])[0] = a;
((short *)&qpsk[2])[1] = -a;
/* old mod table
((short *)&qpsk[1])[0] = a;
((short *)&qpsk[1])[1] = -a;
((short *)&qpsk[2])[0] = -a;
((short *)&qpsk[2])[1] = a;
*/
((short *)&qpsk[3])[0] = -a;
((short *)&qpsk[3])[1] = -a;
#endif
if ((p==0) && (l==0) )
nu = 0;
......@@ -73,12 +53,9 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
if (k > 6)//b
k -=6;//b
#ifdef IFFT_FPGA
k+=phy_vars_eNB->lte_frame_parms.N_RB_DL*6;
#else
k+=phy_vars_eNB->lte_frame_parms.first_carrier_offset;
#endif
for (m=0;m<phy_vars_eNB->lte_frame_parms.N_RB_DL<<1;m++) {
for (m=0;m<phy_vars_eNB->lte_frame_parms.N_RB_DL<<1;m++) { // loop over pilots in one slot/symbol, 2*N_RB_DL pilots
mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf;
......@@ -98,16 +75,10 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
printf("Ns %d, l %d output[%d] = (%d,%d)\n",Ns,l,k,((short *)&output[k])[0],((short *)&output[k])[1]);
#endif
k+=6;//b
#ifdef IFFT_FPGA
if (k >= phy_vars_eNB->lte_frame_parms.N_RB_DL*12) {
k-=phy_vars_eNB->lte_frame_parms.N_RB_DL*12;
}
#else
if (k >= phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) {
k++; // skip DC carrier
k-=phy_vars_eNB->lte_frame_parms.ofdm_symbol_size;
}
#endif
// printf("** k %d\n",k);
}
return(0);
......@@ -125,36 +96,15 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
unsigned short k,a;
mod_sym_t qpsk[4];
#ifdef IFFT_FPGA
// new mod table
qpsk[0] = 1;
qpsk[1] = 3;
qpsk[2] = 2;
qpsk[3] = 4;
/* old mod table
qpsk[0] = 4;
qpsk[1] = 2;
qpsk[2] = 3;
qpsk[3] = 1;
*/
#else
a = (amp*ONE_OVER_SQRT2_Q15)>>15;
((short *)&qpsk[0])[0] = a;
((short *)&qpsk[0])[1] = a;
// new mod table
((short *)&qpsk[1])[0] = -a;
((short *)&qpsk[1])[1] = a;
((short *)&qpsk[2])[0] = a;
((short *)&qpsk[2])[1] = -a;
/* old mod table
((short *)&qpsk[1])[0] = a;
((short *)&qpsk[1])[1] = -a;
((short *)&qpsk[2])[0] = -a;
((short *)&qpsk[2])[1] = a;
*/
((short *)&qpsk[3])[0] = -a;
((short *)&qpsk[3])[1] = -a;
#endif
if ((p==0) && (l==0) )
nu = 0;
......@@ -175,11 +125,8 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
if (k > 5)
k -=6;
#ifdef IFFT_FPGA
k+=phy_vars_eNB->lte_frame_parms.N_RB_DL*6;
#else
k+=phy_vars_eNB->lte_frame_parms.first_carrier_offset;
#endif
for (m=0;m<phy_vars_eNB->lte_frame_parms.N_RB_DL<<1;m++) {
mprime_dword = mprime>>4;
......@@ -200,16 +147,11 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
printf("Ns %d, l %d output[%d] = (%d,%d)\n",Ns,l,k,((short *)&output[k])[0],((short *)&output[k])[1]);
#endif
k+=6;
#ifdef IFFT_FPGA
if (k >= phy_vars_eNB->lte_frame_parms.N_RB_DL*12) {
k-=phy_vars_eNB->lte_frame_parms.N_RB_DL*12;
}
#else
if (k >= phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) {
k++; // skip DC carrier
k-=phy_vars_eNB->lte_frame_parms.ofdm_symbol_size;
}
#endif
// printf("** k %d\n",k);
}
return(0);
......
......@@ -61,6 +61,52 @@ void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14]
}
}
void lte_gold_ue_spec(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_uespec_table[2][20][2][21],uint16_t Nid_cell, uint16_t *n_idDMRS) {
unsigned char ns,l;
unsigned int n,x1,x2;//,x1tmp,x2tmp;
int nscid;
int nid;
for (nscid=0;nscid<2;nscid++) {
if (n_idDMRS)
nid = n_idDMRS[nscid];
else
nid = Nid_cell;
for (ns=0;ns<20;ns++) {
for (l=0;l<2;l++) {
x2 = ((((ns>>1)+1)*((nid<<1)+1))<<16) + nscid;
//x2 = frame_parms->Ncp + (Nid_cell<<1) + (1+(Nid_cell<<1))*(1 + (3*l) + (7*(1+ns))); //cinit
//n = 0
// printf("cinit (ns %d, l %d) => %d\n",ns,l,x2);
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);
// printf("x1 : %x, x2 : %x\n",x1,x2);
}
for (n=0;n<14;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);
lte_gold_uespec_table[nscid][ns][l][n] = x1^x2;
// printf("n=%d : c %x\n",n,x1^x2);
}
}
}
}
}
/*! \brief gold sequenquence generator
\param x1
\param x2 this should be set to c_init if reset=1
......
......@@ -1954,7 +1954,7 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci,
// check pdcch duration imposed by PHICH duration (Section 6.9 of 36-211)
if (frame_parms->Ncp==1) { // extended prefix
if ((frame_parms->frame_type == 1) &&
if ((frame_parms->frame_type == TDD) &&
((frame_parms->tdd_config<3)||(frame_parms->tdd_config==6)) &&
((subframe==1) || (subframe==6))) // subframes 1 and 6 (S-subframes) for 5ms switching periodicity are 2 symbols
nCCEmin = 2;
......@@ -2726,6 +2726,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
}
break;
case 25:
default:
if (frame_type == TDD) {
format1A_size_bits = sizeof_DCI1A_5MHz_TDD_1_6_t;
format1A_size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t);
......@@ -2780,11 +2781,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
format1_size_bytes = sizeof(DCI1_20MHz_FDD_t);
}
break;
default:
format1_size_bits = 0;
format1_size_bytes = 0;
DevParam(frame_parms->N_RB_DL, frame_type, 0);
break;
}
if (do_common == 1) {
......
......@@ -109,6 +109,10 @@ 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;
/// 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)
......@@ -199,6 +203,8 @@ typedef struct {
} LTE_UL_UE_HARQ_t;
typedef struct {
/// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding)
uint32_t *txdataF[8];
/// Allocated RNTI (0 means DLSCH_t is not currently used)
uint16_t rnti;
/// Active flag for baseband transmitter processing
......@@ -247,6 +253,7 @@ typedef struct {
int16_t sqrt_rho_a;
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
int16_t sqrt_rho_b;
} LTE_eNB_DLSCH_t;
#define PUSCH_x 2
......
......@@ -243,7 +243,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,num_pdcch_symbols,frame,subframe);
G = get_G(frame_parms,nb_rb,dlsch->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 +353,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->e+r_offset,
dlsch->harq_processes[harq_pid]->C, // C
NSOFT, // Nsoft,
dlsch->Mdlharq,
......
......@@ -304,7 +304,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
G,
harq_process->w[r],
(uint8_t*)&dummy_w[r][0],
dlsch_llr,
dlsch_llr+r_offset,
harq_process->C,
NSOFT,
dlsch->Mdlharq,
......
......@@ -247,14 +247,14 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
msg("dlsch_demodulation.c: nb_rb=0\n");
return(-1);
}
/*
// DL power control: Scaling of Channel estimates for PDSCH
dlsch_scale_channel(lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext,
frame_parms,
dlsch_ue,
symbol,
nb_rb);
*/
if (first_symbol_flag==1) {
dlsch_channel_level(lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext,
frame_parms,
......@@ -1353,7 +1353,7 @@ void dlsch_scale_channel(int **dl_ch_estimates_ext,
// Determine scaling amplitude based the symbol
ch_amp = ((pilots) ? (dlsch_ue[0]->sqrt_rho_b) : (dlsch_ue[0]->sqrt_rho_a));
// msg("Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
// msg("Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
ch_amp128 = _mm_set1_epi16(ch_amp); // Q3.13
......@@ -1657,9 +1657,9 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
pilots = ((symbol_mod==0)||(symbol_mod==(4-frame_parms->Ncp))) ? 1 : 0;
l=symbol;
nsymb = (frame_parms->Ncp==0) ? 14:12;
nsymb = (frame_parms->Ncp==NORMAL) ? 14:12;
if (frame_parms->frame_type == 1) { // TDD
if (frame_parms->frame_type == TDD) { // TDD
sss_symb = nsymb-1;
pss_symb = 2;
}
......@@ -1803,7 +1803,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
skip_half=2;
//PSS in subframe 0/5 if FDD
if (frame_parms->frame_type == 0) { //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) ) {
rb_alloc_ind = 0;
}
......@@ -1813,7 +1813,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
skip_half=2;
}
if ((frame_parms->frame_type == 1) &&
if ((frame_parms->frame_type == TDD) &&
(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) ) {
rb_alloc_ind = 0;
......@@ -1951,14 +1951,14 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
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;
}
if (frame_parms->frame_type == 0) {
if (frame_parms->frame_type == FDD) {
//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) ) {
rb_alloc_ind = 0;
}
}
if ((frame_parms->frame_type == 1) &&
if ((frame_parms->frame_type == TDD) &&
(subframe==6)){
//PSS
if ((rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) {
......@@ -2078,7 +2078,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
else if (((subframe==0)||(subframe==5)) && (rb==((frame_parms->N_RB_DL>>1)+3)) && (l==sss_symb))
skip_half=2;
if (frame_parms->frame_type == 0) {
if (frame_parms->frame_type == FDD) {
//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) ) {
rb_alloc_ind = 0;
......@@ -2090,7 +2090,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
skip_half=2;
}
if ((frame_parms->frame_type == 1) &&
if ((frame_parms->frame_type == TDD) &&
(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) ) {
rb_alloc_ind = 0;
......@@ -2238,10 +2238,10 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp)))
pilots=1;
nsymb = (frame_parms->Ncp==0) ? 14:12;
nsymb = (frame_parms->Ncp==NORMAL) ? 14:12;
l=symbol;
if (