Fix crashes for T-Tracer to work with NR-UE

1. Fix UE_PHY_PDSCH_IQ event
2. Fix UE_PHY_PDCCH_ENERGY event
3. Fix UE_PHY_PDSCH_ENERGY event
4. Fix UE_PHY_MEAS event
All fixes align NR UE events with their definitions in T_messages.txt and match the expected format in the tracer GUI parser.
This commit is contained in:
alexjiao
2025-10-17 17:06:36 +08:00
parent 7045140845
commit 8424c8ecb6
3 changed files with 21 additions and 8 deletions
+8 -1
View File
@@ -372,7 +372,14 @@ void nr_rx_pdcch(PHY_VARS_NR_UE *ue,
LOG_D(NR_PHY_DCI, "slot %d: pdcch log2_maxh = %d (%d,%d)\n", proc->nr_slot_rx, log2_maxh, avgP[0], avgs);
#endif
#if T_TRACER
T(T_UE_PHY_PDCCH_ENERGY, T_INT(0), T_INT(0), T_INT(proc->frame_rx % 1024), T_INT(proc->nr_slot_rx), T_INT(avgs));
T(T_UE_PHY_PDCCH_ENERGY,
T_INT(0),
T_INT(proc->frame_rx % 1024),
T_INT(proc->nr_slot_rx),
T_INT(avg[0]),
T_INT(antRx > 1 ? avg[1] : 0),
T_INT(antRx > 2 ? avg[2] : 0),
T_INT(antRx > 3 ? avg[3] : 0));
#endif
LOG_D(NR_PHY_DCI, "we enter nr_pdcch_channel_compensation(log2_maxh=%d)\n", log2_maxh);
LOG_D(NR_PHY_DCI, "in nr_pdcch_channel_compensation(rxdataF_ext x dl_ch_estimates_ext -> rxdataF_comp)\n");
@@ -540,6 +540,16 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
}
*log2_maxh = (log2_approx(avgs) / 2) + 1;
LOG_D(PHY, "[DLSCH] AbsSubframe %d.%d log2_maxh = %d (%d)\n", frame % 1024, nr_slot_rx, *log2_maxh, avgs);
#if T_TRACER
T(T_UE_PHY_PDSCH_ENERGY,
T_INT(gNB_id),
T_INT(frame % 1024),
T_INT(nr_slot_rx),
T_INT(avg[0]), // layer 0, antenna 0
T_INT(n_rx > 1 ? avg[1] : 0), // layer 0, antenna 1
T_INT(nl > 1 ? avg[n_rx] : 0), // layer 1, antenna 0
T_INT(nl > 1 && n_rx > 1 ? avg[n_rx + 1] : 0)); // layer 1, antenna 1
#endif
}
stop_meas_nr_ue_phy(ue, DLSCH_CHANNEL_LEVEL_STATS);
if (meas_enabled) {
@@ -552,9 +562,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
first_symbol_flag,
ue->phy_cpu_stats.cpu_time_stats[DLSCH_CHANNEL_LEVEL_STATS].p_time / (cpuf * 1000.0));
}
#if T_TRACER
T(T_UE_PHY_PDSCH_ENERGY, T_INT(gNB_id), T_INT(0), T_INT(frame % 1024), T_INT(nr_slot_rx));
#endif
//----------------------------------------------------------
//--------------------- channel compensation ---------------
@@ -746,13 +753,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
#if T_TRACER
T(T_UE_PHY_PDSCH_IQ,
T_INT(gNB_id),
T_INT(ue->Mod_id),
T_INT(frame % 1024),
T_INT(nr_slot_rx),
T_INT(nb_rb_pdsch),
T_INT(fp->N_RB_UL),
T_INT(fp->symbols_per_slot),
T_BUFFER(&rxdataF_comp[gNB_id][0], 2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ fp->N_RB_UL * 12 * 2));
T_BUFFER(&rxdataF_comp[gNB_id][0], 2 * fp->N_RB_UL * 12 * fp->symbols_per_slot * 2));
#endif
if (ue->phy_sim_pdsch_rxdataF_comp)
+2 -2
View File
@@ -440,7 +440,6 @@ static void nr_ue_measurement_procedures(uint16_t l,
if(nr_slot_rx == 0)
T(T_UE_PHY_MEAS,
T_INT(gNB_id),
T_INT(ue->Mod_id),
T_INT(proc->frame_rx % 1024),
T_INT(nr_slot_rx),
T_INT((int)(10 * log10(ue->measurements.rsrp[0]) - ue->rx_total_gain_dB)),
@@ -448,7 +447,8 @@ static void nr_ue_measurement_procedures(uint16_t l,
T_INT((int)(ue->measurements.rx_power_avg_dB[0] - ue->measurements.n0_power_avg_dB)),
T_INT((int)ue->measurements.rx_power_avg_dB[0]),
T_INT((int)ue->measurements.n0_power_avg_dB),
T_INT((int)ue->measurements.wideband_cqi_avg[0]));
T_INT((int)ue->measurements.wideband_cqi_avg[0]),
T_INT((int)ue->common_vars.freq_offset));
#endif
}