Commit 85b8f78d authored by Gokul Srinivasan's avatar Gokul Srinivasan

process ID overflow bugfix

parent ac4ae0e0
...@@ -151,7 +151,7 @@ void rx_func(void *param) { ...@@ -151,7 +151,7 @@ void rx_func(void *param) {
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick // I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
//LOG_D(PHY, "oai_slot_ind(frame:%u, slot:%d) ********\n", frame_rx, slot_rx); //LOG_D(PHY, "oai_slot_ind(frame:%u, slot:%d) ********\n", frame_rx, slot_rx);
start_meas(&nfapi_meas); start_meas(&nfapi_meas);
oai_slot_ind(frame_tx, slot_tx); oai_slot_ind(frame_rx, slot_rx);
stop_meas(&nfapi_meas); stop_meas(&nfapi_meas);
/*if (gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus|| /*if (gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus||
......
...@@ -1253,8 +1253,8 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, ...@@ -1253,8 +1253,8 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
} else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE) { } else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE) {
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu = &dl_tti_pdu_list[i].pdsch_pdu; nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu = &dl_tti_pdu_list[i].pdsch_pdu;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15_pdu = &pdsch_pdu->pdsch_pdu_rel15; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15_pdu = &pdsch_pdu->pdsch_pdu_rel15;
//nfapi_nr_tx_data_request_t *tx_data = tx_data_request[sfn][slot][rel15_pdu->pduIndex]; //nfapi_nr_tx_data_request_t *tx_data = tx_data_request[sfn][slot][rel15_pdu->pduIndex];
nfapi_nr_pdu_t *tx_data = tx_data_request[sfn][slot][0]; nfapi_nr_pdu_t *tx_data = tx_data_request[sfn][slot][rel15_pdu->pduIndex];
if (tx_data != NULL) { if (tx_data != NULL) {
int UE_id = find_nr_dlsch(rel15_pdu->rnti,gNB,SEARCH_EXIST_OR_FREE); int UE_id = find_nr_dlsch(rel15_pdu->rnti,gNB,SEARCH_EXIST_OR_FREE);
......
...@@ -1620,8 +1620,8 @@ void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port) { ...@@ -1620,8 +1620,8 @@ void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port) {
nfapi_setmode(NFAPI_MODE_VNF); nfapi_setmode(NFAPI_MODE_VNF);
memset(&vnf, 0, sizeof(vnf)); memset(&vnf, 0, sizeof(vnf));
memset(vnf.p7_vnfs, 0, sizeof(vnf.p7_vnfs)); memset(vnf.p7_vnfs, 0, sizeof(vnf.p7_vnfs));
vnf.p7_vnfs[0].timing_window = 32; vnf.p7_vnfs[0].timing_window = 30;
vnf.p7_vnfs[0].periodic_timing_enabled = 1; vnf.p7_vnfs[0].periodic_timing_enabled = 0;
vnf.p7_vnfs[0].aperiodic_timing_enabled = 0; vnf.p7_vnfs[0].aperiodic_timing_enabled = 0;
vnf.p7_vnfs[0].periodic_timing_period = 10; vnf.p7_vnfs[0].periodic_timing_period = 10;
vnf.p7_vnfs[0].config = nfapi_vnf_p7_config_create(); vnf.p7_vnfs[0].config = nfapi_vnf_p7_config_create();
......
This diff is collapsed.
...@@ -2011,7 +2011,9 @@ void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7) ...@@ -2011,7 +2011,9 @@ void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
void vnf_nr_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7) void vnf_nr_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
{ {
uint8_t uplink_slots[6] = {7,8,9,17,18,19};
uint8_t is_uplink_slot = 0;
if (pRecvMsg == NULL || vnf_p7 == NULL) if (pRecvMsg == NULL || vnf_p7 == NULL)
{ {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_timing_info: NULL parameters\n"); NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_timing_info: NULL parameters\n");
...@@ -2030,16 +2032,20 @@ void vnf_nr_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7) ...@@ -2030,16 +2032,20 @@ void vnf_nr_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
//int16_t vnf_pnf_sfnsf_delta = NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf) - NFAPI_SFNSF2DEC(ind.last_sfn_sf); //int16_t vnf_pnf_sfnsf_delta = NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf) - NFAPI_SFNSF2DEC(ind.last_sfn_sf);
int16_t vnf_pnf_sfnslot_delta = NFAPI_SFNSLOT2DEC(vnf_p7->p7_connections[0].sfn,vnf_p7->p7_connections[0].slot) - NFAPI_SFNSLOT2DEC(ind.last_sfn,ind.last_slot); int16_t vnf_pnf_sfnslot_delta = NFAPI_SFNSLOT2DEC(vnf_p7->p7_connections[0].sfn,vnf_p7->p7_connections[0].slot) - NFAPI_SFNSLOT2DEC(ind.last_sfn,ind.last_slot);
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PNF:SFN/SF:%d VNF:SFN/SF:%d deltaSFNSF:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind.last_sfn_sf), NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), vnf_pnf_sfnsf_delta); //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PNF:SFN/SF:%d VNF:SFN/SF:%d deltaSFNSF:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind.last_sfn_sf), NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), vnf_pnf_sfnsf_delta);
// Panos: Careful here!!! Modification of the original nfapi-code // Panos: Careful here!!! Modification of the original nfapi-code
//if (vnf_pnf_sfnsf_delta>1 || vnf_pnf_sfnsf_delta < -1) //if (vnf_pnf_sfnsf_delta>1 || vnf_pnf_sfnsf_delta < -1)
//printf("VNF-PNF delta - %d", vnf_pnf_sfnslot_delta); //printf("VNF-PNF delta - %d", vnf_pnf_sfnslot_delta);
if (vnf_pnf_sfnslot_delta>0 || vnf_pnf_sfnslot_delta < 0) for (int i = 0; i < 6; i++){
if (vnf_p7->p7_connections[0].slot == uplink_slots[i])
is_uplink_slot = 1;
}
if ((vnf_pnf_sfnslot_delta>0 || vnf_pnf_sfnslot_delta < 0) && is_uplink_slot == 0)
{ {
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF delta:%d VNF:%d PNF:%d\n\n\n\n\n\n\n\n\n", __FUNCTION__, vnf_pnf_sfnslot_delta,NFAPI_SFNSLOT2DEC(vnf_p7->p7_connections[0].sfn,vnf_p7->p7_connections[0].slot),NFAPI_SFNSLOT2DEC(ind.last_sfn,ind.last_slot)) ; NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF delta:%d VNF:%d PNF:%d\n\n\n\n\n\n\n\n\n", __FUNCTION__, vnf_pnf_sfnslot_delta,NFAPI_SFNSLOT2DEC(vnf_p7->p7_connections[0].sfn,vnf_p7->p7_connections[0].slot),NFAPI_SFNSLOT2DEC(ind.last_sfn,ind.last_slot)) ;
// Panos: Careful here!!! Modification of the original nfapi-code // Panos: Careful here!!! Modification of the original nfapi-code
vnf_p7->p7_connections[0].sfn = ind.last_sfn; vnf_p7->p7_connections[0].sfn = ind.last_sfn;
vnf_p7->p7_connections[0].slot = ind.last_slot; vnf_p7->p7_connections[0].slot = ind.last_slot;
//printf("VNF SFN/slot modified");
} }
} }
} }
......
This diff is collapsed.
...@@ -780,11 +780,11 @@ int dlsch_encoding_SIC(PHY_VARS_UE *ue, ...@@ -780,11 +780,11 @@ int dlsch_encoding_SIC(PHY_VARS_UE *ue,
for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) { for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
#ifdef DEBUG_DLSCH_CODING #ifdef DEBUG_DLSCH_CODING
printf("Rate Matching, Code segment %u (coded bits (G) %u,unpunctured/repeated bits per code segment %u,mod_order %d, nb_rb %d)...\n", // printf("Rate Matching, Code segment %u (coded bits (G) %u,unpunctured/repeated bits per code segment %u,mod_order %d, nb_rb %d)...\n",
r, // r,
G, // G,
Kr*3, // Kr*3,
mod_order,nb_rb); // mod_order,nb_rb);
#endif #endif
start_meas(rm_stats); start_meas(rm_stats);
#ifdef DEBUG_DLSCH_CODING #ifdef DEBUG_DLSCH_CODING
......
...@@ -134,6 +134,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, ...@@ -134,6 +134,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
/* advance last round's future UL_tti_req to be ahead of current frame/slot */ /* advance last round's future UL_tti_req to be ahead of current frame/slot */
future_ul_tti_req->SFN = (slotP == 0 ? frameP : frameP + 1) % 1024; future_ul_tti_req->SFN = (slotP == 0 ? frameP : frameP + 1) % 1024;
LOG_D(MAC,"Future_ul_tti SFN = %d for slot %d \n", future_ul_tti_req->SFN, (slotP + num_slots - 1) % num_slots);
/* future_ul_tti_req->Slot is fixed! */ /* future_ul_tti_req->Slot is fixed! */
future_ul_tti_req->n_pdus = 0; future_ul_tti_req->n_pdus = 0;
future_ul_tti_req->n_ulsch = 0; future_ul_tti_req->n_ulsch = 0;
...@@ -374,9 +375,10 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -374,9 +375,10 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
if (NFAPI_MODE == NFAPI_MODE_VNF){ if (NFAPI_MODE == NFAPI_MODE_VNF){
if(first_sched_entry == 1) if(first_sched_entry == 1)
{ {
printf("First sched entry at slot %d \n", slot);
for (int i = 0; i<num_slots; i++){ for (int i = 0; i<num_slots; i++){
if(i <= slot) if(i <= slot)
gNB->UL_tti_req_ahead[CC_id][i].SFN = frame + 1; gNB->UL_tti_req_ahead[CC_id][i].SFN = (frame + 1) % 1024;
else else
gNB->UL_tti_req_ahead[CC_id][i].SFN = frame; gNB->UL_tti_req_ahead[CC_id][i].SFN = frame;
} }
......
...@@ -46,7 +46,6 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, ...@@ -46,7 +46,6 @@ void nr_fill_nfapi_pucch(module_id_t mod_id,
nfapi_nr_ul_tti_request_t *future_ul_tti_req = nfapi_nr_ul_tti_request_t *future_ul_tti_req =
&RC.nrmac[mod_id]->UL_tti_req_ahead[0][pucch->ul_slot]; &RC.nrmac[mod_id]->UL_tti_req_ahead[0][pucch->ul_slot];
AssertFatal(future_ul_tti_req->SFN == pucch->frame AssertFatal(future_ul_tti_req->SFN == pucch->frame
&& future_ul_tti_req->Slot == pucch->ul_slot, && future_ul_tti_req->Slot == pucch->ul_slot,
"future UL_tti_req's frame.slot %d.%d does not match PUCCH %d.%d\n", "future UL_tti_req's frame.slot %d.%d does not match PUCCH %d.%d\n",
...@@ -1140,10 +1139,6 @@ int nr_acknack_scheduling(int mod_id, ...@@ -1140,10 +1139,6 @@ int nr_acknack_scheduling(int mod_id,
__func__, __func__,
pucch->csi_bits); pucch->csi_bits);
/* if the currently allocated PUCCH of this UE is full, allocate it */ /* if the currently allocated PUCCH of this UE is full, allocate it */
// if (NFAPI_MODE == NFAPI_MODE_VNF){
// pucch->sr_flag = 1;
// pucch->dai_c = 1;
// }
if (pucch->dai_c == 2) { if (pucch->dai_c == 2) {
/* advance the UL slot information in PUCCH by one so we won't schedule in /* advance the UL slot information in PUCCH by one so we won't schedule in
...@@ -1174,7 +1169,7 @@ int nr_acknack_scheduling(int mod_id, ...@@ -1174,7 +1169,7 @@ int nr_acknack_scheduling(int mod_id,
/* if the UE's next PUCCH occasion is after the possible UL slots (within the /* if the UE's next PUCCH occasion is after the possible UL slots (within the
* same frame) or wrapped around to the next frame, then we assume there is * same frame) or wrapped around to the next frame, then we assume there is
* no possible PUCCH allocation anymore */ * no possible PUCCH allocation anymore */
if(NFAPI_MODE == NFAPI_MONOLITHIC)
if ((pucch->frame == frame if ((pucch->frame == frame
&& (pucch->ul_slot >= first_ul_slot_tdd + nr_ulmix_slots)) && (pucch->ul_slot >= first_ul_slot_tdd + nr_ulmix_slots))
|| (pucch->frame == frame + 1)) || (pucch->frame == frame + 1))
...@@ -1186,10 +1181,10 @@ int nr_acknack_scheduling(int mod_id, ...@@ -1186,10 +1181,10 @@ int nr_acknack_scheduling(int mod_id,
get_pdsch_to_harq_feedback(mod_id, UE_id, ss_type, pdsch_to_harq_feedback); get_pdsch_to_harq_feedback(mod_id, UE_id, ss_type, pdsch_to_harq_feedback);
/* there is a HARQ. Check whether we can use it for this ACKNACK */ /* there is a HARQ. Check whether we can use it for this ACKNACK */
// if(NFAPI_MODE == NFAPI_MODE_VNF)
// return 0;
if (pucch->dai_c > 0) { if (pucch->dai_c > 0) {
/* this UE already has a PUCCH occasion */ /* this UE already has a PUCCH occasion */
LOG_I(MAC,"pucch->frame = %d,frame=%d \n",pucch->frame,frame);
DevAssert(pucch->frame == frame); DevAssert(pucch->frame == frame);
// Find the right timing_indicator value. // Find the right timing_indicator value.
......
...@@ -88,7 +88,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) ...@@ -88,7 +88,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
{ {
if(NFAPI_MODE == NFAPI_MODE_PNF) { if(NFAPI_MODE == NFAPI_MODE_PNF) {
if (UL_info->uci_ind.num_ucis>0) { if (UL_info->uci_ind.num_ucis>0) {
LOG_I(PHY,"PNF Sending UL_info->num_ucis:%d PDU_type: %d, SFN/SF:%d.%d \n", UL_info->uci_ind.num_ucis, UL_info->uci_ind.uci_list[0].pdu_type ,UL_info->frame, UL_info->slot); LOG_D(PHY,"PNF Sending UL_info->num_ucis:%d PDU_type: %d, SFN/SF:%d.%d \n", UL_info->uci_ind.num_ucis, UL_info->uci_ind.uci_list[0].pdu_type ,UL_info->frame, UL_info->slot);
oai_nfapi_nr_uci_indication(&UL_info->uci_ind); oai_nfapi_nr_uci_indication(&UL_info->uci_ind);
UL_info->uci_ind.num_ucis = 0; UL_info->uci_ind.num_ucis = 0;
} }
...@@ -99,7 +99,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) ...@@ -99,7 +99,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
const sub_frame_t slot = UL_info->slot; const sub_frame_t slot = UL_info->slot;
int num_ucis = UL_info->uci_ind.num_ucis; int num_ucis = UL_info->uci_ind.num_ucis;
nfapi_nr_uci_t *uci_list = UL_info->uci_ind.uci_list; nfapi_nr_uci_t *uci_list = UL_info->uci_ind.uci_list;
//printf("handling UCI SFN/slot: %d.%d, num_ucis: %d \n", frame,slot, num_ucis); LOG_I(MAC,"handling UCI SFN/slot: %d.%d, num_ucis: %d \n", frame,slot, num_ucis);
for (int i = 0; i < num_ucis; i++) { for (int i = 0; i < num_ucis; i++) {
switch (uci_list[i].pdu_type) { switch (uci_list[i].pdu_type) {
case NFAPI_NR_UCI_PUSCH_PDU_TYPE: case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
...@@ -120,6 +120,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) ...@@ -120,6 +120,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
break; break;
} }
} }
LOG_D(MAC, "UCI handled \n");
} }
} }
......
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