Commit c2e53453 authored by Marius Tillner's avatar Marius Tillner

added downlink latseq points for latency measurement

parent 6320e807
......@@ -54,6 +54,8 @@
#include <executables/softmodem-common.h>
#include "common/utils/LATSEQ/latseq.h"
#ifdef SMBV
#include "PHY/TOOLS/smbv.h"
unsigned short config_frames[4] = {2,9,11,13};
......@@ -723,6 +725,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
LATSEQ_P("D phy.tosend--phy.sended", "len%u::fm%u.sl%u", 1, frame, slot);
RU_proc_t *proc = &ru->proc;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
nfapi_nr_config_request_scf_t *cfg = &ru->config;
......@@ -825,6 +828,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
(long long unsigned int)(timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension),frame,slot,proc->frame_tx_unwrap,slot, flags, siglen+sf_extension, txs,10*log10((double)signal_energy(txp[0],siglen+sf_extension)));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
//AssertFatal(txs == 0,"trx write function error %d\n", txs);
LATSEQ_P("D phy.sended--phy.out", "len%u::fm%u.sl%u", (siglen+sf_extension)*sizeof(int32_t), frame, slot);
}
}
......@@ -1026,8 +1030,10 @@ void ru_tx_func(void *param) {
// do TX front-end processing if needed (precoding and/or IDFTs)
if (ru->feptx_prec) ru->feptx_prec(ru,frame_tx,slot_tx);
// do OFDM with/without TX front-end processing if needed
// do OFDM with/without TX front-end processing if
LATSEQ_P("D phy.ofdm.idft.start--phy.ofdm.idft.end", "len%u::fm%u.sl%u", 1, frame_tx, slot_tx);
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru,frame_tx,slot_tx);
LATSEQ_P("D phy.ofdm.idft.end--phy.tosend", "len%u::fm%u.sl%u", 1, frame_tx, slot_tx);
if(!emulate_rf) {
// do outgoing fronthaul (south) if needed
......
......@@ -39,6 +39,7 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/utils/nr/nr_common.h"
#include "executables/softmodem-common.h"
#include "common/utils/LATSEQ/latseq.h"
//#define DEBUG_DLSCH
//#define DEBUG_DLSCH_MAPPING
......@@ -129,13 +130,14 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers] __attribute__((aligned(32)));
bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers);
start_meas(dlsch_encoding_stats);
LATSEQ_P("D phy.dlschencoding--phy.dlschencoded", "len%u::fm%u.sl%u.dlschid%u", 1, frame, slot, dlsch_id);
if (nr_dlsch_encoding(gNB,
frame, slot, harq, frame_parms,output,tinput,tprep,tparity,toutput,
dlsch_rate_matching_stats,
dlsch_interleaving_stats,
dlsch_segmentation_stats) == -1)
return;
LATSEQ_P("D phy.dlschencoded--phy.scrambling", "len%u::fm%u.sl%u.dlschid%u", 1, frame, slot, dlsch_id);
stop_meas(dlsch_encoding_stats);
#ifdef DEBUG_DLSCH
printf("PDSCH encoding:\nPayload:\n");
......@@ -159,6 +161,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
for (int q=0; q<rel15->NrOfCodewords; q++) {
/// scrambling
start_meas(dlsch_scrambling_stats);
LATSEQ_P("D phy.scrambling--phy.scrambled", "len%u::fm%u.sl%u.codeword%u", 1, frame, slot, q);
uint32_t scrambled_output[(encoded_length>>5)+4]; // modulator acces by 4 bytes in some cases
memset(scrambled_output, 0, sizeof(scrambled_output));
if ( encoded_length > rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers) abort();
......@@ -168,7 +171,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
rel15->dataScramblingId,
rel15->rnti,
scrambled_output);
LATSEQ_P("D phy.scrambled--phy.modulating", "len%u::fm%u.sl%u.codeword%u", 1, frame, slot, q);
#ifdef DEBUG_DLSCH
printf("PDSCH scrambling:\n");
for (int i=0; i<encoded_length>>8; i++) {
......@@ -181,10 +184,12 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
stop_meas(dlsch_scrambling_stats);
/// Modulation
start_meas(dlsch_modulation_stats);
LATSEQ_P("D phy.modulating--phy.modulated", "len%u::fm%u.sl%u.codeword%u.qm%u", 1, frame, slot, q, Qm);
nr_modulation(scrambled_output,
encoded_length,
Qm,
mod_symbs[q]);
LATSEQ_P("D phy.modulated--phy.layermapping", "len%u::fm%u.sl%u.codeword%u.qm%u", 1, frame, slot, q, Qm);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION, 0);
stop_meas(dlsch_modulation_stats);
#ifdef DEBUG_DLSCH
......@@ -200,10 +205,12 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
start_meas(&gNB->dlsch_layer_mapping_stats);
/// Layer mapping
LATSEQ_P("D phy.layermapping--phy.layermapped", "len%u::fm%u.sl%u", 1, frame, slot);
nr_layer_mapping(mod_symbs,
rel15->nrOfLayers,
nb_re,
tx_layers);
LATSEQ_P("D phy.layermapped--phy.resourcemapping", "len%u::fm%u.sl%u", 1, frame, slot);
#ifdef DEBUG_DLSCH
printf("Layer mapping (%d layers):\n", rel15->nrOfLayers);
for (int l=0; l<rel15->nrOfLayers; l++)
......@@ -236,6 +243,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
#endif
start_meas(&gNB->dlsch_resource_mapping_stats);
LATSEQ_P("D phy.resourcemapping--phy.resourcemapped", "len%u::fm%u.sl%u", 1, frame, slot);
for (int nl=0; nl<rel15->nrOfLayers; nl++) {
int dmrs_port = get_dmrs_port(nl,rel15->dmrsPorts);
......@@ -446,7 +454,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
} // N_RB_DL even
} // no DMRS/PTRS in symbol
} // symbol loop
}// layer loop
}// layer
LATSEQ_P("D phy.resourcemapped--phy.precoding", "len%u::fm%u.sl%u", 1, frame, slot);
stop_meas(&gNB->dlsch_resource_mapping_stats);
///Layer Precoding and Antenna port mapping
......@@ -457,7 +466,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
// The Precoding matrix:
// The Codebook Type I
start_meas(&gNB->dlsch_precoding_stats);
LATSEQ_P("D phy.precoding--phy.precoded", "len%u::fm%u.sl%u", 1, frame, slot);
for (int ap=0; ap<frame_parms->nb_antennas_tx; ap++) {
for (int l=rel15->StartSymbolIndex; l<rel15->StartSymbolIndex+rel15->NrOfSymbols; l++) {
......@@ -542,7 +551,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
} //RB loop
} // symbol loop
}// port loop
LATSEQ_P("D phy.precoded--phy.pdsch.end", "len%u::fm%u.sl%u", 1, frame, slot);
stop_meas(&gNB->dlsch_precoding_stats);
// TODO: handle precoding
......
......@@ -44,6 +44,7 @@
#include <time.h>
#include "intertask_interface.h"
#include "common/utils/LATSEQ/latseq.h"
//#define DEBUG_RXDATA
//#define SRS_IND_DEBUG
......@@ -118,6 +119,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
int slot,
int do_meas) {
LATSEQ_P("D phy.procedures.start--phy.procedures.end", "len%u::fm%u.sl%u", 1, frame, slot);
int aa;
PHY_VARS_gNB *gNB = msgTx->gNB;
NR_DL_FRAME_PARMS *fp=&gNB->frame_parms;
......@@ -180,7 +182,9 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
if (msgTx->num_pdsch_slot > 0) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1);
LOG_D(PHY, "PDSCH generation started (%d) in frame %d.%d\n", msgTx->num_pdsch_slot,frame,slot);
LATSEQ_P("D phy.pdsch.start--phy.dlschencoding", "len%u::fm%u.sl%u", 1, frame, slot);
nr_generate_pdsch(msgTx, frame, slot);
LATSEQ_P("D phy.pdsch.end--phy.procedures.end", "len%u::fm%u.sl%u", 1, frame, slot);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,0);
}
......@@ -206,6 +210,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0);
LATSEQ_P("D phy.procedures.end--phy.ofdm.idft.start", "len%u::fm%u.sl%u", 1, frame, slot);
}
void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
......
......@@ -45,6 +45,8 @@
#include "executables/softmodem-common.h"
#include "../../../nfapi/oai_integration/vendor_ext.h"
#include "common/utils/LATSEQ/latseq.h"
////////////////////////////////////////////////////////
/////* DLSCH MAC PDU generation (6.1.2 TS 38.321) */////
////////////////////////////////////////////////////////
......@@ -1127,6 +1129,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
pdcch_pdu->DurationSymbols);
if (harq->round != 0) { /* retransmission */
LATSEQ_P("D mac.retx--phy.procedures.start", "len%u::fm%u.sl%u.hqpid%u.hqround%u", TBS, frame, slot, current_harq_pid, harq->round);
/* we do not have to do anything, since we do not require to get data
* from RLC or encode MAC CEs. The TX_req structure is filled below
* or copy data to FAPI structures */
......@@ -1213,6 +1216,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
dlsch_total_bytes += len;
lcid_bytes += len;
sdus += 1;
LATSEQ_P("D mac.coded--phy.procedures.start", "len%u::RMbuf%u.fm%u.sl%u.lcid%u.hqpid%u.mcs%u.tbsize%u", len, buf-len, frame, slot, lcid, current_harq_pid, sched_pdsch->mcs, sched_pdsch->tb_size);
}
UE->mac_stats.dl.lc_bytes[lcid] += lcid_bytes;
......
......@@ -31,6 +31,7 @@
#include "nr_pdcp_sdu.h"
#include "LOG/log.h"
#include "common/utils/LATSEQ/latseq.h"
static void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity,
char *_buffer, int size)
......@@ -241,6 +242,7 @@ static void nr_pdcp_entity_recv_sdu(nr_pdcp_entity_t *entity,
entity->security_mode_completed = true;
}
LATSEQ_P("D pdcp.coded--pdcp.enqueue", "len%u::SPbuf%u.sn%u.Pbuf%u", header_size+size+integrity_size, buffer, sn, buf);
entity->tx_next++;
entity->deliver_pdu(entity->deliver_pdu_data, entity, buf,
......
......@@ -31,6 +31,7 @@
#include "NR_CellGroupConfig.h"
#include "openair2/RRC/NR/nr_rrc_proto.h"
#include <stdint.h>
#include "common/utils/LATSEQ/latseq.h"
/* from OAI */
#include "oai_asn1.h"
......@@ -694,6 +695,7 @@ rb_found:
LOG_D(PDCP, "%s(): (drb %d) calling rlc_data_req size %d\n", __func__, rb_id, size);
//for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]);
//printf("\n");
LATSEQ_P("D pdcp.enqueue--rlc.sdu", "len%u::Pbuf%u.PRbuf%u", size, buf, memblock->data);
enqueue_rlc_data_req(&ctxt, 0, MBMS_FLAG_NO, rb_id, sdu_id, 0, size, memblock);
}
}
......
......@@ -28,6 +28,7 @@
#include "LOG/log.h"
#include "common/utils/time_stat.h"
#include "common/utils/LATSEQ/latseq.h"
/* for a given SDU/SDU segment, computes the corresponding PDU header size */
static int compute_pdu_header_size(nr_rlc_entity_am_t *entity,
......@@ -1468,6 +1469,7 @@ static int generate_retx_pdu(nr_rlc_entity_am_t *entity, char *buffer,
int p;
sdu = entity->retransmit_list;
LATSEQ_P("D rlc.retx--TODO", "len%u::sn%u.so%u", sdu->size, sdu->sdu->sn, sdu->so);
pdu_header_size = compute_pdu_header_size(entity, sdu);
......@@ -1544,6 +1546,7 @@ static int generate_tx_pdu(nr_rlc_entity_am_t *entity, char *buffer, int size)
return 0;
sdu = entity->tx_list;
LATSEQ_P("D rlc.genpdu--rlc.coded", "len%u::Rbuf%u", sdu->size, sdu->sdu);
pdu_header_size = compute_pdu_header_size(entity, sdu);
......@@ -1615,6 +1618,7 @@ static int generate_tx_pdu(nr_rlc_entity_am_t *entity, char *buffer, int size)
entity->force_poll = 0;
}
int ret_size = serialize_sdu(entity, sdu, buffer, size, p);
LATSEQ_P("D rlc.coded--mac.coded", "len%u::Rbuf%u.sn%u.so%u.RMbuf%u", ret_size, sdu->sdu, sdu->sdu->sn, sdu->so, buffer);
entity->common.stats.txpdu_pkts++;
entity->common.stats.txpdu_bytes += ret_size;
......@@ -1697,16 +1701,19 @@ void nr_rlc_entity_am_recv_sdu(nr_rlc_entity_t *_entity,
entity->sdu_rejected);
entity->sdu_rejected = 0;
entity->t_log_buffer_full = entity->t_current;
LATSEQ_P("D rlc.sdu--rlc.rejected1", "len%u::PRbuf%u", size, buffer);
}
if (entity->tx_size + size > entity->tx_maxsize) {
entity->sdu_rejected++;
LATSEQ_P("D rlc.sdu--rlc.rejected2", "len%u::PRbuf%u", size, buffer);
return;
}
entity->tx_size += size;
sdu = nr_rlc_new_sdu(buffer, size, sdu_id);
LATSEQ_P("D rlc.sdu--rlc.genpdu", "len%u::PRbuf%u.Rbuf%u", size, buffer, sdu->sdu);
LOG_D(RLC, "Created new RLC SDU and append it to the RLC list \n");
......
......@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include "common/utils/LATSEQ/latseq.h"
typedef struct {
nr_sdap_entity_t *sdap_entity_llist;
......@@ -85,6 +86,7 @@ static bool nr_sdap_tx_entity(nr_sdap_entity_t *entity,
if(!pdcp_ent_has_sdap){
LOG_D(SDAP, "TX - DRB ID: %ld does not have SDAP\n", entity->qfi2drb_table[qfi].drb_id);
LATSEQ_P("D sdap.pdu--pdcp.coded", "len%u::SPbuf%u", sdu_buffer_size, sdu_buffer);
ret = pdcp_data_req(ctxt_p,
srb_flag,
sdap_drb_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment