Merge remote-tracking branch 'origin/t-tracer-nrue-macpdu' into integration_2024_w49 (!3137)
T tracer: add macpdu traces for the NR UE MIB, SIB1, random access and regular scheduling are traced. At the beginning of a connection (rrc setup request and rrc setup), the RNTI is reported as 0. Might be fixed, somehow, if absolutely needed (not sure).
This commit is contained in:
@@ -301,6 +301,12 @@ int8_t nr_ue_decode_BCCH_DL_SCH(NR_UE_MAC_INST_t *mac,
|
||||
nr_mac_rrc_data_ind_ue(mac->ue_id, cc_id, gNB_index, 0, 0, 0, mac->physCellId, 0, NR_BCCH_DL_SCH, (uint8_t *) pduP, pdu_len);
|
||||
mac->get_sib1 = false;
|
||||
mac->get_otherSI = false;
|
||||
T(T_NRUE_MAC_DL_PDU_WITH_DATA,
|
||||
T_INT(SI_RNTI),
|
||||
T_INT(-1 /* frame, unavailable here */),
|
||||
T_INT(-1 /* slot, unavailable here */),
|
||||
T_INT(0 /* harq_pid */),
|
||||
T_BUFFER(pduP, pdu_len));
|
||||
}
|
||||
else
|
||||
LOG_E(NR_MAC, "Got NACK on NR-BCCH-DL-SCH-Message (%s)\n", mac->get_sib1 ? "SIB1" : "other SI");
|
||||
@@ -3588,8 +3594,9 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i
|
||||
{
|
||||
frame_t frameP = dl_info->frame;
|
||||
int slot = dl_info->slot;
|
||||
uint8_t *pduP = (dl_info->rx_ind->rx_indication_body + pdu_id)->pdsch_pdu.pdu;
|
||||
int32_t pdu_len = (int32_t)(dl_info->rx_ind->rx_indication_body + pdu_id)->pdsch_pdu.pdu_length;
|
||||
fapi_nr_pdsch_pdu_t *pdsch_pdu = &(dl_info->rx_ind->rx_indication_body + pdu_id)->pdsch_pdu;
|
||||
uint8_t *pduP = pdsch_pdu->pdu;
|
||||
int32_t pdu_len = (int32_t)pdsch_pdu->pdu_length;
|
||||
uint8_t gNB_index = dl_info->gNB_index;
|
||||
uint8_t CC_id = dl_info->cc_id;
|
||||
uint8_t done = 0;
|
||||
@@ -3599,6 +3606,8 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i
|
||||
return;
|
||||
}
|
||||
|
||||
T(T_NRUE_MAC_DL_PDU_WITH_DATA, T_INT(mac->crnti), T_INT(frameP), T_INT(slot), T_INT(pdsch_pdu->harq_pid), T_BUFFER(pduP, pdu_len));
|
||||
|
||||
LOG_D(MAC,
|
||||
"[%d.%d]: processing PDU %d (with length %d) of %d total number of PDUs...\n",
|
||||
frameP,
|
||||
@@ -3964,6 +3973,9 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d
|
||||
uint8_t preamble_index = ra->ra_PreambleIndex;
|
||||
uint16_t rnti = mac->ra.ra_rnti;
|
||||
|
||||
T(T_NRUE_MAC_DL_RAR_PDU_WITH_DATA, T_INT(rnti), T_INT(frame), T_INT(slot),
|
||||
T_BUFFER(dlsch_buffer, dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.pdu_length));
|
||||
|
||||
LOG_D(NR_MAC, "[%d.%d]: [UE %d][RAPROC] invoking MAC for received RAR (current preamble %d)\n", frame, slot, mac->ue_id, preamble_index);
|
||||
|
||||
while (1) {
|
||||
|
||||
@@ -1599,6 +1599,8 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info)
|
||||
pdu->tx_request_body.fapiTxPdu = ulsch_input_buffer;
|
||||
pdu->tx_request_body.pdu_length = TBS_bytes;
|
||||
number_of_pdus++;
|
||||
T(T_NRUE_MAC_UL_PDU_WITH_DATA, T_INT(mac->crnti), T_INT(frame_tx), T_INT(slot_tx),
|
||||
T_INT(ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id), T_BUFFER(ulsch_input_buffer, TBS_bytes));
|
||||
} else {
|
||||
if (ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator
|
||||
&& (mac->state == UE_CONNECTED || (ra->ra_state == nrRA_WAIT_RAR && ra->cfra))) {
|
||||
@@ -1626,6 +1628,8 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info)
|
||||
pdu->tx_request_body.fapiTxPdu = ulsch_input_buffer;
|
||||
pdu->tx_request_body.pdu_length = TBS_bytes;
|
||||
number_of_pdus++;
|
||||
T(T_NRUE_MAC_UL_PDU_WITH_DATA, T_INT(mac->crnti), T_INT(frame_tx), T_INT(slot_tx),
|
||||
T_INT(ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id), T_BUFFER(ulsch_input_buffer, TBS_bytes));
|
||||
// start or restart dataInactivityTimer if any MAC entity transmits a MAC SDU for DTCH logical channel,
|
||||
// or DCCH logical channel
|
||||
if (mac->data_inactivity_timer)
|
||||
@@ -2965,6 +2969,9 @@ static void nr_ue_prach_scheduler(NR_UE_MAC_INST_t *mac, frame_t frameP, sub_fra
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
|
||||
T(T_UE_PHY_INITIATE_RA_PROCEDURE, T_INT(frameP), T_INT(pdu->prach_config_pdu.prach_slot),
|
||||
T_INT(pdu->prach_config_pdu.ra_PreambleIndex), T_INT(pdu->prach_config_pdu.prach_tx_power));
|
||||
|
||||
if (ra->ra_type == RA_4_STEP) {
|
||||
nr_Msg1_transmitted(mac);
|
||||
} else if (ra->ra_type == RA_2_STEP) {
|
||||
|
||||
@@ -1693,6 +1693,14 @@ static void nr_generate_Msg2(module_id_t module_idP,
|
||||
|
||||
LOG_A(NR_MAC, "%d.%d Send RAR to RA-RNTI %04x\n", frameP, slotP, ra->RA_rnti);
|
||||
|
||||
tx_req->PDU_index = pduindex;
|
||||
tx_req->num_TLV = 1;
|
||||
tx_req->TLVs[0].length = pdsch_pdu_rel15->TBSize[0];
|
||||
tx_req->PDU_length = compute_PDU_length(tx_req->num_TLV, pdsch_pdu_rel15->TBSize[0]);
|
||||
TX_req->SFN = frameP;
|
||||
TX_req->Number_of_PDUs++;
|
||||
TX_req->Slot = slotP;
|
||||
|
||||
T(T_GNB_MAC_DL_RAR_PDU_WITH_DATA,
|
||||
T_INT(module_idP),
|
||||
T_INT(CC_id),
|
||||
@@ -1702,14 +1710,6 @@ static void nr_generate_Msg2(module_id_t module_idP,
|
||||
T_INT(0),
|
||||
T_BUFFER(&tx_req->TLVs[0].value.direct[0], tx_req->TLVs[0].length));
|
||||
|
||||
tx_req->PDU_index = pduindex;
|
||||
tx_req->num_TLV = 1;
|
||||
tx_req->TLVs[0].length = pdsch_pdu_rel15->TBSize[0];
|
||||
tx_req->PDU_length = compute_PDU_length(tx_req->num_TLV, pdsch_pdu_rel15->TBSize[0]);
|
||||
TX_req->SFN = frameP;
|
||||
TX_req->Number_of_PDUs++;
|
||||
TX_req->Slot = slotP;
|
||||
|
||||
// Mark the corresponding symbols RBs as used
|
||||
fill_pdcch_vrb_map(nr_mac, CC_id, &ra->sched_pdcch, CCEIndex, aggregation_level, beam.idx);
|
||||
for (int rb = 0; rb < rbSize; rb++) {
|
||||
|
||||
Reference in New Issue
Block a user