Commit 222e7010 authored by Florian Kaltenberger's avatar Florian Kaltenberger

improved l1 stats

replaced calls to exit with mac_xface->macphy_exit



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5766 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 26ce3333
......@@ -2482,7 +2482,7 @@ unsigned char phy_threegpplte_turbo_decoder(short *y,
break;
default:
printf("FATAL: 3gpplte_turbo_decoder_sse.c: Unknown CRC\n");
exit(-1);
return(255);
break;
}
......
......@@ -927,7 +927,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
break;
default:
printf("FATAL: 3gpplte_turbo_decoder_sse.c: Unknown CRC\n");
exit(-1);
return(255);
break;
}
......
......@@ -1033,7 +1033,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
break;
default:
printf("FATAL: 3gpplte_turbo_decoder_sse.c: Unknown CRC\n");
exit(-1);
return(255);
break;
}
......
......@@ -83,12 +83,7 @@ int rate_matching(unsigned int N_coded,
// the first condition represents the case where the rate is greater than 2/3
// the second condition represents the case where the rate is less than 1/4
msg("[PHY][CODING] Rate matching parameter error (N_coded %d, N_input %d, N_bps %d), exiting\n",N_coded,N_input,N_bps);
#ifdef USER_MODE
exit(-1);
#else
return(-1);
#endif
}
//initialize all bits as transmitted
......@@ -166,12 +161,7 @@ int rate_matching_lte(unsigned int N_coded,
// the first condition represents the case where the rate is greater than 2/3
// the second condition represents the case where the rate is less than 1/4
msg("[PHY][CODING] Rate matching parameter error (N_coded %d, N_input %d), exiting\n",N_coded,N_input);
#ifdef USER_MODE
exit(-1);
#else
return(-1);
#endif
}
//initialize all bits as transmitted
......
......@@ -2554,7 +2554,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,int do_common,uint
CCEmap = CCEmap2;
else {
LOG_E(PHY,"Illegal CCEind %d (Yk %d, m %d, nCCE %d, L2 %d\n",CCEind,Yk,m,nCCE,L2);
exit(-1);
mac_xface->macphy_exit("Illegal CCEind\n");
}
switch (L2) {
case 1:
......
......@@ -219,7 +219,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
}
else {
LOG_E(PHY,"resource type 1 not supported for N_RB_DL=100\n");
exit(-1);
mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n");
/*
subset = rb_alloc&1;
shift = (rb_alloc>>1)&1;
......@@ -248,7 +248,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
}
else {
LOG_E(PHY,"resource type 1 not supported for N_RB_DL=100\n");
exit(-1);
mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n");
/*
subset = rb_alloc&1;
shift = (rb_alloc>>1)&1;
......
......@@ -555,30 +555,33 @@ typedef struct {
UE_MODE_t mode;
/// Current sector where UE is attached
uint8_t sector;
///
uint32_t dlsch_sliding_cnt;
///
uint32_t dlsch_ACK[8];
uint32_t dlsch_NAK[8];
///
uint32_t dlsch_l2_errors;
///
uint32_t dlsch_trials[8];
///
uint32_t ulsch_errors[3];
///
uint32_t ulsch_consecutive_errors[3];
///
uint32_t ulsch_decoding_attempts[3][8];
///
uint32_t ulsch_round_errors[3][8];
uint32_t ulsch_decoding_attempts_last[3][8];
uint32_t ulsch_round_errors_last[3][8];
uint32_t ulsch_round_fer[3][8];
/// dlsch l2 errors
uint32_t dlsch_l2_errors[8];
/// dlsch trials per harq and round
uint32_t dlsch_trials[8][8];
/// dlsch ACK/NACK per hard_pid and round
uint32_t dlsch_ACK[8][8];
uint32_t dlsch_NAK[8][8];
/// ulsch l2 errors per harq_pid
uint32_t ulsch_errors[8];
/// ulsch l2 consecutive errors per harq_pid
uint32_t ulsch_consecutive_errors[8];
/// ulsch trials/errors/fer per harq and round
uint32_t ulsch_decoding_attempts[8][8];
uint32_t ulsch_round_errors[8][8];
uint32_t ulsch_decoding_attempts_last[8][8];
uint32_t ulsch_round_errors_last[8][8];
uint32_t ulsch_round_fer[8][8];
uint32_t sr_received;
uint32_t sr_total;
/// dlsch sliding count and total errors in round 0 are used to compute the dlsch_mcs_offset
uint32_t dlsch_sliding_cnt;
uint32_t dlsch_NAK_round0;
int8_t dlsch_mcs_offset;
/// Target mcs1 after rate-adaptation (used by MAC layer scheduler)
uint8_t dlsch_mcs1;
/// Target mcs2 after rate-adaptation (used by MAC layer scheduler)
......@@ -589,7 +592,7 @@ typedef struct {
int total_TBS;
/// Total bits acknowledged on PDSCH (last interval)
int total_TBS_last;
/// Bitrate on the PDSCH
/// Bitrate on the PDSCH [bps]
unsigned int dlsch_bitrate;
// unsigned int total_transmitted_bits;
} LTE_eNB_UE_stats;
......
......@@ -294,7 +294,7 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN
&phy_vars_eNB->dlsch_turbo_encoding_stats,
&phy_vars_eNB->dlsch_interleaving_stats
)<0)
exit(-1);
mac_xface->macphy_exit("problem in dlsch_encoding");
dlsch_scrambling(&phy_vars_eNB->lte_frame_parms,1,phy_vars_eNB->dlsch_eNB_MCH,G,0,subframe<<1);
......
......@@ -265,7 +265,6 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) {
uint8_t eNB,UE_id,i,j,number_of_cards_l=1;
uint32_t ulsch_errors=0;
uint32_t ulsch_round_attempts[4]={0,0,0,0},ulsch_round_errors[4]={0,0,0,0};
uint32_t harq_pid_ul, harq_pid_dl;
uint32_t UE_id_mac, RRC_status;
if (phy_vars_eNB==NULL)
return 0;
......@@ -306,13 +305,15 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) {
phy_vars_eNB->total_transmitted_bits = phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS + phy_vars_eNB->total_transmitted_bits;
//phy_vars_eNB->total_system_throughput = phy_vars_eNB->eNB_UE_stats[UE_id].total_transmitted_bits + phy_vars_eNB->total_system_throughput;
if (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH)
success = success + ((phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[0]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[1]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[2]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[3]) - (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[0]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[1]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[2]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[3]));
for (i=0;i<8;i++)
success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]);
}
#else
phy_vars_eNB->total_dlsch_bitrate = phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate + phy_vars_eNB->total_dlsch_bitrate;
phy_vars_eNB->total_transmitted_bits = phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS + phy_vars_eNB->total_transmitted_bits;
//phy_vars_eNB->total_system_throughput = phy_vars_eNB->eNB_UE_stats[UE_id].total_transmitted_bits + phy_vars_eNB->total_system_throughput;
success = success + ((phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[0]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[1]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[2]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[3]) - (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[0]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[1]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[2]+phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[3]));
for (i=0;i<8;i++)
success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]);
#endif
}
......@@ -331,17 +332,18 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) {
#ifdef OPENAIR2
if (phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti>0) {
#endif
harq_pid_dl = phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->current_harq_pid;
harq_pid_ul = 2;
len += sprintf(&buffer[len],"[eNB PROC] UE %d (%x) RSSI: (%d,%d) dBm, Sector %d, DLSCH Mode %d, UE_DL_mcs %d, UE_UL_MCS %d\n",
len += sprintf(&buffer[len],"[eNB PROC] UE %d (%x) RSSI: (%d,%d) dBm, Sector %d, DLSCH Mode %d\n",
UE_id,
phy_vars_eNB->eNB_UE_stats[UE_id].crnti,
phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[0],
phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[1],
phy_vars_eNB->eNB_UE_stats[UE_id].sector,
phy_vars_eNB->transmission_mode[UE_id],
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid_dl]->mcs,
phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[harq_pid_ul]->mcs);
phy_vars_eNB->transmission_mode[UE_id]);
for(i=0;i<8;i++)
len+= sprintf(&buffer[len]," harq %d, UE_DL_mcs %d, UE_UL_MCS %d\n",
i,
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[i]->mcs,
phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->mcs);
len += sprintf(&buffer[len],"[eNB PROC] Wideband CQI: (%d,%d) dB\n",
phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][0],
......@@ -381,84 +383,47 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) {
#ifdef OPENAIR2
if (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH) {
#endif
for (i=0;i<3;i++) {
ulsch_errors += phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[i];
for (j=0;j<4;j++) {
ulsch_round_attempts[j] += phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][j];
ulsch_round_errors[j] += phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[i][j];
}
}
len += sprintf(&buffer[len],"[eNB PROC] SR received/total: %d/%d (diff %d)\n",
phy_vars_eNB->eNB_UE_stats[UE_id].sr_received,
phy_vars_eNB->eNB_UE_stats[UE_id].sr_total,
phy_vars_eNB->eNB_UE_stats[UE_id].sr_total-phy_vars_eNB->eNB_UE_stats[UE_id].sr_received);
len += sprintf(&buffer[len],"[eNB PROC] ULSCH FER per round (%d, %d, %d, %d) : (%d, %d, %d, %d) : (%d, %d, %d, %d) \n",
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[0][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[0][1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[0][2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[0][3],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[1][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[1][1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[1][2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[1][3],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[2][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[2][1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[2][2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_fer[2][3]);
len += sprintf(&buffer[len],"[eNB PROC] ULSCH errors %d/%d (%d/%d,%d/%d,%d/%d,%d/%d) : %d/%d (%d/%d,%d/%d,%d/%d,%d/%d) : %d/%d (%d/%d,%d/%d,%d/%d,%d/%d) \n",
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[0][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[0][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[0][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[0][1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[0][1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[0][2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[0][2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[0][3],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[0][3],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[1][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[1][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[1][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[1][1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[1][1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[1][2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[1][2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[1][3],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[1][3],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[2][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[2][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[2][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[2][1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[2][1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[2][2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[2][2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[2][3],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[2][3]);
len += sprintf(&buffer[len],"[eNB PROC] DLSCH errors %d/%d (%d/%d/%d,%d/%d/%d,%d/%d/%d,%d/%d/%d)\n",
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors,
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[0],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[0],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[0],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[0],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[1],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[1],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[1],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[2],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[2],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[2],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[3],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[3],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[3]);
len += sprintf(&buffer[len],"[eNB PROC] ULSCH errors/attempts per harq (per round): \n");
for (i=0;i<8;i++)
len += sprintf(&buffer[len]," harq %d: %d/%d (%d/%d, %d/%d, %d/%d, %d/%d)\n",
i,
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[i],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[i][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][0],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[i][1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][1],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[i][2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][2],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[i][3],
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][3]);
len += sprintf(&buffer[len],"[eNB PROC] DLSCH errors/attempts per harq (per round): \n");
for (i=0;i<8;i++)
len += sprintf(&buffer[len]," harq %d: %d/%d (%d/%d/%d, %d/%d/%d, %d/%d/%d, %d/%d/%d)\n",
i,
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[i][0],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[i][0],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[i][1],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[i][1],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][1],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[i][2],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[i][2],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][2],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[i][3],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[i][3],
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][3]);
len += sprintf(&buffer[len],"[eNB PROC] DLSCH total bits from MAC: %dkbit\n",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS_MAC)/1000);
len += sprintf(&buffer[len],"[eNB PROC] DLSCH total bits ack'ed: %dkbit\n",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS)/1000);
len += sprintf(&buffer[len],"[eNB PROC] DLSCH Average throughput (10 frames): %dkbps\n",(phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate/1000));
len += sprintf(&buffer[len],"[eNB PROC] DLSCH Average throughput (100 frames): %dkbps\n",(phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate/1000));
len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",phy_vars_eNB->transmission_mode[UE_id]);
if(phy_vars_eNB->transmission_mode[UE_id] == 5){
......@@ -478,7 +443,6 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) {
len += sprintf(&buffer[len],"\n");
len += sprintf(&buffer[len],"[eNB PROC] Total Number of Allocated PRBs = %d\n",phy_vars_eNB->mu_mimo_mode[UE_id].pre_nb_available_rbs);
#ifdef OPENAIR2
}
}
......
......@@ -1616,8 +1616,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
mac_exit_wrapper("Invalid UE id (< 0) detected");
}
#ifdef DEBUG_PHY_PROC
if (phy_vars_eNB->proc[sched_subframe].frame_tx%100 == 0)
LOG_I(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generated format0 DCI (rnti %x, dci %x) (DCI pos %d/%d), aggregation %d\n",
//if (phy_vars_eNB->proc[sched_subframe].frame_tx%100 == 0)
LOG_I(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generated ULSCH (format0) DCI (rnti %x, dci %x) (DCI pos %d/%d), aggregation %d\n",
phy_vars_eNB->Mod_id,
subframe2harq_pid(&phy_vars_eNB->lte_frame_parms,
pdcch_alloc2ul_frame(&phy_vars_eNB->lte_frame_parms,(((subframe)==0)?1:0)+phy_vars_eNB->proc[sched_subframe].frame_tx,subframe),
......@@ -1971,7 +1971,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB->eNB_UE_stats[(uint8_t)UE_id].dlsch_sliding_cnt++;
if (phy_vars_eNB->dlsch_eNB[(uint32_t)UE_id][0]->harq_processes[harq_pid]->round == 0) {
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].dlsch_trials[0]++;
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].dlsch_trials[harq_pid][0]++;
#ifdef OPENAIR2
DLSCH_pdu = mac_xface->get_dlsch_sdu(phy_vars_eNB->Mod_id,
......@@ -2005,7 +2005,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
#endif
}
else {
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].dlsch_trials[phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->round]++;
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].dlsch_trials[harq_pid][phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->round]++;
#ifdef DEBUG_PHY_PROC
#ifdef DEBUG_DLSCH
LOG_D(PHY,"[eNB] This DLSCH is a retransmission\n");
......@@ -2173,7 +2173,7 @@ void process_HARQ_feedback(uint8_t UE_id,
uint8_t pucch_sel,
uint8_t SR_payload) {
uint8_t dl_harq_pid[8],dlsch_ACK[8],j,dl_subframe;
uint8_t dl_harq_pid[8],dlsch_ACK[8],dl_subframe;
LTE_eNB_DLSCH_t *dlsch = phy_vars_eNB->dlsch_eNB[(uint32_t)UE_id][0];
LTE_eNB_UE_stats *ue_stats = &phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id];
LTE_DL_eNB_HARQ_t *dlsch_harq_proc;
......@@ -2319,8 +2319,10 @@ void process_HARQ_feedback(uint8_t UE_id,
dlsch->rnti,dl_harq_pid[m],M,m,mp,dlsch_harq_proc->round);
#endif
// if (dlsch_harq_proc->round == 0)
ue_stats->dlsch_NAK[dlsch_harq_proc->round]++;
if (dlsch_harq_proc->round == 0)
ue_stats->dlsch_NAK_round0++;
ue_stats->dlsch_NAK[dl_harq_pid[m]][dlsch_harq_proc->round]++;
// then Increment DLSCH round index
dlsch_harq_proc->round++;
......@@ -2332,7 +2334,7 @@ void process_HARQ_feedback(uint8_t UE_id,
dlsch->rnti,dl_harq_pid[m]);
#endif
dlsch_harq_proc->round = 0;
ue_stats->dlsch_l2_errors++;
ue_stats->dlsch_l2_errors[dl_harq_pid[m]]++;
dlsch_harq_proc->status = SCH_IDLE;
dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
}
......@@ -2342,7 +2344,7 @@ void process_HARQ_feedback(uint8_t UE_id,
LOG_I(PHY,"[eNB %d][PDSCH %x/%d] ACK Received in round %d, resetting process\n",phy_vars_eNB->Mod_id,
dlsch->rnti,dl_harq_pid[m],dlsch_harq_proc->round);
#endif
ue_stats->dlsch_ACK[dlsch_harq_proc->round]++;
ue_stats->dlsch_ACK[dl_harq_pid[m]][dlsch_harq_proc->round]++;
// Received ACK so set round to 0 and set dlsch_harq_pid IDLE
dlsch_harq_proc->round = 0;
......@@ -2358,7 +2360,7 @@ void process_HARQ_feedback(uint8_t UE_id,
}
// Do fine-grain rate-adaptation for DLSCH
if (ue_stats->dlsch_NAK[0] > dlsch->error_threshold) {
if (ue_stats->dlsch_NAK_round0 > dlsch->error_threshold) {
if (ue_stats->dlsch_mcs_offset == 1)
ue_stats->dlsch_mcs_offset=0;
else
......@@ -2372,17 +2374,16 @@ void process_HARQ_feedback(uint8_t UE_id,
// Clear NAK stats and adjust mcs offset
// after measurement window timer expires
if ((ue_stats->dlsch_sliding_cnt == dlsch->ra_window_size) ) {
if ((ue_stats->dlsch_mcs_offset == 0) && (ue_stats->dlsch_NAK[0] < 2))
if ((ue_stats->dlsch_mcs_offset == 0) && (ue_stats->dlsch_NAK_round0 < 2))
ue_stats->dlsch_mcs_offset = 1;
if ((ue_stats->dlsch_mcs_offset == 1) && (ue_stats->dlsch_NAK[0] > 2))
if ((ue_stats->dlsch_mcs_offset == 1) && (ue_stats->dlsch_NAK_round0 > 2))
ue_stats->dlsch_mcs_offset = 0;
if ((ue_stats->dlsch_mcs_offset == 0) && (ue_stats->dlsch_NAK[0] > 2))
if ((ue_stats->dlsch_mcs_offset == 0) && (ue_stats->dlsch_NAK_round0 > 2))
ue_stats->dlsch_mcs_offset = -1;
if ((ue_stats->dlsch_mcs_offset == -1) && (ue_stats->dlsch_NAK[0] < 2))
if ((ue_stats->dlsch_mcs_offset == -1) && (ue_stats->dlsch_NAK_round0 < 2))
ue_stats->dlsch_mcs_offset = 0;
for (j=0;j<phy_vars_eNB->dlsch_eNB[j][0]->Mdlharq;j++)
ue_stats->dlsch_NAK[j] = 0;
ue_stats->dlsch_NAK_round0 = 0;
ue_stats->dlsch_sliding_cnt = 0;
}
......@@ -2562,7 +2563,7 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t
memset(&preamble_energy_list[0],0,64*sizeof(uint16_t));
memset(&preamble_delay_list[0],0,64*sizeof(uint16_t));
if (abstraction_flag == 0) {
LOG_I(PHY,"[eNB %d][RAPROC] Frame %d, Subframe %d : PRACH RX Signal Power : %d dBm\n",phy_vars_eNB->Mod_id,
LOG_D(PHY,"[eNB %d][RAPROC] Frame %d, Subframe %d : PRACH RX Signal Power : %d dBm\n",phy_vars_eNB->Mod_id,
frame,subframe,dB_fixed(signal_energy(&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],512)) - phy_vars_eNB->rx_total_gain_eNB_dB);
// LOG_I(PHY,"[eNB %d][RAPROC] PRACH: rootSequenceIndex %d, prach_ConfigIndex %d, zeroCorrelationZoneConfig %d, highSpeedFlag %d, prach_FreqOffset %d\n",phy_vars_eNB->Mod_id,phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset);
......@@ -2644,7 +2645,7 @@ void ulsch_decoding_procedures(unsigned char subframe, unsigned int i, PHY_VARS_
void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type) {
//RX processing
uint32_t l, ret=0,i,j;
uint32_t l, ret=0,i,j,k;
uint32_t sect_id=0;
uint32_t harq_pid, round;
uint8_t SR_payload,*pucch_payload=NULL,pucch_payload0[2]={0,0},pucch_payload1[2]={0,0};
......@@ -3028,21 +3029,23 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
//#endif
} // This is Msg3 error
else { //normal ULSCH
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
phy_vars_eNB->Mod_id,harq_pid,
frame,subframe, i,
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1,
phy_vars_eNB->ulsch_eNB[i]->Mdlharq,
phy_vars_eNB->ulsch_eNB[i]->o_ACK[0],
phy_vars_eNB->ulsch_eNB[i]->o_ACK[1]);
LOG_I(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:\n",frame,subframe,
/*
LOG_T(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:\n",frame,subframe,
harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0]!=NULL){
for (j=0;j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++)
LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]);
LOG_T(PHY,"\n");
}
*/
// dump_ulsch(phy_vars_eNB,sched_subframe,i);
......@@ -3117,10 +3120,25 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
LOG_I(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",phy_vars_eNB->Mod_id,frame,subframe,i);
#endif //DEBUG_PHY_PROC
for (j=0;j<phy_vars_eNB->dlsch_eNB[i][0]->Mdlharq;j++) {
phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK[j]=0;
phy_vars_eNB->eNB_UE_stats[i].dlsch_sliding_cnt=0;
for (k=0;k<8;k++) {//harq_processes
for (j=0;j<phy_vars_eNB->dlsch_eNB[i][0]->Mdlharq;j++) {
phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK[k][j]=0;
phy_vars_eNB->eNB_UE_stats[i].dlsch_ACK[k][j]=0;
phy_vars_eNB->eNB_UE_stats[i].dlsch_trials[k][j]=0;
}
phy_vars_eNB->eNB_UE_stats[i].dlsch_l2_errors[k]=0;
phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[k]=0;
phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors[k]=0;
for (j=0;j<phy_vars_eNB->ulsch_eNB[i]->Mdlharq;j++) {
phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[k][j]=0;
phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[k][j]=0;
phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[k][j]=0;
phy_vars_eNB->eNB_UE_stats[i].ulsch_round_fer[k][j]=0;
}
}
phy_vars_eNB->eNB_UE_stats[i].dlsch_sliding_cnt=0;
phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK_round0=0;
phy_vars_eNB->eNB_UE_stats[i].dlsch_mcs_offset=0;
//mac_xface->macphy_exit("Mode PUSCH. Exiting.\n");
}
......@@ -3202,8 +3220,10 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][0]);
//#endif
}
if (frame % 100 == 0) {
if (frame % 100 == 0) {
for (round=0;round<phy_vars_eNB->ulsch_eNB[i]->Mdlharq;round++) {
if ((phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][round] -
phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[harq_pid][round]) != 0)
phy_vars_eNB->eNB_UE_stats[i].ulsch_round_fer[harq_pid][round] =
......@@ -3211,16 +3231,14 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors_last[harq_pid][round]))/
(phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][round] -
phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[harq_pid][round]);
phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[harq_pid][round] =
phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][round];
phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors_last[harq_pid][round] =
phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[harq_pid][round];
}
}
#ifdef PUCCH
else if ((phy_vars_eNB->dlsch_eNB[i][0]) &&
(phy_vars_eNB->dlsch_eNB[i][0]->rnti>0)) { // check for PUCCH
......@@ -3471,9 +3489,9 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
#endif //PUCCH
if ((frame % 10 == 0) && (subframe==4)) {
if ((frame % 100 == 0) && (subframe==4)) {
phy_vars_eNB->eNB_UE_stats[i].dlsch_bitrate = (phy_vars_eNB->eNB_UE_stats[i].total_TBS -
phy_vars_eNB->eNB_UE_stats[i].total_TBS_last)*10;
phy_vars_eNB->eNB_UE_stats[i].total_TBS_last);
phy_vars_eNB->eNB_UE_stats[i].total_TBS_last = phy_vars_eNB->eNB_UE_stats[i].total_TBS;
}
......
......@@ -109,7 +109,7 @@ void pusch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id,u
phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH += ((alpha_lut[phy_vars_ue->lte_frame_parms.ul_power_control_config_common.alpha]*PL)/100);
phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH += phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUSCH;
phy_vars_ue->ulsch_ue[eNB_id]->PHR = 15-phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH; // 15 dBm, FIX ME
phy_vars_ue->ulsch_ue[eNB_id]->PHR = 15-phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH; // 15 dBm, FIX ME should be P0_max
if (phy_vars_ue->ulsch_ue[eNB_id]->PHR < -23)
phy_vars_ue->ulsch_ue[eNB_id]->PHR = -23;
......
......@@ -610,12 +610,12 @@ int main(int argc, char **argv) {
}
/*
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu2,sizeof(DCI2_5MHz_2A_M10PRB_TDD_t));
dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_M10PRB_TDD_t;
dci_alloc[0].L = 2;
dci_alloc[0].rnti = 0x1234;
dci_alloc[0].nCCE = 0;
/*
memcpy(&dci_alloc[1].dci_pdu[1],&DLSCH_alloc_pdu2,sizeof(DCI2_5MHz_2A_M10PRB_TDD_t));
dci_alloc[1].dci_length = sizeof_DCI2_5MHz_2A_M10PRB_TDD_t;
dci_alloc[1].L = 3;
......@@ -631,7 +631,7 @@ int main(int argc, char **argv) {
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
/*
num_pdcch_symbols = generate_dci_top(1,
0,
dci_alloc,
......@@ -640,7 +640,7 @@ int main(int argc, char **argv) {
&PHY_vars_eNb->lte_frame_parms,
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
0);
*/
if (num_pdcch_symbols<3) {
......
......@@ -600,6 +600,8 @@ int main(int argc, char **argv) {
PHY_vars_UE->pusch_config_dedicated[eNB_id].betaOffset_ACK_Index = beta_ACK;
PHY_vars_UE->pusch_config_dedicated[eNB_id].betaOffset_RI_Index = beta_RI;
PHY_vars_UE->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index = beta_CQI;
PHY_vars_UE->ul_power_control_dedicated[eNB_id].deltaMCS_Enabled = 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);
......@@ -1264,12 +1266,13 @@ int main(int argc, char **argv) {
#endif
} //trials
printf("\n**********rb: %d ***mcs : %d *********SNR = %f dB (%f): TX %d dB (gain %f dB), N0W %f dB, I0 %d dB [ (%d,%d) dB / (%d,%d) dB ]**************************\n",
printf("\n**********rb: %d ***mcs : %d *********SNR = %f dB (%f): TX %d dB (gain %f dB), N0W %f dB, I0 %d dB, delta_IF %d [ (%d,%d) dB / (%d,%d) dB ]**************************\n",
nb_rb,mcs,SNR,SNR2,
tx_lev_dB,
20*log10(tx_gain),
(double)N0,
PHY_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB,
get_hundred_times_delta_IF(PHY_vars_UE,eNB_id,harq_pid) ,
dB_fixed(PHY_vars_eNB->lte_eNB_pusch_vars[0]->ulsch_power[0]),
dB_fixed(PHY_vars_eNB->lte_eNB_pusch_vars[0]->ulsch_power[1]),
PHY_vars_eNB->PHY_measurements_eNB->n0_power_dB[0],
......
......@@ -406,7 +406,7 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header,
ce_len++;
else {
LOG_E(MAC,"unknown CE %d \n", lcid);
exit(-1);
mac_xface->macphy_exit("unknown CE");
}
}
}
......@@ -593,7 +593,7 @@ void schedule_ulsch_rnti(module_id_t module_idP,
BSR_TABLE[UE_template->bsr_info[LCGID2]]+
BSR_TABLE[UE_template->bsr_info[LCGID3]]; // This is when remaining data in UE buffers (even if SR is triggered)
LOG_D(MAC,"[eNB %d][PUSCH %d/%x] Frame %d subframeP %d Scheduled UE, BSR for LCGID0 %d, LCGID1 %d, LCGID2 %d LCGID3 %d, BO %d\n",
LOG_I(MAC,"[eNB %d][PUSCH %d/%x] Frame %d subframeP %d Scheduled UE, BSR for LCGID0 %d, LCGID1 %d, LCGID2 %d LCGID3 %d, BO %d\n",
module_idP,
UE_id,
rnti,
......
......@@ -24,8 +24,6 @@ endif
CFLAGS += -O2
CFLAGS += -DDRIVER2013 -I$(OPENAIR_TARGETS)/ARCH/COMMON
CFLAGS += -DMAX_NUM_CCs=1
ifeq ($(USRP),0)
CFLAGS += -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/ -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/DEFS -DENABLE_VCD_FIFO
endif
......@@ -39,13 +37,10 @@ ifdef LIBCONFIG_LONG
CFLAGS += -DLIBCONFIG_LONG
endif
ifndef RTAI
RTAI=1
endif
ifeq ($(ENABLE_RAL), 1)
CFLAGS += -DENABLE_RAL
endif
......@@ -65,6 +60,9 @@ endif
endif
endif
ifdef JF
CFLAGS += -DJUMBO_FRAME
endif
ifeq ($(RTAI),1)
CFLAGS += -DENABLE_RTAI_CLOCK
......@@ -138,7 +136,6 @@ endif
RTAI_OBJ += $(UTILS_OBJS)
#ifdef ENABLE_ITTI
CFLAGS += -DEXMIMO_IOT
#endif
......
......@@ -301,8 +301,7 @@ static int mbox_bounds[20] = {8,16,24,30,38,46,54,60,68,7
static LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
int multi_thread=1;
// this allows
uint32_t target_dl_mcs = 28;
uint32_t target_dl_mcs = 28; //maximum allowed mcs
uint32_t target_ul_mcs = 8;
......@@ -453,7 +452,8 @@ static void *scope_thread(void *arg) {
}
//printf("doing forms\n");
usleep(100000); // 100 ms
//usleep(100000); // 100 ms