Merge remote-tracking branch 'origin/data_recording_app' into integration_2025_w31 (!3462)
Synchronized Real-Time Data Recording Application Addition
The main Features of Synchronized Real-Time Data Recording Application:
- The Data Recording Application runs in parallel to the gNB or UE
server or in another server as Data Recording or Data Lake Server
- It makes use of (an extended version) of OAI’s T-tracer framework
- It communicates with base station, and user terminal
- It synchronizes and combines data traces and control information
(meta-data) from Base station and User terminal into consistent SigMF
data sets
Details on implementation addition:
- T_tracer Extension to Support up to 35 Parameters in the T() macro
- Add traces on gNB PHY UL and related requirement: FD PUSH IQ, FD DMRS, and UL Channel estimates wi/wo interpolation, and Rx Payload bits:
1. The required memories have been created and initialized in:
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
2. Those memories: memory for DMRS signals, memory for channel
estimates based on DMRS positions, memory to store slot grid with
channel coefficients based on DMRS positions after interpolation,
and memory to store extracted data including PUSCH + DMRS.
3. The input parameters to nr_pusch_channel_estimation() has been
updated to get the pointer to the added memories of
pusch_dmrs_slot_mem and pusch_ch_est_dmrs_pos_slot_mem
(openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h)
4. The DMRS grid of NR slot and the estimated channel coefficients at
DMRS locations are logged to created memories in:
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
5. The function inner_rx in
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c is updated to log
the extracted ULSCH PRBs and the interpolated channel coefficients.
6. The T-macro() has been called in
(openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c) to trace added
traces: T_GNB_PHY_UL_FD_DMRS, T_GNB_PHY_UL_FD_CHAN_EST_DMRS_POS,
T_GNB_PHY_UL_FD_PUSCH_IQ, T_GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL
- Add traces on UE PHY UL and related requirement: Tx Scrambled bits and Tx payload bits
1. Update input parameters to nr_ulsch_encoding () in
nr_transport_proto_ue.h to get number_dmrs_symbols to be added to
meta-data.
2. In nr_ulsch_coding.c: Trace UE PHY UL Payload TX bits (T_message:
T_UE_PHY_UL_PAYLOAD_TX_BITS) including related meta-data and UTC
time.
3. In nr_ulsch_ue.c: Trace UE PHY UL Scrambled TX bits (T_message:
T_UE_PHY_UL_SCRAMBLED_TX_BITS) including related meta-data and UTC
time.
4. Fix the input prameters in nr_ulsch_encoding () called in
(openair1/SIMULATION/NR_PHY/ulschsim.c) since a new input parameter
has been added.
- Add Data Collection Services (T-Tracers for gNB and UE)
1. Add _tracer_app_gnb and t_tracer_app_ue apps to common/utils/T/tracer/Makefile
2. Add Data collection Service for gNB: common/utils/T/tracer/t_tracer_app_gnb.c
3. Add Data Collection Service for UE: common/utils/T/tracer/t_tracer_app_ue.c
- Add Shared memory configuration
(common/utils/T/tracer/shared_memory_config.h), since we will have too
much memory consumption on the stack if the T-tracer is not fast
enough to process the traces or if we have too much traces. As a
result, tracers start to capture data, write data in shared memory,
then close the T-Tracer after getting the recording of N slots. The
Data recording App will read data from the shared memory.
- Add Main app of Data Recording Application v1.0 including: Config
files, SigMF Interface, Config Interface, Sync Service, and def
messages: The data recording App includes mainly the following files:
1. The main app: data_recording_app_v1.0.py that has the data control
service, interact with tracers, data sync and conversion service.
2. The configuration file:
common/utils/data_recording/config/config_data_recording.json
3. The wireless dictionary file:
common/utils/data_recording/config/wireless_link_parameter_map.yaml
4. Config Interface
(common/utils/data_recording/lib/config_interface.py) that reads
the configuration for both gNB and UE.
5. Sync interface (common/utils/data_recording/lib/sync_service.py)
that sync captured data for gNB and UE before saving them in SigMF
format
6. The SigMF Interface
(common/utils/data_recording/lib/sigmf_interface.py) to store
recorded data and meta-data in SigMF format
7. A simple script
(common/utils/data_recording/sync_validation_demo.py) to validate
that the recorded bits from gNB and UE are in Sync
- For more info look to doc/data_recording.md
This commit is contained in:
@@ -64,6 +64,8 @@ typedef struct puschAntennaProc_s {
|
||||
c16_t ***rxdataF;
|
||||
task_ans_t *ans;
|
||||
scopeData_t *scope;
|
||||
c16_t *pusch_ch_est_dmrs_pos_slot_mem;
|
||||
int dmrs_symbol_start_idx;
|
||||
} puschAntennaProc_t;
|
||||
|
||||
__attribute__((always_inline)) inline c16_t c32x16cumulVectVectWithSteps(c16_t *in1,
|
||||
@@ -149,6 +151,9 @@ static void nr_pusch_antenna_processing(void *arg)
|
||||
int re_offset = k0;
|
||||
LOG_D(PHY, "PUSCH estimation DMRS type 1, Freq-domain interpolation");
|
||||
int pilot_cnt = 0;
|
||||
#if T_TRACER
|
||||
int ch_est_cnt = 0; // To trace channel coefficients
|
||||
#endif
|
||||
|
||||
for (int n = 0; n < 3 * nb_rb_pusch; n++) {
|
||||
// LS estimation
|
||||
@@ -165,6 +170,17 @@ static void nr_pusch_antenna_processing(void *arg)
|
||||
for (int k = pilot_cnt << 1; k < (pilot_cnt << 1) + 4; k++) {
|
||||
ul_ls_est[k] = ch16;
|
||||
}
|
||||
//------------------Write channel parameters to Memory for data recording ------------------//
|
||||
#if T_TRACER
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_CHAN_EST_DMRS_POS)) {
|
||||
// Trace channel coefficients
|
||||
c16_t *pusch_ch_est_dmrs_pos_slot_mem = rdata->pusch_ch_est_dmrs_pos_slot_mem;
|
||||
int dmrs_symbol_start_idx = rdata->dmrs_symbol_start_idx;
|
||||
pusch_ch_est_dmrs_pos_slot_mem[dmrs_symbol_start_idx + delta + ch_est_cnt] = ch16; // 0, 2, 4, 6, 8, location of REs
|
||||
pusch_ch_est_dmrs_pos_slot_mem[dmrs_symbol_start_idx + delta + ch_est_cnt + 2] = ch16; // 0, 2, 4, 6, 8, location of REs
|
||||
}
|
||||
ch_est_cnt += 4;
|
||||
#endif
|
||||
pilot_cnt += 2;
|
||||
}
|
||||
c16_t ch_estimates_time[frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
|
||||
@@ -459,7 +475,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
unsigned short bwp_start_subcarrier,
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
int *max_ch,
|
||||
uint32_t *nvar)
|
||||
uint32_t *nvar,
|
||||
c16_t *pusch_dmrs_slot_mem,
|
||||
c16_t *pusch_ch_est_dmrs_pos_slot_mem)
|
||||
{
|
||||
c16_t pilot[3280] __attribute__((aligned(32)));
|
||||
|
||||
@@ -519,6 +537,20 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
LOG_I(PHY, "In %s: %d + j*(%d)\n", __FUNCTION__, pilot[i].r, pilot[i].i);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//------------------Write DMRS to Memory for Data Recording ------------------//
|
||||
int dmrs_symbol_start_idx = symbol * pusch_pdu->nrOfLayers * nb_rb_pusch * NR_NB_SC_PER_RB + nl * nb_rb_pusch * NR_NB_SC_PER_RB;
|
||||
#if T_TRACER
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_DMRS)) {
|
||||
// used by T-Tracer to trace DMRS slot grid
|
||||
int dmrs_delta = 0; // intialize it to zero currently, derive it later from above functions
|
||||
for (int i = 0; i < (6 * nb_rb_pusch); i++) {
|
||||
// the generated DMRs is a complex conjugate of mod table, so flip the sign of imag. part
|
||||
pusch_dmrs_slot_mem[dmrs_symbol_start_idx + dmrs_delta + i * 2].r = pilot[i].r; // 0, 2, 4, 6, 8, location of REs
|
||||
pusch_dmrs_slot_mem[dmrs_symbol_start_idx + dmrs_delta + i * 2].i = -pilot[i].i; // 0, 2, 4, 6, 8, location of REs
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int nest_count = 0;
|
||||
@@ -573,6 +605,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
rdata->rxdataF = gNB->common_vars.rxdataF;
|
||||
rdata->scope = gNB->scopeData;
|
||||
rdata->ans = &ans;
|
||||
rdata->pusch_ch_est_dmrs_pos_slot_mem = pusch_ch_est_dmrs_pos_slot_mem;
|
||||
rdata->dmrs_symbol_start_idx = dmrs_symbol_start_idx;
|
||||
// Call the nr_pusch_antenna_processing function
|
||||
if (job_id == num_jobs - 1) {
|
||||
// Run the last job inline
|
||||
|
||||
@@ -51,7 +51,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
unsigned short bwp_start_subcarrier,
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
int *max_ch,
|
||||
uint32_t *nvar);
|
||||
uint32_t *nvar,
|
||||
c16_t *pusch_dmrs_slot_mem,
|
||||
c16_t *pusch_ch_est_dmrs_pos_slot_mem);
|
||||
|
||||
void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB);
|
||||
|
||||
|
||||
@@ -10,9 +10,19 @@
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
#include <openair1/PHY/TOOLS/phy_scope_interface.h>
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "T.h"
|
||||
#include <sys/time.h>
|
||||
#include "PHY/log_tools.h"
|
||||
|
||||
#define INVALID_VALUE 255
|
||||
|
||||
#if T_TRACER
|
||||
static void copy_c16_data_to_slot_memory(c16_t *src, c16_t *dst_slot, int nb_re_pusch, int symbol)
|
||||
{
|
||||
memcpy(&dst_slot[nb_re_pusch * symbol], src, nb_re_pusch * sizeof(c16_t));
|
||||
}
|
||||
#endif
|
||||
|
||||
void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
|
||||
{
|
||||
|
||||
@@ -925,7 +935,9 @@ static void inner_rx(PHY_VARS_gNB *gNB,
|
||||
int length,
|
||||
int symbol,
|
||||
int output_shift,
|
||||
uint32_t nvar)
|
||||
uint32_t nvar,
|
||||
c16_t *rxFext_slot,
|
||||
c16_t *chFext_slot)
|
||||
{
|
||||
int nb_layer = rel15_ul->nrOfLayers;
|
||||
int nb_rx_ant = frame_parms->nb_antennas_rx;
|
||||
@@ -956,6 +968,16 @@ static void inner_rx(PHY_VARS_gNB *gNB,
|
||||
dmrs_symbol_flag,
|
||||
rel15_ul,
|
||||
frame_parms);
|
||||
#if T_TRACER
|
||||
int nb_re_pusch = NR_NB_SC_PER_RB * rel15_ul->rb_size;
|
||||
// Assume assume Tx and Rx = 1
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_PUSCH_IQ)) {
|
||||
copy_c16_data_to_slot_memory(rxFext[aarx], rxFext_slot, nb_re_pusch, symbol);
|
||||
}
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL)) {
|
||||
copy_c16_data_to_slot_memory(chFext[aatx][aarx], chFext_slot, nb_re_pusch, symbol);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
c16_t rho[nb_layer][nb_layer][buffer_length] __attribute__((aligned(32)));
|
||||
@@ -1062,6 +1084,8 @@ typedef struct puschSymbolProc_s {
|
||||
uint32_t nvar;
|
||||
int beam_nb;
|
||||
task_ans_t *ans;
|
||||
c16_t *pusch_ch_est_dmrs_interpl_slot_mem;
|
||||
c16_t *rxFext_slot_mem;
|
||||
} puschSymbolProc_t;
|
||||
|
||||
static void nr_pusch_symbol_processing(void *arg)
|
||||
@@ -1097,7 +1121,9 @@ static void nr_pusch_symbol_processing(void *arg)
|
||||
gNB->pusch_vars[ulsch_id].ul_valid_re_per_slot[symbol],
|
||||
symbol,
|
||||
gNB->pusch_vars[ulsch_id].log2_maxh,
|
||||
rdata->nvar);
|
||||
rdata->nvar,
|
||||
rdata->rxFext_slot_mem,
|
||||
rdata->pusch_ch_est_dmrs_interpl_slot_mem);
|
||||
|
||||
int nb_re_pusch = gNB->pusch_vars[ulsch_id].ul_valid_re_per_slot[symbol];
|
||||
// layer de-mapping
|
||||
@@ -1160,6 +1186,38 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
|
||||
LOG_D(PHY,"pusch %d.%d : bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n", frame,slot,bwp_start_subcarrier, rel15_ul->rb_start, frame_parms->first_carrier_offset);
|
||||
LOG_D(PHY,"pusch %d.%d : ul_dmrs_symb_pos %x\n",frame,slot,rel15_ul->ul_dmrs_symb_pos);
|
||||
|
||||
// Memories to store data for data recording
|
||||
int buffer_length_slot = rel15_ul->rb_size * NR_NB_SC_PER_RB * 14; // 14 OFDM Symbols per slot
|
||||
int nb_rx_ant = frame_parms->nb_antennas_rx;
|
||||
int nb_layer = rel15_ul->nrOfLayers;
|
||||
|
||||
// Initialize memory for DMRS signals
|
||||
c16_t pusch_dmrs_slot_mem[nb_layer * buffer_length_slot] __attribute__((aligned(32)));
|
||||
// Initialize memory for channel estimates based on DMRS positions
|
||||
c16_t pusch_ch_est_dmrs_pos_slot_mem[buffer_length_slot * nb_layer * nb_rx_ant] __attribute__((aligned(32)));
|
||||
// memory to store slot grid with channel coefficients based on DMRS positions after interpolation
|
||||
c16_t pusch_ch_est_dmrs_interpl_slot_mem[buffer_length_slot * nb_layer * nb_rx_ant] __attribute__((aligned(32)));
|
||||
// memory to store extracted data including PUSCH + DMRS
|
||||
c16_t rxFext_slot_mem[nb_rx_ant * buffer_length_slot] __attribute__((aligned(32)));
|
||||
|
||||
#if T_TRACER
|
||||
// Initialize memory for DMRS signals
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_DMRS))
|
||||
memset(pusch_dmrs_slot_mem, 0, sizeof(c16_t) * nb_layer * buffer_length_slot);
|
||||
|
||||
// Initialize memory for channel estimates based on DMRS positions
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_CHAN_EST_DMRS_POS))
|
||||
memset(pusch_ch_est_dmrs_pos_slot_mem, 0, sizeof(c16_t) * buffer_length_slot * nb_layer * nb_rx_ant);
|
||||
|
||||
// memory to store slot grid with channel coefficients based on DMRS positions after interpolation
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL))
|
||||
memset(pusch_ch_est_dmrs_interpl_slot_mem, 0, sizeof(c16_t) * buffer_length_slot * nb_layer * nb_rx_ant);
|
||||
|
||||
// memory to store extracted data including PUSCH + DMRS
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_PUSCH_IQ))
|
||||
memset(rxFext_slot_mem, 0, sizeof(c16_t) * buffer_length_slot * nb_rx_ant);
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------
|
||||
//------------------- Channel estimation -------------------
|
||||
//----------------------------------------------------------
|
||||
@@ -1185,7 +1243,9 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
|
||||
bwp_start_subcarrier,
|
||||
rel15_ul,
|
||||
&max_ch,
|
||||
&nvar_tmp);
|
||||
&nvar_tmp,
|
||||
pusch_dmrs_slot_mem,
|
||||
pusch_ch_est_dmrs_pos_slot_mem);
|
||||
nvar += nvar_tmp;
|
||||
}
|
||||
// measure the SNR from the channel estimation
|
||||
@@ -1412,6 +1472,8 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
|
||||
rdata->scramblingSequence = scramblingSequence;
|
||||
rdata->nvar = nvar;
|
||||
rdata->beam_nb = beam_nb;
|
||||
rdata->rxFext_slot_mem = rxFext_slot_mem;
|
||||
rdata->pusch_ch_est_dmrs_interpl_slot_mem = pusch_ch_est_dmrs_interpl_slot_mem;
|
||||
|
||||
if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
|
||||
nr_pusch_symbol_processing(rdata);
|
||||
@@ -1426,6 +1488,191 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
} // symbol loop
|
||||
|
||||
#if T_TRACER
|
||||
// Get Time Stamp for T-tracer messages
|
||||
char trace_time_stamp_str[30];
|
||||
get_time_stamp_usec(trace_time_stamp_str);
|
||||
// trace_time_stamp_str = 8 bytes timestamp = YYYYMMDD
|
||||
// + 9 bytes timestamp = HHMMSSMMM
|
||||
// Not Ready for MIMO
|
||||
int dmrs_port = get_dmrs_port(0, rel15_ul->dmrs_ports);
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_DMRS)) {
|
||||
// Log GNB_PHY_UL_FD_DMRS 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
|
||||
T(T_GNB_PHY_UL_FD_DMRS,
|
||||
T_INT((int)frame),
|
||||
T_INT((int)slot),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_time_stamp_str, 0, 8)),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_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)rel15_ul->subcarrier_spacing), // Subcarrier spacing (0 15kHz, 1 30kHz, 2 60kHz)
|
||||
T_INT((int)rel15_ul->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)rel15_ul->rnti),
|
||||
T_INT((int)rel15_ul->rb_size),
|
||||
T_INT((int)rel15_ul->rb_start),
|
||||
T_INT((int)rel15_ul->start_symbol_index), // start_ofdm_symbol
|
||||
T_INT((int)rel15_ul->nr_of_symbols), // num_ofdm_symbols
|
||||
T_INT((int)rel15_ul->qam_mod_order), // modulation
|
||||
T_INT((int)rel15_ul->mcs_index), // mcs
|
||||
T_INT((int)rel15_ul->mcs_table), // mcs_table_index
|
||||
T_INT((int)rel15_ul->nrOfLayers), // num_layer
|
||||
T_INT((int)rel15_ul->transform_precoding), // transformPrecoder_enabled = 0, transformPrecoder_disabled = 1
|
||||
T_INT((int)rel15_ul->dmrs_config_type), // dmrs_resource_map_config: pusch_dmrs_type1 = 0, pusch_dmrs_type2 = 1
|
||||
T_INT((int)rel15_ul->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)rel15_ul->scid), // dmrs_nscid
|
||||
T_INT((int)frame_parms->nb_antennas_rx), // rx antenna
|
||||
T_INT(0), // number_of_bits
|
||||
T_BUFFER((c16_t *)(&(pusch_dmrs_slot_mem[0])), rel15_ul->rb_size * NR_NB_SC_PER_RB * rel15_ul->nr_of_symbols * 4));
|
||||
}
|
||||
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_CHAN_EST_DMRS_POS)) {
|
||||
// Log GNB_PHY_UL_FD_CHAN_EST_DMRS_POS 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
|
||||
T(T_GNB_PHY_UL_FD_CHAN_EST_DMRS_POS,
|
||||
T_INT((int)frame),
|
||||
T_INT((int)slot),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_time_stamp_str, 0, 8)),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_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)rel15_ul->subcarrier_spacing), // Subcarrier spacing (0 15kHz, 1 30kHz, 2 60kHz)
|
||||
T_INT((int)rel15_ul->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)rel15_ul->rnti),
|
||||
T_INT((int)rel15_ul->rb_size),
|
||||
T_INT((int)rel15_ul->rb_start),
|
||||
T_INT((int)rel15_ul->start_symbol_index), // start_ofdm_symbol
|
||||
T_INT((int)rel15_ul->nr_of_symbols), // num_ofdm_symbols
|
||||
T_INT((int)rel15_ul->qam_mod_order), // modulation
|
||||
T_INT((int)rel15_ul->mcs_index), // mcs
|
||||
T_INT((int)rel15_ul->mcs_table), // mcs_table_index
|
||||
T_INT((int)rel15_ul->nrOfLayers), // num_layer
|
||||
T_INT((int)rel15_ul->transform_precoding), // transformPrecoder_enabled = 0, transformPrecoder_disabled = 1
|
||||
T_INT((int)rel15_ul->dmrs_config_type), // dmrs_resource_map_config: pusch_dmrs_type1 = 0, pusch_dmrs_type2 = 1
|
||||
T_INT((int)rel15_ul->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)rel15_ul->scid), // dmrs_nscid
|
||||
T_INT((int)frame_parms->nb_antennas_rx), // rx antenna
|
||||
T_INT(0), // number_of_bits
|
||||
T_BUFFER((c16_t *)(&(pusch_ch_est_dmrs_pos_slot_mem[0])), rel15_ul->rb_size * NR_NB_SC_PER_RB * rel15_ul->nr_of_symbols * 4));
|
||||
}
|
||||
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_PUSCH_IQ)) {
|
||||
// Log GNB_PHY_UL_FD_PUSCH_IQ 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
|
||||
|
||||
T(T_GNB_PHY_UL_FD_PUSCH_IQ,
|
||||
T_INT((int)frame),
|
||||
T_INT((int)slot),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_time_stamp_str, 0, 8)),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_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)rel15_ul->subcarrier_spacing), // Subcarrier spacing (0 15kHz, 1 30kHz, 2 60kHz)
|
||||
T_INT((int)rel15_ul->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)rel15_ul->rnti),
|
||||
T_INT((int)rel15_ul->rb_size),
|
||||
T_INT((int)rel15_ul->rb_start),
|
||||
T_INT((int)rel15_ul->start_symbol_index), // start_ofdm_symbol
|
||||
T_INT((int)rel15_ul->nr_of_symbols), // num_ofdm_symbols
|
||||
T_INT((int)rel15_ul->qam_mod_order), // modulation
|
||||
T_INT((int)rel15_ul->mcs_index), // mcs
|
||||
T_INT((int)rel15_ul->mcs_table), // mcs_table_index
|
||||
T_INT((int)rel15_ul->nrOfLayers), // num_layer
|
||||
T_INT((int)rel15_ul->transform_precoding), // transformPrecoder_enabled = 0, transformPrecoder_disabled = 1
|
||||
T_INT((int)rel15_ul->dmrs_config_type), // dmrs_resource_map_config: pusch_dmrs_type1 = 0, pusch_dmrs_type2 = 1
|
||||
T_INT((int)rel15_ul->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)rel15_ul->scid), // dmrs_nscid
|
||||
T_INT((int)frame_parms->nb_antennas_rx), // rx antenna
|
||||
T_INT(0), // number_of_bits
|
||||
T_BUFFER((c16_t *)(&(rxFext_slot_mem[0])),
|
||||
rel15_ul->rb_size * NR_NB_SC_PER_RB * rel15_ul->nr_of_symbols * frame_parms->nb_antennas_rx * 4));
|
||||
}
|
||||
if (T_ACTIVE(T_GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL)) {
|
||||
// Log pusch_ch_est_dmrs_interpl_slot_mem 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
|
||||
|
||||
T(T_GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL,
|
||||
T_INT((int)frame),
|
||||
T_INT((int)slot),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_time_stamp_str, 0, 8)),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_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)rel15_ul->subcarrier_spacing), // Subcarrier spacing (0 15kHz, 1 30kHz, 2 60kHz)
|
||||
T_INT((int)rel15_ul->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)rel15_ul->rnti),
|
||||
T_INT((int)rel15_ul->rb_size),
|
||||
T_INT((int)rel15_ul->rb_start),
|
||||
T_INT((int)rel15_ul->start_symbol_index), // start_ofdm_symbol
|
||||
T_INT((int)rel15_ul->nr_of_symbols), // num_ofdm_symbols
|
||||
T_INT((int)rel15_ul->qam_mod_order), // modulation
|
||||
T_INT((int)rel15_ul->mcs_index), // mcs
|
||||
T_INT((int)rel15_ul->mcs_table), // mcs_table_index
|
||||
T_INT((int)rel15_ul->nrOfLayers), // num_layer
|
||||
T_INT((int)rel15_ul->transform_precoding), // transformPrecoder_enabled = 0, transformPrecoder_disabled = 1
|
||||
T_INT((int)rel15_ul->dmrs_config_type), // dmrs_resource_map_config: pusch_dmrs_type1 = 0, pusch_dmrs_type2 = 1
|
||||
T_INT((int)rel15_ul->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)rel15_ul->scid), // dmrs_nscid
|
||||
T_INT((int)frame_parms->nb_antennas_rx), // rx antenna
|
||||
T_INT(0), // number_of_bits
|
||||
T_BUFFER(
|
||||
(c16_t *)pusch_ch_est_dmrs_interpl_slot_mem,
|
||||
rel15_ul->rb_size * NR_NB_SC_PER_RB * rel15_ul->nr_of_symbols * frame_parms->nb_antennas_rx * rel15_ul->nrOfLayers * 4));
|
||||
}
|
||||
#endif
|
||||
|
||||
join_task_ans(&ans);
|
||||
stop_meas(&gNB->rx_pusch_symbol_processing_stats);
|
||||
|
||||
|
||||
@@ -112,7 +112,8 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
const uint8_t slot,
|
||||
unsigned int *G,
|
||||
int nb_ulsch,
|
||||
uint8_t *ULSCH_ids);
|
||||
uint8_t *ULSCH_ids,
|
||||
uint16_t number_dmrs_symbols);
|
||||
|
||||
/*! \brief Perform PUSCH scrambling. TS 38.211 V15.4.0 subclause 6.3.1.1
|
||||
@param[in] in Pointer to input bits
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
|
||||
#include "executables/nr-uesoftmodem.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/log_tools.h"
|
||||
|
||||
int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
NR_UE_ULSCH_t *ulsch,
|
||||
@@ -39,7 +40,8 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
const uint8_t slot,
|
||||
unsigned int *G,
|
||||
int nb_ulsch,
|
||||
uint8_t *ULSCH_ids)
|
||||
uint8_t *ULSCH_ids,
|
||||
uint16_t number_dmrs_symbols)
|
||||
{
|
||||
start_meas_nr_ue_phy(ue, ULSCH_ENCODING_STATS);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING, VCD_FUNCTION_IN);
|
||||
@@ -108,6 +110,58 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
AssertFatal((A / 8) + 3 <= max_payload_bytes, "A %d is too big (A/8+3 = %d > %d)\n", A, (A / 8) + 3, max_payload_bytes);
|
||||
}
|
||||
|
||||
#if T_TRACER
|
||||
if (T_ACTIVE(T_UE_PHY_UL_PAYLOAD_TX_BITS)) {
|
||||
// Get Time Stamp for T-tracer messages
|
||||
char trace_tx_payload_time_stamp_str[30];
|
||||
get_time_stamp_usec(trace_tx_payload_time_stamp_str);
|
||||
// trace_time_stamp_str = 8 bytes timestamp = YYYYMMDD
|
||||
// + 9 bytes timestamp = HHMMSSMMM
|
||||
// Log UE_PHY_UL_PAYLOAD_TX_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 : nb_antennas_tx : int,number_of_bits : buffer,data Define the subcarrier spacing vector
|
||||
// int subcarrier_spacing_vect[] = {15000, 30000, 60000, 120000};
|
||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
int subcarrier_spacing_index = frame_parms->subcarrier_spacing / 15000 - 1;
|
||||
T(T_UE_PHY_UL_PAYLOAD_TX_BITS,
|
||||
T_INT((int)frame),
|
||||
T_INT((int)slot),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_tx_payload_time_stamp_str, 0, 8)),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_tx_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)subcarrier_spacing_index), // Subcarrier spacing (0 15kHz, 1 30kHz, 2 60kHz)
|
||||
T_INT((int)ulsch->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)ulsch->pusch_pdu.rnti),
|
||||
T_INT((int)ulsch->pusch_pdu.rb_size),
|
||||
T_INT((int)ulsch->pusch_pdu.rb_start),
|
||||
T_INT((int)ulsch->pusch_pdu.start_symbol_index), // start_ofdm_symbol
|
||||
T_INT((int)ulsch->pusch_pdu.nr_of_symbols), // num_ofdm_symbols
|
||||
T_INT((int)ulsch->pusch_pdu.qam_mod_order), // modulation
|
||||
T_INT((int)ulsch->pusch_pdu.mcs_index), // mcs
|
||||
T_INT((int)ulsch->pusch_pdu.mcs_table), // mcs_table_index
|
||||
T_INT((int)ulsch->pusch_pdu.nrOfLayers), // num_layer
|
||||
T_INT((int)ulsch->pusch_pdu.transform_precoding), // transformPrecoder_enabled = 0, transformPrecoder_disabled = 1
|
||||
T_INT((int)ulsch->pusch_pdu.dmrs_config_type), // dmrs_resource_map_config: pusch_dmrs_type1 = 0, pusch_dmrs_type2 = 1
|
||||
T_INT((int)ulsch->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)get_dmrs_port(0, ulsch->pusch_pdu.dmrs_ports)), // dmrs_antenna_port
|
||||
T_INT((int)ulsch->pusch_pdu.scid), // dmrs_nscid
|
||||
T_INT((int)frame_parms->nb_antennas_tx), // number of tx antennas
|
||||
T_INT((int)A), // number_of_bits
|
||||
T_BUFFER((uint8_t *)harq_process->payload_AB, A / 8));
|
||||
}
|
||||
#endif
|
||||
///////////////////////// b---->| block segmentation |---->c /////////////////////////
|
||||
|
||||
harq_process->BG = pusch_pdu->ldpcBaseGraph;
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
|
||||
#include <openair2/UTIL/OPT/opt.h>
|
||||
#include "PHY/log_tools.h"
|
||||
|
||||
//#define DEBUG_PUSCH_MAPPING
|
||||
//#define DEBUG_MAC_PDU
|
||||
@@ -543,7 +544,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
|
||||
/////////////////////////ULSCH coding/////////////////////////
|
||||
|
||||
if (nr_ulsch_encoding(UE, &phy_data->ulsch, frame, slot, G, 1, ULSCH_ids) == -1) {
|
||||
if (nr_ulsch_encoding(UE, &phy_data->ulsch, frame, slot, G, 1, ULSCH_ids, number_dmrs_symbols) == -1) {
|
||||
stop_meas_nr_ue_phy(UE, PUSCH_PROC_STATS);
|
||||
return;
|
||||
}
|
||||
@@ -602,7 +603,61 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
rnti,
|
||||
false,
|
||||
scrambled_output);
|
||||
#if T_TRACER
|
||||
if (T_ACTIVE(T_UE_PHY_UL_SCRAMBLED_TX_BITS)) {
|
||||
// Get Time Stamp for T-tracer messages
|
||||
char trace_time_stamp_str[30];
|
||||
get_time_stamp_usec(trace_time_stamp_str);
|
||||
// trace_time_stamp_str = 8 bytes timestamp = YYYYMMDD
|
||||
// + 9 bytes timestamp = HHMMSSMMM
|
||||
|
||||
int dmrs_port = get_dmrs_port(0, pusch_pdu->dmrs_ports);
|
||||
const uint8_t *in_bytes = (const uint8_t *)scrambled_output;
|
||||
|
||||
// Log UE_PHY_UL_SCRAMBLED_TX_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 : nb_antennas_tx : int,number_of_bits : buffer,data Define the subcarrier spacing vector
|
||||
// int subcarrier_spacing_vect[] = {15000, 30000, 60000, 120000};
|
||||
int subcarrier_spacing_index = frame_parms->subcarrier_spacing / 15000 - 1;
|
||||
T(T_UE_PHY_UL_SCRAMBLED_TX_BITS,
|
||||
T_INT((int)frame),
|
||||
T_INT((int)slot),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_time_stamp_str, 0, 8)),
|
||||
T_INT((int)split_time_stamp_and_convert_to_int(trace_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)subcarrier_spacing_index), // 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_tx), // number of tx antennas
|
||||
T_INT((int)available_bits), // number_of_bits
|
||||
T_BUFFER((uint8_t *)in_bytes, available_bits / 8));
|
||||
}
|
||||
#endif
|
||||
/////////////////////////ULSCH modulation/////////////////////////
|
||||
|
||||
int max_num_re = Nl * number_of_symbols * nb_rb * NR_NB_SC_PER_RB;
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file openair1/PHY/log_tools.c
|
||||
* \brief log tools used by data recording application (to be merged to existing OAI log tools)
|
||||
* \author Abdo Gaber
|
||||
* \date 2024
|
||||
* \version 1.0
|
||||
* \company Emerson, NI Test and Measurement
|
||||
* \email:
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "log_tools.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <string.h>
|
||||
#include "PHY/TOOLS/tools_defs.h"
|
||||
|
||||
// Get Time Stamp in microseconds in YYYYMMDDHHMMSSmmmuuu format
|
||||
char* get_time_stamp_usec(char time_stamp_str[])
|
||||
{
|
||||
// initialization to measure time stamp --This part should be moved to inilization part
|
||||
time_t my_time;
|
||||
struct tm* timeinfo;
|
||||
time(&my_time);
|
||||
struct timeval tv;
|
||||
|
||||
// get time stamp
|
||||
timeinfo = localtime(&my_time);
|
||||
gettimeofday(&tv, NULL);
|
||||
// Add time stamp: yyyy mm dd hh mm ss msec
|
||||
uint16_t year = timeinfo->tm_year + 1900;
|
||||
uint8_t mon = timeinfo->tm_mon + 1;
|
||||
uint8_t mday = timeinfo->tm_mday;
|
||||
uint8_t hour = timeinfo->tm_hour;
|
||||
uint8_t min = timeinfo->tm_min;
|
||||
uint8_t sec = timeinfo->tm_sec;
|
||||
uint16_t usec = (tv.tv_usec);
|
||||
// printf ("Time stamp: %d_%d_%d_%d_%d_%d_%d \n",year,mon,mday,hour,min,sec,usec);
|
||||
// sprintf(time_stamp_str, "%d_%d_%d_%d_%d_%d_%d",year,mon,mday,hour,min,sec,usec);
|
||||
sprintf(time_stamp_str, "%04d%02d%02d%02d%02d%02d%06d", year, mon, mday, hour, min, sec, usec);
|
||||
|
||||
return time_stamp_str;
|
||||
}
|
||||
|
||||
// Function to convert timestamp string to integer
|
||||
int convert_time_stamp_to_int(const char* timestamp)
|
||||
{
|
||||
return atoi(timestamp);
|
||||
}
|
||||
|
||||
int split_time_stamp_and_convert_to_int(char time_stamp_str[], int shift, int length)
|
||||
{
|
||||
char time_part[length + 1]; // Buffer to hold the date part YYYYMMDD or HHMMSSmmm
|
||||
// Copy the first 8 or 9 characters (YYYYMMDD) to HHMMSSmmm
|
||||
strncpy(time_part, time_stamp_str + shift, length);
|
||||
time_part[length] = '\0'; // Null-terminate the string
|
||||
// Convert timestamp string to integer
|
||||
return convert_time_stamp_to_int(time_part);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file openair1/PHY/log_tools.h
|
||||
* \brief log tools used by data recording application (to be merged to existing OAI log tools)
|
||||
* \author Abdo Gaber
|
||||
* \date 2024
|
||||
* \version 1.0
|
||||
* \company Emerson, NI Test and Measurement
|
||||
* \email:
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __PHY_LOG_TOOLS_H__
|
||||
#define __PHY_LOG_TOOLS_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include "PHY/TOOLS/tools_defs.h"
|
||||
|
||||
char* get_time_stamp_usec(char time_stamp_str[]);
|
||||
int convert_time_stamp_to_int(const char* timestamp);
|
||||
int split_time_stamp_and_convert_to_int(char time_stamp_str[], int shift, int length);
|
||||
|
||||
#endif /*__PHY_LOG_TOOLS_H__ */
|
||||
@@ -39,8 +39,10 @@
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "assertions.h"
|
||||
#include <time.h>
|
||||
#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
|
||||
@@ -425,6 +427,68 @@ static int nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, boo
|
||||
crc_valid = true;
|
||||
}
|
||||
}
|
||||
#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(((ulsch_harq->TBS) << 3)), // number_of_bits
|
||||
T_BUFFER((uint8_t *)((ulsch_harq->b)), ((ulsch_harq->TBS) << 3) / 8)); // data
|
||||
}
|
||||
#endif
|
||||
|
||||
nfapi_nr_crc_t *crc = &UL_INFO->crc_ind.crc_list[UL_INFO->crc_ind.number_crcs++];
|
||||
nfapi_nr_rx_data_pdu_t *pdu = &UL_INFO->rx_ind.pdu_list[UL_INFO->rx_ind.number_of_pdus++];
|
||||
|
||||
@@ -513,7 +513,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (input_fd == NULL) {
|
||||
uint8_t ULSCH_ids[] = {0};
|
||||
nr_ulsch_encoding(UE, ulsch_ue, 0, 0, &G, 1, ULSCH_ids);
|
||||
nr_ulsch_encoding(UE, ulsch_ue, 0, 0, &G, 1, ULSCH_ids, 0);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
Reference in New Issue
Block a user