Merge remote-tracking branch 'origin/NR_SA_F1AP_5GRECORDS' into develop-NR_SA_F1AP_5GRECORDS
# Conflicts: # openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c # openair1/SCHED_NR/phy_procedures_nr_gNB.c # openair2/GNB_APP/L1_nr_paramdef.h # openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c # openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c # openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c # openair2/SIMULATION/NR_RRC/itti_sim.c
This commit is contained in:
@@ -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,"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) {
|
||||
int stroff=0;
|
||||
|
||||
for (int i=0;i<NUMBER_OF_NR_ULSCH_MAX;i++) {
|
||||
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",
|
||||
gNB->ulsch_stats[i].rnti, aa,gNB->ulsch_stats[i].power[aa],aa,gNB->ulsch_stats[i].noise_power[aa]);
|
||||
AssertFatal(stroff<(STATSTRLEN-1000),"Increase STATSTRLEN\n");
|
||||
if (gNB->ulsch_stats[i].rnti>0) {
|
||||
for (int aa=0;aa<gNB->frame_parms.nb_antennas_rx;aa++)
|
||||
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]/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);
|
||||
|
||||
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",
|
||||
gNB->ulsch_stats[i].rnti,
|
||||
AssertFatal(stroff<(STATSTRLEN-1000),"Increase STATSTRLEN\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].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],
|
||||
@@ -159,10 +164,12 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
|
||||
gNB->ulsch_stats[i].round_trials[2],
|
||||
(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].DTX,
|
||||
gNB->ulsch_stats[i].current_Qm,
|
||||
gNB->ulsch_stats[i].current_RI,
|
||||
gNB->ulsch_stats[i].total_bytes_rx,
|
||||
gNB->ulsch_stats[i].total_bytes_tx);
|
||||
}
|
||||
}
|
||||
fprintf(fd,"%s",output);
|
||||
}
|
||||
@@ -172,3 +179,20 @@ void clear_pusch_stats(PHY_VARS_gNB *gNB) {
|
||||
for (int i=0;i<NUMBER_OF_NR_ULSCH_MAX;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);
|
||||
void dump_pusch_stats(FILE *fd,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) {
|
||||
}
|
||||
|
||||
uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
uint8_t UE_id,
|
||||
uint8_t ULSCH_id,
|
||||
short *ulsch_llr,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
@@ -471,7 +471,8 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
#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];
|
||||
|
||||
if (!harq_process) {
|
||||
@@ -557,9 +558,11 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
if (stats) {
|
||||
stats->rnti = ulsch->rnti;
|
||||
stats->round_trials[harq_process->round]++;
|
||||
}
|
||||
if (harq_process->round == 0) {
|
||||
if (stats) {
|
||||
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) {
|
||||
stats->current_Qm = Qm;
|
||||
stats->current_RI = n_layers;
|
||||
stats->total_bytes_tx += harq_process->TBS;
|
||||
@@ -639,7 +642,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
rdata->Tbslbrm = Tbslbrm;
|
||||
rdata->offset = offset;
|
||||
rdata->ulsch = ulsch;
|
||||
rdata->ulsch_id = UE_id;
|
||||
rdata->ulsch_id = ULSCH_id;
|
||||
pushTpool(phy_vars_gNB->threadPool,req);
|
||||
phy_vars_gNB->nbDecode++;
|
||||
LOG_D(PHY,"Added a block to decode, in pipe: %d\n",phy_vars_gNB->nbDecode);
|
||||
|
||||
@@ -1226,11 +1226,11 @@ 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],
|
||||
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++) {
|
||||
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);
|
||||
//----------------------------------------------------------
|
||||
|
||||
@@ -135,6 +135,7 @@ typedef struct {
|
||||
int current_RI;
|
||||
int power[NB_ANTENNAS_RX];
|
||||
int noise_power[NB_ANTENNAS_RX];
|
||||
int DTX;
|
||||
} NR_gNB_SCH_STATS_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -511,6 +512,8 @@ typedef struct {
|
||||
int16_t *ul_valid_re_per_slot;
|
||||
/// flag to verify if channel level computation is done
|
||||
uint8_t cl_done;
|
||||
/// flag to indicate DTX on reception
|
||||
int DTX;
|
||||
} NR_gNB_PUSCH;
|
||||
|
||||
/// Context data structure for RX/TX portion of slot processing
|
||||
@@ -830,6 +833,7 @@ typedef struct PHY_VARS_gNB_s {
|
||||
int prach_energy_counter;
|
||||
|
||||
int pucch0_thres;
|
||||
int pusch_thres;
|
||||
int prach_thres;
|
||||
uint64_t bad_pucch;
|
||||
/*
|
||||
|
||||
@@ -609,7 +609,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++) {
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
|
||||
int harq_pid;
|
||||
int no_sig;
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq;
|
||||
|
||||
if ((ulsch) &&
|
||||
@@ -658,20 +657,29 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
uint8_t symbol_start = ulsch_harq->ulsch_pdu.start_symbol_index;
|
||||
uint8_t symbol_end = symbol_start + ulsch_harq->ulsch_pdu.nr_of_symbols;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RX_PUSCH,1);
|
||||
start_meas(&gNB->rx_pusch_stats);
|
||||
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);
|
||||
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;
|
||||
}
|
||||
}
|
||||
start_meas(&gNB->rx_pusch_stats);
|
||||
for(uint8_t symbol = symbol_start; symbol < symbol_end; symbol++) {
|
||||
nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, symbol, harq_pid);
|
||||
}
|
||||
int ulsch_power=0,ulsch_noise_power=0;
|
||||
for (int aarx=0;aarx<gNB->frame_parms.nb_antennas_rx;aarx++) {
|
||||
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;
|
||||
ulsch_noise_power += gNB->pusch_vars[ULSCH_id]->ulsch_noise_power[aarx];
|
||||
}
|
||||
stop_meas(&gNB->rx_pusch_stats);
|
||||
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);
|
||||
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_ext.m","rxF_ext",gNB->pusch_vars[0]->rxdataF_ext[0],6900,1,1);
|
||||
|
||||
Reference in New Issue
Block a user