Add traces on UE PHY UL and related requirement: Tx Scrambled bits and Tx payload bits
- Update input parameters to nr_ulsch_encoding () in nr_transport_proto_ue.h to get number_dmrs_symbols to be added to meta-data. - 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. - 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. - Fix the input prameters in nr_ulsch_encoding () called in (openair1/SIMULATION/NR_PHY/ulschsim.c) since a new input parameter has been added.
This commit is contained in:
committed by
Bartosz Podrygajlo
parent
8caf326134
commit
e0c5621d60
@@ -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;
|
||||
|
||||
@@ -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