Commit 502b4d59 authored by Sagar Parsawar's avatar Sagar Parsawar

Cleaning up scheduling PRS slot in gNB and nrUE

parent a292f1a2
......@@ -123,6 +123,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
int offset = gNB->CC_id, slot_prs;
int txdataF_offset = slot*fp->samples_per_slot_wCP;
prs_config_t *prs_config = NULL;
if ((cfg->cell_config.frame_duplex_type.value == TDD) &&
(nr_slot_select(cfg,frame,slot) == NR_UPLINK_SLOT)) return;
......@@ -135,16 +136,17 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
memset(&gNB->common_vars.beam_id[aa][slot*fp->symbols_per_slot],255,fp->symbols_per_slot*sizeof(uint8_t));
}
// Check for PRS slot
// Check for PRS slot - section 7.4.1.7.4 in 3GPP rel16 38.211
for(int rsc_id = 0; rsc_id < gNB->prs_vars.NumPRSResources; rsc_id++)
{
for (int i = 0; i < gNB->prs_vars.prs_cfg[rsc_id].PRSResourceRepetition; i++)
prs_config = &gNB->prs_vars.prs_cfg[rsc_id];
for (int i = 0; i < prs_config->PRSResourceRepetition; i++)
{
if( (((frame*fp->slots_per_frame + slot) - (gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[1] + gNB->prs_vars.prs_cfg[rsc_id].PRSResourceOffset)+gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[0])%gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[0]) == i*gNB->prs_vars.prs_cfg[rsc_id].PRSResourceTimeGap )
if( (((frame*fp->slots_per_frame + slot) - (prs_config->PRSResourceSetPeriod[1] + prs_config->PRSResourceOffset)+prs_config->PRSResourceSetPeriod[0])%prs_config->PRSResourceSetPeriod[0]) == i*prs_config->PRSResourceTimeGap )
{
slot_prs = (slot - i*gNB->prs_vars.prs_cfg[rsc_id].PRSResourceTimeGap + fp->slots_per_frame)%fp->slots_per_frame;
slot_prs = (slot - i*prs_config->PRSResourceTimeGap + fp->slots_per_frame)%fp->slots_per_frame;
LOG_D(PHY,"gNB_TX: frame %d, slot %d, slot_prs %d, PRS Resource ID %d\n",frame, slot, slot_prs, rsc_id);
nr_generate_prs(gNB->nr_gold_prs[rsc_id][slot_prs],&gNB->common_vars.txdataF[0][txdataF_offset], AMP, &gNB->prs_vars.prs_cfg[rsc_id], cfg, fp);
nr_generate_prs(gNB->nr_gold_prs[rsc_id][slot_prs],&gNB->common_vars.txdataF[0][txdataF_offset], AMP, prs_config, cfg, fp);
}
}
}
......
......@@ -1332,7 +1332,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
int frame_rx = proc->frame_rx;
int nr_slot_rx = proc->nr_slot_rx;
fapi_nr_config_request_t *cfg = &ue->nrUE_config;
prs_config_t *prs_config = NULL;
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
......@@ -1411,16 +1411,17 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
}
}
// Check for PRS slot
// Check for PRS slot - section 7.4.1.7.4 in 3GPP rel16 38.211
for(int gNB_id = 0; gNB_id < ue->prs_active_gNBs; gNB_id++)
{
for(int rsc_id = 0; rsc_id < ue->prs_vars[gNB_id]->NumPRSResources; rsc_id++)
{
for (int i = 0; i < ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceRepetition; i++)
prs_config = &ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg;
for (int i = 0; i < prs_config->PRSResourceRepetition; i++)
{
if( (((frame_rx*fp->slots_per_frame + nr_slot_rx) - (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[1] + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceOffset) + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[0])%ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[0]) == i*ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceTimeGap)
if( (((frame_rx*fp->slots_per_frame + nr_slot_rx) - (prs_config->PRSResourceSetPeriod[1] + prs_config->PRSResourceOffset) + prs_config->PRSResourceSetPeriod[0])%prs_config->PRSResourceSetPeriod[0]) == i*prs_config->PRSResourceTimeGap)
{
for(int j = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.SymbolStart; j < (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.SymbolStart+ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.NumPRSSymbols); j++)
for(int j = prs_config->SymbolStart; j < (prs_config->SymbolStart+prs_config->NumPRSSymbols); j++)
{
nr_slot_fep(ue,
proc,
......
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