Commit 506000cd authored by Andrew Burger's avatar Andrew Burger

Saving work

parent 36c9df19
...@@ -1269,6 +1269,7 @@ void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7) ...@@ -1269,6 +1269,7 @@ void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
if (vnf_p7 && vnf_p7->p7_connections) if (vnf_p7 && vnf_p7->p7_connections)
{ {
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);
printf("vnf_pnf_sfnsf_delta = %d adjusting now\n", vnf_pnf_sfnsf_delta); fflush(stdout);
//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);
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
#define MAX_eNB 2 #define MAX_eNB 2
#define MAX_gNB 2 #define MAX_gNB 2
#else #else
#define MAX_MOBILES_PER_ENB 4 #define MAX_MOBILES_PER_ENB 20 // This was maxed at 4 Why? -Andrew
#define MAX_MOBILES_PER_ENB_NB_IoT 4 #define MAX_MOBILES_PER_ENB_NB_IoT 4
#define MAX_MOBILES_PER_GNB 2//16 #define MAX_MOBILES_PER_GNB 2//16
#define MAX_eNB 2 #define MAX_eNB 2
......
...@@ -571,16 +571,30 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -571,16 +571,30 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
UE_sched_ctrl_t *UE_scheduling_control = NULL; UE_sched_ctrl_t *UE_scheduling_control = NULL;
start_meas(&(eNB->eNB_scheduler)); start_meas(&(eNB->eNB_scheduler));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, VCD_FUNCTION_IN);
// TODO: Better solution needed this is the first
if ((frameP == eNB->frame && subframeP <= eNB->subframe) || (frameP == ((eNB->frame + 1023) & 1023))) // 3 indications of this function on startup
// 1303275.278188 [MAC] XXX 0.0 -> 0.4 = 4
// 1303275.279443 [MAC] XXX 0.4 -> 639.5 = 6391
// 1303275.348686 [MAC] XXX 646.3 -> 646.3 = 0
int delta = (frameP * 10 + subframeP) - (eNB->frame * 10 + eNB->subframe);
if (delta < 0)
{
delta += 10240; // sfn_sf decimal values range from 0 to 10239
}
// If we ever see a difference this big something is very wrong
// This threshold is arbitrary
if (delta > 8500 || delta == 0) // 900 frames
{ {
LOG_E(MAC, "Scheduler being called twice for same subframe SF.SFN: %u.%u\n", frameP, subframeP); LOG_I(MAC, "scheduler ignoring outerspace %d.%d -> %d.%d = %d\n",
eNB->frame, eNB->subframe, frameP, subframeP, delta);
return; return;
} }
LOG_I(MAC, "Entering dlsch_ulsch scheduler %d.%d -> %d.%d = %d\n",
eNB->frame, eNB->subframe, frameP, subframeP, delta);
eNB->frame = frameP; eNB->frame = frameP;
eNB->subframe = subframeP; eNB->subframe = subframeP;
LOG_I(MAC, "Entering dlsch_ulsch scheduler Frame: %u Subframe: %u\n", frameP, subframeP);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
mbsfn_status[CC_id] = 0; mbsfn_status[CC_id] = 0;
/* Clear vrb_maps */ /* Clear vrb_maps */
......
...@@ -67,6 +67,7 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra ...@@ -67,6 +67,7 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra
LOG_D(PHY, "Found RAR with the intended RAPID %d\n", LOG_D(PHY, "Found RAR with the intended RAPID %d\n",
rarh->RAPID); rarh->RAPID);
rar = (uint8_t *) (dlsch_buffer + n_rarh + (n_rarpy - 1) * 6); rar = (uint8_t *) (dlsch_buffer + n_rarh + (n_rarpy - 1) * 6);
UE_mac_inst[module_idP].UE_mode[0] = RA_RESPONSE;
break; break;
} }
...@@ -77,9 +78,10 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra ...@@ -77,9 +78,10 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra
} }
if (rarh->E == 0) { if (rarh->E == 0) {
LOG_I(PHY, LOG_I(MAC,
"No RAR found with the intended RAPID. The closest RAPID in all RARs is %d\n", "No RAR found with the intended RAPID. The closest RAPID in all RARs is %d\n",
best_rx_rapid); best_rx_rapid);
UE_mac_inst[module_idP].UE_mode[0] = PRACH;
break; break;
} else { } else {
rarh++; rarh++;
......
...@@ -832,7 +832,8 @@ void dl_config_req_UE_MAC_dci(int sfn, ...@@ -832,7 +832,8 @@ void dl_config_req_UE_MAC_dci(int sfn,
&UE_mac_inst[ue_id].crnti, //t-crnti &UE_mac_inst[ue_id].crnti, //t-crnti
UE_mac_inst[ue_id].RA_prach_resources.ra_PreambleIndex, UE_mac_inst[ue_id].RA_prach_resources.ra_PreambleIndex,
tx_request_pdu_list[pdu_index].segments[0].segment_data); tx_request_pdu_list[pdu_index].segments[0].segment_data);
UE_mac_inst[ue_id].UE_mode[0] = RA_RESPONSE; // UE_mac_inst[ue_id].UE_mode[0] = RA_RESPONSE;
LOG_I(MAC, "setting UE_MODE now: %d\n", UE_mac_inst[ue_id].UE_mode[0]);
// Expecting an UL_CONFIG_ULSCH_PDU to enable Msg3 Txon (first // Expecting an UL_CONFIG_ULSCH_PDU to enable Msg3 Txon (first
// ULSCH Txon for the UE) // ULSCH Txon for the UE)
UE_mac_inst[ue_id].first_ULSCH_Tx = 1; UE_mac_inst[ue_id].first_ULSCH_Tx = 1;
......
...@@ -1166,16 +1166,21 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) ...@@ -1166,16 +1166,21 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg)
if (UE->mode != loop_through_memory) { if (UE->mode != loop_through_memory) {
// We make the start of RA between consecutive UEs differ by 20 frames // We make the start of RA between consecutive UEs differ by 20 frames
//if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id == 0) || (UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id>0 && rx_frame >= UE_mac_inst[Mod_id-1].ra_frame + 20) ) { //if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id == 0) || (UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id>0 && rx_frame >= UE_mac_inst[Mod_id-1].ra_frame + 20) ) {
if (UE_mac_inst[ue_Mod_id].UE_mode[0] == PRACH && ue_Mod_id == next_Mod_id) { LOG_I(MAC, "UE_mode: %d\n", UE_mac_inst[ue_Mod_id].UE_mode[0]);
if (UE_mac_inst[ue_Mod_id].UE_mode[0] == PRACH) { //&& ue_Mod_id == next_Mod_id) {
next_ra_frame++; next_ra_frame++;
if (next_ra_frame > 500) { // if (next_ra_frame > 500) {
// check if we have PRACH opportunity // check if we have PRACH opportunity
LOG_I(MAC, "is_prach_subframe(): %d\n",
is_prach_subframe(&UE->frame_parms, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)));
if (is_prach_subframe(&UE->frame_parms, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)) && UE_mac_inst[ue_Mod_id].SI_Decoded == 1) { if (is_prach_subframe(&UE->frame_parms, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)) && UE_mac_inst[ue_Mod_id].SI_Decoded == 1) {
// The one working strangely... // The one working strangely...
//if (is_prach_subframe(&UE->frame_parms,NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf) && Mod_id == (module_id_t) init_ra_UE) ) { //if (is_prach_subframe(&UE->frame_parms,NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf) && Mod_id == (module_id_t) init_ra_UE) ) {
PRACH_RESOURCES_t *prach_resources = ue_get_rach(ue_Mod_id, 0, NFAPI_SFNSF2SFN(sfn_sf), 0, NFAPI_SFNSF2SF(sfn_sf)); PRACH_RESOURCES_t *prach_resources = ue_get_rach(ue_Mod_id, 0, NFAPI_SFNSF2SFN(sfn_sf), 0, NFAPI_SFNSF2SF(sfn_sf));
if (prach_resources != NULL) { if (prach_resources != NULL) {
UE_mac_inst[ue_Mod_id].ra_frame = rx_frame; LOG_I(MAC, "preamble_received_tar_power: %d\n",
prach_resources->ra_PREAMBLE_RECEIVED_TARGET_POWER);
UE_mac_inst[ue_Mod_id].ra_frame = NFAPI_SFNSF2SFN(sfn_sf); // Is this why RACH comes in late to proxy? - Andrew
LOG_D(MAC, "UE_phy_stub_thread_rxn_txnp4 before RACH, Mod_id: %d frame %d subframe %d\n", ue_Mod_id, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)); LOG_D(MAC, "UE_phy_stub_thread_rxn_txnp4 before RACH, Mod_id: %d frame %d subframe %d\n", ue_Mod_id, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf));
fill_rach_indication_UE_MAC(ue_Mod_id, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf), UL_INFO, prach_resources->ra_PreambleIndex, prach_resources->ra_RNTI); fill_rach_indication_UE_MAC(ue_Mod_id, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf), UL_INFO, prach_resources->ra_PreambleIndex, prach_resources->ra_RNTI);
sent_any = true; sent_any = true;
...@@ -1188,7 +1193,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) ...@@ -1188,7 +1193,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg)
//ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode); //ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode);
} }
} // }
} // mode is PRACH } // mode is PRACH
// Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger // Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger
......
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