Commit 10ea3b67 authored by Raymond Knopp's avatar Raymond Knopp

reduced logging, added PUSCH DTX threshold and counter. Improved n1L1_stats.log.

parent c89b5f2f
...@@ -90,7 +90,7 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB) { ...@@ -90,7 +90,7 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB) {
fprintf(fd,"\nmax_I0 %d (rb %d), min_I0 %d (rb %d), avg I0 %d\n", max_I0, amax, min_I0, amin, gNB->measurements.n0_subband_power_avg_dB); fprintf(fd,"\nmax_I0 %d (rb %d), min_I0 %d (rb %d), avg I0 %d\n", max_I0, amax, min_I0, amin, gNB->measurements.n0_subband_power_avg_dB);
fprintf(fd,"prach_I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10); fprintf(fd,"PRACH I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
} }
......
...@@ -144,14 +144,19 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) { ...@@ -144,14 +144,19 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
int stroff=0; int stroff=0;
for (int i=0;i<NUMBER_OF_NR_ULSCH_MAX;i++) { for (int i=0;i<NUMBER_OF_NR_ULSCH_MAX;i++) {
if (gNB->ulsch_stats[i].rnti>0) {
for (int aa=0;aa<gNB->frame_parms.nb_antennas_rx;aa++) for (int aa=0;aa<gNB->frame_parms.nb_antennas_rx;aa++)
stroff+=sprintf(output+stroff,"ULSCH RNTI %x: ulsch_power[%d] %d, ulsch_noise_power[%d] %d\n", if (aa==0) stroff+=sprintf(output+stroff,"ULSCH RNTI %4x: ulsch_power[%d] %d,%d ulsch_noise_power[%d] %d.%d\n",
gNB->ulsch_stats[i].rnti, aa,gNB->ulsch_stats[i].power[aa],aa,gNB->ulsch_stats[i].noise_power[aa]); gNB->ulsch_stats[i].rnti,
aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10,
aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10);
else stroff+=sprintf(output+stroff," ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d\n",
aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10);
AssertFatal(stroff<(STATSTRLEN-1000),"Increase STATSTRLEN\n"); AssertFatal(stroff<(STATSTRLEN-1000),"Increase STATSTRLEN\n");
if (gNB->ulsch_stats[i].rnti>0)
stroff+=sprintf(output+stroff,"ULSCH RNTI %x: round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d, current_Qm %d, current_RI %d, total_bytes RX/SCHED %d/%d\n", stroff+=sprintf(output+stroff," round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d, DTX %d, current_Qm %d, current_RI %d, total_bytes RX/SCHED %d/%d\n",
gNB->ulsch_stats[i].rnti,
gNB->ulsch_stats[i].round_trials[0], gNB->ulsch_stats[i].round_trials[0],
(double)gNB->ulsch_stats[i].round_trials[1]/gNB->ulsch_stats[i].round_trials[0], (double)gNB->ulsch_stats[i].round_trials[1]/gNB->ulsch_stats[i].round_trials[0],
gNB->ulsch_stats[i].round_trials[1], gNB->ulsch_stats[i].round_trials[1],
...@@ -159,11 +164,13 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) { ...@@ -159,11 +164,13 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
gNB->ulsch_stats[i].round_trials[2], gNB->ulsch_stats[i].round_trials[2],
(double)gNB->ulsch_stats[i].round_trials[3]/gNB->ulsch_stats[i].round_trials[0], (double)gNB->ulsch_stats[i].round_trials[3]/gNB->ulsch_stats[i].round_trials[0],
gNB->ulsch_stats[i].round_trials[3], gNB->ulsch_stats[i].round_trials[3],
gNB->ulsch_stats[i].DTX,
gNB->ulsch_stats[i].current_Qm, gNB->ulsch_stats[i].current_Qm,
gNB->ulsch_stats[i].current_RI, gNB->ulsch_stats[i].current_RI,
gNB->ulsch_stats[i].total_bytes_rx, gNB->ulsch_stats[i].total_bytes_rx,
gNB->ulsch_stats[i].total_bytes_tx); gNB->ulsch_stats[i].total_bytes_tx);
} }
}
fprintf(fd,"%s",output); fprintf(fd,"%s",output);
} }
...@@ -172,3 +179,20 @@ void clear_pusch_stats(PHY_VARS_gNB *gNB) { ...@@ -172,3 +179,20 @@ void clear_pusch_stats(PHY_VARS_gNB *gNB) {
for (int i=0;i<NUMBER_OF_NR_ULSCH_MAX;i++) for (int i=0;i<NUMBER_OF_NR_ULSCH_MAX;i++)
memset((void*)&gNB->ulsch_stats[i],0,sizeof(gNB->ulsch_stats[i])); memset((void*)&gNB->ulsch_stats[i],0,sizeof(gNB->ulsch_stats[i]));
} }
NR_gNB_SCH_STATS_t *get_ulsch_stats(PHY_VARS_gNB *gNB,NR_gNB_ULSCH_t *ulsch) {
NR_gNB_SCH_STATS_t *stats=NULL;
int first_free=-1;
for (int i=0;i<NUMBER_OF_NR_SCH_STATS_MAX;i++) {
if (gNB->ulsch_stats[i].rnti == 0 && first_free == -1) {
first_free = i;
stats=&gNB->ulsch_stats[i];
}
if (gNB->ulsch_stats[i].rnti == ulsch->rnti) {
stats=&gNB->ulsch_stats[i];
break;
}
}
return(stats);
}
...@@ -92,3 +92,5 @@ int16_t find_nr_ulsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type); ...@@ -92,3 +92,5 @@ int16_t find_nr_ulsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type);
void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB); void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB);
void clear_pusch_stats(PHY_VARS_gNB *gNB); void clear_pusch_stats(PHY_VARS_gNB *gNB);
NR_gNB_SCH_STATS_t *get_ulsch_stats(PHY_VARS_gNB *gNB,NR_gNB_ULSCH_t *ulsch);
...@@ -449,7 +449,7 @@ void nr_processULSegment(void* arg) { ...@@ -449,7 +449,7 @@ void nr_processULSegment(void* arg) {
} }
uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
uint8_t UE_id, uint8_t ULSCH_id,
short *ulsch_llr, short *ulsch_llr,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
nfapi_nr_pusch_pdu_t *pusch_pdu, nfapi_nr_pusch_pdu_t *pusch_pdu,
...@@ -471,7 +471,8 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -471,7 +471,8 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
#endif #endif
NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[UE_id][0]; NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[ULSCH_id][0];
NR_gNB_PUSCH *pusch = phy_vars_gNB->pusch_vars[ULSCH_id];
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid]; NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
if (!harq_process) { if (!harq_process) {
...@@ -557,9 +558,11 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -557,9 +558,11 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
if (stats) { if (stats) {
stats->rnti = ulsch->rnti; stats->rnti = ulsch->rnti;
stats->round_trials[harq_process->round]++; stats->round_trials[harq_process->round]++;
for (int aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++) {
stats->power[aarx]=dB_fixed_x10(pusch->ulsch_power[aarx]);
stats->noise_power[aarx]=dB_fixed_x10(pusch->ulsch_noise_power[aarx]);
} }
if (harq_process->round == 0) { if (harq_process->round == 0) {
if (stats) {
stats->current_Qm = Qm; stats->current_Qm = Qm;
stats->current_RI = n_layers; stats->current_RI = n_layers;
stats->total_bytes_tx += harq_process->TBS; stats->total_bytes_tx += harq_process->TBS;
...@@ -639,7 +642,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -639,7 +642,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
rdata->Tbslbrm = Tbslbrm; rdata->Tbslbrm = Tbslbrm;
rdata->offset = offset; rdata->offset = offset;
rdata->ulsch = ulsch; rdata->ulsch = ulsch;
rdata->ulsch_id = UE_id; rdata->ulsch_id = ULSCH_id;
pushTpool(phy_vars_gNB->threadPool,req); pushTpool(phy_vars_gNB->threadPool,req);
phy_vars_gNB->nbDecode++; phy_vars_gNB->nbDecode++;
LOG_D(PHY,"Added a block to decode, in pipe: %d\n",phy_vars_gNB->nbDecode); LOG_D(PHY,"Added a block to decode, in pipe: %d\n",phy_vars_gNB->nbDecode);
......
...@@ -1219,7 +1219,6 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, ...@@ -1219,7 +1219,6 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
nr_gnb_measurements(gNB, ulsch_id, harq_pid, symbol); nr_gnb_measurements(gNB, ulsch_id, harq_pid, symbol);
int num_symb = rel15_ul->nr_of_symbols; int num_symb = rel15_ul->nr_of_symbols;
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
if (symbol == rel15_ul->start_symbol_index) { if (symbol == rel15_ul->start_symbol_index) {
gNB->pusch_vars[ulsch_id]->ulsch_power[aarx]=0; gNB->pusch_vars[ulsch_id]->ulsch_power[aarx]=0;
...@@ -1227,10 +1226,10 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, ...@@ -1227,10 +1226,10 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
} }
gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] += signal_energy_nodc(&gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][symbol*frame_parms->ofdm_symbol_size], gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] += signal_energy_nodc(&gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][symbol*frame_parms->ofdm_symbol_size],
rel15_ul->rb_size*12); rel15_ul->rb_size*12);
if (gNB->pusch_vars[ulsch_id]->ulsch_power[aarx]==1) return (1);
for (int rb=0;rb<rel15_ul->rb_size;rb++) { for (int rb=0;rb<rel15_ul->rb_size;rb++) {
gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx]+=gNB->measurements.n0_subband_power[aarx][rel15_ul->bwp_start+rel15_ul->rb_start+rb]/rel15_ul->rb_size; gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx]+=gNB->measurements.n0_subband_power[aarx][rel15_ul->bwp_start+rel15_ul->rb_start+rb]/rel15_ul->rb_size;
} }
} }
} }
stop_meas(&gNB->ulsch_channel_estimation_stats); stop_meas(&gNB->ulsch_channel_estimation_stats);
......
...@@ -135,6 +135,7 @@ typedef struct { ...@@ -135,6 +135,7 @@ typedef struct {
int current_RI; int current_RI;
int power[NB_ANTENNAS_RX]; int power[NB_ANTENNAS_RX];
int noise_power[NB_ANTENNAS_RX]; int noise_power[NB_ANTENNAS_RX];
int DTX;
} NR_gNB_SCH_STATS_t; } NR_gNB_SCH_STATS_t;
typedef struct { typedef struct {
...@@ -511,6 +512,8 @@ typedef struct { ...@@ -511,6 +512,8 @@ typedef struct {
int16_t *ul_valid_re_per_slot; int16_t *ul_valid_re_per_slot;
/// flag to verify if channel level computation is done /// flag to verify if channel level computation is done
uint8_t cl_done; uint8_t cl_done;
/// flag to indicate DTX on reception
int DTX;
} NR_gNB_PUSCH; } NR_gNB_PUSCH;
/// Context data structure for RX/TX portion of slot processing /// Context data structure for RX/TX portion of slot processing
...@@ -830,6 +833,7 @@ typedef struct PHY_VARS_gNB_s { ...@@ -830,6 +833,7 @@ typedef struct PHY_VARS_gNB_s {
int prach_energy_counter; int prach_energy_counter;
int pucch0_thres; int pucch0_thres;
int pusch_thres;
int prach_thres; int prach_thres;
uint64_t bad_pucch; uint64_t bad_pucch;
/* /*
......
...@@ -378,12 +378,12 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, ...@@ -378,12 +378,12 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
if (timing_advance_update < 0) timing_advance_update = 0; if (timing_advance_update < 0) timing_advance_update = 0;
if (timing_advance_update > 63) timing_advance_update = 63; if (timing_advance_update > 63) timing_advance_update = 63;
LOG_I(PHY, "Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", sync_pos,timing_advance_update); LOG_D(PHY, "Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", sync_pos,timing_advance_update);
// estimate UL_CQI for MAC (from antenna port 0 only) // estimate UL_CQI for MAC (from antenna port 0 only)
int SNRtimes10 = dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power[0]) - dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power[0]); int SNRtimes10 = dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power[0]) - dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power[0]);
LOG_I(PHY, "Estimated SNR for PUSCH is = %f dB (ulsch_power %f, noise %f)\n", SNRtimes10/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power[0])/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power[0])/10.0); LOG_D(PHY, "Estimated SNR for PUSCH is = %f dB (ulsch_power %f, noise %f)\n", SNRtimes10/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power[0])/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power[0])/10.0);
if (SNRtimes10 < -640) cqi=0; if (SNRtimes10 < -640) cqi=0;
else if (SNRtimes10 > 635) cqi=255; else if (SNRtimes10 > 635) cqi=255;
...@@ -605,7 +605,6 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) ...@@ -605,7 +605,6 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
for (int ULSCH_id=0;ULSCH_id<NUMBER_OF_NR_ULSCH_MAX;ULSCH_id++) { for (int ULSCH_id=0;ULSCH_id<NUMBER_OF_NR_ULSCH_MAX;ULSCH_id++) {
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0]; NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
int harq_pid; int harq_pid;
int no_sig;
NR_UL_gNB_HARQ_t *ulsch_harq; NR_UL_gNB_HARQ_t *ulsch_harq;
if ((ulsch) && if ((ulsch) &&
...@@ -656,17 +655,26 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) ...@@ -656,17 +655,26 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RX_PUSCH,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RX_PUSCH,1);
start_meas(&gNB->rx_pusch_stats); start_meas(&gNB->rx_pusch_stats);
for(uint8_t symbol = symbol_start; symbol < symbol_end; symbol++) { for(uint8_t symbol = symbol_start; symbol < symbol_end; symbol++) {
no_sig = nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, symbol, harq_pid); nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, symbol, harq_pid);
if (no_sig) {
LOG_I(PHY, "PUSCH not detected in symbol %d\n",symbol);
nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 1);
return;
}
} }
int ulsch_power=0,ulsch_noise_power=0;
for (int aarx=0;aarx<gNB->frame_parms.nb_antennas_rx;aarx++) { for (int aarx=0;aarx<gNB->frame_parms.nb_antennas_rx;aarx++) {
gNB->pusch_vars[ULSCH_id]->ulsch_power[aarx]/=num_dmrs; gNB->pusch_vars[ULSCH_id]->ulsch_power[aarx]/=num_dmrs;
ulsch_power += gNB->pusch_vars[ULSCH_id]->ulsch_power[aarx];
gNB->pusch_vars[ULSCH_id]->ulsch_noise_power[aarx]/=num_dmrs; gNB->pusch_vars[ULSCH_id]->ulsch_noise_power[aarx]/=num_dmrs;
ulsch_noise_power += gNB->pusch_vars[ULSCH_id]->ulsch_noise_power[aarx];
} }
if (dB_fixed_x10(ulsch_power) < dB_fixed_x10(ulsch_noise_power) + gNB->pusch_thres) {
NR_gNB_SCH_STATS_t *stats=get_ulsch_stats(gNB,ulsch);
LOG_D(PHY, "PUSCH not detected in %d.%d (%d,%d,%d)\n",frame_rx,slot_rx,
dB_fixed_x10(ulsch_power),dB_fixed_x10(ulsch_noise_power),gNB->pusch_thres);
nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 1);
gNB->pusch_vars[ULSCH_id]->DTX=1;
stats->DTX++;
return;
} else gNB->pusch_vars[ULSCH_id]->DTX=0;
stop_meas(&gNB->rx_pusch_stats); stop_meas(&gNB->rx_pusch_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RX_PUSCH,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RX_PUSCH,0);
//LOG_M("rxdataF_comp.m","rxF_comp",gNB->pusch_vars[0]->rxdataF_comp[0],6900,1,1); //LOG_M("rxdataF_comp.m","rxF_comp",gNB->pusch_vars[0]->rxdataF_comp[0],6900,1,1);
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#define CONFIG_STRING_L1_PUSCH_PROC_THREADS "pusch_proc_threads" #define CONFIG_STRING_L1_PUSCH_PROC_THREADS "pusch_proc_threads"
#define CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold" #define CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold"
#define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold" #define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold"
#define CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD "pusch_dtx_threshold"
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* L1 configuration parameters */ /* L1 configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
...@@ -65,7 +66,8 @@ ...@@ -65,7 +66,8 @@
{CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:1, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:1, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:200, TYPE_UINT, 0} \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:200, TYPE_UINT, 0}, \
{CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0} \
} }
#define L1_CC_IDX 0 #define L1_CC_IDX 0
#define L1_TRANSPORT_N_PREFERENCE_IDX 1 #define L1_TRANSPORT_N_PREFERENCE_IDX 1
...@@ -79,6 +81,7 @@ ...@@ -79,6 +81,7 @@
#define L1_PUSCH_PROC_THREADS 9 #define L1_PUSCH_PROC_THREADS 9
#define L1_PUCCH0_DTX_THRESHOLD 10 #define L1_PUCCH0_DTX_THRESHOLD 10
#define L1_PRACH_DTX_THRESHOLD 11 #define L1_PRACH_DTX_THRESHOLD 11
#define L1_PUSCH_DTX_THRESHOLD 12
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/
#endif #endif
...@@ -572,6 +572,7 @@ void RCconfig_NR_L1(void) { ...@@ -572,6 +572,7 @@ void RCconfig_NR_L1(void) {
RC.gNB[j]->pusch_proc_threads = *(L1_ParamList.paramarray[j][L1_PUSCH_PROC_THREADS].uptr); RC.gNB[j]->pusch_proc_threads = *(L1_ParamList.paramarray[j][L1_PUSCH_PROC_THREADS].uptr);
RC.gNB[j]->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr); RC.gNB[j]->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr);
RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr); RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr);
RC.gNB[j]->pusch_thres = *(L1_ParamList.paramarray[j][L1_PUSCH_DTX_THRESHOLD].uptr);
if(strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) { if(strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) {
//sf_ahead = 2; // Need 4 subframe gap between RX and TX //sf_ahead = 2; // Need 4 subframe gap between RX and TX
}else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) { }else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) {
......
...@@ -358,7 +358,7 @@ void nr_store_dlsch_buffer(module_id_t module_id, ...@@ -358,7 +358,7 @@ void nr_store_dlsch_buffer(module_id_t module_id,
0, 0,
0); 0);
sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer;
LOG_I(NR_MAC, LOG_D(NR_MAC,
"%d.%d, LCID%d:->DLSCH, RLC status %d bytes. \n", "%d.%d, LCID%d:->DLSCH, RLC status %d bytes. \n",
frame, frame,
slot, slot,
...@@ -795,7 +795,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -795,7 +795,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
harq->is_waiting = true; harq->is_waiting = true;
UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++; UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++;
LOG_I(NR_MAC, LOG_D(NR_MAC,
"%4d.%2d RNTI %04x start %d RBs %d startSymbol %d nb_symbsol %d MCS %d TBS %d HARQ PID %d round %d NDI %d\n", "%4d.%2d RNTI %04x start %d RBs %d startSymbol %d nb_symbsol %d MCS %d TBS %d HARQ PID %d round %d NDI %d\n",
frame, frame,
slot, slot,
...@@ -824,7 +824,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -824,7 +824,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu));
dl_req->nPDUs += 1; dl_req->nPDUs += 1;
pdcch_pdu = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; pdcch_pdu = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15;
LOG_I(NR_MAC,"Trying to configure DL pdcch for bwp %d, cs %d\n",bwpid,coresetid); LOG_D(NR_MAC,"Trying to configure DL pdcch for bwp %d, cs %d\n",bwpid,coresetid);
NR_SearchSpace_t *ss = bwp ? sched_ctrl->search_space:gNB_mac->sched_ctrlCommon->search_space; NR_SearchSpace_t *ss = bwp ? sched_ctrl->search_space:gNB_mac->sched_ctrlCommon->search_space;
NR_ControlResourceSet_t *coreset = bwp? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset; NR_ControlResourceSet_t *coreset = bwp? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset;
nr_configure_pdcch(pdcch_pdu, ss, coreset, scc, bwp); nr_configure_pdcch(pdcch_pdu, ss, coreset, scc, bwp);
...@@ -965,7 +965,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -965,7 +965,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator; // PDSCH to HARQ TI dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator; // PDSCH to HARQ TI
dci_payload.antenna_ports.val = 0; // nb of cdm groups w/o data 1 and dmrs port 0 dci_payload.antenna_ports.val = 0; // nb of cdm groups w/o data 1 and dmrs port 0
dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID; dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID;
LOG_I(NR_MAC, LOG_D(NR_MAC,
"%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), " "%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), "
"time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d tpc %d\n", "time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d tpc %d\n",
frame, frame,
...@@ -995,7 +995,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -995,7 +995,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
pdsch_pdu->BWPSize, pdsch_pdu->BWPSize,
bwp? bwp->bwp_Id : 0); bwp? bwp->bwp_Id : 0);
LOG_I(NR_MAC, LOG_D(NR_MAC,
"coreset params: FreqDomainResource %llx, start_symbol %d n_symb %d\n", "coreset params: FreqDomainResource %llx, start_symbol %d n_symb %d\n",
(unsigned long long)pdcch_pdu->FreqDomainResource, (unsigned long long)pdcch_pdu->FreqDomainResource,
pdcch_pdu->StartSymbolIndex, pdcch_pdu->StartSymbolIndex,
...@@ -1086,7 +1086,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1086,7 +1086,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
0, 0,
0); 0);
LOG_I(NR_MAC, LOG_D(NR_MAC,
"%4d.%2d RNTI %04x: %d bytes from DTCH %d (ndata %d, remaining size %d)\n", "%4d.%2d RNTI %04x: %d bytes from DTCH %d (ndata %d, remaining size %d)\n",
frame, frame,
slot, slot,
......
...@@ -1853,7 +1853,7 @@ uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) { ...@@ -1853,7 +1853,7 @@ uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) {
// al values passed to this function are x10 // al values passed to this function are x10
int snrx10 = (cqi*5) - 640; int snrx10 = (cqi*5) - 640;
LOG_I(NR_MAC,"tpc : target %d, snrx10 %d\n",target,snrx10); LOG_D(NR_MAC,"tpc : target %d, snrx10 %d\n",target,snrx10);
if (snrx10 > target + incr) return 0; // decrease 1dB if (snrx10 > target + incr) return 0; // decrease 1dB
if (snrx10 < target - incr) return 2; // increase 1dB if (snrx10 < target - incr) return 2; // increase 1dB
if (snrx10 < target - (3*incr)) return 3; // increase 3dB if (snrx10 < target - (3*incr)) return 3; // increase 3dB
......
...@@ -236,7 +236,7 @@ void nr_process_mac_pdu( ...@@ -236,7 +236,7 @@ void nr_process_mac_pdu(
mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pdu_ptr)->L; mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pdu_ptr)->L;
mac_subheader_len = 2; mac_subheader_len = 2;
} }
LOG_I(NR_MAC, "[UE %d] Frame %d : ULSCH -> UL-DCCH %d (gNB %d, %d bytes), rnti: %d \n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len, rnti); LOG_D(NR_MAC, "[UE %d] Frame %d : ULSCH -> UL-DCCH %d (gNB %d, %d bytes), rnti: %d \n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len, rnti);
mac_rlc_data_ind(module_idP, mac_rlc_data_ind(module_idP,
rnti, rnti,
module_idP, module_idP,
...@@ -452,7 +452,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -452,7 +452,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
T_BUFFER(sduP, sdu_lenP)); T_BUFFER(sduP, sdu_lenP));
UE_info->mac_stats[UE_id].ulsch_total_bytes_rx += sdu_lenP; UE_info->mac_stats[UE_id].ulsch_total_bytes_rx += sdu_lenP;
LOG_I(NR_MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d TA %d sduP %p\n", LOG_D(NR_MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d TA %d sduP %p\n",
gnb_mod_idP, gnb_mod_idP,
harq_pid, harq_pid,
CC_idP, CC_idP,
...@@ -738,7 +738,7 @@ void pf_ul(module_id_t module_id, ...@@ -738,7 +738,7 @@ void pf_ul(module_id_t module_id,
/* Get previous PSUCH filed info */ /* Get previous PSUCH filed info */
sched_ctrl->sched_pusch = cur_harq->sched_pusch; sched_ctrl->sched_pusch = cur_harq->sched_pusch;
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
LOG_I(NR_MAC, "%4d.%2d Allocate UL retransmission UE %d/RNTI %04x sched %4d.%2d (%d RBs)\n", LOG_D(NR_MAC, "%4d.%2d Allocate UL retransmission UE %d/RNTI %04x sched %4d.%2d (%d RBs)\n",
frame, slot, UE_id, UE_info->rnti[UE_id], frame, slot, UE_id, UE_info->rnti[UE_id],
sched_pusch->frame, sched_pusch->slot, sched_pusch->frame, sched_pusch->slot,
sched_pusch->rbSize); sched_pusch->rbSize);
...@@ -1075,7 +1075,7 @@ void nr_schedule_ulsch(module_id_t module_id, ...@@ -1075,7 +1075,7 @@ void nr_schedule_ulsch(module_id_t module_id,
cur_harq->sched_pusch = *sched_pusch; cur_harq->sched_pusch = *sched_pusch;
sched_ctrl->sched_ul_bytes += sched_pusch->tb_size; sched_ctrl->sched_ul_bytes += sched_pusch->tb_size;
} else { } else {
LOG_I(NR_MAC, LOG_D(NR_MAC,
"%d.%2d UL retransmission RNTI %04x sched %d.%2d HARQ PID %d round %d NDI %d\n", "%d.%2d UL retransmission RNTI %04x sched %d.%2d HARQ PID %d round %d NDI %d\n",
frame, frame,
slot, slot,
...@@ -1088,7 +1088,7 @@ void nr_schedule_ulsch(module_id_t module_id, ...@@ -1088,7 +1088,7 @@ void nr_schedule_ulsch(module_id_t module_id,
} }
UE_info->mac_stats[UE_id].ulsch_current_bytes = sched_pusch->tb_size; UE_info->mac_stats[UE_id].ulsch_current_bytes = sched_pusch->tb_size;
LOG_I(NR_MAC, LOG_D(NR_MAC,
"%4d.%2d RNTI %04x UL sched %4d.%2d start %d RBS %d MCS %d TBS %d HARQ PID %d round %d NDI %d\n", "%4d.%2d RNTI %04x UL sched %4d.%2d start %d RBS %d MCS %d TBS %d HARQ PID %d round %d NDI %d\n",
frame, frame,
slot, slot,
...@@ -1246,7 +1246,7 @@ void nr_schedule_ulsch(module_id_t module_id, ...@@ -1246,7 +1246,7 @@ void nr_schedule_ulsch(module_id_t module_id,
pdcch_pdu_bwp_coreset[bwpid][coresetid] = pdcch_pdu; pdcch_pdu_bwp_coreset[bwpid][coresetid] = pdcch_pdu;
} }
LOG_I(NR_MAC,"Configuring ULDCI/PDCCH in %d.%d\n", frame,slot); LOG_D(NR_MAC,"Configuring ULDCI/PDCCH in %d.%d\n", frame,slot);
/* Fill PDCCH DL DCI PDU */ /* Fill PDCCH DL DCI PDU */
nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu->dci_pdu[pdcch_pdu->numDlDci]; nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu->dci_pdu[pdcch_pdu->numDlDci];
......
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