Commit 7af3d98f authored by Raymond Knopp's avatar Raymond Knopp

bugfix in ulsch_decoding. removal of logging in pucch.c and usrp_lib.cpp.

parent f05013a2
...@@ -1015,7 +1015,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, ...@@ -1015,7 +1015,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
*payload = 0; *payload = 0;
*Po_PUCCH1_below = ((*Po_PUCCH1_below<<9) + (stat_max<<9)+1024)>>10; *Po_PUCCH1_below = ((*Po_PUCCH1_below<<9) + (stat_max<<9)+1024)>>10;
} }
printf("[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,eNB->measurements[0].n0_subband_power_tot_dBm[6],pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above)); //printf("[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,eNB->measurements[0].n0_subband_power_tot_dBm[6],pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above));
*Po_PUCCH_update = 1; *Po_PUCCH_update = 1;
if (UE_id==0) { if (UE_id==0) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY,dB_fixed(stat_max)); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY,dB_fixed(stat_max));
...@@ -1107,18 +1107,18 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, ...@@ -1107,18 +1107,18 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
stat_re=0; stat_re=0;
stat_im=0; stat_im=0;
printf("PUCCH1A : Po_PUCCH before %d dB (%d)\n",dB_fixed(*Po_PUCCH),*Po_PUCCH); // printf("PUCCH1A : Po_PUCCH before %d dB (%d)\n",dB_fixed(*Po_PUCCH),*Po_PUCCH);
*Po_PUCCH = ((*Po_PUCCH>>1) + ((stat_max)>>1)); *Po_PUCCH = ((*Po_PUCCH>>1) + ((stat_max)>>1));
*Po_PUCCH_dBm = dB_fixed(*Po_PUCCH/frame_parms->N_RB_UL) - eNB->rx_total_gain_dB; *Po_PUCCH_dBm = dB_fixed(*Po_PUCCH/frame_parms->N_RB_UL) - eNB->rx_total_gain_dB;
*Po_PUCCH_update = 1; *Po_PUCCH_update = 1;
/*
printf("PUCCH1A : stat_max %d (%d,%d,%d) => Po_PUCCH %d\n", printf("PUCCH1A : stat_max %d (%d,%d,%d) => Po_PUCCH %d\n",
dB_fixed(stat_max), dB_fixed(stat_max),
pucch1_thres+sigma2_dB, pucch1_thres+sigma2_dB,
pucch1_thres, pucch1_thres,
sigma2_dB, sigma2_dB,
dB_fixed(*Po_PUCCH)); dB_fixed(*Po_PUCCH));
*/
// Do detection now // Do detection now
if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {// if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {//
......
...@@ -302,7 +302,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) { ...@@ -302,7 +302,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) {
} }
// go through second half of segments // go through second half of segments
for (; r<(ulsch_harq->C/2); r++) { for (; r<(ulsch_harq->C); r++) {
// printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]); // printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]);
...@@ -461,6 +461,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr ...@@ -461,6 +461,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
int Q_m = get_Qm_ul(ulsch_harq->mcs); int Q_m = get_Qm_ul(ulsch_harq->mcs);
int G = ulsch_harq->nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch; int G = ulsch_harq->nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch;
unsigned int E; unsigned int E;
int Cby2;
uint8_t (*tc)(int16_t *y, uint8_t (*tc)(int16_t *y,
uint8_t *, uint8_t *,
...@@ -489,38 +490,44 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr ...@@ -489,38 +490,44 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
else else
tc = phy_threegpplte_turbo_decoder8; tc = phy_threegpplte_turbo_decoder8;
if (pthread_mutex_timedlock(&proc->mutex_td,&wait) != 0) { if (ulsch_harq->C>1) { // wakeup worker if more than 1 segment
printf("[eNB] ERROR pthread_mutex_lock for TD thread (IC %d)\n", proc->instance_cnt_td); if (pthread_mutex_timedlock(&proc->mutex_td,&wait) != 0) {
exit_fun( "error locking mutex_fep" ); printf("[eNB] ERROR pthread_mutex_lock for TD thread (IC %d)\n", proc->instance_cnt_td);
return -1; exit_fun( "error locking mutex_fep" );
} return -1;
}
if (proc->instance_cnt_td==0) {
printf("[eNB] TD thread busy\n");
exit_fun("TD thread busy");
pthread_mutex_unlock( &proc->mutex_td );
return -1;
}
++proc->instance_cnt_td;
proc->tdp.eNB = eNB;
proc->tdp.UE_id = UE_id;
proc->tdp.harq_pid = harq_pid;
proc->tdp.llr8_flag = llr8_flag;
// wakeup worker to do second half segments
if (pthread_cond_signal(&proc->cond_td) != 0) {
printf("[eNB] ERROR pthread_cond_signal for td thread exit\n");
exit_fun( "ERROR pthread_cond_signal" );
return (1+ulsch->max_turbo_iterations);
}
if (proc->instance_cnt_td==0) {
printf("[eNB] TD thread busy\n");
exit_fun("TD thread busy");
pthread_mutex_unlock( &proc->mutex_td ); pthread_mutex_unlock( &proc->mutex_td );
return -1; Cby2 = ulsch_harq->C/2;
} }
else {
++proc->instance_cnt_td; Cby2 = 1;
proc->tdp.eNB = eNB;
proc->tdp.UE_id = UE_id;
proc->tdp.harq_pid = harq_pid;
proc->tdp.llr8_flag = llr8_flag;
// wakeup worker to do second half segments
if (pthread_cond_signal(&proc->cond_td) != 0) {
printf("[eNB] ERROR pthread_cond_signal for td thread exit\n");
exit_fun( "ERROR pthread_cond_signal" );
return (1+ulsch->max_turbo_iterations);
} }
pthread_mutex_unlock( &proc->mutex_td );
// go through first half of segments in main thread // go through first half of segments in main thread
for (r=0; r<(ulsch_harq->C/2); r++) { for (r=0; r<Cby2; r++) {
// printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]); // printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]);
// Get Turbo interleaver parameters // Get Turbo interleaver parameters
......
...@@ -215,10 +215,10 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, ...@@ -215,10 +215,10 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
else else
time_avg=(time_diff+time_avg) /2.0; time_avg=(time_diff+time_avg) /2.0;
//prints statics of uhd every 10 seconds /* //prints statics of uhd every 10 seconds
if ( loop % (10 * ((int)device->openair0_cfg[0].sample_rate /(int)nsamps )) ==0) if ( loop % (10 * ((int)device->openair0_cfg[0].sample_rate /(int)nsamps )) ==0)
LOG_I(HW,"usrp_write: min(ns)=%d, max(ns)=%d, avg(ns)=%d\n", (int)time_min, (int)time_max,(int)time_avg); LOG_I(HW,"usrp_write: min(ns)=%d, max(ns)=%d, avg(ns)=%d\n", (int)time_min, (int)time_max,(int)time_avg);
*/
loop++; loop++;
return ret; return ret;
} }
...@@ -331,12 +331,12 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp ...@@ -331,12 +331,12 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
time_avg= time_diff; time_avg= time_diff;
else else
time_avg=(time_diff+time_avg) /2.0; time_avg=(time_diff+time_avg) /2.0;
/*
//prints statics of uhd every 10 seconds //prints statics of uhd every 10 seconds
if ( loop % (10 * ((int)device->openair0_cfg[0].sample_rate /(int)nsamps )) ==0) if ( loop % (10 * ((int)device->openair0_cfg[0].sample_rate /(int)nsamps )) ==0)
LOG_I(HW,"usrp_read: min(ns)=%d, max(ns)=%d, avg(ns)=%d\n", (int)time_min, (int)time_max,(int)time_avg); LOG_I(HW,"usrp_read: min(ns)=%d, max(ns)=%d, avg(ns)=%d\n", (int)time_min, (int)time_max,(int)time_avg);
loop++; loop++;*/
return samples_received; return samples_received;
} }
......
...@@ -31,11 +31,12 @@ eNBs = ...@@ -31,11 +31,12 @@ eNBs =
tdd_config_s = 0; tdd_config_s = 0;
prefix_type = "NORMAL"; prefix_type = "NORMAL";
eutra_band = 7; eutra_band = 7;
downlink_frequency = 2680000000L; downlink_frequency = 2660000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
Nid_cell = 0; Nid_cell = 0;
N_RB_DL = 100; N_RB_DL = 100;
Nid_cell_mbsfn = 0; Nid_cell_mbsfn = 0;
nb_antenna_ports = 1;
nb_antennas_tx = 1; nb_antennas_tx = 1;
nb_antennas_rx = 1; nb_antennas_rx = 1;
tx_gain = 90; tx_gain = 90;
...@@ -100,6 +101,8 @@ eNBs = ...@@ -100,6 +101,8 @@ eNBs =
ue_TimersAndConstants_t311 = 10000; ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20; ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1; ue_TimersAndConstants_n311 = 1;
ue_TransmissionMode = 1;
} }
); );
......
...@@ -835,7 +835,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) { ...@@ -835,7 +835,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
void *rxp[fp->nb_antennas_rx],*txp[fp->nb_antennas_tx]; void *rxp[fp->nb_antennas_rx],*txp[fp->nb_antennas_tx];
unsigned int rxs,txs; unsigned int rxs,txs;
int i; int i;
int tx_sfoffset = 2;//(eNB->single_thread_flag == 1) ? 3 : 3; int tx_sfoffset = 3;//(eNB->single_thread_flag == 1) ? 3 : 3;
if (proc->first_rx==0) { if (proc->first_rx==0) {
// Transmit TX buffer based on timestamp from RX // Transmit TX buffer based on timestamp from RX
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment