Commit 556346dd authored by Raymond Knopp's avatar Raymond 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++) {
......
......@@ -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,
......@@ -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 (frame_parms->frame_type == 1) { // TDD
if (frame_parms->frame_type == TDD) { // TDD
sss_symb = nsymb-1;
pss_symb = 2;
}
......@@ -2320,7 +2320,7 @@ unsigned short dlsch_extract_rbs_dual(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;
}
......@@ -2330,7 +2330,7 @@ unsigned short dlsch_extract_rbs_dual(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;
......@@ -2451,7 +2451,7 @@ unsigned short dlsch_extract_rbs_dual(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;
}
......@@ -2461,7 +2461,7 @@ unsigned short dlsch_extract_rbs_dual(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;
......@@ -2621,14 +2621,14 @@ unsigned short dlsch_extract_rbs_dual(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) ) {
......@@ -2770,7 +2770,7 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
(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;
......@@ -2782,7 +2782,7 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
skip_half=2;
}
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) ) {
......
......@@ -56,7 +56,7 @@
#ifndef __SSE3__
//#define _mm_abs_epi16(xmmx) _mm_xor_si128((xmmx),_mm_cmpgt_epi16(zero,(xmmx)))
#define _mm_abs_epi16(xmmx) _mm_add_epi16(_mm_xor_si128((xmmx),_mm_cmpgt_epi16((*(__m128i*)&zero[0]),(xmmx))),_mm_srli_epi16(_mm_cmpgt_epi16((*(__m128i*)&zero[0]),(xmmx)),15))
//abs_#define _mm_abs_epi16(xmmx) _mm_add_epi16(_mm_xor_si128((xmmx),_mm_cmpgt_epi16((*(__m128i*)&zero[0]),(xmmx))),_mm_srli_epi16(_mm_cmpgt_epi16((*(__m128i*)&zero[0]),(xmmx)),15))
//#define _mm_sign_epi16(xmmx,xmmy) _mm_xor_si128((xmmx),_mm_cmpgt_epi16(zero,(xmmy)))
#endif
......@@ -721,6 +721,7 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
unsigned char symbol_mod,len_mod4=0;
uint32_t *llr32;
if (first_symbol_flag==1) {
llr32 = (uint32_t*)dlsch_llr;
}
......
......@@ -69,6 +69,11 @@ uint8_t is_not_pilot(uint8_t pilots, uint8_t re, uint8_t nushift, uint8_t use2nd
return(0);
}
uint8_t is_not_UEspecRS(int first_layer,int re) {
return(1);
}
void generate_64qam_table(void) {
int a,b,c,index;
......@@ -142,6 +147,8 @@ int allocate_REs_in_RB(mod_sym_t **txdataF,
uint8_t skip_dc,
uint8_t skip_half,
uint8_t use2ndpilots,
uint8_t Nlayers,
uint8_t first_layer,
LTE_DL_FRAME_PARMS *frame_parms) {
uint32_t tti_offset,aa;
......@@ -156,7 +163,7 @@ int allocate_REs_in_RB(mod_sym_t **txdataF,
uint8_t first_re,last_re;
int32_t tmp_sample1,tmp_sample2;
int16_t tmp_amp=amp;
uint8_t layer;
/*
switch (mod_order) {
case 2:
......@@ -197,21 +204,24 @@ int allocate_REs_in_RB(mod_sym_t **txdataF,
tti_offset = symbol_offset + re_off + re;
// check that re is not a pilot
// check that RE is not from Cell-specific RS
if (is_not_pilot(pilots,re,frame_parms->nushift,use2ndpilots)==1) {
// printf("re %d (jj %d)\n",re,*jj);
*re_allocated = *re_allocated + 1;
if (mimo_mode == SISO) { //SISO mapping
if (mimo_mode == SISO) { //SISO mapping
*re_allocated = *re_allocated + 1;
switch (mod_order) {
case 2: //QPSK
// printf("%d : %d,%d => ",tti_offset,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++)
// 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] += (output[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
}
*jj = *jj + 1;
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++)
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
((int16_t*)&txdataF[aa][tti_offset])[1] += (output[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //Q //b_{i+1}
}
*jj = *jj + 1;
// printf("%d,%d\n",((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
......@@ -280,7 +290,7 @@ int allocate_REs_in_RB(mod_sym_t **txdataF,
}
else if (mimo_mode == ALAMOUTI){
*re_allocated = *re_allocated + 1;
// normalization for 2 tx antennas
amp = (int16_t)(((int32_t)tmp_amp*ONE_OVER_SQRT2_Q15)>>15);
......@@ -428,6 +438,7 @@ int allocate_REs_in_RB(mod_sym_t **txdataF,
}
}
else if (mimo_mode == ANTCYCLING ) {
*re_allocated = *re_allocated + 1;
switch (mod_order) {
case 2: //QPSK
......@@ -495,7 +506,7 @@ int allocate_REs_in_RB(mod_sym_t **txdataF,
else if ((mimo_mode >= UNIFORM_PRECODING11)&&(mimo_mode <= PUSCH_PRECODING1)) {
// this is for transmission modes 4-6 (1 layer)
*re_allocated = *re_allocated + 1;
amp = (int16_t)(((int32_t)tmp_amp*ONE_OVER_SQRT2_Q15)>>15);
switch (mod_order) {
......@@ -592,14 +603,6 @@ int allocate_REs_in_RB(mod_sym_t **txdataF,
}
}
else {
msg("allocate_REs_in_RB() [dlsch.c] : ERROR, unknown mimo_mode %d\n",mimo_mode);
return(-1);
}
if (mimo_mode == ALAMOUTI) {
re++; // adjacent carriers are taken care of by precoding
*re_allocated = *re_allocated + 1;
......@@ -608,8 +611,92 @@ int allocate_REs_in_RB(mod_sym_t **txdataF,
*re_allocated = *re_allocated + 1;
}
}
if (mimo_mode >= TM8) { //TM8,TM9,TM10
if (is_not_UEspecRS(first_layer,re)) {
switch (mod_order) {
case 2: //QPSK
// printf("%d : %d,%d => ",tti_offset,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
for (layer=first_layer;layer<=(first_layer+Nlayers);layer++) {
((int16_t*)&txdataF[layer][tti_offset])[0] = (output[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
*jj = *jj + 1;
((int16_t*)&txdataF[layer][tti_offset])[1] = (output[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //Q //b_{i+1}
*jj = *jj + 1;
}
break;
case 4: //16QAM
if (is_not_UEspecRS(layer,re)) {
qam16_table_offset_re = 0;
qam16_table_offset_im = 0;
if (output[*jj] == 1)
qam16_table_offset_re+=2;
*jj=*jj+1;
if (output[*jj] == 1)
qam16_table_offset_im+=2;
*jj=*jj+1;
if (output[*jj] == 1)
qam16_table_offset_re+=1;
*jj=*jj+1;
if (output[*jj] == 1)
qam16_table_offset_im+=1;
*jj=*jj+1;
for (layer=first_layer;layer<=(first_layer+Nlayers);layer++) {
((int16_t*)&txdataF[layer][tti_offset])[0] = qam_table_s[qam16_table_offset_re];
((int16_t*)&txdataF[layer][tti_offset])[1] = qam_table_s[qam16_table_offset_im];
}
}
break;
case 6: //64QAM
qam64_table_offset_re = 0;
qam64_table_offset_im = 0;
if (output[*jj] == 1)
qam64_table_offset_re+=4;
*jj=*jj+1;
if (output[*jj] == 1)
qam64_table_offset_im+=4;
*jj=*jj+1;
if (output[*jj] == 1)
qam64_table_offset_re+=2;
*jj=*jj+1;
if (output[*jj] == 1)
qam64_table_offset_im+=2;
*jj=*jj+1;
if (output[*jj] == 1)
qam64_table_offset_re+=1;
*jj=*jj+1;
if (output[*jj] == 1)
qam64_table_offset_im+=1;
*jj=*jj+1;
for (layer=first_layer;layer<=(first_layer+Nlayers);layer++) {
((int16_t*)&txdataF[layer][tti_offset])[0] = qam_table_s[qam64_table_offset_re];
((int16_t*)&txdataF[layer][tti_offset])[1] = qam_table_s[qam64_table_offset_im];
}
break;
}
}
}
else if (mimo_mode>=TM9_10) {
msg("allocate_REs_in_RB() [dlsch.c] : ERROR, unknown mimo_mode %d\n",mimo_mode);
return(-1);
}
}
}
return(0);
}
......@@ -768,6 +855,7 @@ int dlsch_modulation(mod_sym_t **txdataF,
int16_t amp_rho_a, amp_rho_b;
int16_t qam16_table_a[4],qam64_table_a[8],qam16_table_b[4],qam64_table_b[8];
int16_t *qam_table_s;
uint8_t Nl = dlsch->harq_processes[harq_pid]->Nl;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, VCD_FUNCTION_IN);
......@@ -959,7 +1047,7 @@ int dlsch_modulation(mod_sym_t **txdataF,
if (rb_alloc_ind > 0)
{
//printf("Allocated rb %d, subframe_offset %d, symbol_offset %d, re_offset %d\n",rb,subframe_offset,symbol_offset,re_offset);
// printf("Allocated rb %d, subframe_offset %d, symbol_offset %d, re_offset %d\n",rb,subframe_offset,symbol_offset,re_offset);
allocate_REs_in_RB(txdataF,
&jj,
re_offset,
......@@ -976,6 +1064,8 @@ int dlsch_modulation(mod_sym_t **txdataF,
skip_dc,
skip_half,
(frame_parms->mode1_flag==1)?1:0,
dlsch->harq_processes[harq_pid]->Nlayers,
dlsch->harq_processes[harq_pid]->first_layer,
frame_parms);
}
re_offset+=12; // go to next RB
......@@ -995,7 +1085,7 @@ int dlsch_modulation(mod_sym_t **txdataF,
#ifdef DEBUG_DLSCH_MODULATION
msg("generate_dlsch : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch->nb_rb,dlsch->rb_alloc,mod_order,2,0,subframe_offset));
msg("generate_dlsch : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch->nb_rb,dlsch->rb_alloc,mod_order,Nl,2,0,subframe_offset));
#endif
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, VCD_FUNCTION_OUT);
......@@ -1092,7 +1182,7 @@ int mch_modulation(mod_sym_t **txdataF,
#ifdef DEBUG_DLSCH_MODULATION
msg("generate_dlsch(MCH) : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch->nb_rb,dlsch->rb_alloc,mod_order,2,0,subframe_offset));
msg("generate_dlsch(MCH) : jj = %d,re_allocated = %d (G %d)\n",jj,re_allocated,get_G(frame_parms,dlsch->nb_rb,dlsch->rb_alloc,mod_order,1,2,0,subframe_offset));
#endif
return (re_allocated);
......
......@@ -244,8 +244,8 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
// LOG_I(PHY,"**************************************************************\n");
// First try FDD normal prefix
frame_parms->Ncp=0;
frame_parms->frame_type=0;
frame_parms->Ncp=NORMAL;
frame_parms->frame_type=FDD;
init_frame_parms(frame_parms,1);
sync_pos = lte_sync_time(phy_vars_ue->lte_ue_common_vars.rxdata,
......@@ -316,8 +316,8 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
if (ret==-1) {
// Now FDD extended prefix
frame_parms->Ncp=1;
frame_parms->frame_type=0;
frame_parms->Ncp=EXTENDED;
frame_parms->frame_type=FDD;
init_frame_parms(frame_parms,1);
if (sync_pos < frame_parms->nb_prefix_samples)
sync_pos2 = sync_pos + FRAME_LENGTH_COMPLEX_SAMPLES - frame_parms->nb_prefix_samples;
......@@ -357,8 +357,8 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
if (ret==-1) {
// Now TDD normal prefix
frame_parms->Ncp=0;
frame_parms->frame_type=1;
frame_parms->Ncp=NORMAL;
frame_parms->frame_type=TDD;
init_frame_parms(frame_parms,1);
if (sync_pos >= frame_parms->nb_prefix_samples)
......@@ -405,8 +405,8 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
if (ret==-1) {
// Now TDD extended prefix
frame_parms->Ncp=1;
frame_parms->frame_type=1;
frame_parms->Ncp=EXTENDED;
frame_parms->frame_type=TDD;
init_frame_parms(frame_parms,1);
sync_pos2 = sync_pos - frame_parms->nb_prefix_samples;
if (sync_pos >= frame_parms->nb_prefix_samples)
......
......@@ -150,7 +150,7 @@ int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_ord
int rb,re_pbch_sss=0;
int rb_alloc_ind,nsymb;
nsymb = (frame_parms->Ncp==0) ? 14 : 12;
nsymb = (frame_parms->Ncp==NORMAL) ? 14 : 12;
// printf("adjust_G2 : symbol %d, subframe %d\n",symbol,subframe);
if ((subframe!=0) && (subframe!=5) && (subframe!=6)) // if not PBCH/SSS or SSS
......@@ -296,7 +296,7 @@ int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_orde
}
// printf("re_pbch_sss %d\n",re_pbch_sss);
if (subframe==0) { //PBCH+SSS+PSS
if (frame_parms->frame_type == 1) { // TDD
if (frame_parms->frame_type == TDD) { // TDD
if (frame_parms->mode1_flag==0)
//2ant so PBCH 3+2/3 symbols, SSS 1 symbol * REs => (14/3)*re_pbch_sss for normal CP,
// 2+4/3 symbols, SSS 1 symbol => (13/3)*re_pbch_sss for ext. CP
......@@ -319,14 +319,14 @@ int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_orde
}
}
else if (subframe == 5) // SSS+PSS for FDD, SSS for TDD
return(((frame_parms->frame_type==0)?2:1)*re_pbch_sss * 1 * mod_order);
else if ((subframe == 6)&&(frame_parms->frame_type == 1)) // PSS for TDD
return(((frame_parms->frame_type==FDD)?2:1)*re_pbch_sss * 1 * mod_order);
else if ((subframe == 6)&&(frame_parms->frame_type == TDD)) // PSS for TDD
return(re_pbch_sss * 1 * mod_order);
return(0);
}
int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t num_pdcch_symbols,int frame,uint8_t subframe) {
int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe) {
......@@ -336,12 +336,12 @@ int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint
G_adj= adjust_G(frame_parms,rb_alloc,mod_order,subframe);
// printf("get_G subframe %d mod_order %d, nb_rb %d: rb_alloc %x,%x,%x,%x, G_adj %d\n",subframe,mod_order,nb_rb,rb_alloc[3],rb_alloc[2],rb_alloc[1],rb_alloc[0], G_adj);
if (frame_parms->Ncp==0) { // normal prefix
if (frame_parms->Ncp==NORMAL) { // normal prefix
// PDDDPDD PDDDPDD - 13 PDSCH symbols, 10 full, 3 w/ pilots = 10*12 + 3*8
// PCDDPDD PDDDPDD - 12 PDSCH symbols, 9 full, 3 w/ pilots = 9*12 + 3*8
// PCCDPDD PDDDPDD - 11 PDSCH symbols, 8 full, 3 w/pilots = 8*12 + 3*8
if (frame_parms->mode1_flag==0) // SISO
return(((int)nb_rb * mod_order * ((11-num_pdcch_symbols)*12 + 3*8)) - G_adj);
return((((int)nb_rb * mod_order * ((11-num_pdcch_symbols)*12 + 3*8)) - G_adj)*Nl);
else
return(((int)nb_rb * mod_order * ((11-num_pdcch_symbols)*12 + 3*10)) - G_adj);
}
......@@ -350,7 +350,7 @@ int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint
// PCDPDD PDDPDD - 10 PDSCH symbols, 7 full, 3 w/ pilots = 7*12 + 3*8
// PCCPDD PDDPDD - 9 PDSCH symbols, 6 full, 3 w/pilots = 6*12 + 3*8
if (frame_parms->mode1_flag==0)
return(((int)nb_rb * mod_order * ((9-num_pdcch_symbols)*12 + 3*8)) - G_adj);
return((((int)nb_rb * mod_order * ((9-num_pdcch_symbols)*12 + 3*8)) - G_adj)*Nl);
else
return(((int)nb_rb * mod_order * ((9-num_pdcch_symbols)*12 + 3*10)) - G_adj);
}
......
......@@ -293,6 +293,8 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
0,
0,
0,
1,
0,
frame_parms);
re_offset+=12; // go to next RB
......
......@@ -245,7 +245,7 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN
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,
get_Qm(phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->mcs),
get_Qm(phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->mcs),1,
2,phy_vars_eNB->frame,subframe);
generate_mbsfn_pilot(phy_vars_eNB,
......
......@@ -142,6 +142,8 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t skip_dc,
uint8_t skip_half,
uint8_t use2ndpilots,
uint8_t Nlayers,
uint8_t firstlayer,
LTE_DL_FRAME_PARMS *frame_parms);
\brief Fills RB with data
......@@ -161,6 +163,8 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
\param skip_dc offset for positive RBs
\param skip_half indicate that first or second half of RB must be skipped for PBCH/PSS/SSS
\param use2ndpilots Set to use the pilots from antenna port 1 for PDSCH
\param Nlayers Number of layers for this codeword
\param firstlayer Index of first layer (minus 7, i.e. 0..7 <-> p=7,...,14
\param frame_parms Frame parameter descriptor
*/
......@@ -180,6 +184,8 @@ int32_t allocate_REs_in_RB(mod_sym_t **txdataF,
uint8_t skip_dc,
uint8_t skip_half,
uint8_t use2ndpilots,
uint8_t Nlayers,
uint8_t firstlayer,
LTE_DL_FRAME_PARMS *frame_parms);
/** \fn int32_t dlsch_modulation(mod_sym_t **txdataF,
......@@ -1225,7 +1231,7 @@ uint8_t get_transmission_mode(uint16_t Mod_id, uint16_t rnti);
*/
uint32_t conv_nprb(uint8_t ra_header,uint32_t rb_alloc,int N_RB_DL);
int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t num_pdcch_symbols,int frame,uint8_t subframe);
int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe);
int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe);
int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol);
......
......@@ -94,7 +94,7 @@ int generate_pss(mod_sym_t **txdataF,
//a = (amp*ONE_OVER_SQRT2_Q15)>>15;
//printf("[PSS] amp=%d, a=%d\n",amp,a);
Nsymb = (frame_parms->Ncp==0)?14:12;
Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
//for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) {
aa = 0;
......
......@@ -64,7 +64,7 @@ int generate_sss(mod_sym_t **txdataF,
else
d = &d5_sss[62*(Nid2 + (Nid1*3))];
Nsymb = (frame_parms->Ncp==0)?14:12;
Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
k = frame_parms->ofdm_symbol_size-3*12+5;
for (i=0;i<62;i++) {
//for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) {
......@@ -166,7 +166,7 @@ int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
int32_t **rxdataF = phy_vars_ue->lte_ue_common_vars.rxdataF;
if (frame_parms->frame_type == 0) {
if (frame_parms->frame_type == FDD) {
pss_symb = 6-frame_parms->Ncp;
sss_symb = pss_symb-1;
}
......@@ -247,9 +247,9 @@ int rx_sss(PHY_VARS_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uint8_
int32_t metric;
int16_t *d0,*d5;
if (phy_vars_ue->lte_frame_parms.frame_type == 0) { // FDD
if (phy_vars_ue->lte_frame_parms.frame_type == FDD) {
#ifdef DEBUG_SSS
if (phy_vars_ue->lte_frame_parms.Ncp == 0)
if (phy_vars_ue->lte_frame_parms.Ncp == NORMAL)
msg("[PHY][UE%d] Doing SSS for FDD Normal Prefix\n",phy_vars_ue->Mod_id);
else
msg("[PHY][UE%d] Doing SSS for FDD Extended Prefix\n",phy_vars_ue->Mod_id);
......@@ -270,7 +270,7 @@ int rx_sss(PHY_VARS_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uint8_
}
else { // TDD
#ifdef DEBUG_SSS
if (phy_vars_ue->lte_frame_parms.Ncp == 0)
if (phy_vars_ue->lte_frame_parms.Ncp == NORMAL)
msg("[PHY][UE%d] Doing SSS for TDD Normal Prefix\n",phy_vars_ue->Mod_id);
else
msg("[PHY][UE%d] Doing SSS for TDD Extended Prefix\n",phy_vars_ue->Mod_id);
......@@ -308,7 +308,7 @@ int rx_sss(PHY_VARS_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uint8_
// write_output("sss0_comp0.m","sss0comp0",sss0_ext,72,1,1);
if (phy_vars_ue->lte_frame_parms.frame_type == 0) { // FDD
if (phy_vars_ue->lte_frame_parms.frame_type == FDD) { // FDD
// SSS
slot_fep(phy_vars_ue,
......
......@@ -510,7 +510,7 @@ uint32_t ulsch_encoding(uint8_t *a,
r_offset += lte_rate_matching_turbo(ulsch->harq_processes[harq_pid]->RTC[r],
G,
ulsch->harq_processes[harq_pid]->w[r],
&ulsch->e[0],
ulsch->e+r_offset,
ulsch->harq_processes[harq_pid]->C, // C
NSOFT, // Nsoft,
ulsch->Mdlharq,
......
......@@ -1161,7 +1161,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
G,
ulsch->harq_processes[harq_pid]->w[r],
(uint8_t*) &dummy_w[r][0],
ulsch->e,
ulsch->e+r_offset,
ulsch->harq_processes[harq_pid]->C,
NSOFT,
ulsch->Mdlharq,
......
......@@ -588,53 +588,30 @@ void ulsch_extract_rbs_single(int32_t **rxdataF,
msg("ulsch_extract_rbs_single: 2*nb_rb1 = %d, 2*nb_rb2 = %d\n",nb_rb1,nb_rb2);
#endif
#ifndef NEW_FFT
rxF_ext = &rxdataF_ext[aarx][(symbol*frame_parms->N_RB_UL*12)*2];
#else
rxF_ext = &rxdataF_ext[aarx][(symbol*frame_parms->N_RB_UL*12)];
#endif
if (nb_rb1) {
#ifndef NEW_FFT
rxF = &rxdataF[aarx][(first_rb*12 + frame_parms->first_carrier_offset + symbol*frame_parms->ofdm_symbol_size)*2];
memcpy(rxF_ext, rxF, nb_rb1*12*sizeof(int));
rxF_ext += nb_rb1*12;
#else
rxF = &rxdataF[aarx][(first_rb*12 + frame_parms->first_carrier_offset + symbol*frame_parms->ofdm_symbol_size)];
memcpy(rxF_ext, rxF, nb_rb1*6*sizeof(int));
rxF_ext += nb_rb1*6;
#endif
if (nb_rb2) {
//#ifdef OFDMA_ULSCH
// rxF = &rxdataF[aarx][(1 + symbol*frame_parms->ofdm_symbol_size)*2];
//#else
#ifndef NEW_FFT
rxF = &rxdataF[aarx][(symbol*frame_parms->ofdm_symbol_size)*2];
//#endif
memcpy(rxF_ext, rxF, nb_rb2*12*sizeof(int));
rxF_ext += nb_rb2*12;
#else
rxF = &rxdataF[aarx][(symbol*frame_parms->ofdm_symbol_size)];
//#endif
memcpy(rxF_ext, rxF, nb_rb2*6*sizeof(int));
rxF_ext += nb_rb2*6;
#endif
}
}
else { //there is only data in the second half
//#ifdef OFDMA_ULSCH
// rxF = &rxdataF[aarx][(1 + 6*(2*first_rb - frame_parms->N_RB_UL) + symbol*frame_parms->ofdm_symbol_size)*2];
//#else
#ifndef NEW_FFT
rxF = &rxdataF[aarx][(6*(2*first_rb - frame_parms->N_RB_UL) + symbol*frame_parms->ofdm_symbol_size)*2];
//#endif
memcpy(rxF_ext, rxF, nb_rb2*12*sizeof(int));
rxF_ext += nb_rb2*12;
#else
rxF = &rxdataF[aarx][(6*(2*first_rb - frame_parms->N_RB_UL) + symbol*frame_parms->ofdm_symbol_size)];
//#endif
memcpy(rxF_ext, rxF, nb_rb2*6*sizeof(int));
rxF_ext += nb_rb2*6;
#endif
}
}
......@@ -1311,15 +1288,7 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
msg("rx_ulsch: eNB_id %d, harq_pid %d, nb_rb %d first_rb %d, cooperation %d\n",eNB_id,harq_pid,ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,ulsch[UE_id]->harq_processes[harq_pid]->first_rb, cooperation_flag);
#endif //DEBUG_ULSCH
#ifndef NEW_FFT
if ( (frame_parms->ofdm_symbol_size == 128) ||
(frame_parms->ofdm_symbol_size == 512) )
rx_power_correction = 2;
else
rx_power_correction = 1;
#else
rx_power_correction = 1;
#endif
for (l=0;l<(frame_parms->symbols_per_tti-ulsch[UE_id]->srs_active);l++) {
......@@ -1347,14 +1316,6 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
l/(frame_parms->symbols_per_tti/2),
cooperation_flag);
#ifndef NEW_FFT
ulsch_correct_ext(eNB_pusch_vars->rxdataF_ext[eNB_id],
eNB_pusch_vars->rxdataF_ext2[eNB_id],
l,
frame_parms,
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb);
#endif
if(cooperation_flag == 2)
{
for (i=0;i<frame_parms->nb_antennas_rx;i++){
......@@ -1425,11 +1386,9 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
avgs = cmax(avgs,avgU[(aarx<<1)]);
// log2_maxh = 4+(log2_approx(avgs)/2);
#ifdef NEW_FFT
log2_maxh = (log2_approx(avgs)/2)+ log2_approx(frame_parms->nb_antennas_rx-1)+4;
#else
log2_maxh = (log2_approx(avgs)/2)+ log2_approx(frame_parms->nb_antennas_rx-1)+3;
#endif
#ifdef DEBUG_ULSCH
msg("[ULSCH] log2_maxh = %d (%d,%d)\n",log2_maxh,avgU[0],avgs);
#endif
......@@ -1446,11 +1405,7 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
{
ulsch_channel_compensation_alamouti(
#ifndef NEW_FFT
eNB_pusch_vars->rxdataF_ext2[eNB_id],
#else
eNB_pusch_vars->rxdataF_ext[eNB_id],
#endif
eNB_pusch_vars->drs_ch_estimates_0[eNB_id],
eNB_pusch_vars->drs_ch_estimates_1[eNB_id],
eNB_pusch_vars->ul_ch_mag_0[eNB_id],
......@@ -1481,11 +1436,7 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
else
{
ulsch_channel_compensation(
#ifndef NEW_FFT
eNB_pusch_vars->rxdataF_ext2[eNB_id],
#else
eNB_pusch_vars->rxdataF_ext[eNB_id],
#endif
eNB_pusch_vars->drs_ch_estimates[eNB_id],
eNB_pusch_vars->ul_ch_mag[eNB_id],
eNB_pusch_vars->ul_ch_magb[eNB_id],
......@@ -1613,14 +1564,6 @@ void dump_ulsch(PHY_VARS_eNB *PHY_vars_eNB,uint8_t subframe, uint8_t UE_id) {
write_output("/tmp/rxsig0.m","rxs0", &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][0][0],PHY_vars_eNB->lte_frame_parms.samples_per_tti*10,1,1);
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_rx>1)
write_output("/tmp/rxsig1.m","rxs1", &PHY_vars_eNB->lte_eNB_common_vars.rxdata[0][1][0],PHY_vars_eNB->lte_frame_parms.samples_per_tti*10,1,1);
#ifndef NEW_FFT
write_output("/tmp/rxsigF0.m","rxsF0", &PHY_vars_eNB->lte_eNB_common_vars.rxdataF[0][0][0],PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size*nsymb*2,2,1);
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_rx>1)
write_output("/tmp/rxsigF1.m","rxsF1", &PHY_vars_eNB->lte_eNB_common_vars.rxdataF[0][1][0],PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size*nsymb*2,2,1);
write_output("/tmp/rxsigF0_ext.m","rxsF0_ext", &PHY_vars_eNB->lte_eNB_pusch_vars[UE_id]->rxdataF_ext[0][0][0],PHY_vars_eNB->lte_frame_parms.N_RB_UL*12*nsymb*2,2,1);
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_rx>1)
write_output("/tmp/rxsigF1_ext.m","rxsF1_ext", &PHY_vars_eNB->lte_eNB_pusch_vars[UE_id]->rxdataF_ext[1][0][0],PHY_vars_eNB->lte_frame_parms.N_RB_UL*12*nsymb*2,2,1);
#else
write_output("/tmp/rxsigF0.m","rxsF0", &PHY_vars_eNB->lte_eNB_common_vars.rxdataF[0][0][0],PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size*nsymb,1,1);
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_rx>1)
write_output("/tmp/rxsigF1.m","rxsF1", &PHY_vars_eNB->lte_eNB_common_vars.rxdataF[0][1][0],PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size*nsymb,1,1);
......@@ -1641,6 +1584,5 @@ void dump_ulsch(PHY_VARS_eNB *PHY_vars_eNB,uint8_t subframe, uint8_t UE_id) {
write_output("/tmp/ulsch_ch_mag.m","ulsch_ch_mag",&PHY_vars_eNB->lte_eNB_pusch_vars[UE_id]->ul_ch_mag[0][0][0],PHY_vars_eNB->lte_frame_parms.N_RB_UL*12*nsymb,1,1);
// write_output("ulsch_ch_mag1.m","ulsch_ch_mag1",&PHY_vars_eNB->lte_eNB_pusch_vars[UE_id]->ul_ch_mag[0][1][0],PHY_vars_eNB->lte_frame_parms.N_RB_UL*12*nsymb,1,1);
#endif
#endif
}
......@@ -46,6 +46,7 @@ PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_ue_measurements.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_eNB_measurements.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/adjust_gain.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_dl_cell_spec.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_dl_uespec.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_gold.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_gold_mbsfn.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_dl_mbsfn.o
......
lte_dfts: lte_dfts.c
gcc -O3 -msse4.1 -o lte_dfts lte_dfts.c fft.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
gcc -O3 -msse4.1 -o lte_dfts lte_dfts.c fft.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
dft_cycles: lte_dfts
./lte_dfts | egrep cycles
This diff is collapsed.
......@@ -118,9 +118,9 @@
#ifdef CBMIMO1
#define openair_get_mbox() (*(unsigned int *)mbox)
#define openair_get_mbox() (*(uint32_t *)mbox)
#else //CBMIMO1
#define openair_get_mbox() (*(unsigned int *)PHY_vars->mbox>>1)
#define openair_get_mbox() (*(uint32_t *)PHY_vars->mbox>>1)
#endif //CBMIMO1
#endif // USERMODE
......@@ -183,7 +183,7 @@ typedef struct PHY_VARS_eNB_s{
/// Module ID indicator for this instance
module_id_t Mod_id;
uint8_t local_flag;
unsigned int rx_total_gain_eNB_dB;
uint32_t rx_total_gain_eNB_dB;
frame_t frame;
LTE_DL_FRAME_PARMS lte_frame_parms;
PHY_MEASUREMENTS_eNB PHY_measurements_eNB[NUMBER_OF_eNB_SECTORS_MAX]; /// Measurement variables
......@@ -201,10 +201,13 @@ typedef struct PHY_VARS_eNB_s{
LTE_eNB_UE_stats *eNB_UE_stats_ptr[NUMBER_OF_UE_MAX];
/// cell-specific reference symbols
unsigned int lte_gold_table[20][2][14];
uint32_t lte_gold_table[20][2][14];
/// UE-specific reference symbols (p=7...14), TM 8/9/10
uint32_t lte_gold_uespec_table[2][20][2][21];
/// mbsfn reference symbols
unsigned int lte_gold_mbsfn_table[10][3][42];
uint32_t lte_gold_mbsfn_table[10][3][42];
uint32_t X_u[64][839];
......@@ -214,7 +217,7 @@ typedef struct PHY_VARS_eNB_s{
/// Indicator set to 0 after first SR
uint8_t first_sr[NUMBER_OF_UE_MAX];
unsigned int max_peak_val;
uint32_t max_peak_val;
int max_eNB_id, max_sync_pos;
......@@ -286,21 +289,21 @@ typedef struct PHY_VARS_eNB_s{
///check for Total Transmissions
unsigned int check_for_total_transmissions;
uint32_t check_for_total_transmissions;
///check for MU-MIMO Transmissions
unsigned int check_for_MUMIMO_transmissions;
uint32_t check_for_MUMIMO_transmissions;
///check for SU-MIMO Transmissions
unsigned int check_for_SUMIMO_transmissions;
uint32_t check_for_SUMIMO_transmissions;
///check for FULL MU-MIMO Transmissions
unsigned int FULL_MUMIMO_transmissions;
uint32_t FULL_MUMIMO_transmissions;
/// Counter for total bitrate, bits and throughput in downlink
unsigned int total_dlsch_bitrate;
unsigned int total_transmitted_bits;
unsigned int total_system_throughput;
uint32_t total_dlsch_bitrate;
uint32_t total_transmitted_bits;
uint32_t total_system_throughput;
time_stats_t phy_proc;
time_stats_t phy_proc_tx;
......@@ -356,12 +359,12 @@ typedef struct
/// Module ID indicator for this instance
uint8_t Mod_id;
uint8_t local_flag;
unsigned int tx_total_gain_dB;
unsigned int rx_total_gain_dB; ///this is a function of rx_gain_mode (and the corresponding gain) and the rx_gain of the card
uint32_t tx_total_gain_dB;
uint32_t rx_total_gain_dB; ///this is a function of rx_gain_mode (and the corresponding gain) and the rx_gain of the card
rx_gain_t rx_gain_mode[4];
unsigned int rx_gain_max[4];
unsigned int rx_gain_med[4];
unsigned int rx_gain_byp[4];
uint32_t rx_gain_max[4];
uint32_t rx_gain_med[4];
uint32_t rx_gain_byp[4];
int8_t tx_power_dBm;
int8_t tx_power_max_dBm;
uint32_t frame;
......@@ -395,26 +398,29 @@ typedef struct
UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_eNB_MAX];
int8_t g_pucch[NUMBER_OF_CONNECTED_eNB_MAX];
/// cell-specific reference symbols
unsigned int lte_gold_table[7][20][2][14];
uint32_t lte_gold_table[7][20][2][14];
/// ue-specific reference symbols
uint32_t lte_gold_uespec_table[2][20][2][21];
/// mbsfn reference symbols
unsigned int lte_gold_mbsfn_table[10][3][42];
/// mbsfn reference symbols
uint32_t lte_gold_mbsfn_table[10][3][42];
uint32_t X_u[64][839];
char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX];
unsigned char ulsch_ue_Msg3_active[NUMBER_OF_CONNECTED_eNB_MAX];
unsigned int ulsch_ue_Msg3_frame[NUMBER_OF_CONNECTED_eNB_MAX];
uint32_t ulsch_ue_Msg3_frame[NUMBER_OF_CONNECTED_eNB_MAX];
unsigned char ulsch_ue_Msg3_subframe[NUMBER_OF_CONNECTED_eNB_MAX];
// unsigned char Msg3_timer[NUMBER_OF_CONNECTED_eNB_MAX];
//unsigned char *Msg3_ptr[NUMBER_OF_CONNECTED_eNB_MAX];
PRACH_RESOURCES_t *prach_resources[NUMBER_OF_CONNECTED_eNB_MAX];
int turbo_iterations, turbo_cntl_iterations;
unsigned int total_TBS[NUMBER_OF_CONNECTED_eNB_MAX];
unsigned int total_TBS_last[NUMBER_OF_CONNECTED_eNB_MAX];
unsigned int bitrate[NUMBER_OF_CONNECTED_eNB_MAX];
unsigned int total_received_bits[NUMBER_OF_CONNECTED_eNB_MAX];
uint32_t total_TBS[NUMBER_OF_CONNECTED_eNB_MAX];
uint32_t total_TBS_last[NUMBER_OF_CONNECTED_eNB_MAX];
uint32_t bitrate[NUMBER_OF_CONNECTED_eNB_MAX];
uint32_t total_received_bits[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_errors[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_errors_last[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_received[NUMBER_OF_CONNECTED_eNB_MAX];
......
......@@ -534,7 +534,9 @@ typedef enum {
PUSCH_PRECODING1=8,
DUALSTREAM_UNIFORM_PRECODING1=9,
DUALSTREAM_UNIFORM_PRECODINGj=10,
DUALSTREAM_PUSCH_PRECODING=11
DUALSTREAM_PUSCH_PRECODING=11,
TM8=12,
TM9_10=13
} MIMO_mode_t;
typedef struct{
......
......@@ -1791,6 +1791,7 @@ void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,ui
phy_vars_eNB->dlsch_eNB_SI->nb_rb,
phy_vars_eNB->dlsch_eNB_SI->rb_alloc,
get_Qm(phy_vars_eNB->dlsch_eNB_SI->harq_processes[0]->mcs),
1,
num_pdcch_symbols,phy_vars_eNB->frame,next_slot>>1),
0,
next_slot);
......@@ -1909,6 +1910,7 @@ void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,ui
phy_vars_eNB->dlsch_eNB_ra->nb_rb,
phy_vars_eNB->dlsch_eNB_ra->rb_alloc,
get_Qm(phy_vars_eNB->dlsch_eNB_ra->harq_processes[0]->mcs),
1,
num_pdcch_symbols,phy_vars_eNB->frame,next_slot>>1),
0,
next_slot);
......@@ -1958,6 +1960,7 @@ void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,ui
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nb_rb,
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rb_alloc,
get_Qm(phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->mcs),
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->Nl,
num_pdcch_symbols,phy_vars_eNB->frame,next_slot>>1),
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nb_rb,
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->mcs,
......@@ -2031,6 +2034,7 @@ void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,ui
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nb_rb,
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rb_alloc,
get_Qm(phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->mcs),
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->Nl,
num_pdcch_symbols,phy_vars_eNB->frame,next_slot>>1),
0,
next_slot);
......
......@@ -150,6 +150,7 @@ void dump_dlsch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint8_t
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->nb_rb,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs),
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Nl,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
phy_vars_ue->frame,subframe);
......@@ -177,6 +178,7 @@ void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe) {
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->mcs),
1,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
phy_vars_ue->frame,subframe);
LOG_D(PHY,"[UE %d] Dumping dlsch_SI : nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n",
......@@ -230,6 +232,7 @@ void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe) {
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->mcs),
1,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
phy_vars_ue->frame,subframe);
LOG_D(PHY,"[UE %d] Dumping dlsch_ra : nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n",
......@@ -2465,6 +2468,7 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,uint8_t last_slot, PHY_VARS_UE *phy_v
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->nb_rb,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs),
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->Nl,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
phy_vars_ue->frame,(((last_slot>>1)==0) ? 9 : ((last_slot>>1)-1)));
start_meas(&phy_vars_ue->dlsch_unscrambling_stats);
......@@ -2614,7 +2618,7 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,uint8_t last_slot, PHY_VARS_UE *phy_v
get_G(&phy_vars_ue->lte_frame_parms,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->mcs),
get_Qm(phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->mcs),1,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
phy_vars_ue->frame,(((last_slot>>1)==0) ? 9 : ((last_slot>>1)-1)));
......@@ -2749,7 +2753,7 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,uint8_t last_slot, PHY_VARS_UE *phy_v
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->G = get_G(&phy_vars_ue->lte_frame_parms,
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->mcs),
get_Qm(phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->mcs),1,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
phy_vars_ue->frame,
(((last_slot>>1)==0) ? 9 : ((last_slot>>1)-1)));
......@@ -3097,6 +3101,7 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,uint8_t last_slot, PHY_VARS_UE *phy_v
phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->rb_alloc,
get_Qm(phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->mcs),
1,
2,
((last_slot>>1)==9?-1:0)+phy_vars_ue->frame,last_slot>>1);
......
......@@ -1264,6 +1264,7 @@ int main(int argc, char **argv) {
PHY_vars_eNB->dlsch_eNB[0][0]->nb_rb,
PHY_vars_eNB->dlsch_eNB[0][0]->rb_alloc,
get_Qm(PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->mcs),
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->Nl,
num_pdcch_symbols,
0,subframe);
......@@ -1528,6 +1529,7 @@ int main(int argc, char **argv) {
PHY_vars_eNB->dlsch_eNB[k][0]->nb_rb,
PHY_vars_eNB->dlsch_eNB[k][0]->rb_alloc,
get_Qm(PHY_vars_eNB->dlsch_eNB[k][0]->harq_processes[0]->mcs),
PHY_vars_eNB->dlsch_eNB[k][0]->harq_processes[0]->Nl,
num_pdcch_symbols,
0,subframe);
......@@ -1995,7 +1997,8 @@ int main(int argc, char **argv) {
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->nb_rb,
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->rb_alloc,
get_Qm(PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->mcs),
PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->Nl,
PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
0,subframe);
/*
rate = (double)dlsch_tbs25[get_I_TBS(PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->mcs)][PHY_vars_UE->dlsch_ue[0][0]->nb_rb-1]/(coded_bits_per_codeword);
......@@ -2210,6 +2213,7 @@ int main(int argc, char **argv) {
PHY_vars_eNB->dlsch_eNB[0][0]->nb_rb,
PHY_vars_eNB->dlsch_eNB[0][0]->rb_alloc,
get_Qm(PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->mcs),
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->Nl,
num_pdcch_symbols,
0,subframe);
......
......@@ -498,7 +498,7 @@ int main(int argc, char **argv) {
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->nb_rb,
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->rb_alloc,
get_Qm(PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->mcs),
2,
1,2,
PHY_vars_UE->frame,subframe);
dlsch_unscrambling(&PHY_vars_UE->lte_frame_parms,1,PHY_vars_UE->dlsch_ue_MCH[0],
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->G,
......
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