completing merge
This commit is contained in:
+61
-59
@@ -352,32 +352,30 @@ static void UE_synch(void *arg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||||
|
|
||||||
nr_dcireq_t dcireq;
|
|
||||||
nr_scheduled_response_t scheduled_response;
|
|
||||||
uint32_t nb_rb, start_rb;
|
uint32_t nb_rb, start_rb;
|
||||||
uint8_t nb_symb_sch, start_symbol, mcs, precod_nbr_layers, harq_pid, rvidx;
|
uint8_t nb_symb_sch, start_symbol, mcs, precod_nbr_layers, harq_pid, rvidx;
|
||||||
uint16_t n_rnti;
|
uint16_t n_rnti;
|
||||||
|
|
||||||
// Process Rx data for one sub-frame
|
nr_dcireq_t dcireq;
|
||||||
if (nr_slot_select(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_DOWNLINK_SLOT) {
|
nr_scheduled_response_t scheduled_response;
|
||||||
//TODO: all of this has to be moved to the MAC!!!
|
|
||||||
|
// program PUSCH. this should actually be done by the MAC upon reception of an UL DCI
|
||||||
|
if (proc->nr_tti_tx == NR_UPLINK_SLOT || UE->frame_parms.frame_type == FDD){
|
||||||
|
|
||||||
dcireq.module_id = UE->Mod_id;
|
dcireq.module_id = UE->Mod_id;
|
||||||
dcireq.gNB_index = 0;
|
dcireq.gNB_index = 0;
|
||||||
dcireq.cc_id = 0;
|
dcireq.cc_id = 0;
|
||||||
dcireq.frame = proc->frame_rx;
|
dcireq.frame = proc->frame_rx;
|
||||||
dcireq.slot = proc->nr_tti_rx;
|
dcireq.slot = proc->nr_tti_rx;
|
||||||
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
|
|
||||||
|
|
||||||
scheduled_response.dl_config = &dcireq.dl_config_req;
|
scheduled_response.dl_config = NULL;
|
||||||
scheduled_response.ul_config = &dcireq.ul_config_req;
|
scheduled_response.ul_config = &dcireq.ul_config_req;
|
||||||
scheduled_response.tx_request = NULL;
|
scheduled_response.tx_request = NULL;
|
||||||
scheduled_response.module_id = UE->Mod_id;
|
scheduled_response.module_id = UE->Mod_id;
|
||||||
scheduled_response.CC_id = 0;
|
scheduled_response.CC_id = 0;
|
||||||
scheduled_response.frame = proc->frame_rx;
|
scheduled_response.frame = proc->frame_rx;
|
||||||
scheduled_response.slot = proc->nr_tti_rx;
|
scheduled_response.slot = proc->nr_tti_rx;
|
||||||
|
|
||||||
//--------------------------Temporary configuration-----------------------------//
|
//--------------------------Temporary configuration-----------------------------//
|
||||||
n_rnti = 0x1234;
|
n_rnti = 0x1234;
|
||||||
nb_rb = 50;
|
nb_rb = 50;
|
||||||
@@ -388,7 +386,7 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
|||||||
mcs = 9;
|
mcs = 9;
|
||||||
harq_pid = 0;
|
harq_pid = 0;
|
||||||
rvidx = 0;
|
rvidx = 0;
|
||||||
//------------------------------------------------------------------------------//
|
//------------------------------------------------------------------------------//
|
||||||
|
|
||||||
scheduled_response.ul_config->sfn_slot = NR_UPLINK_SLOT;
|
scheduled_response.ul_config->sfn_slot = NR_UPLINK_SLOT;
|
||||||
scheduled_response.ul_config->number_pdus = 1;
|
scheduled_response.ul_config->number_pdus = 1;
|
||||||
@@ -403,8 +401,45 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
|||||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = rvidx;
|
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = rvidx;
|
||||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.n_layers = precod_nbr_layers;
|
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.n_layers = precod_nbr_layers;
|
||||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.harq_process_nbr = harq_pid;
|
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.harq_process_nbr = harq_pid;
|
||||||
|
|
||||||
nr_ue_scheduled_response(&scheduled_response);
|
nr_ue_scheduled_response(&scheduled_response);
|
||||||
|
|
||||||
|
if (UE->mode != loop_through_memory) {
|
||||||
|
uint8_t thread_id = PHY_vars_UE_g[UE->Mod_id][0]->current_thread_id[proc->nr_tti_tx];
|
||||||
|
phy_procedures_nrUE_TX(UE,proc,0,thread_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||||
|
|
||||||
|
nr_dcireq_t dcireq;
|
||||||
|
nr_scheduled_response_t scheduled_response;
|
||||||
|
|
||||||
|
//program DCI for slot 1
|
||||||
|
//TODO: all of this has to be moved to the MAC!!!
|
||||||
|
if (proc->nr_tti_tx == NR_DOWNLINK_SLOT || UE->frame_parms.frame_type == FDD){
|
||||||
|
dcireq.module_id = UE->Mod_id;
|
||||||
|
dcireq.gNB_index = 0;
|
||||||
|
dcireq.cc_id = 0;
|
||||||
|
dcireq.frame = proc->frame_rx;
|
||||||
|
dcireq.slot = proc->nr_tti_rx;
|
||||||
|
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
|
||||||
|
|
||||||
|
// we should have received a DL DCI here, so configure DL accordingly
|
||||||
|
scheduled_response.dl_config = &dcireq.dl_config_req;
|
||||||
|
scheduled_response.ul_config = NULL;
|
||||||
|
scheduled_response.tx_request = NULL;
|
||||||
|
scheduled_response.module_id = UE->Mod_id;
|
||||||
|
scheduled_response.CC_id = 0;
|
||||||
|
scheduled_response.frame = proc->frame_rx;
|
||||||
|
scheduled_response.slot = proc->nr_tti_rx;
|
||||||
|
|
||||||
|
nr_ue_scheduled_response(&scheduled_response);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process Rx data for one sub-frame
|
||||||
|
if ( proc->nr_tti_rx >=0 && proc->nr_tti_rx <= 1 ) {
|
||||||
#ifdef UE_SLOT_PARALLELISATION
|
#ifdef UE_SLOT_PARALLELISATION
|
||||||
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
|
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
|
||||||
#else
|
#else
|
||||||
@@ -413,15 +448,15 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
|||||||
LOG_D(PHY,"phy_procedures_nrUE_RX: slot:%d, time %lu\n", proc->nr_tti_rx, (rdtsc()-a)/3500);
|
LOG_D(PHY,"phy_procedures_nrUE_RX: slot:%d, time %lu\n", proc->nr_tti_rx, (rdtsc()-a)/3500);
|
||||||
//printf(">>> nr_ue_pdcch_procedures ended\n");
|
//printf(">>> nr_ue_pdcch_procedures ended\n");
|
||||||
#endif
|
#endif
|
||||||
if(IS_SOFTMODEM_NOS1){ //&& proc->nr_tti_rx==1
|
if(IS_SOFTMODEM_NOS1){ //&& proc->nr_tti_rx==1
|
||||||
//Hardcoded rnti value
|
//Hardcoded rnti value
|
||||||
protocol_ctxt_t ctxt;
|
protocol_ctxt_t ctxt;
|
||||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO,
|
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO,
|
||||||
0x1234, proc->frame_rx,
|
0x1234, proc->frame_rx,
|
||||||
proc->nr_tti_rx, 0);
|
proc->nr_tti_rx, 0);
|
||||||
pdcp_run(&ctxt);
|
pdcp_run(&ctxt);
|
||||||
pdcp_fifo_flush_sdus(&ctxt);
|
pdcp_fifo_flush_sdus(&ctxt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -456,45 +491,14 @@ typedef struct processingData_s {
|
|||||||
} processingData_t;
|
} processingData_t;
|
||||||
|
|
||||||
void UE_processing(void *arg) {
|
void UE_processing(void *arg) {
|
||||||
uint8_t thread_id;
|
|
||||||
processingData_t *rxtxD=(processingData_t *) arg;
|
processingData_t *rxtxD=(processingData_t *) arg;
|
||||||
UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
|
UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
|
||||||
PHY_VARS_NR_UE *UE = rxtxD->UE;
|
PHY_VARS_NR_UE *UE = rxtxD->UE;
|
||||||
|
|
||||||
processSlotRX(UE, proc);
|
processSlotRX(UE, proc);
|
||||||
//printf(">>> mac ended\n");
|
|
||||||
// Prepare the future Tx data
|
|
||||||
/*
|
|
||||||
#ifndef NO_RAT_NR
|
|
||||||
|
|
||||||
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_UPLINK_SLOT)
|
processSlotTX(UE, proc);
|
||||||
#else
|
|
||||||
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
|
|
||||||
(UE->frame_parms.frame_type == FDD) )
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
if (proc->nr_tti_tx == NR_UPLINK_SLOT || UE->frame_parms.frame_type == FDD){
|
|
||||||
|
|
||||||
thread_id = PHY_vars_UE_g[UE->Mod_id][0]->current_thread_id[proc->nr_tti_tx];
|
|
||||||
|
|
||||||
|
|
||||||
if (UE->mode != loop_through_memory)
|
|
||||||
phy_procedures_nrUE_TX(UE,proc,0,thread_id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay);
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_S) &&
|
|
||||||
(UE->frame_parms.frame_type == TDD))
|
|
||||||
if (UE->mode != loop_through_memory)
|
|
||||||
//phy_procedures_UE_S_TX(UE,0,0,no_relay);
|
|
||||||
updateTimes(current, &t3, 10000, timing_proc_name);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
|
void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
|
||||||
@@ -812,12 +816,12 @@ if (slot_nr==18)
|
|||||||
void init_NR_UE(int nb_inst, char* rrc_config_path) {
|
void init_NR_UE(int nb_inst, char* rrc_config_path) {
|
||||||
int inst;
|
int inst;
|
||||||
NR_UE_MAC_INST_t *mac_inst;
|
NR_UE_MAC_INST_t *mac_inst;
|
||||||
|
NR_UE_RRC_INST_t* rrc_inst;
|
||||||
|
|
||||||
for (inst=0; inst < nb_inst; inst++) {
|
for (inst=0; inst < nb_inst; inst++) {
|
||||||
nr_l3_init_ue(rrc_config_path);
|
AssertFatal((rrc_inst = nr_l3_init_ue(rrc_config_path)) != NULL, "can not initialize RRC module\n");
|
||||||
nr_l2_init_ue();
|
AssertFatal((mac_inst = nr_l2_init_ue(rrc_inst)) != NULL, "can not initialize L2 module\n");
|
||||||
mac_inst = get_mac_inst(inst);
|
AssertFatal((mac_inst->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initialize IF module\n");
|
||||||
AssertFatal((mac_inst->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initial IF module\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -838,6 +842,4 @@ void init_NR_UE_threads(int nb_inst) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("UE threads created by %ld\n", gettid());
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -766,11 +766,14 @@ int main( int argc, char **argv ) {
|
|||||||
#else
|
#else
|
||||||
PHY_vars_UE_g[0][CC_id]->hw_timing_advance = 160;
|
PHY_vars_UE_g[0][CC_id]->hw_timing_advance = 160;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init_NR_UE_threads(1);
|
||||||
|
printf("UE threads created by %ld\n", gettid());
|
||||||
|
|
||||||
// wait for end of program
|
// wait for end of program
|
||||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||||
init_NR_UE_threads(1);
|
|
||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
sleep(3600);
|
sleep(3600);
|
||||||
|
|||||||
Reference in New Issue
Block a user