Commit bb21c02d authored by David Kim's avatar David Kim

updated for CI debug in nrUE side.

parent 7b619c54
......@@ -560,6 +560,7 @@ void processSlotTX(void *arg) {
ul_indication.thread_id = proc->thread_id;
ul_indication.ue_sched_mode = rxtxD->ue_sched_mode;
LOG_I(PHY,"We are here to call ul_indication\n");
UE->if_inst->ul_indication(&ul_indication);
}
......@@ -621,6 +622,7 @@ void processSlotRX(void *arg) {
} else {
rxtxD->ue_sched_mode = SCHED_ALL;
LOG_I(PHY, "We are calling processSlotTX in processSlotRX \n");
processSlotTX(rxtxD);
}
......@@ -639,6 +641,7 @@ void processSlotRX(void *arg) {
}
if (UE->UE_mode[gNB_id] > NOT_SYNCHED && UE->UE_mode[gNB_id] < PUSCH) {
LOG_I(PHY, "We are calling nr_ue_prach_procedures in processSlotRX\n");
nr_ue_prach_procedures(UE, proc, gNB_id);
}
LOG_D(PHY,"****** end TX-Chain for AbsSubframe %d.%d ******\n", proc->frame_tx, proc->nr_slot_tx);
......
......@@ -2079,11 +2079,13 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
prach_resources->init_msg1 = 1;
} else {
nr_prach = nr_ue_get_rach(prach_resources, &ue->prach_vars[0]->prach_pdu, mod_id, ue->CC_id, frame_tx, gNB_id, nr_slot_tx);
LOG_D(PHY, "In %s:[%d.%d] getting PRACH resources : %d\n", __FUNCTION__, frame_tx, nr_slot_tx,nr_prach);
}
if (nr_prach > 0)
LOG_I(PHY, "In %s: We are here with nr_prach = %u (GENERATE_PREAMBLE: 1)\n", __FUNCTION__, nr_prach);
if (nr_prach == GENERATE_PREAMBLE) {
if (ue->mac_enabled == 1) {
......@@ -2115,7 +2117,9 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_IN);
LOG_I(PHY, "In %s: We are here to call generate_nr_prach \n", __FUNCTION__);
prach_power = generate_nr_prach(ue, gNB_id, nr_slot_tx);
LOG_I(PHY, "In %s: We are here after calling generate_nr_prach \n", __FUNCTION__);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_OUT);
......@@ -2128,8 +2132,10 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
dB_fixed(prach_power),
ue->prach_vars[gNB_id]->amp);
if (ue->mac_enabled == 1)
if (ue->mac_enabled == 1){
nr_Msg1_transmitted(mod_id, ue->CC_id, frame_tx, gNB_id);
LOG_I(PHY, "In %s: We are here after nr_Msg1_transmitted\n", __FUNCTION__);
}
} else if (nr_prach == WAIT_CONTENTION_RESOLUTION) {
LOG_D(PHY, "In %s: [UE %d] RA waiting contention resolution\n", __FUNCTION__, mod_id);
......
......@@ -928,6 +928,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
AssertFatal(TBS_max > ra->Msg3_size, "In %s: allocated resources are not enough for Msg3!\n", __FUNCTION__);
// Init RA procedure
LOG_I(NR_MAC, " We are here in nr_ue_get_rach: prach_format %d\n", prach_pdu->prach_format);
init_RA(mod_id, prach_resources, setup, rach_ConfigGeneric, rach_ConfigDedicated);
nr_get_RA_window(mac);
// Fill in preamble and PRACH resources
......
......@@ -565,6 +565,8 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in
def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format];
}
int8_t ret_proc = nr_ue_process_dci(module_id, cc_id, gNB_index, frame, slot, def_dci_pdu_rel15, dci);
if (!get_softmodem_params()->nsa)
memset(def_dci_pdu_rel15, 0, sizeof(dci_pdu_rel15_t));
return ret_proc;
}
......@@ -684,9 +686,11 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
LOG_W(MAC, "In %s: ul_config request is NULL. Probably due to unexpected UL DCI in frame.slot %d.%d. Ignoring DCI!\n", __FUNCTION__, frame, slot);
return -1;
}
if (get_softmodem_params()->nsa) {
ul_config->number_pdus = 0;
AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]),
"Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus);
}
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pusch_config_pdu;
fill_ul_config(ul_config, frame_tx, slot_tx, FAPI_NR_UL_CONFIG_TYPE_PUSCH);
......
......@@ -161,7 +161,7 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl
num_slots_ul,
index);
if(!mac->ul_config_request)
if(!mac->ul_config_request && get_softmodem_params()->nsa)
return NULL;
return &mac->ul_config_request[index];
}
......@@ -896,6 +896,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
dcireq.slot = rx_slot;
dcireq.dl_config_req.number_pdus = 0;
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
if (get_softmodem_params()->nsa)
mac->dl_config_request = dcireq.dl_config_req;
fill_scheduled_response(&scheduled_response, &dcireq.dl_config_req, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->thread_id);
......@@ -945,6 +946,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
uint8_t ulsch_input_buffer[MAX_ULSCH_PAYLOAD_BYTES];
nr_scheduled_response_t scheduled_response;
fapi_nr_tx_request_t tx_req;
if (get_softmodem_params()->nsa)
memset(&tx_req, 0, sizeof(tx_req));
for (int j = 0; j < ul_config->number_pdus; j++) {
......@@ -1853,11 +1855,18 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
RA_config_t *ra = &mac->ra;
fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP);
fapi_nr_ul_config_request_t *ul_config;
if (get_softmodem_params()->nsa) {
ul_config = get_ul_config_request(mac, slotP);
if (!ul_config) {
LOG_E(NR_MAC, "mac->ul_config is null! \n");
return;
}
}
else {
ul_config = &mac->ul_config_request[0];
}
LOG_I(NR_MAC, "We are here to check calling nr_ue_prach_scheduler\n");
fapi_nr_ul_config_prach_pdu *prach_config_pdu;
fapi_nr_config_request_t *cfg = &mac->phy_config.config_req;
......@@ -1888,6 +1897,8 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
&prach_occasion_info_p);
if (is_nr_prach_slot && ra->ra_state == RA_UE_IDLE) {
LOG_I(NR_MAC, "We are here to see is_nr_prach_slot = %d, ra->ra_state = %d (RA_UE_IDLE: 0)\n",
is_nr_prach_slot, ra->ra_state);
AssertFatal(NULL != prach_occasion_info_p,"PRACH Occasion Info not returned in a valid NR Prach Slot\n");
ra->generate_nr_prach = GENERATE_PREAMBLE;
......@@ -1895,12 +1906,14 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
format = prach_occasion_info_p->format;
format0 = format & 0xff; // single PRACH format
format1 = (format >> 8) & 0xff; // dual PRACH format
LOG_D(NR_MAC,"We are here with format %u, %s %d\n", format, __FUNCTION__, __LINE__);
LOG_I(NR_MAC,"We are here with format0 %u, format1 %u, %s %d\n",
format0, format1, __FUNCTION__, __LINE__);
AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]),
"Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus);
prach_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu;
memset(prach_config_pdu, 0, sizeof(fapi_nr_ul_config_prach_pdu));
if (get_softmodem_params()->nsa)
ul_config->number_pdus += 1;
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PRACH);
......@@ -1919,7 +1932,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
prach_config_pdu->restricted_set = prach_config->restricted_set_config;
prach_config_pdu->freq_msg1 = prach_config->num_prach_fd_occasions_list[prach_occasion_info_p->fdm].k1;
LOG_D(NR_MAC,"Selected RO Frame %u, Slot %u, Symbol %u, Fdm %u\n", frameP, prach_config_pdu->prach_slot, prach_config_pdu->prach_start_symbol, prach_config_pdu->num_ra);
LOG_I(NR_MAC,"Selected RO Frame %u, Slot %u, Symbol %u, Fdm %u\n", frameP, prach_config_pdu->prach_slot, prach_config_pdu->prach_start_symbol, prach_config_pdu->num_ra);
// Search which SSB is mapped in the RO (among all the SSBs mapped to this RO)
for (prach_config_pdu->ssb_nb_in_ro=0; prach_config_pdu->ssb_nb_in_ro<prach_occasion_info_p->nb_mapped_ssb; prach_config_pdu->ssb_nb_in_ro++) {
......@@ -1927,7 +1940,8 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
break;
}
AssertFatal(prach_config_pdu->ssb_nb_in_ro<prach_occasion_info_p->nb_mapped_ssb, "%u not found in the mapped SSBs to the PRACH occasion", selected_gnb_ssb_idx);
LOG_I(NR_MAC,"We are here Before set prach_config_pdu->prach_format %x, %s %d\n",
prach_config_pdu->prach_format, __FUNCTION__, __LINE__);
if (format1 != 0xff) {
switch(format0) { // dual PRACH format
case 0xa1:
......@@ -1981,11 +1995,18 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
AssertFatal(1 == 0, "Invalid PRACH format");
}
} // if format1
LOG_I(NR_MAC,"We are here After set prach_config_pdu->prach_format %x, %s %d\n",
prach_config_pdu->prach_format, __FUNCTION__, __LINE__);
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id);
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
mac->if_module->scheduled_response(&scheduled_response);
} // is_nr_prach_slot
else
LOG_I(NR_MAC, "We are here to see is_nr_prach_slot = %d, ra->ra_state = %d (RA_UE_IDLE: 0)\n",
is_nr_prach_slot, ra->ra_state);
} // if is_nr_UL_slot
else
LOG_I(NR_MAC, "We are here It is not is_nr_UL_slot\n");
}
// This function schedules the reception of SIB1 after initial sync and before going to real time state
......
......@@ -844,6 +844,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
if (ul_info->ue_sched_mode == ONLY_PUSCH) {
ret = nr_ue_scheduler(NULL, ul_info);
LOG_I(NR_MAC, "In nr_ue_ul_indication: We are to return due to ul_info->ue_sched_mode == ONLY_PUSCH\n");
return 0;
}
if (ul_info->ue_sched_mode == SCHED_ALL) {
......@@ -856,7 +857,10 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon = mac->scc != NULL ? mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon;
if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->phy_test)
{
LOG_I(NR_MAC, "In nr_ue_ul_indication: We are here to call nr_ue_prach_scheduler \n");
nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id);
}
if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type))
nr_ue_pucch_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id);
......
......@@ -1033,7 +1033,7 @@ void fill_initial_SpCellConfig(rnti_t rnti,
// one symbol (13)
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
pucchres0->pucch_ResourceId=0;
pucchres0->startingPRB=(8+rnti) % curr_bwp;
pucchres0->startingPRB=0;//(8+rnti) % curr_bwp;
LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp);
pucchres0->intraSlotFrequencyHopping=NULL;
pucchres0->secondHopPRB=NULL;
......
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