Merge branch 'develop' into RU-RAU-split
Conflicts: openair1/PHY/INIT/lte_init.c openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c openair1/PHY/LTE_TRANSPORT/dci.c openair1/PHY/LTE_TRANSPORT/dci_tools.c openair1/PHY/LTE_TRANSPORT/dlsch_coding.c openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c openair1/PHY/LTE_TRANSPORT/if4_tools.c openair1/PHY/LTE_TRANSPORT/if5_tools.c openair1/PHY/LTE_TRANSPORT/if5_tools.h openair1/PHY/LTE_TRANSPORT/pcfich.c openair1/PHY/LTE_TRANSPORT/phich.c openair1/PHY/LTE_TRANSPORT/prach.c openair1/PHY/LTE_TRANSPORT/rar_tools.c openair1/PHY/LTE_TRANSPORT/srs_modulation.c openair1/PHY/defs.h openair1/PHY/impl_defs_lte.h openair1/PHY/impl_defs_top.h openair1/SCHED/phy_procedures_lte_eNb.c openair1/SCHED/phy_procedures_lte_ue.c openair2/COMMON/mac_rrc_primitives.h openair2/ENB_APP/enb_config.c openair2/ENB_APP/enb_config.h openair2/LAYER2/MAC/config.c openair2/LAYER2/MAC/eNB_scheduler.c openair2/LAYER2/MAC/eNB_scheduler_dlsch.c openair2/LAYER2/MAC/eNB_scheduler_mch.c openair2/LAYER2/MAC/eNB_scheduler_primitives.c openair2/LAYER2/MAC/main.c openair2/LAYER2/MAC/proto.h openair2/RRC/LITE/MESSAGES/asn1_msg.c openair2/RRC/LITE/MESSAGES/asn1_msg.h openair2/RRC/LITE/rrc_UE.c openair2/RRC/LITE/rrc_common.c openair2/RRC/LITE/rrc_eNB.c targets/ARCH/COMMON/common_lib.c targets/ARCH/COMMON/common_lib.h targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.oaisim.conf targets/RT/USER/lte-enb.c targets/RT/USER/lte-softmodem.c targets/RT/USER/lte-ue.c targets/RT/USER/rt_wrapper.h targets/SIMU/USER/channel_sim.c targets/SIMU/USER/init_lte.c targets/SIMU/USER/oaisim.c targets/SIMU/USER/oaisim_functions.c
This commit is contained in:
@@ -489,7 +489,8 @@ void fill_phy_ue_vars(unsigned int ue_id, uint8_t CC_id,unsigned int last_slot)
|
||||
rnti = UE_transport_info[ue_id][CC_id].rnti[n_enb];
|
||||
enb_id = UE_transport_info[ue_id][CC_id].eNB_id[n_enb];
|
||||
|
||||
PHY_vars_UE_g[ue_id][CC_id]->pdcch_vars[enb_id]->crnti=rnti;
|
||||
PHY_vars_UE_g[ue_id][CC_id]->pdcch_vars[0][enb_id]->crnti=rnti;
|
||||
PHY_vars_UE_g[ue_id][CC_id]->pdcch_vars[1][enb_id]->crnti=rnti;
|
||||
|
||||
harq_pid = UE_transport_info[ue_id][CC_id].harq_pid[n_enb];
|
||||
|
||||
|
||||
@@ -308,10 +308,10 @@ void* multicast_link_main_loop (void *param)
|
||||
}
|
||||
|
||||
void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
|
||||
unsigned char multicast_group, char *multicast_ifname)
|
||||
unsigned char _multicast_group, char *multicast_ifname)
|
||||
{
|
||||
rx_handler = rx_handlerP;
|
||||
multicast_group = multicast_group;
|
||||
multicast_group = _multicast_group;
|
||||
multicast_if = multicast_ifname;
|
||||
LOG_I(EMU, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
|
||||
(multicast_if == NULL) ? "not specified" : multicast_if, multicast_group,
|
||||
|
||||
+192
-160
@@ -57,6 +57,8 @@
|
||||
PHY_VARS_eNB *eNB;
|
||||
PHY_VARS_UE *UE;
|
||||
|
||||
double cpuf;
|
||||
|
||||
int otg_enabled=0;
|
||||
/*the following parameters are used to control the processing times calculations*/
|
||||
double t_tx_max = -1000000000; /*!< \brief initial max process time for tx */
|
||||
@@ -118,10 +120,10 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4],
|
||||
void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4],
|
||||
double *s_re[2],double *s_im[2],double *r_re[2],double *r_im[2],FILE *csv_fd) {
|
||||
|
||||
int i,u;
|
||||
@@ -145,17 +147,17 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
r_re[aarx][i] += ((double)(((short *)eNB->common_vars.txdata[0][aa]))[(2*subframe*UE->frame_parms.samples_per_tti) +(i<<1)]);
|
||||
r_im[aarx][i] += ((double)(((short *)eNB->common_vars.txdata[0][aa]))[(2*subframe*UE->frame_parms.samples_per_tti) +(i<<1)+1]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Multipath channel
|
||||
if (awgn_flag == 0) {
|
||||
multipath_channel(eNB2UE[round],s_re,s_im,r_re,r_im,
|
||||
2*UE->frame_parms.samples_per_tti,hold_channel);
|
||||
|
||||
|
||||
// printf("amc: ****************** eNB2UE[%d]->n_rx = %d,dd %d\n",round,eNB2UE[round]->nb_rx,eNB2UE[round]->channel_offset);
|
||||
if(abstx==1 && num_rounds>1)
|
||||
if(round==0 && hold_channel==0) {
|
||||
@@ -163,7 +165,7 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
random_channel(eNB2UE[2],0);
|
||||
random_channel(eNB2UE[3],0);
|
||||
}
|
||||
|
||||
|
||||
if (UE->perfect_ce==1) {
|
||||
// fill in perfect channel estimates
|
||||
freq_channel(eNB2UE[round],UE->frame_parms.N_RB_DL,12*UE->frame_parms.N_RB_DL + 1);
|
||||
@@ -173,15 +175,15 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(abstx) {
|
||||
if (trials==0 && round==0) {
|
||||
// calculate freq domain representation to compute SINR
|
||||
freq_channel(eNB2UE[0], eNB->frame_parms.N_RB_DL,2*eNB->frame_parms.N_RB_DL + 1);
|
||||
// snr=pow(10.0,.1*SNR);
|
||||
fprintf(csv_fd,"%f,",SNR);
|
||||
|
||||
|
||||
for (u=0; u<2*eNB->frame_parms.N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[0]->nb_rx; aarx++) {
|
||||
for (aatx=0; aatx<eNB2UE[0]->nb_tx; aatx++) {
|
||||
@@ -190,11 +192,11 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
fprintf(csv_fd,"%e+i*(%e),",channelx,channely);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(num_rounds>1) {
|
||||
freq_channel(eNB2UE[1], eNB->frame_parms.N_RB_DL,2*eNB->frame_parms.N_RB_DL + 1);
|
||||
|
||||
|
||||
for (u=0; u<2*eNB->frame_parms.N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[1]->nb_rx; aarx++) {
|
||||
for (aatx=0; aatx<eNB2UE[1]->nb_tx; aatx++) {
|
||||
@@ -204,9 +206,9 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
freq_channel(eNB2UE[2], eNB->frame_parms.N_RB_DL,2*eNB->frame_parms.N_RB_DL + 1);
|
||||
|
||||
|
||||
for (u=0; u<2*eNB->frame_parms.N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[2]->nb_rx; aarx++) {
|
||||
for (aatx=0; aatx<eNB2UE[2]->nb_tx; aatx++) {
|
||||
@@ -216,9 +218,9 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
freq_channel(eNB2UE[3], eNB->frame_parms.N_RB_DL,2*eNB->frame_parms.N_RB_DL + 1);
|
||||
|
||||
|
||||
for (u=0; u<2*eNB->frame_parms.N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[3]->nb_rx; aarx++) {
|
||||
for (aatx=0; aatx<eNB2UE[3]->nb_tx; aatx++) {
|
||||
@@ -231,10 +233,11 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//AWGN
|
||||
// This is the SNR on the PDSCH for OFDM symbols without pilots -> rho_A
|
||||
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)eNB->frame_parms.ofdm_symbol_size/(double)(eNB->frame_parms.N_RB_DL*12)) - SNR - get_pa_dB(eNB->pdsch_config_dedicated);
|
||||
// tx_lev is the average energy over the whole subframe
|
||||
// but SNR should be better defined wrt the energy in the reference symbols
|
||||
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)eNB->frame_parms.ofdm_symbol_size/(double)(eNB->frame_parms.N_RB_DL*12)) - SNR;
|
||||
sigma2 = pow(10,sigma2_dB/10);
|
||||
|
||||
for (i=0; i<2*UE->frame_parms.samples_per_tti; i++) {
|
||||
@@ -251,7 +254,7 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
|
||||
void fill_DCI(PHY_VARS_eNB *eNB,
|
||||
DCI_ALLOC_t *dci_alloc,
|
||||
int subframe,
|
||||
int subframe,
|
||||
int n_rnti,
|
||||
int n_users,
|
||||
int transmission_mode,
|
||||
@@ -267,7 +270,7 @@ void fill_DCI(PHY_VARS_eNB *eNB,
|
||||
int *num_dci) {
|
||||
|
||||
int k;
|
||||
int dci_length,dci_length_bytes;
|
||||
int dci_length = -1,dci_length_bytes = -1;
|
||||
|
||||
// printf("Generating DCIs for %d users, TM %d, mcs1 %d\n",n_users,transmission_mode,mcs1);
|
||||
for(k=0; k<n_users; k++) {
|
||||
@@ -278,9 +281,9 @@ void fill_DCI(PHY_VARS_eNB *eNB,
|
||||
|
||||
case 7:
|
||||
if (common_flag == 0) {
|
||||
|
||||
|
||||
if (eNB->frame_parms.frame_type == TDD) {
|
||||
|
||||
|
||||
switch (eNB->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
dci_length = sizeof_DCI1_1_5MHz_TDD_t;
|
||||
@@ -294,7 +297,7 @@ void fill_DCI(PHY_VARS_eNB *eNB,
|
||||
((DCI1_1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi = ndi;
|
||||
((DCI1_1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv = rv;
|
||||
break;
|
||||
|
||||
|
||||
case 25:
|
||||
dci_length = sizeof_DCI1_5MHz_TDD_t;
|
||||
dci_length_bytes = sizeof(DCI1_5MHz_TDD_t);
|
||||
@@ -307,7 +310,7 @@ void fill_DCI(PHY_VARS_eNB *eNB,
|
||||
((DCI1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi = ndi;
|
||||
((DCI1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv = rv;
|
||||
break;
|
||||
|
||||
|
||||
case 50:
|
||||
dci_length = sizeof_DCI1_10MHz_TDD_t;
|
||||
dci_length_bytes = sizeof(DCI1_10MHz_TDD_t);
|
||||
@@ -1223,17 +1226,18 @@ DCI_PDU *get_dci_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t
|
||||
if (subframeP == subframe) {
|
||||
DCI_pdu.Num_ue_spec_dci = num_ue_spec_dci;
|
||||
DCI_pdu.Num_common_dci = num_common_dci;
|
||||
DCI_pdu.num_pdcch_symbols = num_pdcch_symbols;
|
||||
return(&DCI_pdu);
|
||||
DCI_pdu.num_pdcch_symbols = num_pdcch_symbols;
|
||||
} else {
|
||||
DCI_pdu.Num_ue_spec_dci = 0;
|
||||
DCI_pdu.Num_common_dci = 0;
|
||||
DCI_pdu.num_pdcch_symbols = num_pdcch_symbols;
|
||||
DCI_pdu.num_pdcch_symbols = num_pdcch_symbols;
|
||||
}
|
||||
|
||||
return &DCI_pdu;
|
||||
}
|
||||
|
||||
void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP) {
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1265,7 +1269,7 @@ int main(int argc, char **argv)
|
||||
|
||||
int s,Kr,Kr_bytes;
|
||||
|
||||
double SNR,snr0=-2.0,snr1,rate;
|
||||
double SNR,snr0=-2.0,snr1,rate = 0;
|
||||
double snr_step=1,input_snr_step=1, snr_int=30;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
@@ -1295,10 +1299,10 @@ int main(int argc, char **argv)
|
||||
DCI_ALLOC_t *dci_alloc = &DCI_pdu.dci_alloc[0];
|
||||
|
||||
unsigned int ret;
|
||||
unsigned int coded_bits_per_codeword=0,nsymb,tbs=0;
|
||||
unsigned int coded_bits_per_codeword=0,nsymb; //,tbs=0;
|
||||
|
||||
unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors=0;//,num_layers;
|
||||
int re_allocated;
|
||||
unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors[4]={0,0,0,0};//,num_layers;
|
||||
//int re_allocated;
|
||||
char fname[32],vname[32];
|
||||
FILE *bler_fd;
|
||||
char bler_fname[256];
|
||||
@@ -1325,25 +1329,25 @@ int main(int argc, char **argv)
|
||||
int n_frames;
|
||||
int n_ch_rlz = 1;
|
||||
channel_desc_t *eNB2UE[4];
|
||||
uint8_t num_pdcch_symbols_2=0;
|
||||
//uint8_t num_pdcch_symbols_2=0;
|
||||
uint8_t rx_sample_offset = 0;
|
||||
//char stats_buffer[4096];
|
||||
//int len;
|
||||
uint8_t num_rounds = 4;//,fix_rounds=0;
|
||||
|
||||
int u;
|
||||
//int u;
|
||||
int n=0;
|
||||
int abstx=0;
|
||||
int iii;
|
||||
//int iii;
|
||||
|
||||
int ch_realization;
|
||||
int pmi_feedback=0;
|
||||
//int pmi_feedback=0;
|
||||
int hold_channel=0;
|
||||
|
||||
// void *data;
|
||||
// int ii;
|
||||
// int bler;
|
||||
double blerr[4],uncoded_ber,avg_ber;
|
||||
double blerr[4],uncoded_ber; //,avg_ber;
|
||||
short *uncoded_ber_bit=NULL;
|
||||
uint8_t N_RB_DL=25,osf=1;
|
||||
frame_t frame_type = FDD;
|
||||
@@ -1352,7 +1356,7 @@ int main(int argc, char **argv)
|
||||
char title[255];
|
||||
|
||||
int numCCE=0;
|
||||
int dci_length_bytes=0,dci_length=0;
|
||||
//int dci_length_bytes=0,dci_length=0;
|
||||
//double channel_bandwidth = 5.0, sampling_rate=7.68;
|
||||
int common_flag=0,TPC=0;
|
||||
|
||||
@@ -1375,6 +1379,7 @@ int main(int argc, char **argv)
|
||||
uint8_t Kmimo;
|
||||
uint8_t ue_category=4;
|
||||
uint32_t Nsoft;
|
||||
int sf;
|
||||
|
||||
|
||||
|
||||
@@ -1386,9 +1391,9 @@ int main(int argc, char **argv)
|
||||
|
||||
FILE *csv_fd=NULL;
|
||||
char csv_fname[32];
|
||||
int dci_flag=1;
|
||||
//int dci_flag=1;
|
||||
int two_thread_flag=0;
|
||||
int DLSCH_RB_ALLOC;
|
||||
int DLSCH_RB_ALLOC = 0;
|
||||
|
||||
#if defined(__arm__)
|
||||
FILE *proc_fd = NULL;
|
||||
@@ -1408,6 +1413,8 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz);
|
||||
|
||||
cpuf = cpu_freq_GHz;
|
||||
|
||||
//signal(SIGSEGV, handler);
|
||||
//signal(SIGABRT, handler);
|
||||
|
||||
@@ -1446,9 +1453,9 @@ int main(int argc, char **argv)
|
||||
Nid_cell = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
dci_flag = 1;
|
||||
break;
|
||||
//case 'd':
|
||||
// dci_flag = 1;
|
||||
// break;
|
||||
|
||||
case 'D':
|
||||
frame_type=TDD;
|
||||
@@ -1459,7 +1466,7 @@ int main(int argc, char **argv)
|
||||
common_flag = 1;
|
||||
TPC = atoi(optarg);
|
||||
break;
|
||||
|
||||
|
||||
case 'E':
|
||||
threequarter_fs=1;
|
||||
break;
|
||||
@@ -1475,7 +1482,7 @@ int main(int argc, char **argv)
|
||||
case 'i':
|
||||
input_fd = fopen(optarg,"r");
|
||||
input_file=1;
|
||||
dci_flag = 1;
|
||||
//dci_flag = 1;
|
||||
break;
|
||||
|
||||
case 'I':
|
||||
@@ -1779,7 +1786,7 @@ int main(int argc, char **argv)
|
||||
form_ue = create_lte_phy_scope_ue();
|
||||
sprintf (title, "LTE PHY SCOPE eNB");
|
||||
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
|
||||
|
||||
if (!dual_stream_UE==0) {
|
||||
UE->use_ia_receiver = 1;
|
||||
fl_set_button(form_ue->button_0,1);
|
||||
@@ -1807,9 +1814,9 @@ int main(int argc, char **argv)
|
||||
perfect_ce);
|
||||
|
||||
if ((transmission_mode==1) || (transmission_mode==7)) {
|
||||
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx; aa++)
|
||||
for (re=0; re<eNB->frame_parms.ofdm_symbol_size; re++)
|
||||
eNB->common_vars.beam_weights[0][0][aa][re] = 0x00007fff/eNB->frame_parms.nb_antennas_tx;
|
||||
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx; aa++)
|
||||
for (re=0; re<eNB->frame_parms.ofdm_symbol_size; re++)
|
||||
eNB->common_vars.beam_weights[0][0][aa][re] = 0x00007fff/eNB->frame_parms.nb_antennas_tx;
|
||||
}
|
||||
|
||||
if (transmission_mode<7)
|
||||
@@ -1823,15 +1830,17 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else {
|
||||
eNB->te = dlsch_encoding_2threads;
|
||||
extern void init_td_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_te_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
init_td_thread(eNB,NULL);
|
||||
init_te_thread(eNB,NULL);
|
||||
}
|
||||
|
||||
// callback functions required for phy_procedures_tx
|
||||
// callback functions required for phy_procedures_tx
|
||||
mac_xface->get_dci_sdu = get_dci_sdu;
|
||||
mac_xface->get_dlsch_sdu = get_dlsch_sdu;
|
||||
mac_xface->eNB_dlsch_ulsch_scheduler = eNB_dlsch_ulsch_scheduler;
|
||||
|
||||
|
||||
// eNB_id_i = UE->n_connected_eNB;
|
||||
|
||||
printf("Setting mcs1 = %d\n",mcs1);
|
||||
@@ -1990,7 +1999,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
*/
|
||||
|
||||
UE->pdcch_vars[0]->crnti = n_rnti;
|
||||
UE->pdcch_vars[subframe & 0x1][0]->crnti = n_rnti;
|
||||
|
||||
// Fill in UL_alloc
|
||||
UL_alloc_pdu.type = 0;
|
||||
@@ -2096,17 +2105,28 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
UE->dlsch[0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
/* allocate memory for both subframes (only one is really used
|
||||
* but there is now "copy_harq_proc_struct" which needs both
|
||||
* to be valid)
|
||||
* TODO: refine this somehow (necessary?)
|
||||
*/
|
||||
for (sf = 0; sf < 2; sf++) {
|
||||
for (i=0; i<2; i++) {
|
||||
UE->dlsch[sf][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
|
||||
if (!UE->dlsch[0][i]) {
|
||||
printf("Can't get ue dlsch structures\n");
|
||||
exit(-1);
|
||||
if (!UE->dlsch[sf][0][i]) {
|
||||
printf("Can't get ue dlsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
UE->dlsch[sf][0][i]->rnti = n_rnti;
|
||||
}
|
||||
|
||||
UE->dlsch[0][i]->rnti = n_rnti;
|
||||
}
|
||||
|
||||
UE->dlsch_SI[0] = new_ue_dlsch(1,1,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
UE->dlsch_ra[0] = new_ue_dlsch(1,1,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
UE->ulsch[0] = new_ue_ulsch(N_RB_DL,0);
|
||||
|
||||
// structure for SIC at UE
|
||||
UE->dlsch_eNB[0] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0,&eNB->frame_parms);
|
||||
|
||||
@@ -2177,6 +2197,7 @@ int main(int argc, char **argv)
|
||||
|
||||
while ((!feof(input_trch_fd)) && (i<input_buffer_length0<<3)) {
|
||||
ret=fscanf(input_trch_fd,"%s",input_trch_val);
|
||||
if (ret != 1) printf("ERROR: error reading file\n");
|
||||
|
||||
if (input_trch_val[0] == '1')
|
||||
input_buffer0[k][i>>3]+=(1<<(7-(i&7)));
|
||||
@@ -2233,7 +2254,10 @@ int main(int argc, char **argv)
|
||||
round_trials[2] = 0;
|
||||
round_trials[3] = 0;
|
||||
|
||||
dci_errors=0;
|
||||
dci_errors[0]=0;
|
||||
dci_errors[1]=0;
|
||||
dci_errors[2]=0;
|
||||
dci_errors[3]=0;
|
||||
// avg_ber = 0;
|
||||
|
||||
round=0;
|
||||
@@ -2249,12 +2273,13 @@ int main(int argc, char **argv)
|
||||
reset_meas(&eNB->dlsch_rate_matching_stats);
|
||||
reset_meas(&eNB->dlsch_turbo_encoding_stats);
|
||||
|
||||
reset_meas(&UE->phy_proc_rx); // total UE rx
|
||||
reset_meas(&UE->phy_proc_rx[subframe&0x1]); // total UE rx
|
||||
reset_meas(&UE->ofdm_demod_stats);
|
||||
reset_meas(&UE->dlsch_channel_estimation_stats);
|
||||
reset_meas(&UE->dlsch_freq_offset_estimation_stats);
|
||||
reset_meas(&UE->rx_dft_stats);
|
||||
reset_meas(&UE->dlsch_decoding_stats);
|
||||
reset_meas(&UE->dlsch_decoding_stats[0]);
|
||||
reset_meas(&UE->dlsch_decoding_stats[1]);
|
||||
reset_meas(&UE->dlsch_turbo_decoding_stats);
|
||||
reset_meas(&UE->dlsch_deinterleaving_stats);
|
||||
reset_meas(&UE->dlsch_rate_unmatching_stats);
|
||||
@@ -2300,10 +2325,10 @@ int main(int argc, char **argv)
|
||||
// printf("Trial %d, round %d\n",trials,round);
|
||||
round_trials[round]++;
|
||||
|
||||
if(transmission_mode>=5)
|
||||
pmi_feedback=1;
|
||||
else
|
||||
pmi_feedback=0;
|
||||
//if(transmission_mode>=5)
|
||||
// pmi_feedback=1;
|
||||
//else
|
||||
// pmi_feedback=0;
|
||||
|
||||
if (abstx) {
|
||||
if (trials==0 && round==0 && SNR==snr0) //generate a new channel
|
||||
@@ -2335,7 +2360,7 @@ int main(int argc, char **argv)
|
||||
TB0_active = 1;
|
||||
|
||||
eNB->dlsch[0][0]->harq_processes[0]->rvidx = round&3;
|
||||
|
||||
|
||||
fill_DCI(eNB,&dci_alloc[0],subframe,n_rnti,n_users,transmission_mode,common_flag,DLSCH_RB_ALLOC,TPC,mcs1,mcs2,trials&1,round&3,&num_common_dci,&num_ue_spec_dci,&num_dci);
|
||||
}
|
||||
else {
|
||||
@@ -2343,14 +2368,14 @@ int main(int argc, char **argv)
|
||||
(TB0_active==1)?mcs1:0,mcs2,trials&1,(TB0_active==1)?round&3:0,&num_common_dci,&num_ue_spec_dci,&num_dci);
|
||||
}
|
||||
for (i=num_common_dci; i<num_dci; i++) {
|
||||
|
||||
|
||||
dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
|
||||
1<<dci_alloc[i].L,
|
||||
numCCE,
|
||||
(dci_alloc[i].rnti==SI_RNTI)? 1 : 0,
|
||||
dci_alloc[i].rnti,
|
||||
subframe);
|
||||
|
||||
|
||||
if (dci_alloc[i].firstCCE < 0) {
|
||||
printf("firstCCE <0 !! dci %d: rnti %x, format %d : nCCE %d/%d\n",i,dci_alloc[i].rnti, dci_alloc[i].format,
|
||||
dci_alloc[i].firstCCE,numCCE);
|
||||
@@ -2362,7 +2387,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
} // common_flag == 0
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@@ -2389,22 +2414,22 @@ int main(int argc, char **argv)
|
||||
tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
proc_eNB->subframe_tx = subframe;
|
||||
eNB->abstraction_flag=0;
|
||||
|
||||
|
||||
phy_procedures_eNB_TX(eNB,proc_eNB,no_relay,NULL,1);
|
||||
|
||||
|
||||
|
||||
|
||||
start_meas(&eNB->ofdm_mod_stats);
|
||||
|
||||
|
||||
/*
|
||||
do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
|
||||
eNB->common_vars.txdata[eNB_id],
|
||||
(subframe*2),
|
||||
&eNB->frame_parms);
|
||||
|
||||
|
||||
do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
|
||||
eNB->common_vars.txdata[eNB_id],
|
||||
(subframe*2)+1,
|
||||
@@ -2425,19 +2450,19 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
stop_meas(&eNB->ofdm_mod_stats);
|
||||
|
||||
|
||||
// generate next subframe for channel estimation
|
||||
|
||||
|
||||
proc_eNB->subframe_tx = subframe+1;
|
||||
|
||||
|
||||
phy_procedures_eNB_TX(eNB,proc_eNB,no_relay,NULL,0);
|
||||
|
||||
|
||||
do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
|
||||
eNB->common_vars.txdata[eNB_id],
|
||||
(subframe*2)+2,
|
||||
&eNB->frame_parms);
|
||||
|
||||
|
||||
|
||||
proc_eNB->frame_tx++;
|
||||
|
||||
tx_lev = 0;
|
||||
@@ -2450,7 +2475,7 @@ int main(int argc, char **argv)
|
||||
|
||||
tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
|
||||
|
||||
|
||||
|
||||
if (n_frames==1) {
|
||||
printf("tx_lev = %d (%d dB)\n",tx_lev,tx_lev_dB);
|
||||
|
||||
@@ -2466,7 +2491,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
DL_channel(eNB,UE,subframe,awgn_flag,SNR,tx_lev,hold_channel,abstx,num_rounds,trials,round,eNB2UE,s_re,s_im,r_re,r_im,csv_fd);
|
||||
|
||||
|
||||
|
||||
UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[subframe&1];
|
||||
proc->subframe_rx = subframe;
|
||||
@@ -2479,16 +2504,19 @@ int main(int argc, char **argv)
|
||||
UE->rx_offset,
|
||||
0,
|
||||
0);
|
||||
|
||||
|
||||
if (n_frames==1) printf("Running phy_procedures_UE_RX\n");
|
||||
phy_procedures_UE_RX(UE,proc,0,0,normal_txrx,no_relay,NULL);
|
||||
|
||||
if (UE->dlsch[0][0]->active == 0) {
|
||||
if (UE->dlsch[subframe&0x1][0][0]->active == 0) {
|
||||
//printf("DCI not received\n");
|
||||
dci_errors[round]++;
|
||||
UE->dlsch_errors[0] = 1;
|
||||
|
||||
/*
|
||||
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],12*UE->frame_parms.N_RB_DL*3,1,1);
|
||||
|
||||
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNB_id]->rxdataF_comp[0],4*12*UE->frame_parms.N_RB_DL,1,1);
|
||||
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[eNB_id]->llr,12*UE->frame_parms.N_RB_DL*4*2,1,4);
|
||||
write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
|
||||
@@ -2503,90 +2531,92 @@ int main(int argc, char **argv)
|
||||
|
||||
if ((test_perf ==0 ) && (n_frames==1)) {
|
||||
write_output("ch0.m","ch0",eNB2UE[0]->ch[0],eNB2UE[0]->channel_length,1,8);
|
||||
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_tx>1)
|
||||
write_output("ch1.m","ch1",eNB2UE[0]->ch[eNB->frame_parms.nb_antennas_rx],eNB2UE[0]->channel_length,1,8);
|
||||
|
||||
|
||||
//common vars
|
||||
write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||
|
||||
write_output("rxsigF0.m","rxsF0", &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
||||
write_output("rxsigF1.m","rxsF1", UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
}
|
||||
|
||||
|
||||
write_output("dlsch00_r0.m","dl00_r0",
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1)
|
||||
write_output("dlsch01_r0.m","dl01_r0",
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_tx>1)
|
||||
write_output("dlsch10_r0.m","dl10_r0",
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
|
||||
if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1))
|
||||
write_output("dlsch11_r0.m","dl11_r0",
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
|
||||
|
||||
//pdsch_vars
|
||||
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||
//dump_dlsch2(UE,eNB_id_i,coded_bits_per_codeword);
|
||||
|
||||
dump_dlsch2(UE,eNB_id,subframe,&coded_bits_per_codeword,round, UE->dlsch[subframe&0x1][0][0]->current_harq_pid);
|
||||
|
||||
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||
|
||||
|
||||
//pdcch_vars
|
||||
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],300*3,1,1);
|
||||
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNB_id]->rxdataF_comp[0],4*300,1,1);
|
||||
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[eNB_id]->llr,2400,1,4);
|
||||
|
||||
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[0][eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[0][eNB_id]->dl_ch_estimates_ext[0],300*3,1,1);
|
||||
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[0][eNB_id]->rxdataF_comp[0],4*300,1,1);
|
||||
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[0][eNB_id]->llr,2400,1,4);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (UE->dlsch_errors[0] == 0) {
|
||||
|
||||
avg_iter += UE->dlsch[eNB_id][0]->last_iteration_cnt;
|
||||
avg_iter += UE->dlsch[subframe&0x1][eNB_id][0]->last_iteration_cnt;
|
||||
iter_trials++;
|
||||
|
||||
if (n_frames==1)
|
||||
printf("No DLSCH errors found (round %d),uncoded ber %f\n",round,uncoded_ber);
|
||||
|
||||
UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->TBS;
|
||||
UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->TBS;
|
||||
TB0_active = 0;
|
||||
|
||||
|
||||
|
||||
} // DLSCH received ok
|
||||
else {
|
||||
errs[round]++;
|
||||
|
||||
avg_iter += UE->dlsch[eNB_id][0]->last_iteration_cnt-1;
|
||||
avg_iter += UE->dlsch[subframe&0x1][eNB_id][0]->last_iteration_cnt-1;
|
||||
iter_trials++;
|
||||
|
||||
if (n_frames==1) {
|
||||
//if ((n_frames==1) || (SNR>=30)) {
|
||||
printf("DLSCH errors found (round %d), uncoded ber %f\n",round,uncoded_ber);
|
||||
|
||||
for (s=0; s<UE->dlsch[0][0]->harq_processes[0]->C; s++) {
|
||||
if (s<UE->dlsch[0][0]->harq_processes[0]->Cminus)
|
||||
Kr = UE->dlsch[0][0]->harq_processes[0]->Kminus;
|
||||
for (s=0; s<UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->C; s++) {
|
||||
if (s<UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Cminus)
|
||||
Kr = UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kminus;
|
||||
else
|
||||
Kr = UE->dlsch[0][0]->harq_processes[0]->Kplus;
|
||||
Kr = UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kplus;
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
printf("Decoded_output (Segment %d):\n",s);
|
||||
|
||||
for (i=0; i<Kr_bytes; i++)
|
||||
printf("%d : %x (%x)\n",i,UE->dlsch[0][0]->harq_processes[0]->c[s][i],UE->dlsch[0][0]->harq_processes[0]->c[s][i]^eNB->dlsch[0][0]->harq_processes[0]->c[s][i]);
|
||||
printf("%d : %x (%x)\n",i,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->c[s][i],UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->c[s][i]^eNB->dlsch[0][0]->harq_processes[0]->c[s][i]);
|
||||
}
|
||||
|
||||
sprintf(fname,"rxsig0_r%d.m",round);
|
||||
@@ -2594,8 +2624,9 @@ int main(int argc, char **argv)
|
||||
write_output(fname,vname, &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||
sprintf(fname,"rxsigF0_r%d.m",round);
|
||||
sprintf(vname,"rxs0F_r%d",round);
|
||||
|
||||
write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||
sprintf(fname,"rxsig1_r%d.m",round);
|
||||
sprintf(vname,"rxs1_r%d.m",round);
|
||||
@@ -2636,26 +2667,27 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
//pdsch_vars
|
||||
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||
|
||||
dump_dlsch2(UE,eNB_id,subframe,&coded_bits_per_codeword,round, UE->dlsch[subframe&0x1][0][0]->current_harq_pid);
|
||||
|
||||
|
||||
//write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||
//write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
|
||||
//write_output("dlsch_w.m","w",eNB->dlsch[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,4);
|
||||
//write_output("dlsch_w.m","w",UE->dlsch[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0);
|
||||
//write_output("dlsch_w.m","w",UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0);
|
||||
//pdcch_vars
|
||||
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],300*3,1,1);
|
||||
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNB_id]->rxdataF_comp[0],4*300,1,1);
|
||||
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[eNB_id]->llr,2400,1,4);
|
||||
|
||||
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[0][eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[0][eNB_id]->dl_ch_estimates_ext[0],300*3,1,1);
|
||||
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[0][eNB_id]->rxdataF_comp[0],4*300,1,1);
|
||||
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[0][eNB_id]->llr,2400,1,4);
|
||||
|
||||
if (round == 3) exit(-1);
|
||||
}
|
||||
|
||||
// printf("round %d errors %d/%d\n",round,errs[round],trials);
|
||||
|
||||
round++;
|
||||
// UE->dlsch[0][0]->harq_processes[0]->round++;
|
||||
// UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round++;
|
||||
}
|
||||
|
||||
if (xforms==1) {
|
||||
@@ -2696,10 +2728,10 @@ int main(int argc, char **argv)
|
||||
double t_tx_enc = (double)eNB->dlsch_encoding_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
|
||||
|
||||
double t_rx = (double)UE->phy_proc_rx.p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx = (double)UE->phy_proc_rx[subframe&0x1].p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx_fft = (double)UE->ofdm_demod_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx_demod = (double)UE->dlsch_rx_pdcch_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx_dec = (double)UE->dlsch_decoding_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx_dec = (double)UE->dlsch_decoding_stats[subframe&1].p_time/cpu_freq_GHz/1000.0;
|
||||
|
||||
if (t_tx > t_tx_max)
|
||||
t_tx_max = t_tx;
|
||||
@@ -2819,13 +2851,13 @@ int main(int argc, char **argv)
|
||||
double std_phy_proc_rx_demod=0;
|
||||
double std_phy_proc_rx_dec=0;
|
||||
|
||||
effective_rate = ((double)(round_trials[0]-dci_errors)/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3]));
|
||||
effective_rate = 1.0-((double)(errs[0]+errs[1]+errs[2]+errs[3])/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3]));
|
||||
|
||||
printf("\n**********************SNR = %f dB (tx_lev %f)**************************\n",
|
||||
SNR,
|
||||
(double)tx_lev_dB+10*log10(UE->frame_parms.ofdm_symbol_size/(NB_RB*12)));
|
||||
|
||||
printf("Errors (%d(%d)/%d %d/%d %d/%d %d/%d), Pe = (%e,%e,%e,%e), dci_errors %d/%d, Pe = %e => effective rate %f (%2.1f%%,%f, %f), normalized delay %f (%f)\n",
|
||||
printf("Errors (%d(%d)/%d %d/%d %d/%d %d/%d), Pe = (%e,%e,%e,%e), dci_errors %d/%d, Pe = %e => effective rate %f, normalized delay %f (%f)\n",
|
||||
errs[0],
|
||||
errs2[0],
|
||||
round_trials[0],
|
||||
@@ -2839,13 +2871,13 @@ int main(int argc, char **argv)
|
||||
(double)errs[1]/(round_trials[0]),
|
||||
(double)errs[2]/(round_trials[0]),
|
||||
(double)errs[3]/(round_trials[0]),
|
||||
dci_errors,
|
||||
round_trials[0],
|
||||
(double)dci_errors/(round_trials[0]),
|
||||
rate*effective_rate,
|
||||
dci_errors[0]+dci_errors[1]+dci_errors[2]+dci_errors[3],
|
||||
round_trials[0]+round_trials[1]+round_trials[2]+round_trials[3],
|
||||
(double)(dci_errors[0]+dci_errors[1]+dci_errors[2]+dci_errors[3])/(round_trials[0]+round_trials[1]+round_trials[2]+round_trials[3]),
|
||||
//rate*effective_rate,
|
||||
100*effective_rate,
|
||||
rate,
|
||||
rate*get_Qm(UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs),
|
||||
//rate,
|
||||
//rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs),
|
||||
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/
|
||||
(double)eNB->dlsch[0][0]->harq_processes[0]->TBS,
|
||||
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
|
||||
@@ -2885,10 +2917,10 @@ int main(int argc, char **argv)
|
||||
eNB->dlsch_interleaving_stats.diff/eNB->dlsch_interleaving_stats.trials/cpu_freq_GHz/1000.0,eNB->dlsch_interleaving_stats.trials);
|
||||
|
||||
printf("\n\nUE RX function statistics (per 1ms subframe)\n\n");
|
||||
std_phy_proc_rx = sqrt((double)UE->phy_proc_rx.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
|
||||
2)/UE->phy_proc_rx.trials - pow((double)UE->phy_proc_rx.diff/UE->phy_proc_rx.trials/cpu_freq_GHz/1000,2));
|
||||
printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx.diff/UE->phy_proc_rx.trials/cpu_freq_GHz/1000.0,
|
||||
UE->phy_proc_rx.trials*2/3);
|
||||
std_phy_proc_rx = sqrt((double)UE->phy_proc_rx[subframe&0x1].diff_square/pow(cpu_freq_GHz,2)/pow(1000,
|
||||
2)/UE->phy_proc_rx[subframe&0x1].trials - pow((double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000,2));
|
||||
printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000.0,
|
||||
UE->phy_proc_rx[subframe&0x1].trials*2/3);
|
||||
printf("|__Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n", std_phy_proc_rx, t_rx_max, t_rx_min, rx_median,
|
||||
rx_q1, rx_q3, n_rx_dropped);
|
||||
std_phy_proc_rx_fft = sqrt((double)UE->ofdm_demod_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
|
||||
@@ -2912,17 +2944,17 @@ int main(int argc, char **argv)
|
||||
printf("|__ Statistcs std: %fus median %fus q1 %fus q3 %fus \n",std_phy_proc_rx_demod, rx_demod_median, rx_demod_q1, rx_demod_q3);
|
||||
printf("DLSCH unscrambling time :%f us (%d trials)\n",(double)UE->dlsch_unscrambling_stats.diff/UE->dlsch_unscrambling_stats.trials/cpu_freq_GHz/1000.0,
|
||||
UE->dlsch_unscrambling_stats.trials);
|
||||
std_phy_proc_rx_dec = sqrt((double)UE->dlsch_decoding_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
|
||||
2)/UE->dlsch_decoding_stats.trials - pow((double)UE->dlsch_decoding_stats.diff/UE->dlsch_decoding_stats.trials/cpu_freq_GHz/1000,2));
|
||||
std_phy_proc_rx_dec = sqrt((double)UE->dlsch_decoding_stats[subframe&1].diff_square/pow(cpu_freq_GHz,2)/pow(1000,
|
||||
2)/UE->dlsch_decoding_stats[subframe&1].trials - pow((double)UE->dlsch_decoding_stats[subframe&1].diff/UE->dlsch_decoding_stats[subframe&1].trials/cpu_freq_GHz/1000,2));
|
||||
printf("DLSCH Decoding time (%02.2f Mbit/s, avg iter %1.2f) :%f us (%d trials, max %f)\n",
|
||||
eNB->dlsch[0][0]->harq_processes[0]->TBS/1000.0,(double)avg_iter/iter_trials,
|
||||
(double)UE->dlsch_decoding_stats.diff/UE->dlsch_decoding_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_decoding_stats.trials,
|
||||
(double)UE->dlsch_decoding_stats.max/cpu_freq_GHz/1000.0);
|
||||
(double)UE->dlsch_decoding_stats[subframe&1].diff/UE->dlsch_decoding_stats[subframe&1].trials/cpu_freq_GHz/1000.0,UE->dlsch_decoding_stats[subframe&1].trials,
|
||||
(double)UE->dlsch_decoding_stats[subframe&1].max/cpu_freq_GHz/1000.0);
|
||||
printf("|__ Statistcs std: %fus median %fus q1 %fus q3 %fus \n",std_phy_proc_rx_dec, rx_dec_median, rx_dec_q1, rx_dec_q3);
|
||||
printf("|__ DLSCH Rate Unmatching :%f us (%d trials)\n",
|
||||
(double)UE->dlsch_rate_unmatching_stats.diff/UE->dlsch_rate_unmatching_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_rate_unmatching_stats.trials);
|
||||
printf("|__ DLSCH Turbo Decoding(%d bits) :%f us (%d trials)\n",
|
||||
UE->dlsch[0][0]->harq_processes[0]->Cminus ? UE->dlsch[0][0]->harq_processes[0]->Kminus : UE->dlsch[0][0]->harq_processes[0]->Kplus,
|
||||
UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Cminus ? UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kminus : UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kplus,
|
||||
(double)UE->dlsch_turbo_decoding_stats.diff/UE->dlsch_turbo_decoding_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_turbo_decoding_stats.trials);
|
||||
printf(" |__ init %f us (cycles/iter %f, %d trials)\n",
|
||||
(double)UE->dlsch_tc_init_stats.diff/UE->dlsch_tc_init_stats.trials/cpu_freq_GHz/1000.0,
|
||||
@@ -2968,7 +3000,7 @@ int main(int argc, char **argv)
|
||||
round_trials[2],
|
||||
errs[3],
|
||||
round_trials[3],
|
||||
dci_errors);
|
||||
dci_errors[0]);
|
||||
} else {
|
||||
fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n",
|
||||
SNR,
|
||||
@@ -2984,7 +3016,7 @@ int main(int argc, char **argv)
|
||||
round_trials[2],
|
||||
errs[3],
|
||||
round_trials[3],
|
||||
dci_errors);
|
||||
dci_errors[0]);
|
||||
}
|
||||
|
||||
|
||||
@@ -3017,7 +3049,7 @@ int main(int argc, char **argv)
|
||||
round_trials[2],
|
||||
errs[3],
|
||||
round_trials[3],
|
||||
dci_errors);
|
||||
dci_errors[0]);
|
||||
|
||||
//fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n");
|
||||
fprintf(time_meas_fd,"%f;%d;%d;%f; %2.1f%%;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;",
|
||||
@@ -3040,9 +3072,9 @@ int main(int argc, char **argv)
|
||||
(double)errs[1]/(round_trials[0]),
|
||||
(double)errs[2]/(round_trials[0]),
|
||||
(double)errs[3]/(round_trials[0]),
|
||||
dci_errors,
|
||||
dci_errors[0],
|
||||
round_trials[0],
|
||||
(double)dci_errors/(round_trials[0]),
|
||||
(double)dci_errors[0]/(round_trials[0]),
|
||||
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/
|
||||
(double)eNB->dlsch[0][0]->harq_processes[0]->TBS,
|
||||
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
|
||||
@@ -3061,7 +3093,7 @@ int main(int argc, char **argv)
|
||||
round_trials[2],
|
||||
errs[3],
|
||||
round_trials[3],
|
||||
dci_errors);
|
||||
dci_errors[0]);
|
||||
|
||||
//fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n");
|
||||
fprintf(time_meas_fd,"%f;%d;%d;%d;%d;%f;%2.1f;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;",
|
||||
@@ -3085,9 +3117,9 @@ int main(int argc, char **argv)
|
||||
(double)errs[1]/(round_trials[0]),
|
||||
(double)errs[2]/(round_trials[0]),
|
||||
(double)errs[3]/(round_trials[0]),
|
||||
dci_errors,
|
||||
dci_errors[0],
|
||||
round_trials[0],
|
||||
(double)dci_errors/(round_trials[0]),
|
||||
(double)dci_errors[0]/(round_trials[0]),
|
||||
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/
|
||||
(double)eNB->dlsch[0][0]->harq_processes[0]->TBS,
|
||||
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
|
||||
@@ -3100,12 +3132,12 @@ int main(int argc, char **argv)
|
||||
eNB->dlsch_modulation_stats.trials,
|
||||
eNB->dlsch_scrambling_stats.trials,
|
||||
eNB->dlsch_encoding_stats.trials,
|
||||
UE->phy_proc_rx.trials,
|
||||
UE->phy_proc_rx[subframe&0x1].trials,
|
||||
UE->ofdm_demod_stats.trials,
|
||||
UE->dlsch_rx_pdcch_stats.trials,
|
||||
UE->dlsch_llr_stats.trials,
|
||||
UE->dlsch_unscrambling_stats.trials,
|
||||
UE->dlsch_decoding_stats.trials
|
||||
UE->dlsch_decoding_stats[subframe&1].trials
|
||||
);
|
||||
fprintf(time_meas_fd,"%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;",
|
||||
get_time_meas_us(&eNB->phy_proc_tx),
|
||||
@@ -3113,12 +3145,12 @@ int main(int argc, char **argv)
|
||||
get_time_meas_us(&eNB->dlsch_modulation_stats),
|
||||
get_time_meas_us(&eNB->dlsch_scrambling_stats),
|
||||
get_time_meas_us(&eNB->dlsch_encoding_stats),
|
||||
get_time_meas_us(&UE->phy_proc_rx),
|
||||
get_time_meas_us(&UE->phy_proc_rx[subframe&0x1]),
|
||||
nsymb*get_time_meas_us(&UE->ofdm_demod_stats),
|
||||
get_time_meas_us(&UE->dlsch_rx_pdcch_stats),
|
||||
3*get_time_meas_us(&UE->dlsch_llr_stats),
|
||||
get_time_meas_us(&UE->dlsch_unscrambling_stats),
|
||||
get_time_meas_us(&UE->dlsch_decoding_stats)
|
||||
get_time_meas_us(&UE->dlsch_decoding_stats[subframe&1])
|
||||
);
|
||||
//fprintf(time_meas_fd,"eNB_PROC_TX_STD;eNB_PROC_TX_MAX;eNB_PROC_TX_MIN;eNB_PROC_TX_MED;eNB_PROC_TX_Q1;eNB_PROC_TX_Q3;eNB_PROC_TX_DROPPED;\n");
|
||||
fprintf(time_meas_fd,"%f;%f;%f;%f;%f;%f;%d;", std_phy_proc_tx, t_tx_max, t_tx_min, tx_median, tx_q1, tx_q3, n_tx_dropped);
|
||||
@@ -3153,12 +3185,12 @@ int main(int argc, char **argv)
|
||||
eNB->dlsch_modulation_stats.trials,
|
||||
eNB->dlsch_scrambling_stats.trials,
|
||||
eNB->dlsch_encoding_stats.trials,
|
||||
UE->phy_proc_rx.trials,
|
||||
UE->phy_proc_rx[subframe&0x1].trials,
|
||||
UE->ofdm_demod_stats.trials,
|
||||
UE->dlsch_rx_pdcch_stats.trials,
|
||||
UE->dlsch_llr_stats.trials,
|
||||
UE->dlsch_unscrambling_stats.trials,
|
||||
UE->dlsch_decoding_stats.trials);
|
||||
UE->dlsch_decoding_stats[subframe&1].trials);
|
||||
*/
|
||||
printf("[passed] effective rate : %f (%2.1f%%,%f)): log and break \n",rate*effective_rate, 100*effective_rate, rate );
|
||||
break;
|
||||
@@ -3211,7 +3243,7 @@ int main(int argc, char **argv)
|
||||
printf("eNB %d\n",i);
|
||||
free_eNB_dlsch(eNB->dlsch[0][i]);
|
||||
printf("UE %d\n",i);
|
||||
free_ue_dlsch(UE->dlsch[0][i]);
|
||||
free_ue_dlsch(UE->dlsch[subframe&0x1][0][i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,31 +1,23 @@
|
||||
/******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file dlsim.c
|
||||
\brief Top-level DL simulator
|
||||
@@ -961,14 +953,14 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
UE->dlsch[0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
UE->dlsch[subframe&0x1][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
|
||||
if (!UE->dlsch[0][i]) {
|
||||
if (!UE->dlsch[subframe&0x1][0][i]) {
|
||||
printf("Can't get ue dlsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
UE->dlsch[0][i]->rnti = n_rnti;
|
||||
UE->dlsch[subframe&0x1][0][i]->rnti = n_rnti;
|
||||
}
|
||||
|
||||
// structure for SIC at UE
|
||||
@@ -2077,7 +2069,7 @@ int main(int argc, char **argv)
|
||||
reset_meas(&eNB->dlsch_rate_matching_stats);
|
||||
reset_meas(&eNB->dlsch_turbo_encoding_stats);
|
||||
|
||||
reset_meas(&UE->phy_proc_rx); // total UE rx
|
||||
reset_meas(&UE->phy_proc_rx[subframe&0x1]); // total UE rx
|
||||
reset_meas(&UE->ofdm_demod_stats);
|
||||
reset_meas(&UE->dlsch_channel_estimation_stats);
|
||||
reset_meas(&UE->dlsch_freq_offset_estimation_stats);
|
||||
@@ -2120,9 +2112,9 @@ int main(int argc, char **argv)
|
||||
//if (trials%100==0)
|
||||
eNB2UE[0]->first_run = 1;
|
||||
|
||||
ret = UE->dlsch[0][0]->max_turbo_iterations+1;
|
||||
ret = UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations+1;
|
||||
|
||||
while ((round < num_rounds) && (ret > UE->dlsch[0][0]->max_turbo_iterations)) {
|
||||
while ((round < num_rounds) && (ret > UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations)) {
|
||||
//printf("Trial %d, round %d\n",trials,round);
|
||||
round_trials[round]++;
|
||||
|
||||
@@ -2609,7 +2601,7 @@ PMI_FEEDBACK:
|
||||
// use the PMI from previous trial
|
||||
if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) {
|
||||
eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,eNB->frame_parms.N_RB_DL);
|
||||
UE->dlsch[0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
|
||||
UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
|
||||
|
||||
if (n_users>1)
|
||||
eNB->dlsch[1][0]->harq_processes[0]->pmi_alloc = (eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc ^ 0x1555);
|
||||
@@ -3067,7 +3059,7 @@ PMI_FEEDBACK:
|
||||
}
|
||||
|
||||
|
||||
start_meas(&UE->phy_proc_rx);
|
||||
start_meas(&UE->phy_proc_rx[subframe&0x1]);
|
||||
|
||||
// Inner receiver scheduling for 3 slots
|
||||
|
||||
@@ -3235,7 +3227,7 @@ PMI_FEEDBACK:
|
||||
|
||||
for (i=0; i<dci_cnt; i++) {
|
||||
// printf("Generating dlsch parameters for RNTI %x\n",dci_alloc_rx[i].rnti);
|
||||
if (round == 0) UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->first_tx=1;
|
||||
if (round == 0) UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->first_tx=1;
|
||||
|
||||
if ((dci_alloc_rx[i].rnti == n_rnti) &&
|
||||
(generate_ue_dlsch_params_from_dci(0,
|
||||
@@ -3243,7 +3235,7 @@ PMI_FEEDBACK:
|
||||
dci_alloc_rx[i].dci_pdu,
|
||||
dci_alloc_rx[i].rnti,
|
||||
dci_alloc_rx[i].format,
|
||||
UE->dlsch[0],
|
||||
UE->dlsch[subframe&0x1][0],
|
||||
&UE->frame_parms,
|
||||
UE->pdsch_config_dedicated,
|
||||
SI_RNTI,
|
||||
@@ -3252,23 +3244,23 @@ PMI_FEEDBACK:
|
||||
transmission_mode<7?0:transmission_mode))) {
|
||||
//dump_dci(&UE->frame_parms,&dci_alloc_rx[i]);
|
||||
coded_bits_per_codeword = get_G(&eNB->frame_parms,
|
||||
UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->nb_rb,
|
||||
UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->rb_alloc_even,
|
||||
get_Qm(UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs),
|
||||
UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->Nl,
|
||||
UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->nb_rb,
|
||||
UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->rb_alloc_even,
|
||||
get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs),
|
||||
UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->Nl,
|
||||
UE->pdcch_vars[0]->num_pdcch_symbols,
|
||||
0,
|
||||
subframe,
|
||||
(transmission_mode<7?0:transmission_mode));
|
||||
/*if (transmission_mode==7 && common_flag==0)
|
||||
UE->dlsch[0][0]->harq_processes[0]->mimo_mode = TM7; */
|
||||
UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->mimo_mode = TM7; */
|
||||
|
||||
/*
|
||||
rate = (double)dlsch_tbs25[get_I_TBS(UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs)][UE->dlsch[0][0]->nb_rb-1]/(coded_bits_per_codeword);
|
||||
rate*=get_Qm(UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs);
|
||||
rate = (double)dlsch_tbs25[get_I_TBS(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs)][UE->dlsch[subframe&0x1][0][0]->nb_rb-1]/(coded_bits_per_codeword);
|
||||
rate*=get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs);
|
||||
*/
|
||||
printf("num_pdcch_symbols %d, G %d, TBS %d\n",UE->pdcch_vars[0]->num_pdcch_symbols,coded_bits_per_codeword,
|
||||
UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->TBS);
|
||||
UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->TBS);
|
||||
|
||||
dlsch_active = 1;
|
||||
} else {
|
||||
@@ -3296,7 +3288,7 @@ PMI_FEEDBACK:
|
||||
UE->pdcch_vars[0]->crnti = n_rnti;
|
||||
UE->pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols;
|
||||
|
||||
if (round == 0) UE->dlsch[0][0]->harq_processes[0]->first_tx=1;
|
||||
if (round == 0) UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx=1;
|
||||
|
||||
switch (transmission_mode) {
|
||||
case 1:
|
||||
@@ -3307,7 +3299,7 @@ PMI_FEEDBACK:
|
||||
&DLSCH_alloc_pdu_1[0],
|
||||
(common_flag==0)? C_RNTI : SI_RNTI,
|
||||
(common_flag==0)? format1 : format1A,
|
||||
UE->dlsch[0],
|
||||
UE->dlsch[subframe&0x1][0],
|
||||
&UE->frame_parms,
|
||||
UE->pdsch_config_dedicated,
|
||||
SI_RNTI,
|
||||
@@ -3315,24 +3307,24 @@ PMI_FEEDBACK:
|
||||
P_RNTI,
|
||||
transmission_mode<7?0:transmission_mode);
|
||||
/*if(transmission_mode==7 && common_flag==0)
|
||||
UE->dlsch[0][0]->harq_processes[0]->mimo_mode = TM7;*/
|
||||
UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->mimo_mode = TM7;*/
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// printf("Rate: TM3 (before) round %d (%d) first_tx %d\n",round,UE->dlsch[0][0]->harq_processes[0]->round,UE->dlsch[0][0]->harq_processes[0]->first_tx);
|
||||
// printf("Rate: TM3 (before) round %d (%d) first_tx %d\n",round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx);
|
||||
generate_ue_dlsch_params_from_dci(0,
|
||||
subframe,
|
||||
&DLSCH_alloc_pdu_1[0],
|
||||
(common_flag==0)? C_RNTI : SI_RNTI,
|
||||
(common_flag==0)? format2A : format1A,
|
||||
UE->dlsch[0],
|
||||
UE->dlsch[subframe&0x1][0],
|
||||
&UE->frame_parms,
|
||||
UE->pdsch_config_dedicated,
|
||||
SI_RNTI,
|
||||
0,
|
||||
P_RNTI,
|
||||
0);
|
||||
// printf("Rate: TM3 (after) round %d (%d) first_tx %d\n",round,UE->dlsch[0][0]->harq_processes[0]->round,UE->dlsch[0][0]->harq_processes[0]->first_tx);
|
||||
// printf("Rate: TM3 (after) round %d (%d) first_tx %d\n",round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->first_tx);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
@@ -3341,7 +3333,7 @@ PMI_FEEDBACK:
|
||||
&DLSCH_alloc_pdu_1[0],
|
||||
(common_flag==0)? C_RNTI : SI_RNTI,
|
||||
(common_flag==0)? format2 : format1A,
|
||||
UE->dlsch[0],
|
||||
UE->dlsch[subframe&0x1][0],
|
||||
&UE->frame_parms,
|
||||
UE->pdsch_config_dedicated,
|
||||
SI_RNTI,
|
||||
@@ -3357,7 +3349,7 @@ PMI_FEEDBACK:
|
||||
&DLSCH_alloc_pdu2_1E[0],
|
||||
C_RNTI,
|
||||
format1E_2A_M10PRB,
|
||||
UE->dlsch[0],
|
||||
UE->dlsch[subframe&0x1][0],
|
||||
&UE->frame_parms,
|
||||
UE->pdsch_config_dedicated,
|
||||
SI_RNTI,
|
||||
@@ -3389,7 +3381,7 @@ PMI_FEEDBACK:
|
||||
if ((Ns==(1+(2*subframe))) && (l==0)) {// process PDSCH symbols 1,2,3,4,5,(6 Normal Prefix)
|
||||
|
||||
if ((transmission_mode == 5) &&
|
||||
(UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->dl_power_off==0) &&
|
||||
(UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->dl_power_off==0) &&
|
||||
(UE->use_ia_receiver ==1)) {
|
||||
dual_stream_UE = 1;
|
||||
} else {
|
||||
@@ -3412,7 +3404,7 @@ PMI_FEEDBACK:
|
||||
(m==UE->pdcch_vars[0]->num_pdcch_symbols)?1:0,
|
||||
dual_stream_UE,
|
||||
i_mod,
|
||||
UE->dlsch[0][0]->current_harq_pid)==-1) {
|
||||
UE->dlsch[subframe&0x1][0][0]->current_harq_pid)==-1) {
|
||||
dlsch_active = 0;
|
||||
break;
|
||||
}
|
||||
@@ -3438,7 +3430,7 @@ PMI_FEEDBACK:
|
||||
0,
|
||||
dual_stream_UE,
|
||||
i_mod,
|
||||
UE->dlsch[0][0]->current_harq_pid)==-1) {
|
||||
UE->dlsch[subframe&0x1][0][0]->current_harq_pid)==-1) {
|
||||
dlsch_active=0;
|
||||
break;
|
||||
}
|
||||
@@ -3464,7 +3456,7 @@ PMI_FEEDBACK:
|
||||
0,
|
||||
dual_stream_UE,
|
||||
i_mod,
|
||||
UE->dlsch[0][0]->current_harq_pid)==-1) {
|
||||
UE->dlsch[subframe&0x1][0][0]->current_harq_pid)==-1) {
|
||||
dlsch_active=0;
|
||||
break;
|
||||
}
|
||||
@@ -3512,7 +3504,7 @@ PMI_FEEDBACK:
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
|
||||
//pdsch_vars
|
||||
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||
dump_dlsch2(UE,eNB_id,subframe,&coded_bits_per_codeword,round);
|
||||
//dump_dlsch2(UE,eNB_id_i,coded_bits_per_codeword);
|
||||
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||
|
||||
@@ -3542,7 +3534,7 @@ PMI_FEEDBACK:
|
||||
}
|
||||
|
||||
for (int cw=Kmimo-1; cw>=0; cw--) {
|
||||
UE->dlsch[0][cw]->rnti = (common_flag==0) ? n_rnti: SI_RNTI;
|
||||
UE->dlsch[subframe&0x1][0][cw]->rnti = (common_flag==0) ? n_rnti: SI_RNTI;
|
||||
coded_bits_per_codeword = get_G(&eNB->frame_parms,
|
||||
eNB->dlsch[0][cw]->harq_processes[0]->nb_rb,
|
||||
eNB->dlsch[0][cw]->harq_processes[0]->rb_alloc,
|
||||
@@ -3553,7 +3545,7 @@ PMI_FEEDBACK:
|
||||
subframe,
|
||||
(transmission_mode<7?0:transmission_mode));
|
||||
|
||||
UE->dlsch[0][cw]->harq_processes[UE->dlsch[0][cw]->current_harq_pid]->G = coded_bits_per_codeword;
|
||||
UE->dlsch[subframe&0x1][0][cw]->harq_processes[UE->dlsch[subframe&0x1][0][cw]->current_harq_pid]->G = coded_bits_per_codeword;
|
||||
|
||||
|
||||
|
||||
@@ -3577,7 +3569,7 @@ PMI_FEEDBACK:
|
||||
start_meas(&UE->dlsch_unscrambling_stats);
|
||||
dlsch_unscrambling(&UE->frame_parms,
|
||||
0,
|
||||
UE->dlsch[0][cw],
|
||||
UE->dlsch[subframe&0x1][0][cw],
|
||||
coded_bits_per_codeword,
|
||||
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[cw],
|
||||
0,
|
||||
@@ -3588,15 +3580,15 @@ PMI_FEEDBACK:
|
||||
ret = dlsch_decoding(UE,
|
||||
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[cw],
|
||||
&UE->frame_parms,
|
||||
UE->dlsch[0][cw],
|
||||
UE->dlsch[0][cw]->harq_processes[UE->dlsch[0][cw]->current_harq_pid],
|
||||
UE->dlsch[subframe&0x1][0][cw],
|
||||
UE->dlsch[subframe&0x1][0][cw]->harq_processes[UE->dlsch[subframe&0x1][0][cw]->current_harq_pid],
|
||||
subframe,
|
||||
UE->dlsch[0][cw]->current_harq_pid,
|
||||
UE->dlsch[subframe&0x1][0][cw]->current_harq_pid,
|
||||
1,llr8_flag);
|
||||
stop_meas(&UE->dlsch_decoding_stats);
|
||||
|
||||
if (cw==1) {
|
||||
if (ret <= UE->dlsch[0][cw]->max_turbo_iterations) {
|
||||
if (ret <= UE->dlsch[subframe&0x1][0][cw]->max_turbo_iterations) {
|
||||
} else {
|
||||
errs2[round]++;
|
||||
}
|
||||
@@ -3604,10 +3596,10 @@ PMI_FEEDBACK:
|
||||
}
|
||||
|
||||
|
||||
stop_meas(&UE->phy_proc_rx);
|
||||
stop_meas(&UE->phy_proc_rx[subframe&0x1]);
|
||||
|
||||
|
||||
if (ret <= UE->dlsch[0][0]->max_turbo_iterations) {
|
||||
if (ret <= UE->dlsch[subframe&0x1][0][0]->max_turbo_iterations) {
|
||||
|
||||
avg_iter += ret;
|
||||
iter_trials++;
|
||||
@@ -3615,15 +3607,15 @@ PMI_FEEDBACK:
|
||||
if (n_frames==1)
|
||||
printf("No DLSCH errors found (round %d),uncoded ber %f\n",round,uncoded_ber);
|
||||
|
||||
UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->TBS;
|
||||
UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->TBS;
|
||||
TB0_active = 0;
|
||||
|
||||
if (UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->mimo_mode == LARGE_CDD) { //try to decode second stream using SIC
|
||||
if (UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->mimo_mode == LARGE_CDD) { //try to decode second stream using SIC
|
||||
/*
|
||||
for (round = 0 ; round < UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->round ; round++) {
|
||||
for (round = 0 ; round < UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->round ; round++) {
|
||||
// re-encoding of first stream
|
||||
dlsch0_ue_harq = UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid];
|
||||
dlsch0_eNB_harq = UE->dlsch[eNB_id]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid];
|
||||
dlsch0_ue_harq = UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid];
|
||||
dlsch0_eNB_harq = UE->dlsch[subframe&0x1][eNB_id]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid];
|
||||
dlsch0_eNB_harq->mimo_mode = LARGE_CDD;
|
||||
dlsch0_eNB_harq->rb_alloc[0] = dlsch0_ue_harq->rb_alloc_even[0];
|
||||
dlsch0_eNB_harq->nb_rb = dlsch0_ue_harq->nb_rb;
|
||||
@@ -3635,13 +3627,13 @@ PMI_FEEDBACK:
|
||||
dlsch0_eNB_harq->dl_power_off = dlsch0_ue_harq->dl_power_off;
|
||||
dlsch0_eNB_harq->status = dlsch0_ue_harq->status;
|
||||
|
||||
UE->dlsch[eNB_id]->active = UE->dlsch[eNB_id][0]->active;
|
||||
UE->dlsch[eNB_id]->rnti = UE->dlsch[eNB_id][0]->rnti;
|
||||
UE->dlsch[subframe&0x1][eNB_id]->active = UE->dlsch[subframe&0x1][eNB_id][0]->active;
|
||||
UE->dlsch[subframe&0x1][eNB_id]->rnti = UE->dlsch[subframe&0x1][eNB_id][0]->rnti;
|
||||
|
||||
dlsch_encoding(UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->b,
|
||||
dlsch_encoding(UE->dlsch[subframe&0x1][eNB_id][0]->harq_processes[UE->dlsch[subframe&0x1][eNB_id][0]->current_harq_pid]->b,
|
||||
&UE->frame_parms,
|
||||
num_pdcch_symbols,
|
||||
UE->dlsch[0],
|
||||
UE->dlsch[subframe&0x1][0],
|
||||
0,subframe,
|
||||
&UE->dlsch_rate_matching_stats,
|
||||
&UE->dlsch_turbo_encoding_stats,
|
||||
@@ -3668,18 +3660,18 @@ PMI_FEEDBACK:
|
||||
//if ((n_frames==1) || (SNR>=30))
|
||||
printf("DLSCH errors found (round %d), uncoded ber %f\n",round,uncoded_ber);
|
||||
|
||||
for (s=0; s<UE->dlsch[0][0]->harq_processes[0]->C; s++) {
|
||||
if (s<UE->dlsch[0][0]->harq_processes[0]->Cminus)
|
||||
Kr = UE->dlsch[0][0]->harq_processes[0]->Kminus;
|
||||
for (s=0; s<UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->C; s++) {
|
||||
if (s<UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Cminus)
|
||||
Kr = UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kminus;
|
||||
else
|
||||
Kr = UE->dlsch[0][0]->harq_processes[0]->Kplus;
|
||||
Kr = UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kplus;
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
printf("Decoded_output (Segment %d):\n",s);
|
||||
|
||||
for (i=0; i<Kr_bytes; i++)
|
||||
printf("%d : %x (%x)\n",i,UE->dlsch[0][0]->harq_processes[0]->c[s][i],UE->dlsch[0][0]->harq_processes[0]->c[s][i]^eNB->dlsch[0][0]->harq_processes[0]->c[s][i]);
|
||||
printf("%d : %x (%x)\n",i,UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->c[s][i],UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->c[s][i]^eNB->dlsch[0][0]->harq_processes[0]->c[s][i]);
|
||||
}
|
||||
|
||||
sprintf(fname,"rxsig0_r%d.m",round);
|
||||
@@ -3729,12 +3721,12 @@ PMI_FEEDBACK:
|
||||
}
|
||||
|
||||
//pdsch_vars
|
||||
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||
dump_dlsch2(UE,eNB_id,subframe,&coded_bits_per_codeword,round);
|
||||
/*
|
||||
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||
write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
|
||||
write_output("dlsch_w.m","w",eNB->dlsch[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,4);
|
||||
write_output("dlsch_w.m","w",UE->dlsch[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0);
|
||||
write_output("dlsch_w.m","w",UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->w[0],3*(tbs+64),1,0);
|
||||
*/
|
||||
|
||||
if (round == 3) exit(-1);
|
||||
@@ -3743,7 +3735,7 @@ PMI_FEEDBACK:
|
||||
// printf("round %d errors %d/%d\n",round,errs[round],trials);
|
||||
|
||||
round++;
|
||||
// UE->dlsch[0][0]->harq_processes[0]->round++;
|
||||
// UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->round++;
|
||||
}
|
||||
|
||||
if (xforms==1) {
|
||||
@@ -3783,7 +3775,7 @@ PMI_FEEDBACK:
|
||||
double t_tx_enc = (double)eNB->dlsch_encoding_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
|
||||
|
||||
double t_rx = (double)UE->phy_proc_rx.p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx = (double)UE->phy_proc_rx[subframe&0x1].p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx_fft = (double)UE->ofdm_demod_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx_demod = (double)UE->dlsch_rx_pdcch_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
double t_rx_dec = (double)UE->dlsch_decoding_stats.p_time/cpu_freq_GHz/1000.0;
|
||||
@@ -3933,7 +3925,7 @@ PMI_FEEDBACK:
|
||||
rate*effective_rate,
|
||||
100*effective_rate,
|
||||
rate,
|
||||
rate*get_Qm(UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs),
|
||||
rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs),
|
||||
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/
|
||||
(double)eNB->dlsch[0][0]->harq_processes[0]->TBS,
|
||||
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
|
||||
@@ -3972,10 +3964,10 @@ PMI_FEEDBACK:
|
||||
eNB->dlsch_interleaving_stats.diff/eNB->dlsch_interleaving_stats.trials/cpu_freq_GHz/1000.0,eNB->dlsch_interleaving_stats.trials);
|
||||
|
||||
printf("\n\nUE RX function statistics (per 1ms subframe)\n\n");
|
||||
std_phy_proc_rx = sqrt((double)UE->phy_proc_rx.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
|
||||
2)/UE->phy_proc_rx.trials - pow((double)UE->phy_proc_rx.diff/UE->phy_proc_rx.trials/cpu_freq_GHz/1000,2));
|
||||
printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx.diff/UE->phy_proc_rx.trials/cpu_freq_GHz/1000.0,
|
||||
UE->phy_proc_rx.trials*2/3);
|
||||
std_phy_proc_rx = sqrt((double)UE->phy_proc_rx[subframe&0x1].diff_square/pow(cpu_freq_GHz,2)/pow(1000,
|
||||
2)/UE->phy_proc_rx[subframe&0x1].trials - pow((double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000,2));
|
||||
printf("Total PHY proc rx :%f us (%d trials)\n",(double)UE->phy_proc_rx[subframe&0x1].diff/UE->phy_proc_rx[subframe&0x1].trials/cpu_freq_GHz/1000.0,
|
||||
UE->phy_proc_rx[subframe&0x1].trials*2/3);
|
||||
printf("|__Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n", std_phy_proc_rx, t_rx_max, t_rx_min, rx_median,
|
||||
rx_q1, rx_q3, n_rx_dropped);
|
||||
std_phy_proc_rx_fft = sqrt((double)UE->ofdm_demod_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
|
||||
@@ -4009,7 +4001,7 @@ PMI_FEEDBACK:
|
||||
printf("|__ DLSCH Rate Unmatching :%f us (%d trials)\n",
|
||||
(double)UE->dlsch_rate_unmatching_stats.diff/UE->dlsch_rate_unmatching_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_rate_unmatching_stats.trials);
|
||||
printf("|__ DLSCH Turbo Decoding(%d bits) :%f us (%d trials)\n",
|
||||
UE->dlsch[0][0]->harq_processes[0]->Cminus ? UE->dlsch[0][0]->harq_processes[0]->Kminus : UE->dlsch[0][0]->harq_processes[0]->Kplus,
|
||||
UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Cminus ? UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kminus : UE->dlsch[subframe&0x1][0][0]->harq_processes[0]->Kplus,
|
||||
(double)UE->dlsch_turbo_decoding_stats.diff/UE->dlsch_turbo_decoding_stats.trials/cpu_freq_GHz/1000.0,UE->dlsch_turbo_decoding_stats.trials);
|
||||
printf(" |__ init %f us (cycles/iter %f, %d trials)\n",
|
||||
(double)UE->dlsch_tc_init_stats.diff/UE->dlsch_tc_init_stats.trials/cpu_freq_GHz/1000.0,
|
||||
@@ -4187,7 +4179,7 @@ PMI_FEEDBACK:
|
||||
eNB->dlsch_modulation_stats.trials,
|
||||
eNB->dlsch_scrambling_stats.trials,
|
||||
eNB->dlsch_encoding_stats.trials,
|
||||
UE->phy_proc_rx.trials,
|
||||
UE->phy_proc_rx[subframe&0x1].trials,
|
||||
UE->ofdm_demod_stats.trials,
|
||||
UE->dlsch_rx_pdcch_stats.trials,
|
||||
UE->dlsch_llr_stats.trials,
|
||||
@@ -4200,7 +4192,7 @@ PMI_FEEDBACK:
|
||||
get_time_meas_us(&eNB->dlsch_modulation_stats),
|
||||
get_time_meas_us(&eNB->dlsch_scrambling_stats),
|
||||
get_time_meas_us(&eNB->dlsch_encoding_stats),
|
||||
get_time_meas_us(&UE->phy_proc_rx),
|
||||
get_time_meas_us(&UE->phy_proc_rx[subframe&0x1]),
|
||||
nsymb*get_time_meas_us(&UE->ofdm_demod_stats),
|
||||
get_time_meas_us(&UE->dlsch_rx_pdcch_stats),
|
||||
3*get_time_meas_us(&UE->dlsch_llr_stats),
|
||||
@@ -4240,7 +4232,7 @@ PMI_FEEDBACK:
|
||||
eNB->dlsch_modulation_stats.trials,
|
||||
eNB->dlsch_scrambling_stats.trials,
|
||||
eNB->dlsch_encoding_stats.trials,
|
||||
UE->phy_proc_rx.trials,
|
||||
UE->phy_proc_rx[subframe&0x1].trials,
|
||||
UE->ofdm_demod_stats.trials,
|
||||
UE->dlsch_rx_pdcch_stats.trials,
|
||||
UE->dlsch_llr_stats.trials,
|
||||
@@ -4298,7 +4290,7 @@ PMI_FEEDBACK:
|
||||
printf("eNB %d\n",i);
|
||||
free_eNB_dlsch(eNB->dlsch[0][i]);
|
||||
printf("UE %d\n",i);
|
||||
free_ue_dlsch(UE->dlsch[0][i]);
|
||||
free_ue_dlsch(UE->dlsch[subframe&0x1][0][i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
PHY_VARS_eNB *eNB;
|
||||
PHY_VARS_UE *UE;
|
||||
|
||||
double cpuf;
|
||||
|
||||
DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2_1E[2];
|
||||
#define UL_RB_ALLOC 0x1ff;
|
||||
@@ -118,6 +119,8 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
*/
|
||||
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
|
||||
logInit();
|
||||
number_of_cards = 1;
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
PHY_VARS_eNB *eNB,*eNB1,*eNB2;
|
||||
PHY_VARS_UE *UE;
|
||||
|
||||
double cpuf;
|
||||
|
||||
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
||||
|
||||
int32_t *dummybuf[4];
|
||||
@@ -116,6 +118,8 @@ int main(int argc, char **argv)
|
||||
char title[255];
|
||||
#endif
|
||||
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
|
||||
logInit();
|
||||
number_of_cards = 1;
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ PHY_VARS_UE *UE;
|
||||
#define CCCH_RB_ALLOC computeRIV(eNB->frame_parms.N_RB_UL,0,2)
|
||||
#define DLSCH_RB_ALLOC ((uint16_t)0x1fbf) // igore DC component,RB13
|
||||
|
||||
double cpuf;
|
||||
|
||||
DCI_PDU DCI_pdu;
|
||||
|
||||
@@ -457,6 +458,8 @@ int main(int argc, char **argv)
|
||||
|
||||
number_of_cards = 1;
|
||||
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
|
||||
logInit();
|
||||
|
||||
|
||||
@@ -650,6 +653,7 @@ int main(int argc, char **argv)
|
||||
printf("-h This message\n");
|
||||
printf("-a Use AWGN channel and not multipath\n");
|
||||
printf("-c TDD config\n");
|
||||
printf("-S Subframe number (0..9)\n");
|
||||
printf("-R N_RB_DL\n");
|
||||
printf("-F use FDD frame\n");
|
||||
printf("-p Use extended prefix mode\n");
|
||||
@@ -1085,12 +1089,10 @@ int main(int argc, char **argv)
|
||||
// write_output("H00.m","h00",&(UE->common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||
|
||||
// do PDCCH procedures here
|
||||
UE->pdcch_vars[0]->crnti = n_rnti;
|
||||
UE->pdcch_vars[0][0]->crnti = n_rnti;
|
||||
|
||||
// printf("Doing RX : num_pdcch_symbols at TX %d\n",num_pdcch_symbols);
|
||||
rx_pdcch(&UE->common_vars,
|
||||
UE->pdcch_vars,
|
||||
&UE->frame_parms,
|
||||
rx_pdcch(UE,
|
||||
trial,
|
||||
subframe,
|
||||
0,
|
||||
@@ -1118,7 +1120,7 @@ int main(int argc, char **argv)
|
||||
dl_rx=0;
|
||||
|
||||
if (n_frames==1) {
|
||||
numCCE = get_nCCE(UE->pdcch_vars[0]->num_pdcch_symbols, &UE->frame_parms, get_mi(&UE->frame_parms,subframe));
|
||||
numCCE = get_nCCE(UE->pdcch_vars[0][0]->num_pdcch_symbols, &UE->frame_parms, get_mi(&UE->frame_parms,subframe));
|
||||
|
||||
for (i = 0; i < dci_cnt; i++)
|
||||
printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i, dci_alloc_rx[i].rnti, dci_alloc_rx[i].format,
|
||||
@@ -1167,7 +1169,7 @@ int main(int argc, char **argv)
|
||||
// exit(-1);
|
||||
}
|
||||
|
||||
if (UE->pdcch_vars[0]->num_pdcch_symbols != num_pdcch_symbols)
|
||||
if (UE->pdcch_vars[0][0]->num_pdcch_symbols != num_pdcch_symbols)
|
||||
n_errors_cfi++;
|
||||
|
||||
/*
|
||||
@@ -1224,9 +1226,9 @@ int main(int argc, char **argv)
|
||||
if (n_tx==2)
|
||||
write_output("H10.m","h10",&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||
|
||||
write_output("pdcch_rxF_ext0.m","pdcch_rxF_ext0",UE->pdcch_vars[eNb_id]->rxdataF_ext[0],3*12*UE->frame_parms.N_RB_DL,1,1);
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNb_id]->rxdataF_comp[0],4*12*UE->frame_parms.N_RB_DL,1,1);
|
||||
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[eNb_id]->llr,2400,1,4);
|
||||
write_output("pdcch_rxF_ext0.m","pdcch_rxF_ext0",UE->pdcch_vars[0][eNb_id]->rxdataF_ext[0],3*12*UE->frame_parms.N_RB_DL,1,1);
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[0][eNb_id]->rxdataF_comp[0],4*12*UE->frame_parms.N_RB_DL,1,1);
|
||||
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[0][eNb_id]->llr,2400,1,4);
|
||||
}
|
||||
|
||||
lte_sync_time_free();
|
||||
|
||||
@@ -45,7 +45,7 @@ PHY_VARS_UE *UE;
|
||||
|
||||
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
||||
|
||||
|
||||
double cpuf;
|
||||
|
||||
extern uint16_t prach_root_sequence_map0_3[838];
|
||||
|
||||
@@ -99,6 +99,8 @@ int main(int argc, char **argv)
|
||||
int NCS_config = 1,rootSequenceIndex=0;
|
||||
int threequarter_fs = 0;
|
||||
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
|
||||
logInit();
|
||||
|
||||
number_of_cards = 1;
|
||||
|
||||
@@ -47,7 +47,7 @@ PHY_VARS_UE *UE;
|
||||
|
||||
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
||||
|
||||
|
||||
double cpuf;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@@ -85,11 +85,13 @@ int main(int argc, char **argv)
|
||||
|
||||
// double pucch_sinr;
|
||||
uint8_t osf=1,N_RB_DL=25;
|
||||
uint32_t pucch_tx=0,pucch1_missed=0,pucch1_false=0,sig;
|
||||
uint32_t pucch_tx=0,pucch1_missed=0,pucch1_false=0,pucch3_false=0,sig;
|
||||
PUCCH_FMT_t pucch_format = pucch_format1;
|
||||
PUCCH_CONFIG_DEDICATED pucch_config_dedicated;
|
||||
uint8_t subframe=0;
|
||||
uint8_t pucch_payload,pucch_payload_rx;
|
||||
uint8_t pucch3_payload_size=7;
|
||||
uint8_t pucch3_payload[21],pucch3_payload_rx[21];
|
||||
double tx_gain=1.0;
|
||||
int32_t stat;
|
||||
double stat_no_sig,stat_sig;
|
||||
@@ -98,9 +100,14 @@ int main(int argc, char **argv)
|
||||
|
||||
uint16_t n1_pucch = 0;
|
||||
uint16_t n2_pucch = 0;
|
||||
uint16_t n3_pucch = 20;
|
||||
|
||||
uint16_t n_rnti=0x1234;
|
||||
|
||||
number_of_cards = 1;
|
||||
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
|
||||
while ((c = getopt (argc, argv, "har:pf:g:n:s:S:x:y:z:N:F:T:R:")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
@@ -116,6 +123,8 @@ int main(int argc, char **argv)
|
||||
pucch_format = pucch_format1a;
|
||||
else if (atoi(optarg)==2)
|
||||
pucch_format = pucch_format1b;
|
||||
else if (atoi(optarg)==6) // 3,4,5 is reserved for format2,2a,2b
|
||||
pucch_format = pucch_format3;
|
||||
else {
|
||||
printf("Unsupported pucch_format %d\n",atoi(optarg));
|
||||
exit(-1);
|
||||
@@ -280,7 +289,7 @@ int main(int argc, char **argv)
|
||||
printf("-N Noise variance in dB\n");
|
||||
printf("-R N_RB_DL\n");
|
||||
printf("-O oversampling factor (1,2,4,8,16)\n");
|
||||
printf("-f PUCCH format (0=1,1=1a,2=1b), formats 2/2a/2b not supported\n");
|
||||
printf("-f PUCCH format (0=1,1=1a,2=1b,6=3), formats 2/2a/2b not supported\n");
|
||||
printf("-F Input filename (.txt format) for RX conformance testing\n");
|
||||
exit (-1);
|
||||
break;
|
||||
@@ -360,18 +369,34 @@ int main(int argc, char **argv)
|
||||
UE->frame_parms.pucch_config_common.nRB_CQI = 4;
|
||||
UE->frame_parms.pucch_config_common.nCS_AN = 6;
|
||||
|
||||
pucch_payload = 0;
|
||||
|
||||
generate_pucch1x(UE->common_vars.txdataF,
|
||||
frame_parms,
|
||||
UE->ncs_cell,
|
||||
pucch_format,
|
||||
&pucch_config_dedicated,
|
||||
n1_pucch,
|
||||
0, //shortened_format,
|
||||
&pucch_payload,
|
||||
AMP, //amp,
|
||||
subframe); //subframe
|
||||
if( (pucch_format == pucch_format1) || (pucch_format == pucch_format1a) || (pucch_format == pucch_format1b) ){
|
||||
pucch_payload = 0;
|
||||
generate_pucch1x(UE->common_vars.txdataF,
|
||||
frame_parms,
|
||||
UE->ncs_cell,
|
||||
pucch_format,
|
||||
&pucch_config_dedicated,
|
||||
n1_pucch,
|
||||
0, //shortened_format,
|
||||
&pucch_payload,
|
||||
AMP, //amp,
|
||||
subframe); //subframe
|
||||
}else if( pucch_format == pucch_format3){
|
||||
for(i=0;i<pucch3_payload_size;i++)
|
||||
pucch3_payload[i]=(uint8_t)(taus()&0x1);
|
||||
generate_pucch3x(UE->common_vars.txdataF,
|
||||
frame_parms,
|
||||
UE->ncs_cell,
|
||||
pucch_format,
|
||||
&pucch_config_dedicated,
|
||||
n3_pucch,
|
||||
0, //shortened_format,
|
||||
pucch3_payload,
|
||||
AMP, //amp,
|
||||
subframe, //subframe
|
||||
n_rnti); //rnti
|
||||
}
|
||||
write_output("txsigF0.m","txsF0", &UE->common_vars.txdataF[0][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*nsymb,1,1);
|
||||
|
||||
tx_lev = 0;
|
||||
@@ -427,6 +452,7 @@ int main(int argc, char **argv)
|
||||
pucch_tx = 0;
|
||||
pucch1_missed=0;
|
||||
pucch1_false=0;
|
||||
pucch3_false=0;
|
||||
|
||||
stat_no_sig = 0;
|
||||
stat_sig = 0;
|
||||
@@ -538,7 +564,7 @@ int main(int argc, char **argv)
|
||||
n1_pucch,
|
||||
n2_pucch,
|
||||
0, //shortened_format,
|
||||
&pucch_payload_rx, //payload,
|
||||
(pucch_format==pucch_format3) ? pucch3_payload_rx : &pucch_payload_rx, //payload,
|
||||
0 /* frame not defined, let's pass 0 */,
|
||||
subframe,
|
||||
pucch1_thres);
|
||||
@@ -559,8 +585,15 @@ int main(int argc, char **argv)
|
||||
printf("EXIT\n");
|
||||
exit(-1);
|
||||
}*/
|
||||
} else {
|
||||
} else if( (pucch_format==pucch_format1a) || (pucch_format==pucch_format1b) ) {
|
||||
pucch1_false = (pucch_payload_rx != pucch_payload) ? (pucch1_false+1) : pucch1_false;
|
||||
} else if (pucch_format==pucch_format3){
|
||||
for(i=0;i<pucch3_payload_size;i++){
|
||||
if(pucch3_payload[i]!=pucch3_payload_rx[i]){
|
||||
pucch3_false = (pucch3_false+1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// printf("sig %d\n",sig);
|
||||
@@ -574,7 +607,8 @@ int main(int argc, char **argv)
|
||||
printf("pucch_trials %d : pucch1a_errors %d\n",pucch_tx,pucch1_false);
|
||||
else if (pucch_format==pucch_format1b)
|
||||
printf("pucch_trials %d : pucch1b_errors %d\n",pucch_tx,pucch1_false);
|
||||
|
||||
else if (pucch_format==pucch_format3)
|
||||
printf("pucch_trials %d : pucch3_errors %d\n",pucch_tx,pucch3_false);
|
||||
}
|
||||
|
||||
if (n_frames==1) {
|
||||
|
||||
@@ -406,7 +406,7 @@ int main(int argc, char **argv)
|
||||
|
||||
DCI_ALLOC_t dci_alloc[8],dci_alloc_rx[8];
|
||||
uint16_t n_rnti=1234,dci_cnt;
|
||||
uint16_t coded_bits_per_codeword;
|
||||
unsigned int coded_bits_per_codeword;
|
||||
double tmp_re,tmp_im,foff,deltaF=0.0,cs,sn;
|
||||
uint32_t carrier_freq[4]= {1907600000,1907600000,1907600000,1907600000};
|
||||
uint32_t rf_mode[4] = {55759,55759,55759,55759};
|
||||
@@ -1739,7 +1739,7 @@ int main(int argc, char **argv)
|
||||
PHY_vars_UE[0]->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
|
||||
0);
|
||||
|
||||
dump_dlsch2(PHY_vars_UE[0],0,0,coded_bits_per_codeword);
|
||||
dump_dlsch2(PHY_vars_UE[0],0,0,&coded_bits_per_codeword);
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "SCHED/vars.h"
|
||||
#include "LAYER2/MAC/vars.h"
|
||||
#include "OCG_vars.h"
|
||||
#include "intertask_interface_init.h"
|
||||
|
||||
#include "unitary_defs.h"
|
||||
|
||||
@@ -50,6 +51,7 @@
|
||||
PHY_VARS_eNB *eNB;
|
||||
PHY_VARS_UE *UE;
|
||||
|
||||
double cpuf;
|
||||
|
||||
|
||||
|
||||
@@ -162,8 +164,8 @@ void fill_ulsch_dci(PHY_VARS_eNB *eNB,void *UL_dci,int first_rb,int nb_rb,int mc
|
||||
|
||||
}
|
||||
|
||||
extern void eNB_fep_full(PHY_VARS_eNB *eNB);
|
||||
extern void eNB_fep_full_2thread(PHY_VARS_eNB *eNB);
|
||||
extern void eNB_fep_full(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
|
||||
extern void eNB_fep_full_2thread(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@@ -195,7 +197,7 @@ int main(int argc, char **argv)
|
||||
int chMod = 0 ;
|
||||
int UE_id = 0;
|
||||
unsigned char nb_rb=25,first_rb=0,mcs=0,round=0,bundling_flag=1;
|
||||
unsigned char l;
|
||||
//unsigned char l;
|
||||
|
||||
unsigned char awgn_flag = 0 ;
|
||||
SCM_t channel_model=Rice1;
|
||||
@@ -244,14 +246,14 @@ int main(int argc, char **argv)
|
||||
int hold_channel=0;
|
||||
channel_desc_t *UE2eNB;
|
||||
|
||||
uint8_t control_only_flag = 0;
|
||||
//uint8_t control_only_flag = 0;
|
||||
int delay = 0;
|
||||
double maxDoppler = 0.0;
|
||||
uint8_t srs_flag = 0;
|
||||
|
||||
uint8_t N_RB_DL=25,osf=1;
|
||||
|
||||
uint8_t cyclic_shift = 0;
|
||||
//uint8_t cyclic_shift = 0;
|
||||
uint8_t cooperation_flag = 0; //0 no cooperation, 1 delay diversity, 2 Alamouti
|
||||
uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
|
||||
uint8_t tdd_config=3,frame_type=FDD;
|
||||
@@ -273,6 +275,7 @@ int main(int argc, char **argv)
|
||||
uint8_t max_turbo_iterations=4;
|
||||
uint8_t parallel_flag=0;
|
||||
int nb_rb_set = 0;
|
||||
int sf;
|
||||
|
||||
int threequarter_fs=0;
|
||||
int ndi;
|
||||
@@ -280,11 +283,19 @@ int main(int argc, char **argv)
|
||||
opp_enabled=1; // to enable the time meas
|
||||
|
||||
cpu_freq_GHz = (double)get_cpu_freq_GHz();
|
||||
cpuf = cpu_freq_GHz;
|
||||
|
||||
printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz);
|
||||
|
||||
|
||||
logInit();
|
||||
/*
|
||||
// enable these lines if you need debug info
|
||||
// however itti will catch all signals, so ctrl-c won't work anymore
|
||||
// alternatively you can disable ITTI completely in CMakeLists.txt
|
||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
|
||||
set_comp_log(PHY,LOG_DEBUG,LOG_MED,1);
|
||||
set_glog(LOG_DEBUG,LOG_MED);
|
||||
*/
|
||||
|
||||
while ((c = getopt (argc, argv, "hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:LF")) != -1) {
|
||||
switch (c) {
|
||||
@@ -452,9 +463,9 @@ int main(int argc, char **argv)
|
||||
first_rb = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
cyclic_shift = atoi(optarg);
|
||||
break;
|
||||
//case 'c':
|
||||
// cyclic_shift = atoi(optarg);
|
||||
// break;
|
||||
|
||||
case 'E':
|
||||
threequarter_fs=1;
|
||||
@@ -546,7 +557,9 @@ int main(int argc, char **argv)
|
||||
|
||||
case 'h':
|
||||
default:
|
||||
printf("%s -h(elp) -a(wgn on) -m mcs -n n_frames -s snr0 -t delay_spread -p (extended prefix on) -r nb_rb -f first_rb -c cyclic_shift -o (srs on) -g channel_model [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M'), -d Channel delay, -D maximum Doppler shift \n",
|
||||
/* option "-c cyclic_shift" is not used, let's remove from documentation */
|
||||
//printf("%s -h(elp) -a(wgn on) -m mcs -n n_frames -s snr0 -t delay_spread -p (extended prefix on) -r nb_rb -f first_rb -c cyclic_shift -o (srs on) -g channel_model [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M'), -d Channel delay, -D maximum Doppler shift \n",
|
||||
printf("%s -h(elp) -a(wgn on) -m mcs -n n_frames -s snr0 -t delay_spread -p (extended prefix on) -r nb_rb -f first_rb -o (srs on) -g channel_model [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M'), -d Channel delay, -D maximum Doppler shift \n",
|
||||
argv[0]);
|
||||
exit(1);
|
||||
break;
|
||||
@@ -566,6 +579,11 @@ int main(int argc, char **argv)
|
||||
osf,
|
||||
0);
|
||||
|
||||
// for a call to phy_reset_ue later we need PHY_vars_UE_g allocated and pointing to UE
|
||||
PHY_vars_UE_g = (PHY_VARS_UE***)malloc(sizeof(PHY_VARS_UE**));
|
||||
PHY_vars_UE_g[0] = (PHY_VARS_UE**) malloc(sizeof(PHY_VARS_UE*));
|
||||
PHY_vars_UE_g[0][0] = UE;
|
||||
|
||||
if (nb_rb_set == 0)
|
||||
nb_rb = eNB->frame_parms.N_RB_UL;
|
||||
|
||||
@@ -580,8 +598,6 @@ int main(int argc, char **argv)
|
||||
|
||||
txdata = UE->common_vars.txdata;
|
||||
|
||||
|
||||
|
||||
nsymb = (eNB->frame_parms.Ncp == NORMAL) ? 14 : 12;
|
||||
|
||||
|
||||
@@ -630,23 +646,31 @@ int main(int argc, char **argv)
|
||||
fl_show_form (form_enb->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
}
|
||||
|
||||
UE->pdcch_vars[0]->crnti = 14;
|
||||
UE->pdcch_vars[0][0]->crnti = 14;
|
||||
|
||||
UE->frame_parms.soundingrs_ul_config_common.enabled_flag = srs_flag;
|
||||
UE->frame_parms.soundingrs_ul_config_common.srs_BandwidthConfig = 2;
|
||||
UE->frame_parms.soundingrs_ul_config_common.srs_SubframeConfig = 7;
|
||||
UE->frame_parms.soundingrs_ul_config_common.srs_SubframeConfig = 3;
|
||||
UE->soundingrs_ul_config_dedicated[eNB_id].srsConfigDedicatedSetup = srs_flag;
|
||||
UE->soundingrs_ul_config_dedicated[eNB_id].duration = 1;
|
||||
UE->soundingrs_ul_config_dedicated[eNB_id].srs_ConfigIndex = 2;
|
||||
UE->soundingrs_ul_config_dedicated[eNB_id].srs_Bandwidth = 0;
|
||||
UE->soundingrs_ul_config_dedicated[eNB_id].transmissionComb = 0;
|
||||
UE->soundingrs_ul_config_dedicated[eNB_id].freqDomainPosition = 0;
|
||||
UE->soundingrs_ul_config_dedicated[eNB_id].cyclicShift = 0;
|
||||
|
||||
eNB->frame_parms.soundingrs_ul_config_common.enabled_flag = srs_flag;
|
||||
eNB->frame_parms.soundingrs_ul_config_common.srs_BandwidthConfig = 2;
|
||||
eNB->frame_parms.soundingrs_ul_config_common.srs_SubframeConfig = 7;
|
||||
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex = 1;
|
||||
eNB->frame_parms.soundingrs_ul_config_common.srs_SubframeConfig = 3;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].srsConfigDedicatedSetup = srs_flag;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].duration = 1;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex = 2;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].srs_Bandwidth = 0;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].transmissionComb = 0;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].freqDomainPosition = 0;
|
||||
eNB->soundingrs_ul_config_dedicated[UE_id].cyclicShift = 0;
|
||||
|
||||
eNB->cooperation_flag = cooperation_flag;
|
||||
// eNB->eNB_UE_stats[0].SRS_parameters = UE->SRS_parameters;
|
||||
|
||||
eNB->pusch_config_dedicated[UE_id].betaOffset_ACK_Index = beta_ACK;
|
||||
eNB->pusch_config_dedicated[UE_id].betaOffset_RI_Index = beta_RI;
|
||||
@@ -657,6 +681,11 @@ int main(int argc, char **argv)
|
||||
|
||||
UE->ul_power_control_dedicated[eNB_id].deltaMCS_Enabled = 1;
|
||||
|
||||
// disable periodic cqi/ri reporting
|
||||
UE->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = -1;
|
||||
UE->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = -1;
|
||||
|
||||
|
||||
printf("PUSCH Beta : ACK %f, RI %f, CQI %f\n",(double)beta_ack[beta_ACK]/8,(double)beta_ri[beta_RI]/8,(double)beta_cqi[beta_CQI]/8);
|
||||
|
||||
UE2eNB = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx,
|
||||
@@ -675,31 +704,38 @@ int main(int argc, char **argv)
|
||||
UE->ulsch[0] = new_ue_ulsch(N_RB_DL,0);
|
||||
|
||||
if (parallel_flag == 1) {
|
||||
extern void init_fep_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_td_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
init_fep_thread(eNB,NULL);
|
||||
init_td_thread(eNB,NULL);
|
||||
}
|
||||
// Create transport channel structures for 2 transport blocks (MIMO)
|
||||
for (i=0; i<2; i++) {
|
||||
eNB->dlsch[0][i] = new_eNB_dlsch(1,8,1827072,N_RB_DL,0,&eNB->frame_parms);
|
||||
UE->dlsch[0][i] = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
|
||||
if (!eNB->dlsch[0][i]) {
|
||||
printf("Can't get eNB dlsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (!UE->dlsch[0][i]) {
|
||||
printf("Can't get ue dlsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
eNB->dlsch[0][i]->rnti = 14;
|
||||
UE->dlsch[0][i]->rnti = 14;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/* allocate memory for both subframes (only one is really used
|
||||
* but there is now "copy_harq_proc_struct" which needs both
|
||||
* to be valid)
|
||||
* TODO: refine this somehow (necessary?)
|
||||
*/
|
||||
for (sf = 0; sf < 2; sf++) {
|
||||
for (i=0; i<2; i++) {
|
||||
UE->dlsch[sf][0][i] = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
if (!UE->dlsch[sf][0][i]) {
|
||||
printf("Can't get ue dlsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
UE->dlsch[sf][0][i]->rnti = 14;
|
||||
}
|
||||
}
|
||||
|
||||
UE->dlsch_SI[0] = new_ue_dlsch(1,1,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
UE->dlsch_ra[0] = new_ue_dlsch(1,1,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
|
||||
UE->measurements.rank[0] = 0;
|
||||
UE->transmission_mode[0] = 2;
|
||||
@@ -735,7 +771,7 @@ int main(int argc, char **argv)
|
||||
init_ul_hopping(&eNB->frame_parms);
|
||||
|
||||
|
||||
UE->dlsch[0][0]->harq_ack[ul_subframe2pdcch_alloc_subframe(&eNB->frame_parms,subframe)].send_harq_status = 1;
|
||||
UE->dlsch[subframe&1][0][0]->harq_ack[ul_subframe2pdcch_alloc_subframe(&eNB->frame_parms,subframe)].send_harq_status = 1;
|
||||
|
||||
UE->ulsch_Msg3_active[eNB_id] = 0;
|
||||
UE->ul_power_control_dedicated[eNB_id].accumulationEnabled=1;
|
||||
@@ -841,6 +877,7 @@ int main(int argc, char **argv)
|
||||
|
||||
while (!feof(input_fdUL)) {
|
||||
ret=fscanf(input_fdUL,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
|
||||
if (ret != 2) printf("ERROR: error reading file\n");
|
||||
|
||||
if ((i%4)==0) {
|
||||
((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
|
||||
@@ -915,6 +952,10 @@ int main(int argc, char **argv)
|
||||
initialize(&time_vector_rx_dec);
|
||||
|
||||
ndi=0;
|
||||
|
||||
phy_reset_ue(0,0,0);
|
||||
UE->UE_mode[eNB_id]=PUSCH;
|
||||
|
||||
for (trials = 0; trials<n_frames; trials++) {
|
||||
// printf("*");
|
||||
// UE->frame++;
|
||||
|
||||
@@ -115,7 +115,7 @@ int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
|
||||
|
||||
start_meas(&desc->interp_freq);
|
||||
|
||||
for (f=-n_samples_max/2,f2=-n_samples/2; f<=n_samples_max/2; f+=d,f2++) {
|
||||
for (f=-n_samples_max/2,f2=-n_samples/2; f<n_samples_max/2; f+=d,f2++) {
|
||||
clut = cos_lut[n_samples_max/2+f];
|
||||
slut = sin_lut[n_samples_max/2+f];
|
||||
|
||||
@@ -318,3 +318,4 @@ double pbch_bler(double sinr)
|
||||
return(bler);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,16 @@ typedef enum {
|
||||
Rice1,
|
||||
Rice1_corr,
|
||||
Rice1_anticorr,
|
||||
AWGN
|
||||
AWGN,
|
||||
Rayleigh1_orthogonal,
|
||||
Rayleigh1_orth_eff_ch_TM4_prec_real,
|
||||
Rayleigh1_orth_eff_ch_TM4_prec_imag,
|
||||
Rayleigh8_orth_eff_ch_TM4_prec_real,
|
||||
Rayleigh8_orth_eff_ch_TM4_prec_imag,
|
||||
TS_SHIFT,
|
||||
EPA_low,
|
||||
EPA_medium,
|
||||
EPA_high,
|
||||
} SCM_t;
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,13 +39,41 @@ static unsigned int seed, iy, ir[98];
|
||||
#define a 1664525lu
|
||||
#define mod 4294967296.0 /* is 2**32 */
|
||||
|
||||
#if 1
|
||||
void randominit(unsigned seed_init)
|
||||
{
|
||||
int i;
|
||||
// this need to be integrated with the existing rng, like taus: navid
|
||||
printf("Initializing random number generator, seed %x\n",seed_init);
|
||||
|
||||
if (seed_init == 0) {
|
||||
srand((unsigned)time(NULL));
|
||||
|
||||
seed = (unsigned int) rand();
|
||||
} else {
|
||||
seed = seed_init;
|
||||
}
|
||||
|
||||
if (seed % 2 == 0) seed += 1; /* seed and mod are relative prime */
|
||||
|
||||
for (i=1; i<=97; i++) {
|
||||
seed = a*seed; /* mod 2**32 */
|
||||
ir[i]= seed; /* initialize the shuffle table */
|
||||
}
|
||||
|
||||
iy=1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
void randominit(unsigned seed_init)
|
||||
{
|
||||
int i;
|
||||
// this need to be integrated with the existing rng, like taus: navid
|
||||
LOG_D(PHY,"Initializing random number generator, seed %x\n",seed_init);
|
||||
|
||||
seed_init = 62110;
|
||||
|
||||
if (seed_init == 0) {
|
||||
srand((unsigned)time(NULL));
|
||||
|
||||
@@ -63,7 +91,7 @@ void randominit(unsigned seed_init)
|
||||
|
||||
iy=1;
|
||||
}
|
||||
|
||||
#endif
|
||||
/*!\brief Uniform linear congruential random number generator on \f$[0,1)\f$. Returns a double-precision floating-point number.*/
|
||||
|
||||
double uniformrandom(void)
|
||||
|
||||
@@ -19,86 +19,124 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifdef USER_MODE
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <asm/io.h>
|
||||
#include <asm/rtai.h>
|
||||
#endif
|
||||
#ifdef RTAI_ENABLED
|
||||
#include <rtai.h>
|
||||
#include <rtai_sched.h>
|
||||
#define time(x) (unsigned int)(rt_get_time_ns())
|
||||
#endif
|
||||
|
||||
unsigned int s0, s1, s2, b;
|
||||
|
||||
//----------------------------------------------
|
||||
//
|
||||
/*!
|
||||
*/
|
||||
//
|
||||
|
||||
unsigned int taus(void)
|
||||
{
|
||||
|
||||
b = (((s0 << 13) ^ s0) >> 19);
|
||||
s0 = (((s0 & 0xFFFFFFFE) << 12)^ b);
|
||||
b = (((s1 << 2) ^ s1) >> 25);
|
||||
s1 = (((s1 & 0xFFFFFFF8) << 4)^ b);
|
||||
b = (((s2 << 3) ^ s2) >> 11);
|
||||
s2 = (((s2 & 0xFFFFFFF0) << 17)^ b);
|
||||
return s0 ^ s1 ^ s2;
|
||||
}
|
||||
|
||||
void set_taus_seed(unsigned int seed_init)
|
||||
{
|
||||
|
||||
#ifdef USER_MODE
|
||||
struct drand48_data buffer;
|
||||
unsigned long result = 0;
|
||||
#endif
|
||||
|
||||
if (seed_init == 0) {
|
||||
s0 = (unsigned int)time(NULL);
|
||||
s1 = (unsigned int)time(NULL);
|
||||
s2 = (unsigned int)time(NULL);
|
||||
} else {
|
||||
#ifndef USER_MODE
|
||||
s0 = (unsigned int)0x1e23d852;
|
||||
s1 = (unsigned int)0x81f38a1c;
|
||||
s2 = (unsigned int)0xfe1a133e;
|
||||
#else
|
||||
/* Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
|
||||
srand48_r((long int)seed_init, &buffer);
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s0 = result;
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s1 = result;
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s2 = result;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MAIN
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
unsigned int i,rand;
|
||||
|
||||
set_taus_seed();
|
||||
|
||||
for (i=0; i<10; i++) {
|
||||
|
||||
rand = taus();
|
||||
printf("%u\n",rand);
|
||||
|
||||
}
|
||||
}
|
||||
#endif //MAIN
|
||||
|
||||
|
||||
|
||||
#ifdef USER_MODE
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <asm/io.h>
|
||||
#include <asm/rtai.h>
|
||||
#endif
|
||||
#ifdef RTAI_ENABLED
|
||||
#include <rtai.h>
|
||||
#include <rtai_sched.h>
|
||||
#define time(x) (unsigned int)(rt_get_time_ns())
|
||||
#endif
|
||||
|
||||
unsigned int s0, s1, s2, b;
|
||||
|
||||
//----------------------------------------------
|
||||
//
|
||||
/*!
|
||||
*/
|
||||
//
|
||||
|
||||
unsigned int taus(void)
|
||||
{
|
||||
|
||||
b = (((s0 << 13) ^ s0) >> 19);
|
||||
s0 = (((s0 & 0xFFFFFFFE) << 12)^ b);
|
||||
b = (((s1 << 2) ^ s1) >> 25);
|
||||
s1 = (((s1 & 0xFFFFFFF8) << 4)^ b);
|
||||
b = (((s2 << 3) ^ s2) >> 11);
|
||||
s2 = (((s2 & 0xFFFFFFF0) << 17)^ b);
|
||||
return s0 ^ s1 ^ s2;
|
||||
}
|
||||
#if 1
|
||||
void set_taus_seed(unsigned int seed_init)
|
||||
{
|
||||
|
||||
#ifdef USER_MODE
|
||||
struct drand48_data buffer;
|
||||
unsigned long result = 0;
|
||||
#endif
|
||||
|
||||
if (seed_init == 0) {
|
||||
s0 = (unsigned int)time(NULL);
|
||||
s1 = (unsigned int)time(NULL);
|
||||
s2 = (unsigned int)time(NULL);
|
||||
} else {
|
||||
#ifndef USER_MODE
|
||||
s0 = (unsigned int)0x1e23d852;
|
||||
s1 = (unsigned int)0x81f38a1c;
|
||||
s2 = (unsigned int)0xfe1a133e;
|
||||
#else
|
||||
/* Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
|
||||
srand48_r((long int)seed_init, &buffer);
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s0 = result;
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s1 = result;
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s2 = result;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
void set_taus_seed(unsigned int seed_init)
|
||||
{
|
||||
|
||||
#ifdef USER_MODE
|
||||
struct drand48_data buffer;
|
||||
unsigned long result = 0;
|
||||
#endif
|
||||
s0 = (unsigned int)0x1e23d852;
|
||||
s1 = (unsigned int)0x81f38a1c;
|
||||
s2 = (unsigned int)0xfe1a133e;
|
||||
|
||||
return;
|
||||
|
||||
if (seed_init == 0) {
|
||||
s0 = (unsigned int)time(NULL);
|
||||
s1 = (unsigned int)time(NULL);
|
||||
s2 = (unsigned int)time(NULL);
|
||||
} else {
|
||||
#ifndef USER_MODE
|
||||
s0 = (unsigned int)0x1e23d852;
|
||||
s1 = (unsigned int)0x81f38a1c;
|
||||
s2 = (unsigned int)0xfe1a133e;
|
||||
#else
|
||||
// Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
|
||||
srand48_r((long int)seed_init, &buffer);
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s0 = result;
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s1 = result;
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s2 = result;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MAIN
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
unsigned int i,rand;
|
||||
|
||||
set_taus_seed();
|
||||
|
||||
for (i=0; i<10; i++) {
|
||||
|
||||
rand = taus();
|
||||
printf("%u\n",rand);
|
||||
|
||||
}
|
||||
}
|
||||
#endif //MAIN
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user