Commit 1254fe7a authored by laurent's avatar laurent

fix buld ocp enb after merge, some minor enhancements

parent 05f052cc
...@@ -814,6 +814,7 @@ static inline unsigned long long int vcd_get_time(void) ...@@ -814,6 +814,7 @@ static inline unsigned long long int vcd_get_time(void)
return (long long unsigned int)((time.tv_nsec - g_time_start.tv_nsec)) + return (long long unsigned int)((time.tv_nsec - g_time_start.tv_nsec)) +
((long long unsigned int)time.tv_sec - (long long unsigned int)g_time_start.tv_sec) * 1000000000UL; ((long long unsigned int)time.tv_sec - (long long unsigned int)g_time_start.tv_sec) * 1000000000UL;
#endif #endif
return 0;
} }
void vcd_signal_dumper_create_header(void) void vcd_signal_dumper_create_header(void)
......
...@@ -1348,7 +1348,7 @@ int main ( int argc, char **argv ) { ...@@ -1348,7 +1348,7 @@ int main ( int argc, char **argv ) {
// end of CI modifications // end of CI modifications
//getchar(); //getchar();
if(IS_SOFTMODEM_DOFORMS) if(IS_SOFTMODEM_DOFORMS)
load_softscope("enb"); load_softscope("enb",NULL);
itti_wait_tasks_end(); itti_wait_tasks_end();
oai_exit=1; oai_exit=1;
......
...@@ -2242,16 +2242,13 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, ...@@ -2242,16 +2242,13 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
MIMO_mode_t mimo_mode = -1; MIMO_mode_t mimo_mode = -1;
uint8_t mprime=0,Ns; uint8_t mprime=0,Ns;
int8_t lprime=-1; int8_t lprime=-1;
int aa=0;
#ifdef DEBUG_DLSCH_MODULATION #ifdef DEBUG_DLSCH_MODULATION
uint8_t Nl0; //= dlsch0_harq->Nl; uint8_t Nl0; //= dlsch0_harq->Nl;
uint8_t Nl1; uint8_t Nl1;
#endif #endif
int ru_id;
RU_t *ru; RU_t *ru;
int eNB_id;
if ((dlsch0 != NULL) && (dlsch1 != NULL)){ if ((dlsch0 != NULL) && (dlsch1 != NULL)){
...@@ -2432,11 +2429,11 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, ...@@ -2432,11 +2429,11 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
} }
// mapping ue specific beamforming weights from UE specified DLSCH structure to RU beam weights for the eNB // mapping ue specific beamforming weights from UE specified DLSCH structure to RU beam weights for the eNB
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) { for (int ru_id=0;ru_id<RC.nb_RU;ru_id++) {
ru = RC.ru[ru_id]; ru = RC.ru[ru_id];
for (eNB_id=0;eNB_id<ru->num_eNB;eNB_id++){ for (int eNB_id=0;eNB_id<ru->num_eNB;eNB_id++){
if (phy_vars_eNB == ru->eNB_list[eNB_id]) { if (phy_vars_eNB == ru->eNB_list[eNB_id]) {
for (aa=0;aa<ru->nb_tx;aa++){ for (int aa=0;aa<ru->nb_tx;aa++){
LOG_I(PHY,"ru_id:%d eNB_id:%d aa:%d memcpy(ru->beam_weights, dlsch0->ue_spec_bf_weights[ru_id][0],)\n", ru_id, eNB_id, aa); LOG_I(PHY,"ru_id:%d eNB_id:%d aa:%d memcpy(ru->beam_weights, dlsch0->ue_spec_bf_weights[ru_id][0],)\n", ru_id, eNB_id, aa);
memcpy(ru->beam_weights[eNB_id][5][aa], memcpy(ru->beam_weights[eNB_id][5][aa],
dlsch0->ue_spec_bf_weights[ru_id][0], dlsch0->ue_spec_bf_weights[ru_id][0],
......
...@@ -377,7 +377,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -377,7 +377,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols!=0) if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols!=0)
nr_ulmix_slots++; nr_ulmix_slots++;
if (slot_txP== 0 && (UE_list->fiveG_connected[UE_id] || get_softmodem_params()->phy_test)) { if (slot_txP== 0 && (UE_list->UEcontext[UE_id].fiveG_connected || get_softmodem_params()->phy_test)) {
for (int k=0; k<nr_ulmix_slots; k++) { for (int k=0; k<nr_ulmix_slots; k++) {
memset((void *) &UE_list->UE_sched_ctrl[UE_id].sched_pucch[k], memset((void *) &UE_list->UE_sched_ctrl[UE_id].sched_pucch[k],
0, 0,
...@@ -449,7 +449,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -449,7 +449,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
if (get_softmodem_params()->phy_test == 0) if (get_softmodem_params()->phy_test == 0)
nr_schedule_RA(module_idP, frame_txP, slot_txP); nr_schedule_RA(module_idP, frame_txP, slot_txP);
else else
UE_list->fiveG_connected[UE_id] = true; UE_list->UEcontext[UE_id].fiveG_connected = true;
// Phytest scheduling // Phytest scheduling
...@@ -471,7 +471,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -471,7 +471,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
} }
} }
if (UE_list->fiveG_connected[UE_id] && (is_xlsch_in_slot(*dlsch_in_slot_bitmap,slot_txP%num_slots_per_tdd))) { if (UE_list->UEcontext[UE_id].fiveG_connected && (is_xlsch_in_slot(*dlsch_in_slot_bitmap,slot_txP%num_slots_per_tdd))) {
ue_sched_ctl->current_harq_pid = slot_txP % num_slots_per_tdd; ue_sched_ctl->current_harq_pid = slot_txP % num_slots_per_tdd;
nr_update_pucch_scheduling(module_idP, UE_id, frame_txP, slot_txP, num_slots_per_tdd,&pucch_sched); nr_update_pucch_scheduling(module_idP, UE_id, frame_txP, slot_txP, num_slots_per_tdd,&pucch_sched);
nr_schedule_uss_dlsch_phytest(module_idP, frame_txP, slot_txP, &UE_list->UE_sched_ctrl[UE_id].sched_pucch[pucch_sched], NULL); nr_schedule_uss_dlsch_phytest(module_idP, frame_txP, slot_txP, &UE_list->UE_sched_ctrl[UE_id].sched_pucch[pucch_sched], NULL);
...@@ -490,7 +490,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -490,7 +490,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
if (is_nr_UL_slot(cc->ServingCellConfigCommon,slot_rxP)) { if (is_nr_UL_slot(cc->ServingCellConfigCommon,slot_rxP)) {
if (get_softmodem_params()->phy_test == 0) { if (get_softmodem_params()->phy_test == 0) {
if (UE_list->fiveG_connected[UE_id]) if (UE_list->UEcontext[UE_id].fiveG_connected)
nr_schedule_pucch(module_idP, UE_id, frame_rxP, slot_rxP); nr_schedule_pucch(module_idP, UE_id, frame_rxP, slot_rxP);
schedule_nr_prach(module_idP, (frame_rxP+1)&1023, slot_rxP); schedule_nr_prach(module_idP, (frame_rxP+1)&1023, slot_rxP);
nr_schedule_reception_msg3(module_idP, 0, frame_rxP, slot_rxP); nr_schedule_reception_msg3(module_idP, 0, frame_rxP, slot_rxP);
......
...@@ -268,7 +268,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -268,7 +268,7 @@ void nr_initiate_ra_proc(module_id_t module_idP,
} }
} }
if (pr_found) if (pr_found)
UE_list->fiveG_connected[UE_id] = false; UE_list->UEcontext[UE_id].fiveG_connected = false;
else { else {
LOG_E(MAC, "[gNB %d][RAPROC] FAILURE: preamble %d does not correspond to any of the ones in rach_ConfigDedicated for UE_id %d\n", LOG_E(MAC, "[gNB %d][RAPROC] FAILURE: preamble %d does not correspond to any of the ones in rach_ConfigDedicated for UE_id %d\n",
module_idP, preamble_index, UE_id); module_idP, preamble_index, UE_id);
......
...@@ -141,4 +141,10 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){ ...@@ -141,4 +141,10 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){
} }
} }
void
schedule_nr_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
//------------------------------------------------------------------------------
{
}
...@@ -313,7 +313,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -313,7 +313,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if (UE_list->active[i] == TRUE) { if (UE_list->active[i] == TRUE) {
if (UE_list->tc_rnti[i] == current_rnti) { if (UE_list->tc_rnti[i] == current_rnti) {
// for now the only thing we are doing is set the UE as 5G connected // for now the only thing we are doing is set the UE as 5G connected
UE_list->fiveG_connected[i] = true; UE_list->UEcontext[i].fiveG_connected = true;
LOG_I(MAC, "[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly and UE_id %d is now 5G connected\n", LOG_I(MAC, "[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly and UE_id %d is now 5G connected\n",
gnb_mod_idP, current_rnti, i); gnb_mod_idP, current_rnti, i);
} }
......
...@@ -278,6 +278,10 @@ typedef struct NR_preamble_ue { ...@@ -278,6 +278,10 @@ typedef struct NR_preamble_ue {
uint8_t *preamble_list; uint8_t *preamble_list;
} NR_preamble_ue; } NR_preamble_ue;
typedef struct {
boolean_t fiveG_connected;
} NRUEcontext_t;
/*! \brief UE list used by gNB to order UEs/CC for scheduling*/ /*! \brief UE list used by gNB to order UEs/CC for scheduling*/
typedef struct { typedef struct {
DLSCH_PDU DLSCH_pdu[4][MAX_MOBILES_PER_GNB]; DLSCH_PDU DLSCH_pdu[4][MAX_MOBILES_PER_GNB];
...@@ -290,7 +294,7 @@ typedef struct { ...@@ -290,7 +294,7 @@ typedef struct {
int avail; int avail;
int num_UEs; int num_UEs;
boolean_t active[MAX_MOBILES_PER_GNB]; boolean_t active[MAX_MOBILES_PER_GNB];
boolean_t fiveG_connected[MAX_MOBILES_PER_GNB]; NRUEcontext_t UEcontext[MAX_MOBILES_PER_GNB];
rnti_t rnti[MAX_MOBILES_PER_GNB]; rnti_t rnti[MAX_MOBILES_PER_GNB];
rnti_t tc_rnti[MAX_MOBILES_PER_GNB]; rnti_t tc_rnti[MAX_MOBILES_PER_GNB];
NR_preamble_ue preambles[MAX_MOBILES_PER_GNB]; NR_preamble_ue preambles[MAX_MOBILES_PER_GNB];
......
...@@ -88,6 +88,12 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP, ...@@ -88,6 +88,12 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
} }
/* TODO BCCH SIB1 SIBs */ /* TODO BCCH SIB1 SIBs */
if ((Srb_id & RAB_OFFSET ) == BCCH) {
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB1_MBMS,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_MBMS);
}
/* CCCH */ /* CCCH */
if( (Srb_id & RAB_OFFSET ) == CCCH) { if( (Srb_id & RAB_OFFSET ) == CCCH) {
...@@ -114,4 +120,4 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP, ...@@ -114,4 +120,4 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
return(0); return(0);
} }
\ No newline at end of file
...@@ -340,11 +340,12 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, ...@@ -340,11 +340,12 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
ASN_SEQUENCE_ADD(&sib1->uac_BarringInfo->uac_BarringInfoSetList, &nr_uac_BarringInfoSet); ASN_SEQUENCE_ADD(&sib1->uac_BarringInfo->uac_BarringInfoSetList, &nr_uac_BarringInfoSet);
#endif #endif
//encode SIB1 to data //encode SIB1 to data
carrier->SIB1=(uint8_t *) malloc16(128);
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_BCCH_DL_SCH_Message, enc_rval = uper_encode_to_buffer(&asn_DEF_NR_BCCH_DL_SCH_Message,
NULL, NULL,
(void *)sib1_message, (void *)sib1_message,
carrier->SIB1, carrier->SIB1,
100); 128);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded); enc_rval.failed_type->name, enc_rval.encoded);
......
...@@ -178,10 +178,11 @@ void rrc_gNB_generate_SgNBAdditionRequestAcknowledge( ...@@ -178,10 +178,11 @@ void rrc_gNB_generate_SgNBAdditionRequestAcknowledge(
///---------------------------------------------------------------------------------------------------------------/// ///---------------------------------------------------------------------------------------------------------------///
///---------------------------------------------------------------------------------------------------------------/// ///---------------------------------------------------------------------------------------------------------------///
static void init_NR_SI(gNB_RRC_INST *rrc) { static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration) {
LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__); LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__);
rrc->carrier.MIB = (uint8_t *) malloc16(4); rrc->carrier.MIB = (uint8_t *) malloc16(4);
rrc->carrier.sizeof_MIB = do_MIB_NR(rrc,0); rrc->carrier.sizeof_MIB = do_MIB_NR(rrc,0);
rrc->carrier.sizeof_SIB1 = do_SIB1_NR(&rrc->carrier,configuration);
LOG_I(NR_RRC,"Done init_NR_SI\n"); LOG_I(NR_RRC,"Done init_NR_SI\n");
rrc_mac_config_req_gNB(rrc->module_id, rrc_mac_config_req_gNB(rrc->module_id,
rrc->carrier.ssb_SubcarrierOffset, rrc->carrier.ssb_SubcarrierOffset,
...@@ -267,7 +268,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu ...@@ -267,7 +268,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts; rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts;
/// System Information INIT /// System Information INIT
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" Checking release \n",PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt)); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" Checking release \n",PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt));
init_NR_SI(rrc); init_NR_SI(rrc, configuration);
rrc_init_nr_global_param(); rrc_init_nr_global_param();
openair_nr_rrc_on(&ctxt); openair_nr_rrc_on(&ctxt);
return 0; return 0;
......
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