Build error fix, sync hardcode, UL indication called in every slot
This commit is contained in:
@@ -1561,7 +1561,7 @@ uint8_t is_nr_p7_request_in_window(uint16_t sfn,uint16_t slot, const char* name,
|
||||
// }
|
||||
struct timespec curr_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
||||
printf("PNF SFN:%d, PNF slot:%d, VNF SFN:%d, VNF slot:%d, Curr time;%d.%d. \n",phy->sfn,phy->slot,sfn,slot,curr_time.tv_sec,curr_time.tv_nsec);
|
||||
printf("PNF SFN:%d, PNF slot:%d, VNF SFN:%d, VNF slot:%d, SFN offset:%d, Curr time;%d.%d. \n",phy->sfn,phy->slot,sfn,slot, phy->sfn - sfn,curr_time.tv_sec,curr_time.tv_nsec);
|
||||
if(current_sfn_slot_dec <= recv_sfn_slot_dec + timing_window){
|
||||
in_window = 1;
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
|
||||
@@ -1578,7 +1578,7 @@ uint8_t is_nr_p7_request_in_window(uint16_t sfn,uint16_t slot, const char* name,
|
||||
|
||||
}//Need to add more cases
|
||||
|
||||
|
||||
in_window = 0; // gokul
|
||||
return in_window;
|
||||
}
|
||||
|
||||
|
||||
@@ -181,9 +181,11 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
||||
slot_start = timespec_add(slot_start, slot_duration);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "next slot will start at %d.%d\n", slot_start.tv_sec, slot_start.tv_nsec);
|
||||
|
||||
struct timespec ref_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ref_time);
|
||||
uint8_t setup_time;
|
||||
while(vnf_p7->terminate == 0)
|
||||
{
|
||||
{
|
||||
fd_set rfds;
|
||||
int maxSock = 0;
|
||||
FD_ZERO(&rfds);
|
||||
@@ -193,6 +195,10 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
||||
FD_SET(vnf_p7->socket, &rfds);
|
||||
maxSock = vnf_p7->socket;
|
||||
|
||||
struct timespec curr_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
||||
setup_time = curr_time.tv_sec - ref_time.tv_sec;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &pselect_start);
|
||||
//long millisecond = pselect_start.tv_nsec / 1e6;
|
||||
|
||||
@@ -404,6 +410,19 @@ struct timespec current_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, ¤t_time);
|
||||
// pselect timed out
|
||||
|
||||
if(setup_time > 10){
|
||||
// Call the scheduler
|
||||
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
gNB->UL_INFO.frame = vnf_frame;
|
||||
gNB->UL_INFO.slot = vnf_slot;
|
||||
|
||||
gNB->UL_INFO.module_id = gNB->Mod_id;
|
||||
gNB->UL_INFO.CC_id = gNB->CC_id;
|
||||
gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
|
||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
}
|
||||
|
||||
while(curr != 0)
|
||||
{
|
||||
if (curr->slot == 19)
|
||||
@@ -418,13 +437,16 @@ struct timespec current_time;
|
||||
{
|
||||
curr->slot++;
|
||||
}
|
||||
//printf("Frame = %d, slot = %d in VNF main loop. \n",curr->sfn,curr->slot);
|
||||
printf("Frame = %d, slot = %d in VNF main loop. \n",curr->sfn,curr->slot);
|
||||
vnf_frame = curr->sfn; vnf_slot = curr->slot;
|
||||
|
||||
struct timespec curr_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &curr_time);
|
||||
|
||||
vnf_nr_sync(vnf_p7, curr);
|
||||
//vnf_nr_sync(vnf_p7, curr);
|
||||
|
||||
(vnf_p7->_public.sync_indication)(&(vnf_p7->_public), 1); //hardcoded sync
|
||||
|
||||
curr = curr->next;
|
||||
}
|
||||
send_mac_slot_indications(vnf_p7);
|
||||
@@ -435,19 +457,10 @@ struct timespec current_time;
|
||||
// have a p7 message
|
||||
if(FD_ISSET(vnf_p7->socket, &rfds))
|
||||
{
|
||||
|
||||
printf("P7 message received \n");
|
||||
vnf_nr_p7_read_dispatch_message(vnf_p7);
|
||||
|
||||
// Call the scheduler
|
||||
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
gNB->UL_INFO.frame = vnf_frame;
|
||||
gNB->UL_INFO.slot = vnf_slot;
|
||||
|
||||
gNB->UL_INFO.module_id = gNB->Mod_id;
|
||||
gNB->UL_INFO.CC_id = gNB->CC_id;
|
||||
gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
|
||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
//#define DEBUG_NR_PUCCH_RX 1
|
||||
@@ -86,6 +88,8 @@ void nr_fill_pucch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu) {
|
||||
if (NFAPI_MODE == NFAPI_MODE_PNF)
|
||||
gNB->pucch[0]->active = 0;
|
||||
|
||||
int id = nr_find_pucch(pucch_pdu->rnti,frame,slot,gNB);
|
||||
AssertFatal( (id>=0) && (id<NUMBER_OF_NR_PUCCH_MAX),
|
||||
|
||||
@@ -149,7 +149,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
nfapi_nr_ul_dci_request_t *UL_dci_req = Sched_INFO->UL_dci_req;
|
||||
frame_t frame = Sched_INFO->frame;
|
||||
sub_frame_t slot = Sched_INFO->slot;
|
||||
|
||||
//printf("Inside nr_schedule_resp SFN:%d, slot:%d \n",Sched_INFO->frame, Sched_INFO->slot);
|
||||
AssertFatal(RC.gNB!=NULL,"RC.gNB is null\n");
|
||||
AssertFatal(RC.gNB[Mod_id]!=NULL,"RC.gNB[%d] is null\n",Mod_id);
|
||||
|
||||
|
||||
@@ -1141,7 +1141,7 @@ int nr_acknack_scheduling(int mod_id,
|
||||
if(NFAPI_MODE == NFAPI_MODE_VNF){
|
||||
gNB_MAC_INST *gNB = RC.nrmac[mod_id];
|
||||
gNB->UL_tti_req_ahead[0][7].SFN = f;//Added to set the UL_tti_req_ahead SFN in VNF mode for slot 7
|
||||
gNB->[8].SFN = f;//Added to set the UL_tti_req_ahead SFN in VNF mode for slot 8
|
||||
gNB->UL_tti_req_ahead[0][8].SFN = f;//Added to set the UL_tti_req_ahead SFN in VNF mode for slot 8
|
||||
gNB->UL_tti_req_ahead[0][9].SFN = f;//Added to set the UL_tti_req_ahead SFN in VNF mode for slot 9
|
||||
gNB->UL_tti_req[0] = &gNB->UL_tti_req_ahead[0][slot];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user