Commit 403956d6 authored by Sakthivel Velumani's avatar Sakthivel Velumani

avoiding race condition for PDSCH tx

parent f8c510e0
...@@ -506,6 +506,8 @@ void init_nr_transport(PHY_VARS_gNB *gNB) { ...@@ -506,6 +506,8 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
LOG_I(PHY, "Initialise nr transport\n"); LOG_I(PHY, "Initialise nr transport\n");
uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value; uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value;
memset(gNB->num_pdsch_rnti, 0, sizeof(uint16_t)*80);
for (i=0; i <NUMBER_OF_NR_PDCCH_MAX; i++) { for (i=0; i <NUMBER_OF_NR_PDCCH_MAX; i++) {
LOG_I(PHY,"Initializing PDCCH list for PDCCH %d/%d\n",i,NUMBER_OF_NR_PDCCH_MAX); LOG_I(PHY,"Initializing PDCCH list for PDCCH %d/%d\n",i,NUMBER_OF_NR_PDCCH_MAX);
gNB->pdcch_pdu[i].frame=-1; gNB->pdcch_pdu[i].frame=-1;
......
...@@ -291,7 +291,7 @@ void nr_fill_dlsch(PHY_VARS_gNB *gNB, ...@@ -291,7 +291,7 @@ void nr_fill_dlsch(PHY_VARS_gNB *gNB,
NR_DL_gNB_HARQ_t **harq = dlsch->harq_processes; NR_DL_gNB_HARQ_t **harq = dlsch->harq_processes;
/// DLSCH struct /// DLSCH struct
memcpy((void*)&harq[dlsch->harq_ids[frame%2][slot]]->pdsch_pdu, (void*)pdsch_pdu, sizeof(nfapi_nr_dl_tti_pdsch_pdu)); memcpy((void*)&harq[dlsch->harq_ids[frame%2][slot]]->pdsch_pdu, (void*)pdsch_pdu, sizeof(nfapi_nr_dl_tti_pdsch_pdu));
gNB->num_pdsch_rnti++; gNB->num_pdsch_rnti[slot]++;
AssertFatal(sdu!=NULL,"sdu is null\n"); AssertFatal(sdu!=NULL,"sdu is null\n");
harq[dlsch->harq_ids[frame%2][slot]]->pdu = sdu; harq[dlsch->harq_ids[frame%2][slot]]->pdu = sdu;
......
...@@ -691,7 +691,7 @@ typedef struct PHY_VARS_gNB_s { ...@@ -691,7 +691,7 @@ typedef struct PHY_VARS_gNB_s {
// nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu; // nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu;
nfapi_nr_dl_tti_ssb_pdu ssb_pdu; nfapi_nr_dl_tti_ssb_pdu ssb_pdu;
int num_pdsch_rnti; uint16_t num_pdsch_rnti[80];
NR_gNB_PBCH pbch; NR_gNB_PBCH pbch;
nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL]; nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL];
NR_gNB_COMMON common_vars; NR_gNB_COMMON common_vars;
......
...@@ -154,7 +154,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ ...@@ -154,7 +154,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
number_ul_dci_pdu,number_ul_tti_pdu); number_ul_dci_pdu,number_ul_tti_pdu);
int pdcch_received=0; int pdcch_received=0;
gNB->num_pdsch_rnti=0; gNB->num_pdsch_rnti[slot]=0;
for (int i=0; i<NUMBER_OF_NR_DLSCH_MAX; i++) { for (int i=0; i<NUMBER_OF_NR_DLSCH_MAX; i++) {
gNB->dlsch[i][0]->rnti=0; gNB->dlsch[i][0]->rnti=0;
gNB->dlsch[i][0]->harq_mask=0; gNB->dlsch[i][0]->harq_mask=0;
......
...@@ -191,9 +191,9 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, ...@@ -191,9 +191,9 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
if (ul_pdcch_pdu_id >= 0) gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].frame = -1; if (ul_pdcch_pdu_id >= 0) gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].frame = -1;
} }
for (int i=0; i<gNB->num_pdsch_rnti; i++) { for (int i=0; i<gNB->num_pdsch_rnti[slot]; i++) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1);
LOG_D(PHY, "PDSCH generation started (%d)\n", gNB->num_pdsch_rnti); LOG_D(PHY, "PDSCH generation started (%d) in frame %d.%d\n", gNB->num_pdsch_rnti[slot],frame,slot);
nr_generate_pdsch(gNB->dlsch[i][0], nr_generate_pdsch(gNB->dlsch[i][0],
gNB->nr_gold_pdsch_dmrs[slot], gNB->nr_gold_pdsch_dmrs[slot],
gNB->common_vars.txdataF, gNB->common_vars.txdataF,
......
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