Commit c3f984d0 authored by matzakos's avatar matzakos

Introduce nfapi_mode variable to differentiate functionality between...

Introduce nfapi_mode variable to differentiate functionality between phy_stub_ue mode (nfapi_mode=3) and normal full stack mode (nfapi_mode!=3).
parent 96f18a06
...@@ -677,6 +677,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -677,6 +677,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
return(0); return(0);
} }
/*
// P: New function supporting the MAC interface // P: New function supporting the MAC interface
void config_sib1_ue() void config_sib1_ue()
{ {
...@@ -714,7 +715,7 @@ void config_dedicated_ue() ...@@ -714,7 +715,7 @@ void config_dedicated_ue()
{ {
} }
*/
int int
rrc_mac_config_req_ue( rrc_mac_config_req_ue(
......
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
#include "SIMULATION/TOOLS/defs.h" // for taus #include "SIMULATION/TOOLS/defs.h" // for taus
extern uint8_t nfapi_mode;
int8_t get_DELTA_PREAMBLE(module_id_t module_idP,int CC_id) int8_t get_DELTA_PREAMBLE(module_id_t module_idP,int CC_id)
{ {
...@@ -287,10 +289,15 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -287,10 +289,15 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
uint8_t Size = 0; uint8_t Size = 0;
UE_MODE_t UE_mode;
// Panos: Modification for phy_stub_ue operation // Panos: Modification for phy_stub_ue operation
//UE_MODE_t UE_mode = get_ue_mode(module_idP,0,eNB_indexP); if(nfapi_mode == 3) { // Panos: phy_stub_ue mode
UE_MODE_t UE_mode = UE_mac_inst[module_idP].UE_mode[0]; UE_mode = UE_mac_inst[module_idP].UE_mode[0];
}
else { // Full stack mode
UE_mode = get_ue_mode(module_idP,0,eNB_indexP);
}
uint8_t lcid = CCCH; uint8_t lcid = CCCH;
uint16_t Size16; uint16_t Size16;
......
...@@ -74,6 +74,8 @@ extern uint8_t usim_test; ...@@ -74,6 +74,8 @@ extern uint8_t usim_test;
extern UL_IND_t *UL_INFO; extern UL_IND_t *UL_INFO;
extern uint8_t nfapi_mode;
/* /*
#ifndef USER_MODE #ifndef USER_MODE
#define msg debug_msg #define msg debug_msg
...@@ -396,11 +398,15 @@ ue_send_sdu( ...@@ -396,11 +398,15 @@ ue_send_sdu(
for (i=0; i<6; i++) for (i=0; i<6; i++)
if (tx_sdu[i] != payload_ptr[i]) { if (tx_sdu[i] != payload_ptr[i]) {
LOG_E(MAC,"[UE %d][RAPROC] Contention detected, RA failed\n",module_idP); LOG_E(MAC,"[UE %d][RAPROC] Contention detected, RA failed\n",module_idP);
if(nfapi_mode == 3) { // Panos: phy_stub mode
// Panos: Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to // Panos: Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to
// PRACH state. // PRACH state.
UE_mac_inst[module_idP].UE_mode[eNB_index] = PRACH; UE_mac_inst[module_idP].UE_mode[eNB_index] = PRACH;
//ra_failed(module_idP,CC_id,eNB_index); //ra_failed(module_idP,CC_id,eNB_index);UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 0;
UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 0; }
else { // Full stack mode
ra_failed(module_idP,CC_id,eNB_index);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_OUT);
return; return;
} }
...@@ -408,9 +414,14 @@ ue_send_sdu( ...@@ -408,9 +414,14 @@ ue_send_sdu(
LOG_I(MAC,"[UE %d][RAPROC] Frame %d : Clearing contention resolution timer\n", module_idP, frameP); LOG_I(MAC,"[UE %d][RAPROC] Frame %d : Clearing contention resolution timer\n", module_idP, frameP);
UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 0; UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 0;
if(nfapi_mode == 3) // phy_stub mode
{
//Panos: Modification for phy_stub mode operation here. We only need to change the ue_mode to PUSCH //Panos: Modification for phy_stub mode operation here. We only need to change the ue_mode to PUSCH
UE_mac_inst[module_idP].UE_mode[eNB_index] = PUSCH; UE_mac_inst[module_idP].UE_mode[eNB_index] = PUSCH;
//ra_succeeded(module_idP,CC_id,eNB_index); }
else { // Full stack mode
ra_succeeded(module_idP,CC_id,eNB_index);
}
} }
payload_ptr+=6; payload_ptr+=6;
...@@ -421,7 +432,10 @@ ue_send_sdu( ...@@ -421,7 +432,10 @@ ue_send_sdu(
LOG_D(MAC,"[UE] CE %d : UE Timing Advance : %d\n",i,payload_ptr[0]); LOG_D(MAC,"[UE] CE %d : UE Timing Advance : %d\n",i,payload_ptr[0]);
#endif #endif
// Panos: Eliminate call to process_timing_advance for the phy_stub UE operation mode. Is this correct? // Panos: Eliminate call to process_timing_advance for the phy_stub UE operation mode. Is this correct?
//process_timing_advance(module_idP,CC_id,payload_ptr[0]); if (nfapi_mode!=3)
{
process_timing_advance(module_idP,CC_id,payload_ptr[0]);
}
payload_ptr++; payload_ptr++;
break; break;
...@@ -1596,9 +1610,14 @@ for (lcid=DCCH; (lcid < MAX_NUM_LCID) && (is_all_lcid_processed == FALSE) ; lcid ...@@ -1596,9 +1610,14 @@ for (lcid=DCCH; (lcid < MAX_NUM_LCID) && (is_all_lcid_processed == FALSE) ; lcid
// build PHR and update the timers // build PHR and update the timers
if (phr_ce_len == sizeof(POWER_HEADROOM_CMD)) { if (phr_ce_len == sizeof(POWER_HEADROOM_CMD)) {
if (nfapi_mode == 3){ //phy_stub mode
//Panos: Substitute with a static value for the MAC layer abstraction (phy_stub mode) //Panos: Substitute with a static value for the MAC layer abstraction (phy_stub mode)
//phr_p->PH = get_phr_mapping(module_idP,CC_id,eNB_index);
phr_p->PH = 40; phr_p->PH = 40;
}
else { // Full stack mode
phr_p->PH = get_phr_mapping(module_idP,CC_id,eNB_index);
}
phr_p->R = 0; phr_p->R = 0;
LOG_D(MAC,"[UE %d] Frame %d report PHR with mapping (%d->%d) for LCID %d\n", LOG_D(MAC,"[UE %d] Frame %d report PHR with mapping (%d->%d) for LCID %d\n",
module_idP,frameP, get_PHR(module_idP,CC_id,eNB_index), phr_p->PH,POWER_HEADROOM); module_idP,frameP, get_PHR(module_idP,CC_id,eNB_index), phr_p->PH,POWER_HEADROOM);
......
...@@ -717,6 +717,7 @@ int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req) ...@@ -717,6 +717,7 @@ int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req)
handle_nfapi_ul_pdu_UE_MAC(Mod_id,&ul_config_pdu_list[i],sfn,sf,req->ul_config_request_body.srs_present); handle_nfapi_ul_pdu_UE_MAC(Mod_id,&ul_config_pdu_list[i],sfn,sf,req->ul_config_request_body.srs_present);
free(UL_INFO);
} }
else else
{ {
......
...@@ -116,6 +116,7 @@ static pthread_t forms_thread; //xforms ...@@ -116,6 +116,7 @@ static pthread_t forms_thread; //xforms
pthread_cond_t sync_cond; pthread_cond_t sync_cond;
pthread_mutex_t sync_mutex; pthread_mutex_t sync_mutex;
int sync_var=-1; //!< protected by mutex \ref sync_mutex. int sync_var=-1; //!< protected by mutex \ref sync_mutex.
uint8_t nfapi_mode = 0;
uint16_t runtime_phy_rx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100] uint16_t runtime_phy_rx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100]
uint16_t runtime_phy_tx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100] uint16_t runtime_phy_tx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100]
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
#include "T.h" #include "T.h"
extern double cpuf; extern double cpuf;
extern uint8_t nfapi_mode;
#define FRAME_PERIOD 100000000ULL #define FRAME_PERIOD 100000000ULL
#define DAQ_PERIOD 66667ULL #define DAQ_PERIOD 66667ULL
...@@ -642,14 +643,17 @@ static void *UE_thread_rxn_txnp4(void *arg) { ...@@ -642,14 +643,17 @@ static void *UE_thread_rxn_txnp4(void *arg) {
// UE Rx procedures directly at the MAC layer, based on the received nfapi requests from the vnf (eNB). // UE Rx procedures directly at the MAC layer, based on the received nfapi requests from the vnf (eNB).
// Hardcode Mod_id for now. Will be changed later. // Hardcode Mod_id for now. Will be changed later.
if(nfapi_mode == 3){
if(UE_mac_inst[Mod_id].tx_req) if(UE_mac_inst[Mod_id].tx_req)
tx_req_UE_MAC(UE_mac_inst[Mod_id].tx_req); tx_req_UE_MAC(UE_mac_inst[Mod_id].tx_req);
if(UE_mac_inst[Mod_id].dl_config_req) if(UE_mac_inst[Mod_id].dl_config_req)
dl_config_req_UE_MAC(UE_mac_inst[Mod_id].dl_config_req); dl_config_req_UE_MAC(UE_mac_inst[Mod_id].dl_config_req);
if(UE_mac_inst[Mod_id].hi_dci0_req) if(UE_mac_inst[Mod_id].hi_dci0_req)
hi_dci0_req_UE_MAC(UE_mac_inst[Mod_id].hi_dci0_req); hi_dci0_req_UE_MAC(UE_mac_inst[Mod_id].hi_dci0_req);
}
//phy_procedures_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL ); else{
phy_procedures_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
}
#endif #endif
} }
...@@ -698,11 +702,13 @@ static void *UE_thread_rxn_txnp4(void *arg) { ...@@ -698,11 +702,13 @@ static void *UE_thread_rxn_txnp4(void *arg) {
// Panos: Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger // Panos: Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger
// UE Tx procedures directly at the MAC layer, based on the received ul_config requests from the vnf (eNB). // UE Tx procedures directly at the MAC layer, based on the received ul_config requests from the vnf (eNB).
// Generate UL_indications which corresponf to UL traffic. // Generate UL_indications which corresponf to UL traffic.
if(UE_mac_inst[Mod_id].ul_config_req){ if(nfapi_mode == 3 && UE_mac_inst[Mod_id].ul_config_req){
ul_config_req_UE_MAC(UE_mac_inst[Mod_id].ul_config_req); ul_config_req_UE_MAC(UE_mac_inst[Mod_id].ul_config_req);
UL_indication(UL_INFO); UL_indication(UL_INFO);
} }
//phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay); else{
phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay);
}
} }
......
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