PHY/gNB: replace inline T() calls with T_messages_creator wrappers

Use log_ul_fd_dmrs, log_ul_fd_pusch_iq, log_ul_fd_chan_est_dmrs_pos,
log_ul_fd_chan_est_dmrs_interpl, log_ul_payload_rx_bits.
Remove redundant T_ACTIVE() guards and old timestamp formatting.
This commit is contained in:
abgaber
2026-04-24 10:31:38 +02:00
parent 3f5520d792
commit 5558f98154
+6 -53
View File
@@ -15,6 +15,7 @@
#include "PHY/INIT/nr_phy_init.h"
#include "PHY/MODULATION/nr_modulation.h"
#include "T.h"
#include "T_messages_creator.h"
#include "executables/nr-softmodem.h"
#include "executables/softmodem-common.h"
#include "nfapi/oai_integration/vendor_ext.h"
@@ -23,7 +24,6 @@
#include <sys/time.h>
#include <stdint.h>
#include <openair1/PHY/TOOLS/phy_scope_interface.h>
#include "PHY/log_tools.h"
//#define DEBUG_RXDATA
//#define SRS_IND_DEBUG
@@ -349,65 +349,18 @@ static int nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int
}
}
#if T_TRACER
if (T_ACTIVE(T_GNB_PHY_UL_PAYLOAD_RX_BITS)) {
{
// capture Rx Payload via T-Tracer for both CRC valid and invalid cases
// Get Time Stamp for T-tracer messages
char trace_rx_payload_time_stamp_str[30];
get_time_stamp_usec(trace_rx_payload_time_stamp_str);
// trace_rx_payload_time_stamp_str = 8 bytes timestamp = YYYYMMDD
// + 9 bytes timestamp = HHMMSSMMM
// Log GNB_PHY_UL_PAYLOAD_RX_BITS using T-Tracer if activated
// FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm :
// int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot :
// int,Nid_cell : int,rnti :
// int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols :
// int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers :
// int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols : int,dmrs_port :
// int,dmrs_nscid : int,nb_antennas_rx : int,number_of_bits : buffer,data
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
int dmrs_port = get_dmrs_port(0, pusch_pdu->dmrs_ports);
// int num_bytes = rdata->Kr_bytes - (ulsch_harq->F >> 3) - ((ulsch_harq->C > 1) ? 3 : 0);
// printf("num_bytes %d, len with CRC %d, data len %d\n", num_bytes, lenWithCrc(1, rdata->A), rdata->A);
// calculate the number of dmrs symbols in the slot
int number_dmrs_symbols = 0;
for (int l = pusch_pdu->start_symbol_index; l < pusch_pdu->start_symbol_index + pusch_pdu->nr_of_symbols; l++)
number_dmrs_symbols += ((pusch_pdu->ul_dmrs_symb_pos) >> l) & 0x01;
// Log GNB_PHY_UL_PAYLOAD_RX_BITS using T-Tracer if activated
T(T_GNB_PHY_UL_PAYLOAD_RX_BITS,
T_INT((int)ulsch->frame),
T_INT((int)ulsch->slot),
T_INT((int)split_time_stamp_and_convert_to_int(trace_rx_payload_time_stamp_str, 0, 8)),
T_INT((int)split_time_stamp_and_convert_to_int(trace_rx_payload_time_stamp_str, 8, 9)),
T_INT((int)frame_parms->frame_type), // Frame type (0 FDD, 1 TDD) frame_structure
T_INT((int)frame_parms->freq_range), // Frequency range (0 FR1, 1 FR2)
T_INT((int)pusch_pdu->subcarrier_spacing), // Subcarrier spacing (0 15kHz, 1 30kHz, 2 60kHz)
T_INT((int)pusch_pdu->cyclic_prefix), // Normal or extended prefix (0 normal, 1 extended)
T_INT((int)frame_parms->symbols_per_slot), // Number of symbols per slot
T_INT((int)frame_parms->Nid_cell),
T_INT((int)pusch_pdu->rnti),
T_INT((int)pusch_pdu->rb_size),
T_INT((int)pusch_pdu->rb_start),
T_INT((int)pusch_pdu->start_symbol_index), // start_ofdm_symbol
T_INT((int)pusch_pdu->nr_of_symbols), // num_ofdm_symbols
T_INT((int)pusch_pdu->qam_mod_order), // modulation
T_INT((int)pusch_pdu->mcs_index), // mcs
T_INT((int)pusch_pdu->mcs_table), // mcs_table_index
T_INT((int)pusch_pdu->nrOfLayers), // num_layer
T_INT((int)pusch_pdu->transform_precoding), // transformPrecoder_enabled = 0, transformPrecoder_disabled = 1
T_INT((int)pusch_pdu->dmrs_config_type), // dmrs_resource_map_config: pusch_dmrs_type1 = 0, pusch_dmrs_type2 = 1
T_INT((int)pusch_pdu->ul_dmrs_symb_pos), // used to derive the DMRS symbol positions
T_INT((int)number_dmrs_symbols),
// dmrs_start_ofdm_symbol
// dmrs_duration_num_ofdm_symbols
// dmrs_num_add_positions
T_INT((int)dmrs_port), // dmrs_antenna_port
T_INT((int)pusch_pdu->scid), // dmrs_nscid
T_INT((int)frame_parms->nb_antennas_rx), // rx antenna
T_INT((pusch_pdu->pusch_data.tb_size << 3)), // number_of_bits
T_BUFFER((uint8_t *)((ulsch_harq->b)), pusch_pdu->pusch_data.tb_size)); // data
log_ul_payload_rx_bits(ulsch->frame, ulsch->slot, frame_parms, pusch_pdu,
number_dmrs_symbols, dmrs_port,
(const uint8_t *)ulsch_harq->b,
pusch_pdu->pusch_data.tb_size);
}
#endif