DL Post processor: distinguish tx/retx
This commit is contained in:
@@ -573,6 +573,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
|||||||
if (sched_ctrl->rbSize <= 0 && !get_softmodem_params()->phy_test)
|
if (sched_ctrl->rbSize <= 0 && !get_softmodem_params()->phy_test)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
const rnti_t rnti = UE_info->rnti[UE_id];
|
||||||
|
|
||||||
/* POST processing */
|
/* POST processing */
|
||||||
struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList =
|
struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList =
|
||||||
sched_ctrl->active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
sched_ctrl->active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||||
@@ -600,6 +602,67 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
|||||||
1 /* nrOfLayers */)
|
1 /* nrOfLayers */)
|
||||||
>> 3;
|
>> 3;
|
||||||
|
|
||||||
|
const int current_harq_pid = sched_ctrl->current_harq_pid;
|
||||||
|
NR_UE_harq_t *harq = &sched_ctrl->harq_processes[current_harq_pid];
|
||||||
|
NR_sched_pucch *pucch = &sched_ctrl->sched_pucch[sched_ctrl->pucch_sched_idx];
|
||||||
|
harq->feedback_slot = pucch->ul_slot;
|
||||||
|
harq->is_waiting = 1;
|
||||||
|
UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++;
|
||||||
|
|
||||||
|
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
|
||||||
|
nr_fill_nfapi_dl_pdu(module_id,
|
||||||
|
UE_id,
|
||||||
|
sched_ctrl->active_bwp->bwp_Id,
|
||||||
|
sched_ctrl->search_space,
|
||||||
|
sched_ctrl->coreset,
|
||||||
|
dl_req,
|
||||||
|
pucch,
|
||||||
|
1 /* nrOfLayers */,
|
||||||
|
sched_ctrl->mcs,
|
||||||
|
sched_ctrl->rbSize,
|
||||||
|
sched_ctrl->rbStart,
|
||||||
|
sched_ctrl->numDmrsCdmGrpsNoData,
|
||||||
|
getDmrsConfigType(sched_ctrl->active_bwp),
|
||||||
|
sched_ctrl->mcsTableIdx,
|
||||||
|
nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
|
||||||
|
nr_get_Qm_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
|
||||||
|
TBS,
|
||||||
|
sched_ctrl->time_domain_allocation,
|
||||||
|
startSymbolIndex,
|
||||||
|
nrOfSymbols,
|
||||||
|
sched_ctrl->aggregation_level,
|
||||||
|
sched_ctrl->cce_index,
|
||||||
|
current_harq_pid,
|
||||||
|
harq->ndi,
|
||||||
|
harq->round);
|
||||||
|
|
||||||
|
NR_UE_ret_info_t *retInfo = &sched_ctrl->retInfo[current_harq_pid];
|
||||||
|
if (harq->round != 0) { /* retransmission */
|
||||||
|
if (sched_ctrl->rbSize != retInfo->rbSize)
|
||||||
|
LOG_W(MAC,
|
||||||
|
"retransmission uses different rbSize (%d vs. orig %d)\n",
|
||||||
|
sched_ctrl->rbSize,
|
||||||
|
retInfo->rbSize);
|
||||||
|
if (sched_ctrl->time_domain_allocation != retInfo->time_domain_allocation)
|
||||||
|
LOG_W(MAC,
|
||||||
|
"retransmission uses different time_domain_allocation (%d vs. orig %d)\n",
|
||||||
|
sched_ctrl->time_domain_allocation,
|
||||||
|
retInfo->time_domain_allocation);
|
||||||
|
if (sched_ctrl->mcs != retInfo->mcs
|
||||||
|
|| sched_ctrl->mcsTableIdx != retInfo->mcsTableIdx
|
||||||
|
|| sched_ctrl->numDmrsCdmGrpsNoData != retInfo->numDmrsCdmGrpsNoData)
|
||||||
|
LOG_W(MAC,
|
||||||
|
"retransmission uses different table/MCS/numDmrsCdmGrpsNoData (%d/%d/%d vs. orig %d/%d/%d)\n",
|
||||||
|
sched_ctrl->mcsTableIdx,
|
||||||
|
sched_ctrl->mcs,
|
||||||
|
sched_ctrl->numDmrsCdmGrpsNoData,
|
||||||
|
retInfo->mcsTableIdx,
|
||||||
|
retInfo->mcs,
|
||||||
|
retInfo->numDmrsCdmGrpsNoData);
|
||||||
|
/* we do not have to do anything, since we do not require to get data
|
||||||
|
* from RLC, encode MAC CEs, or copy data to FAPI structures */
|
||||||
|
LOG_W(MAC, "%d.%2d retransmission UE %d/RNTI %04x\n", frame, slot, UE_id, rnti);
|
||||||
|
} else { /* initial transmission */
|
||||||
/* Get RLC data TODO: remove random data retrieval */
|
/* Get RLC data TODO: remove random data retrieval */
|
||||||
int header_length_total = 0;
|
int header_length_total = 0;
|
||||||
int header_length_last = 0;
|
int header_length_last = 0;
|
||||||
@@ -608,7 +671,6 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
|||||||
uint16_t sdu_lengths[NB_RB_MAX] = {0};
|
uint16_t sdu_lengths[NB_RB_MAX] = {0};
|
||||||
uint8_t mac_sdus[MAX_NR_DLSCH_PAYLOAD_BYTES];
|
uint8_t mac_sdus[MAX_NR_DLSCH_PAYLOAD_BYTES];
|
||||||
unsigned char sdu_lcids[NB_RB_MAX] = {0};
|
unsigned char sdu_lcids[NB_RB_MAX] = {0};
|
||||||
const rnti_t rnti = UE_info->rnti[UE_id];
|
|
||||||
const int lcid = DL_SCH_LCID_DTCH;
|
const int lcid = DL_SCH_LCID_DTCH;
|
||||||
if (sched_ctrl->num_total_bytes > 0) {
|
if (sched_ctrl->num_total_bytes > 0) {
|
||||||
LOG_D(MAC,
|
LOG_D(MAC,
|
||||||
@@ -689,49 +751,14 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
|||||||
gNB_mac->UE_info.DLSCH_pdu[0][0].payload[0][offset + j] = 0;
|
gNB_mac->UE_info.DLSCH_pdu[0][0].payload[0][offset + j] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int current_harq_pid = sched_ctrl->current_harq_pid;
|
|
||||||
NR_UE_harq_t *harq = &sched_ctrl->harq_processes[current_harq_pid];
|
|
||||||
NR_sched_pucch *pucch = &sched_ctrl->sched_pucch[sched_ctrl->pucch_sched_idx];
|
|
||||||
harq->feedback_slot = pucch->ul_slot;
|
|
||||||
harq->is_waiting = 1;
|
|
||||||
UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++;
|
|
||||||
if (harq->round == 0)
|
|
||||||
UE_info->mac_stats[UE_id].dlsch_total_bytes += TBS;
|
UE_info->mac_stats[UE_id].dlsch_total_bytes += TBS;
|
||||||
|
|
||||||
NR_UE_ret_info_t *retInfo = &sched_ctrl->retInfo[current_harq_pid];
|
|
||||||
retInfo->rbSize = sched_ctrl->rbSize;
|
retInfo->rbSize = sched_ctrl->rbSize;
|
||||||
retInfo->time_domain_allocation = sched_ctrl->time_domain_allocation;
|
retInfo->time_domain_allocation = sched_ctrl->time_domain_allocation;
|
||||||
retInfo->mcsTableIdx = sched_ctrl->mcsTableIdx;
|
retInfo->mcsTableIdx = sched_ctrl->mcsTableIdx;
|
||||||
retInfo->mcs = sched_ctrl->mcs;
|
retInfo->mcs = sched_ctrl->mcs;
|
||||||
retInfo->numDmrsCdmGrpsNoData = sched_ctrl->numDmrsCdmGrpsNoData;
|
retInfo->numDmrsCdmGrpsNoData = sched_ctrl->numDmrsCdmGrpsNoData;
|
||||||
|
|
||||||
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
|
|
||||||
nr_fill_nfapi_dl_pdu(module_id,
|
|
||||||
UE_id,
|
|
||||||
sched_ctrl->active_bwp->bwp_Id,
|
|
||||||
sched_ctrl->search_space,
|
|
||||||
sched_ctrl->coreset,
|
|
||||||
dl_req,
|
|
||||||
pucch,
|
|
||||||
1 /* nrOfLayers */,
|
|
||||||
sched_ctrl->mcs,
|
|
||||||
sched_ctrl->rbSize,
|
|
||||||
sched_ctrl->rbStart,
|
|
||||||
sched_ctrl->numDmrsCdmGrpsNoData,
|
|
||||||
getDmrsConfigType(sched_ctrl->active_bwp),
|
|
||||||
sched_ctrl->mcsTableIdx,
|
|
||||||
nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
|
|
||||||
nr_get_Qm_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
|
|
||||||
TBS,
|
|
||||||
sched_ctrl->time_domain_allocation,
|
|
||||||
startSymbolIndex,
|
|
||||||
nrOfSymbols,
|
|
||||||
sched_ctrl->aggregation_level,
|
|
||||||
sched_ctrl->cce_index,
|
|
||||||
current_harq_pid,
|
|
||||||
harq->ndi,
|
|
||||||
harq->round);
|
|
||||||
|
|
||||||
nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[gNB_mac->TX_req[CC_id].Number_of_PDUs];
|
nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[gNB_mac->TX_req[CC_id].Number_of_PDUs];
|
||||||
configure_fapi_dl_Tx(module_id,
|
configure_fapi_dl_Tx(module_id,
|
||||||
frame,
|
frame,
|
||||||
@@ -748,10 +775,13 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
|||||||
frame,
|
frame,
|
||||||
slot,
|
slot,
|
||||||
TBS);
|
TBS);
|
||||||
for(int i = 0; i < 10; i++) {
|
for(int i = 0; i < 10; i++)
|
||||||
LOG_I(MAC, "byte %d : %x\n", i,((uint8_t *)gNB_mac->UE_info.DLSCH_pdu[0][0].payload[0])[i]);
|
LOG_I(MAC,
|
||||||
}
|
"byte %d: %x\n",
|
||||||
|
i,
|
||||||
|
((uint8_t *)gNB_mac->UE_info.DLSCH_pdu[0][0].payload[0])[i]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user