Merge remote-tracking branch 'origin/develop' into NR_MIMO_memory
This commit is contained in:
@@ -214,6 +214,59 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void configure_dlsch(NR_UE_DLSCH_t *dlsch0,
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
|
||||
module_id_t module_id,
|
||||
int rnti) {
|
||||
|
||||
const uint8_t current_harq_pid = dlsch_config_pdu->harq_process_nbr;
|
||||
dlsch0->current_harq_pid = current_harq_pid;
|
||||
dlsch0->active = 1;
|
||||
dlsch0->rnti = rnti;
|
||||
|
||||
LOG_D(PHY,"current_harq_pid = %d\n", current_harq_pid);
|
||||
|
||||
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch0->harq_processes[current_harq_pid];
|
||||
AssertFatal(dlsch0_harq, "no harq_process for HARQ PID %d\n", current_harq_pid);
|
||||
|
||||
dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart;
|
||||
dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize;
|
||||
dlsch0_harq->nb_rb = dlsch_config_pdu->number_rbs;
|
||||
dlsch0_harq->start_rb = dlsch_config_pdu->start_rb;
|
||||
dlsch0_harq->nb_symbols = dlsch_config_pdu->number_symbols;
|
||||
dlsch0_harq->start_symbol = dlsch_config_pdu->start_symbol;
|
||||
dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos;
|
||||
dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType;
|
||||
dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups;
|
||||
dlsch0_harq->dmrs_ports = dlsch_config_pdu->dmrs_ports;
|
||||
dlsch0_harq->mcs = dlsch_config_pdu->mcs;
|
||||
dlsch0_harq->rvidx = dlsch_config_pdu->rv;
|
||||
dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH;
|
||||
//get nrOfLayers from DCI info
|
||||
uint8_t Nl = 0;
|
||||
for (int i = 0; i < 12; i++) { // max 12 ports
|
||||
if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1;
|
||||
}
|
||||
dlsch0_harq->Nl = Nl;
|
||||
dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table;
|
||||
downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch_config_pdu->rv, dlsch0->rnti_type);
|
||||
if (dlsch0_harq->status != ACTIVE) {
|
||||
// dlsch0_harq->status not ACTIVE due to false retransmission
|
||||
// Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status
|
||||
dlsch0->active = 0;
|
||||
update_harq_status(module_id,dlsch0->current_harq_pid,dlsch0_harq->ack);
|
||||
}
|
||||
/* PTRS */
|
||||
dlsch0_harq->PTRSFreqDensity = dlsch_config_pdu->PTRSFreqDensity;
|
||||
dlsch0_harq->PTRSTimeDensity = dlsch_config_pdu->PTRSTimeDensity;
|
||||
dlsch0_harq->PTRSPortIndex = dlsch_config_pdu->PTRSPortIndex;
|
||||
dlsch0_harq->nEpreRatioOfPDSCHToPTRS = dlsch_config_pdu->nEpreRatioOfPDSCHToPTRS;
|
||||
dlsch0_harq->PTRSReOffset = dlsch_config_pdu->PTRSReOffset;
|
||||
dlsch0_harq->pduBitmap = dlsch_config_pdu->pduBitmap;
|
||||
LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs);
|
||||
}
|
||||
|
||||
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
|
||||
bool found = false;
|
||||
@@ -221,7 +274,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
|
||||
module_id_t module_id = scheduled_response->module_id;
|
||||
uint8_t cc_id = scheduled_response->CC_id, thread_id;
|
||||
uint32_t i;
|
||||
int slot = scheduled_response->slot;
|
||||
|
||||
// Note: we have to handle the thread IDs for this. To be revisited completely.
|
||||
@@ -233,89 +285,53 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
|
||||
if(scheduled_response->dl_config != NULL){
|
||||
fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config;
|
||||
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu;
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *pdcch_config;
|
||||
pdcch_vars->nb_search_space = 0;
|
||||
|
||||
for (i = 0; i < dl_config->number_pdus; ++i){
|
||||
for (int i = 0; i < dl_config->number_pdus; ++i){
|
||||
AssertFatal(dl_config->number_pdus < FAPI_NR_DL_CONFIG_LIST_NUM,"dl_config->number_pdus %d out of bounds\n",dl_config->number_pdus);
|
||||
AssertFatal(dl_config->dl_config_list[i].pdu_type<=FAPI_NR_DL_CONFIG_TYPES,"pdu_type %d > 2\n",dl_config->dl_config_list[i].pdu_type);
|
||||
LOG_D(PHY, "In %s: frame %d slot %d received 1 DL %s PDU of %d total DL PDUs:\n",
|
||||
__FUNCTION__, scheduled_response->frame, slot, dl_pdu_type[dl_config->dl_config_list[i].pdu_type - 1], dl_config->number_pdus);
|
||||
|
||||
if (dl_config->dl_config_list[i].pdu_type == FAPI_NR_DL_CONFIG_TYPE_DCI) {
|
||||
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15;
|
||||
memcpy((void*)&pdcch_vars->pdcch_config[pdcch_vars->nb_search_space],(void*)pdcch_config,sizeof(*pdcch_config));
|
||||
pdcch_vars->nb_search_space = pdcch_vars->nb_search_space + 1;
|
||||
pdcch_vars->sfn = scheduled_response->frame;
|
||||
pdcch_vars->slot = slot;
|
||||
LOG_D(PHY,"Number of DCI SearchSpaces %d\n",pdcch_vars->nb_search_space);
|
||||
|
||||
} else {
|
||||
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15;
|
||||
uint8_t current_harq_pid = dlsch_config_pdu->harq_process_nbr;
|
||||
|
||||
if (dl_config->dl_config_list[i].pdu_type == FAPI_NR_DL_CONFIG_TYPE_DLSCH){
|
||||
dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch[thread_id][0][0];
|
||||
}
|
||||
else if (dl_config->dl_config_list[i].pdu_type == FAPI_NR_DL_CONFIG_TYPE_RA_DLSCH){
|
||||
switch(dl_config->dl_config_list[i].pdu_type) {
|
||||
case FAPI_NR_DL_CONFIG_TYPE_DCI:
|
||||
pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15;
|
||||
memcpy(&pdcch_vars->pdcch_config[pdcch_vars->nb_search_space],pdcch_config,sizeof(*pdcch_config));
|
||||
pdcch_vars->nb_search_space = pdcch_vars->nb_search_space + 1;
|
||||
pdcch_vars->sfn = scheduled_response->frame;
|
||||
pdcch_vars->slot = slot;
|
||||
LOG_D(PHY,"Number of DCI SearchSpaces %d\n",pdcch_vars->nb_search_space);
|
||||
break;
|
||||
case FAPI_NR_DL_CONFIG_TYPE_CSI_IM:
|
||||
LOG_I(PHY,"Received CSI-IM PDU at FAPI\n");
|
||||
break;
|
||||
case FAPI_NR_DL_CONFIG_TYPE_CSI_RS:
|
||||
LOG_I(PHY,"Received CSI-RS PDU at FAPI\n");
|
||||
break;
|
||||
case FAPI_NR_DL_CONFIG_TYPE_RA_DLSCH:
|
||||
dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15;
|
||||
dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch_ra[0];
|
||||
dlsch0->rnti_type = _RA_RNTI_;
|
||||
dlsch0->harq_processes[current_harq_pid]->status = ACTIVE;
|
||||
}
|
||||
else if (dl_config->dl_config_list[i].pdu_type == FAPI_NR_DL_CONFIG_TYPE_SI_DLSCH){
|
||||
dlsch0->harq_processes[dlsch_config_pdu->harq_process_nbr]->status = ACTIVE;
|
||||
configure_dlsch(dlsch0, dlsch_config_pdu, module_id,
|
||||
dl_config->dl_config_list[i].dlsch_config_pdu.rnti);
|
||||
break;
|
||||
case FAPI_NR_DL_CONFIG_TYPE_SI_DLSCH:
|
||||
dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15;
|
||||
dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch_SI[0];
|
||||
dlsch0->rnti_type = _SI_RNTI_;
|
||||
dlsch0->harq_processes[current_harq_pid]->status = ACTIVE;
|
||||
}
|
||||
|
||||
dlsch0->current_harq_pid = current_harq_pid;
|
||||
dlsch0->active = 1;
|
||||
dlsch0->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti;
|
||||
|
||||
LOG_D(PHY,"slot %d current_harq_pid = %d\n",slot, current_harq_pid);
|
||||
|
||||
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch0->harq_processes[current_harq_pid];
|
||||
if (dlsch0_harq){
|
||||
|
||||
dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart;
|
||||
dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize;
|
||||
dlsch0_harq->nb_rb = dlsch_config_pdu->number_rbs;
|
||||
dlsch0_harq->start_rb = dlsch_config_pdu->start_rb;
|
||||
dlsch0_harq->nb_symbols = dlsch_config_pdu->number_symbols;
|
||||
dlsch0_harq->start_symbol = dlsch_config_pdu->start_symbol;
|
||||
dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos;
|
||||
dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType;
|
||||
dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups;
|
||||
dlsch0_harq->dmrs_ports = dlsch_config_pdu->dmrs_ports;
|
||||
dlsch0_harq->mcs = dlsch_config_pdu->mcs;
|
||||
dlsch0_harq->rvidx = dlsch_config_pdu->rv;
|
||||
dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH;
|
||||
//get nrOfLayers from DCI info
|
||||
uint8_t Nl = 0;
|
||||
for (i = 0; i < 12; i++) { // max 12 ports
|
||||
if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1;
|
||||
}
|
||||
dlsch0_harq->Nl = Nl;
|
||||
dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table;
|
||||
downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch_config_pdu->rv, dlsch0->rnti_type);
|
||||
if (dlsch0_harq->status != ACTIVE) {
|
||||
// dlsch0_harq->status not ACTIVE due to false retransmission
|
||||
// Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status
|
||||
dlsch0->active = 0;
|
||||
update_harq_status(module_id,dlsch0->current_harq_pid,dlsch0_harq->ack);
|
||||
}
|
||||
/* PTRS */
|
||||
dlsch0_harq->PTRSFreqDensity = dlsch_config_pdu->PTRSFreqDensity;
|
||||
dlsch0_harq->PTRSTimeDensity = dlsch_config_pdu->PTRSTimeDensity;
|
||||
dlsch0_harq->PTRSPortIndex = dlsch_config_pdu->PTRSPortIndex;
|
||||
dlsch0_harq->nEpreRatioOfPDSCHToPTRS = dlsch_config_pdu->nEpreRatioOfPDSCHToPTRS;
|
||||
dlsch0_harq->PTRSReOffset = dlsch_config_pdu->PTRSReOffset;
|
||||
dlsch0_harq->pduBitmap = dlsch_config_pdu->pduBitmap;
|
||||
LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n",
|
||||
dlsch0->g_pucch, dlsch0_harq->mcs);
|
||||
}
|
||||
dlsch0->harq_processes[dlsch_config_pdu->harq_process_nbr]->status = ACTIVE;
|
||||
configure_dlsch(dlsch0, dlsch_config_pdu, module_id,
|
||||
dl_config->dl_config_list[i].dlsch_config_pdu.rnti);
|
||||
break;
|
||||
case FAPI_NR_DL_CONFIG_TYPE_DLSCH:
|
||||
dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15;
|
||||
dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch[thread_id][0][0];
|
||||
configure_dlsch(dlsch0, dlsch_config_pdu, module_id,
|
||||
dl_config->dl_config_list[i].dlsch_config_pdu.rnti);
|
||||
break;
|
||||
}
|
||||
}
|
||||
dl_config->number_pdus = 0;
|
||||
@@ -326,9 +342,9 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
fapi_nr_ul_config_request_t *ul_config = scheduled_response->ul_config;
|
||||
int pdu_done = 0;
|
||||
pthread_mutex_lock(&ul_config->mutex_ul_config);
|
||||
LOG_D(PHY, "%d.%d ul S ul_config %p pdu_done %d number_pdus %d\n", scheduled_response->frame, slot, ul_config, pdu_done, ul_config->number_pdus);
|
||||
|
||||
for (i = 0; i < ul_config->number_pdus; ++i){
|
||||
LOG_D(PHY, "%d.%d ul S ul_config %p pdu_done %d number_pdus %d\n", scheduled_response->frame, slot, ul_config, pdu_done, ul_config->number_pdus);
|
||||
for (int i = 0; i < ul_config->number_pdus; ++i){
|
||||
|
||||
AssertFatal(ul_config->ul_config_list[i].pdu_type <= FAPI_NR_UL_CONFIG_TYPES,"pdu_type %d out of bounds\n",ul_config->ul_config_list[i].pdu_type);
|
||||
LOG_D(PHY, "In %s: processing %s PDU of %d total UL PDUs (ul_config %p) \n", __FUNCTION__, ul_pdu_type[ul_config->ul_config_list[i].pdu_type - 1], ul_config->number_pdus, ul_config);
|
||||
|
||||
Reference in New Issue
Block a user